@tekkare/auriga 0.2.45 → 0.2.47
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/module.json +1 -1
- package/dist/runtime/components/argToolbarContent.vue +30 -2
- package/dist/runtime/components/argToolbarContent.vue.d.ts +12 -0
- package/dist/runtime/components/argToolbarSources.vue +1 -1
- package/dist/runtime/components/localTextHighlight.vue +251 -0
- package/dist/runtime/components/localTextHighlight.vue.d.ts +96 -0
- package/dist/runtime/components/locales/en.json +2 -1
- package/dist/runtime/components/locales/es.json +2 -1
- package/dist/runtime/components/locales/fr.json +2 -1
- package/dist/runtime/components/locales/jp.json +2 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<div class="oip_info_container" @click.stop>
|
|
7
7
|
<div v-if="infoOpen" class="oip_info_close" @click="closeInfo()">
|
|
8
8
|
<arg-icon name="X" size="20" />
|
|
9
|
-
<p>
|
|
9
|
+
<p>{{langData}}</p>
|
|
10
10
|
</div>
|
|
11
11
|
<div
|
|
12
12
|
class="oip_info_section"
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
import {
|
|
58
58
|
onMounted,
|
|
59
59
|
ref,
|
|
60
|
+
onBeforeMount,
|
|
60
61
|
defineComponent,
|
|
61
62
|
watch
|
|
62
63
|
} from "vue";
|
|
@@ -84,12 +85,38 @@ export default defineComponent({
|
|
|
84
85
|
sourceAmount: {
|
|
85
86
|
type: Number,
|
|
86
87
|
required: true
|
|
88
|
+
},
|
|
89
|
+
lang: {
|
|
90
|
+
type: String,
|
|
91
|
+
default: "en",
|
|
92
|
+
validator: (value) => {
|
|
93
|
+
return ["en", "fr", "es", "jp"].includes(value);
|
|
94
|
+
}
|
|
87
95
|
}
|
|
88
96
|
},
|
|
89
97
|
emits: ["update:Open", "update:Menu"],
|
|
90
98
|
setup(props, { emit }) {
|
|
91
99
|
const trueActiveMenu = ref("");
|
|
92
100
|
const infoOpen = ref(false);
|
|
101
|
+
const langData = ref("Close");
|
|
102
|
+
async function setLang() {
|
|
103
|
+
const jsonFiles = import.meta.glob("./locales/*.json");
|
|
104
|
+
for (const path in jsonFiles) {
|
|
105
|
+
if (path.split("/")[2].includes(props.lang)) {
|
|
106
|
+
const json = await jsonFiles[path]();
|
|
107
|
+
langData.value = json.close;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
onBeforeMount(async () => {
|
|
112
|
+
setLang();
|
|
113
|
+
});
|
|
114
|
+
watch(
|
|
115
|
+
() => props.lang,
|
|
116
|
+
() => {
|
|
117
|
+
setLang();
|
|
118
|
+
}
|
|
119
|
+
);
|
|
93
120
|
watch(
|
|
94
121
|
() => props.toolbarOpen,
|
|
95
122
|
(new_info_open) => {
|
|
@@ -130,7 +157,8 @@ export default defineComponent({
|
|
|
130
157
|
infoOpen,
|
|
131
158
|
trueActiveMenu,
|
|
132
159
|
openMenu,
|
|
133
|
-
closeInfo
|
|
160
|
+
closeInfo,
|
|
161
|
+
langData
|
|
134
162
|
};
|
|
135
163
|
}
|
|
136
164
|
});
|
|
@@ -18,11 +18,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
18
18
|
type: NumberConstructor;
|
|
19
19
|
required: true;
|
|
20
20
|
};
|
|
21
|
+
lang: {
|
|
22
|
+
type: StringConstructor;
|
|
23
|
+
default: string;
|
|
24
|
+
validator: (value: string) => boolean;
|
|
25
|
+
};
|
|
21
26
|
}, {
|
|
22
27
|
infoOpen: import("vue").Ref<boolean>;
|
|
23
28
|
trueActiveMenu: import("vue").Ref<string>;
|
|
24
29
|
openMenu: (item: string) => void;
|
|
25
30
|
closeInfo: () => void;
|
|
31
|
+
langData: import("vue").Ref<any>;
|
|
26
32
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:Menu" | "update:Open")[], "update:Menu" | "update:Open", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
27
33
|
toolbarOpen: {
|
|
28
34
|
type: BooleanConstructor;
|
|
@@ -43,10 +49,16 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
43
49
|
type: NumberConstructor;
|
|
44
50
|
required: true;
|
|
45
51
|
};
|
|
52
|
+
lang: {
|
|
53
|
+
type: StringConstructor;
|
|
54
|
+
default: string;
|
|
55
|
+
validator: (value: string) => boolean;
|
|
56
|
+
};
|
|
46
57
|
}>> & {
|
|
47
58
|
"onUpdate:Menu"?: ((...args: any[]) => any) | undefined;
|
|
48
59
|
"onUpdate:Open"?: ((...args: any[]) => any) | undefined;
|
|
49
60
|
}, {
|
|
61
|
+
lang: string;
|
|
50
62
|
toolbarOpen: boolean;
|
|
51
63
|
toolbarArray: unknown[];
|
|
52
64
|
activeMenu: string;
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="haveReadMore && needsMore ? 'crop_display' : ''">
|
|
3
|
+
<div
|
|
4
|
+
:id="id"
|
|
5
|
+
:class="crop && !showMore ? 'crop' : ''"
|
|
6
|
+
:style="crop && !showMore ? `-webkit-line-clamp: ${lines}` : ''"
|
|
7
|
+
v-html="renderText"
|
|
8
|
+
/>
|
|
9
|
+
<arg-text-btn v-if="crop && haveReadMore && needsMore" @click="toggleMore">
|
|
10
|
+
{{ getReadMore }}
|
|
11
|
+
</arg-text-btn>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
import { onMounted, ref, computed, defineComponent } from "vue";
|
|
17
|
+
import argTextBtn from "./argTextBtn.vue";
|
|
18
|
+
export default defineComponent({
|
|
19
|
+
name: "localTextHighlight",
|
|
20
|
+
components: { argTextBtn },
|
|
21
|
+
props: {
|
|
22
|
+
text: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: true
|
|
25
|
+
},
|
|
26
|
+
queries: {
|
|
27
|
+
type: Array,
|
|
28
|
+
default: null
|
|
29
|
+
},
|
|
30
|
+
crop: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: false
|
|
33
|
+
},
|
|
34
|
+
lines: {
|
|
35
|
+
type: Number,
|
|
36
|
+
default: 3
|
|
37
|
+
},
|
|
38
|
+
haveReadMore: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: false
|
|
41
|
+
},
|
|
42
|
+
id: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: null
|
|
45
|
+
},
|
|
46
|
+
customReadMore: {
|
|
47
|
+
type: Object,
|
|
48
|
+
default: null
|
|
49
|
+
},
|
|
50
|
+
lang: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: "en",
|
|
53
|
+
validator: (value) => {
|
|
54
|
+
return ["en", "fr", "es"].includes(value);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
emits: ["onShowMore", "onShowLess"],
|
|
59
|
+
setup(props, { emit }) {
|
|
60
|
+
const showMore = ref(false);
|
|
61
|
+
const indic = ref(null);
|
|
62
|
+
const getReadMore = computed(() => {
|
|
63
|
+
if (props.customReadMore !== null) {
|
|
64
|
+
return showMore.value ? props.customReadMore.less : props.customReadMore.more;
|
|
65
|
+
} else {
|
|
66
|
+
const texts = {
|
|
67
|
+
more: { en: "Read more", fr: "Voir plus", es: "Ver m\xE1s" },
|
|
68
|
+
less: { en: "Read less", fr: "Voir moins", es: "Ver menos" }
|
|
69
|
+
};
|
|
70
|
+
return showMore.value ? texts.less[props.lang] : texts.more[props.lang];
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
function toggleMore() {
|
|
74
|
+
showMore.value = !showMore.value;
|
|
75
|
+
if (showMore.value) {
|
|
76
|
+
emit("onShowMore");
|
|
77
|
+
} else {
|
|
78
|
+
emit("onShowLess");
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function escapeRegExp(str) {
|
|
82
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\<script lang="ts">
|
|
83
|
+
import { onMounted, ref, computed, defineComponent } from "vue";
|
|
84
|
+
import argTextBtn from "./argTextBtn.vue";
|
|
85
|
+
|
|
86
|
+
export default defineComponent({
|
|
87
|
+
name: "localTextHighlight",
|
|
88
|
+
components: { argTextBtn },
|
|
89
|
+
props: {
|
|
90
|
+
text: {
|
|
91
|
+
type: String,
|
|
92
|
+
required: true,
|
|
93
|
+
},
|
|
94
|
+
queries: {
|
|
95
|
+
type: Array as () => string[],
|
|
96
|
+
default: null,
|
|
97
|
+
},
|
|
98
|
+
crop: {
|
|
99
|
+
type: Boolean,
|
|
100
|
+
default: false,
|
|
101
|
+
},
|
|
102
|
+
lines: {
|
|
103
|
+
type: Number,
|
|
104
|
+
default: 3,
|
|
105
|
+
},
|
|
106
|
+
haveReadMore: {
|
|
107
|
+
type: Boolean,
|
|
108
|
+
default: false,
|
|
109
|
+
},
|
|
110
|
+
id: {
|
|
111
|
+
type: String,
|
|
112
|
+
default: null,
|
|
113
|
+
},
|
|
114
|
+
customReadMore: {
|
|
115
|
+
type: Object as () => { more: string; less: string },
|
|
116
|
+
default: null,
|
|
117
|
+
},
|
|
118
|
+
lang: {
|
|
119
|
+
type: String as () => "en" | "fr" | "es",
|
|
120
|
+
default: "en",
|
|
121
|
+
validator: (value: string) => {
|
|
122
|
+
return ["en", "fr", "es"].includes(value);
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
emits: ["onShowMore", "onShowLess"],
|
|
127
|
+
setup(props, { emit }) {
|
|
128
|
+
const showMore = ref(false);
|
|
129
|
+
const indic = ref<HTMLElement | null>(null);
|
|
130
|
+
|
|
131
|
+
const getReadMore = computed(() => {
|
|
132
|
+
if (props.customReadMore !== null) {
|
|
133
|
+
return showMore.value
|
|
134
|
+
? props.customReadMore.less
|
|
135
|
+
: props.customReadMore.more;
|
|
136
|
+
} else {
|
|
137
|
+
const texts = {
|
|
138
|
+
more: { en: "Read more", fr: "Voir plus", es: "Ver más" },
|
|
139
|
+
less: { en: "Read less", fr: "Voir moins", es: "Ver menos" },
|
|
140
|
+
};
|
|
141
|
+
return showMore.value ? texts.less[props.lang] : texts.more[props.lang];
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
function toggleMore() {
|
|
146
|
+
showMore.value = !showMore.value;
|
|
147
|
+
|
|
148
|
+
if (showMore.value) {
|
|
149
|
+
emit("onShowMore");
|
|
150
|
+
} else {
|
|
151
|
+
emit("onShowLess");
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function escapeRegExp(str: string) {
|
|
156
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const needsMore = computed(() => {
|
|
160
|
+
const fullHeight = ref(0);
|
|
161
|
+
const originalHeight = ref(0);
|
|
162
|
+
|
|
163
|
+
if (indic.value !== null) {
|
|
164
|
+
indic.value.classList.remove("crop");
|
|
165
|
+
|
|
166
|
+
fullHeight.value = indic.value.clientHeight;
|
|
167
|
+
indic.value.classList.add("crop");
|
|
168
|
+
originalHeight.value = indic.value.clientHeight;
|
|
169
|
+
}
|
|
170
|
+
return fullHeight.value > originalHeight.value;
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
const renderText = computed(() => {
|
|
174
|
+
let returnText = props.text;
|
|
175
|
+
if (
|
|
176
|
+
props.queries !== null &&
|
|
177
|
+
props.queries.length > 0 &&
|
|
178
|
+
returnText !== null
|
|
179
|
+
) {
|
|
180
|
+
props.queries.forEach((word: string) => {
|
|
181
|
+
const regex = new RegExp(`\\b(${escapeRegExp(word)})\\b`, "gi");
|
|
182
|
+
returnText = returnText.replace(regex, (match: string) => {
|
|
183
|
+
if (match.toLowerCase() === "mark") {
|
|
184
|
+
return match;
|
|
185
|
+
}
|
|
186
|
+
return `<mark>${match}</mark>`;
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
return returnText;
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
onMounted(() => {
|
|
195
|
+
indic.value = document.getElementById(props.id);
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
return {
|
|
199
|
+
showMore,
|
|
200
|
+
needsMore,
|
|
201
|
+
renderText,
|
|
202
|
+
getReadMore,
|
|
203
|
+
toggleMore,
|
|
204
|
+
};
|
|
205
|
+
},
|
|
206
|
+
});
|
|
207
|
+
</script>");
|
|
208
|
+
}
|
|
209
|
+
const needsMore = computed(() => {
|
|
210
|
+
const fullHeight = ref(0);
|
|
211
|
+
const originalHeight = ref(0);
|
|
212
|
+
if (indic.value !== null) {
|
|
213
|
+
indic.value.classList.remove("crop");
|
|
214
|
+
fullHeight.value = indic.value.clientHeight;
|
|
215
|
+
indic.value.classList.add("crop");
|
|
216
|
+
originalHeight.value = indic.value.clientHeight;
|
|
217
|
+
}
|
|
218
|
+
return fullHeight.value > originalHeight.value;
|
|
219
|
+
});
|
|
220
|
+
const renderText = computed(() => {
|
|
221
|
+
let returnText = props.text;
|
|
222
|
+
if (props.queries !== null && props.queries.length > 0 && returnText !== null) {
|
|
223
|
+
props.queries.forEach((word) => {
|
|
224
|
+
const regex = new RegExp(`\\b(${escapeRegExp(word)})\\b`, "gi");
|
|
225
|
+
returnText = returnText.replace(regex, (match) => {
|
|
226
|
+
if (match.toLowerCase() === "mark") {
|
|
227
|
+
return match;
|
|
228
|
+
}
|
|
229
|
+
return `<mark>${match}</mark>`;
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
return returnText;
|
|
234
|
+
});
|
|
235
|
+
onMounted(() => {
|
|
236
|
+
indic.value = document.getElementById(props.id);
|
|
237
|
+
});
|
|
238
|
+
return {
|
|
239
|
+
showMore,
|
|
240
|
+
needsMore,
|
|
241
|
+
renderText,
|
|
242
|
+
getReadMore,
|
|
243
|
+
toggleMore
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
</script>
|
|
248
|
+
|
|
249
|
+
<style scoped>
|
|
250
|
+
.crop{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden}.crop_display{align-items:flex-start;display:flex;flex-direction:column;gap:8px}
|
|
251
|
+
</style>
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
text: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
queries: {
|
|
7
|
+
type: () => string[];
|
|
8
|
+
default: null;
|
|
9
|
+
};
|
|
10
|
+
crop: {
|
|
11
|
+
type: BooleanConstructor;
|
|
12
|
+
default: boolean;
|
|
13
|
+
};
|
|
14
|
+
lines: {
|
|
15
|
+
type: NumberConstructor;
|
|
16
|
+
default: number;
|
|
17
|
+
};
|
|
18
|
+
haveReadMore: {
|
|
19
|
+
type: BooleanConstructor;
|
|
20
|
+
default: boolean;
|
|
21
|
+
};
|
|
22
|
+
id: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
default: null;
|
|
25
|
+
};
|
|
26
|
+
customReadMore: {
|
|
27
|
+
type: () => {
|
|
28
|
+
more: string;
|
|
29
|
+
less: string;
|
|
30
|
+
};
|
|
31
|
+
default: null;
|
|
32
|
+
};
|
|
33
|
+
lang: {
|
|
34
|
+
type: () => "en" | "fr" | "es";
|
|
35
|
+
default: string;
|
|
36
|
+
validator: (value: string) => boolean;
|
|
37
|
+
};
|
|
38
|
+
}, {
|
|
39
|
+
showMore: import("vue").Ref<boolean>;
|
|
40
|
+
needsMore: import("vue").ComputedRef<boolean>;
|
|
41
|
+
renderText: import("vue").ComputedRef<string>;
|
|
42
|
+
getReadMore: import("vue").ComputedRef<string>;
|
|
43
|
+
toggleMore: () => void;
|
|
44
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("onShowMore" | "onShowLess")[], "onShowMore" | "onShowLess", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
45
|
+
text: {
|
|
46
|
+
type: StringConstructor;
|
|
47
|
+
required: true;
|
|
48
|
+
};
|
|
49
|
+
queries: {
|
|
50
|
+
type: () => string[];
|
|
51
|
+
default: null;
|
|
52
|
+
};
|
|
53
|
+
crop: {
|
|
54
|
+
type: BooleanConstructor;
|
|
55
|
+
default: boolean;
|
|
56
|
+
};
|
|
57
|
+
lines: {
|
|
58
|
+
type: NumberConstructor;
|
|
59
|
+
default: number;
|
|
60
|
+
};
|
|
61
|
+
haveReadMore: {
|
|
62
|
+
type: BooleanConstructor;
|
|
63
|
+
default: boolean;
|
|
64
|
+
};
|
|
65
|
+
id: {
|
|
66
|
+
type: StringConstructor;
|
|
67
|
+
default: null;
|
|
68
|
+
};
|
|
69
|
+
customReadMore: {
|
|
70
|
+
type: () => {
|
|
71
|
+
more: string;
|
|
72
|
+
less: string;
|
|
73
|
+
};
|
|
74
|
+
default: null;
|
|
75
|
+
};
|
|
76
|
+
lang: {
|
|
77
|
+
type: () => "en" | "fr" | "es";
|
|
78
|
+
default: string;
|
|
79
|
+
validator: (value: string) => boolean;
|
|
80
|
+
};
|
|
81
|
+
}>> & {
|
|
82
|
+
onOnShowMore?: ((...args: any[]) => any) | undefined;
|
|
83
|
+
onOnShowLess?: ((...args: any[]) => any) | undefined;
|
|
84
|
+
}, {
|
|
85
|
+
id: string;
|
|
86
|
+
lang: "en" | "fr" | "es";
|
|
87
|
+
queries: string[];
|
|
88
|
+
crop: boolean;
|
|
89
|
+
lines: number;
|
|
90
|
+
haveReadMore: boolean;
|
|
91
|
+
customReadMore: {
|
|
92
|
+
more: string;
|
|
93
|
+
less: string;
|
|
94
|
+
};
|
|
95
|
+
}, {}>;
|
|
96
|
+
export default _default;
|
|
@@ -166,7 +166,8 @@
|
|
|
166
166
|
"toolbarSource": {
|
|
167
167
|
"comply": "To comply with the ",
|
|
168
168
|
"list": "You must list in your reports the sources used.",
|
|
169
|
-
"copy": "The ”Copy” button is provided to ease this process."
|
|
169
|
+
"copy": "The ”Copy” button is provided to ease this process.",
|
|
170
|
+
"sources": "Sources"
|
|
170
171
|
},
|
|
171
172
|
"filterCard": {
|
|
172
173
|
"title": "Filters",
|
|
@@ -165,7 +165,8 @@
|
|
|
165
165
|
"toolbarSource": {
|
|
166
166
|
"comply": "Para cumplir con ",
|
|
167
167
|
"list": "debe enumerar en sus informes las fuentes utilizadas.",
|
|
168
|
-
"copy": "El botón ”Copiar” facilita este proceso."
|
|
168
|
+
"copy": "El botón ”Copiar” facilita este proceso.",
|
|
169
|
+
"sources": "Fuentes"
|
|
169
170
|
},
|
|
170
171
|
"filterCard": {
|
|
171
172
|
"title": "Filtros",
|
|
@@ -165,7 +165,8 @@
|
|
|
165
165
|
"toolbarSource": {
|
|
166
166
|
"comply": "Pour être conforme à l’",
|
|
167
167
|
"list": "vous devez annotez vos documents avec les sources utilisées.",
|
|
168
|
-
"copy": "Le bouton “Copier” est prévu pour faciliter cette démarche."
|
|
168
|
+
"copy": "Le bouton “Copier” est prévu pour faciliter cette démarche.",
|
|
169
|
+
"sources": "Sources"
|
|
169
170
|
},
|
|
170
171
|
"filterCard": {
|
|
171
172
|
"title": "Filtres",
|