From 1f7e69b19566998edf1f2a1bb2e62d12ee053087 Mon Sep 17 00:00:00 2001 From: DhaaraniCIT Date: Thu, 6 Jun 2024 18:53:25 +0530 Subject: [PATCH] multi select css changes --- .../configuration-multi-select.component.html | 25 +--- .../email-multi-select-field.component.html | 48 +------ .../multi-select/multi-select.component.html | 63 +++++++++- .../multi-select/multi-select.component.scss | 75 ++++++++++- .../multi-select/multi-select.component.ts | 37 +++++- src/styles.scss | 117 +++++++++--------- 6 files changed, 239 insertions(+), 126 deletions(-) diff --git a/src/app/shared/components/configuration/configuration-multi-select/configuration-multi-select.component.html b/src/app/shared/components/configuration/configuration-multi-select/configuration-multi-select.component.html index 97e22195b..012de52ae 100644 --- a/src/app/shared/components/configuration/configuration-multi-select/configuration-multi-select.component.html +++ b/src/app/shared/components/configuration/configuration-multi-select/configuration-multi-select.component.html @@ -9,27 +9,10 @@
- - -
-

{{ name | titlecase | snakeCaseToSpaceCase }}

-
-
- {{ placeholder }} -
-
- - -
-

{{ memo | titlecase | snakeCaseToSpaceCase }}

-
-
-
+ +
diff --git a/src/app/shared/components/configuration/email-multi-select-field/email-multi-select-field.component.html b/src/app/shared/components/configuration/email-multi-select-field/email-multi-select-field.component.html index 96f1ce168..03f969b7e 100644 --- a/src/app/shared/components/configuration/email-multi-select-field/email-multi-select-field.component.html +++ b/src/app/shared/components/configuration/email-multi-select-field/email-multi-select-field.component.html @@ -9,48 +9,12 @@
- - -
-

{{ selectedEmail }}

-

- -
-
-

- +{{ form.value.email.length - 1 }} -

-
-
- Select Email Address -
-
- -
-
- - - - -
-
-
- -
- - - {{ user.name }} - - -

{{ user.email }}

-
-
-
+ +
diff --git a/src/app/shared/components/input/multi-select/multi-select.component.html b/src/app/shared/components/input/multi-select/multi-select.component.html index 559e4c231..b993518f4 100644 --- a/src/app/shared/components/input/multi-select/multi-select.component.html +++ b/src/app/shared/components/input/multi-select/multi-select.component.html @@ -1,5 +1,66 @@
- + + +
+
+

{{ name | titlecase | snakeCaseToSpaceCase }}

+
+
+ {{ placeholder }} +
+
+
+
+

{{ selectedValue }}

+

+ +
+
+

+ +{{ form.value.email.length - 1 }} +

+
+
+ {{placeholder}} +
+
+
+ +
+
+ + + + +
+
+
+ +
+

{{ value | titlecase | snakeCaseToSpaceCase }}

+
+
+ + + {{ value.name }} + + +

{{ value.email }}

+
+
diff --git a/src/app/shared/components/input/multi-select/multi-select.component.scss b/src/app/shared/components/input/multi-select/multi-select.component.scss index fbef2a601..50b664521 100644 --- a/src/app/shared/components/input/multi-select/multi-select.component.scss +++ b/src/app/shared/components/input/multi-select/multi-select.component.scss @@ -1,3 +1,74 @@ -:host ::ng-deep .p-multiselect-label { - @apply tw-z-1 tw-w-270-px #{!important}; +.p-multiselect { + @apply tw-h-40-px tw-flex tw-items-center lg:tw-w-300-px md:tw-w-260-px tw-border tw-border-solid tw-border-select-default-border tw-rounded-4-px #{!important}; + + &.p-focus:not(.p-disabled) { + @apply tw-shadow-none tw-border-select-focused-border #{!important}; + } + + &.p-focus { + @apply tw-shadow-none #{!important}; + } + + .p-multiselect-trigger { + @apply tw-w-12-px #{!important}; + } + + .p-multiselect-label { + @apply tw-text-select-focused-text tw-text-14-px tw-p-0 tw-z-1 tw-w-270-px #{!important}; + + &.p-placeholder { + @apply tw-text-select-focused-placeholder-text #{!important}; + } + } + + .p-multiselect-close { + @apply tw-hidden #{!important}; + } + + .p-multiselect-panel { + @apply tw-w-300-px; + + .p-multiselect-header { + @apply tw-border-none tw-p-0 #{!important}; + + .p-checkbox { + @apply tw-hidden; + } + } + + .p-multiselect-items { + @apply tw-p-0 #{!important}; + + .p-multiselect-item { + @apply tw-text-14-px tw-text-dd-menu-item-default-text-color tw-px-12-px tw-py-6-px #{!important}; + + .p-checkbox { + @apply tw-mb-0 #{!important}; + } + + &.p-highlight { + @apply tw-text-14-px tw-text-dd-menu-item-default-text-color tw-bg-white tw-rounded-4-px #{!important}; + } + + &:not(.p-highlight):not(.p-disabled):hover, + &:focus, + &:hover { + @apply tw-shadow-none tw-bg-dd-menu-item-hover-bg #{!important}; + } + + &:hover { + @apply tw-shadow-none tw-bg-dd-menu-item-hover-bg tw-rounded-none #{!important}; + } + } + + .p-multiselect-empty-message { + @apply tw-py-24-px tw-flex tw-justify-center tw-text-slightly-normal-text-color tw-text-14-px tw-italic #{!important}; + } + } + } + + .p-multiselect-filter-container { + @apply tw-hidden; + } } + diff --git a/src/app/shared/components/input/multi-select/multi-select.component.ts b/src/app/shared/components/input/multi-select/multi-select.component.ts index 714a23e86..35ae53e05 100644 --- a/src/app/shared/components/input/multi-select/multi-select.component.ts +++ b/src/app/shared/components/input/multi-select/multi-select.component.ts @@ -1,12 +1,13 @@ -import { Component, Input, OnInit } from '@angular/core'; +import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { FormGroup } from '@angular/forms'; +import { brandingConfig } from 'src/app/branding/branding-config'; @Component({ selector: 'app-multi-select', templateUrl: './multi-select.component.html', styleUrls: ['./multi-select.component.scss'] }) -export class MultiSelectComponent { +export class MultiSelectComponent implements OnInit{ @Input() form: FormGroup; @@ -18,6 +19,38 @@ export class MultiSelectComponent { @Input() options: any[]; + @Input() optionLabel: string; + + @Input() displayAs: string; + + @Input() isFilter: boolean = false; + + @Input() filterBy: string; + + @Input() isFieldMandatory: boolean = false; + + @Input() selectedValue: string | null; + + @Output() multiSelectChange = new EventEmitter(); + + @Output() removeItem = new EventEmitter(); + + readonly brandingConfig = brandingConfig; + constructor() { } + onMultiSelectChange(value: any) { + this.multiSelectChange.emit(); + } + + removeIconClick() { + this.removeItem.emit(); + } + + isOverflowing(element: any): boolean { + return element.offsetWidth < element.scrollWidth; + } + + ngOnInit(): void {} + } diff --git a/src/styles.scss b/src/styles.scss index 9b4a22b35..62a32b5ec 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -7,6 +7,7 @@ @import 'assets/themes/co/c1dl.scss'; @import 'assets/themes/fyle/fdl.scss'; @import './app/shared/components/input/toggle/toggle.component.scss'; +@import './app/shared/components/input/multi-select/multi-select.component.scss'; @@ -308,50 +309,50 @@ p { @apply tw-bg-bg-tertiary tw-p-6-px #{!important} } -.p-multiselect { - @apply tw-h-40-px tw-flex tw-items-center lg:tw-w-300-px md:tw-w-260-px tw-border tw-border-solid tw-border-select-default-border tw-rounded-4-px #{!important}; -} +// .p-multiselect { +// @apply tw-h-40-px tw-flex tw-items-center lg:tw-w-300-px md:tw-w-260-px tw-border tw-border-solid tw-border-select-default-border tw-rounded-4-px #{!important}; +// } -.p-multiselect .p-multiselect-trigger { - @apply tw-w-12-px #{!important}; -} +// .p-multiselect .p-multiselect-trigger { +// @apply tw-w-12-px #{!important}; +// } -.p-multiselect .p-multiselect-label { - @apply tw-text-select-focused-text tw-text-14-px tw-p-0 #{!important}; -} +// .p-multiselect .p-multiselect-label { +// @apply tw-text-select-focused-text tw-text-14-px tw-p-0 #{!important}; +// } -.p-multiselect:not(.p-disabled).p-focus { - @apply tw-shadow-none #{!important}; -} +// .p-multiselect:not(.p-disabled).p-focus { +// @apply tw-shadow-none #{!important}; +// } -.p-multiselect.p-focus:not(.p-disabled) { - @apply tw-shadow-none tw-border-select-focused-border #{!important}; -} +// .p-multiselect.p-focus:not(.p-disabled) { +// @apply tw-shadow-none tw-border-select-focused-border #{!important}; +// } -.p-multiselect-panel .p-multiselect-header .p-checkbox { - @apply tw-hidden; -} +// .p-multiselect-panel .p-multiselect-header .p-checkbox { +// @apply tw-hidden; +// } -.p-multiselect-panel .p-multiselect-header, -.p-multiselect-panel .p-multiselect-items { - @apply tw-p-0 #{!important}; -} +// .p-multiselect-panel .p-multiselect-header, +// .p-multiselect-panel .p-multiselect-items { +// @apply tw-p-0 #{!important}; +// } -.p-multiselect-panel .p-multiselect-header { - @apply tw-border-none #{!important}; -} +// .p-multiselect-panel .p-multiselect-header { +// @apply tw-border-none #{!important}; +// } -.p-multiselect-filter-container { - @apply tw-hidden; -} +// .p-multiselect-filter-container { +// @apply tw-hidden; +// } -.p-multiselect-close { - @apply tw-hidden #{!important}; -} +// .p-multiselect-close { +// @apply tw-hidden #{!important}; +// } -.p-multiselect-panel { - @apply tw-w-300-px; -} +// .p-multiselect-panel { +// @apply tw-w-300-px; +// } .p-dropdown-panel .p-dropdown-items .p-dropdown-item { @apply tw-min-h-dropdown-option-height tw-py-6-px tw-px-12-px #{!important}; @@ -361,21 +362,21 @@ p { @apply tw-text-select-default-placeholder-text #{!important}; } -.p-multiselect .p-multiselect-label.p-placeholder { - @apply tw-text-select-focused-placeholder-text #{!important}; -} +// .p-multiselect .p-multiselect-label.p-placeholder { +// @apply tw-text-select-focused-placeholder-text #{!important}; +// } -.p-multiselect-panel .p-multiselect-items .p-multiselect-item { - @apply tw-text-14-px tw-text-dd-menu-item-default-text-color tw-px-12-px tw-py-6-px #{!important}; -} +// .p-multiselect-panel .p-multiselect-items .p-multiselect-item { +// @apply tw-text-14-px tw-text-dd-menu-item-default-text-color tw-px-12-px tw-py-6-px #{!important}; +// } .p-checkbox { @apply tw-h-[revert] tw-w-[revert] #{!important}; } -.p-multiselect-panel .p-multiselect-items .p-multiselect-item .p-checkbox { - @apply tw-mb-0 #{!important}; -} +// .p-multiselect-panel .p-multiselect-items .p-multiselect-item .p-checkbox { +// @apply tw-mb-0 #{!important}; +// } .p-checkbox .p-checkbox-box { @apply tw-h-16-px tw-w-16-px tw-rounded-5-px tw-transition-none tw-border-[1.5px] tw-border-checkbox-icon-color #{!important}; @@ -385,21 +386,21 @@ p { @apply tw-border-[1.5px] #{!important}; } -.p-multiselect-panel .p-multiselect-items .p-multiselect-item.p-highlight { - @apply tw-text-14-px tw-text-dd-menu-item-default-text-color tw-bg-white tw-rounded-4-px #{!important}; -} +// .p-multiselect-panel .p-multiselect-items .p-multiselect-item.p-highlight { +// @apply tw-text-14-px tw-text-dd-menu-item-default-text-color tw-bg-white tw-rounded-4-px #{!important}; +// } -.p-multiselect-panel .p-multiselect-items .p-multiselect-item:not(.p-highlight):not(.p-disabled):hover { - @apply tw-shadow-none tw-bg-dd-menu-item-hover-bg #{!important}; -} +// .p-multiselect-panel .p-multiselect-items .p-multiselect-item:not(.p-highlight):not(.p-disabled):hover { +// @apply tw-shadow-none tw-bg-dd-menu-item-hover-bg #{!important}; +// } -.p-multiselect-panel .p-multiselect-items .p-multiselect-item:focus { - @apply tw-shadow-none tw-bg-dd-menu-item-hover-bg #{!important}; -} +// .p-multiselect-panel .p-multiselect-items .p-multiselect-item:focus { +// @apply tw-shadow-none tw-bg-dd-menu-item-hover-bg #{!important}; +// } -.p-multiselect-panel .p-multiselect-items .p-multiselect-item:hover { - @apply tw-shadow-none tw-bg-dd-menu-item-hover-bg tw-rounded-none #{!important}; -} +// .p-multiselect-panel .p-multiselect-items .p-multiselect-item:hover { +// @apply tw-shadow-none tw-bg-dd-menu-item-hover-bg tw-rounded-none #{!important}; +// } .p-checkbox .p-checkbox-box.p-highlight { @apply tw-bg-checkbox-icon-selected-color tw-border-none tw-pb-checkbox-marked-icon-spacing #{!important}; @@ -413,9 +414,9 @@ p { @apply tw-border-sub-text-color #{!important}; } -.p-multiselect-panel .p-multiselect-items .p-multiselect-empty-message { - @apply tw-py-24-px tw-flex tw-justify-center tw-text-slightly-normal-text-color tw-text-14-px tw-italic #{!important}; -} +// .p-multiselect-panel .p-multiselect-items .p-multiselect-empty-message { +// @apply tw-py-24-px tw-flex tw-justify-center tw-text-slightly-normal-text-color tw-text-14-px tw-italic #{!important}; +// } @mixin spinner($height, $width, $animation) { &.p-progress-spinner {