@abi-software/map-side-bar 2.11.2 → 2.11.4

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,323 +0,0 @@
1
- <template>
2
- <div v-if="entry" class="main">
3
- <div class="header">
4
- <el-input
5
- class="search-input"
6
- placeholder="Search"
7
- v-model="searchInput"
8
- @keyup="search(searchInput)"
9
- clearable
10
- @clear="clearSearchClicked"
11
- ></el-input>
12
- <el-button
13
- v-show="false"
14
- type="primary"
15
- class="button"
16
- @click="search(searchInput)"
17
- size="large"
18
- >
19
- Search
20
- </el-button>
21
- </div>
22
- <div class="content scrollbar" ref="content">
23
- <div v-for="result in paginatedResults" :key="result.Acupoint" class="step-item">
24
- <AcupointsCard
25
- class="dataset-card"
26
- :entry="result"
27
- @mouseenter="hoverChanged(result)"
28
- @mouseleave="hoverChanged(undefined)"
29
- />
30
- </div>
31
- <el-pagination
32
- class="pagination"
33
- v-model:current-page="page"
34
- hide-on-single-page
35
- large
36
- layout="prev, pager, next"
37
- :page-size="numberPerPage"
38
- :total="numberOfHits"
39
- @current-change="pageChange"
40
- ></el-pagination>
41
- </div>
42
- </div>
43
- </template>
44
-
45
- <script>
46
- /* eslint-disable no-alert, no-console */
47
- import {
48
- ElButton as Button,
49
- ElCard as Card,
50
- ElDrawer as Drawer,
51
- ElIcon as Icon,
52
- ElInput as Input,
53
- ElPagination as Pagination,
54
- } from 'element-plus'
55
- import AcupointsCard from './AcupointsCard.vue'
56
-
57
- export default {
58
- components: {
59
- AcupointsCard,
60
- Button,
61
- Card,
62
- Drawer,
63
- Icon,
64
- Input,
65
- Pagination
66
- },
67
- name: 'AcupointsInfoSearch',
68
- props: {
69
- entry: {
70
- type: Object,
71
- default: () => initial_state,
72
- },
73
- },
74
- data: function () {
75
- return {
76
- results: [],
77
- paginatedResults: [],
78
- searchInput: "",
79
- lastSearch: "",
80
- numberOfHits: 0,
81
- numberPerPage: 10,
82
- page: 1,
83
- }
84
- },
85
- watch: {
86
- entry: {
87
- handler: function () {
88
- this.search(
89
- this.searchInput,
90
- this.numberPerPage,
91
- this.page
92
- )
93
- },
94
- immediate: true,
95
- deep: true,
96
- },
97
- },
98
- methods: {
99
- hoverChanged: function (data) {
100
- this.$emit('hover-changed', data)
101
- },
102
- resetSearch: function () {
103
- this.numberOfHits = 0
104
- this.search(this.searchInput)
105
- },
106
- clearSearchClicked: function () {
107
- this.searchInput = '';
108
- this.search("");
109
- },
110
- search: function(input) {
111
- this.results = []
112
- if (input !== this.previousSearch) {
113
- if (input === "") {
114
- this.results = Object.values(this.entry)
115
- } else {
116
- const lowerCase = input.toLowerCase()
117
- for (const value of Object.values(this.entry)) {
118
- const searchFields = [
119
- value["Acupoint"],
120
- value["Synonym"],
121
- value["Chinese Name"],
122
- value["English Name"],
123
- value["Reference"],
124
- value["Indications"],
125
- value["Acupuncture Method"],
126
- value["Vasculature"],
127
- value["Innervation"]
128
- ];
129
- const allstrings = searchFields.join();
130
- const myJSON = allstrings.toLowerCase();
131
- if (myJSON.includes(lowerCase)) {
132
- this.results.push(value)
133
- }
134
- }
135
- }
136
- }
137
- const start = this.numberPerPage * (this.page - 1)
138
- this.paginatedResults = this.results.slice(start, start + this.numberPerPage)
139
- this.numberOfHits = this.results.length
140
- this.searchInput = input
141
- this.lastSearch = input
142
- console.log(this.numberOfHits)
143
- },
144
- numberPerPageUpdate: function (val) {
145
- this.numberPerPage = val
146
- this.pageChange(1)
147
- },
148
- pageChange: function (page) {
149
- this.page = page
150
- this.search( this.searchInput)
151
- },
152
- scrollToTop: function () {
153
- if (this.$refs.content) {
154
- this.$refs.content.scroll({ top: 0, behavior: 'smooth' })
155
- }
156
- },
157
- resetPageNavigation: function () {
158
- this.page = 1
159
- },
160
- },
161
- }
162
- </script>
163
-
164
- <style lang="scss" scoped>
165
- .dataset-card {
166
- position: relative;
167
-
168
- &::before {
169
- content: "";
170
- display: block;
171
- width: calc(100% - 15px);
172
- height: 100%;
173
- position: absolute;
174
- top: 7px;
175
- left: 7px;
176
- border-style: solid;
177
- border-radius: 5px;
178
- border-color: transparent;
179
- }
180
-
181
- &:hover {
182
- &::before {
183
- border-color: var(--el-color-primary);
184
- }
185
- }
186
- }
187
-
188
- .main {
189
- font-size: 14px;
190
- text-align: left;
191
- line-height: 1.5em;
192
- font-family: Asap, sans-serif, Helvetica;
193
- font-weight: 400;
194
- /* outline: thin red solid; */
195
- overflow-y: auto;
196
- scrollbar-width: thin;
197
- min-width: 16rem;
198
- background-color: #f7faff;
199
- height: 100%;
200
- border-left: 1px solid var(--el-border-color);
201
- border-top: 1px solid var(--el-border-color);
202
- display: flex;
203
- flex-direction: column;
204
- gap: 1.75rem;
205
- padding: 1rem;
206
- }
207
-
208
- .step-item {
209
- font-size: 14px;
210
- margin-bottom: 18px;
211
- text-align: left;
212
- }
213
-
214
- .search-input {
215
- width: 298px !important;
216
- height: 40px;
217
- padding-right: 14px;
218
-
219
- :deep(.el-input__inner) {
220
- font-family: inherit;
221
- }
222
- }
223
-
224
- .header {
225
- .el-button {
226
- font-family: inherit;
227
-
228
- &:hover,
229
- &:focus {
230
- background: $app-primary-color;
231
- box-shadow: -3px 2px 4px #00000040;
232
- color: #fff;
233
- }
234
- }
235
- }
236
-
237
- .pagination {
238
- padding-bottom: 16px;
239
- background-color: white;
240
- padding-left: 95px;
241
- font-weight: bold;
242
- }
243
-
244
- .pagination :deep(button) {
245
- background-color: white !important;
246
- }
247
- .pagination :deep(li) {
248
- background-color: white !important;
249
- }
250
- .pagination :deep(li.is-active) {
251
- color: $app-primary-color;
252
- }
253
-
254
- .error-feedback {
255
- font-family: Asap;
256
- font-size: 14px;
257
- font-style: italic;
258
- padding-top: 15px;
259
- }
260
-
261
- .content-card :deep(.el-card__header) {
262
- background-color: #292b66;
263
- padding: 1rem;
264
- }
265
-
266
- .content-card :deep(.el-card__body) {
267
- background-color: #f7faff;
268
- overflow-y: hidden;
269
- padding: 1rem;
270
- }
271
-
272
- .content {
273
- // width: 515px;
274
- flex: 1 1 auto;
275
- box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.06);
276
- border: solid 1px #e4e7ed;
277
- background-color: #ffffff;
278
- overflow-y: scroll;
279
- scrollbar-width: thin;
280
- border-radius: var(--el-border-radius-base);
281
- }
282
-
283
- .content :deep(.el-loading-spinner .path) {
284
- stroke: $app-primary-color;
285
- }
286
-
287
- .content :deep(.step-item:first-child .seperator-path) {
288
- display: none;
289
- }
290
-
291
- .content :deep(.step-item:not(:first-child) .seperator-path) {
292
- width: 455px;
293
- height: 0px;
294
- border: solid 1px #e4e7ed;
295
- background-color: #e4e7ed;
296
- }
297
-
298
- .scrollbar::-webkit-scrollbar-track {
299
- border-radius: 10px;
300
- background-color: #f5f5f5;
301
- }
302
-
303
- .scrollbar::-webkit-scrollbar {
304
- width: 12px;
305
- right: -12px;
306
- background-color: #f5f5f5;
307
- }
308
-
309
- .scrollbar::-webkit-scrollbar-thumb {
310
- border-radius: 4px;
311
- box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.06);
312
- background-color: #979797;
313
- }
314
-
315
- :deep(.el-input__suffix) {
316
- padding-right: 0px;
317
- }
318
-
319
- :deep(.my-drawer) {
320
- background: rgba(0, 0, 0, 0);
321
- box-shadow: none;
322
- }
323
- </style>