@abi-software/flatmapvuer 1.2.0 → 1.3.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.
@@ -1,236 +0,0 @@
1
- <template>
2
- <div class="selections-container">
3
- <el-row>
4
- <el-col :span="12">
5
- <div class="title-text">Systems</div>
6
- </el-col>
7
- </el-row>
8
- <div class="tree-container">
9
- <el-tree
10
- ref="tree"
11
- node-key="key"
12
- show-checkbox
13
- :check-strictly="false"
14
- :data="treeData"
15
- :render-after-expand="false"
16
- :default-expanded-keys="defaultExpandedKeys"
17
- @check="checkChanged"
18
- >
19
- <template #default="{ node, data }">
20
- <span
21
- class="region-tree-node"
22
- :class="{
23
- activeItem: nodeIsActive(data),
24
- hoverItem: nodeIsHover(data),
25
- }"
26
- @click="changeActiveByNode(data)"
27
- @mouseover="changeHoverByNode(data)"
28
- >
29
- <div :style="getBackgroundStyles(data)">
30
- {{ node.label }}
31
- </div>
32
- </span>
33
- </template>
34
- </el-tree>
35
- </div>
36
- </div>
37
- </template>
38
-
39
- <script>
40
- /* eslint-disable no-alert, no-console */
41
- import {
42
- ElCheckbox as Checkbox,
43
- ElCheckboxGroup as CheckboxGroup,
44
- ElColorPicker as ColorPicker,
45
- ElRow as Row,
46
- ElTree as Tree,
47
- } from 'element-plus'
48
-
49
- /**
50
- * A vue component for toggling visibility of various regions.
51
- */
52
- export default {
53
- name: 'TreeControls',
54
- components: {
55
- Checkbox,
56
- CheckboxGroup,
57
- ColorPicker,
58
- Row,
59
- Tree,
60
- },
61
- props: {
62
- treeData: {
63
- type: Array,
64
- default: function () {
65
- return []
66
- },
67
- },
68
- active: {
69
- type: String,
70
- default: '',
71
- },
72
- hover: {
73
- type: String,
74
- default: '',
75
- },
76
- },
77
- data: function () {
78
- return {
79
- defaultExpandedKeys: ['All'],
80
- }
81
- },
82
- unmounted: function () {
83
- this.sortedPrimitiveGroups = undefined
84
- },
85
- methods: {
86
- nodeIsActive: function (data) {
87
- return this.active === data.models
88
- },
89
- nodeIsHover: function (data) {
90
- return this.hover === data.models
91
- },
92
- changeActiveByNode: function (data) {
93
- if (data.models) {
94
- this.$emit('change-active', data.models)
95
- }
96
- },
97
- changeHoverByNode: function () {
98
- //if (data.models) {
99
- // this.$emit("change-active", data.models);
100
- //}
101
- },
102
- checkChanged: function (node, data) {
103
- const isChecked = data.checkedKeys.includes(node.key)
104
- if (node.key === 'All') {
105
- this.$emit('checkAll', isChecked)
106
- } else {
107
- this.$emit('changed', { key: node.key, value: isChecked })
108
- }
109
- },
110
- getBackgroundStyles: function (node) {
111
- if ('colour' in node) {
112
- return { background: node.colour }
113
- }
114
- return {}
115
- },
116
- },
117
- }
118
- </script>
119
-
120
- <style lang="scss" scoped>
121
-
122
- .selections-container {
123
- padding-top: 5px;
124
- }
125
-
126
- .checkbox-container {
127
- display: flex;
128
- cursor: pointer;
129
- }
130
-
131
- .tree-controls {
132
- position: absolute;
133
- bottom: 0px;
134
- transition: all 1s ease;
135
-
136
- &:focus {
137
- outline: none;
138
- }
139
- }
140
-
141
- .container {
142
- text-align: left;
143
- overflow: none;
144
- padding-top: 7px;
145
- padding-bottom: 16px;
146
- background: #ffffff;
147
- }
148
-
149
- .title-text {
150
- width: 59px;
151
- height: 20px;
152
- color: rgb(48, 49, 51);
153
- font-size: 14px;
154
- font-weight: normal;
155
- line-height: 20px;
156
- margin-left: 8px;
157
- }
158
-
159
- .all-checkbox {
160
- float: right;
161
- }
162
-
163
- .tree-container {
164
- width: 260px;
165
- border: 1px solid rgb(144, 147, 153);
166
- border-radius: 4px;
167
- background: #ffffff;
168
- margin-top: 6px;
169
- scrollbar-width: thin;
170
- overflow: hidden;
171
-
172
- :deep(.el-tree) {
173
- max-height: 240px;
174
- min-height: 130px;
175
- overflow: auto;
176
- &::-webkit-scrollbar {
177
- width: 4px;
178
- }
179
-
180
- &::-webkit-scrollbar-thumb {
181
- border-radius: 10px;
182
- box-shadow: inset 0 0 6px #c0c4cc;
183
- }
184
- }
185
-
186
- :deep(.el-tree-node__content) {
187
- height: 22px;
188
- }
189
- }
190
-
191
- :deep(.el-checkbox__input) {
192
- &.is-indeterminate,
193
- &.is-checked {
194
- .el-checkbox__inner {
195
- background-color: $app-primary-color;
196
- border-color: $app-primary-color;
197
- }
198
- }
199
- }
200
-
201
- :deep(
202
- .el-tree-node__children
203
- .el-tree-node__children
204
- .el-tree-node__content
205
- > label.el-checkbox) {
206
- display: none;
207
- }
208
-
209
- :deep(.el-checkbox__label) {
210
- padding-left: 5px;
211
- color: $app-primary-color !important;
212
- font-size: 12px;
213
- font-weight: 500;
214
- letter-spacing: 0px;
215
- line-height: 14px;
216
- }
217
-
218
- .activeItem {
219
- background-color: #bbb !important;
220
- }
221
-
222
- .region-tree-node {
223
- flex: 1;
224
- color: $app-primary-color !important;
225
- display: flex;
226
- font-size: 12px;
227
- line-height: 14px;
228
- padding-left: 0px;
229
- background-color: #fff;
230
- width: 100%;
231
- }
232
-
233
- .hoverItem {
234
- background-color: #eee !important;
235
- }
236
- </style>