@processmaker/modeler 1.30.3 → 1.32.0

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 (207) hide show
  1. package/dist/.DS_Store +0 -0
  2. package/dist/img/{boundary-event.5bf51421.svg → boundary-event.4e0fb9de.svg} +3 -3
  3. package/dist/img/clipboard.5fe6f79e.svg +3 -0
  4. package/dist/img/conditional-start-event.a56e4b5b.svg +4 -0
  5. package/dist/img/{connect-artifacts.5f8bed89.svg → connect-artifacts.496eb4b9.svg} +3 -3
  6. package/dist/img/{connect-elements.d4abedf2.svg → connect-elements.9ec5ca93.svg} +3 -3
  7. package/dist/img/copy-regular.2d678143.svg +3 -0
  8. package/dist/img/data-object.0d6d1585.svg +3 -0
  9. package/dist/img/data-store.32bed5ce.svg +3 -0
  10. package/dist/img/{default-flow.212147b4.svg → default-flow.156a793b.svg} +3 -3
  11. package/dist/img/end-event.9d1ff5c0.svg +3 -0
  12. package/dist/img/error-end-event.aab86eca.svg +11 -0
  13. package/dist/img/event-based-gateway.9960eee5.svg +6 -0
  14. package/dist/img/exclusive-gateway.26db4fae.svg +4 -0
  15. package/dist/img/generic-gateway.09ca6929.svg +3 -0
  16. package/dist/img/generic-intermediate-event.a711eb33.svg +4 -0
  17. package/dist/img/inclusive-gateway.754cb36f.svg +4 -0
  18. package/dist/img/intermediate-conditional-catch-event.e9ae6198.svg +5 -0
  19. package/dist/img/intermediate-message-catch-event.9d25208e.svg +5 -0
  20. package/dist/img/intermediate-message-throw-event.4309dc45.svg +5 -0
  21. package/dist/img/intermediate-signal-catch-event.74b65f17.svg +5 -0
  22. package/dist/img/intermediate-signal-throw-event.29cad018.svg +5 -0
  23. package/dist/img/intermediate-timer-event.1670a1c8.svg +5 -0
  24. package/dist/img/issue-close.5d1630e6.svg +3 -0
  25. package/dist/img/issue-item.3187f291.svg +3 -0
  26. package/dist/img/issue-open.707390b4.svg +4 -0
  27. package/dist/img/{lane-below.890c069b.svg → lane-below.e67f9823.svg} +12 -12
  28. package/dist/img/manual-task.374a73c3.svg +4 -0
  29. package/dist/img/message-end-event.f15b67f5.svg +4 -0
  30. package/dist/img/message-start-event.f2d4a5e6.svg +4 -0
  31. package/dist/img/mini-map.ae46890c.svg +3 -0
  32. package/dist/img/minus.ca21cc3b.svg +3 -0
  33. package/dist/img/parallel-gateway.877bb628.svg +4 -0
  34. package/dist/img/pin-angle-fill.0e4af645.svg +3 -0
  35. package/dist/img/pin-angle.3462c115.svg +3 -0
  36. package/dist/img/plus.afbb0b13.svg +3 -0
  37. package/dist/img/pool.98d4734c.svg +3 -0
  38. package/dist/img/redo.8425ce7e.svg +4 -0
  39. package/dist/img/script-task.3d8c664a.svg +4 -0
  40. package/dist/img/signal-end-event.a38a6616.svg +4 -0
  41. package/dist/img/signal-start-event.3d7b096c.svg +4 -0
  42. package/dist/img/start-event.7f1911cb.svg +3 -0
  43. package/dist/img/sub-task.52d09847.svg +4 -0
  44. package/dist/img/task.8a1c6c75.svg +3 -0
  45. package/dist/img/terminate-end-event.3aa5cd00.svg +4 -0
  46. package/dist/img/text-annotation.02df53cd.svg +3 -0
  47. package/dist/img/timer-start-event.55abac82.svg +4 -0
  48. package/dist/img/trash-alt-solid.58c408b8.svg +1 -0
  49. package/dist/img/undo.e0ffff93.svg +4 -0
  50. package/dist/img/validate-close.09ace97a.svg +4 -0
  51. package/dist/img/validate-open.b0ecf74e.svg +4 -0
  52. package/dist/modeler.common.js +27454 -19961
  53. package/dist/modeler.common.js.map +1 -1
  54. package/dist/modeler.umd.js +27454 -19961
  55. package/dist/modeler.umd.js.map +1 -1
  56. package/dist/modeler.umd.min.js +28 -3
  57. package/dist/modeler.umd.min.js.map +1 -1
  58. package/jsconfig.json +12 -0
  59. package/package.json +4 -2
  60. package/src/.DS_Store +0 -0
  61. package/src/ModelerApp.vue +13 -22
  62. package/src/assets/boundary-event.svg +3 -3
  63. package/src/assets/clipboard.svg +3 -1
  64. package/src/assets/cog-solid.svg +1 -0
  65. package/src/assets/connect-artifacts.svg +3 -3
  66. package/src/assets/connect-elements.svg +3 -3
  67. package/src/assets/copy-regular.svg +3 -1
  68. package/src/assets/default-flow.svg +3 -3
  69. package/src/assets/lane-below.svg +12 -12
  70. package/src/assets/palette.svg +1 -0
  71. package/src/assets/pin-angle-fill.svg +3 -0
  72. package/src/assets/pin-angle.svg +3 -0
  73. package/src/assets/railBottom/mini-map.svg +3 -0
  74. package/src/assets/railBottom/minus.svg +3 -0
  75. package/src/assets/railBottom/plus.svg +3 -0
  76. package/src/assets/railBottom/redo.svg +4 -0
  77. package/src/assets/railBottom/undo.svg +4 -0
  78. package/src/assets/scss/settings/_settings.variables.scss +5 -0
  79. package/src/assets/scss/tools/_tools.chevron.scss +1 -1
  80. package/src/assets/toolpanel/conditional-start-event.svg +4 -0
  81. package/src/assets/toolpanel/data-object.svg +2 -8
  82. package/src/assets/toolpanel/data-store.svg +2 -5
  83. package/src/assets/toolpanel/end-event.svg +3 -19
  84. package/src/assets/toolpanel/error-end-event.svg +11 -0
  85. package/src/assets/toolpanel/event-based-gateway.svg +6 -0
  86. package/src/assets/toolpanel/exclusive-gateway.svg +4 -0
  87. package/src/assets/toolpanel/generic-gateway.svg +2 -13
  88. package/src/assets/toolpanel/generic-intermediate-event.svg +3 -4
  89. package/src/assets/toolpanel/inclusive-gateway.svg +4 -0
  90. package/src/assets/toolpanel/intermediate-conditional-catch-event.svg +5 -0
  91. package/src/assets/toolpanel/intermediate-message-catch-event.svg +5 -0
  92. package/src/assets/toolpanel/intermediate-message-throw-event.svg +4 -5
  93. package/src/assets/toolpanel/intermediate-signal-catch-event.svg +5 -0
  94. package/src/assets/toolpanel/intermediate-signal-throw-event.svg +5 -0
  95. package/src/assets/toolpanel/intermediate-timer-event.svg +5 -0
  96. package/src/assets/toolpanel/manual-task.svg +4 -0
  97. package/src/assets/toolpanel/message-end-event.svg +4 -0
  98. package/src/assets/toolpanel/message-start-event.svg +3 -3
  99. package/src/assets/toolpanel/parallel-gateway.svg +4 -0
  100. package/src/assets/toolpanel/pool.svg +3 -11
  101. package/src/assets/toolpanel/script-task.svg +4 -0
  102. package/src/assets/toolpanel/signal-end-event.svg +4 -0
  103. package/src/assets/toolpanel/signal-start-event.svg +4 -0
  104. package/src/assets/toolpanel/start-event.svg +3 -19
  105. package/src/assets/toolpanel/sub-task.svg +4 -0
  106. package/src/assets/toolpanel/task.svg +3 -14
  107. package/src/assets/toolpanel/terminate-end-event.svg +4 -0
  108. package/src/assets/toolpanel/text-annotation.svg +3 -17
  109. package/src/assets/toolpanel/timer-start-event.svg +4 -0
  110. package/src/assets/topRail/issue-close.svg +3 -0
  111. package/src/assets/topRail/issue-item.svg +3 -0
  112. package/src/assets/topRail/issue-open.svg +4 -0
  113. package/src/assets/topRail/validate-close.svg +4 -0
  114. package/src/assets/topRail/validate-open.svg +4 -0
  115. package/src/assets/trash-alt-solid.svg +1 -4
  116. package/src/components/crown/crownButtons/addLaneAboveButton.vue +6 -4
  117. package/src/components/crown/crownButtons/addLaneBelowButton.vue +6 -4
  118. package/src/components/crown/crownButtons/associationFlowButton.vue +1 -14
  119. package/src/components/crown/crownButtons/cloneButton.vue +1 -6
  120. package/src/components/crown/crownButtons/copyButton.vue +1 -4
  121. package/src/components/crown/crownButtons/crownBoundaryEventDropdown.vue +7 -2
  122. package/src/components/crown/crownButtons/crownButton.vue +36 -11
  123. package/src/components/crown/crownButtons/crownColorDropdown.vue +1 -1
  124. package/src/components/crown/crownButtons/crownDropdown.scss +4 -9
  125. package/src/components/crown/crownButtons/crownTaskDropdown.vue +1 -1
  126. package/src/components/crown/crownButtons/deleteButton.vue +1 -7
  127. package/src/components/crown/crownButtons/genericFlowButton.vue +4 -4
  128. package/src/components/crown/crownButtons/icons/faAlignBottom.js +11 -0
  129. package/src/components/crown/crownButtons/icons/faAlignLeft.js +11 -0
  130. package/src/components/crown/crownButtons/icons/faAlignRight.js +11 -0
  131. package/src/components/crown/crownButtons/icons/faAlignTop.js +11 -0
  132. package/src/components/crown/crownButtons/icons/faBoundaryEvent.js +11 -0
  133. package/src/components/crown/crownButtons/icons/faCenterHorizontally.js +11 -0
  134. package/src/components/crown/crownButtons/icons/faCenterVertically.js +11 -0
  135. package/src/components/crown/crownButtons/icons/faConnectElements.js +11 -0
  136. package/src/components/crown/crownButtons/icons/faDistributeHorizontally.js +11 -0
  137. package/src/components/crown/crownButtons/icons/faDistributeVertically.js +11 -0
  138. package/src/components/crown/crownButtons/icons/faLaneAbove.js +11 -0
  139. package/src/components/crown/crownButtons/icons/faLaneBelow.js +11 -0
  140. package/src/components/crown/crownButtons/icons/index.js +12 -0
  141. package/src/components/crown/crownConfig/crownConfig.scss +5 -4
  142. package/src/components/crown/crownConfig/crownConfig.vue +5 -2
  143. package/src/components/crown/crownMultiselect/crownAlign.scss +20 -0
  144. package/src/components/crown/crownMultiselect/crownAlign.vue +302 -0
  145. package/src/components/crown/crownMultiselect/crownMultiselect.vue +60 -14
  146. package/src/components/hotkeys/escKey.js +20 -0
  147. package/src/components/hotkeys/main.js +4 -2
  148. package/src/components/miniPaper/MiniPaper.vue +16 -2
  149. package/src/components/miniPaper/miniPaper.scss +6 -12
  150. package/src/components/modeler/Modeler.vue +32 -22
  151. package/src/components/modeler/ModelerReadonly.vue +1011 -0
  152. package/src/components/modeler/Selection.vue +11 -9
  153. package/src/components/nodes/endEvent/index.js +37 -0
  154. package/src/components/nodes/exclusiveGateway/index.js +30 -0
  155. package/src/components/nodes/index.js +1 -0
  156. package/src/components/nodes/intermediateTimerEvent/index.js +44 -0
  157. package/src/components/nodes/startEvent/index.js +43 -0
  158. package/src/components/nodes/task/index.js +30 -0
  159. package/src/components/railBottom/RailBottom.vue +120 -0
  160. package/src/components/railBottom/controls/Controls.vue +80 -0
  161. package/src/components/railBottom/controls/SubmenuPopper/SubmenuPopper.vue +188 -0
  162. package/src/components/railBottom/controls/controls.scss +98 -0
  163. package/src/components/railBottom/icons/MinusIcon.vue +5 -0
  164. package/src/components/railBottom/icons/PlusIcon.vue +5 -0
  165. package/src/components/railBottom/icons/index.js +2 -0
  166. package/src/components/railBottom/miniPaperControl/MiniPaperControl.vue +46 -0
  167. package/src/components/railBottom/miniPaperControl/miniPaperControl.scss +45 -0
  168. package/src/components/railBottom/railBottom.scss +28 -0
  169. package/src/components/railBottom/undoRedoControl/UndoRedoControl.vue +89 -0
  170. package/src/components/railBottom/undoRedoControl/undoRedoControl.scss +51 -0
  171. package/src/components/railBottom/zoomControl/ZoomControl.vue +80 -0
  172. package/src/components/railBottom/zoomControl/zoomControl.scss +66 -0
  173. package/src/components/rails/explorer-rail/explorer-rail.scss +55 -0
  174. package/src/components/rails/explorer-rail/explorer.vue +93 -0
  175. package/src/components/rails/explorer-rail/filterNodeTypes/filterNodeTypes.vue +54 -0
  176. package/src/components/rails/explorer-rail/nodeTypesLoop/nodeTypesLoop.vue +164 -0
  177. package/src/components/rails/explorer-rail/rankConstants.js +1 -0
  178. package/src/components/toolbar/ToolBar.vue +23 -80
  179. package/src/components/topRail/TopRail.vue +91 -0
  180. package/src/components/topRail/topRail.scss +6 -0
  181. package/src/components/topRail/validateControl/index.js +3 -0
  182. package/src/components/topRail/validateControl/validateButton/ValidateButton.vue +38 -0
  183. package/src/components/topRail/validateControl/validateButton/validateButton.scss +25 -0
  184. package/src/components/topRail/validateControl/validateIssue/ValidateIssue.vue +59 -0
  185. package/src/components/topRail/validateControl/validateIssue/validateIssue.scss +54 -0
  186. package/src/components/topRail/validateControl/validatePanel/ValidatePanel.vue +51 -0
  187. package/src/components/topRail/validateControl/validatePanel/validatePanel.scss +67 -0
  188. package/src/main.js +6 -0
  189. package/src/mixins/clickAndDrop.js +100 -0
  190. package/src/mixins/highlightConfig.js +52 -8
  191. package/src/mixins/linkConfig.js +7 -0
  192. package/src/mixins/resizeConfig.js +3 -1
  193. package/src/nodeTypesStore.js +133 -0
  194. package/src/store.js +5 -0
  195. package/dist/img/clipboard.bcc7796a.svg +0 -1
  196. package/dist/img/copy-regular.3eb4c04a.svg +0 -1
  197. package/dist/img/data-object.e931f8e7.svg +0 -9
  198. package/dist/img/data-store.7ca4c899.svg +0 -6
  199. package/dist/img/end-event.1ad31396.svg +0 -19
  200. package/dist/img/generic-gateway.3a76fc75.svg +0 -14
  201. package/dist/img/generic-intermediate-event.ba2e1d71.svg +0 -5
  202. package/dist/img/intermediate-message-throw-event.ac432d96.svg +0 -6
  203. package/dist/img/pool.ac62ddae.svg +0 -11
  204. package/dist/img/start-event.e895cee2.svg +0 -19
  205. package/dist/img/task.e7419065.svg +0 -14
  206. package/dist/img/text-annotation.926416f4.svg +0 -17
  207. package/dist/img/trash-alt-solid.f2f64c1f.svg +0 -4
@@ -0,0 +1,54 @@
1
+ <script>
2
+ import nodeTypesStore from '@/nodeTypesStore';
3
+ export default {
4
+ name: 'FilterNodeTypes',
5
+ data() {
6
+ return {
7
+ searchTerm: '',
8
+ placeholder: this.$t('Seach Objects'),
9
+ };
10
+ },
11
+ watch: {
12
+ searchTerm(value) {
13
+ if (value.length === 0) nodeTypesStore.commit('clearFilteredNodes');
14
+ if (value.length > 0) nodeTypesStore.commit('setFilteredNodeTypes', value);
15
+ },
16
+ },
17
+ computed: {
18
+ nodeTypes() {
19
+ const pinnedNodeTypes = nodeTypesStore.getters.getPinnedNodeTypes;
20
+ const nodeTypes = nodeTypesStore.getters.getNodeTypes;
21
+ return [...pinnedNodeTypes, ...nodeTypes];
22
+ },
23
+ },
24
+ };
25
+ </script>
26
+
27
+ <template>
28
+ <div id="searchNodeTypes">
29
+ <label class="position-relative d-block">
30
+ <i class="fas fa-search position-absolute h-100 text-muted ml-2" />
31
+ <b-input :placeholder="placeholder" v-model="searchTerm" />
32
+ </label>
33
+ </div>
34
+
35
+ </template>
36
+
37
+ <style lang="scss" scoped>
38
+ #searchNodeTypes {
39
+ i {
40
+ top: 27%;
41
+ }
42
+ input {
43
+ border: 1px solid #5F666D;
44
+ border-radius: 4px;
45
+ margin-bottom: 1rem;
46
+ font-size: 14px;
47
+ line-height: 21px;
48
+ padding-left: 30px;
49
+ &::placeholder {
50
+ color: #929FAC;
51
+ }
52
+ }
53
+ }
54
+ </style>
@@ -0,0 +1,164 @@
1
+ <script>
2
+ import pinIcon from '@/assets/pin-angle.svg';
3
+ import pinFillIcon from '@/assets/pin-angle-fill.svg';
4
+ import nodeTypesStore from '@/nodeTypesStore';
5
+ import clickAndDrop from '@/mixins/clickAndDrop';
6
+
7
+ export default {
8
+ name: 'NodeTypesLoop',
9
+ mixins: [clickAndDrop],
10
+ data() {
11
+ return {
12
+ pinIcon,
13
+ pinFillIcon,
14
+ showPin: false,
15
+ };
16
+ },
17
+ created() {
18
+ nodeTypesStore.dispatch('getUserPinnedObjects');
19
+ },
20
+ methods: {
21
+ nodeTypeAlreadyPinned(object, type) {
22
+ return !!this.pinnedObjects.find(obj => obj.type === type);
23
+ },
24
+ unPin(object) {
25
+ return nodeTypesStore.dispatch('removeUserPinnedObject', object);
26
+ },
27
+ addPin(object) {
28
+ return nodeTypesStore.dispatch('addUserPinnedObject', object);
29
+ },
30
+ },
31
+ computed: {
32
+ pinnedObjects() {
33
+ return nodeTypesStore.getters.getPinnedNodeTypes;
34
+ },
35
+ objects() {
36
+ return nodeTypesStore.getters.getNodeTypes;
37
+ },
38
+ unpinnedObjects() {
39
+ const objects = this.objects;
40
+ return objects.filter((obj) => !this.pinnedObjects.some(pinnedObj => pinnedObj.type === obj.type));
41
+ },
42
+ filteredNodes() {
43
+ return nodeTypesStore.getters.getFilteredNodeTypes;
44
+ },
45
+ searchTerm() {
46
+ return nodeTypesStore.getters.getSearchTerm;
47
+ },
48
+ },
49
+ };
50
+ </script>
51
+
52
+ <template>
53
+ <div id="nodeTypesList">
54
+ <div id="filteredNodes-container" v-if="filteredNodes.length > 0">
55
+ <template v-for="object in filteredNodes">
56
+ <div
57
+ class="node-types__item"
58
+ :key="object.id"
59
+ @mouseover="showPin = true"
60
+ @mouseleave="showPin = false"
61
+ @click.stop="onClickHandler($event, object)"
62
+ >
63
+ <img class="node-types__item__icon" :src="object.icon" :alt="$t(object.label)">
64
+ <span>{{ $t(object.label) }}</span>
65
+ <img
66
+ v-if="nodeTypeAlreadyPinned(object, object.type)"
67
+ :src="pinFillIcon"
68
+ class="pinIcon"
69
+ alt="Unpin Element"
70
+ @click="unPin(object)"
71
+ >
72
+ <img
73
+ v-else
74
+ :src="pinIcon"
75
+ class="pinIcon"
76
+ alt="Pin Element"
77
+ @click="addPin(object)"
78
+ >
79
+ </div>
80
+ </template>
81
+ </div>
82
+ <template v-if="filteredNodes.length === 0 && !searchTerm">
83
+ <div class="pinnedObjects" v-if="pinnedObjects.length > 0">
84
+ <p>{{ $t('Pinned Objects') }}</p>
85
+ <template v-for="pinnedObject in pinnedObjects">
86
+ <div
87
+ class="node-types__item"
88
+ :key="pinnedObject.id"
89
+ @mouseover="showPin = true"
90
+ @mouseleave="showPin = false"
91
+ @click.stop="onClickHandler($event, pinnedObject)"
92
+ >
93
+ <img class="node-types__item__icon" :src="pinnedObject.icon" :alt="$t(pinnedObject.label)">
94
+ <span>{{ $t(pinnedObject.label) }}</span>
95
+ <img
96
+ :src="pinFillIcon"
97
+ class="pinIcon"
98
+ alt="Pin/Unpin Element"
99
+ @click="unPin(pinnedObject)"
100
+ >
101
+ </div>
102
+ </template>
103
+ </div>
104
+ <div class="objectCategory">
105
+ <p>{{ $t('Object Category') }}</p>
106
+ <template v-for="nodeType in unpinnedObjects">
107
+ <div
108
+ class="node-types__item"
109
+ :key="nodeType.id"
110
+ @mouseover="showPin = true"
111
+ @mouseleave="showPin = false"
112
+ @click.stop="onClickHandler($event, nodeType)"
113
+ >
114
+ <img class="node-types__item__icon" :src="nodeType.icon" :alt="$t(nodeType.label)">
115
+ <span>{{ $t(nodeType.label) }}</span>
116
+ <img
117
+ :src="pinIcon"
118
+ class="pinIcon"
119
+ alt="Pin/Unpin Element"
120
+ @click="addPin(nodeType)"
121
+ >
122
+ </div>
123
+ </template>
124
+ </div>
125
+ </template>
126
+ </div>
127
+ </template>
128
+
129
+ <style lang="scss">
130
+ #nodeTypesList {
131
+ .pinnedObjects {
132
+ margin-bottom: 1rem;
133
+ }
134
+ }
135
+ .node-types {
136
+ &__item {
137
+ display: flex;
138
+ padding: 0.5rem 0.3rem;
139
+ align-items: center;
140
+ border-radius: 4px;
141
+ user-select: none;
142
+ &:hover {
143
+ background-color: #EBEEF2;
144
+ .pinIcon {
145
+ background-color: #DADDDF;
146
+ }
147
+ }
148
+ &__icon {
149
+ width: 1.5rem;
150
+ height: 1.5rem;
151
+ }
152
+ span {
153
+ margin-left: 0.8rem;
154
+ font-size: 13px;
155
+ line-height: 19px;
156
+ }
157
+ .pinIcon {
158
+ margin-left: auto;
159
+ border-radius: 4px;
160
+ padding: 0.3rem;
161
+ }
162
+ }
163
+ }
164
+ </style>
@@ -0,0 +1 @@
1
+ export const BOTTOM = 5000;
@@ -4,65 +4,13 @@
4
4
  aria-label="Toolbar" :class="{ 'ignore-pointer': canvasDragPosition }"
5
5
  >
6
6
  <breadcrumb :breadcrumb-data="breadcrumbData" />
7
- <div class="mr-3">
8
- <align-buttons @save-state="$emit('save-state')" />
7
+ <div class="d-flex mr-3">
8
+ <TopRail
9
+ :validation-errors="validationErrors"
10
+ :warnings="warnings"
11
+ />
9
12
 
10
- <div class="btn-group btn-group-sm mr-2" role="group" aria-label="Undo/redo controls">
11
- <b-button
12
- class="btn btn-sm btn-secondary btn-undo"
13
- :disabled="!canUndo"
14
- data-test="undo"
15
- v-b-tooltip.hover
16
- :title="$t('Undo')"
17
- @click="undo"
18
- >
19
- <font-awesome-icon :icon="undoIcon" />
20
- </b-button>
21
-
22
- <b-button
23
- class="btn btn-sm btn-secondary btn-redo"
24
- :disabled="!canRedo"
25
- data-test="redo"
26
- v-b-tooltip.hover
27
- :title="$t('Redo')"
28
- @click="redo"
29
- >
30
- <font-awesome-icon :icon="redoIcon" />
31
- </b-button>
32
- </div>
33
-
34
- <div class="btn-group btn-group-sm mr-2" role="group" aria-label="Zoom controls">
35
- <b-button
36
- class="btn btn-sm btn-secondary"
37
- @click="paperManager.scale = paperManager.scale.sx + scaleStep"
38
- data-test="zoom-in"
39
- v-b-tooltip.hover
40
- :title="$t('Zoom In')"
41
- >
42
- <font-awesome-icon :icon="plusIcon" />
43
- </b-button>
44
- <b-button
45
- class="btn btn-sm btn-secondary"
46
- @click="paperManager.scale = Math.max(minimumScale, paperManager.scale.sx -= scaleStep)"
47
- data-test="zoom-out"
48
- v-b-tooltip.hover
49
- :title="$t('Zoom Out')"
50
- >
51
- <font-awesome-icon :icon="minusIcon" />
52
- </b-button>
53
- <b-button
54
- v-if="paperManager"
55
- class="btn btn-sm btn-secondary"
56
- @click="paperManager.scale = initialScale"
57
- :disabled="paperManager.scale.sx === initialScale"
58
- data-test="zoom-reset"
59
- v-b-tooltip.hover
60
- :title="$t('Reset to initial scale')"
61
- >
62
- {{ $t('Reset') }}
63
- </b-button>
64
- <span v-if="paperManager" class="btn btn-sm btn-secondary scale-value">{{ Math.round(paperManager.scale.sx*100) }}%</span>
65
- </div>
13
+ <align-buttons @save-state="$emit('save-state')" />
66
14
 
67
15
  <div class="btn-group btn-group-sm mr-2" role="group" aria-label="Additional controls">
68
16
  <b-button
@@ -74,16 +22,6 @@
74
22
  >
75
23
  <font-awesome-icon :icon="panelsCompressed ? expandIcon : compressIcon" />
76
24
  </b-button>
77
-
78
- <b-button
79
- class="btn btn-sm btn-secondary mini-map-btn ml-auto"
80
- data-test="mini-map-btn"
81
- @click="miniMapOpen = !miniMapOpen"
82
- v-b-tooltip.hover
83
- :title="miniMapOpen ? $t('Hide Mini-Map') : $t('Show Mini-Map')"
84
- >
85
- <font-awesome-icon :icon="miniMapOpen ? minusIcon : mapIcon" />
86
- </b-button>
87
25
  </div>
88
26
  <div class="btn-group btn-group-sm" role="group" aria-label="Publish controls">
89
27
  <template v-if="isVersionsInstalled">
@@ -144,23 +82,28 @@ import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
144
82
  import { faCompress, faExpand, faMapMarked, faMinus, faPlus, faRedo, faUndo, faSave, faCheckCircle, faSpinner } from '@fortawesome/free-solid-svg-icons';
145
83
  import undoRedoStore from '@/undoRedoStore';
146
84
  import Breadcrumb from '@/components/toolbar/breadcrumb/Breadcrumb';
85
+ import TopRail from '@/components/topRail/TopRail.vue';
147
86
  import AlignButtons from '@/components/toolbar/alignButtons/AlignButtons';
148
87
 
149
88
  export default {
150
89
  name: 'tool-bar',
151
- components: { Breadcrumb, FontAwesomeIcon, AlignButtons },
152
- props: {
153
- canvasDragPosition: {},
154
- cursor: {},
155
- paperManager: {},
156
- isRendering: {
157
- type: Boolean,
158
- },
159
- breadcrumbData: {
160
- type: Array,
161
- },
162
- panelsCompressed: Boolean,
90
+ components: {
91
+ Breadcrumb,
92
+ TopRail,
93
+ FontAwesomeIcon,
94
+ AlignButtons,
163
95
  },
96
+ props: [
97
+ 'canvasDragPosition',
98
+ 'cursor',
99
+ 'paperManager',
100
+ 'isRendering',
101
+ 'breadcrumbData',
102
+ 'panelsCompressed',
103
+ 'validationErrors',
104
+ 'warnings',
105
+ 'xmlManager',
106
+ ],
164
107
  watch: {
165
108
  miniMapOpen(isOpen) {
166
109
  this.$emit('toggle-mini-map-open', isOpen);
@@ -0,0 +1,91 @@
1
+ <template>
2
+ <div class="top-rail-container">
3
+ <ValidateIssue
4
+ v-show="isOpenIssue"
5
+ :number-of-errors="numberOfErrors"
6
+ @openPanel="handleOpenPanel"
7
+ />
8
+
9
+ <ValidateButton @openIssue="handleOpenIssue" />
10
+
11
+ <ValidatePanel
12
+ v-show="isOpenIssue && isOpenPanel"
13
+ :error-list="errorList"
14
+ :warnings="warnings"
15
+ />
16
+ </div>
17
+ </template>
18
+
19
+ <script>
20
+ import store from '@/store';
21
+ import { ValidateButton, ValidateIssue, ValidatePanel } from '@/components/topRail/validateControl';
22
+
23
+ export default {
24
+ components: {
25
+ ValidateButton,
26
+ ValidateIssue,
27
+ ValidatePanel,
28
+ },
29
+ props: {
30
+ validationErrors: {
31
+ type: Object,
32
+ required: true,
33
+ },
34
+ warnings: {
35
+ type: Array,
36
+ required: true,
37
+ },
38
+ },
39
+ data() {
40
+ return {
41
+ isOpenIssue: false,
42
+ isOpenPanel: false,
43
+ };
44
+ },
45
+ computed: {
46
+ errorList() {
47
+ // Get a formatted error list to show in the issue panel
48
+ return Object.entries(this.validationErrors)
49
+ .flatMap(([errorKey, errors]) => (
50
+ errors.flatMap(error => ({
51
+ ...error,
52
+ errorKey,
53
+ ...{ 'errorId': `${error.id}_${error.message.split(' ').join('_')}` },
54
+ }))
55
+ ));
56
+ },
57
+ numberOfErrors() {
58
+ // Get the number of errors
59
+ return this.errorList.length + this.warnings.length;
60
+ },
61
+ },
62
+ watch: {
63
+ numberOfErrors(newValue) {
64
+ // Checks the number of errors, if it is "0" hides the panel errors
65
+ if (newValue === 0) {
66
+ this.isOpenPanel = false;
67
+ }
68
+ },
69
+ },
70
+ methods: {
71
+ /**
72
+ * Show/hide the issue button
73
+ * @param {boolean} value
74
+ */
75
+ handleOpenIssue(value) {
76
+ this.isOpenIssue = value;
77
+ // Set the auto-validate value store
78
+ store.commit('setAutoValidate', this.isOpenIssue);
79
+ },
80
+ /**
81
+ * Show/hide the issue panel
82
+ * @param {boolean} value
83
+ */
84
+ handleOpenPanel(value) {
85
+ this.isOpenPanel = value;
86
+ },
87
+ },
88
+ };
89
+ </script>
90
+
91
+ <style scoped lang="scss" src="./topRail.scss"></style>
@@ -0,0 +1,6 @@
1
+ .top-rail-container {
2
+ position: relative;
3
+ display: flex;
4
+ align-items: center;
5
+ padding: 0px 8px;
6
+ }
@@ -0,0 +1,3 @@
1
+ export { default as ValidateButton } from './validateButton/ValidateButton.vue';
2
+ export { default as ValidateIssue } from './validateIssue/ValidateIssue.vue';
3
+ export { default as ValidatePanel } from './validatePanel/ValidatePanel.vue';
@@ -0,0 +1,38 @@
1
+ <template>
2
+ <button
3
+ type="button"
4
+ @click.prevent="handleOpen"
5
+ :class="['validate-button', { 'validate-button-active': isOpen }]"
6
+ >
7
+ <inline-svg :src="isOpen ? validateOpenIcon : validateCloseIcon" />
8
+ </button>
9
+ </template>
10
+
11
+ <script>
12
+ import InlineSvg from 'vue-inline-svg';
13
+
14
+ export default {
15
+ components: {
16
+ InlineSvg,
17
+ },
18
+ data() {
19
+ return {
20
+ isOpen: false,
21
+ validateCloseIcon: require('@/assets/topRail/validate-close.svg'),
22
+ validateOpenIcon: require('@/assets/topRail/validate-open.svg'),
23
+ };
24
+ },
25
+ methods: {
26
+ /**
27
+ * Show/hide issue button
28
+ */
29
+ handleOpen() {
30
+ this.isOpen = !this.isOpen;
31
+
32
+ this.$emit('openIssue', this.isOpen);
33
+ },
34
+ },
35
+ };
36
+ </script>
37
+
38
+ <style scoped lang="scss" src="./validateButton.scss"></style>
@@ -0,0 +1,25 @@
1
+ .validate-button {
2
+ display: flex;
3
+ justify-content: center;
4
+ align-items: center;
5
+ width: 32px;
6
+ height: 32px;
7
+ background-color: #EBEEF2;
8
+ border: 0 none;
9
+ border-radius: 4px;
10
+ transition: background-color 0.3s ease;
11
+
12
+ & > svg {
13
+ width: 18px;
14
+ fill: #212529;
15
+ }
16
+
17
+ &:active,
18
+ &-active {
19
+ background-color: #104A75;
20
+
21
+ & > svg {
22
+ fill: #ffffff;
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,59 @@
1
+ <template>
2
+ <button
3
+ type="button"
4
+ :disabled="numberOfErrors === 0"
5
+ @click.prevent="handleOpen"
6
+ class="issue-box"
7
+ >
8
+ <span class="issue-title">Issues</span>
9
+
10
+ <span class="issue-badge">{{ numberOfErrors }}</span>
11
+
12
+ <span class="issue-icon">
13
+ <inline-svg :src="isOpen ? issueOpenIcon : issueCloseIcon" />
14
+ </span>
15
+ </button>
16
+ </template>
17
+
18
+ <script>
19
+ import InlineSvg from 'vue-inline-svg';
20
+
21
+ export default {
22
+ components: {
23
+ InlineSvg,
24
+ },
25
+ props: {
26
+ numberOfErrors: {
27
+ type: Number,
28
+ required: true,
29
+ },
30
+ },
31
+ data() {
32
+ return {
33
+ isOpen: false,
34
+ issueCloseIcon: require('@/assets/topRail/issue-close.svg'),
35
+ issueOpenIcon: require('@/assets/topRail/issue-open.svg'),
36
+ };
37
+ },
38
+ watch: {
39
+ numberOfErrors(newValue) {
40
+ // Checks the number of errors if it is "0" reset the issue icon
41
+ if (newValue === 0) {
42
+ this.isOpen = false;
43
+ }
44
+ },
45
+ },
46
+ methods: {
47
+ /**
48
+ * Show/hide the issue panel
49
+ */
50
+ handleOpen() {
51
+ this.isOpen = !this.isOpen;
52
+
53
+ this.$emit('openPanel', this.isOpen);
54
+ },
55
+ },
56
+ };
57
+ </script>
58
+
59
+ <style scoped lang="scss" src="./validateIssue.scss"></style>
@@ -0,0 +1,54 @@
1
+ .issue {
2
+ &-box {
3
+ display: flex;
4
+ align-items: center;
5
+ background-color: #EBEEF2;
6
+ margin-right: 12px;
7
+ padding: 4px 8px;
8
+ border: 0 none;
9
+ border-radius: 4px;
10
+ font-family: 'Open Sans';
11
+ }
12
+
13
+ &-title {
14
+ font-weight: 400;
15
+ font-size: 14px;
16
+ line-height: 21px;
17
+ letter-spacing: -0.02em;
18
+ color: #212529;
19
+ }
20
+
21
+ &-badge {
22
+ display: flex;
23
+ justify-content: center;
24
+ align-items: center;
25
+ min-width: 16px;
26
+ height: 20px;
27
+ margin: {
28
+ left: 7px;
29
+ right: 15px;
30
+ };
31
+ padding: {
32
+ left: 3px;
33
+ right: 3px;
34
+ };
35
+ background: #FFAB00;
36
+ border-radius: 8px;
37
+ font-size: 12.8px;
38
+ font-weight: 400;
39
+ color: #FFFFFF;
40
+ }
41
+
42
+ &-icon {
43
+ display: flex;
44
+ justify-content: center;
45
+ align-items: center;
46
+ width: 14px;
47
+ height: 14px;
48
+ padding: 0px;
49
+
50
+ & > svg {
51
+ fill: #212529;
52
+ }
53
+ }
54
+ }
@@ -0,0 +1,51 @@
1
+ <template>
2
+ <div class="validate-container">
3
+ <div v-for="(error, index) in errorList" :key="`${error.errorId}_${index}`" class="validate-item-box">
4
+ <vue-inline-svg :src="issueIcon" />
5
+
6
+ <div class="validate-item-info">
7
+ <div class="validate-item-title">{{ error.errorKey }}</div>
8
+ <div class="validate-item-description">{{ error.message }}.</div>
9
+ <div class="validate-item-node" v-if="error.id">
10
+ <span class="validate-item-node-title">{{ $t('Node ID') }}:</span> {{ error.id }}
11
+ </div>
12
+ </div>
13
+ </div>
14
+
15
+ <div v-for="(warning, index) in warnings" :key="warning.title + index" class="validate-item-box">
16
+ <vue-inline-svg :src="issueIcon" />
17
+
18
+ <div class="validate-item-info">
19
+ <div class="validate-item-title">{{ warning.title }}</div>
20
+ <div class="validate-item-description">{{ warning.text }}.</div>
21
+ </div>
22
+ </div>
23
+ </div>
24
+ </template>
25
+
26
+ <script>
27
+ import VueInlineSvg from 'vue-inline-svg';
28
+
29
+ export default {
30
+ components: {
31
+ VueInlineSvg,
32
+ },
33
+ props: {
34
+ errorList: {
35
+ type: Array,
36
+ required: true,
37
+ },
38
+ warnings: {
39
+ type: Array,
40
+ required: true,
41
+ },
42
+ },
43
+ data() {
44
+ return {
45
+ issueIcon: require('@/assets/topRail/issue-item.svg'),
46
+ };
47
+ },
48
+ };
49
+ </script>
50
+
51
+ <style scoped lang="scss" src="./validatePanel.scss"></style>