Skip to content

Commit

Permalink
feat: replace useUniqueId for uuid package
Browse files Browse the repository at this point in the history
  • Loading branch information
rigojr committed Oct 10, 2023
1 parent 0e8151e commit 6578cb4
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 30 deletions.
6 changes: 3 additions & 3 deletions frontend/components/form/FormSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
</template>

<script setup lang="ts">
import { v4 as uuidv4 } from 'uuid';
import useFormInput from "../../composables/useFormSetup";
import useUniqueID from "../../composables/useUniqueID";
export interface Props {
placeholder?: string;
Expand All @@ -29,6 +30,5 @@ const props = withDefaults(defineProps<Props>(), {
const emit = defineEmits(["update:modelValue"]);
const { updateValue } = useFormInput(props, emit, true);
const uuid = useUniqueID().getID().toString();
const uuid = uuidv4();
</script>
9 changes: 3 additions & 6 deletions frontend/components/form/FormTextField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
</template>

<script setup lang="ts">
import { v4 as uuidv4 } from 'uuid';
import useFormInput from "../../composables/useFormSetup";
import useUniqueID from "../../composables/useUniqueID";
export interface Props {
placeholder?: string;
Expand All @@ -35,13 +36,9 @@ const props = withDefaults(defineProps<Props>(), {
});
const emit = defineEmits(["update:modelValue"]);
const { updateValue } = useFormInput({ value: props?.modelValue }, emit, false);
const uuid = useUniqueID().getID();
const uuid = uuidv4();
const refInputType = ref(props?.inputType);
const changeInputType = () => {
refInputType.value = refInputType.value === "password" ? "text" : "password";
};
Expand Down
6 changes: 3 additions & 3 deletions frontend/components/form/checkbox/FormCheckbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
</template>

<script setup lang="ts">
import { v4 as uuidv4 } from 'uuid';
import useFormInput from "../../../composables/useFormSetup";
import useUniqueID from "../../../composables/useUniqueID";
export interface Props {
label?: string;
Expand All @@ -38,6 +39,5 @@ const props = withDefaults(defineProps<Props>(), {
const emit = defineEmits(["update:modelValue"]);
const { updateValue } = useFormInput(props, emit);
const uuid = useUniqueID().getID().toString();
const uuid = uuidv4();
</script>
5 changes: 3 additions & 2 deletions frontend/components/form/checkbox/FormCheckboxBtn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
</template>

<script setup lang="ts">
import { v4 as uuidv4 } from 'uuid';
import useFormInput from "../../../composables/useFormSetup";
import useUniqueID from "../../../composables/useUniqueID";
export interface Props {
label?: string;
Expand All @@ -45,7 +46,7 @@ const props = withDefaults(defineProps<Props>(), {
const emit = defineEmits(["update:modelValue"]);
const { updateValue } = useFormInput(props, emit);
const uuid = useUniqueID().getID().toString();
const uuid = uuidv4();
const customColorClass =
props.customColor !== ""
? `bg-light-${props.customColor}/60 dark:bg-dark-${props.customColor}/10 dark:text-dark-${props.customColor}`
Expand Down
5 changes: 3 additions & 2 deletions frontend/components/form/radio/FormRadio.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
</template>

<script setup lang="ts">
import { v4 as uuidv4 } from 'uuid';
import useFormInput from "../../../composables/useFormSetup";
import useUniqueID from "../../../composables/useUniqueID";
export interface Props {
label?: string;
Expand All @@ -31,5 +32,5 @@ const props = withDefaults(defineProps<Props>(), {
const emit = defineEmits(["update:modelValue"]);
const { updateValue } = useFormInput(props, emit);
const uuid = useUniqueID().getID().toString();
const uuid = uuidv4();
</script>
5 changes: 3 additions & 2 deletions frontend/components/form/radio/FormRadioBtn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
</template>

<script setup lang="ts">
import { v4 as uuidv4 } from 'uuid';
import useFormInput from "../../../composables/useFormSetup";
import useUniqueID from "../../../composables/useUniqueID";
export interface Props {
label?: string;
Expand All @@ -46,7 +47,7 @@ const props = withDefaults(defineProps<Props>(), {
const emit = defineEmits(["update:modelValue"]);
const { updateValue } = useFormInput(props, emit);
const uuid = useUniqueID().getID().toString();
const uuid = uuidv4();
const customColorClass =
props.customColor !== ""
? `bg-light-${props.customColor}/60 dark:bg-dark-${props.customColor}/10 dark:text-dark-${props.customColor}`
Expand Down
12 changes: 0 additions & 12 deletions frontend/composables/useUniqueID.ts

This file was deleted.

2 changes: 2 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@
"@nuxtjs/tailwindcss": "^6.2.0",
"@pinia/nuxt": "^0.4.6",
"@types/node": "^18.11.18",
"@types/uuid": "^9.0.5",
"@vueuse/core": "^9.12.0",
"@vueuse/nuxt": "^9.12.0",
"nuxt": "npm:nuxt3@latest",
"nuxt-icon": "^0.2.6",
"typescript": "^5.1.3",
"uuid": "^9.0.1",
"vue-tsc": "^1.8.8"
},
"dependencies": {
Expand Down
10 changes: 10 additions & 0 deletions frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1541,6 +1541,11 @@
resolved "https://registry.yarnpkg.com/@types/unist/-/unist-3.0.0.tgz#988ae8af1e5239e89f9fbb1ade4c935f4eeedf9a"
integrity sha512-MFETx3tbTjE7Uk6vvnWINA/1iJ7LuMdO4fcq8UfF0pRbj01aGLduVvQcRyswuACJdpnHgg8E3rQLhaRdNEJS0w==

"@types/uuid@^9.0.5":
version "9.0.5"
resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-9.0.5.tgz#25a71eb73eba95ac0e559ff3dd018fc08294acf6"
integrity sha512-xfHdwa1FMJ082prjSJpoEI57GZITiQz10r3vEJCHa2khEFQjKy91aWKz6+zybzssCvXUwE1LQWgWVwZ4nYUvHQ==

"@types/web-bluetooth@^0.0.16":
version "0.0.16"
resolved "https://registry.yarnpkg.com/@types/web-bluetooth/-/web-bluetooth-0.0.16.tgz#1d12873a8e49567371f2a75fe3e7f7edca6662d8"
Expand Down Expand Up @@ -8261,6 +8266,11 @@ [email protected]:
resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713"
integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==

uuid@^9.0.1:
version "9.0.1"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30"
integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==

uvu@^0.5.0:
version "0.5.6"
resolved "https://registry.yarnpkg.com/uvu/-/uvu-0.5.6.tgz#2754ca20bcb0bb59b64e9985e84d2e81058502df"
Expand Down

0 comments on commit 6578cb4

Please sign in to comment.