Compare commits

...

3 Commits

Author SHA1 Message Date
renovate[bot]
c89b1e842d
Merge 7f03933124 into e1b4f9aafe 2024-08-08 00:20:36 +09:00
Diego Fabricio
e1b4f9aafe
feat(lorem-ipsum): add button to refresh text lorem-ipsum (#1213)
Co-authored-by: Diego Guzmán <diego.guzman@caces.gob.ec>
2024-08-07 09:22:08 +02:00
renovate[bot]
7f03933124
chore(deps): update dependency @vue/tsconfig to ^0.5.0 2024-02-10 23:34:27 +00:00
3 changed files with 14 additions and 8 deletions

View File

@ -119,7 +119,7 @@
"@vue/compiler-sfc": "^3.2.47",
"@vue/runtime-dom": "^3.3.4",
"@vue/test-utils": "^2.3.2",
"@vue/tsconfig": "^0.4.0",
"@vue/tsconfig": "^0.5.0",
"consola": "^3.0.2",
"eslint": "^8.47.0",
"hygen": "^6.2.11",

View File

@ -254,8 +254,8 @@ devDependencies:
specifier: ^2.3.2
version: 2.3.2(vue@3.3.4)
'@vue/tsconfig':
specifier: ^0.4.0
version: 0.4.0
specifier: ^0.5.0
version: 0.5.1
consola:
specifier: ^3.0.2
version: 3.0.2
@ -3923,8 +3923,8 @@ packages:
'@vue/server-renderer': 3.3.7(vue@3.3.4)
dev: true
/@vue/tsconfig@0.4.0:
resolution: {integrity: sha512-CPuIReonid9+zOG/CGTT05FXrPYATEqoDGNrEaqS4hwcw5BUNM2FguC0mOwJD4Jr16UpRVl9N0pY3P+srIbqmg==}
/@vue/tsconfig@0.5.1:
resolution: {integrity: sha512-VcZK7MvpjuTPx2w6blwnwZAu5/LgBUtejFOi3pPGQFXQN5Ela03FUtd2Qtg4yWGGissVL0dr6Ro1LfOFh+PCuQ==}
dev: true
/@vue/typescript@1.8.1(typescript@5.2.2):
@ -4564,7 +4564,7 @@ packages:
dev: false
/concat-map@0.0.1:
resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=}
resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
/config-chain@1.1.13:
resolution: {integrity: sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==}
@ -9449,6 +9449,7 @@ packages:
/workbox-google-analytics@7.0.0:
resolution: {integrity: sha512-MEYM1JTn/qiC3DbpvP2BVhyIH+dV/5BjHk756u9VbwuAhu0QHyKscTnisQuz21lfRpOwiS9z4XdqeVAKol0bzg==}
deprecated: It is not compatible with newer versions of GA starting with v4, as long as you are using GAv3 it should be ok, but the package is not longer being maintained
dependencies:
workbox-background-sync: 7.0.0
workbox-core: 7.0.0

View File

@ -2,6 +2,7 @@
import { generateLoremIpsum } from './lorem-ipsum-generator.service';
import { useCopy } from '@/composable/copy';
import { randIntFromInterval } from '@/utils/random';
import { computedRefreshable } from '@/composable/computedRefreshable';
const paragraphs = ref(1);
const sentences = ref([3, 8]);
@ -9,7 +10,7 @@ const words = ref([8, 15]);
const startWithLoremIpsum = ref(true);
const asHTML = ref(false);
const loremIpsumText = computed(() =>
const [loremIpsumText, refreshLoremIpsum] = computedRefreshable(() =>
generateLoremIpsum({
paragraphCount: paragraphs.value,
asHTML: asHTML.value,
@ -18,6 +19,7 @@ const loremIpsumText = computed(() =>
startWithLoremIpsum: startWithLoremIpsum.value,
}),
);
const { copy } = useCopy({ source: loremIpsumText, text: 'Lorem ipsum copied to the clipboard' });
</script>
@ -41,10 +43,13 @@ const { copy } = useCopy({ source: loremIpsumText, text: 'Lorem ipsum copied to
<c-input-text :value="loremIpsumText" multiline placeholder="Your lorem ipsum..." readonly mt-5 rows="5" />
<div mt-5 flex justify-center>
<div mt-5 flex justify-center gap-3>
<c-button autofocus @click="copy()">
Copy
</c-button>
<c-button @click="refreshLoremIpsum">
Refresh
</c-button>
</div>
</c-card>
</template>