From 2c63cf797a7ec1a18cbcf6b946389755e73baf98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Zi=C3=B3=C5=82kowski?= Date: Fri, 22 Nov 2024 17:33:48 +0100 Subject: [PATCH 1/4] IT-5861 fix icon when datepicker is open --- lib/js/components/DatePickers/DatePicker/DatePicker.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/js/components/DatePickers/DatePicker/DatePicker.vue b/lib/js/components/DatePickers/DatePicker/DatePicker.vue index 30a4f7225..4adfe5c43 100644 --- a/lib/js/components/DatePickers/DatePicker/DatePicker.vue +++ b/lib/js/components/DatePickers/DatePicker/DatePicker.vue @@ -272,10 +272,11 @@ export default defineComponent({ return localFullDateWithShortMonthName(this.date); }, tileIcon() { + console.debug(!this.icon, this.icon, this.isOpen); if (!this.icon) { return null; } - return this.isOpen.value ? ICONS.FA_CHEVRON_UP : this.icon; + return this.isOpen ? ICONS.FA_CHEVRON_UP : this.icon; }, }, async mounted() { From 4c4b732623da77d7f699b7128d0b3fa50cc7ea37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Zi=C3=B3=C5=82kowski?= Date: Mon, 25 Nov 2024 13:01:14 +0100 Subject: [PATCH 2/4] IT-5861 error message will show for empty string --- .../DatePickers/DatePicker/DatePicker.stories.ts | 2 +- lib/js/components/DatePickers/DatePicker/DatePicker.vue | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/js/components/DatePickers/DatePicker/DatePicker.stories.ts b/lib/js/components/DatePickers/DatePicker/DatePicker.stories.ts index 669ad2eba..fabdd7365 100644 --- a/lib/js/components/DatePickers/DatePicker/DatePicker.stories.ts +++ b/lib/js/components/DatePickers/DatePicker/DatePicker.stories.ts @@ -98,7 +98,7 @@ const args = { icon: 'FA_CALENDAR_DAY', isIconHiddenOnMobile: false, calendarPosition: DATE_PICKER_CALENDAR_POSITIONS.BOTTOM, - errorMessage: '', + errorMessage: null, state: DATE_PICKER_STATES.DEFAULT, color: DATE_PICKER_COLORS.NEUTRAL, disableDates: [new Date(now + oneDayMili * 2).toISOString().slice(0, 10)], diff --git a/lib/js/components/DatePickers/DatePicker/DatePicker.vue b/lib/js/components/DatePickers/DatePicker/DatePicker.vue index 4adfe5c43..16cbd4047 100644 --- a/lib/js/components/DatePickers/DatePicker/DatePicker.vue +++ b/lib/js/components/DatePickers/DatePicker/DatePicker.vue @@ -45,7 +45,9 @@ @click="toggle" /> - {{ errorMessage }} + + {{ errorMessage }} + @@ -185,7 +187,7 @@ export default defineComponent({ }, errorMessage: { type: String, - default: '', + default: null, }, state: { type: String as PropType, @@ -278,6 +280,9 @@ export default defineComponent({ } return this.isOpen ? ICONS.FA_CHEVRON_UP : this.icon; }, + showErrorMessage() { + return this.errorMessage !== null; + }, }, async mounted() { if (this.isInteractive && this.state === DATE_PICKER_STATES.DEFAULT) { From 430c00cb47bfd020b0d417fcd153a9c3898ce662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Zi=C3=B3=C5=82kowski?= Date: Mon, 25 Nov 2024 13:03:34 +0100 Subject: [PATCH 3/4] IT-5861 remove console error --- lib/js/components/DatePickers/DatePicker/DatePicker.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/js/components/DatePickers/DatePicker/DatePicker.vue b/lib/js/components/DatePickers/DatePicker/DatePicker.vue index 16cbd4047..16839e0ad 100644 --- a/lib/js/components/DatePickers/DatePicker/DatePicker.vue +++ b/lib/js/components/DatePickers/DatePicker/DatePicker.vue @@ -274,7 +274,6 @@ export default defineComponent({ return localFullDateWithShortMonthName(this.date); }, tileIcon() { - console.debug(!this.icon, this.icon, this.isOpen); if (!this.icon) { return null; } From 9523c3f38a2515ed6a28229f3d9764361421c156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Zi=C3=B3=C5=82kowski?= Date: Mon, 25 Nov 2024 14:42:23 +0100 Subject: [PATCH 4/4] IT-5861 add height to error-message --- lib/js/components/DatePickers/DatePicker/DatePicker.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/js/components/DatePickers/DatePicker/DatePicker.vue b/lib/js/components/DatePickers/DatePicker/DatePicker.vue index 16839e0ad..1038f4bb3 100644 --- a/lib/js/components/DatePickers/DatePicker/DatePicker.vue +++ b/lib/js/components/DatePickers/DatePicker/DatePicker.vue @@ -115,6 +115,7 @@ @include info-s-default-regular; color: $color-danger-text; + height: $space-xs; } }