@pega/angular-sdk-overrides 0.25.15 → 0.26.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/designSystemExtension/alert/alert.component.html +4 -1
- package/lib/designSystemExtension/alert/alert.component.scss +9 -10
- package/lib/designSystemExtension/alert/alert.component.ts +6 -2
- package/lib/designSystemExtension/material-details-fields/material-details-fields.component.html +30 -21
- package/lib/designSystemExtension/operator/operator.component.ts +2 -1
- package/lib/designSystemExtension/rich-text-editor/rich-text-editor.component.html +104 -10
- package/lib/designSystemExtension/rich-text-editor/rich-text-editor.component.scss +141 -1
- package/lib/designSystemExtension/rich-text-editor/rich-text-editor.component.ts +224 -72
- package/lib/field/auto-complete/auto-complete.component.html +2 -1
- package/lib/field/auto-complete/auto-complete.component.ts +2 -0
- package/lib/field/check-box/check-box.component.html +4 -2
- package/lib/field/check-box/check-box.component.ts +10 -1
- package/lib/field/currency/currency.component.html +2 -1
- package/lib/field/currency/currency.component.ts +10 -1
- package/lib/field/date/date.component.html +2 -1
- package/lib/field/date/date.component.ts +2 -0
- package/lib/field/date-time/date-time.component.html +2 -1
- package/lib/field/date-time/date-time.component.scss +46 -40
- package/lib/field/date-time/date-time.component.ts +2 -0
- package/lib/field/decimal/decimal.component.html +2 -1
- package/lib/field/decimal/decimal.component.ts +2 -0
- package/lib/field/dropdown/dropdown.component.html +2 -1
- package/lib/field/dropdown/dropdown.component.ts +10 -1
- package/lib/field/email/email.component.html +2 -1
- package/lib/field/email/email.component.ts +2 -2
- package/lib/field/embedded-data-multi/embedded-data-multi.component.html +3 -0
- package/lib/field/embedded-data-multi/embedded-data-multi.component.scss +0 -0
- package/lib/field/embedded-data-multi/embedded-data-multi.component.ts +173 -0
- package/lib/field/field.base.ts +27 -1
- package/lib/field/integer/integer.component.html +2 -1
- package/lib/field/integer/integer.component.ts +4 -2
- package/lib/field/location/location.component.html +2 -1
- package/lib/field/location/location.component.ts +3 -1
- package/lib/field/multiselect/multiselect.component.html +1 -1
- package/lib/field/multiselect/multiselect.component.ts +22 -3
- package/lib/field/multiselect/utils.ts +5 -3
- package/lib/field/object-reference/object-reference.component.html +30 -15
- package/lib/field/object-reference/object-reference.component.ts +819 -94
- package/lib/field/percentage/percentage.component.html +2 -1
- package/lib/field/percentage/percentage.component.ts +10 -1
- package/lib/field/phone/phone.component.html +2 -1
- package/lib/field/phone/phone.component.ts +2 -1
- package/lib/field/radio-buttons/radio-buttons.component.html +2 -1
- package/lib/field/radio-buttons/radio-buttons.component.ts +10 -1
- package/lib/field/rich-text/rich-text.component.scss +1 -166
- package/lib/field/rich-text/rich-text.component.ts +1 -1
- package/lib/field/selectable-card/selectable-card.component.html +1 -0
- package/lib/field/selectable-card/selectable-card.component.ts +31 -16
- package/lib/field/semantic-link/semantic-link.component.ts +9 -5
- package/lib/field/text-area/text-area.component.html +2 -1
- package/lib/field/text-area/text-area.component.ts +2 -1
- package/lib/field/text-input/text-input.component.html +2 -1
- package/lib/field/text-input/text-input.component.ts +2 -1
- package/lib/field/time/time.component.html +2 -1
- package/lib/field/time/time.component.ts +2 -1
- package/lib/field/url/url.component.html +2 -1
- package/lib/field/url/url.component.ts +2 -1
- package/lib/field/user-reference/user-reference.component.html +4 -2
- package/lib/field/user-reference/user-reference.component.ts +10 -5
- package/lib/infra/Containers/flow-container/flow-container.component.ts +35 -46
- package/lib/infra/Containers/modal-view-container/modal-view-container.component.ts +46 -50
- package/lib/infra/Containers/view-container/view-container.component.ts +32 -31
- package/lib/infra/navbar/navbar.component.ts +33 -35
- package/lib/infra/root-container/root-container.component.ts +33 -38
- package/lib/template/app-shell/app-shell.component.ts +12 -11
- package/lib/template/base/details-template-base.ts +2 -1
- package/lib/template/data-reference/data-reference.component.ts +18 -27
- package/lib/template/data-reference/search-form/search-form.component.ts +7 -1
- package/lib/template/default-form/default-form.component.html +19 -3
- package/lib/template/default-form/default-form.component.ts +13 -3
- package/lib/template/simple-table/simple-table.component.ts +6 -0
- package/lib/template/simple-table-manual/helpers.ts +5 -5
- package/lib/template/simple-table-manual/simple-table-manual.component.html +29 -11
- package/lib/template/simple-table-manual/simple-table-manual.component.scss +4 -2
- package/lib/template/simple-table-manual/simple-table-manual.component.ts +82 -24
- package/lib/template/single-reference-readonly/single-reference-readonly.component.html +1 -1
- package/lib/template/single-reference-readonly/single-reference-readonly.component.scss +4 -0
- package/lib/template/single-reference-readonly/single-reference-readonly.component.ts +4 -4
- package/lib/template/wss-nav-bar/wss-nav-bar.component.ts +18 -20
- package/lib/widget/attachment/AttachmentUtils.ts +18 -10
- package/lib/widget/attachment/attachment.component.html +16 -6
- package/lib/widget/attachment/attachment.component.ts +12 -2
- package/lib/widget/case-history/case-history.component.ts +6 -2
- package/lib/widget/file-utility/file-utility.component.ts +25 -29
- package/lib/widget/todo/todo.component.ts +7 -2
- package/package.json +1 -1
|
@@ -1,18 +1,37 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
AfterViewInit,
|
|
3
|
+
ChangeDetectorRef,
|
|
4
|
+
Component,
|
|
5
|
+
ElementRef,
|
|
6
|
+
EventEmitter,
|
|
7
|
+
Input,
|
|
8
|
+
OnChanges,
|
|
9
|
+
OnDestroy,
|
|
10
|
+
Output,
|
|
11
|
+
SimpleChanges,
|
|
12
|
+
ViewChild
|
|
13
|
+
} from '@angular/core';
|
|
2
14
|
import { CommonModule } from '@angular/common';
|
|
3
15
|
import { FormControl, ReactiveFormsModule, Validators } from '@angular/forms';
|
|
4
|
-
import {
|
|
16
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
17
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
18
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
19
|
+
import { MatSelectModule } from '@angular/material/select';
|
|
20
|
+
import { Editor } from '@tiptap/core';
|
|
21
|
+
import StarterKit from '@tiptap/starter-kit';
|
|
22
|
+
import Placeholder from '@tiptap/extension-placeholder';
|
|
23
|
+
import Image from '@tiptap/extension-image';
|
|
24
|
+
import Link from '@tiptap/extension-link';
|
|
5
25
|
|
|
6
|
-
|
|
26
|
+
type BlockType = 'paragraph' | 'h1' | 'h2' | 'h3';
|
|
7
27
|
|
|
8
28
|
@Component({
|
|
9
29
|
selector: 'app-rich-text-editor',
|
|
10
30
|
templateUrl: './rich-text-editor.component.html',
|
|
11
31
|
styleUrls: ['./rich-text-editor.component.scss'],
|
|
12
|
-
imports: [CommonModule,
|
|
13
|
-
providers: [{ provide: TINYMCE_SCRIPT_SRC, useValue: 'tinymce/tinymce.min.js' }]
|
|
32
|
+
imports: [CommonModule, ReactiveFormsModule, MatButtonModule, MatFormFieldModule, MatIconModule, MatSelectModule]
|
|
14
33
|
})
|
|
15
|
-
export class RichTextEditorComponent implements OnChanges {
|
|
34
|
+
export class RichTextEditorComponent implements OnChanges, AfterViewInit, OnDestroy {
|
|
16
35
|
@Input() placeholder;
|
|
17
36
|
@Input() disabled;
|
|
18
37
|
@Input() readonly;
|
|
@@ -26,13 +45,27 @@ export class RichTextEditorComponent implements OnChanges {
|
|
|
26
45
|
@Output() onBlur: EventEmitter<any> = new EventEmitter();
|
|
27
46
|
@Output() onChange: EventEmitter<any> = new EventEmitter();
|
|
28
47
|
|
|
29
|
-
|
|
30
|
-
editorConfig: any = {};
|
|
48
|
+
private editorEl?: ElementRef<HTMLDivElement>;
|
|
31
49
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
50
|
+
richText = new FormControl('');
|
|
51
|
+
editor?: Editor;
|
|
52
|
+
currentBlock: BlockType = 'paragraph';
|
|
53
|
+
|
|
54
|
+
private viewInitialized = false;
|
|
55
|
+
|
|
56
|
+
constructor(private cdr: ChangeDetectorRef) {}
|
|
57
|
+
|
|
58
|
+
@ViewChild('editorEl')
|
|
59
|
+
set editorElement(element: ElementRef<HTMLDivElement> | undefined) {
|
|
60
|
+
this.editorEl = element;
|
|
61
|
+
if (element && this.viewInitialized && !this.readonly && !this.editor) {
|
|
62
|
+
this.initializeEditor();
|
|
35
63
|
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
ngOnChanges(changes: SimpleChanges) {
|
|
67
|
+
this.richText.setValidators(this.required ? Validators.required : null);
|
|
68
|
+
this.richText.updateValueAndValidity({ emitEvent: false });
|
|
36
69
|
|
|
37
70
|
if (this.disabled) {
|
|
38
71
|
this.richText.disable();
|
|
@@ -40,79 +73,198 @@ export class RichTextEditorComponent implements OnChanges {
|
|
|
40
73
|
this.richText.enable();
|
|
41
74
|
}
|
|
42
75
|
|
|
43
|
-
|
|
44
|
-
|
|
76
|
+
this.richText.setValue(this.value ?? '', { emitEvent: false });
|
|
77
|
+
|
|
78
|
+
if (!this.viewInitialized) return;
|
|
79
|
+
|
|
80
|
+
if (this.readonly) {
|
|
81
|
+
this.destroyEditor();
|
|
82
|
+
return;
|
|
45
83
|
}
|
|
46
84
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
this.
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
85
|
+
if (!this.editor && this.editorEl) {
|
|
86
|
+
this.initializeEditor();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (this.editor && changes['value'] && this.value !== this.editor.getHTML()) {
|
|
90
|
+
this.editor.commands.setContent(this.value ?? '', { emitUpdate: false });
|
|
91
|
+
}
|
|
92
|
+
if (this.editor && changes['disabled']) {
|
|
93
|
+
this.editor.setEditable(!this.disabled);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
ngAfterViewInit(): void {
|
|
98
|
+
this.viewInitialized = true;
|
|
99
|
+
if (!this.readonly) this.initializeEditor();
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
private initializeEditor(): void {
|
|
103
|
+
if (!this.editorEl || this.editor) return;
|
|
104
|
+
|
|
105
|
+
this.editor = new Editor({
|
|
106
|
+
element: this.editorEl.nativeElement,
|
|
107
|
+
extensions: [
|
|
108
|
+
StarterKit,
|
|
109
|
+
Placeholder.configure({ placeholder: this.placeholder || '' }),
|
|
110
|
+
Image.configure({ inline: false, allowBase64: true }),
|
|
111
|
+
Link.configure({ openOnClick: false, autolink: true })
|
|
112
|
+
],
|
|
113
|
+
content: this.value || '',
|
|
114
|
+
editable: !this.disabled,
|
|
115
|
+
onUpdate: ({ editor }) => {
|
|
116
|
+
const html = editor.getHTML();
|
|
117
|
+
this.richText.setValue(html, { emitEvent: false });
|
|
118
|
+
this.richText.markAsDirty();
|
|
119
|
+
this.onChange.emit(html);
|
|
120
|
+
this.cdr.markForCheck();
|
|
121
|
+
},
|
|
122
|
+
onBlur: ({ editor }) => {
|
|
123
|
+
this.richText.markAsTouched();
|
|
124
|
+
this.onBlur.emit(editor.getHTML());
|
|
125
|
+
this.cdr.markForCheck();
|
|
126
|
+
},
|
|
127
|
+
onSelectionUpdate: ({ editor }) => {
|
|
128
|
+
this.updateCurrentBlock(editor);
|
|
129
|
+
this.cdr.markForCheck();
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
this.updateCurrentBlock(this.editor);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
private updateCurrentBlock(editor: Editor): void {
|
|
136
|
+
if (editor.isActive('heading', { level: 1 })) this.currentBlock = 'h1';
|
|
137
|
+
else if (editor.isActive('heading', { level: 2 })) this.currentBlock = 'h2';
|
|
138
|
+
else if (editor.isActive('heading', { level: 3 })) this.currentBlock = 'h3';
|
|
139
|
+
else this.currentBlock = 'paragraph';
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
private destroyEditor(): void {
|
|
143
|
+
this.editor?.destroy();
|
|
144
|
+
this.editor = undefined;
|
|
145
|
+
this.currentBlock = 'paragraph';
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
ngOnDestroy(): void {
|
|
149
|
+
this.destroyEditor();
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
isActive(name: string, attrs?: Record<string, any>): boolean {
|
|
153
|
+
return this.editor ? this.editor.isActive(name, attrs) : false;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
setBlock(value: string) {
|
|
157
|
+
if (!this.editor) return;
|
|
158
|
+
const chain = this.editor.chain().focus();
|
|
159
|
+
switch (value) {
|
|
160
|
+
case 'h1':
|
|
161
|
+
chain.toggleHeading({ level: 1 }).run();
|
|
162
|
+
break;
|
|
163
|
+
case 'h2':
|
|
164
|
+
chain.toggleHeading({ level: 2 }).run();
|
|
165
|
+
break;
|
|
166
|
+
case 'h3':
|
|
167
|
+
chain.toggleHeading({ level: 3 }).run();
|
|
168
|
+
break;
|
|
169
|
+
default:
|
|
170
|
+
chain.setParagraph().run();
|
|
171
|
+
}
|
|
172
|
+
this.currentBlock = value as BlockType;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
toggleBold() {
|
|
176
|
+
this.editor?.chain().focus().toggleBold().run();
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
toggleItalic() {
|
|
180
|
+
this.editor?.chain().focus().toggleItalic().run();
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
toggleStrike() {
|
|
184
|
+
this.editor?.chain().focus().toggleStrike().run();
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
toggleBulletList() {
|
|
188
|
+
this.editor?.chain().focus().toggleBulletList().run();
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
toggleOrderedList() {
|
|
192
|
+
this.editor?.chain().focus().toggleOrderedList().run();
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
outdent() {
|
|
196
|
+
if (!this.editor) return;
|
|
197
|
+
if (this.editor.can().liftListItem('listItem')) {
|
|
198
|
+
this.editor.chain().focus().liftListItem('listItem').run();
|
|
199
|
+
} else {
|
|
200
|
+
this.editor.chain().focus().liftEmptyBlock().run();
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
indent() {
|
|
205
|
+
this.editor?.chain().focus().sinkListItem('listItem').run();
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
addLink() {
|
|
209
|
+
if (!this.editor) return;
|
|
210
|
+
const previous = this.editor.getAttributes('link')?.['href'] ?? '';
|
|
211
|
+
const { from, to, empty } = this.editor.state.selection;
|
|
212
|
+
const url = window.prompt('Enter URL', previous);
|
|
213
|
+
if (url === null) return;
|
|
214
|
+
if (url === '') {
|
|
215
|
+
this.editor.chain().focus().setTextSelection({ from, to }).extendMarkRange('link').unsetLink().run();
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
const normalizedUrl = this.normalizeUrl(url);
|
|
219
|
+
if (!normalizedUrl) return;
|
|
220
|
+
if (empty) {
|
|
221
|
+
this.editor
|
|
222
|
+
.chain()
|
|
223
|
+
.focus()
|
|
224
|
+
.insertContentAt(from, {
|
|
225
|
+
type: 'text',
|
|
226
|
+
text: url,
|
|
227
|
+
marks: [{ type: 'link', attrs: { href: normalizedUrl } }]
|
|
228
|
+
})
|
|
229
|
+
.run();
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
this.editor.chain().focus().setTextSelection({ from, to }).extendMarkRange('link').setLink({ href: normalizedUrl }).run();
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
private normalizeUrl(url: string): string | null {
|
|
236
|
+
const trimmedUrl = url.trim();
|
|
237
|
+
if (!trimmedUrl) return null;
|
|
238
|
+
if (/^\/\//.test(trimmedUrl)) return `https:${trimmedUrl}`;
|
|
239
|
+
if (/^(?:https?|mailto|tel|ftp):/i.test(trimmedUrl)) return trimmedUrl;
|
|
240
|
+
if (/^[a-z][a-z\d+.-]*:/i.test(trimmedUrl)) return null;
|
|
241
|
+
return `https://${trimmedUrl}`;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
addImage() {
|
|
245
|
+
if (!this.editor) return;
|
|
246
|
+
const insertPosition = this.editor.state.selection.to;
|
|
78
247
|
const input = document.createElement('input');
|
|
79
248
|
input.setAttribute('type', 'file');
|
|
80
249
|
input.setAttribute('accept', 'image/*');
|
|
81
250
|
|
|
82
251
|
input.addEventListener('change', (e: any) => {
|
|
83
|
-
const file = e.target.files[0];
|
|
84
|
-
|
|
85
|
-
const reader
|
|
252
|
+
const file = e.target.files?.[0];
|
|
253
|
+
if (!file) return;
|
|
254
|
+
const reader = new FileReader();
|
|
86
255
|
reader.addEventListener('load', () => {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
const blobCache = tinymce.activeEditor.editorUpload.blobCache;
|
|
95
|
-
const base64 = reader.result.split(',')[1];
|
|
96
|
-
const blobInfo = blobCache.create(blobId, file, base64);
|
|
97
|
-
blobCache.add(blobInfo);
|
|
98
|
-
|
|
99
|
-
/* call the callback and populate the Title field with the file name */
|
|
100
|
-
cb(blobInfo.blobUri(), { title: file.name });
|
|
256
|
+
const src = reader.result as string;
|
|
257
|
+
this.editor
|
|
258
|
+
?.chain()
|
|
259
|
+
.focus()
|
|
260
|
+
.setTextSelection(insertPosition)
|
|
261
|
+
.insertContent({ type: 'image', attrs: { src, alt: file.name, title: file.name } })
|
|
262
|
+
.run();
|
|
101
263
|
});
|
|
264
|
+
reader.addEventListener('error', () => this.cdr.markForCheck());
|
|
102
265
|
reader.readAsDataURL(file);
|
|
103
266
|
});
|
|
104
267
|
|
|
105
268
|
input.click();
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
blur() {
|
|
109
|
-
if (tinymce.activeEditor) {
|
|
110
|
-
const editorValue = tinymce.activeEditor.getContent({ format: 'html' });
|
|
111
|
-
this.onBlur.emit(editorValue);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
change(event) {
|
|
116
|
-
this.onChange.emit(event);
|
|
117
269
|
}
|
|
118
270
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<ng-template #noDisplayMode>
|
|
5
5
|
<div *ngIf="!bReadonly$ && bHasForm$; else noEdit">
|
|
6
6
|
<div [formGroup]="formGroup$" *ngIf="bVisible$">
|
|
7
|
-
<mat-form-field class="psdk-full-width" subscriptSizing="dynamic"
|
|
7
|
+
<mat-form-field class="psdk-full-width" subscriptSizing="dynamic">
|
|
8
8
|
<mat-label>{{ label$ }}</mat-label>
|
|
9
9
|
<input
|
|
10
10
|
matInput
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
<span>{{ opt.value }}</span>
|
|
21
21
|
</mat-option>
|
|
22
22
|
</mat-autocomplete>
|
|
23
|
+
<mat-hint *ngIf="helperText" [appFieldWarning]="bFieldMessageVisible$">{{ helperText }}</mat-hint>
|
|
23
24
|
<mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error>
|
|
24
25
|
</mat-form-field>
|
|
25
26
|
</div>
|
|
@@ -9,6 +9,7 @@ import { Observable } from 'rxjs';
|
|
|
9
9
|
import { map, startWith } from 'rxjs/operators';
|
|
10
10
|
|
|
11
11
|
import { FieldBase } from '@pega/angular-sdk-components';
|
|
12
|
+
import { FieldWarningDirective } from '@pega/angular-sdk-components';
|
|
12
13
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
13
14
|
import { DatapageService } from '@pega/angular-sdk-components';
|
|
14
15
|
import { handleEvent } from '@pega/angular-sdk-components';
|
|
@@ -41,6 +42,7 @@ interface AutoCompleteProps extends PConnFieldProps {
|
|
|
41
42
|
MatInputModule,
|
|
42
43
|
MatAutocompleteModule,
|
|
43
44
|
MatOptionModule,
|
|
45
|
+
FieldWarningDirective,
|
|
44
46
|
forwardRef(() => ComponentMapperComponent)
|
|
45
47
|
],
|
|
46
48
|
providers: [DatapageService]
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
</span>
|
|
19
19
|
</div>
|
|
20
20
|
<div *ngIf="selectionMode === 'multi'; else single">
|
|
21
|
-
<mat-option *ngFor="let item of listOfCheckboxes"
|
|
21
|
+
<mat-option *ngFor="let item of listOfCheckboxes">
|
|
22
22
|
<mat-checkbox
|
|
23
23
|
[labelPosition]="'after'"
|
|
24
24
|
[checked]="item.selected"
|
|
@@ -42,7 +42,9 @@
|
|
|
42
42
|
(blur)="fieldOnBlur($event)"
|
|
43
43
|
><span [ngClass]="{ 'label-required': bRequired$ }">{{ caption$ }}</span></mat-checkbox
|
|
44
44
|
>
|
|
45
|
-
<p *ngIf="helperText"
|
|
45
|
+
<p *ngIf="helperText && !(fieldControl.invalid && (fieldControl.touched || fieldControl.dirty))" [appFieldWarning]="bFieldMessageVisible$">
|
|
46
|
+
{{ helperText }}
|
|
47
|
+
</p>
|
|
46
48
|
</ng-template>
|
|
47
49
|
<mat-error *ngIf="fieldControl.invalid && (fieldControl.touched || fieldControl.dirty)">{{ getErrorMessage() }}</mat-error>
|
|
48
50
|
</div>
|
|
@@ -6,6 +6,7 @@ import { MatFormFieldModule } from '@angular/material/form-field';
|
|
|
6
6
|
import { MatOptionModule } from '@angular/material/core';
|
|
7
7
|
|
|
8
8
|
import { FieldBase } from '@pega/angular-sdk-components';
|
|
9
|
+
import { FieldWarningDirective } from '@pega/angular-sdk-components';
|
|
9
10
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
10
11
|
import { PConnFieldProps } from '@pega/angular-sdk-components';
|
|
11
12
|
import { deleteInstruction, insertInstruction, updateNewInstructions } from '@pega/angular-sdk-components';
|
|
@@ -33,7 +34,15 @@ interface CheckboxProps extends Omit<PConnFieldProps, 'value'> {
|
|
|
33
34
|
selector: 'app-check-box',
|
|
34
35
|
templateUrl: './check-box.component.html',
|
|
35
36
|
styleUrls: ['./check-box.component.scss'],
|
|
36
|
-
imports: [
|
|
37
|
+
imports: [
|
|
38
|
+
CommonModule,
|
|
39
|
+
ReactiveFormsModule,
|
|
40
|
+
MatCheckboxModule,
|
|
41
|
+
MatFormFieldModule,
|
|
42
|
+
MatOptionModule,
|
|
43
|
+
FieldWarningDirective,
|
|
44
|
+
forwardRef(() => ComponentMapperComponent)
|
|
45
|
+
]
|
|
37
46
|
})
|
|
38
47
|
export class CheckBoxComponent extends FieldBase implements OnInit, OnDestroy {
|
|
39
48
|
configProps$: CheckboxProps;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<ng-template #noDisplayMode>
|
|
5
5
|
<div *ngIf="bHasForm$; else noEdit">
|
|
6
6
|
<div [formGroup]="formGroup$" *ngIf="bVisible$" class="psdk-currency-field">
|
|
7
|
-
<mat-form-field class="psdk-full-width" subscriptSizing="dynamic"
|
|
7
|
+
<mat-form-field class="psdk-full-width" subscriptSizing="dynamic">
|
|
8
8
|
<mat-label>{{ label$ }}</mat-label>
|
|
9
9
|
<div class="psdk-currency-input">
|
|
10
10
|
<input
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
[readonly]="bReadonly$"
|
|
31
31
|
/>
|
|
32
32
|
</div>
|
|
33
|
+
<mat-hint *ngIf="helperText" [appFieldWarning]="bFieldMessageVisible$">{{ helperText }}</mat-hint>
|
|
33
34
|
<mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error>
|
|
34
35
|
</mat-form-field>
|
|
35
36
|
</div>
|
|
@@ -6,6 +6,7 @@ import { MatFormFieldModule } from '@angular/material/form-field';
|
|
|
6
6
|
import { NgxCurrencyDirective, NgxCurrencyInputMode } from 'ngx-currency';
|
|
7
7
|
|
|
8
8
|
import { FieldBase } from '@pega/angular-sdk-components';
|
|
9
|
+
import { FieldWarningDirective } from '@pega/angular-sdk-components';
|
|
9
10
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
10
11
|
import { handleEvent } from '@pega/angular-sdk-components';
|
|
11
12
|
import { getCurrencyCharacters, getCurrencyOptions } from '@pega/angular-sdk-components';
|
|
@@ -23,7 +24,15 @@ interface CurrrencyProps extends PConnFieldProps {
|
|
|
23
24
|
selector: 'app-currency',
|
|
24
25
|
templateUrl: './currency.component.html',
|
|
25
26
|
styleUrls: ['./currency.component.scss'],
|
|
26
|
-
imports: [
|
|
27
|
+
imports: [
|
|
28
|
+
CommonModule,
|
|
29
|
+
ReactiveFormsModule,
|
|
30
|
+
MatFormFieldModule,
|
|
31
|
+
MatInputModule,
|
|
32
|
+
NgxCurrencyDirective,
|
|
33
|
+
FieldWarningDirective,
|
|
34
|
+
forwardRef(() => ComponentMapperComponent)
|
|
35
|
+
]
|
|
27
36
|
})
|
|
28
37
|
export class CurrencyComponent extends FieldBase {
|
|
29
38
|
configProps$: CurrrencyProps;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<ng-template #noDisplayMode>
|
|
5
5
|
<div *ngIf="!bReadonly$ && bHasForm$; else noEdit">
|
|
6
6
|
<div [formGroup]="formGroup$" *ngIf="bVisible$">
|
|
7
|
-
<mat-form-field class="psdk-full-width" subscriptSizing="dynamic"
|
|
7
|
+
<mat-form-field class="psdk-full-width" subscriptSizing="dynamic">
|
|
8
8
|
<mat-label>{{ label$ }}</mat-label>
|
|
9
9
|
<input
|
|
10
10
|
matInput
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
/>
|
|
22
22
|
<mat-datepicker-toggle matSuffix [for]="pegadate" [disabled]="bDisabled$"></mat-datepicker-toggle>
|
|
23
23
|
<mat-datepicker #pegadate [startAt]="value$" xPosition="end"></mat-datepicker>
|
|
24
|
+
<mat-hint *ngIf="helperText" [appFieldWarning]="bFieldMessageVisible$">{{ helperText }}</mat-hint>
|
|
24
25
|
<mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error>
|
|
25
26
|
</mat-form-field>
|
|
26
27
|
</div>
|
|
@@ -9,6 +9,7 @@ import { MAT_DATE_FORMATS } from '@angular/material/core';
|
|
|
9
9
|
import { MomentDateModule } from '@angular/material-moment-adapter';
|
|
10
10
|
|
|
11
11
|
import { FieldBase } from '@pega/angular-sdk-components';
|
|
12
|
+
import { FieldWarningDirective } from '@pega/angular-sdk-components';
|
|
12
13
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
13
14
|
import { getDateFormatInfo } from '@pega/angular-sdk-components';
|
|
14
15
|
import { format } from '@pega/angular-sdk-components';
|
|
@@ -50,6 +51,7 @@ class MyFormat {
|
|
|
50
51
|
MatDatepickerModule,
|
|
51
52
|
MatNativeDateModule,
|
|
52
53
|
MomentDateModule,
|
|
54
|
+
FieldWarningDirective,
|
|
53
55
|
forwardRef(() => ComponentMapperComponent)
|
|
54
56
|
],
|
|
55
57
|
providers: [{ provide: MAT_DATE_FORMATS, useClass: MyFormat }]
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<ng-template #noDisplayMode>
|
|
5
5
|
<div *ngIf="!bReadonly$ && bHasForm$; else noEdit">
|
|
6
6
|
<div [formGroup]="formGroup$" *ngIf="bVisible$">
|
|
7
|
-
<mat-form-field class="psdk-full-width" subscriptSizing="dynamic"
|
|
7
|
+
<mat-form-field class="psdk-full-width" subscriptSizing="dynamic">
|
|
8
8
|
<mat-label>{{ label$ }}</mat-label>
|
|
9
9
|
<input
|
|
10
10
|
matInput
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
/>
|
|
19
19
|
<mat-datepicker-toggle matSuffix [owlDateTimeTrigger]="dtPicker"></mat-datepicker-toggle>
|
|
20
20
|
<owl-date-time #dtPicker [disabled]="bDisabled$" [scrollStrategy]="scrollStrategy"></owl-date-time>
|
|
21
|
+
<mat-hint *ngIf="helperText" [appFieldWarning]="bFieldMessageVisible$">{{ helperText }}</mat-hint>
|
|
21
22
|
<mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error>
|
|
22
23
|
</mat-form-field>
|
|
23
24
|
</div>
|
|
@@ -20,61 +20,67 @@
|
|
|
20
20
|
width: auto;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
0px 2px 4px -1px rgba(0, 0, 0, 0.2),
|
|
27
|
-
0px 4px 5px 0px rgba(0, 0, 0, 0.14),
|
|
28
|
-
0px 1px 10px 0px rgba(0, 0, 0, 0.12);
|
|
29
|
-
display: block;
|
|
30
|
-
border-radius: 4px;
|
|
31
|
-
background-color: var(--mat-datepicker-calendar-container-background-color);
|
|
32
|
-
color: var(--mat-datepicker-calendar-container-text-color);
|
|
23
|
+
.owl-dt-container {
|
|
24
|
+
background-color: var(--mat-sys-surface-container);
|
|
25
|
+
color: var(--mat-sys-on-surface);
|
|
33
26
|
}
|
|
34
27
|
|
|
35
|
-
.
|
|
36
|
-
|
|
37
|
-
border-color: var(--mat-
|
|
28
|
+
.owl-dt-container-row,
|
|
29
|
+
.owl-dt-container-info .owl-dt-container-range:last-child {
|
|
30
|
+
border-color: var(--mat-sys-outline-variant);
|
|
38
31
|
}
|
|
39
32
|
|
|
40
|
-
.
|
|
41
|
-
|
|
42
|
-
color: var(--mat-
|
|
33
|
+
.owl-dt-calendar-control,
|
|
34
|
+
.owl-dt-calendar-table .owl-dt-calendar-cell {
|
|
35
|
+
color: var(--mat-sys-on-surface);
|
|
43
36
|
}
|
|
44
37
|
|
|
45
|
-
.
|
|
46
|
-
|
|
38
|
+
.owl-dt-calendar-table .owl-dt-calendar-header,
|
|
39
|
+
.owl-dt-calendar-table .owl-dt-calendar-cell-disabled > .owl-dt-calendar-cell-content:not(.owl-dt-calendar-cell-selected) {
|
|
40
|
+
color: var(--mat-sys-on-surface-variant);
|
|
47
41
|
}
|
|
48
42
|
|
|
49
|
-
.
|
|
50
|
-
|
|
51
|
-
background-color: var(--mat-datepicker-calendar-date-hover-state-background-color);
|
|
43
|
+
.owl-dt-calendar-table .owl-dt-calendar-header .owl-dt-calendar-table-divider::after {
|
|
44
|
+
background-color: var(--mat-sys-outline-variant);
|
|
52
45
|
}
|
|
53
46
|
|
|
54
|
-
.
|
|
55
|
-
|
|
47
|
+
.owl-dt-calendar-table .owl-dt-calendar-cell-today:not(.owl-dt-calendar-cell-selected) {
|
|
48
|
+
border-color: var(--mat-sys-outline);
|
|
56
49
|
}
|
|
57
50
|
|
|
58
|
-
.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
color: var(--mat-datepicker-calendar-header-text-color);
|
|
62
|
-
font-size: var(--mat-datepicker-calendar-header-text-size);
|
|
63
|
-
font-weight: var(--mat-datepicker-calendar-header-text-weight);
|
|
51
|
+
.owl-dt-calendar-table .owl-dt-calendar-cell-selected {
|
|
52
|
+
background-color: var(--mat-sys-primary);
|
|
53
|
+
color: var(--mat-sys-on-primary);
|
|
64
54
|
}
|
|
65
55
|
|
|
66
|
-
.
|
|
67
|
-
.
|
|
68
|
-
|
|
56
|
+
.owl-dt-calendar-table .owl-dt-calendar-cell-active:focus > .owl-dt-calendar-cell-content:not(.owl-dt-calendar-cell-selected),
|
|
57
|
+
.owl-dt-calendar-table :not(.owl-dt-calendar-cell-disabled):hover > .owl-dt-calendar-cell-content:not(.owl-dt-calendar-cell-selected),
|
|
58
|
+
.owl-dt-calendar-control .owl-dt-calendar-control-content .owl-dt-calendar-control-button:hover,
|
|
59
|
+
.owl-dt-control-period-button:hover > .owl-dt-control-button-content,
|
|
60
|
+
.owl-dt-container-control-button:hover .owl-dt-control-button-content,
|
|
61
|
+
.owl-dt-control:focus > .owl-dt-control-content {
|
|
62
|
+
background-color: var(--mat-sys-surface-container-high);
|
|
69
63
|
}
|
|
70
64
|
|
|
71
|
-
.
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
65
|
+
.owl-dt-timer-content .owl-dt-timer-input {
|
|
66
|
+
border-color: var(--mat-sys-outline);
|
|
67
|
+
background-color: var(--mat-sys-surface-container-highest);
|
|
68
|
+
color: var(--mat-sys-on-surface);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.owl-dt-container-buttons,
|
|
72
|
+
.owl-dt-container-info .owl-dt-container-info-active,
|
|
73
|
+
.owl-dt-timer-hour12 {
|
|
74
|
+
color: var(--mat-sys-primary);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.owl-dt-control-arrow-button[disabled] {
|
|
78
|
+
color: var(--mat-sys-on-surface-variant);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.owl-dt-timer-hour12 .owl-dt-timer-hour12-box:focus .owl-dt-control-button-content,
|
|
82
|
+
.owl-dt-timer-hour12 .owl-dt-timer-hour12-box:hover .owl-dt-control-button-content {
|
|
83
|
+
background-color: var(--mat-sys-primary);
|
|
84
|
+
color: var(--mat-sys-on-primary);
|
|
79
85
|
}
|
|
80
86
|
}
|
|
@@ -9,6 +9,7 @@ import { OwlDateTimeModule, OwlNativeDateTimeModule } from '@danielmoncada/angul
|
|
|
9
9
|
import dayjs from 'dayjs';
|
|
10
10
|
|
|
11
11
|
import { FieldBase } from '@pega/angular-sdk-components';
|
|
12
|
+
import { FieldWarningDirective } from '@pega/angular-sdk-components';
|
|
12
13
|
import { ComponentMapperComponent } from '@pega/angular-sdk-components';
|
|
13
14
|
import { getDateFormatInfo } from '@pega/angular-sdk-components';
|
|
14
15
|
import { handleEvent } from '@pega/angular-sdk-components';
|
|
@@ -31,6 +32,7 @@ interface DateTimeProps extends PConnFieldProps {
|
|
|
31
32
|
MatDatepickerModule,
|
|
32
33
|
OwlDateTimeModule,
|
|
33
34
|
OwlNativeDateTimeModule,
|
|
35
|
+
FieldWarningDirective,
|
|
34
36
|
forwardRef(() => ComponentMapperComponent)
|
|
35
37
|
]
|
|
36
38
|
})
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<ng-template #noDisplayMode>
|
|
5
5
|
<div *ngIf="bHasForm$; else noEdit">
|
|
6
6
|
<div [formGroup]="formGroup$" *ngIf="bVisible$">
|
|
7
|
-
<mat-form-field class="psdk-full-width" subscriptSizing="dynamic"
|
|
7
|
+
<mat-form-field class="psdk-full-width" subscriptSizing="dynamic">
|
|
8
8
|
<mat-label>{{ label$ }}</mat-label>
|
|
9
9
|
<input
|
|
10
10
|
type="text"
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
(blur)="fieldOnBlur($event)"
|
|
30
30
|
[readonly]="bReadonly$"
|
|
31
31
|
/>
|
|
32
|
+
<mat-hint *ngIf="helperText" [appFieldWarning]="bFieldMessageVisible$">{{ helperText }}</mat-hint>
|
|
32
33
|
<mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error>
|
|
33
34
|
</mat-form-field>
|
|
34
35
|
</div>
|