From 9578e7b6b4159aeae7d483d13522681c3299b291 Mon Sep 17 00:00:00 2001 From: Vincent Salucci <26154748+vincentsalucci@users.noreply.github.com> Date: Tue, 11 Oct 2022 07:49:31 -0500 Subject: [PATCH] [CL-27] [EC-455] Ng-Select Integration (#3383) * [CL-27] Select -> Library initial commit * [EC-455] NG-Select Integration * Prettier * [EC-455] [CL-27] Add option for removing items on close // Added loading/no item found text defaults // Fixed disabled bg color // Added templated loading icon * [EC-455] [CL-27] Removed enter override // Fixed backspace removal // Clearing search on add // Gave label select states * [EC-455] [CL-27] Added copy from text to theme * [EC-455] [CL-27] Changed SimpleItemView to type - removed creation logic to shift responsibility to hosting component * [EC-455] [CL-27] Updated custom theme to include CSS variable colors * [CL-27] [EC-455] Initial pass at form field control // initial template for custom value accessor * [EC-455] working baseItem input * [EC-455] working value accessor * [EC-455] Completed FormFieldControl implemntation // fixed badge disabled bug * [EC-455] Prettier * [EC-455] Removed obsolete variables * [EC-455] Private value accessor functions * [EC-455] Cleaned up default variables * [EC-455] Imported Shared module to access i18n pipe // cleaned up string refs * [EC-455] Adjusted padding for clear button // Changed hover color to text-main // Fixed pipe import on stories * [EC-455] FormObj factory * [EC-455] FormObj factory * [EC-455] Updated FormFieldModule import/export statements * [EC-455] Null check ngControl // added strings * [EC-455] Fixed remaining null check // Added standalone story & input * [EC-455] Actually adding the null check * [EC-455] Removed injector logic // Removed Value Accessor PROVIDER // Self-assigned value accessor * [EC-455] Fixed ID copy pasta // Forwarded desribed by to focusable input // Abstracted input for label * [EC-455] Prettier --- apps/web/src/locales/en/messages.json | 12 + .../src/form-field/form-field-control.ts | 8 + .../src/form-field/form-field.component.html | 2 +- .../src/form-field/form-field.component.ts | 5 +- .../src/form-field/form-field.module.ts | 7 +- libs/components/src/form-field/index.ts | 1 + .../src/form-field/multi-select.stories.ts | 283 +++++++++++++ libs/components/src/input/input.directive.ts | 9 +- .../multi-select/models/select-item-view.ts | 7 + .../multi-select/multi-select.component.html | 55 +++ .../multi-select/multi-select.component.ts | 179 ++++++++ .../src/multi-select/multi-select.module.ts | 16 + .../src/multi-select/scss/bw.theme.scss | 394 ++++++++++++++++++ libs/components/src/styles.scss | 76 ++-- package-lock.json | 28 +- package.json | 1 + 16 files changed, 1038 insertions(+), 45 deletions(-) create mode 100644 libs/components/src/form-field/form-field-control.ts create mode 100644 libs/components/src/form-field/multi-select.stories.ts create mode 100644 libs/components/src/multi-select/models/select-item-view.ts create mode 100644 libs/components/src/multi-select/multi-select.component.html create mode 100644 libs/components/src/multi-select/multi-select.component.ts create mode 100644 libs/components/src/multi-select/multi-select.module.ts create mode 100644 libs/components/src/multi-select/scss/bw.theme.scss diff --git a/apps/web/src/locales/en/messages.json b/apps/web/src/locales/en/messages.json index efced93ca43..755eb80b7ae 100644 --- a/apps/web/src/locales/en/messages.json +++ b/apps/web/src/locales/en/messages.json @@ -5390,5 +5390,17 @@ }, "numberOfUsers": { "message": "Number of users" + }, + "multiSelectPlaceholder": { + "message": "-- Type to Filter --" + }, + "multiSelectLoading": { + "message": "Retrieving options..." + }, + "multiSelectNotFound": { + "message": "No items found" + }, + "multiSelectClearAll": { + "message": "Clear all" } } diff --git a/libs/components/src/form-field/form-field-control.ts b/libs/components/src/form-field/form-field-control.ts new file mode 100644 index 00000000000..ee63407a8bd --- /dev/null +++ b/libs/components/src/form-field/form-field-control.ts @@ -0,0 +1,8 @@ +export abstract class BitFormFieldControl { + ariaDescribedBy: string; + id: string; + labelForId: string; + required: boolean; + hasError: boolean; + error: [string, any]; +} diff --git a/libs/components/src/form-field/form-field.component.html b/libs/components/src/form-field/form-field.component.html index cf638ce1c77..5c46fb557b4 100644 --- a/libs/components/src/form-field/form-field.component.html +++ b/libs/components/src/form-field/form-field.component.html @@ -1,4 +1,4 @@ -