@meetelise/chat 1.20.6 → 1.20.8

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.
package/src/MEChat.ts CHANGED
@@ -84,7 +84,7 @@ const installTalkjsMobileStyleFix = () => {
84
84
  metaTag.setAttribute("name", "viewport");
85
85
  metaTag.setAttribute(
86
86
  "content",
87
- "width=device-width, initial-scale=1, maximum-scale=1"
87
+ "width=device-width, initial-scale=1, maximum-scale=2"
88
88
  );
89
89
  document.head.appendChild(metaTag);
90
90
  };
@@ -22,7 +22,7 @@ import { TimePicker } from "./time-picker";
22
22
  import { LabeledOption, UnitV2 } from "../../fetchBuildingInfo";
23
23
  import { isMobile } from "../../utils";
24
24
  import axios from "axios";
25
- import { mapValues } from "lodash";
25
+ import { isNumber, isString, mapValues } from "lodash";
26
26
  import classnames from "classnames";
27
27
  import parseISO from "date-fns/parseISO";
28
28
  import compareAsc from "date-fns/compareAsc";
@@ -1043,13 +1043,13 @@ export class TourScheduler extends LitElement {
1043
1043
  <me-select
1044
1044
  id="layoutType"
1045
1045
  placeholder="Select layout"
1046
- .options="${this.layoutOptions.map((i) => ({
1046
+ .options="${sortedLayouts(this.layoutOptions).map((i) => ({
1047
1047
  label: getHumanReadableLayout(i),
1048
1048
  value: i,
1049
1049
  }))}"
1050
1050
  defaultOption="Studio"
1051
1051
  @change=${() => {
1052
- // to revalidate the form
1052
+ // to revalidate the form.
1053
1053
  this.requestUpdate();
1054
1054
  }}
1055
1055
  >Studio
@@ -1239,3 +1239,43 @@ const tourTypeForSubmission = {
1239
1239
  [TourType.Self]: "self-guided-tour",
1240
1240
  [TourType.Virtual]: "live-virtual-tour",
1241
1241
  };
1242
+
1243
+ const getLayoutOrder = (layout: string) => {
1244
+ return {
1245
+ studio: 0,
1246
+ "1br": 1,
1247
+ "2br": 2,
1248
+ "3br": 3,
1249
+ "4br": 4,
1250
+ "5br": 5,
1251
+ "6br": 6,
1252
+ "7br": 7,
1253
+ "8br": 8,
1254
+ "9br": 9,
1255
+ "10br": 10,
1256
+ }[layout];
1257
+ };
1258
+
1259
+ const getLayoutFromOrder = (order: number) => {
1260
+ return {
1261
+ 0: "studio",
1262
+ 1: "1br",
1263
+ 2: "2br",
1264
+ 3: "3br",
1265
+ 4: "4br",
1266
+ 5: "5br",
1267
+ 6: "6br",
1268
+ 7: "7br",
1269
+ 8: "8br",
1270
+ 9: "9br",
1271
+ 10: "10br",
1272
+ }[order];
1273
+ };
1274
+
1275
+ const sortedLayouts = (layouts: string[]) => {
1276
+ const layoutOrder = layouts
1277
+ .map((layout) => getLayoutOrder(layout))
1278
+ .filter(isNumber)
1279
+ .sort();
1280
+ return layoutOrder.map((order) => getLayoutFromOrder(order)).filter(isString);
1281
+ };