From 2962480a85501dd4ac0288389bfa79b4ce4fdbcc Mon Sep 17 00:00:00 2001 From: Paul Valerie GOMA Date: Tue, 22 Jul 2025 16:49:51 +0200 Subject: [PATCH 01/17] =?UTF-8?q?=F0=9F=92=84=20Adding=20the=20style=20of?= =?UTF-8?q?=20the=20primevue=20checkbox=20component?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/style/primevue-style/checkbox.css | 32 ++++++++ src/components/checkbox/IVCheckbox.type.ts | 84 ++++++++++++++++++++ 2 files changed, 116 insertions(+) create mode 100644 src/assets/style/primevue-style/checkbox.css create mode 100644 src/components/checkbox/IVCheckbox.type.ts diff --git a/src/assets/style/primevue-style/checkbox.css b/src/assets/style/primevue-style/checkbox.css new file mode 100644 index 0000000..635532a --- /dev/null +++ b/src/assets/style/primevue-style/checkbox.css @@ -0,0 +1,32 @@ +:root{ + /* size */ + --p-checkbox-width: 1.5rem; + --p-checkbox-height: 1.5rem; + --p-checkbox-sm-width: 1rem; + --p-checkbox-sm-height: 1rem; + /* border */ + --p-checkbox-border-radius: 0px; + --p-checkbox-border-color: var(--border-action-high-blue-france); + --p-checkbox-hover-border-color: var(--border-action-high-blue-france); + /* background */ + --p-checkbox-background: var(--background-default-grey); + /* icon */ + --p-checkbox-icon-size: 1rem; + --p-checkbox-icon-sm-size: 1rem; + --p-checkbox-icon-color: var(--background-default-grey); + /* focus */ + --p-checkbox-checked-focus-border-color: var(--border-action-high-blue-france); + --p-checkbox-focus-border-color: var(--border-action-high-blue-france); + --p-checkbox-focus-ring-color: var(--focus-color); + --p-checkbox-focus-ring-width: var(--focus-width); + --p-checkbox-focus-ring-style: var(--focus-style); + --p-checkbox-focus-ring-offset: var(--focus-offset); + /* checked */ + --p-checkbox-checked-border-color: var(--border-action-high-blue-france); + --p-checkbox-checked-background: var(--border-active-blue-france); + --p-checkbox-icon-checked-color: var(--background-default-grey); + /* checked:hover */ + --p-checkbox-icon-checked-hover-color: var(--background-default-grey); + --p-checkbox-checked-hover-border-color: var(--border-action-high-blue-france); + --p-checkbox-checked-hover-background: var(--border-active-blue-france); +} diff --git a/src/components/checkbox/IVCheckbox.type.ts b/src/components/checkbox/IVCheckbox.type.ts new file mode 100644 index 0000000..31916fe --- /dev/null +++ b/src/components/checkbox/IVCheckbox.type.ts @@ -0,0 +1,84 @@ +/** + * Interface representing the props for a CheckBox Vue component. + */ +export default interface ICheckBox { + /** + * The unique identifier for the checkbox element. + */ + id?: string; + + /** + * The name attribute for the checkbox input. + */ + name?: string; + + /** + * Indicates whether the checkbox is required in a form. + */ + required?: boolean; + + /** + * The value associated with the checkbox. + */ + value?: unknown; + + /** + * Whether the checkbox is initially checked. + */ + checked?: boolean; + + /** + * The bound value of the checkbox, can be a boolean or an array of values. + */ + modelValue: Array | boolean; + + /** + * If true, renders the checkbox in a smaller size. + */ + small?: boolean; + + /** + * If true, displays the checkbox inline with other elements. + */ + inline?: boolean; + + /** + * If true, the checkbox is read-only and cannot be changed by the user. + */ + readonly?: boolean; + + /** + * Opacity level applied when the checkbox is read-only. + */ + readonlyOpacity?: number; + + /** + * The label text displayed next to the checkbox. + */ + label?: string; + + /** + * The error message shown when validation fails. + */ + errorMessage?: string; + + /** + * The message shown when the checkbox input is valid. + */ + validMessage?: string; + + /** + * Additional hint or helper text displayed below the checkbox. + */ + hint?: string; + + /** + * If true, disables the checkbox input. + */ + disabled?: boolean; + + /** + * Visual style of the checkbox, can be 'normal', 'error', or 'success'. + */ + type?: 'normal' | 'error' | 'success'; +} From 6742d0c39cf266a76e7278869e2da18dbf0b7f53 Mon Sep 17 00:00:00 2001 From: Paul Valerie GOMA Date: Tue, 22 Jul 2025 16:50:42 +0200 Subject: [PATCH 02/17] =?UTF-8?q?=F0=9F=92=84=20Update=20the=20primevue=20?= =?UTF-8?q?configuration=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/style/primevue-configuration.css | 1 + 1 file changed, 1 insertion(+) diff --git a/src/assets/style/primevue-configuration.css b/src/assets/style/primevue-configuration.css index 1ae4ed8..c381491 100644 --- a/src/assets/style/primevue-configuration.css +++ b/src/assets/style/primevue-configuration.css @@ -7,3 +7,4 @@ @import './primevue-style/divider.css'; @import './primevue-style/various.css'; @import './primevue-style/form.css'; +@import './primevue-style/checkbox.css'; From b4bcca9abac2fe4aa1842b113acd83083d160a1e Mon Sep 17 00:00:00 2001 From: Paul Valerie GOMA Date: Tue, 22 Jul 2025 16:54:29 +0200 Subject: [PATCH 03/17] =?UTF-8?q?=F0=9F=8F=B7=EF=B8=8F=20=20Updated=20chec?= =?UTF-8?q?kbox=20component=20interface=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/checkbox/IVCheckbox.type.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/checkbox/IVCheckbox.type.ts b/src/components/checkbox/IVCheckbox.type.ts index 31916fe..6b82ce3 100644 --- a/src/components/checkbox/IVCheckbox.type.ts +++ b/src/components/checkbox/IVCheckbox.type.ts @@ -1,7 +1,7 @@ /** * Interface representing the props for a CheckBox Vue component. */ -export default interface ICheckBox { +export default interface IVCheckBox { /** * The unique identifier for the checkbox element. */ From 25a00d7c579649d6c4524376b0784ec9fc167478 Mon Sep 17 00:00:00 2001 From: Paul Valerie GOMA Date: Wed, 23 Jul 2025 08:54:44 +0200 Subject: [PATCH 04/17] =?UTF-8?q?=E2=9C=A8=20feature:=20Checkbox=20compone?= =?UTF-8?q?nt=20added?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/checkbox/VCheckbox.vue | 143 ++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 src/components/checkbox/VCheckbox.vue diff --git a/src/components/checkbox/VCheckbox.vue b/src/components/checkbox/VCheckbox.vue new file mode 100644 index 0000000..89c3c6d --- /dev/null +++ b/src/components/checkbox/VCheckbox.vue @@ -0,0 +1,143 @@ + + + + + From 5c89228564f13e3281ce27f67798a30450aef34f Mon Sep 17 00:00:00 2001 From: Paul Valerie GOMA Date: Wed, 23 Jul 2025 09:52:43 +0200 Subject: [PATCH 05/17] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20=20refaco:=20require?= =?UTF-8?q?d-tip=20slot=20improved?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/checkbox/VCheckbox.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/checkbox/VCheckbox.vue b/src/components/checkbox/VCheckbox.vue index 89c3c6d..c727762 100644 --- a/src/components/checkbox/VCheckbox.vue +++ b/src/components/checkbox/VCheckbox.vue @@ -69,8 +69,8 @@ const labelState = computed(() => { :type="labelState" class="label-container" > - From fb93a3e353a25db2cfe058a76e1b54bca94ba769 Mon Sep 17 00:00:00 2001 From: Paul Valerie GOMA Date: Wed, 23 Jul 2025 10:26:22 +0200 Subject: [PATCH 08/17] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20=20refactor:=20Compo?= =?UTF-8?q?nent=20updated?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/checkbox/VCheckbox.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/checkbox/VCheckbox.vue b/src/components/checkbox/VCheckbox.vue index c727762..92a173a 100644 --- a/src/components/checkbox/VCheckbox.vue +++ b/src/components/checkbox/VCheckbox.vue @@ -96,7 +96,7 @@ const labelState = computed(() => { display: flex; flex-direction: column; align-items: start; - gap: 0.125rem; + gap: 0.5rem; align-self: stretch; } From 2c4a134152ae6df1a4f4cf8e84cddbfd642f657d Mon Sep 17 00:00:00 2001 From: Paul Valerie GOMA Date: Wed, 23 Jul 2025 11:04:30 +0200 Subject: [PATCH 09/17] =?UTF-8?q?=E2=9C=A8=20feature:=20emit=20handled?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/checkbox/VCheckbox.vue | 31 ++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/src/components/checkbox/VCheckbox.vue b/src/components/checkbox/VCheckbox.vue index 92a173a..1c1cfc2 100644 --- a/src/components/checkbox/VCheckbox.vue +++ b/src/components/checkbox/VCheckbox.vue @@ -3,7 +3,7 @@ import Checkbox from 'primevue/checkbox'; import VLabel from '../label/VLabel.vue'; import VHint from '../hint/VHint.vue'; import type IVCheckBox from './IVCheckbox.type'; -import { useId, computed } from 'vue'; +import { useId, computed, watch, ref } from 'vue'; const props = withDefaults(defineProps(), { id: () => useId(), @@ -16,7 +16,6 @@ const props = withDefaults(defineProps(), { readonlyOpacity: 0.75, }); - const size = computed(() => props.small ? 'small' : undefined) const message = computed(() => props.errorMessage || props.validMessage) @@ -33,6 +32,26 @@ const labelState = computed(() => { else if((!!props.validMessage || props.type === 'success') && !props.disabled) return 'success'; else return 'default'; }) + +const emit = defineEmits([ + 'update:modelValue', + 'value-change', + 'change', + 'focus', + 'blur' +]) + +const localModelValue = ref(props.modelValue); +watch(() => props.modelValue, (newVal) => { + if(localModelValue.value !== newVal){ + localModelValue.value = newVal; + } +}) +watch(localModelValue, (newVal) => { + if(props.modelValue !== newVal){ + emit('update:modelValue', newVal); + } +}); From 4fda9c4ecf83229f90c2f43714424775eacebc02 Mon Sep 17 00:00:00 2001 From: Paul Valerie GOMA Date: Wed, 23 Jul 2025 12:43:05 +0200 Subject: [PATCH 14/17] 1.0.5 -> 1.0.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e69ad57..4db8cd9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cellule-financiere-pmo/visua-vue", - "version": "1.0.5", + "version": "1.0.6", "type": "module", "scripts": { "dev": "vite", From 31c560ea028db99ed56cd71a151d3dc913b31211 Mon Sep 17 00:00:00 2001 From: Paul Valerie GOMA Date: Wed, 23 Jul 2025 12:43:20 +0200 Subject: [PATCH 15/17] 1.0.5 -> 1.0.6 --- package-lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 696bb58..eb36326 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@cellule-financiere-pmo/visua-vue", - "version": "1.0.5", + "version": "1.0.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@cellule-financiere-pmo/visua-vue", - "version": "1.0.5", + "version": "1.0.6", "license": "ISC", "dependencies": { "@cellule-financiere-pmo/visua": "1.1.3", From aa50024d64d9732f070598fb2982d39c88869f13 Mon Sep 17 00:00:00 2001 From: Paul Valerie GOMA Date: Wed, 23 Jul 2025 12:43:58 +0200 Subject: [PATCH 16/17] =?UTF-8?q?=F0=9F=93=9D=20docs:=20README=20file=20up?= =?UTF-8?q?dated?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1e65271..6872d61 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # visua-vue -**Current version: v1.0.5** \ No newline at end of file +**Current version: v1.0.6** \ No newline at end of file From 4c796bc74cb771be309237e4c287712c02f3e260 Mon Sep 17 00:00:00 2001 From: Paul Valerie GOMA Date: Wed, 23 Jul 2025 12:52:07 +0200 Subject: [PATCH 17/17] =?UTF-8?q?=F0=9F=93=9D=20docs:=20Updated=20CHANGELO?= =?UTF-8?q?G=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 08334de..caf21dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.0.6] - 2025-07-23 +### Added +- Checkbox component + +### Fixed +- VLabel `required-tip` slot +- VHint UI style + ## [1.0.5] - 2025-07-22 ### Added - Input component