qms-angular 1.1.34 → 1.1.36

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 (78) hide show
  1. package/bundles/qms-angular.umd.js +373 -194
  2. package/bundles/qms-angular.umd.js.map +1 -1
  3. package/esm2015/lib/common/enum/document-field-status.js +7 -0
  4. package/esm2015/lib/common/models/qms-flat-node.model.js +1 -1
  5. package/esm2015/lib/common/models/qms-tree-node.model.js +1 -1
  6. package/esm2015/lib/components/qms-stepper/models/qms-stepper.model.js +4 -3
  7. package/esm2015/lib/components/qms-stepper/qms-stepper.component.js +5 -3
  8. package/esm2015/lib/components/related/common/video.const.js +4 -0
  9. package/esm2015/lib/components/related/model/popup-data.model.js +1 -1
  10. package/esm2015/lib/components/related/model/risk-danger.model.js +2 -1
  11. package/esm2015/lib/components/related/popup/related-popup.component.js +30 -12
  12. package/esm2015/lib/components/related/risk/list/list.component.js +4 -3
  13. package/esm2015/lib/components/select-department/model/select-department-popup-data.model.js +1 -1
  14. package/esm2015/lib/components/select-department/select-department.component.js +29 -7
  15. package/esm2015/lib/components/select-department-tree/model/select-department-tree.config.js +5 -1
  16. package/esm2015/lib/components/select-department-tree/select-department-tree.component.js +45 -8
  17. package/esm2015/lib/components/select-process-document/select-process-document.component.js +1 -1
  18. package/esm2015/lib/components/tree/model/tree-node.model.js +1 -1
  19. package/esm2015/lib/components/tree/tree.component.js +75 -42
  20. package/esm2015/lib/components/tree/tree.function.js +2 -1
  21. package/esm2015/lib/model/en.js +5 -2
  22. package/esm2015/lib/model/no.js +5 -2
  23. package/esm2015/lib/qms-ckeditor-components/common/classes/qmsUploadAdapter.js +1 -5
  24. package/esm2015/lib/qms-ckeditor-components/common/constants/iconSvg.constants.js +2 -1
  25. package/esm2015/lib/qms-ckeditor-components/common/models/qms-ckeditor-data.model.js +1 -1
  26. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-bpmn/qms-ckeditor-bpmn.component.js +3 -3
  27. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-link/qms-ckeditor-link.component.js +9 -2
  28. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-link-simple/qms-ckeditor-link-simple.component.js +2 -1
  29. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-load-template/qms-ckeditor-load-template.component.js +14 -9
  30. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-relation/qmsckeditor-related.component.js +17 -47
  31. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-template/qms-ckeditor-template.component.js +68 -28
  32. package/esm2015/lib/qms-ckeditor-components/models/qms-ckeditor-template.model.js +3 -2
  33. package/esm2015/lib/qms-ckeditor-components/qms-ckeditor.component.js +10 -8
  34. package/esm2015/lib/qms-ckeditor-components/qms-ckeditor.module.js +3 -1
  35. package/esm2015/lib/qms-ckeditor-components/services/qms-ckeditor-upload.service.js +5 -2
  36. package/esm2015/lib/qms-ckeditor-components/services/qms-ckedtior-template.service.js +8 -5
  37. package/fesm2015/qms-angular.js +336 -181
  38. package/fesm2015/qms-angular.js.map +1 -1
  39. package/lib/common/enum/document-field-status.d.ts +5 -0
  40. package/lib/common/models/qms-flat-node.model.d.ts +3 -0
  41. package/lib/common/models/qms-tree-node.model.d.ts +3 -0
  42. package/lib/components/qms-stepper/models/qms-stepper.model.d.ts +3 -2
  43. package/lib/components/qms-stepper/qms-stepper.component.d.ts +2 -0
  44. package/lib/components/related/common/video.const.d.ts +3 -0
  45. package/lib/components/related/model/popup-data.model.d.ts +2 -0
  46. package/lib/components/related/model/risk-danger.model.d.ts +1 -0
  47. package/lib/components/related/popup/related-popup.component.d.ts +5 -2
  48. package/lib/components/related/risk/list/list.component.d.ts +1 -0
  49. package/lib/components/select-department/model/select-department-popup-data.model.d.ts +2 -0
  50. package/lib/components/select-department/select-department.component.d.ts +9 -1
  51. package/lib/components/select-department-tree/model/select-department-tree.config.d.ts +4 -0
  52. package/lib/components/select-department-tree/select-department-tree.component.d.ts +7 -1
  53. package/lib/components/tree/model/tree-node.model.d.ts +1 -0
  54. package/lib/components/tree/tree.component.d.ts +2 -1
  55. package/lib/model/en.d.ts +3 -0
  56. package/lib/model/no.d.ts +3 -0
  57. package/lib/qms-ckeditor-components/common/classes/qmsUploadAdapter.d.ts +0 -1
  58. package/lib/qms-ckeditor-components/common/constants/iconSvg.constants.d.ts +1 -0
  59. package/lib/qms-ckeditor-components/common/models/qms-ckeditor-data.model.d.ts +2 -0
  60. package/lib/qms-ckeditor-components/components/qms-ckeditor-link/qms-ckeditor-link.component.d.ts +1 -0
  61. package/lib/qms-ckeditor-components/components/qms-ckeditor-load-template/qms-ckeditor-load-template.component.d.ts +4 -2
  62. package/lib/qms-ckeditor-components/components/qms-ckeditor-relation/qmsckeditor-related.component.d.ts +1 -1
  63. package/lib/qms-ckeditor-components/components/qms-ckeditor-template/qms-ckeditor-template.component.d.ts +17 -3
  64. package/lib/qms-ckeditor-components/models/qms-ckeditor-template.model.d.ts +3 -1
  65. package/lib/qms-ckeditor-components/services/qms-ckeditor-upload.service.d.ts +1 -1
  66. package/lib/qms-ckeditor-components/services/qms-ckedtior-template.service.d.ts +2 -1
  67. package/package.json +1 -1
  68. package/qms-angular.metadata.json +1 -1
  69. package/src/assets/qms-ckeditor-plugin/build/ckeditor.js +1 -1
  70. package/src/assets/qms-ckeditor-plugin/build/ckeditor.js.map +1 -1
  71. package/src/assets/qms-ckeditor-plugin/src/plugins/link/linkcommand.js +4 -0
  72. package/src/assets/qms-ckeditor-plugin/src/plugins/link/linkdialogcommand.js +66 -14
  73. package/src/assets/qms-ckeditor-plugin/src/plugins/link/linkui.js +1 -1
  74. package/src/lib/components/qms-stepper/qms-stepper.component.scss +4 -0
  75. package/src/lib/components/select-process-document/select-process-document.component.scss +3 -0
  76. package/src/lib/qms-ckeditor-components/components/qms-ckeditor-bpmn/qms-ckeditor-bpmn.component.scss +26 -0
  77. package/src/lib/qms-ckeditor-components/components/qms-ckeditor-load-template/qms-ckeditor-load-template.component.scss +5 -0
  78. package/src/lib/qms-ckeditor-components/components/qms-ckeditor-template/qms-ckeditor-template.component.scss +21 -0
@@ -149,6 +149,10 @@ export default class LinkCommand extends Command {
149
149
  * @param {Object} [manualDecoratorIds={}] The information about manual decorator attributes to be applied or removed upon execution.
150
150
  */
151
151
  execute(options) {
152
+ if(!options) {
153
+ return;
154
+ }
155
+
152
156
  const model = this.editor.model;
153
157
  const selection = model.document.selection;
154
158
  const manualDecoratorIds = {};
@@ -4,9 +4,10 @@ import { Collection, first } from '@ckeditor/ckeditor5-utils';
4
4
  import * as QMSCKEditorConstant from '../common/qmsCKEditorConstant';
5
5
  import * as QMSCKEditorEnum from '../common/qmsCKEditorEnum';
6
6
  import * as QMSCKEditorService from '../common/qmsCKEditorService';
7
- import { isImageAllowed } from './utils';
7
+ import { isImageAllowed, isLinkElement} from './utils';
8
8
  import AutomaticDecorators from './utils/automaticdecorators';
9
-
9
+ import * as QMSCKEditorUtil from '../common/qmsCKEditorUtil';
10
+
10
11
  export default class LinkDialogCommand extends Command {
11
12
  constructor( editor ) {
12
13
  super( editor );
@@ -48,18 +49,38 @@ import AutomaticDecorators from './utils/automaticdecorators';
48
49
  const ranges = selection.getFirstRange();
49
50
 
50
51
  let link = QMSCKEditorEnum.hyperLink;
51
- link.typeId = 0;
52
- link.targetId = 0;
53
- link.protocolId = 0;
54
- link.url = '';
55
- link.title = '';
56
- link.editorContent = '';
57
- link.ckeditorId = editor.id;
58
- for (const item of ranges.getItems()) {
59
- if (item.data) {
60
- link.title = item.data;
61
- }
62
- }
52
+
53
+ let parentLink = this._getSelectedLinkElement();
54
+
55
+ if(parentLink) {
56
+ let linkOption = parentLink.getAttribute('url') || parentLink.getAttribute('option');
57
+ link.typeId = QMSCKEditorUtil.getLinkType(linkOption);
58
+ link.targetId = parentLink.getAttribute('target') ? QMSCKEditorEnum.targetEnum[parentLink.getAttribute('target')] : 0;
59
+ if (parentLink._children.length > 0) {
60
+ link.title = parentLink._children[0]._textData ? parentLink._children[0]._textData.trim() : '';
61
+ }
62
+ else {
63
+ link.title = '';
64
+ }
65
+ link.protocolId = QMSCKEditorUtil.getProtocolId(linkOption);
66
+ link.url = parentLink.getAttribute('href') || '';
67
+ link.edit = true;
68
+ link.ckeditorId = editor.id;
69
+ } else {
70
+ link.typeId = 0;
71
+ link.targetId = 0;
72
+ link.protocolId = 0;
73
+ link.url = '';
74
+ link.title = '';
75
+ link.editorContent = '';
76
+ link.ckeditorId = editor.id;
77
+ for (const item of ranges.getItems()) {
78
+ if (item.data) {
79
+ link.title = item.data;
80
+ }
81
+ }
82
+ }
83
+
63
84
  QMSCKEditorService.linkNotify(link);
64
85
  window[QMSCKEditorConstant.QMSCK_LINKED] = false;
65
86
  window.addEventListener(QMSCKEditorConstant.QMSCK_LINK_PLUGIN_RESP, function(evt) {
@@ -88,4 +109,35 @@ import AutomaticDecorators from './utils/automaticdecorators';
88
109
 
89
110
  return doc.selection.getAttribute( decoratorName );
90
111
  }
112
+
113
+ _getSelectedLinkElement() {
114
+ const view = this.editor.editing.view;
115
+ const selection = view.document.selection;
116
+
117
+ if ( selection.isCollapsed ) {
118
+ return findLinkElementAncestor( selection.getFirstPosition() );
119
+ } else {
120
+ // The range for fully selected link is usually anchored in adjacent text nodes.
121
+ // Trim it to get closer to the actual link element.
122
+ const range = selection.getFirstRange().getTrimmed();
123
+ const startLink = findLinkElementAncestor( range.start );
124
+ const endLink = findLinkElementAncestor( range.end );
125
+
126
+ if ( !startLink || startLink != endLink ) {
127
+ return null;
128
+ }
129
+
130
+ // Check if the link element is fully selected.
131
+ if ( view.createRangeIn( startLink ).getTrimmed().isEqual( range ) ) {
132
+ return startLink;
133
+ } else {
134
+ return null;
135
+ }
136
+ }
137
+ }
138
+
91
139
  }
140
+
141
+ function findLinkElementAncestor( position ) {
142
+ return position.getAncestors().find( ancestor => isLinkElement( ancestor ) );
143
+ }
@@ -144,7 +144,7 @@ export default class LinkUI extends Plugin {
144
144
 
145
145
  parentLink = this._getSelectedLinkElement();
146
146
 
147
- const linkOption = parentLink.getAttribute('url');
147
+ let linkOption = parentLink.getAttribute('url') || parentLink.getAttribute('option');
148
148
  link.typeId = QMSCKEditorUtil.getLinkType(linkOption);
149
149
  link.targetId = parentLink.getAttribute('target') ? QMSCKEditorEnum.targetEnum[parentLink.getAttribute('target')] : 0;
150
150
  if (parentLink._children.length > 0) {
@@ -175,6 +175,10 @@
175
175
  }
176
176
 
177
177
  .is-mandatory-field {
178
+ color: #002E68 !important;
179
+ }
180
+
181
+ .is-deleted-field {
178
182
  color: #ef1d34 !important;
179
183
  }
180
184
  }
@@ -51,6 +51,8 @@
51
51
  }
52
52
 
53
53
  .panel-tree {
54
+ overflow: auto;
55
+ width: fit-content;
54
56
  .mat-expansion-panel-body {
55
57
  padding: 0 12px 12px;
56
58
  }
@@ -310,3 +312,4 @@ cdk-virtual-scroll-viewport {
310
312
  min-height: 300px;
311
313
  }
312
314
  }
315
+
@@ -17,6 +17,32 @@
17
17
  border: solid;
18
18
  border-width: 0px 1px 1px 0px;
19
19
  overflow-y: auto;
20
+
21
+ .textarea-field {
22
+ display: flex;
23
+ justify-content: space-between;
24
+ }
25
+
26
+ .range-field {
27
+ height: 40px;
28
+ margin-bottom: 15px;
29
+ }
30
+
31
+ .units {
32
+ font-size: 12px;
33
+ }
34
+
35
+ .connection-wrapper {
36
+ padding-bottom: 1.34375em;
37
+
38
+ .mat-card-wrapper {
39
+ padding-right: 0px;
40
+ }
41
+ .connection-content {
42
+ display: flex;
43
+ justify-content: space-between;
44
+ }
45
+ }
20
46
  }
21
47
 
22
48
  #toolbarpanel {
@@ -7,4 +7,9 @@
7
7
  .option {
8
8
  padding-left: 15px;
9
9
  }
10
+
11
+ .image-template {
12
+ width: 100%;
13
+ height: 100%;
14
+ }
10
15
  }
@@ -11,4 +11,25 @@
11
11
  .template-checkbox{
12
12
  padding-top: 20px;
13
13
  }
14
+
15
+ .selected-image {
16
+ display: flex;
17
+ align-items: center;
18
+ padding-bottom: 10px;
19
+
20
+ .input-upload {
21
+ height: 60px;
22
+ }
23
+ }
24
+
25
+ .form-content-height {
26
+ min-height: 350px;
27
+ max-height: 410px;
28
+ }
29
+
30
+ .template-button-group {
31
+ padding-top: 10px;
32
+ padding-right: 0.5rem;
33
+ padding-left: 0.5rem;
34
+ }
14
35
  }