@meetelise/chat 1.35.1 → 1.35.2

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 (19) hide show
  1. package/dist/src/WebComponent/FeeCalculator/model/desired-rentable-item.d.ts +1 -1
  2. package/dist/src/WebComponent/FeeCalculator/model/rentable-item-summary.d.ts +6 -2
  3. package/dist/src/WebComponent/FeeCalculator/model/rentable-item.d.ts +2 -1
  4. package/dist/src/WebComponent/icons/CalculatorOutlineIcon.d.ts +1 -1
  5. package/package.json +1 -1
  6. package/public/dist/index.js +250 -164
  7. package/src/WebComponent/FeeCalculator/components/addons/addon-item-matrix-qty-selector/addon-item-matrix-qty-selector-styles.ts +5 -1
  8. package/src/WebComponent/FeeCalculator/components/addons/common-addon-styles.ts +16 -0
  9. package/src/WebComponent/FeeCalculator/components/addons/rentable-item-qty-selector/rentable-item-qty-selector.ts +18 -6
  10. package/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout-styles.ts +15 -6
  11. package/src/WebComponent/FeeCalculator/components/fee-calculator-layout/fee-calculator-layout.ts +19 -1
  12. package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector-styles.ts +0 -2
  13. package/src/WebComponent/FeeCalculator/components/floor-plan-selector/floor-plan-selector.ts +1 -2
  14. package/src/WebComponent/FeeCalculator/model/desired-rentable-item.ts +1 -1
  15. package/src/WebComponent/FeeCalculator/model/rentable-item-summary.ts +26 -2
  16. package/src/WebComponent/FeeCalculator/model/rentable-item.ts +12 -1
  17. package/src/WebComponent/icons/CalculatorOutlineIcon.ts +76 -18
  18. package/src/WebComponent/launcher/Launcher.ts +1 -1
  19. package/src/services/fees/fetchBuildingFeesV2.ts +4 -1
@@ -6,11 +6,12 @@ export default [
6
6
  css`
7
7
  .quantity-controls-container {
8
8
  display: flex;
9
+ flex-direction: column;
9
10
  gap: 12px;
10
11
  }
11
12
 
12
13
  .quantity-control {
13
- flex: 1;
14
+ width: 100%;
14
15
  display: flex;
15
16
  align-items: center;
16
17
  border: 1px solid #dee2e6;
@@ -30,6 +31,9 @@ export default [
30
31
  text-align: center;
31
32
  font-size: 0.875rem;
32
33
  color: #374151;
34
+ white-space: nowrap;
35
+ overflow: hidden;
36
+ text-overflow: ellipsis;
33
37
  }
34
38
  `,
35
39
  ];
@@ -3,6 +3,7 @@ import { css } from "lit";
3
3
  export default css`
4
4
  :host {
5
5
  display: block;
6
+ height: 100%;
6
7
  }
7
8
 
8
9
  p {
@@ -13,6 +14,8 @@ export default css`
13
14
  border: 1px solid #e5e7eb;
14
15
  border-radius: 0.375rem;
15
16
  align-items: center;
17
+ height: 100%;
18
+ display: flex;
16
19
  }
17
20
 
18
21
  .addon-inner-container {
@@ -20,6 +23,7 @@ export default css`
20
23
  flex-direction: column;
21
24
  gap: 8px;
22
25
  margin: 12px;
26
+ width: 100%;
23
27
  }
24
28
 
25
29
  .addon-header {
@@ -48,6 +52,12 @@ export default css`
48
52
  border-radius: 0.2;
49
53
  }
50
54
 
55
+ .quantity-control.unavailable {
56
+ background-color: #f9f9f9;
57
+ border-color: #e0e0e0;
58
+ cursor: not-allowed;
59
+ }
60
+
51
61
  .operator-sign {
52
62
  display: inline-block;
53
63
  line-height: 1;
@@ -79,4 +89,10 @@ export default css`
79
89
  padding: 0.25rem;
80
90
  font-size: 0.875rem;
81
91
  }
92
+
93
+ .unavailable-text {
94
+ color: #9ca3af;
95
+ font-style: italic;
96
+ cursor: not-allowed;
97
+ }
82
98
  `;
@@ -4,6 +4,8 @@ import { DesiredRentableItem, RentableItemSummary } from "../../../model";
4
4
 
5
5
  import commonAddonStyles from "../common-addon-styles";
6
6
 
7
+ const DEFAULT_MAX_QUANTITY = 10;
8
+
7
9
  @customElement("rentable-item-qty-selector")
8
10
  export class RentableItemQtySelector extends LitElement {
9
11
  static styles = commonAddonStyles;
@@ -27,7 +29,10 @@ export class RentableItemQtySelector extends LitElement {
27
29
  }
28
30
 
29
31
  get quantityLeft(): number {
30
- return this.totalAvailableItems - this.quantity;
32
+ return Math.min(
33
+ this.totalAvailableItems - this.quantity,
34
+ DEFAULT_MAX_QUANTITY
35
+ );
31
36
  }
32
37
 
33
38
  get atMaxUnits(): boolean {
@@ -53,7 +58,6 @@ export class RentableItemQtySelector extends LitElement {
53
58
  private emitChange(): void {
54
59
  if (!this.rentableItem) return;
55
60
 
56
- // Find first item that is available
57
61
  const firstAvailableItem = this.rentableItem.allItems.find(
58
62
  (item) => item.available && !this.selectedItemIds.has(item.id)
59
63
  );
@@ -63,7 +67,7 @@ export class RentableItemQtySelector extends LitElement {
63
67
  this.selectedItemIds.add(firstAvailableItem.id);
64
68
 
65
69
  this.onSelect?.({
66
- id: parseInt(firstAvailableItem.id),
70
+ id: firstAvailableItem.id,
67
71
  type: this.rentableItem.type,
68
72
  });
69
73
  }
@@ -78,7 +82,7 @@ export class RentableItemQtySelector extends LitElement {
78
82
  <div class="addon-inner-container">
79
83
  <div class="addon-header">
80
84
  <div class="addon-header-left">
81
- <p class="addon-title">${this.rentableItem.type}</p>
85
+ <p class="addon-title">${this.rentableItem.displayName}</p>
82
86
  </div>
83
87
 
84
88
  ${this.quantityLeft > 0
@@ -91,7 +95,11 @@ export class RentableItemQtySelector extends LitElement {
91
95
  </div>
92
96
 
93
97
  <div class="addon-body">
94
- <div class="quantity-control">
98
+ <div
99
+ class="quantity-control ${!hasAvailableItems
100
+ ? "unavailable"
101
+ : ""}"
102
+ >
95
103
  <button
96
104
  class="quantity-button"
97
105
  @click=${this.handleDecrement}
@@ -100,7 +108,11 @@ export class RentableItemQtySelector extends LitElement {
100
108
  >
101
109
  <span class="operator-sign">&minus;</span>
102
110
  </button>
103
- <span class="quantity-value">${this.quantity}</span>
111
+ ${hasAvailableItems
112
+ ? html`<span class="quantity-value">${this.quantity}</span>`
113
+ : html`<span class="quantity-value unavailable-text"
114
+ >Not available</span
115
+ >`}
104
116
  <button
105
117
  class="quantity-button"
106
118
  @click=${this.handleIncrement}
@@ -9,17 +9,18 @@ export default css`
9
9
  display: flex;
10
10
  margin-top: 20px;
11
11
  gap: 20px;
12
+ max-height: 95%;
12
13
  transition: margin-top var(--transition-timing),
13
14
  padding var(--transition-timing), gap var(--transition-timing),
14
15
  width var(--transition-timing), height var(--transition-timing);
15
16
  }
16
17
 
17
18
  .sidepanel {
18
- flex: 0 0 300px;
19
19
  display: flex;
20
- margin-left: 20px;
21
20
  flex-direction: column;
22
- max-width: 50%;
21
+ margin-left: 20px;
22
+ max-width: 60%;
23
+ width: 500px;
23
24
  gap: 20px;
24
25
  transition: width var(--transition-timing),
25
26
  max-width var(--transition-timing), margin var(--transition-timing);
@@ -43,9 +44,11 @@ export default css`
43
44
  }
44
45
 
45
46
  .sidepanel-addons-container {
46
- display: flex;
47
- flex-direction: column;
47
+ display: grid;
48
+ grid-template-columns: repeat(2, 1fr);
48
49
  gap: 12px;
50
+ max-height: 22rem;
51
+ overflow-y: auto;
49
52
  }
50
53
 
51
54
  .fees-container {
@@ -100,9 +103,9 @@ export default css`
100
103
 
101
104
  .sidepanel {
102
105
  max-width: 100%;
106
+ width: 100%;
103
107
  order: 1;
104
108
  flex: none;
105
- width: 100%;
106
109
  margin: 0;
107
110
  box-sizing: border-box;
108
111
  }
@@ -123,6 +126,12 @@ export default css`
123
126
  box-sizing: border-box;
124
127
  }
125
128
 
129
+ .sidepanel-addons-container {
130
+ display: flex;
131
+ flex-direction: column;
132
+ grid-template-columns: 1fr;
133
+ }
134
+
126
135
  .loading-container {
127
136
  height: auto;
128
137
  min-height: 100px;
@@ -94,7 +94,25 @@ export class FeeCalculatorLayout extends LitElement {
94
94
  .flat()
95
95
  .filter((fee) => fee.isOptional);
96
96
 
97
- return [...addons, ...this.rentableItems];
97
+ // Sort to prioritize available rentable items and move unavailable ones to the end
98
+ return [...addons, ...this.rentableItems].sort((a, b) => {
99
+ const aIsRentable = a instanceof RentableItemSummary;
100
+ const bIsRentable = b instanceof RentableItemSummary;
101
+
102
+ if (!aIsRentable && !bIsRentable) return 0;
103
+
104
+ const aAvailable = aIsRentable
105
+ ? (a as RentableItemSummary).allItems?.some((item) => item.available) ??
106
+ false
107
+ : true;
108
+ const bAvailable = bIsRentable
109
+ ? (b as RentableItemSummary).allItems?.some((item) => item.available) ??
110
+ false
111
+ : true;
112
+
113
+ // Sort unavailable rentable items to the end
114
+ return aAvailable === bAvailable ? 0 : aAvailable ? -1 : 1;
115
+ });
98
116
  }
99
117
 
100
118
  renderRecurrenceFeeSection(
@@ -3,7 +3,6 @@ import { css } from "lit";
3
3
  const floorPlanSelectorStyles = css`
4
4
  :host {
5
5
  display: block;
6
- margin-bottom: 16px;
7
6
  }
8
7
 
9
8
  .floor-plan-selector {
@@ -98,7 +97,6 @@ const floorPlanSelectorStyles = css`
98
97
  }
99
98
 
100
99
  .unit-selection {
101
- margin-top: 16px;
102
100
  max-height: 16rem;
103
101
  overflow-y: auto;
104
102
  }
@@ -158,7 +158,6 @@ export class FloorPlanSelector extends LitElement {
158
158
  if (this.isLoading) {
159
159
  return html`
160
160
  <div class="unit-selection">
161
- <div class="unit-label">Select Unit</div>
162
161
  <div class="loading-container">
163
162
  <mega-loader size="32"></mega-loader>
164
163
  </div>
@@ -168,7 +167,6 @@ export class FloorPlanSelector extends LitElement {
168
167
 
169
168
  return html`
170
169
  <div class="unit-selection">
171
- <div class="unit-label">Select Unit</div>
172
170
  <div class="image-carousel">
173
171
  ${this.units?.length === 0
174
172
  ? html`
@@ -234,6 +232,7 @@ export class FloorPlanSelector extends LitElement {
234
232
  </div>
235
233
  </div>
236
234
 
235
+ <div class="unit-label">Select Unit</div>
237
236
  ${this.renderUnitSelection()}
238
237
  </div>
239
238
  </div>
@@ -1,4 +1,4 @@
1
1
  export type DesiredRentableItem = {
2
- id: number;
2
+ id: string;
3
3
  type: string;
4
4
  };
@@ -1,10 +1,34 @@
1
1
  import { RentableItem } from "./rentable-item";
2
2
 
3
- export interface RentableItemSummary {
3
+ export class RentableItemSummary {
4
4
  description: string;
5
5
  type: string;
6
6
  minAvailableItem?: RentableItem;
7
7
  maxAvailableItem?: RentableItem;
8
8
  allItems: RentableItem[];
9
- rent?: number;
9
+ rent: number;
10
+ priceDescription: string;
11
+
12
+ constructor(data: Partial<RentableItemSummary> = {}) {
13
+ this.description = data.description ?? "";
14
+ this.type = data.type ?? "";
15
+ this.minAvailableItem = data.minAvailableItem
16
+ ? new RentableItem(data.minAvailableItem)
17
+ : undefined;
18
+ this.maxAvailableItem = data.maxAvailableItem
19
+ ? new RentableItem(data.maxAvailableItem)
20
+ : undefined;
21
+ this.allItems = (data.allItems ?? []).map((item) => new RentableItem(item));
22
+ this.rent = data.rent ?? 0;
23
+ this.priceDescription = data.priceDescription ?? "";
24
+ }
25
+
26
+ get displayName(): string {
27
+ return this.description;
28
+ }
29
+
30
+ get itemDescription(): string {
31
+ if (this.allItems.length === 0) return "";
32
+ return this.allItems[0].description;
33
+ }
10
34
  }
@@ -1,10 +1,21 @@
1
1
  import { RentFrequency } from "./rent-frequency";
2
2
 
3
- export interface RentableItem {
3
+ export class RentableItem {
4
4
  id: string;
5
5
  description: string;
6
6
  rent: number;
7
7
  rentFrequency: RentFrequency;
8
8
  available: boolean;
9
9
  reservedUntil?: Date;
10
+
11
+ constructor(data: Partial<RentableItem> = {}) {
12
+ this.id = data.id ?? "";
13
+ this.description = data.description ?? "";
14
+ this.rent = data.rent ?? 0;
15
+ this.rentFrequency = data.rentFrequency ?? "monthly";
16
+ this.available = data.available ?? false;
17
+ this.reservedUntil = data.reservedUntil
18
+ ? new Date(data.reservedUntil)
19
+ : undefined;
20
+ }
10
21
  }
@@ -1,22 +1,80 @@
1
1
  import { svg, SVGTemplateResult } from "lit";
2
2
 
3
3
  export const CalculatorOutlineIcon = (
4
- color = "white"
5
- ): SVGTemplateResult => svg`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
6
- <g id="Frame" clip-path="url(#clip0_14068_170001)">
7
- <path id="Vector" d="M3.33301 4.16667C3.33301 3.72464 3.5086 3.30072 3.82116 2.98816C4.13372 2.67559 4.55765 2.5 4.99967 2.5H14.9997C15.4417 2.5 15.8656 2.67559 16.1782 2.98816C16.4907 3.30072 16.6663 3.72464 16.6663 4.16667V15.8333C16.6663 16.2754 16.4907 16.6993 16.1782 17.0118C15.8656 17.3244 15.4417 17.5 14.9997 17.5H4.99967C4.55765 17.5 4.13372 17.3244 3.82116 17.0118C3.5086 16.6993 3.33301 16.2754 3.33301 15.8333V4.16667Z" stroke=${color} stroke-linecap="round" stroke-linejoin="round"/>
8
- <path id="Vector_2" d="M6.66699 6.66634C6.66699 6.44533 6.75479 6.23337 6.91107 6.07709C7.06735 5.92081 7.27931 5.83301 7.50033 5.83301H12.5003C12.7213 5.83301 12.9333 5.92081 13.0896 6.07709C13.2459 6.23337 13.3337 6.44533 13.3337 6.66634V7.49967C13.3337 7.72069 13.2459 7.93265 13.0896 8.08893C12.9333 8.24521 12.7213 8.33301 12.5003 8.33301H7.50033C7.27931 8.33301 7.06735 8.24521 6.91107 8.08893C6.75479 7.93265 6.66699 7.72069 6.66699 7.49967V6.66634Z" stroke=${color} stroke-linecap="round" stroke-linejoin="round"/>
9
- <path id="Vector_3" d="M6.66699 11.667V11.6753" stroke=${color} stroke-linecap="round" stroke-linejoin="round"/>
10
- <path id="Vector_4" d="M10 11.667V11.6753" stroke=${color} stroke-linecap="round" stroke-linejoin="round"/>
11
- <path id="Vector_5" d="M13.333 11.667V11.6753" stroke=${color} stroke-linecap="round" stroke-linejoin="round"/>
12
- <path id="Vector_6" d="M6.66699 14.167V14.1753" stroke=${color} stroke-linecap="round" stroke-linejoin="round"/>
13
- <path id="Vector_7" d="M10 14.167V14.1753" stroke=${color} stroke-linecap="round" stroke-linejoin="round"/>
14
- <path id="Vector_8" d="M13.333 14.167V14.1753" stroke=${color} stroke-linecap="round" stroke-linejoin="round"/>
15
- </g>
16
- <defs>
17
- <clipPath id="clip0_14068_170001">
18
- <rect width="20" height="20" fill="white"/>
19
- </clipPath>
20
- </defs>
21
- </svg>
4
+ color = "white",
5
+ size = 20,
6
+ shiftX = -2
7
+ ): SVGTemplateResult => svg`
8
+ <svg
9
+ width="${size}"
10
+ height="${size}"
11
+ viewBox="0 0 20 20"
12
+ fill="none"
13
+ xmlns="http://www.w3.org/2000/svg"
14
+ transform="translate(${shiftX}, 0)"
15
+ >
16
+ <g id="Frame" clip-path="url(#clip0_14068_170001)">
17
+ <path
18
+ id="Vector"
19
+ d="M3.33301 4.16667C3.33301 3.72464 3.5086 3.30072 3.82116 2.98816C4.13372 2.67559 4.55765 2.5 4.99967 2.5H14.9997C15.4417 2.5 15.8656 2.67559 16.1782 2.98816C16.4907 3.30072 16.6663 3.72464 16.6663 4.16667V15.8333C16.6663 16.2754 16.4907 16.6993 16.1782 17.0118C15.8656 17.3244 15.4417 17.5 14.9997 17.5H4.99967C4.55765 17.5 4.13372 17.3244 3.82116 17.0118C3.5086 16.6993 3.33301 16.2754 3.33301 15.8333V4.16667Z"
20
+ stroke=${color}
21
+ stroke-linecap="round"
22
+ stroke-linejoin="round"
23
+ />
24
+ <path
25
+ id="Vector_2"
26
+ d="M6.66699 6.66634C6.66699 6.44533 6.75479 6.23337 6.91107 6.07709C7.06735 5.92081 7.27931 5.83301 7.50033 5.83301H12.5003C12.7213 5.83301 12.9333 5.92081 13.0896 6.07709C13.2459 6.23337 13.3337 6.44533 13.3337 6.66634V7.49967C13.3337 7.72069 13.2459 7.93265 13.0896 8.08893C12.9333 8.24521 12.7213 8.33301 12.5003 8.33301H7.50033C7.27931 8.33301 7.06735 8.24521 6.91107 8.08893C6.75479 7.93265 6.66699 7.72069 6.66699 7.49967V6.66634Z"
27
+ stroke=${color}
28
+ stroke-linecap="round"
29
+ stroke-linejoin="round"
30
+ />
31
+ <path
32
+ id="Vector_3"
33
+ d="M6.66699 11.667V11.6753"
34
+ stroke=${color}
35
+ stroke-linecap="round"
36
+ stroke-linejoin="round"
37
+ />
38
+ <path
39
+ id="Vector_4"
40
+ d="M10 11.667V11.6753"
41
+ stroke=${color}
42
+ stroke-linecap="round"
43
+ stroke-linejoin="round"
44
+ />
45
+ <path
46
+ id="Vector_5"
47
+ d="M13.333 11.667V11.6753"
48
+ stroke=${color}
49
+ stroke-linecap="round"
50
+ stroke-linejoin="round"
51
+ />
52
+ <path
53
+ id="Vector_6"
54
+ d="M6.66699 14.167V14.1753"
55
+ stroke=${color}
56
+ stroke-linecap="round"
57
+ stroke-linejoin="round"
58
+ />
59
+ <path
60
+ id="Vector_7"
61
+ d="M10 14.167V14.1753"
62
+ stroke=${color}
63
+ stroke-linecap="round"
64
+ stroke-linejoin="round"
65
+ />
66
+ <path
67
+ id="Vector_8"
68
+ d="M13.333 14.167V14.1753"
69
+ stroke=${color}
70
+ stroke-linecap="round"
71
+ stroke-linejoin="round"
72
+ />
73
+ </g>
74
+ <defs>
75
+ <clipPath id="clip0_14068_170001">
76
+ <rect width="20" height="20" fill="white"/>
77
+ </clipPath>
78
+ </defs>
79
+ </svg>
22
80
  `;
@@ -782,7 +782,7 @@ export class Launcher extends LitElement {
782
782
  this.foregroundColorOnSecondaryBackgroundColor
783
783
  )}
784
784
  </div>
785
- <div class="vertical-pill-title">
785
+ <div class="vertical-pill-title" style="margin-left: -2px;">
786
786
  <span class="vertical-pill-bold">Calculate</span> Cost
787
787
  </div>
788
788
  </div>
@@ -31,7 +31,7 @@ const fetchBuildingFeesV2 = async (
31
31
  const data = camelize<BuildingFeeResponse>(feesResponse.data);
32
32
  return {
33
33
  fees: data.fees.map(toBuildingFeeClass),
34
- rentableItems: data.rentableItems,
34
+ rentableItems: data.rentableItems.map(toRentableItemSummary),
35
35
  buildingIncentives: data.buildingIncentives,
36
36
  };
37
37
  }
@@ -53,4 +53,7 @@ const fetchBuildingFeesV2 = async (
53
53
 
54
54
  const toBuildingFeeClass = (fee: BuildingFeeView) => new BuildingFeeView(fee);
55
55
 
56
+ const toRentableItemSummary = (item: RentableItemSummary) =>
57
+ new RentableItemSummary(item);
58
+
56
59
  export default fetchBuildingFeesV2;