@tekkare/auriga 0.1.171 → 0.1.173
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
CHANGED
|
@@ -1,35 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :class="haveReadMore && needsMore ? 'crop_display' : ''">
|
|
3
3
|
<div
|
|
4
|
-
:class="crop && !showMore ? 'crop' : ''"
|
|
5
4
|
:id="id"
|
|
5
|
+
:class="crop && !showMore ? 'crop' : ''"
|
|
6
6
|
:style="crop && !showMore ? `-webkit-line-clamp: ${lines}` : ''"
|
|
7
7
|
v-html="renderText"
|
|
8
|
-
|
|
8
|
+
/>
|
|
9
9
|
<arg-text-btn v-if="crop && haveReadMore && needsMore" @click="toggleMore">
|
|
10
|
-
{{
|
|
11
|
-
customReadMore !== null
|
|
12
|
-
? !showMore
|
|
13
|
-
? readText.more
|
|
14
|
-
: readText.less
|
|
15
|
-
: !showMore
|
|
16
|
-
? readText.more[lang]
|
|
17
|
-
: readText.less[lang]
|
|
18
|
-
}}
|
|
10
|
+
{{ getReadMore }}
|
|
19
11
|
</arg-text-btn>
|
|
20
12
|
</div>
|
|
21
13
|
</template>
|
|
22
14
|
|
|
23
15
|
<script>
|
|
24
|
-
import {
|
|
25
|
-
onMounted,
|
|
26
|
-
ref,
|
|
27
|
-
computed,
|
|
28
|
-
defineComponent
|
|
29
|
-
} from "vue";
|
|
16
|
+
import { onMounted, ref, computed, defineComponent } from "vue";
|
|
30
17
|
import argTextBtn from "./argTextBtn.vue";
|
|
31
18
|
export default defineComponent({
|
|
32
|
-
name: "
|
|
19
|
+
name: "argHighlightText",
|
|
33
20
|
components: { argTextBtn },
|
|
34
21
|
props: {
|
|
35
22
|
text: {
|
|
@@ -72,14 +59,16 @@ export default defineComponent({
|
|
|
72
59
|
setup(props, { emit }) {
|
|
73
60
|
const showMore = ref(false);
|
|
74
61
|
const indic = ref(null);
|
|
75
|
-
const
|
|
62
|
+
const getReadMore = computed(() => {
|
|
76
63
|
if (props.customReadMore !== null) {
|
|
77
|
-
return props.customReadMore;
|
|
78
|
-
} else
|
|
79
|
-
|
|
64
|
+
return showMore.value ? props.customReadMore.less : props.customReadMore.more;
|
|
65
|
+
} else {
|
|
66
|
+
const texts = {
|
|
80
67
|
more: { en: "Read more", fr: "Voir plus", es: "Ver m\xE0s" },
|
|
81
68
|
less: { en: "Read less", fr: "Voir moins", es: "Ver menos" }
|
|
82
69
|
};
|
|
70
|
+
return showMore.value ? texts.less[props.lang] : texts.more[props.lang];
|
|
71
|
+
}
|
|
83
72
|
});
|
|
84
73
|
function toggleMore() {
|
|
85
74
|
showMore.value = !showMore.value;
|
|
@@ -90,18 +79,11 @@ export default defineComponent({
|
|
|
90
79
|
}
|
|
91
80
|
function escapeRegExp(str) {
|
|
92
81
|
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\<script lang="ts">
|
|
93
|
-
import {
|
|
94
|
-
onMounted,
|
|
95
|
-
ref,
|
|
96
|
-
computed,
|
|
97
|
-
defineProps,
|
|
98
|
-
defineEmits,
|
|
99
|
-
defineComponent,
|
|
100
|
-
} from "vue";
|
|
82
|
+
import { onMounted, ref, computed, defineComponent } from "vue";
|
|
101
83
|
import argTextBtn from "./argTextBtn.vue";
|
|
102
84
|
|
|
103
85
|
export default defineComponent({
|
|
104
|
-
name: "
|
|
86
|
+
name: "argHighlightText",
|
|
105
87
|
components: { argTextBtn },
|
|
106
88
|
props: {
|
|
107
89
|
text: {
|
|
@@ -129,11 +111,11 @@ export default defineComponent({
|
|
|
129
111
|
default: null,
|
|
130
112
|
},
|
|
131
113
|
customReadMore: {
|
|
132
|
-
type: Object,
|
|
114
|
+
type: Object as () => { more: string; less: string },
|
|
133
115
|
default: null,
|
|
134
116
|
},
|
|
135
117
|
lang: {
|
|
136
|
-
type: String,
|
|
118
|
+
type: String as () => "en" | "fr" | "es",
|
|
137
119
|
default: "en",
|
|
138
120
|
validator: (value: string) => {
|
|
139
121
|
// Check if the value is either 'en' or 'fr'
|
|
@@ -146,14 +128,18 @@ export default defineComponent({
|
|
|
146
128
|
const showMore = ref(false);
|
|
147
129
|
const indic = ref(null as any);
|
|
148
130
|
|
|
149
|
-
const
|
|
131
|
+
const getReadMore = computed(() => {
|
|
150
132
|
if (props.customReadMore !== null) {
|
|
151
|
-
return
|
|
152
|
-
|
|
153
|
-
|
|
133
|
+
return showMore.value
|
|
134
|
+
? props.customReadMore.less
|
|
135
|
+
: props.customReadMore.more;
|
|
136
|
+
} else {
|
|
137
|
+
const texts = {
|
|
154
138
|
more: { en: "Read more", fr: "Voir plus", es: "Ver màs" },
|
|
155
139
|
less: { en: "Read less", fr: "Voir moins", es: "Ver menos" },
|
|
156
140
|
};
|
|
141
|
+
return showMore.value ? texts.less[props.lang] : texts.more[props.lang];
|
|
142
|
+
}
|
|
157
143
|
});
|
|
158
144
|
|
|
159
145
|
function toggleMore() {
|
|
@@ -193,7 +179,6 @@ export default defineComponent({
|
|
|
193
179
|
props.queries.forEach((word: string) => {
|
|
194
180
|
const regex = new RegExp(`\\b(${escapeRegExp(word)})\\b`, "gi");
|
|
195
181
|
returnText = returnText.replace(regex, (match: string) => {
|
|
196
|
-
console.log(match);
|
|
197
182
|
if (match.toLowerCase() === "mark") {
|
|
198
183
|
return match;
|
|
199
184
|
}
|
|
@@ -213,7 +198,7 @@ export default defineComponent({
|
|
|
213
198
|
showMore,
|
|
214
199
|
needsMore,
|
|
215
200
|
renderText,
|
|
216
|
-
|
|
201
|
+
getReadMore,
|
|
217
202
|
toggleMore,
|
|
218
203
|
};
|
|
219
204
|
},
|
|
@@ -237,7 +222,6 @@ export default defineComponent({
|
|
|
237
222
|
props.queries.forEach((word) => {
|
|
238
223
|
const regex = new RegExp(`\\b(${escapeRegExp(word)})\\b`, "gi");
|
|
239
224
|
returnText = returnText.replace(regex, (match) => {
|
|
240
|
-
console.log(match);
|
|
241
225
|
if (match.toLowerCase() === "mark") {
|
|
242
226
|
return match;
|
|
243
227
|
}
|
|
@@ -254,7 +238,7 @@ export default defineComponent({
|
|
|
254
238
|
showMore,
|
|
255
239
|
needsMore,
|
|
256
240
|
renderText,
|
|
257
|
-
|
|
241
|
+
getReadMore,
|
|
258
242
|
toggleMore
|
|
259
243
|
};
|
|
260
244
|
}
|
|
@@ -37,11 +37,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
37
37
|
default: null;
|
|
38
38
|
};
|
|
39
39
|
customReadMore: {
|
|
40
|
-
type:
|
|
40
|
+
type: () => {
|
|
41
|
+
more: string;
|
|
42
|
+
less: string;
|
|
43
|
+
};
|
|
41
44
|
default: null;
|
|
42
45
|
};
|
|
43
46
|
lang: {
|
|
44
|
-
type:
|
|
47
|
+
type: () => "en" | "fr" | "es";
|
|
45
48
|
default: string;
|
|
46
49
|
validator: (value: string) => boolean;
|
|
47
50
|
};
|
|
@@ -49,7 +52,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
49
52
|
showMore: import("vue").Ref<boolean>;
|
|
50
53
|
needsMore: import("vue").ComputedRef<boolean>;
|
|
51
54
|
renderText: import("vue").ComputedRef<string>;
|
|
52
|
-
|
|
55
|
+
getReadMore: import("vue").ComputedRef<string>;
|
|
53
56
|
toggleMore: () => void;
|
|
54
57
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("onShowMore" | "onShowLess")[], "onShowMore" | "onShowLess", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
55
58
|
text: {
|
|
@@ -90,11 +93,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
90
93
|
default: null;
|
|
91
94
|
};
|
|
92
95
|
customReadMore: {
|
|
93
|
-
type:
|
|
96
|
+
type: () => {
|
|
97
|
+
more: string;
|
|
98
|
+
less: string;
|
|
99
|
+
};
|
|
94
100
|
default: null;
|
|
95
101
|
};
|
|
96
102
|
lang: {
|
|
97
|
-
type:
|
|
103
|
+
type: () => "en" | "fr" | "es";
|
|
98
104
|
default: string;
|
|
99
105
|
validator: (value: string) => boolean;
|
|
100
106
|
};
|
|
@@ -103,11 +109,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
103
109
|
onOnShowLess?: ((...args: any[]) => any) | undefined;
|
|
104
110
|
}, {
|
|
105
111
|
id: string;
|
|
106
|
-
lang:
|
|
112
|
+
lang: "en" | "fr" | "es";
|
|
107
113
|
queries: string[];
|
|
108
114
|
crop: boolean;
|
|
109
115
|
lines: number;
|
|
110
116
|
haveReadMore: boolean;
|
|
111
|
-
customReadMore:
|
|
117
|
+
customReadMore: {
|
|
118
|
+
more: string;
|
|
119
|
+
less: string;
|
|
120
|
+
};
|
|
112
121
|
}, {}>;
|
|
113
122
|
export default _default;
|