@meetelise/chat 1.31.0 → 1.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/src/WebComponent/FeeCalculator/components/{addon-item → addons/addon-item}/addon-item.d.ts +2 -2
  2. package/dist/src/WebComponent/FeeCalculator/components/addons/rentable-item/rentable-item-styles.d.ts +2 -0
  3. package/dist/src/WebComponent/FeeCalculator/components/addons/rentable-item/rentable-item.d.ts +25 -0
  4. package/dist/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout.d.ts +13 -5
  5. package/dist/src/WebComponent/FeeCalculator/components/fee-item/fee-item.d.ts +1 -1
  6. package/dist/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.d.ts +8 -8
  7. package/dist/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card.d.ts +3 -3
  8. package/dist/src/WebComponent/FeeCalculator/components/index.d.ts +1 -1
  9. package/dist/src/WebComponent/FeeCalculator/constants.d.ts +1 -0
  10. package/dist/src/WebComponent/FeeCalculator/fee-calculator.d.ts +4 -3
  11. package/dist/src/globals.d.ts +1 -0
  12. package/dist/src/services/fees/calculateQuote.d.ts +0 -1
  13. package/dist/src/services/fees/fetchBuildingUnits.d.ts +29 -0
  14. package/dist/src/utils/queryParamBuilder.d.ts +8 -0
  15. package/package.json +1 -1
  16. package/public/dist/index.js +302 -241
  17. package/src/WebComponent/FeeCalculator/components/{addon-item → addons/addon-item}/addon-item.ts +33 -35
  18. package/src/WebComponent/FeeCalculator/components/addons/rentable-item/rentable-item-styles.ts +9 -0
  19. package/src/WebComponent/FeeCalculator/components/addons/rentable-item/rentable-item.ts +138 -0
  20. package/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout.ts +42 -17
  21. package/src/WebComponent/FeeCalculator/components/fee-item/fee-item.ts +1 -1
  22. package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector-styles.ts +0 -1
  23. package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.ts +31 -35
  24. package/src/WebComponent/FeeCalculator/components/floorplan-image-card/floorplan-image-card.ts +13 -13
  25. package/src/WebComponent/FeeCalculator/components/index.ts +1 -1
  26. package/src/WebComponent/FeeCalculator/constants.ts +2 -0
  27. package/src/WebComponent/FeeCalculator/fee-calculator.ts +48 -25
  28. package/src/WebComponent/actions/call-us-window.ts +32 -10
  29. package/src/WebComponent/launcher/Launcher.ts +0 -1
  30. package/src/WebComponent/me-chat.ts +4 -7
  31. package/src/globals.ts +2 -0
  32. package/src/services/fees/calculateQuote.ts +0 -1
  33. package/src/services/fees/fetchBuildingUnits.ts +84 -0
  34. package/src/utils/queryParamBuilder.ts +28 -0
  35. package/dist/src/WebComponent/FeeCalculator/components/addon-item/index.d.ts +0 -1
  36. package/dist/src/services/fees/fetchBuildingFloorplans.d.ts +0 -21
  37. package/src/WebComponent/FeeCalculator/components/addon-item/index.ts +0 -1
  38. /package/dist/src/WebComponent/FeeCalculator/components/{addon-item/addon-item-styles.d.ts → addons/common-addon-styles.d.ts} +0 -0
  39. /package/src/WebComponent/FeeCalculator/components/{addon-item/addon-item-styles.ts → addons/common-addon-styles.ts} +0 -0
@@ -1,6 +1,6 @@
1
1
  import { LitElement, TemplateResult } from "lit";
2
- import { BuildingFee } from "../../model/building-fee";
3
- import { DesiredAddon } from "../../../../services/fees/calculateQuote";
2
+ import { BuildingFee } from "../../../model/building-fee";
3
+ import { DesiredAddon } from "../../../../../services/fees/calculateQuote";
4
4
  export declare class AddonItem extends LitElement {
5
5
  static styles: import("lit").CSSResult;
6
6
  feeItem: BuildingFee | null;
@@ -0,0 +1,2 @@
1
+ declare const rentableItemStyles: import("lit").CSSResult;
2
+ export default rentableItemStyles;
@@ -0,0 +1,25 @@
1
+ import { LitElement, TemplateResult } from "lit";
2
+ import { RentableItemSummary } from "../../../../../services/fees/fetchBuildingFees";
3
+ import { DesiredRentableItem } from "../../../../../services/fees/calculateQuote";
4
+ export declare class RentableItem extends LitElement {
5
+ static styles: import("lit").CSSResult;
6
+ rentableItem: RentableItemSummary | null;
7
+ onSelect: ((rentableItem: DesiredRentableItem) => void) | null;
8
+ private isChecked;
9
+ private quantity;
10
+ selectedItemIds: Set<string>;
11
+ get totalAvailableItems(): number;
12
+ get quantityLeft(): number;
13
+ get atMaxUnits(): boolean;
14
+ get atMinUnits(): boolean;
15
+ private handleCheckboxClick;
16
+ private handleIncrement;
17
+ private handleDecrement;
18
+ private emitChange;
19
+ render(): TemplateResult;
20
+ }
21
+ declare global {
22
+ interface HTMLElementTagNameMap {
23
+ "rentable-item": RentableItem;
24
+ }
25
+ }
@@ -1,27 +1,35 @@
1
1
  import { LitElement, TemplateResult } from "lit";
2
2
  import { BuildingFee, RecurrenceFrequency } from "../../model/building-fee";
3
3
  import { LayoutOption } from "../../../../fetchBuildingWebchatView";
4
- import { CalculateQuoteResponse, DesiredAddon, FeeEstimate } from "../../../../services/fees/calculateQuote";
4
+ import { CalculateQuoteResponse, DesiredAddon, DesiredRentableItem, FeeEstimate } from "../../../../services/fees/calculateQuote";
5
+ import { RentableItemSummary } from "../../../../services/fees/fetchBuildingFees";
6
+ import { Unit } from "../../../../services/fees/fetchBuildingUnits";
5
7
  import "../floor-plan-selector/floor-plan-selector";
6
8
  import "../fee-card/fee-card";
7
- import "../addon-item/addon-item";
9
+ import "../addons/addon-item/addon-item";
10
+ import "../addons/rentable-item/rentable-item";
8
11
  import "../../../loaders/skeleton-loader";
9
12
  export declare class FeeCalculatorLayout extends LitElement {
10
13
  static styles: import("lit").CSSResult;
11
14
  buildingSlug: string;
12
15
  isLoading: boolean;
13
- selectedUnitId: number | null;
16
+ selectedUnit: Unit | null;
14
17
  quote: CalculateQuoteResponse | null;
15
18
  layoutOptions: LayoutOption[];
16
19
  selectedLayoutIds: number[];
17
20
  groupedFees: Record<RecurrenceFrequency, BuildingFee[]>;
21
+ rentableItems: RentableItemSummary[];
18
22
  onSelectLayout: ((layoutIds: number[]) => void) | null;
19
- onUnitSelect: ((unitId: number) => void) | null;
23
+ onUnitSelect: ((unit: Unit) => void) | null;
20
24
  onMoveInDateChange: ((moveInDate: Date) => void) | null;
21
25
  onLeaseTermChange: ((leaseTerm: number) => void) | null;
22
26
  onAddonSelect: ((addon: DesiredAddon) => void) | null;
27
+ onRentableItemSelect: ((rentableItem: DesiredRentableItem) => void) | null;
23
28
  get standardFees(): Record<RecurrenceFrequency, BuildingFee[]>;
24
- get addOns(): BuildingFee[];
29
+ /**
30
+ * A "rentable item" is simply a fee which has inventory attached to it.
31
+ */
32
+ get addOns(): (BuildingFee | RentableItemSummary)[];
25
33
  renderRecurrenceFeeSection(title: string, fees: FeeEstimate[]): TemplateResult | null;
26
34
  renderFeeSections(): TemplateResult[];
27
35
  renderFeesContent(): TemplateResult;
@@ -1,6 +1,6 @@
1
1
  import { LitElement, TemplateResult } from "lit";
2
2
  import { FeeEstimate } from "../../../../services/fees/calculateQuote";
3
- import "../addon-item/addon-item";
3
+ import "../addons/addon-item/addon-item";
4
4
  export declare class FeeItemComponent extends LitElement {
5
5
  static styles: import("lit").CSSResult;
6
6
  feeItem: FeeEstimate | null;
@@ -1,6 +1,6 @@
1
1
  import { LitElement, TemplateResult } from "lit";
2
2
  import { LayoutOption } from "../../../../fetchBuildingWebchatView";
3
- import { Floorplan } from "../../../../services/fees/fetchBuildingFloorplans";
3
+ import { Unit } from "../../../../services/fees/fetchBuildingUnits";
4
4
  import "../floorplan-image-card/floorplan-image-card";
5
5
  import "../../../loaders/mega-loader";
6
6
  export declare class FloorPlanSelector extends LitElement {
@@ -9,21 +9,21 @@ export declare class FloorPlanSelector extends LitElement {
9
9
  layoutOptions: LayoutOption[];
10
10
  selectedLayoutIds: number[];
11
11
  onSelectLayout: ((layoutIds: number[]) => void) | null;
12
- onUnitSelect: ((unitId: number) => void) | null;
12
+ onUnitSelect: ((unit: Unit) => void) | null;
13
13
  onMoveInDateChange: ((moveInDate: Date) => void) | null;
14
14
  onLeaseTermChange: ((leaseTerm: number) => void) | null;
15
15
  moveInDate: Date | null;
16
- leaseTerm: string;
17
- floorPlans: Floorplan[];
18
- selectedUnitId: number | null;
16
+ leaseTerm: number;
17
+ units: Unit[];
18
+ selectedUnit: Unit | null;
19
19
  isLoading: boolean;
20
20
  private get displayOptions();
21
- private fetchFloorplans;
21
+ private fetchUnits;
22
22
  firstUpdated: () => Promise<void>;
23
- handleUnitSelect: (unitId: number) => void;
23
+ handleUnitSelect: (unit: Unit) => void;
24
24
  handleLayoutChange: (ids: number[]) => Promise<void>;
25
25
  handleMoveInDateChange: (e: Event) => Promise<void>;
26
- handleLeaseTermChange: (e: Event) => void;
26
+ handleLeaseTermChange: (e: Event) => Promise<void>;
27
27
  render(): TemplateResult;
28
28
  }
29
29
  declare global {
@@ -1,9 +1,9 @@
1
1
  import { LitElement, TemplateResult } from "lit";
2
- import { Floorplan } from "../../../../services/fees/fetchBuildingFloorplans";
2
+ import { Unit } from "../../../../services/fees/fetchBuildingUnits";
3
3
  export declare class FloorplanImageCard extends LitElement {
4
4
  static styles: import("lit").CSSResult;
5
- floorplan: Floorplan;
6
- onUnitSelect: ((unitId: number) => void) | null;
5
+ unit: Unit;
6
+ onUnitSelect: ((unit: Unit) => void) | null;
7
7
  selected: boolean;
8
8
  get bedAndBathText(): string;
9
9
  get priceRange(): string;
@@ -1,5 +1,5 @@
1
1
  export * from "./promo-card/promo-card";
2
2
  export * from "./floor-plan-selector/floor-plan-selector";
3
3
  export * from "./fee-card/fee-card";
4
- export * from "./addon-item/addon-item";
4
+ export * from "./addons/addon-item/addon-item";
5
5
  export * from "./fee-calculator-layout/fee-calculator-layout";
@@ -1,2 +1,3 @@
1
1
  export declare const ALL_LAYOUTS_OPTION = -1;
2
2
  export declare const CALCULATE_DEBOUNCE_MS = 1000;
3
+ export declare const DEFAULT_LEASE_TERM = 12;
@@ -2,6 +2,7 @@ import { LitElement, TemplateResult } from "lit";
2
2
  import { LayoutOption } from "../../fetchBuildingWebchatView";
3
3
  import { BuildingFee, RecurrenceFrequency } from "./model/building-fee";
4
4
  import { CalculateQuoteResponse, DesiredAddon, DesiredRentableItem } from "../../services/fees/calculateQuote";
5
+ import { Unit } from "../../services/fees/fetchBuildingUnits";
5
6
  import "./components";
6
7
  import "./components/fee-calculator-layout/fee-calculator-layout";
7
8
  import "../chat-additional-actions";
@@ -12,7 +13,6 @@ export declare class FeeCalculator extends LitElement {
12
13
  orgSlug: string;
13
14
  private primaryColor;
14
15
  private backgroundColor;
15
- compactDesign: boolean;
16
16
  onCloseClicked: (() => void) | null;
17
17
  onClickEmailOption: ((e: MouseEvent) => void) | null;
18
18
  onClickPhoneOption: ((e: MouseEvent) => void) | null;
@@ -20,7 +20,7 @@ export declare class FeeCalculator extends LitElement {
20
20
  onClickTextUsOption: ((e: MouseEvent) => void) | null;
21
21
  private isLoading;
22
22
  private selectedLayoutIds;
23
- private selectedUnitId;
23
+ private selectedUnit;
24
24
  private desiredAddons;
25
25
  private desiredRentableItems;
26
26
  private leaseTerm;
@@ -36,13 +36,14 @@ export declare class FeeCalculator extends LitElement {
36
36
  };
37
37
  quote: CalculateQuoteResponse | null;
38
38
  private groupedFees;
39
+ private rentableItems;
39
40
  private debouncedCalculateQuote;
40
41
  get layouts(): LayoutOption[];
41
42
  firstUpdated: () => Promise<void>;
42
43
  setupCalculator: () => Promise<void>;
43
44
  updated(changedProperties: Map<string, unknown>): void;
44
45
  calculateQuote: () => Promise<void>;
45
- handleUnitSelect: (unitId: number) => void;
46
+ handleUnitSelect: (unit: Unit) => void;
46
47
  handleMoveInDateChange: (date: Date) => void;
47
48
  handleLeaseTermChange: (leaseTerm: number) => void;
48
49
  handleAddonSelect: (addon: DesiredAddon) => void;
@@ -1 +1,2 @@
1
1
  export declare const BASE_DOMAIN = "https://app.meetelise.com";
2
+ export declare const TODAY: Date;
@@ -14,7 +14,6 @@ export declare type DesiredAddon = {
14
14
  };
15
15
  export declare type DesiredRentableItem = {
16
16
  id: number;
17
- quantity: number;
18
17
  type: string;
19
18
  };
20
19
  export declare type CalculateQuoteResponse = {
@@ -0,0 +1,29 @@
1
+ export declare type Unit = {
2
+ /**
3
+ * ID comes back in the format "u1234567890" - we strip the "u"
4
+ */
5
+ id: number;
6
+ unitNumber: string;
7
+ layout: number;
8
+ externalFloorPlanDescriptionId: string;
9
+ numberOfBedrooms: number;
10
+ numberOfBathrooms: number;
11
+ squareFootage: number;
12
+ floor: number;
13
+ floorplanName: string;
14
+ floorplanUrl: string;
15
+ availabilityStage: string;
16
+ earliestAvailable: string;
17
+ latestAvailable: string;
18
+ startingPrice: number;
19
+ maxPrice: number;
20
+ };
21
+ declare type FetchPropertyUnitsParams = {
22
+ buildingSlug: string;
23
+ numBedrooms?: number;
24
+ moveInDateEarliest?: Date;
25
+ moveInDateLatest?: Date;
26
+ leaseTermMin?: number;
27
+ };
28
+ declare const fetchBuildingUnits: ({ buildingSlug, numBedrooms, moveInDateEarliest, moveInDateLatest, leaseTermMin, }: FetchPropertyUnitsParams) => Promise<Unit[]>;
29
+ export default fetchBuildingUnits;
@@ -0,0 +1,8 @@
1
+ declare class QueryParamBuilder {
2
+ private params;
3
+ constructor();
4
+ addSingle(key: string, value?: string): QueryParamBuilder;
5
+ addArray(key: string, values?: string[]): QueryParamBuilder;
6
+ build(): string;
7
+ }
8
+ export default QueryParamBuilder;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meetelise/chat",
3
- "version": "1.31.0",
3
+ "version": "1.32.0",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "homepage": "https://github.com/MeetElise/chat-ui#readme",