@meetelise/chat 1.74.0 → 1.76.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.
- package/dist/src/WebComponent/Scheduler/time-picker.d.ts +6 -0
- package/dist/src/WebComponent/Scheduler/tour-type-option.d.ts +1 -1
- package/dist/src/WebComponent/SchedulerV2/booking-confirmation.d.ts +2 -0
- package/dist/src/WebComponent/SchedulerV2/contact-form.d.ts +9 -3
- package/dist/src/WebComponent/SchedulerV2/itinerary-editor.d.ts +18 -1
- package/dist/src/WebComponent/SchedulerV2/itineraryStopStyles.d.ts +1 -2
- package/dist/src/WebComponent/SchedulerV2/schedulerIcons.d.ts +18 -0
- package/dist/src/WebComponent/SchedulerV2/schedulerRequests.d.ts +2 -0
- package/dist/src/WebComponent/SchedulerV2/schedulerV2Styles.d.ts +9 -0
- package/dist/src/WebComponent/SchedulerV2/tour-scheduler-v2.d.ts +17 -1
- package/dist/src/WebComponent/SchedulerV2/tourItineraryApi.d.ts +12 -0
- package/dist/src/WebComponent/SchedulerV2/tourTimes.d.ts +3 -1
- package/dist/src/WebComponent/actions/international-phone-input.d.ts +7 -0
- package/dist/src/WebComponent/me-select.d.ts +2 -0
- package/package.json +1 -1
- package/public/dist/index.js +2411 -1446
- package/src/WebComponent/Scheduler/date-picker.ts +130 -51
- package/src/WebComponent/Scheduler/time-picker.ts +62 -0
- package/src/WebComponent/Scheduler/tour-type-option.ts +31 -10
- package/src/WebComponent/SchedulerV2/booking-confirmation.ts +54 -45
- package/src/WebComponent/SchedulerV2/community-picker.ts +222 -160
- package/src/WebComponent/SchedulerV2/contact-form.ts +100 -70
- package/src/WebComponent/SchedulerV2/itinerary-editor.ts +316 -151
- package/src/WebComponent/SchedulerV2/itineraryStopStyles.ts +44 -21
- package/src/WebComponent/SchedulerV2/scheduler-popover.ts +6 -6
- package/src/WebComponent/SchedulerV2/schedulerIcons.ts +143 -0
- package/src/WebComponent/SchedulerV2/schedulerRequests.ts +10 -0
- package/src/WebComponent/SchedulerV2/schedulerV2Styles.ts +347 -0
- package/src/WebComponent/SchedulerV2/tour-scheduler-v2.ts +493 -172
- package/src/WebComponent/SchedulerV2/tourItineraryApi.ts +12 -0
- package/src/WebComponent/SchedulerV2/tourTimes.ts +16 -3
- package/src/WebComponent/actions/action-confirm-button.ts +4 -3
- package/src/WebComponent/actions/international-phone-input.ts +84 -1
- package/src/WebComponent/me-select.ts +74 -0
- package/src/tourSchedulerV2Booking.test.ts +129 -7
|
@@ -12,18 +12,26 @@ import "../Scheduler/date-picker";
|
|
|
12
12
|
import "../Scheduler/time-picker";
|
|
13
13
|
import "../Scheduler/tour-type-option";
|
|
14
14
|
import "../mini-loader";
|
|
15
|
+
import "./scheduler-popover";
|
|
15
16
|
import type { DatePicker } from "../Scheduler/date-picker";
|
|
16
17
|
import type { TimePicker, TimePickerOption } from "../Scheduler/time-picker";
|
|
17
|
-
import { unselectedTourTypeForegroundColor } from "../Scheduler/tour-type-option";
|
|
18
|
-
import { tourSchedulerStyles } from "../Scheduler/tourSchedulerStyles";
|
|
19
|
-
import { InputStyles } from "../actions/InputStyles";
|
|
20
|
-
import { itineraryStopStyles } from "./itineraryStopStyles";
|
|
21
|
-
import floorplanImageCardStyles from "../FeeCalculator/components/floorplan-image-card/floorplan-image-card-styles";
|
|
22
|
-
import floorPlanSelectorStyles from "../FeeCalculator/components/floor-plan-selector/floor-plan-selector-styles";
|
|
23
|
-
import { GripIcon } from "../icons/GripIcon";
|
|
24
|
-
import { PencilIcon } from "../icons/PencilIcon";
|
|
25
|
-
import { TrashIcon } from "../icons/TrashIcon";
|
|
26
18
|
import { defaultPrimaryColor } from "../../themes";
|
|
19
|
+
import { getTimezoneAbbreviation } from "../../getTimezoneString";
|
|
20
|
+
import { isMobile, onMobileChange } from "../../utils";
|
|
21
|
+
import { schedulerV2Styles } from "./schedulerV2Styles";
|
|
22
|
+
import { itineraryStopStyles } from "./itineraryStopStyles";
|
|
23
|
+
import {
|
|
24
|
+
BuildingLineIcon,
|
|
25
|
+
CalendarLineIcon,
|
|
26
|
+
CheckCircleLineIcon,
|
|
27
|
+
GripLineIcon,
|
|
28
|
+
MapPinLineIcon,
|
|
29
|
+
PencilLineIcon,
|
|
30
|
+
PersonPlusLineIcon,
|
|
31
|
+
PlusLineIcon,
|
|
32
|
+
TrashLineIcon,
|
|
33
|
+
VideoLineIcon,
|
|
34
|
+
} from "./schedulerIcons";
|
|
27
35
|
import {
|
|
28
36
|
CommunitySummary,
|
|
29
37
|
formatAddress,
|
|
@@ -32,6 +40,8 @@ import {
|
|
|
32
40
|
} from "./tourItineraryApi";
|
|
33
41
|
import {
|
|
34
42
|
dateFromIsoDate,
|
|
43
|
+
formatLeg,
|
|
44
|
+
formatLongDate,
|
|
35
45
|
formatMonthDay,
|
|
36
46
|
formatTime,
|
|
37
47
|
formatTimeRange,
|
|
@@ -52,6 +62,13 @@ export interface StopProblem {
|
|
|
52
62
|
text: string;
|
|
53
63
|
}
|
|
54
64
|
|
|
65
|
+
/** The design's line icon for each tour type. */
|
|
66
|
+
const TOUR_TYPE_ICONS: Record<TourTypeId, typeof PersonPlusLineIcon> = {
|
|
67
|
+
"escorted-tour": PersonPlusLineIcon,
|
|
68
|
+
"live-virtual-tour": VideoLineIcon,
|
|
69
|
+
"self-guided-tour": MapPinLineIcon,
|
|
70
|
+
};
|
|
71
|
+
|
|
55
72
|
/** An API start time as today's time picker shows it. */
|
|
56
73
|
const timeOption = (iso: string): TimePickerOption => ({
|
|
57
74
|
displayTime: formatTime(iso),
|
|
@@ -134,6 +151,20 @@ export class ItineraryEditor extends LitElement {
|
|
|
134
151
|
}
|
|
135
152
|
|
|
136
153
|
@state() private editingTimeFor: number | null = null;
|
|
154
|
+
/** The date field's calendar is open. */
|
|
155
|
+
@state() private dateOpen = false;
|
|
156
|
+
@state() private mobile = isMobile();
|
|
157
|
+
private cleanupMobileListener?: () => void;
|
|
158
|
+
|
|
159
|
+
connectedCallback(): void {
|
|
160
|
+
super.connectedCallback();
|
|
161
|
+
this.cleanupMobileListener = onMobileChange((m) => (this.mobile = m));
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
disconnectedCallback(): void {
|
|
165
|
+
this.cleanupMobileListener?.();
|
|
166
|
+
super.disconnectedCallback();
|
|
167
|
+
}
|
|
137
168
|
@state() private dragIndex: number | null = null;
|
|
138
169
|
@state() private dropIndex: number | null = null;
|
|
139
170
|
|
|
@@ -196,13 +227,12 @@ export class ItineraryEditor extends LitElement {
|
|
|
196
227
|
if (!this.single) return "";
|
|
197
228
|
const id = this.stops.find((s) => !s.fixed)?.building_id;
|
|
198
229
|
const community = id === undefined ? undefined : this.communities.get(id);
|
|
199
|
-
return html`<h2 class="
|
|
200
|
-
<div class="
|
|
201
|
-
<
|
|
202
|
-
|
|
203
|
-
<p class="
|
|
204
|
-
|
|
205
|
-
</p>
|
|
230
|
+
return html`<h2 class="section-heading">Community</h2>
|
|
231
|
+
<div class="card community">
|
|
232
|
+
<span class="icon-tile">${BuildingLineIcon(20)}</span>
|
|
233
|
+
<div class="card-text">
|
|
234
|
+
<p class="title">${community?.name ?? ""}</p>
|
|
235
|
+
<p class="subtitle">${formatAddress(community?.address ?? null)}</p>
|
|
206
236
|
</div>
|
|
207
237
|
${this.canEditCommunities
|
|
208
238
|
? html`<button
|
|
@@ -210,14 +240,16 @@ export class ItineraryEditor extends LitElement {
|
|
|
210
240
|
aria-label="Change community"
|
|
211
241
|
@click=${() => emit(this, "edit-communities", {})}
|
|
212
242
|
>
|
|
213
|
-
${
|
|
243
|
+
${PencilLineIcon(14)}
|
|
214
244
|
</button>`
|
|
215
245
|
: ""}
|
|
216
|
-
</div
|
|
246
|
+
</div>`;
|
|
217
247
|
}
|
|
218
248
|
|
|
219
249
|
private renderTourTypes(): TemplateResult {
|
|
220
|
-
return html`<h2 id="tour-type-heading" class="
|
|
250
|
+
return html`<h2 id="tour-type-heading" class="section-heading">
|
|
251
|
+
Tour Type
|
|
252
|
+
</h2>
|
|
221
253
|
<div
|
|
222
254
|
id="tour-type-menu"
|
|
223
255
|
role="radiogroup"
|
|
@@ -242,9 +274,9 @@ export class ItineraryEditor extends LitElement {
|
|
|
242
274
|
}
|
|
243
275
|
}}
|
|
244
276
|
>
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
277
|
+
<span slot="icon" class="tour-type-icon"
|
|
278
|
+
>${TOUR_TYPE_ICONS[id](20)}</span
|
|
279
|
+
>
|
|
248
280
|
</tour-type-option>`;
|
|
249
281
|
})}
|
|
250
282
|
</div>
|
|
@@ -255,28 +287,42 @@ export class ItineraryEditor extends LitElement {
|
|
|
255
287
|
: ""}`;
|
|
256
288
|
}
|
|
257
289
|
|
|
258
|
-
|
|
290
|
+
/** Today's date picker over `dates`, reporting a picked day other than `date`. */
|
|
291
|
+
private renderDatePicker(
|
|
292
|
+
dates: string[] = this.bookableDates,
|
|
293
|
+
date: string | null = this.date,
|
|
294
|
+
pick: (picked: string) => void = (picked) =>
|
|
295
|
+
emit(this, "date-change", { date: picked })
|
|
296
|
+
): TemplateResult {
|
|
259
297
|
// The month of the chosen or first bookable date, which may not be this month.
|
|
260
|
-
const shown =
|
|
298
|
+
const shown = date ?? dates[0];
|
|
261
299
|
return html`<date-picker
|
|
262
300
|
outlined
|
|
263
301
|
.shownMonth=${shown?.slice(0, 7)}
|
|
264
302
|
.availabilities=${Object.fromEntries(
|
|
265
|
-
|
|
303
|
+
dates.map((d) => [d, [dateFromIsoDate(d)]])
|
|
266
304
|
)}
|
|
267
|
-
.defaultDate=${
|
|
305
|
+
.defaultDate=${date ? dateFromIsoDate(date) : undefined}
|
|
268
306
|
@change=${(e: Event) => {
|
|
269
307
|
const picked = (e.target as DatePicker).selectedDate;
|
|
270
|
-
if (picked && toIsoDate(picked) !==
|
|
271
|
-
emit(this, "date-change", { date: toIsoDate(picked) });
|
|
272
|
-
}
|
|
308
|
+
if (picked && toIsoDate(picked) !== date) pick(toIsoDate(picked));
|
|
273
309
|
}}
|
|
274
310
|
></date-picker>`;
|
|
275
311
|
}
|
|
276
312
|
|
|
313
|
+
/** One stop's own day: moving it there makes it a separate tour. */
|
|
314
|
+
private renderStopDatePicker(stop: PlanStop): TemplateResult {
|
|
315
|
+
return html`<div class="calendar-frame">
|
|
316
|
+
${this.renderDatePicker(stop.dates, isoDate(stop.start), (date) =>
|
|
317
|
+
emit(this, "stop-date-change", { buildingId: stop.building_id, date })
|
|
318
|
+
)}
|
|
319
|
+
</div>`;
|
|
320
|
+
}
|
|
321
|
+
|
|
277
322
|
private renderTimePicker(stop: PlanStop): TemplateResult {
|
|
278
323
|
const times = [...new Set([stop.start, ...stop.alternatives])].sort();
|
|
279
324
|
return html`<time-picker
|
|
325
|
+
outlined
|
|
280
326
|
selecteddateexists
|
|
281
327
|
.timezone=${stop.timezone}
|
|
282
328
|
.options=${times.map(timeOption)}
|
|
@@ -302,34 +348,75 @@ export class ItineraryEditor extends LitElement {
|
|
|
302
348
|
}
|
|
303
349
|
|
|
304
350
|
private renderLinkPrompt(): TemplateResult {
|
|
305
|
-
return html`<h2 class="
|
|
306
|
-
<
|
|
351
|
+
return html`<h2 class="section-heading">Date and Time</h2>
|
|
352
|
+
<button
|
|
353
|
+
id="self-guided-redirect-bttn"
|
|
354
|
+
class="primary-button"
|
|
355
|
+
@click=${() => emit(this, "open-tour-link", {})}
|
|
356
|
+
>
|
|
357
|
+
View Tour Times
|
|
358
|
+
</button>`;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* The design's date field: the chosen day, which opens the calendar under
|
|
363
|
+
* it (in place on phones). Picking a day closes it, the day already chosen
|
|
364
|
+
* included, which the calendar reports without a date change.
|
|
365
|
+
*/
|
|
366
|
+
private renderDateField(): TemplateResult {
|
|
367
|
+
const label = this.date ? formatLongDate(this.date) : "Select a date";
|
|
368
|
+
// The calendar handles the click first, inside its own shadow root.
|
|
369
|
+
const closeOnDay = (e: MouseEvent) => {
|
|
370
|
+
const day = e
|
|
371
|
+
.composedPath()
|
|
372
|
+
.find(
|
|
373
|
+
(n) =>
|
|
374
|
+
n instanceof HTMLButtonElement &&
|
|
375
|
+
n.matches("button.dayNumber:not(:disabled)")
|
|
376
|
+
);
|
|
377
|
+
if (!day) return;
|
|
378
|
+
this.dateOpen = false;
|
|
379
|
+
this.renderRoot.querySelector<HTMLElement>("#date-trigger")?.focus();
|
|
380
|
+
};
|
|
381
|
+
return html`<h2 id="date-heading" class="section-heading">Date</h2>
|
|
382
|
+
<scheduler-popover
|
|
383
|
+
class="date-popover"
|
|
384
|
+
?open=${this.dateOpen}
|
|
385
|
+
?inline=${this.mobile}
|
|
386
|
+
@popover-close=${() => (this.dateOpen = false)}
|
|
387
|
+
>
|
|
307
388
|
<button
|
|
308
|
-
id="
|
|
309
|
-
|
|
389
|
+
id="date-trigger"
|
|
390
|
+
slot="trigger"
|
|
391
|
+
class="input picker-field"
|
|
392
|
+
aria-expanded=${String(this.dateOpen)}
|
|
393
|
+
aria-controls="date-panel"
|
|
394
|
+
aria-label=${`Date, ${label}`}
|
|
395
|
+
@click=${() => (this.dateOpen = !this.dateOpen)}
|
|
310
396
|
>
|
|
311
|
-
|
|
397
|
+
<span class=${classMap({ value: true, placeholder: !this.date })}
|
|
398
|
+
>${label}</span
|
|
399
|
+
>
|
|
400
|
+
${CalendarLineIcon(14)}
|
|
312
401
|
</button>
|
|
313
|
-
|
|
402
|
+
<div id="date-panel" class="calendar-panel" @click=${closeOnDay}>
|
|
403
|
+
${this.renderDatePicker()}
|
|
404
|
+
</div>
|
|
405
|
+
</scheduler-popover>
|
|
406
|
+
${this.bookableDates.length === 0 && this.offersKnown
|
|
407
|
+
? html`<p class="explanation">No tour times in the next 30 days.</p>`
|
|
408
|
+
: ""}`;
|
|
314
409
|
}
|
|
315
410
|
|
|
316
|
-
|
|
411
|
+
/** "Time (CDT)": the one community's times, in its own time zone. */
|
|
412
|
+
private renderTimes(): TemplateResult {
|
|
317
413
|
const stop = this.stops.find((s) => !s.fixed);
|
|
318
|
-
|
|
319
|
-
|
|
414
|
+
const zone = stop ? getTimezoneAbbreviation(stop.timezone) : "";
|
|
415
|
+
return html`<h2 class="section-heading">
|
|
416
|
+
${zone ? `Time (${zone})` : "Time"}
|
|
417
|
+
${this.loading ? html`<mini-loader></mini-loader>` : ""}
|
|
320
418
|
</h2>
|
|
321
|
-
|
|
322
|
-
<div id="datePicker">
|
|
323
|
-
${this.renderDatePicker()}
|
|
324
|
-
${stop
|
|
325
|
-
? html`<div>${this.renderTimePicker(stop)}</div>`
|
|
326
|
-
: html`<p class="explanation">
|
|
327
|
-
${this.bookableDates.length === 0 && this.offersKnown
|
|
328
|
-
? "No tour times in the next 30 days."
|
|
329
|
-
: ""}
|
|
330
|
-
</p>`}
|
|
331
|
-
</div>
|
|
332
|
-
</div>`;
|
|
419
|
+
${stop ? this.renderTimePicker(stop) : ""}`;
|
|
333
420
|
}
|
|
334
421
|
|
|
335
422
|
private renderStop(stop: PlanStop, index: number): TemplateResult {
|
|
@@ -338,14 +425,20 @@ export class ItineraryEditor extends LitElement {
|
|
|
338
425
|
const newIndex = ids.indexOf(stop.building_id);
|
|
339
426
|
const editing = this.editingTimeFor === stop.building_id;
|
|
340
427
|
const canReorder = !stop.fixed && ids.length > 1;
|
|
341
|
-
// With no other time to pick,
|
|
428
|
+
// With no other day or time to pick, they're plain text rather than a picker.
|
|
342
429
|
const canChangeTime =
|
|
343
430
|
!stop.fixed && stop.alternatives.some((t) => t !== stop.start);
|
|
431
|
+
const canChangeDate =
|
|
432
|
+
!stop.fixed && (stop.dates ?? []).some((d) => d !== isoDate(stop.start));
|
|
344
433
|
const time = `${formatMonthDay(isoDate(stop.start))} · ${formatTimeRange(
|
|
345
434
|
stop.start,
|
|
346
435
|
stop.end
|
|
347
436
|
)}`;
|
|
348
437
|
const dragging = this.dragIndex !== null;
|
|
438
|
+
const leg = formatLeg(
|
|
439
|
+
stop.distance_from_prev_mi,
|
|
440
|
+
stop.travel_minutes_from_prev
|
|
441
|
+
);
|
|
349
442
|
return html`<li
|
|
350
443
|
class=${classMap({
|
|
351
444
|
"stop-item": true,
|
|
@@ -358,17 +451,13 @@ export class ItineraryEditor extends LitElement {
|
|
|
358
451
|
data-index=${stop.fixed ? nothing : newIndex}
|
|
359
452
|
>
|
|
360
453
|
${index > 0
|
|
361
|
-
? html`<p class="
|
|
362
|
-
${
|
|
363
|
-
? html`${
|
|
364
|
-
class="sr-only"
|
|
365
|
-
>
|
|
366
|
-
from the previous stop</span
|
|
367
|
-
>`
|
|
454
|
+
? html`<p class="leg">
|
|
455
|
+
${leg
|
|
456
|
+
? html`${leg}<span class="sr-only"> from the previous stop</span>`
|
|
368
457
|
: ""}
|
|
369
458
|
</p>`
|
|
370
459
|
: ""}
|
|
371
|
-
<div class="
|
|
460
|
+
<div class="card stop-card">
|
|
372
461
|
${canReorder
|
|
373
462
|
? html`<button
|
|
374
463
|
class="icon-button grip"
|
|
@@ -400,38 +489,49 @@ export class ItineraryEditor extends LitElement {
|
|
|
400
489
|
this.move(newIndex, to);
|
|
401
490
|
}}
|
|
402
491
|
>
|
|
403
|
-
${
|
|
492
|
+
${GripLineIcon(14)}
|
|
404
493
|
</button>`
|
|
405
494
|
: ""}
|
|
406
495
|
<span class="stop-number" aria-hidden="true">${index + 1}</span>
|
|
407
|
-
<div class="
|
|
408
|
-
<p class="
|
|
496
|
+
<div class="card-text">
|
|
497
|
+
<p class="stop-name">
|
|
409
498
|
<span class="sr-only">Stop ${index + 1}:</span>
|
|
410
499
|
${community?.name ?? ""}
|
|
411
500
|
</p>
|
|
412
|
-
<p class="
|
|
413
|
-
|
|
414
|
-
</p>
|
|
415
|
-
${!canChangeTime
|
|
501
|
+
<p class="subtitle">${formatAddress(community?.address ?? null)}</p>
|
|
502
|
+
${!canChangeTime && !canChangeDate
|
|
416
503
|
? html`<p class="stop-time">
|
|
417
504
|
${time}
|
|
418
|
-
${stop.fixed
|
|
419
|
-
? html`<span class="floor-plan-badge selected">Booked</span>`
|
|
420
|
-
: ""}
|
|
505
|
+
${stop.fixed ? html`<span class="sr-only">, booked</span>` : ""}
|
|
421
506
|
</p>`
|
|
422
507
|
: html`<button
|
|
423
508
|
class="stop-time edit-time"
|
|
424
509
|
aria-expanded=${String(editing)}
|
|
425
|
-
aria-label=${`Change the
|
|
510
|
+
aria-label=${`Change the ${
|
|
511
|
+
canChangeDate ? "date or time" : "time"
|
|
512
|
+
} at ${community?.name ?? ""}`}
|
|
426
513
|
@click=${() =>
|
|
427
514
|
(this.editingTimeFor = editing ? null : stop.building_id)}
|
|
428
515
|
>
|
|
429
|
-
${time} ${
|
|
516
|
+
${time} ${PencilLineIcon(12)}
|
|
430
517
|
</button>`}
|
|
431
|
-
${editing ? this.
|
|
518
|
+
${editing && canChangeDate ? this.renderStopDatePicker(stop) : ""}
|
|
519
|
+
${
|
|
520
|
+
// While /plan answers, these are the old plan's times, which may
|
|
521
|
+
// be on the stop's old day.
|
|
522
|
+
editing && canChangeTime && !this.loading
|
|
523
|
+
? html`<div class="stop-times">
|
|
524
|
+
${this.renderTimePicker(stop)}
|
|
525
|
+
<p class="subtitle">
|
|
526
|
+
Times in ${getTimezoneAbbreviation(stop.timezone)}
|
|
527
|
+
</p>
|
|
528
|
+
</div>`
|
|
529
|
+
: ""
|
|
530
|
+
}
|
|
432
531
|
</div>
|
|
433
|
-
${
|
|
434
|
-
|
|
532
|
+
${stop.fixed
|
|
533
|
+
? html`<span class="booked-mark">${CheckCircleLineIcon(18, 1)}</span>`
|
|
534
|
+
: ids.length > 1 || this.problems.length > 0 || this.stopsOnly
|
|
435
535
|
? this.renderRemove(stop.building_id, community?.name ?? "")
|
|
436
536
|
: ""}
|
|
437
537
|
</div>
|
|
@@ -444,16 +544,16 @@ export class ItineraryEditor extends LitElement {
|
|
|
444
544
|
aria-label=${`Remove ${name}`}
|
|
445
545
|
@click=${() => emit(this, "stop-remove", { buildingId })}
|
|
446
546
|
>
|
|
447
|
-
${
|
|
547
|
+
${TrashLineIcon(16)}
|
|
448
548
|
</button>`;
|
|
449
549
|
}
|
|
450
550
|
|
|
451
551
|
private renderProblem(problem: StopProblem): TemplateResult {
|
|
452
552
|
const community = this.communities.get(problem.building_id);
|
|
453
553
|
return html`<li class="stop-item">
|
|
454
|
-
<div class="
|
|
455
|
-
<div class="
|
|
456
|
-
<p class="
|
|
554
|
+
<div class="card stop-card">
|
|
555
|
+
<div class="card-text">
|
|
556
|
+
<p class="stop-name">${community?.name ?? ""}</p>
|
|
457
557
|
<p class="error-message">${problem.text}</p>
|
|
458
558
|
</div>
|
|
459
559
|
${this.renderRemove(problem.building_id, community?.name ?? "")}
|
|
@@ -463,8 +563,8 @@ export class ItineraryEditor extends LitElement {
|
|
|
463
563
|
|
|
464
564
|
/** Several communities: the date sits under the tour type, as in the design. */
|
|
465
565
|
private renderItineraryDate(): TemplateResult {
|
|
466
|
-
return html`<h2 class="
|
|
467
|
-
<div
|
|
566
|
+
return html`<h2 class="section-heading date-header">Date</h2>
|
|
567
|
+
<div class="calendar-frame">${this.renderDatePicker()}</div>
|
|
468
568
|
${this.bookableDates.length === 0 && this.offersKnown
|
|
469
569
|
? html`<p class="explanation">
|
|
470
570
|
These communities have no back-to-back tour times in the next 30
|
|
@@ -481,8 +581,8 @@ export class ItineraryEditor extends LitElement {
|
|
|
481
581
|
}
|
|
482
582
|
|
|
483
583
|
private renderItinerary(): TemplateResult {
|
|
484
|
-
return html`<h2 class="
|
|
485
|
-
|
|
584
|
+
return html`<h2 class="section-heading">
|
|
585
|
+
Tour Itinerary ${this.loading ? html`<mini-loader></mini-loader>` : ""}
|
|
486
586
|
</h2>
|
|
487
587
|
${this.renderStops()}`;
|
|
488
588
|
}
|
|
@@ -492,120 +592,134 @@ export class ItineraryEditor extends LitElement {
|
|
|
492
592
|
return html`${this.renderStops()}
|
|
493
593
|
${this.canAddStop
|
|
494
594
|
? html`<button
|
|
495
|
-
class="
|
|
595
|
+
class="add-stop"
|
|
496
596
|
@click=${() => emit(this, "add-stop", {})}
|
|
497
597
|
>
|
|
498
|
-
|
|
598
|
+
${PlusLineIcon(18)} Add Another Stop
|
|
499
599
|
</button>`
|
|
500
600
|
: ""}`;
|
|
501
601
|
}
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
602
|
+
if (!this.single) {
|
|
603
|
+
const itinerary = !this.selectedTypeOpensLink;
|
|
604
|
+
return html`<div id="tour-type-menu-outer-container" class="column">
|
|
605
|
+
${this.renderTourTypes()}
|
|
606
|
+
${itinerary ? this.renderItineraryDate() : ""}
|
|
607
|
+
</div>
|
|
608
|
+
<div id="date-and-time-menu-outer-container" class="column">
|
|
609
|
+
${itinerary ? this.renderItinerary() : this.renderLinkPrompt()}
|
|
610
|
+
</div>`;
|
|
611
|
+
}
|
|
612
|
+
return html`<div id="tour-type-menu-outer-container" class="column">
|
|
613
|
+
${this.renderCommunity()}
|
|
614
|
+
${this.selectedTypeOpensLink ? "" : this.renderDateField()}
|
|
615
|
+
${this.renderTourTypes()}
|
|
506
616
|
</div>
|
|
507
|
-
<div id="date-and-time-menu-outer-container">
|
|
617
|
+
<div id="date-and-time-menu-outer-container" class="column">
|
|
508
618
|
${this.selectedTypeOpensLink
|
|
509
619
|
? this.renderLinkPrompt()
|
|
510
|
-
: this.
|
|
511
|
-
? this.renderSingleDateAndTime()
|
|
512
|
-
: this.renderItinerary()}
|
|
620
|
+
: this.renderTimes()}
|
|
513
621
|
</div>`;
|
|
514
622
|
}
|
|
515
623
|
|
|
516
624
|
static styles = [
|
|
517
|
-
|
|
518
|
-
InputStyles,
|
|
519
|
-
floorPlanSelectorStyles,
|
|
520
|
-
floorplanImageCardStyles,
|
|
625
|
+
schedulerV2Styles,
|
|
521
626
|
itineraryStopStyles,
|
|
522
627
|
css`
|
|
523
|
-
/* New layout only: the stop list and the community card's actions. */
|
|
524
628
|
:host {
|
|
525
629
|
display: contents;
|
|
526
630
|
}
|
|
527
631
|
|
|
528
|
-
.
|
|
529
|
-
align-items: center;
|
|
632
|
+
.column {
|
|
530
633
|
display: flex;
|
|
531
|
-
|
|
532
|
-
|
|
634
|
+
flex-direction: column;
|
|
635
|
+
min-width: 0;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
/* 20px between the left column's sections, as in the design. */
|
|
639
|
+
.column > .section-heading:not(:first-child) {
|
|
640
|
+
margin-top: 20px;
|
|
533
641
|
}
|
|
534
642
|
|
|
535
|
-
.
|
|
643
|
+
.card-text {
|
|
644
|
+
flex: 1;
|
|
536
645
|
min-width: 0;
|
|
537
646
|
}
|
|
538
647
|
|
|
539
648
|
.community {
|
|
540
649
|
align-items: center;
|
|
541
|
-
|
|
650
|
+
border-radius: 4px;
|
|
651
|
+
display: flex;
|
|
652
|
+
gap: 12px;
|
|
653
|
+
padding: 7px;
|
|
542
654
|
}
|
|
543
655
|
|
|
544
|
-
|
|
545
|
-
|
|
656
|
+
.change-community {
|
|
657
|
+
height: 28px;
|
|
658
|
+
margin-right: 1px;
|
|
546
659
|
}
|
|
547
660
|
|
|
548
|
-
#tour-type-menu
|
|
549
|
-
|
|
661
|
+
#tour-type-menu {
|
|
662
|
+
display: flex;
|
|
663
|
+
flex-direction: column;
|
|
664
|
+
gap: 4px;
|
|
550
665
|
}
|
|
551
666
|
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
align-self: center;
|
|
667
|
+
.tour-type-icon {
|
|
668
|
+
display: flex;
|
|
555
669
|
}
|
|
556
670
|
|
|
557
|
-
|
|
558
|
-
|
|
671
|
+
#tour-type-menu > .explanation {
|
|
672
|
+
margin-top: 8px;
|
|
559
673
|
}
|
|
560
674
|
|
|
561
|
-
.
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
border-radius: 8px;
|
|
675
|
+
.date-popover {
|
|
676
|
+
display: block;
|
|
677
|
+
--scheduler-popover-padding: 12px;
|
|
565
678
|
}
|
|
566
679
|
|
|
567
|
-
.
|
|
568
|
-
|
|
680
|
+
.date-popover .picker-field[aria-expanded="true"] {
|
|
681
|
+
border-color: var(--tsv2-accent);
|
|
569
682
|
}
|
|
570
683
|
|
|
571
|
-
.
|
|
572
|
-
|
|
573
|
-
border-style: dashed;
|
|
684
|
+
.calendar-panel {
|
|
685
|
+
width: 246px;
|
|
574
686
|
}
|
|
575
687
|
|
|
576
|
-
.
|
|
577
|
-
|
|
578
|
-
|
|
688
|
+
.date-popover[inline] .calendar-panel {
|
|
689
|
+
border: 1px solid var(--tsv2-line);
|
|
690
|
+
border-radius: 8px;
|
|
691
|
+
margin-top: 8px;
|
|
692
|
+
padding: 12px;
|
|
693
|
+
width: auto;
|
|
579
694
|
}
|
|
580
695
|
|
|
581
|
-
.
|
|
582
|
-
|
|
583
|
-
align-self: flex-start;
|
|
584
|
-
background: none;
|
|
585
|
-
border: none;
|
|
696
|
+
.calendar-frame {
|
|
697
|
+
border: 1px solid var(--tsv2-line);
|
|
586
698
|
border-radius: 4px;
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
display: inline-flex;
|
|
590
|
-
flex-shrink: 0;
|
|
591
|
-
padding: 4px;
|
|
699
|
+
margin-top: 8px;
|
|
700
|
+
padding: 12px;
|
|
592
701
|
}
|
|
593
702
|
|
|
594
|
-
.
|
|
595
|
-
|
|
703
|
+
.column > .calendar-frame {
|
|
704
|
+
margin-top: 0;
|
|
596
705
|
}
|
|
597
706
|
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
707
|
+
.primary-button {
|
|
708
|
+
background: var(--tsv2-accent);
|
|
709
|
+
border: none;
|
|
710
|
+
border-radius: 4px;
|
|
711
|
+
color: var(--on-primary-color, #ffffff);
|
|
712
|
+
cursor: pointer;
|
|
713
|
+
font: inherit;
|
|
714
|
+
font-size: 12px;
|
|
715
|
+
height: 36px;
|
|
716
|
+
line-height: 16px;
|
|
717
|
+
padding: 0 24px;
|
|
718
|
+
width: 100%;
|
|
603
719
|
}
|
|
604
720
|
|
|
605
|
-
.
|
|
606
|
-
|
|
607
|
-
display: inline-flex;
|
|
608
|
-
gap: 6px;
|
|
721
|
+
.primary-button:hover {
|
|
722
|
+
opacity: 0.85;
|
|
609
723
|
}
|
|
610
724
|
|
|
611
725
|
.edit-time {
|
|
@@ -614,18 +728,69 @@ export class ItineraryEditor extends LitElement {
|
|
|
614
728
|
color: inherit;
|
|
615
729
|
cursor: pointer;
|
|
616
730
|
font: inherit;
|
|
617
|
-
font-size:
|
|
731
|
+
font-size: 12px;
|
|
618
732
|
padding: 0;
|
|
619
733
|
}
|
|
620
734
|
|
|
621
735
|
.edit-time svg {
|
|
622
|
-
color:
|
|
736
|
+
color: var(--tsv2-muted);
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
.stop-card .calendar-frame,
|
|
740
|
+
.stop-times {
|
|
741
|
+
margin-top: 12px;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
.stop-times .subtitle {
|
|
745
|
+
margin-top: 6px;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
.booked-mark {
|
|
749
|
+
display: inline-flex;
|
|
750
|
+
flex: none;
|
|
751
|
+
margin-right: 8px;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
.remove {
|
|
755
|
+
color: #868e96;
|
|
756
|
+
margin-right: 4px;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
.grip {
|
|
760
|
+
cursor: grab;
|
|
761
|
+
margin: 0 -6px 0 -4px;
|
|
762
|
+
touch-action: none;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
.stop-item.dragging {
|
|
766
|
+
opacity: 0.5;
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
.stop-item.drop-target .stop-card {
|
|
770
|
+
border-color: var(--tsv2-accent);
|
|
771
|
+
border-style: dashed;
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
.add-stop {
|
|
775
|
+
align-items: center;
|
|
776
|
+
background: var(--tsv2-tint);
|
|
777
|
+
border: none;
|
|
778
|
+
border-radius: 4px;
|
|
779
|
+
color: var(--tsv2-accent);
|
|
780
|
+
cursor: pointer;
|
|
781
|
+
display: flex;
|
|
782
|
+
font: inherit;
|
|
783
|
+
font-size: 12px;
|
|
784
|
+
gap: 6px;
|
|
785
|
+
height: 36px;
|
|
786
|
+
justify-content: center;
|
|
787
|
+
line-height: 16px;
|
|
788
|
+
margin-top: 12px;
|
|
789
|
+
width: 100%;
|
|
623
790
|
}
|
|
624
791
|
|
|
625
|
-
.stop
|
|
626
|
-
|
|
627
|
-
font-size: 0.7rem;
|
|
628
|
-
padding: 2px 8px;
|
|
792
|
+
.add-stop:hover {
|
|
793
|
+
background: var(--tsv2-tint-line);
|
|
629
794
|
}
|
|
630
795
|
`,
|
|
631
796
|
];
|