diff --git a/web/app/components/inputs/people-select.hbs b/web/app/components/inputs/people-select.hbs index e47736539..7a685266f 100644 --- a/web/app/components/inputs/people-select.hbs +++ b/web/app/components/inputs/people-select.hbs @@ -14,17 +14,21 @@ @onKeydown={{@onKeydown}} @disabled={{@disabled}} @selectedItemComponent={{component "multiselect/user-email-image-chip"}} + @calculatePosition={{this.calculatePosition}} + @loadingMessage="Loading..." + @eventType="click" + {{on "click" this.onClick}} ...attributes as |value| >
- -
-
+ +
+
{{get-model-attr "person.name" value}} -
-
- {{get-model-attr "person.email" value}} + + {{get-model-attr "person.email" value}} +
diff --git a/web/app/components/inputs/people-select.ts b/web/app/components/inputs/people-select.ts index d2283708a..67ae69c4a 100644 --- a/web/app/components/inputs/people-select.ts +++ b/web/app/components/inputs/people-select.ts @@ -8,6 +8,10 @@ import FetchService from "hermes/services/fetch"; import Ember from "ember"; import StoreService from "hermes/services/store"; import PersonModel from "hermes/models/person"; +import { Select } from "ember-power-select/components/power-select"; +import { next } from "@ember/runloop"; +import calculatePosition from "ember-basic-dropdown/utils/calculate-position"; +import { assert } from "@ember/debug"; export interface GoogleUser { emailAddresses: { value: string }[]; @@ -15,6 +19,26 @@ export interface GoogleUser { photos: { url: string }[]; } +enum ComputedVerticalPosition { + Above = "above", + Below = "below", +} + +enum ComputedHorizontalPosition { + Left = "left", + Right = "right", +} + +interface CalculatePositionOptions { + horizontalPosition: ComputedHorizontalPosition; + verticalPosition: ComputedVerticalPosition; + matchTriggerWidth: boolean; + previousHorizontalPosition?: ComputedHorizontalPosition; + previousVerticalPosition?: ComputedVerticalPosition; + renderInPlace: boolean; + dropdown: any; +} + interface InputsPeopleSelectComponentSignature { Element: HTMLDivElement; Args: { @@ -40,15 +64,39 @@ export default class InputsPeopleSelectComponent extends Component { + select.actions.close(); + }); } } @@ -56,10 +104,58 @@ export default class InputsPeopleSelectComponent extends Component