@abi-software/map-side-bar 2.14.1-acupoint.0 → 2.14.1-beta.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.
- package/dist/map-side-bar.js +480 -468
- package/dist/map-side-bar.umd.cjs +34 -34
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/AcupointsCard.vue +30 -5
package/package.json
CHANGED
|
@@ -26,15 +26,18 @@
|
|
|
26
26
|
</div>
|
|
27
27
|
</template>
|
|
28
28
|
<template v-for="field in displayFields" :key="field['name']">
|
|
29
|
-
<div class="details"
|
|
29
|
+
<div class="details">
|
|
30
30
|
<strong>{{ field['name'] }}: </strong>
|
|
31
31
|
<template v-if="field['name'] === 'Link'">
|
|
32
32
|
<a :href="entry['Link']" target="_blank">
|
|
33
33
|
<span>
|
|
34
|
-
|
|
34
|
+
{{ entry['Link'] }}
|
|
35
35
|
</span>
|
|
36
36
|
</a>
|
|
37
37
|
</template>
|
|
38
|
+
<template v-else-if="field['name'] === 'Reference'">
|
|
39
|
+
<div v-html="formatReference(entry[field['name']])"></div>
|
|
40
|
+
</template>
|
|
38
41
|
<template v-else>
|
|
39
42
|
<span
|
|
40
43
|
v-if="!field['isEditing']"
|
|
@@ -81,16 +84,19 @@ export default {
|
|
|
81
84
|
expanded: [],
|
|
82
85
|
tags: [],
|
|
83
86
|
displayFields: [
|
|
87
|
+
{name: "Link", isEditing: false},
|
|
84
88
|
{name: "Synonym", isEditing: false},
|
|
89
|
+
{name: "Pinyin Name", isEditing: false},
|
|
85
90
|
{name: "Chinese Name", isEditing: false},
|
|
86
|
-
{name: "English Name", isEditing: false},
|
|
87
91
|
{name: "Meridian", isEditing: false},
|
|
88
92
|
{name: "Reference", isEditing: false},
|
|
89
93
|
{name: "Indications", isEditing: false},
|
|
90
94
|
{name: "Acupuncture Method", isEditing: false},
|
|
91
|
-
{name: "Vasculature", isEditing: false},
|
|
92
95
|
{name: "Innervation", isEditing: false},
|
|
93
|
-
{name: "
|
|
96
|
+
{name: "Nearby Nerve", isEditing: false},
|
|
97
|
+
{name: "Vasculature", isEditing: false},
|
|
98
|
+
{name: "Nearby Artery", isEditing: false},
|
|
99
|
+
{name: "Nearby Vein", isEditing: false},
|
|
94
100
|
//{name: "Notes", isEditing: false},
|
|
95
101
|
]
|
|
96
102
|
}
|
|
@@ -139,6 +145,25 @@ export default {
|
|
|
139
145
|
inputMounted: function(event) {
|
|
140
146
|
event.el?.querySelector('textarea')?.focus();
|
|
141
147
|
},
|
|
148
|
+
formatReference: function(text) {
|
|
149
|
+
if (!text) {
|
|
150
|
+
return 'Not Available';
|
|
151
|
+
}
|
|
152
|
+
// Escape HTML first so only the markup added below is rendered
|
|
153
|
+
const escaped = String(text)
|
|
154
|
+
.replace(/&/g, '&')
|
|
155
|
+
.replace(/</g, '<')
|
|
156
|
+
.replace(/>/g, '>')
|
|
157
|
+
.replace(/"/g, '"')
|
|
158
|
+
.replace(/'/g, ''');
|
|
159
|
+
return escaped
|
|
160
|
+
// Bold and italicise square-bracketed labels, e.g. [Acupoint Location, Pinyin Label]
|
|
161
|
+
.replace(/\[([^\]\n]+)\]/g, '<strong><em>[$1]</em></strong>')
|
|
162
|
+
// Turn http(s) URLs into links, leaving trailing punctuation outside
|
|
163
|
+
.replace(/https?:\/\/[^\s<]+?(?=[.,;:!?)]*(?:\s|<|$))/g,
|
|
164
|
+
(url) => `<a href="${url}" target="_blank" rel="noopener noreferrer">${url}</a>`)
|
|
165
|
+
.replace(/\n/g, '<br>');
|
|
166
|
+
},
|
|
142
167
|
setFieldToEditing: function(field) {
|
|
143
168
|
if (this.allowEditing) {
|
|
144
169
|
field['isEditing'] = true;
|