qms-angular 1.0.80 → 1.0.84
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/bundles/qms-angular.umd.js +259 -106
- package/bundles/qms-angular.umd.js.map +1 -1
- package/esm2015/lib/components/qms-navigation-drawer/qms-navigation-drawer.component.js +3 -3
- package/esm2015/lib/components/qms-paginator/qms-paginator.component.js +14 -4
- package/esm2015/lib/components/related/popup/related-popup.component.js +48 -56
- package/esm2015/lib/components/select-one/select-one.component.js +3 -2
- package/esm2015/lib/components/select-process-document/select-process-document.component.js +65 -34
- package/esm2015/lib/components/tree/tree.component.js +2 -2
- package/esm2015/lib/directives/dialog/dialog.content.directive.js +96 -0
- package/esm2015/lib/directives/table/table-row.directive.js +3 -3
- package/esm2015/lib/directives/table/table.directive.js +6 -6
- package/esm2015/lib/model/en.js +4 -1
- package/esm2015/lib/model/no.js +4 -1
- package/esm2015/lib/qms-angular.module.js +12 -3
- package/esm2015/public-api.js +2 -1
- package/fesm2015/qms-angular.js +247 -105
- package/fesm2015/qms-angular.js.map +1 -1
- package/lib/components/qms-paginator/qms-paginator.component.d.ts +5 -1
- package/lib/directives/dialog/dialog.content.directive.d.ts +30 -0
- package/lib/directives/table/table-row.directive.d.ts +1 -1
- package/lib/directives/table/table.directive.d.ts +1 -1
- package/lib/model/en.d.ts +3 -0
- package/lib/model/no.d.ts +3 -0
- package/lib.theme.scss +1 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/qms-angular.metadata.json +1 -1
- package/src/assets/qms-ckeditor-plugin/build/ckeditor.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/ckeditor.js.map +1 -1
- package/src/assets/qms-ckeditor-plugin/src/plugins/anchor/anchorediting.js +19 -1
- package/src/assets/qms-ckeditor-plugin/src/plugins/imagemap/converters.js +44 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/imagemap/imagemapediting.js +3 -1
- package/src/assets/qms-ckeditor-plugin/src/plugins/media/mediaembedediting.js +30 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/tooltipediting.js +20 -9
- package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/utils.js +4 -1
- package/src/lib/components/qms-navigation-drawer/qms-navigation-drawer.component.scss +5 -5
- package/src/themes/core/_dialog.scss +35 -0
- package/src/themes/core/_form.scss +4 -0
@@ -80,6 +80,24 @@ export default class AnchorEditing extends Plugin {
|
|
80
80
|
} } );
|
81
81
|
|
82
82
|
editor.conversion.for( 'upcast' )
|
83
|
+
.elementToElement( {
|
84
|
+
view: {
|
85
|
+
name: 'a'
|
86
|
+
},
|
87
|
+
model: ( viewElement, {writer}) => {
|
88
|
+
const attributes = {};
|
89
|
+
const id = viewElement.getAttribute('id') ? viewElement.getAttribute('id') : viewElement.getAttribute('name');
|
90
|
+
|
91
|
+
if(viewElement.parent.childCount > 1 && viewElement.isEmpty && typeof viewElement.parent.getChild(1).data !== 'undefined'){
|
92
|
+
const text = viewElement.parent.getChild(1).data;
|
93
|
+
attributes['id'] = id;
|
94
|
+
attributes['name'] = id;
|
95
|
+
attributes['anchorId'] = text;
|
96
|
+
const { start: positionBefore } = editor.model.insertContent( writer.createText(text, attributes), 0 );
|
97
|
+
return writer.setSelection( positionBefore );
|
98
|
+
}
|
99
|
+
}
|
100
|
+
})
|
83
101
|
.elementToAttribute( {
|
84
102
|
view: {
|
85
103
|
name: 'a',
|
@@ -89,7 +107,7 @@ export default class AnchorEditing extends Plugin {
|
|
89
107
|
},
|
90
108
|
model: {
|
91
109
|
key: 'anchorId',
|
92
|
-
value: viewElement => viewElement.getAttribute( 'id' )
|
110
|
+
value: viewElement => viewElement.getAttribute( 'id' ) ? viewElement.getAttribute( 'id' ) : viewElement.getAttribute( 'name' )
|
93
111
|
}
|
94
112
|
} );
|
95
113
|
|
@@ -206,6 +206,15 @@ export function upcastMapElement() {
|
|
206
206
|
const areas = [];
|
207
207
|
if(viewMap.childCount > 0){
|
208
208
|
for (const child of Array.from(viewMap.getChildren())) {
|
209
|
+
try {
|
210
|
+
if (child.getAttribute() < 5) throw -1;
|
211
|
+
const check = child.getAttribute(HTML_ATTRIBUTES.COORDS);
|
212
|
+
if (!check) throw -1;
|
213
|
+
}
|
214
|
+
catch(err){
|
215
|
+
continue;
|
216
|
+
}
|
217
|
+
|
209
218
|
let area = {};
|
210
219
|
area[HTML_ATTRIBUTES.COORDS] = child.getAttribute(HTML_ATTRIBUTES.COORDS);
|
211
220
|
area[HTML_ATTRIBUTES.HREF] = child.getAttribute(HTML_ATTRIBUTES.HREF);
|
@@ -377,3 +386,38 @@ export function upcastImageHeightAttribute() {
|
|
377
386
|
});
|
378
387
|
};
|
379
388
|
}
|
389
|
+
|
390
|
+
export function downcastImagePluginAttribute() {
|
391
|
+
return dispatcher => {
|
392
|
+
dispatcher.on(`attribute:${IMAGEMAP_ATTRIBUTES.IMAGE_SRC}:${IMAGEMAP_ELEMENTS.IMAGE}`, (evt, data, conversionApi)=> {
|
393
|
+
|
394
|
+
const viewWriter = conversionApi.writer;
|
395
|
+
const figure = conversionApi.mapper.toViewElement(data.item);
|
396
|
+
const img = getViewImgFromWidget(figure);
|
397
|
+
const altAttribute = data.item.getAttribute('alt') || '';
|
398
|
+
|
399
|
+
const classes = altAttribute.split('#');
|
400
|
+
const className = classes.length > 0 ? classes[0] : '';
|
401
|
+
const attributes = {};
|
402
|
+
|
403
|
+
switch (className) {
|
404
|
+
case 'bpmn':
|
405
|
+
attributes['class'] = 'bpmn-chart-entity';
|
406
|
+
attributes['data-charttype'] = className;
|
407
|
+
break;
|
408
|
+
case 'flowchart':
|
409
|
+
attributes['class'] = 'flow-chart-entity';
|
410
|
+
attributes['data-charttype'] = 'flow';
|
411
|
+
break;
|
412
|
+
|
413
|
+
default:
|
414
|
+
attributes['class'] = '';
|
415
|
+
attributes['data-charttype'] = '';
|
416
|
+
break;
|
417
|
+
}
|
418
|
+
|
419
|
+
viewWriter.setAttribute('class', attributes['class'], img);
|
420
|
+
viewWriter.setAttribute('data-charttype', attributes['data-charttype'], img);
|
421
|
+
});
|
422
|
+
};
|
423
|
+
}
|
@@ -6,7 +6,8 @@ import { IMAGEMAP_ATTRIBUTES, IMAGEMAP_ELEMENTS, drawMap, IMAGEMAP_COMMANDS, HTM
|
|
6
6
|
import ImageLoadObserver from '@ckeditor/ckeditor5-image/src/image/imageloadobserver';
|
7
7
|
import { downcastImageWidthAttribute, downcastImageHeightAttribute, downcastImageSavedSrcAttribute, downcastImageMapAttribute,
|
8
8
|
upcastImageSavedSrcAttribute, upcastMapElement, dowcastMapNameAttribute, dowcastMapWidthAttribute, dowcastMapHeightAttribute,
|
9
|
-
dowcastMapAreaAttribute, upcastImageMapAttribute, upcastImageHeightAttribute, upcastImageWidthAttribute, downcastMapElement
|
9
|
+
dowcastMapAreaAttribute, upcastImageMapAttribute, upcastImageHeightAttribute, upcastImageWidthAttribute, downcastMapElement,
|
10
|
+
downcastImagePluginAttribute
|
10
11
|
} from './converters';
|
11
12
|
import { isWidget } from '@ckeditor/ckeditor5-widget/src/utils';
|
12
13
|
import { trimStart, debounced } from '../common/qmsCKEditorUtil';
|
@@ -54,6 +55,7 @@ import { trimStart, debounced } from '../common/qmsCKEditorUtil';
|
|
54
55
|
conversion.for('dataDowncast').add(downcastImageSavedSrcAttribute(true));
|
55
56
|
conversion.for('editingDowncast').add(downcastImageSavedSrcAttribute(false));
|
56
57
|
|
58
|
+
conversion.for('downcast').add(downcastImagePluginAttribute());
|
57
59
|
conversion.for('downcast').add(downcastImageMapAttribute());
|
58
60
|
conversion.for('downcast').add(downcastMapElement());
|
59
61
|
|
@@ -244,6 +244,36 @@ export default class MediaEmbedEditing extends Plugin {
|
|
244
244
|
model: ( viewMedia, { writer } ) => {
|
245
245
|
const url = viewMedia.getAttribute( 'data-oembed-url' );
|
246
246
|
|
247
|
+
if ( registry.hasMedia( url ) ) {
|
248
|
+
return writer.createElement( 'media', { url } );
|
249
|
+
}
|
250
|
+
}
|
251
|
+
} )
|
252
|
+
// Upcast for iframe from ck4-editor.
|
253
|
+
.elementToElement( {
|
254
|
+
view: {
|
255
|
+
name: 'iframe',
|
256
|
+
attributes: {
|
257
|
+
'data-src': true
|
258
|
+
}
|
259
|
+
},
|
260
|
+
model: ( viewMedia, { writer } ) => {
|
261
|
+
const url = viewMedia.getAttribute( 'data-src' );
|
262
|
+
if ( registry.hasMedia( url ) ) {
|
263
|
+
return writer.createElement( 'media', { url } );
|
264
|
+
}
|
265
|
+
}
|
266
|
+
} )
|
267
|
+
// for video upload from ck4
|
268
|
+
.elementToElement( {
|
269
|
+
view: {
|
270
|
+
name: 'video',
|
271
|
+
attributes: {
|
272
|
+
'poster': true
|
273
|
+
}
|
274
|
+
},
|
275
|
+
model: ( viewMedia, { writer } ) => {
|
276
|
+
const url = viewMedia.getAttribute( 'poster' );
|
247
277
|
if ( registry.hasMedia( url ) ) {
|
248
278
|
return writer.createElement( 'media', { url } );
|
249
279
|
}
|
@@ -7,7 +7,7 @@ import { ClipboardPipeline } from '@ckeditor/ckeditor5-clipboard';
|
|
7
7
|
import TooltipCommand from './tooltipcommand';
|
8
8
|
import RemoveTooltipCommand from './removetooltipcommand';
|
9
9
|
import TooltipDialogCommand from './tooltipdialogcommand';
|
10
|
-
import { TOOLTIP_COMMANDS, HTML_ATTRIBUTE, HTML_CLASS, HTML_ELEMENT, TOOLTIP_ATTRIBUTE, TOOLTIP_CUSTOM_PROPERTY } from './utils';
|
10
|
+
import { TOOLTIP_COMMANDS, HTML_ATTRIBUTE, HTML_CLASS, HTML_ELEMENT, TOOLTIP_ATTRIBUTE, TOOLTIP_CUSTOM_PROPERTY, CK4_HTML_ATTRIBUTE, CK4_HTML_CLASS } from './utils';
|
11
11
|
import '../../themes/styles/tooltip.css';
|
12
12
|
|
13
13
|
export default class TooltipEditing extends Plugin {
|
@@ -31,25 +31,36 @@ export default class TooltipEditing extends Plugin {
|
|
31
31
|
.attributeToElement({
|
32
32
|
model: TOOLTIP_ATTRIBUTE,
|
33
33
|
view: (modelAttributeValue, { writer }) =>{
|
34
|
-
const attributes = { class: HTML_CLASS };
|
34
|
+
const attributes = { class: `${HTML_CLASS} ${CK4_HTML_CLASS}` };
|
35
35
|
attributes[HTML_ATTRIBUTE] = modelAttributeValue;
|
36
|
-
|
36
|
+
attributes[CK4_HTML_ATTRIBUTE] = modelAttributeValue;
|
37
|
+
const tooltipElement = writer.createAttributeElement('span', attributes, { priority: 5 });
|
37
38
|
writer.setCustomProperty(TOOLTIP_CUSTOM_PROPERTY, true, tooltipElement);
|
38
39
|
return tooltipElement;
|
39
40
|
}
|
40
41
|
});
|
41
42
|
|
42
|
-
editor.conversion.for('upcast')
|
43
|
+
editor.conversion.for( 'upcast' )
|
44
|
+
.elementToElement( {
|
45
|
+
view: {
|
46
|
+
classes: CK4_HTML_CLASS
|
47
|
+
},
|
48
|
+
model: ( viewElement, { writer } ) => {
|
49
|
+
const attributes = { class: `${HTML_CLASS} ${CK4_HTML_CLASS}` };
|
50
|
+
attributes[HTML_ATTRIBUTE] = viewElement.getAttribute(CK4_HTML_ATTRIBUTE);
|
51
|
+
attributes[CK4_HTML_ATTRIBUTE] = viewElement.getAttribute(CK4_HTML_ATTRIBUTE);
|
52
|
+
return writer.createElement( HTML_ELEMENT, attributes);
|
53
|
+
}
|
54
|
+
})
|
43
55
|
.elementToAttribute({
|
44
56
|
view: {
|
45
|
-
|
46
|
-
attributes: {
|
47
|
-
[HTML_ATTRIBUTE]: true
|
48
|
-
}
|
57
|
+
classes: CK4_HTML_CLASS
|
49
58
|
},
|
50
59
|
model: {
|
51
60
|
key: TOOLTIP_ATTRIBUTE,
|
52
|
-
value: viewElement =>
|
61
|
+
value: (viewElement) => {
|
62
|
+
return viewElement.getAttribute(HTML_ATTRIBUTE) ? viewElement.getAttribute(HTML_ATTRIBUTE) : viewElement.getAttribute(CK4_HTML_ATTRIBUTE);
|
63
|
+
}
|
53
64
|
}
|
54
65
|
});
|
55
66
|
|
@@ -4,7 +4,10 @@ export const TOOLTIP_ATTRIBUTE = 'qmstooltip';
|
|
4
4
|
export const HTML_ATTRIBUTE = 'data-qmstooltip';
|
5
5
|
export const HTML_CLASS = 'qms-tooltip';
|
6
6
|
export const HTML_ELEMENT = 'abbr';
|
7
|
-
|
7
|
+
|
8
|
+
export const CK4_HTML_ATTRIBUTE = 'title';
|
9
|
+
export const CK4_HTML_CLASS = 'source-info';
|
10
|
+
|
8
11
|
export const TOOLTIP_COMMANDS = {
|
9
12
|
TOOLTIP_DIALOG: 'tooltipdialog',
|
10
13
|
TOOLTIP: 'tooltip',
|
@@ -1,5 +1,6 @@
|
|
1
1
|
::ng-deep mat-tree.qms-navigation-drawer-container {
|
2
2
|
|
3
|
+
padding: 0.25rem!important;
|
3
4
|
.mat-tree-node {
|
4
5
|
min-width: 272px !important;
|
5
6
|
height : 48px !important;
|
@@ -7,7 +8,6 @@
|
|
7
8
|
|
8
9
|
.mat-tree-node {
|
9
10
|
min-height: 34px;
|
10
|
-
margin : 16px 0px;
|
11
11
|
|
12
12
|
&.active {
|
13
13
|
background-color: #F2F7FD;
|
@@ -25,7 +25,6 @@
|
|
25
25
|
.tree-content {
|
26
26
|
width : 100%;
|
27
27
|
position : relative;
|
28
|
-
cursor : pointer;
|
29
28
|
align-items: center;
|
30
29
|
}
|
31
30
|
|
@@ -159,6 +158,7 @@
|
|
159
158
|
display : -webkit-box;
|
160
159
|
-webkit-line-clamp: 2;
|
161
160
|
-webkit-box-orient: vertical;
|
161
|
+
cursor : pointer;
|
162
162
|
}
|
163
163
|
|
164
164
|
.span-text:after {
|
@@ -187,9 +187,9 @@
|
|
187
187
|
}
|
188
188
|
|
189
189
|
.mat-tree-node:hover {
|
190
|
-
|
191
|
-
|
192
|
-
|
190
|
+
.span-text {
|
191
|
+
max-width: calc(100% - 96px);
|
192
|
+
}
|
193
193
|
}
|
194
194
|
|
195
195
|
.pr-34 {
|
@@ -0,0 +1,35 @@
|
|
1
|
+
|
2
|
+
::ng-deep .qms-dialog-container {
|
3
|
+
display: flex;
|
4
|
+
flex-flow: column;
|
5
|
+
min-height: 150px;
|
6
|
+
max-height: 80vh;
|
7
|
+
|
8
|
+
.qms-dialog-header {
|
9
|
+
display: flex;
|
10
|
+
justify-content: space-between;
|
11
|
+
align-items: center;
|
12
|
+
margin-bottom: 10px;
|
13
|
+
flex: 0 1 auto;
|
14
|
+
height: 50px;
|
15
|
+
}
|
16
|
+
|
17
|
+
.qms-dialog-content {
|
18
|
+
flex: 1 1 auto;
|
19
|
+
overflow-y: auto;
|
20
|
+
overflow-x: hidden;
|
21
|
+
margin: 0;
|
22
|
+
}
|
23
|
+
|
24
|
+
.qms-dialog-footer {
|
25
|
+
display: flex;
|
26
|
+
flex-wrap: wrap;
|
27
|
+
min-height: 50px;
|
28
|
+
align-items: center;
|
29
|
+
box-sizing: content-box;
|
30
|
+
justify-content: end;
|
31
|
+
margin-top: 10px;
|
32
|
+
flex: 0 1 auto;
|
33
|
+
height: 50px;
|
34
|
+
}
|
35
|
+
}
|