From 7b6232a15128d3dfb6680e9cc97382eb3c198411 Mon Sep 17 00:00:00 2001 From: Marvin <33938500+marvin-j97@users.noreply.github.com> Date: Wed, 9 Aug 2023 23:45:21 +0200 Subject: [PATCH] feat(Case Converter): Add lowercase and uppercase (#534) * feat(case converter): add uppercase and lowercase * (case converter) correctly use stripRegexp * style: lint fix * feat(ui): added c-select in the ui lib (#550) * feat(ui): added c-select in the ui lib * refactor(ui): switched n-select to c-select * feat(new tool): emoji picker (#551) * chore(deps): update dependency @vitejs/plugin-vue to v4 (#496) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update dependency @vitejs/plugin-vue-jsx to v3 (#497) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * refactor(case converter): using nocase to convert to upper and lower case * refactor(case converter): config based case changes --------- Co-authored-by: Corentin THOMASSET Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- src/components/InputCopyable.vue | 2 +- src/tools/case-converter/case-converter.vue | 128 ++++++++++++-------- unocss.config.ts | 1 + 3 files changed, 79 insertions(+), 52 deletions(-) diff --git a/src/components/InputCopyable.vue b/src/components/InputCopyable.vue index 0c689097..db26f458 100644 --- a/src/components/InputCopyable.vue +++ b/src/components/InputCopyable.vue @@ -11,7 +11,7 @@ const { copy } = useClipboard({ source: value }); function onCopyClicked() { copy(); - tooltipText.value = 'Copied !'; + tooltipText.value = 'Copied!'; setTimeout(() => { tooltipText.value = 'Copy to clipboard'; diff --git a/src/tools/case-converter/case-converter.vue b/src/tools/case-converter/case-converter.vue index 1a2e3af0..e43744ca 100644 --- a/src/tools/case-converter/case-converter.vue +++ b/src/tools/case-converter/case-converter.vue @@ -19,62 +19,88 @@ const baseConfig = { }; const input = ref('lorem ipsum dolor sit amet'); + +const formats = computed(() => [ + { + label: 'Lowercase:', + value: noCase(input.value, baseConfig).toLocaleLowerCase(), + }, + { + label: 'Uppercase:', + value: noCase(input.value, baseConfig).toLocaleUpperCase(), + }, + { + label: 'Camelcase:', + value: camelCase(input.value, baseConfig), + }, + { + label: 'Capitalcase:', + value: capitalCase(input.value, baseConfig), + }, + { + label: 'Constantcase:', + value: constantCase(input.value, baseConfig), + }, + { + label: 'Dotcase:', + value: dotCase(input.value, baseConfig), + }, + { + label: 'Headercase:', + value: headerCase(input.value, baseConfig), + }, + { + label: 'Nocase:', + value: noCase(input.value, baseConfig), + }, + { + label: 'Paramcase:', + value: paramCase(input.value, baseConfig), + }, + { + label: 'Pascalcase:', + value: pascalCase(input.value, baseConfig), + }, + { + label: 'Pathcase:', + value: pathCase(input.value, baseConfig), + }, + { + label: 'Sentencecase:', + value: sentenceCase(input.value, baseConfig), + }, + { + label: 'Snakecase:', + value: snakeCase(input.value, baseConfig), + }, +]); + +const inputLabelAlignmentConfig = { + labelPosition: 'left', + labelWidth: '120px', + labelAlign: 'right', +}; - - diff --git a/unocss.config.ts b/unocss.config.ts index 0ce8f705..6da68739 100644 --- a/unocss.config.ts +++ b/unocss.config.ts @@ -19,5 +19,6 @@ export default defineConfig({ }, shortcuts: { 'pretty-scrollbar': 'scrollbar scrollbar-rounded scrollbar-thumb-color-gray-300 scrollbar-track-color-gray-100 dark:scrollbar-thumb-color-#424242 dark:scrollbar-track-color-#686868', + 'divider': 'h-1px bg-current op-10', }, });