@redseed/redseed-ui-vue3 2.24.0 → 2.24.2
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/package.json
CHANGED
|
@@ -13,13 +13,13 @@ const props = defineProps({
|
|
|
13
13
|
const readMoreId = _.uniqueId('read_more_')
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
* {{read_more}}, {{ read_more }}, {{ ReadMore }} interpolation
|
|
16
|
+
* Regex to allow for {{read_more}}, {{ read_more }}
|
|
18
17
|
*/
|
|
19
|
-
const
|
|
18
|
+
const regex = /{{\s*read_more\s*}}/g
|
|
20
19
|
|
|
21
|
-
const
|
|
22
|
-
|
|
20
|
+
const replacement = `<a id="${readMoreId}"></a>`
|
|
21
|
+
|
|
22
|
+
const result = _.replace(props.html, regex, replacement)
|
|
23
23
|
|
|
24
24
|
const showMore = ref(false)
|
|
25
25
|
|
|
@@ -58,12 +58,12 @@ onMounted(() => {
|
|
|
58
58
|
})
|
|
59
59
|
</script>
|
|
60
60
|
<template>
|
|
61
|
-
<div class="rsui-read-more
|
|
61
|
+
<div class="rsui-read-more">
|
|
62
62
|
<div ref="htmlContentElement"
|
|
63
|
-
class="rsui-read-
|
|
63
|
+
class="rsui-read-more__content"
|
|
64
64
|
v-html="result"
|
|
65
65
|
></div>
|
|
66
|
-
<div v-if="hasReadMore" class="rsui-read-
|
|
66
|
+
<div v-if="hasReadMore" class="rsui-read-more__link">
|
|
67
67
|
<LinkPrimary md v-if="!showMore" @click="showMore = true">
|
|
68
68
|
<slot name="more-label">More details</slot>
|
|
69
69
|
</LinkPrimary>
|
|
@@ -74,7 +74,7 @@ onMounted(() => {
|
|
|
74
74
|
</div>
|
|
75
75
|
</template>
|
|
76
76
|
<style lang="scss" scoped>
|
|
77
|
-
.rsui-read-more
|
|
77
|
+
.rsui-read-more {
|
|
78
78
|
&__content {
|
|
79
79
|
@apply transition-all overflow-hidden;
|
|
80
80
|
}
|