qms-angular 1.0.20 → 1.0.24

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 (42) hide show
  1. package/bundles/qms-angular.umd.js +141 -56
  2. package/bundles/qms-angular.umd.js.map +1 -1
  3. package/esm2015/lib/components/related/common/tree.function.js +2 -2
  4. package/esm2015/lib/components/related/list-other-related/list-related.component.js +9 -3
  5. package/esm2015/lib/components/related/model/danger-assessment.model.js +1 -1
  6. package/esm2015/lib/components/related/model/danger.model.js +1 -1
  7. package/esm2015/lib/components/related/model/risk-result.model.js +2 -1
  8. package/esm2015/lib/components/related/model/selected-node.model.js +1 -1
  9. package/esm2015/lib/components/related/popup/related-popup.component.js +83 -27
  10. package/esm2015/lib/components/related/risk/list/list.component.js +7 -4
  11. package/esm2015/lib/components/related/risk/result/result.component.js +4 -2
  12. package/esm2015/lib/components/related/tree/tree.component.js +7 -4
  13. package/esm2015/lib/directives/tooltip/tooltip-renderer.directive.js +4 -3
  14. package/esm2015/lib/model/en.js +3 -1
  15. package/esm2015/lib/model/no.js +3 -1
  16. package/esm2015/lib/qms-ckeditor-components/common/functions/common.function.js +9 -5
  17. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-link/attachments/link-attachment.component.js +8 -2
  18. package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-link/qms-ckeditor-link.component.js +3 -3
  19. package/esm2015/lib/qms-ckeditor-components/qms-ckeditor.component.js +2 -2
  20. package/fesm2015/qms-angular.js +141 -56
  21. package/fesm2015/qms-angular.js.map +1 -1
  22. package/lib/components/related/list-other-related/list-related.component.d.ts +2 -0
  23. package/lib/components/related/model/danger-assessment.model.d.ts +3 -0
  24. package/lib/components/related/model/danger.model.d.ts +3 -0
  25. package/lib/components/related/model/risk-result.model.d.ts +1 -0
  26. package/lib/components/related/model/selected-node.model.d.ts +1 -0
  27. package/lib/components/related/popup/related-popup.component.d.ts +1 -0
  28. package/lib/components/related/risk/result/result.component.d.ts +1 -0
  29. package/lib/model/en.d.ts +2 -0
  30. package/lib/model/no.d.ts +2 -0
  31. package/lib/qms-ckeditor-components/common/functions/common.function.d.ts +2 -0
  32. package/package.json +1 -1
  33. package/qms-angular.metadata.json +1 -1
  34. package/src/assets/qms-ckeditor-plugin/build/ckeditor.js +1 -1
  35. package/src/assets/qms-ckeditor-plugin/build/ckeditor.js.map +1 -1
  36. package/src/assets/qms-ckeditor-plugin/src/plugins/common/qmsCKEditorConstant.js +1 -0
  37. package/src/assets/qms-ckeditor-plugin/src/plugins/link/linkcommand.js +3 -1
  38. package/src/assets/qms-ckeditor-plugin/src/plugins/link/linkediting.js +47 -6
  39. package/src/assets/qms-ckeditor-plugin/src/plugins/link/linkui.js +10 -4
  40. package/src/assets/qms-ckeditor-plugin/src/themes/tyles/linkactions.css +0 -1
  41. package/src/lib/components/related/popup/related-popup.component.scss +21 -13
  42. package/src/lib/components/related/risk/list/list.component.scss +18 -4
@@ -8,3 +8,4 @@ export const QMSCK_LOAD_TEMPLATE_PLUGIN_RESP = 'QMSCK_LOAD_TEMPLATE_PLUGIN_RESP'
8
8
  export const QMSCK_LINKED = 'LINKED'
9
9
  export const QMSCK_LINK_PLUGIN_MSG = 'QMSCK_LINK_PLUGIN_MSG';
10
10
  export const QMSCK_LINK_PLUGIN_RESP = 'QMSCK_LINK_PLUGIN_RESP';
11
+ export const QMSCK_LINK_OPTION = 'LINK_OPTION'
@@ -180,7 +180,7 @@ export default class LinkCommand extends Command {
180
180
  const response = evt.detail;
181
181
  const target = QMSCKEditorEnum.protocolEnum[response.protocolId];
182
182
  const url = response.url;
183
- const href = url;
183
+ const href = url.substring(2, url.length);
184
184
  const title = response.title ? response.title : url;
185
185
 
186
186
  for(let i= 0; i < linkDecorators.length-2; i++){
@@ -199,6 +199,8 @@ export default class LinkCommand extends Command {
199
199
  }
200
200
 
201
201
  model.change( writer => {
202
+ // set link option value
203
+ window[QMSCKEditorConstant.QMSCK_LINK_OPTION] = url.substring(0, 2);
202
204
  // If selection is collapsed then update selected link or insert new one at the place of caret.
203
205
  if ( selection.isCollapsed ) {
204
206
  const position = selection.getFirstPosition();
@@ -17,8 +17,9 @@ import LinkCommand from './linkcommand';
17
17
  import UnlinkCommand from './unlinkcommand';
18
18
  import ManualDecorator from './utils/manualdecorator';
19
19
  import { createLinkElement, ensureSafeUrl, getLocalizedDecorators, normalizeDecorators } from './utils';
20
-
20
+ import * as QMSCKEditorConstant from '../common/qmsCKEditorConstant';
21
21
  import '../../themes/tyles/link.css';
22
+ import { isLinkElement } from './utils';
22
23
 
23
24
  const HIGHLIGHT_CLASS = 'ck-link_selected';
24
25
  const DECORATOR_AUTOMATIC = 'automatic';
@@ -189,12 +190,22 @@ export default class LinkEditing extends Plugin {
189
190
  editor.conversion.for( 'downcast' ).attributeToElement( {
190
191
  model: decorator.id,
191
192
  view: ( manualDecoratorName, { writer } ) => {
192
- if ( manualDecoratorName ) {
193
+ if ( manualDecoratorName) {
193
194
  const attributes = manualDecorators.get( decorator.id ).attributes;
194
- const element = writer.createAttributeElement( 'a', attributes, { priority: 5 } );
195
- writer.setCustomProperty( 'link', true, element );
196
-
197
- return element;
195
+ let linkOption = window[QMSCKEditorConstant.QMSCK_LINK_OPTION]? window[QMSCKEditorConstant.QMSCK_LINK_OPTION] : '00';
196
+ let parentLink = this._getSelectedLinkElement();
197
+ if (parentLink && window[QMSCKEditorConstant.QMSCK_LINKED]) {
198
+ try {
199
+ linkOption = parentLink.parent.getChild(0).getAttribute('url');
200
+ } catch{
201
+ linkOption = parentLink.parent.getChild(1).getAttribute('url');
202
+ }
203
+ }
204
+ attributes.url = linkOption;
205
+ const element = writer.createAttributeElement( 'a', attributes, { priority: 5 } );
206
+ writer.setCustomProperty( 'link', true, element );
207
+
208
+ return element;
198
209
  }
199
210
  } } );
200
211
 
@@ -210,6 +221,32 @@ export default class LinkEditing extends Plugin {
210
221
  } );
211
222
  }
212
223
 
224
+ _getSelectedLinkElement() {
225
+ const view = this.editor.editing.view;
226
+ const selection = view.document.selection;
227
+
228
+ if ( selection.isCollapsed ) {
229
+ return findLinkElementAncestor( selection.getFirstPosition() );
230
+ } else {
231
+ // The range for fully selected link is usually anchored in adjacent text nodes.
232
+ // Trim it to get closer to the actual link element.
233
+ const range = selection.getFirstRange().getTrimmed();
234
+ const startLink = findLinkElementAncestor( range.start );
235
+ const endLink = findLinkElementAncestor( range.end );
236
+
237
+ if ( !startLink || startLink != endLink ) {
238
+ return null;
239
+ }
240
+
241
+ // Check if the link element is fully selected.
242
+ if ( view.createRangeIn( startLink ).getTrimmed().isEqual( range ) ) {
243
+ return startLink;
244
+ } else {
245
+ return null;
246
+ }
247
+ }
248
+ }
249
+
213
250
  /**
214
251
  * Starts listening to {@link module:engine/model/model~Model#event:insertContent} and corrects the model
215
252
  * selection attributes if the selection is at the end of a link after inserting the content.
@@ -573,3 +610,7 @@ function isTyping( editor ) {
573
610
 
574
611
  return input.isInput( editor.model.change( writer => writer.batch ) );
575
612
  }
613
+
614
+ function findLinkElementAncestor( position ) {
615
+ return position.getAncestors().find( ancestor => isLinkElement( ancestor ) );
616
+ }
@@ -140,11 +140,17 @@ export default class LinkUI extends Plugin {
140
140
  else {
141
141
  parentLink = this._getSelectedLinkElement();
142
142
  }
143
- link.typeId = QMSCKEditorUtil.getLinkType(href);
143
+ const linkOption = parentLink.getAttribute('url');
144
+ link.typeId = QMSCKEditorUtil.getLinkType(linkOption);
144
145
  link.targetId = parentLink.getAttribute('target') ? QMSCKEditorEnum.targetEnum[parentLink.getAttribute('target')] : 0;
145
- link.title = parentLink._children[0]._textData ? parentLink._children[0]._textData : '';
146
- link.protocolId = QMSCKEditorUtil.getProtocolId(href);
147
- link.url = QMSCKEditorUtil.getUrl(href);
146
+ if (parentLink._children.length > 0) {
147
+ link.title = parentLink._children[0]._textData ? parentLink._children[0]._textData.trim() : '';
148
+ }
149
+ else {
150
+ link.title = '';
151
+ }
152
+ link.protocolId = QMSCKEditorUtil.getProtocolId(linkOption);
153
+ link.url = href;
148
154
  link.edit = true;
149
155
  window[QMSCKEditorConstant.QMSCK_LINKED] = false;
150
156
  QMSCKEditorService.linkNotify(link);
@@ -17,7 +17,6 @@
17
17
  overflow: hidden;
18
18
  width: 100px;
19
19
  text-overflow: ellipsis;
20
- direction: rtl;
21
20
  }
22
21
  }
23
22
 
@@ -73,33 +73,41 @@
73
73
 
74
74
  .panel__item {
75
75
  height: 100px;
76
- overflow: auto;
77
76
  margin-top: 12px;
77
+ overflow-x: hidden;
78
+ overflow-y: auto;
79
+ padding-right: 5px;
80
+ width: 100%;
81
+ max-width: 100%;
82
+ display: flex;
83
+ flex-wrap: wrap;
84
+ align-content: flex-start;
78
85
 
79
86
  .related__item__inline {
80
- display: inline;
81
- width: auto;
87
+ max-width: 100%;
82
88
  }
83
89
 
84
90
  .related__item__content {
85
- background-color: rgba(0, 0, 0, 0.04);
86
- border: 1px solid #e0e0e0;
87
- border-radius: 4px;
88
- display: inline-block;
89
- padding: 2px 4px;
90
- margin-left: 5px;
91
+ height: 32px;
92
+ line-height: 32px;
93
+ background-color: $related-item-background;
94
+ max-width: 100%;
91
95
  margin-bottom: 5px;
96
+ margin-left: 2.5px;
97
+ margin-right: 2.5px;
92
98
 
93
99
  .mat-icon {
94
100
  color: $related-mat-icon-color;
95
- font-size: 22px;
96
- vertical-align: middle;
97
- margin-left: 7px;
98
- cursor: pointer;
101
+ font-size: 24px;
99
102
  }
100
103
 
101
104
  span.related__item__content_name {
102
105
  display: inline-block;
106
+ width: auto;
107
+ width: calc(100% - 13px);
108
+ white-space: nowrap;
109
+ overflow: hidden;
110
+ text-overflow: ellipsis;
103
111
  }
104
112
  }
105
113
  }
@@ -44,6 +44,21 @@
44
44
  height: 40px;
45
45
  line-height: 40px;
46
46
  }
47
+
48
+ .label-archived {
49
+ font-weight: 600;
50
+ font-size: 0.875rem;
51
+ line-height: 1rem;
52
+ color: #525252;
53
+ padding: 5px;
54
+ background: linear-gradient(
55
+ 0deg,
56
+ rgba(0, 0, 0, 0.1),
57
+ rgba(0, 0, 0, 0.1)
58
+ ),
59
+ #ffffff;
60
+ border-radius: 2px;
61
+ }
47
62
  }
48
63
  }
49
64
 
@@ -82,7 +97,7 @@
82
97
 
83
98
  border-bottom: 1px solid #ddd;
84
99
  color: $primary;
85
- min-height: 48px;
100
+ min-height: 48px;
86
101
  border-bottom: 1px solid #ddd;
87
102
 
88
103
  .title {
@@ -104,7 +119,7 @@
104
119
  width: 24px;
105
120
  height: 24px;
106
121
 
107
- font-size: 0.75rem;
122
+ font-size: 0.75rem;
108
123
  border-radius: 1px;
109
124
  }
110
125
 
@@ -123,7 +138,6 @@
123
138
  color: white;
124
139
  }
125
140
 
126
-
127
141
  .cursor {
128
142
  cursor: pointer;
129
- }
143
+ }