@nylas/react 1.1.0-canary.16 → 1.1.0-canary.18
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/add-circle-icon_2.entry-3091976b.cjs +1 -0
- package/dist/add-circle-icon_2.entry-3b13ee64.js +25 -0
- package/dist/{archive-icon_7.entry-54dc5cc2.js → archive-icon_7.entry-8932618a.js} +19 -19
- package/dist/{archive-icon_7.entry-073d9915.cjs → archive-icon_7.entry-c2b6d860.cjs} +1 -1
- package/dist/{arrow-icon.entry-869a1db9.js → arrow-icon.entry-1f54c377.js} +4 -4
- package/dist/{arrow-icon.entry-bada78b8.cjs → arrow-icon.entry-a159bee8.cjs} +1 -1
- package/dist/{bold-icon_3.entry-5695177e.js → bold-icon_3.entry-447d0537.js} +10 -10
- package/dist/{bold-icon_3.entry-cc6150c9.cjs → bold-icon_3.entry-c51e1af3.cjs} +1 -1
- package/dist/{button-component.entry-a0533c8b.js → button-component.entry-52ccb6d9.js} +2 -2
- package/dist/{button-component.entry-3703ecff.cjs → button-component.entry-e79b2d08.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-0f1d98b3.cjs → calendar-cancel-icon.entry-805febcc.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-a9ab0b09.js → calendar-cancel-icon.entry-a78f27bc.js} +2 -2
- package/dist/{calendar-check-icon_2.entry-6b83717e.cjs → calendar-check-icon_2.entry-4a0fd7bd.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-a62b5d2c.js → calendar-check-icon_2.entry-7c8b6c92.js} +3 -3
- package/dist/{calendar-icon.entry-08f83da9.cjs → calendar-icon.entry-1fc018b4.cjs} +1 -1
- package/dist/{calendar-icon.entry-ddc22561.js → calendar-icon.entry-96f9727f.js} +5 -5
- package/dist/calendar-info-icon_28.entry-2054703c.cjs +1 -0
- package/dist/{calendar-info-icon_27.entry-f02f44b7.js → calendar-info-icon_28.entry-e7bebd13.js} +527 -701
- package/dist/{chevron-icon_3.entry-f27202a2.js → chevron-icon_3.entry-25d90239.js} +6 -6
- package/dist/chevron-icon_3.entry-7bd4a4b5.cjs +1 -0
- package/dist/{clock-icon_2.entry-b7b8ef46.cjs → clock-icon_2.entry-2406c3d0.cjs} +1 -1
- package/dist/{clock-icon_2.entry-2277fd45.js → clock-icon_2.entry-c1b22ed4.js} +5 -5
- package/dist/{constants-f34b9c6e-ccdbc4ac.cjs → constants-f34b9c6e-b774916c.cjs} +1 -1
- package/dist/{constants-f34b9c6e-bbca6b6e.js → constants-f34b9c6e-f1c4dd0d.js} +1 -1
- package/dist/document-refresh-icon.entry-570f9c9d.js +15 -0
- package/dist/document-refresh-icon.entry-a0293858.cjs +1 -0
- package/dist/elements/index.d.ts +1 -0
- package/dist/{elements-dc5b338e-d48368b1.cjs → elements-dc5b338e-550a6cb1.cjs} +1 -1
- package/dist/{elements-dc5b338e-c4a07acc.js → elements-dc5b338e-cafa7a55.js} +1 -1
- package/dist/{focus-visible-e8093c16-10c0fa06.js → focus-visible-e8093c16-022799ce.js} +1 -1
- package/dist/{focus-visible-e8093c16-c86f3687.cjs → focus-visible-e8093c16-c14162e8.cjs} +1 -1
- package/dist/{forward-icon_6.entry-07cd4b52.cjs → forward-icon_6.entry-55752b23.cjs} +2 -2
- package/dist/{forward-icon_6.entry-39d788af.js → forward-icon_6.entry-9b832146.js} +9 -9
- package/dist/{globe-icon.entry-60a53e89.js → globe-icon.entry-2b61820e.js} +4 -4
- package/dist/{globe-icon.entry-76c90d97.cjs → globe-icon.entry-dabe7b8b.cjs} +1 -1
- package/dist/google-logo-icon_4.entry-60c0d39a.cjs +1 -0
- package/dist/google-logo-icon_4.entry-a0dc33da.js +467 -0
- package/dist/index-53420959-67beefed.js +5 -0
- package/dist/index-53420959-d3254a34.cjs +1 -0
- package/dist/{index-6d9eeb53-66c114b2.cjs → index-6d9eeb53-3049fc04.cjs} +1 -1
- package/dist/{index-6d9eeb53-38c9f47c.js → index-6d9eeb53-3edef246.js} +2 -2
- package/dist/{index-f383e3c4.js → index-812162da.js} +902 -901
- package/dist/{index-f435e814.cjs → index-e3e9b594.cjs} +3 -3
- package/dist/{index.es-9cc0eb3c-09dc620b.cjs → index.es-9cc0eb3c-0c99c055.cjs} +1 -1
- package/dist/{index.es-9cc0eb3c-510db795.js → index.es-9cc0eb3c-52226859.js} +1 -1
- package/dist/{info-icon_2.entry-a61859ac.js → info-icon_2.entry-2fe6c16c.js} +8 -8
- package/dist/{info-icon_2.entry-7fe8bcd9.cjs → info-icon_2.entry-5f6b9af8.cjs} +1 -1
- package/dist/{input-component.entry-12f60175.js → input-component.entry-1195d579.js} +6 -6
- package/dist/{input-component.entry-04dcc655.cjs → input-component.entry-2b6e44c4.cjs} +1 -1
- package/dist/{input-dropdown_2.entry-0e5925a7.js → input-dropdown_2.entry-dbd0d6f4.js} +35 -28
- package/dist/input-dropdown_2.entry-dbdb5aa3.cjs +1 -0
- package/dist/loading-icon.entry-027a2ad1.js +15 -0
- package/dist/{loading-icon.entry-f82786b4.cjs → loading-icon.entry-e179f122.cjs} +1 -1
- package/dist/{mailbox-store-64b4ef7c-1e6c96cc.cjs → mailbox-store-64b4ef7c-0eac526c.cjs} +1 -1
- package/dist/{mailbox-store-64b4ef7c-017196a6.js → mailbox-store-64b4ef7c-22a6c565.js} +2 -2
- package/dist/nylas-booked-event-card_10.entry-84f64ba5.cjs +1 -0
- package/dist/{nylas-booked-event-card_10.entry-2dff7f16.js → nylas-booked-event-card_10.entry-e0990f5b.js} +170 -170
- package/dist/{nylas-custom-booking-flow.entry-36f7a943.cjs → nylas-custom-booking-flow.entry-898c8cc9.cjs} +1 -1
- package/dist/{nylas-custom-booking-flow.entry-feed589b.js → nylas-custom-booking-flow.entry-bc64af5f.js} +7 -7
- package/dist/{nylas-form-card.entry-e9f09602.cjs → nylas-form-card.entry-0c71f4fc.cjs} +1 -1
- package/dist/{nylas-form-card.entry-49f519dd.js → nylas-form-card.entry-c564b52e.js} +9 -9
- package/dist/{nylas-if-state.entry-127694a9.js → nylas-if-state.entry-e9486e12.js} +3 -3
- package/dist/{nylas-if-state.entry-81916723.cjs → nylas-if-state.entry-ff6a2046.cjs} +1 -1
- package/dist/{nylas-list-folders.entry-e3e9ec1f.js → nylas-list-folders.entry-0258af1e.js} +7 -7
- package/dist/{nylas-list-folders.entry-f4c68fb9.cjs → nylas-list-folders.entry-90716d2b.cjs} +1 -1
- package/dist/{nylas-list-threads.entry-fa4b5318.js → nylas-list-threads.entry-1abcdd30.js} +3 -3
- package/dist/{nylas-list-threads.entry-f0a1b9d1.cjs → nylas-list-threads.entry-21edf012.cjs} +1 -1
- package/dist/{nylas-login.entry-aeac716e.cjs → nylas-login.entry-2e0ce95e.cjs} +1 -1
- package/dist/{nylas-login.entry-6d17e994.js → nylas-login.entry-ba7383ac.js} +3 -3
- package/dist/{nylas-mailbox-pagination.entry-50fba238.cjs → nylas-mailbox-pagination.entry-ba6beb08.cjs} +1 -1
- package/dist/{nylas-mailbox-pagination.entry-c440f56a.js → nylas-mailbox-pagination.entry-f6186560.js} +2 -2
- package/dist/{nylas-mailbox-toolbar-button.entry-d3d0c870.cjs → nylas-mailbox-toolbar-button.entry-0875aadb.cjs} +1 -1
- package/dist/{nylas-mailbox-toolbar-button.entry-14e30d36.js → nylas-mailbox-toolbar-button.entry-e18059b0.js} +10 -10
- package/dist/{nylas-mailbox.entry-a59159c7.js → nylas-mailbox.entry-2e3815ed.js} +4 -4
- package/dist/{nylas-mailbox.entry-2fdb3d4c.cjs → nylas-mailbox.entry-bb2905bf.cjs} +1 -1
- package/dist/{nylas-provider.entry-dfa8c7c1.cjs → nylas-provider.entry-51c5cdbf.cjs} +1 -1
- package/dist/{nylas-provider.entry-d7dbb5fc.js → nylas-provider.entry-69ee5061.js} +13 -13
- package/dist/{nylas-scheduler-editor.entry-67e71234.cjs → nylas-scheduler-editor.entry-923b8566.cjs} +2 -2
- package/dist/{nylas-scheduler-editor.entry-3b44b807.js → nylas-scheduler-editor.entry-d4a9afb1.js} +5 -5
- package/dist/{nylas-scheduling.entry-0ce0dab9.cjs → nylas-scheduling.entry-54f1a5e9.cjs} +1 -1
- package/dist/{nylas-scheduling.entry-68f72bf7.js → nylas-scheduling.entry-f82a2822.js} +3 -3
- package/dist/{nylas-threads-refresh.entry-23a83bd4.js → nylas-threads-refresh.entry-72482d2f.js} +10 -10
- package/dist/{nylas-threads-refresh.entry-955e92c7.cjs → nylas-threads-refresh.entry-99001756.cjs} +1 -1
- package/dist/{nylas-threads-search.entry-2fb6db63.cjs → nylas-threads-search.entry-462527fd.cjs} +1 -1
- package/dist/{nylas-threads-search.entry-8f01ee4a.js → nylas-threads-search.entry-c5fe50e5.js} +14 -14
- package/dist/nylas-time-window-picker.entry-0d93e7cc.js +316 -0
- package/dist/nylas-time-window-picker.entry-ccffcf2b.cjs +1 -0
- package/dist/{nylas-view-thread.entry-b957f88b.js → nylas-view-thread.entry-2d34b41c.js} +6 -6
- package/dist/{nylas-view-thread.entry-3cf0c1ac.cjs → nylas-view-thread.entry-58432a52.cjs} +1 -1
- package/dist/play-icon_2.entry-1ea3fd6b.cjs +1 -0
- package/dist/{play-icon_2.entry-ecdf8ea4.js → play-icon_2.entry-d08adf17.js} +7 -7
- package/dist/react.cjs +1 -1
- package/dist/react.js +41 -40
- package/dist/{refresh-icon.entry-76e58ccb.cjs → refresh-icon.entry-1e670732.cjs} +1 -1
- package/dist/{refresh-icon.entry-480d28aa.js → refresh-icon.entry-a041136d.js} +4 -4
- package/dist/{register-component-a5a9ca5d-438c8a96.js → register-component-a5a9ca5d-a5c01c35.js} +1 -1
- package/dist/{register-component-a5a9ca5d-ebf633cf.cjs → register-component-a5a9ca5d-b68b6039.cjs} +1 -1
- package/dist/{scheduler-config-store-4a50a03d-d5a5899e.cjs → scheduler-config-store-4a50a03d-884e6df8.cjs} +1 -1
- package/dist/{scheduler-config-store-4a50a03d-defa6368.js → scheduler-config-store-4a50a03d-ee42ff96.js} +1 -1
- package/dist/{scheduler-store-f02ce045-de4cb1f5.js → scheduler-store-f02ce045-23a14e3f.js} +1 -1
- package/dist/{scheduler-store-f02ce045-00faab09.cjs → scheduler-store-f02ce045-42e3647c.cjs} +1 -1
- package/dist/{textarea-component.entry-1c8d11af.js → textarea-component.entry-1b4c771b.js} +4 -4
- package/dist/{textarea-component.entry-5ff249a8.cjs → textarea-component.entry-24a830c1.cjs} +1 -1
- package/dist/{translate-icon.entry-a55c013b.cjs → translate-icon.entry-0c0add25.cjs} +1 -1
- package/dist/{translate-icon.entry-3741cac0.js → translate-icon.entry-44bde57b.js} +2 -2
- package/dist/{warning-icon.entry-445352b5.js → warning-icon.entry-8956cba2.js} +5 -5
- package/dist/{warning-icon.entry-1a104c52.cjs → warning-icon.entry-9a77ab01.cjs} +1 -1
- package/package.json +2 -2
- package/dist/add-circle-icon_2.entry-035ffd48.cjs +0 -1
- package/dist/add-circle-icon_2.entry-5cadaf97.js +0 -25
- package/dist/calendar-info-icon_27.entry-a8390790.cjs +0 -1
- package/dist/chevron-icon_3.entry-978b52d5.cjs +0 -1
- package/dist/document-refresh-icon.entry-5795e2a9.cjs +0 -1
- package/dist/document-refresh-icon.entry-656a5e02.js +0 -15
- package/dist/google-logo-icon_4.entry-5402eae2.cjs +0 -1
- package/dist/google-logo-icon_4.entry-d327d68f.js +0 -438
- package/dist/index-53420959-791b4e73.js +0 -5
- package/dist/index-53420959-9f979766.cjs +0 -1
- package/dist/input-dropdown_2.entry-d9bff099.cjs +0 -1
- package/dist/loading-icon.entry-51ddd748.js +0 -15
- package/dist/nylas-booked-event-card_10.entry-5a9a4cc6.cjs +0 -1
- package/dist/play-icon_2.entry-c92d5237.cjs +0 -1
- package/dist/toggle-switch.entry-26d3d1c9.cjs +0 -1
- package/dist/toggle-switch.entry-339ab48b.js +0 -25
|
@@ -1,438 +0,0 @@
|
|
|
1
|
-
import { r as D, h as n, c as y, x as at, d, y as q, H as K, g as Q } from "./index-f383e3c4.js";
|
|
2
|
-
import { R as X } from "./register-component-a5a9ca5d-438c8a96.js";
|
|
3
|
-
import { D as it } from "./constants-f34b9c6e-bbca6b6e.js";
|
|
4
|
-
import "react";
|
|
5
|
-
import "react-dom";
|
|
6
|
-
const st = ".sc-google-logo-icon-h{display:flex}", ot = st, rt = class {
|
|
7
|
-
constructor(t) {
|
|
8
|
-
D(this, t), this.width = "24", this.height = "24";
|
|
9
|
-
}
|
|
10
|
-
render() {
|
|
11
|
-
return n("svg", { key: "48ccae649f280d48621dfb214a08b980155680a1", width: this.width, height: this.height, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, n("g", { key: "10196951caa0fa0b94b57c57a62d8bcb31d92d91", "clip-path": "url(#clip0_959_12452)" }, n("path", { key: "0d2358cd1dcbd7f9ef2dfa17a5075a341210a43c", d: "M23.745 12.27C23.745 11.48 23.675 10.73 23.555 10H12.255V14.51H18.725C18.435 15.99 17.585 17.24 16.325 18.09V21.09H20.185C22.445 19 23.745 15.92 23.745 12.27Z", fill: "#4285F4" }), n("path", { key: "8540c5619b64996b6b158fe50609aa378dfd468f", d: "M12.255 24C15.495 24 18.205 22.92 20.185 21.09L16.325 18.09C15.245 18.81 13.875 19.25 12.255 19.25C9.12504 19.25 6.47505 17.14 5.52505 14.29H1.54504V17.38C3.51504 21.3 7.56504 24 12.255 24Z", fill: "#34A853" }), n("path", { key: "b683a33b6068de0793ef4426e6404d438dbdf73e", d: "M5.52501 14.2901C5.27501 13.5701 5.145 12.8001 5.145 12.0001C5.145 11.2001 5.28501 10.4301 5.52501 9.71012V6.62012H1.545C0.725004 8.24012 0.255005 10.0601 0.255005 12.0001C0.255005 13.9401 0.725004 15.7601 1.545 17.3801L5.52501 14.2901Z", fill: "#FBBC05" }), n("path", { key: "916d663bbb04c8267e595adf9125068232414ed7", d: "M12.255 4.75C14.025 4.75 15.605 5.36 16.855 6.55L20.275 3.13C18.205 1.19 15.495 0 12.255 0C7.56504 0 3.51504 2.7 1.54504 6.62L5.52505 9.71C6.47505 6.86 9.12504 4.75 12.255 4.75Z", fill: "#EA4335" })), n("defs", { key: "a941f8ccb1711f648dc3e2db750496a2491b4b55" }, n("clipPath", { key: "caef3b6e814ed957bcee43a794130dce6760702d", id: "clip0_959_12452" }, n("rect", { key: "df7c24b60402fd2e9d248f4e5ccfbaa640d549ae", width: 24, height: 24, fill: "white" }))));
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
rt.style = ot;
|
|
15
|
-
const lt = ".sc-microsoft-logo-icon-h{display:flex}", dt = lt, ct = class {
|
|
16
|
-
constructor(t) {
|
|
17
|
-
D(this, t), this.width = "22", this.height = "22";
|
|
18
|
-
}
|
|
19
|
-
render() {
|
|
20
|
-
return n("svg", { key: "4aa3482048f90ecbcb46d539716464bdf2c20e47", width: this.width, height: this.height, viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, n("path", { key: "27924938927bdc57e665d91623f07684aea3a6ee", d: "M0.043457 0.043457H10.4782V10.4782H0.043457V0.043457Z", fill: "#F35325" }), n("path", { key: "91decf0bfe7ef26f93ea724fa9738d1ffa1ae4a6", d: "M11.5217 0.043457H21.9565V10.4782H11.5217V0.043457Z", fill: "#81BC06" }), n("path", { key: "0f455cec58fd99a755157ab9ca950242a634d541", d: "M0.043457 11.5217H10.4782V21.9565H0.043457V11.5217Z", fill: "#05A6F0" }), n("path", { key: "80c930047e54c708d5f7cde3d88f33f2a0d0dbd5", d: "M11.5217 11.5217H21.9565V21.9565H11.5217V11.5217Z", fill: "#FFBA08" }));
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
ct.style = dt;
|
|
24
|
-
function bt({ id: t, formState: e, activeTab: a, calendars: s }) {
|
|
25
|
-
var o;
|
|
26
|
-
switch (a) {
|
|
27
|
-
case "eventInfo":
|
|
28
|
-
const i = e.title, l = e.description, r = parseInt(e.duration), b = e.location;
|
|
29
|
-
return n(
|
|
30
|
-
"div",
|
|
31
|
-
{ key: t },
|
|
32
|
-
n(
|
|
33
|
-
"nylas-event-info",
|
|
34
|
-
null,
|
|
35
|
-
n(
|
|
36
|
-
"div",
|
|
37
|
-
{ slot: "inputs" },
|
|
38
|
-
n("nylas-event-title", { name: "title", eventTitle: i, exportparts: "net, net__title, net__dropdown-content" }),
|
|
39
|
-
n("nylas-event-duration", { name: "duration", eventDurationMinutes: r, exportparts: "ned, ned__dropdown, ned__dropdown-button, ned__dropdown-content, ned__input_dropdown, ned__input_dropdown-input, ned__input_dropdown-content" }),
|
|
40
|
-
n("nylas-event-location", { name: "location", eventLocation: b, exportparts: "nel, nel__location, nel__dropdown, nel__dropdown-button, nel__dropdown-content" }),
|
|
41
|
-
n("nylas-event-description", { name: "description", eventDescription: l, exportparts: "nedesc, nedesc__textarea" })
|
|
42
|
-
)
|
|
43
|
-
)
|
|
44
|
-
);
|
|
45
|
-
case "availability":
|
|
46
|
-
const u = e.availability.openHours, f = e.availability.timezone ? e.availability.timezone : Intl.DateTimeFormat().resolvedOptions().timeZone, h = (o = e.participants) == null ? void 0 : o.find((v) => v.is_organizer), m = (h == null ? void 0 : h.email) ?? "primary", g = e.calendarIds.length > 0 ? e.calendarIds : [m], _ = e.bookingCalendar == "primary" ? m : e.bookingCalendar;
|
|
47
|
-
return n(
|
|
48
|
-
"div",
|
|
49
|
-
{ key: t },
|
|
50
|
-
n("nylas-booking-calendar-picker", { name: "booking-calendar", calendars: s ?? [], defaultBookingCalendar: _, exportparts: "nbcp, nbcp__header, nbcp__input-label, nbcp__dropdown, nbcp__dropdown-button, nbcp__dropdown-content" }),
|
|
51
|
-
n("nylas-calendar-picker", { name: "calendars", calendars: s ?? [], defaultSelectedCalendars: g, exportparts: "ncp ncp__header, ncp__dropdown, ncp__dropdown-button, ncp__dropdown-content" }),
|
|
52
|
-
n("nylas-availability-picker", { name: "availability", openHours: u, defaultTimezone: f, exportparts: "nap__header, nap__select-timezone, nap__select-timezone-button, nap__select-timezone-dropdown-content, nap__availability, nap__day, nap__time-ranges, nap__time-range, nap__add-time-range, nap__time-picker-container, nap__time-picker-input, nap__time-picker-times" })
|
|
53
|
-
);
|
|
54
|
-
case "bookingOptions":
|
|
55
|
-
return n(
|
|
56
|
-
"div",
|
|
57
|
-
{ key: t },
|
|
58
|
-
n("nylas-buffer-time", { name: "buffer-time", buffer: e.buffer, exportparts: "nbt, nbt__header, nbt__body, nbt__dropdown-before, nbt__dropdown-button-before, nbt__dropdown-content-before, nbt__dropdown-after, nbt__dropdown-button-after, nbt__dropdown-content-after, nbt__preview" }),
|
|
59
|
-
n(
|
|
60
|
-
"nylas-event-limits",
|
|
61
|
-
null,
|
|
62
|
-
n(
|
|
63
|
-
"div",
|
|
64
|
-
{ slot: "inputs" },
|
|
65
|
-
n("nylas-min-booking-notice", { name: "min-booking-notice", minBookingNotice: e.minBookingNotice, exportparts: "nmbn, nmbn__number-dropdown, nmbn__number-dropdown-button, nmbn__number-dropdown-content, nmbn__period-dropdown, nmbn__period-dropdown-button, nmbn__period-dropdown-content" }),
|
|
66
|
-
n("nylas-limit-future-bookings", { name: "limit-future-bookings", availableDaysInFuture: e.availableDaysInFuture, exportparts: "nlfb, nlfb__number-dropdown, nlfb__number-dropdown-button, nlfb__number-dropdown-content, nlfb__period-dropdown, nlfb__period-dropdown-button, nlfb__period-dropdown-content" }),
|
|
67
|
-
n("nylas-min-cancellation-notice", { name: "min-cancellation-notice", minCancellationNotice: e.minCancellationNotice, exportparts: "nmcn, nmcn__number-dropdown, nmcn__number-dropdown-button, nmcn__number-dropdown-content, nmcn__period-dropdown, nmcn__period-dropdown-button, nmcn__period-dropdown-content" }),
|
|
68
|
-
n("nylas-cancellation-policy", { name: "cancellation-policy", cancellationPolicy: e.cancellationPolicy, exportparts: "ncpolicy, ncpolicy__textarea" })
|
|
69
|
-
)
|
|
70
|
-
),
|
|
71
|
-
n("nylas-timeslot-interval", { name: "timeslot-interval", eventDurationMinutes: parseInt(e.duration), exportparts: "nti, nti__header, nti__input-label, nti__dropdown, nti__dropdown-button, nti__dropdown-content" }),
|
|
72
|
-
n("nylas-customize-booking-settings", { name: "customize-booking-settings", exportparts: "ncbs, ncbs__header, ncbs__settings, ncbs__settings-div, ncbs__additional_guests, ncbs__cancellation_options, ncbs__rescheduling_options" })
|
|
73
|
-
);
|
|
74
|
-
case "participants":
|
|
75
|
-
return n(
|
|
76
|
-
"div",
|
|
77
|
-
{ key: t },
|
|
78
|
-
n("nylas-additional-participants", { name: "participants", eventParticipants: e.participants, exportparts: "nap__title, nap__subtitle, nap__content, nap__input_group, nap__input_wrapper, nap__input, nap__remove-participant" })
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
const ut = '.sc-nylas-editor-tabs-h{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.scheduler-editor.sc-nylas-editor-tabs{display:flex;flex-direction:column}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs{height:554px;display:grid;grid-template-columns:minmax(224px, 25%) 1fr}@media screen and (max-width: 768px){.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs{display:table-column-group;height:auto}}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs{display:flex;flex-direction:column;border-right:1px solid var(--nylas-base-200);background-color:var(--nylas-base-25)}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.sc-nylas-editor-tabs{display:flex;align-items:center;gap:0.5rem;padding:0.5rem 1rem;color:var(--nylas-base-900);background:var(--nylas-base-0);border:none;height:56px;font-family:var(--nylas-font-family);font-size:16px;font-weight:500;line-height:24px;cursor:pointer}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.sc-nylas-editor-tabs:not(:first-of-type){margin-top:0.25rem}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tabs.sc-nylas-editor-tabs .tab.active.sc-nylas-editor-tabs{font-weight:600;background:var(--nylas-base-0);color:var(--nylas-primary);border-left:4px solid var(--nylas-primary);box-shadow:0px 1px 2px 0px rgba(0, 0, 0, 0.0588235294);box-shadow:0px 1px 3px 0px rgba(0, 0, 0, 0.1019607843)}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs{max-width:692px;overflow-y:auto}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-info.sc-nylas-editor-tabs,.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-limits.sc-nylas-editor-tabs{width:inherit}.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-info.sc-nylas-editor-tabs div[slot=inputs].sc-nylas-editor-tabs,.scheduler-editor.sc-nylas-editor-tabs .form-contents.sc-nylas-editor-tabs .tab-content.sc-nylas-editor-tabs nylas-event-limits.sc-nylas-editor-tabs div[slot=inputs].sc-nylas-editor-tabs{display:flex;flex-direction:column;gap:1rem}.footer.sc-nylas-editor-tabs{display:flex;justify-content:space-between;align-items:center;gap:1rem;min-height:80px;padding:0 1rem;border-top:1px solid var(--nylas-base-200)}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs{flex-direction:column;height:auto}}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .preview.sc-nylas-editor-tabs{margin-top:1rem;width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs{display:flex;justify-content:flex-end;align-items:center;justify-self:flex-end;gap:1rem}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs{flex-direction:column-reverse;width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.sc-nylas-editor-tabs{max-width:524px}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.unsaved-changes.sc-nylas-editor-tabs{color:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.saved-changes.sc-nylas-editor-tabs{color:var(--nylas-success)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.error.sc-nylas-editor-tabs{color:var(--nylas-error)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs p.error-full-width.sc-nylas-editor-tabs{max-width:660px}@media screen and (max-width: 768px){.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button-component.sc-nylas-editor-tabs{width:100%}}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs{background:var(--nylas-primary);color:var(--nylas-base-0);height:48px;border:none;border-radius:var(--nylas-border-radius-2x);font-size:1rem;line-height:24px;padding:0 1rem;cursor:pointer;width:148px}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:hover{background:var(--nylas-base-600)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:active{background:var(--nylas-base-800)}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs:disabled{background:var(--nylas-base-300);cursor:not-allowed}.footer.sc-nylas-editor-tabs .buttons.sc-nylas-editor-tabs button.sc-nylas-editor-tabs span.sc-nylas-editor-tabs{display:flex;align-items:center;justify-content:center;gap:0.5rem}', ht = ut;
|
|
83
|
-
var pt = function(t, e, a, s) {
|
|
84
|
-
var o = arguments.length, i = o < 3 ? e : s === null ? s = Object.getOwnPropertyDescriptor(e, a) : s, l;
|
|
85
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
86
|
-
i = Reflect.decorate(t, e, a, s);
|
|
87
|
-
else
|
|
88
|
-
for (var r = t.length - 1; r >= 0; r--)
|
|
89
|
-
(l = t[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(e, a, i) : l(e, a)) || i);
|
|
90
|
-
return o > 3 && i && Object.defineProperty(e, a, i), i;
|
|
91
|
-
}, T = function(t, e) {
|
|
92
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
93
|
-
return Reflect.metadata(t, e);
|
|
94
|
-
};
|
|
95
|
-
const Y = class {
|
|
96
|
-
constructor(t) {
|
|
97
|
-
D(this, t), this.schedulerConfigChanged = y(this, "schedulerConfigChanged", 7), this.cancelButtonClick = y(this, "cancelButtonClick", 7), this.formSubmitted = y(this, "formSubmitted", 7), this.previewButtonClicked = y(this, "previewButtonClicked", 7), this.setError = (e) => {
|
|
98
|
-
this.error = e.message;
|
|
99
|
-
}, this.formSubmissionHandler = async (e) => {
|
|
100
|
-
var O, F, P, E, R, N, j, M, V, U, z, A, $, Z, G, J;
|
|
101
|
-
if (e.preventDefault(), this.formSubmitted.emit(), !this.formRef.checkValidity())
|
|
102
|
-
return;
|
|
103
|
-
this.isLoading = !0, this.hasUnsavedChanges = !1;
|
|
104
|
-
const s = this.updateFormState(), { title: o, description: i, duration: l, availability: r, calendarIds: b, bookingCalendar: u, location: f, bookingType: h, buffer: m, availableDaysInFuture: g, minCancellationNotice: _, minBookingNotice: v, cancellationPolicy: C, timeslotInterval: p, additionalGuestsHidden: x, hideCancellationOptions: S, hideReschedulingOptions: L, participants: B } = s, c = (F = (O = this.selectedConfiguration) == null ? void 0 : O.participants) == null ? void 0 : F.find((W) => W.is_organizer), w = l ? parseInt(l) : 30, k = {
|
|
105
|
-
...((P = this.selectedConfiguration) == null ? void 0 : P.id) && { id: this.selectedConfiguration.id },
|
|
106
|
-
version: ((E = this.selectedConfiguration) == null ? void 0 : E.version) ?? "1.0.0",
|
|
107
|
-
availability: {
|
|
108
|
-
duration_minutes: w,
|
|
109
|
-
interval_minutes: (p == null ? void 0 : p.interval) ?? w,
|
|
110
|
-
round_to: p == null ? void 0 : p.roundTo,
|
|
111
|
-
availability_rules: {
|
|
112
|
-
availability_method: ((j = (N = (R = this.selectedConfiguration) == null ? void 0 : R.availability) == null ? void 0 : N.availability_rules) == null ? void 0 : j.availability_method) ?? "collective",
|
|
113
|
-
buffer: m || { before: 0, after: 0 },
|
|
114
|
-
default_open_hours: ((U = (V = (M = this.selectedConfiguration) == null ? void 0 : M.availability) == null ? void 0 : V.availability_rules) == null ? void 0 : U.default_open_hours) ?? it,
|
|
115
|
-
round_robin_group_id: (($ = (A = (z = this.selectedConfiguration) == null ? void 0 : z.availability) == null ? void 0 : A.availability_rules) == null ? void 0 : $.round_robin_group_id) ?? ""
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
participants: [
|
|
119
|
-
{
|
|
120
|
-
name: (c == null ? void 0 : c.name) ?? (c == null ? void 0 : c.email) ?? ((Z = this.currentUser) == null ? void 0 : Z.name) ?? ((G = this.currentUser) == null ? void 0 : G.email) ?? "",
|
|
121
|
-
email: (c == null ? void 0 : c.email) ?? ((J = this.currentUser) == null ? void 0 : J.email) ?? "",
|
|
122
|
-
is_organizer: !0,
|
|
123
|
-
availability: {
|
|
124
|
-
calendar_ids: b != null && b.length ? b : ["primary"],
|
|
125
|
-
open_hours: (r == null ? void 0 : r.openHours) ?? []
|
|
126
|
-
},
|
|
127
|
-
booking: {
|
|
128
|
-
calendar_id: u && u !== "" ? u : "primary"
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
...B ?? []
|
|
132
|
-
],
|
|
133
|
-
event_booking: {
|
|
134
|
-
title: (o == null ? void 0 : o.toString()) ?? "",
|
|
135
|
-
description: (i == null ? void 0 : i.toString()) ?? "",
|
|
136
|
-
location: (f == null ? void 0 : f.toString()) ?? "",
|
|
137
|
-
booking_type: (h == null ? void 0 : h.toString()) ?? "booking",
|
|
138
|
-
timezone: (r == null ? void 0 : r.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
139
|
-
},
|
|
140
|
-
scheduler: {
|
|
141
|
-
cancellation_policy: C ?? "",
|
|
142
|
-
available_days_in_future: g ?? 30,
|
|
143
|
-
min_cancellation_notice: _ ?? 0,
|
|
144
|
-
min_booking_notice: v ?? 60,
|
|
145
|
-
hide_additional_guests: x ?? !1,
|
|
146
|
-
hide_cancellation_options: S ?? !1,
|
|
147
|
-
hide_rescheduling_options: L ?? !1
|
|
148
|
-
}
|
|
149
|
-
}, H = at(k, this.selectedConfiguration), et = this.action === "create" ? H : k, nt = (W) => {
|
|
150
|
-
this.isLoading = !1, this.changesSaved = !0, setTimeout(() => {
|
|
151
|
-
this.changesSaved = !1;
|
|
152
|
-
}, 5e3);
|
|
153
|
-
};
|
|
154
|
-
this.schedulerConfigChanged.emit({ config: et, resetLoadingState: nt, setError: this.setError, action: this.action });
|
|
155
|
-
}, this.calendars = void 0, this.selectedConfiguration = void 0, this.currentUser = void 0, this.schedulerPreviewLink = "", this.mode = "app", this.action = "create", this.activeTab = "eventInfo", this.isLoading = !1, this.hasUnsavedChanges = !1, this.changesSaved = !1, this.formState = {}, this.error = "";
|
|
156
|
-
}
|
|
157
|
-
configChangedHandler(t) {
|
|
158
|
-
d("[nylas-editor-tabs]", "configChangedHandler", t, this.selectedConfiguration), this.formState = {
|
|
159
|
-
...this.getFormStateFromConfig(t)
|
|
160
|
-
}, t.id ? this.action = "edit" : this.action = "create";
|
|
161
|
-
}
|
|
162
|
-
connectedCallback() {
|
|
163
|
-
d("[nylas-editor-tabs]", "connectedCallback");
|
|
164
|
-
}
|
|
165
|
-
componentWillLoad() {
|
|
166
|
-
d("[nylas-editor-tabs]", "componentWillLoad"), this.formState = this.getFormStateFromConfig(this.selectedConfiguration);
|
|
167
|
-
}
|
|
168
|
-
componentDidLoad() {
|
|
169
|
-
d("[nylas-editor-tabs]", "componentDidLoad");
|
|
170
|
-
}
|
|
171
|
-
disconnectedCallback() {
|
|
172
|
-
d("[nylas-editor-tabs]", "disconnectedCallback");
|
|
173
|
-
}
|
|
174
|
-
handleValueChanged(t) {
|
|
175
|
-
d("[nylas-editor-tabs]", "handleValueChanged", t);
|
|
176
|
-
const { name: e, value: a } = t.detail;
|
|
177
|
-
this.formState = { ...this.formState, [e]: a }, this.hasUnsavedChanges = !0, this.error = "";
|
|
178
|
-
}
|
|
179
|
-
getFormStateFromConfig(t) {
|
|
180
|
-
var a, s, o, i, l, r, b, u, f, h, m, g, _, v, C, p, x, S, L, B, c, w, k;
|
|
181
|
-
const e = (a = t == null ? void 0 : t.participants) == null ? void 0 : a.find((H) => H.is_organizer);
|
|
182
|
-
return {
|
|
183
|
-
title: ((s = t == null ? void 0 : t.event_booking) == null ? void 0 : s.title) ?? "",
|
|
184
|
-
description: ((o = t == null ? void 0 : t.event_booking) == null ? void 0 : o.description) ?? "",
|
|
185
|
-
duration: ((l = (i = t == null ? void 0 : t.availability) == null ? void 0 : i.duration_minutes) == null ? void 0 : l.toString()) ?? "30",
|
|
186
|
-
availability: {
|
|
187
|
-
timezone: ((r = t == null ? void 0 : t.event_booking) == null ? void 0 : r.timezone) ?? Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
188
|
-
openHours: (b = e == null ? void 0 : e.availability) == null ? void 0 : b.open_hours
|
|
189
|
-
},
|
|
190
|
-
calendarIds: ((u = e == null ? void 0 : e.availability) == null ? void 0 : u.calendar_ids) ?? [],
|
|
191
|
-
participants: (t == null ? void 0 : t.participants) ?? [],
|
|
192
|
-
bookingCalendar: ((f = e == null ? void 0 : e.booking) == null ? void 0 : f.calendar_id) ?? (e == null ? void 0 : e.email) ?? "",
|
|
193
|
-
location: ((h = t == null ? void 0 : t.event_booking) == null ? void 0 : h.location) ?? "",
|
|
194
|
-
bookingType: ((m = t == null ? void 0 : t.event_booking) == null ? void 0 : m.booking_type) ?? "booking",
|
|
195
|
-
buffer: ((_ = (g = t == null ? void 0 : t.availability) == null ? void 0 : g.availability_rules) == null ? void 0 : _.buffer) ?? { before: 0, after: 0 },
|
|
196
|
-
cancellationPolicy: ((v = t == null ? void 0 : t.scheduler) == null ? void 0 : v.cancellation_policy) ?? "",
|
|
197
|
-
availableDaysInFuture: ((C = t == null ? void 0 : t.scheduler) == null ? void 0 : C.available_days_in_future) ?? 30,
|
|
198
|
-
minCancellationNotice: ((p = t == null ? void 0 : t.scheduler) == null ? void 0 : p.min_cancellation_notice) ?? 0,
|
|
199
|
-
minBookingNotice: ((x = t == null ? void 0 : t.scheduler) == null ? void 0 : x.min_booking_notice) ?? 60,
|
|
200
|
-
timeslotInterval: {
|
|
201
|
-
interval: ((S = t == null ? void 0 : t.availability) == null ? void 0 : S.interval_minutes) ?? ((L = t == null ? void 0 : t.availability) == null ? void 0 : L.duration_minutes) ?? 10,
|
|
202
|
-
roundTo: (B = t == null ? void 0 : t.availability) == null ? void 0 : B.round_to
|
|
203
|
-
},
|
|
204
|
-
additionalGuestsHidden: ((c = t == null ? void 0 : t.scheduler) == null ? void 0 : c.hide_additional_guests) ?? !1,
|
|
205
|
-
hideCancellationOptions: ((w = t == null ? void 0 : t.scheduler) == null ? void 0 : w.hide_cancellation_options) ?? !1,
|
|
206
|
-
hideReschedulingOptions: ((k = t == null ? void 0 : t.scheduler) == null ? void 0 : k.hide_rescheduling_options) ?? !1
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
updateFormState() {
|
|
210
|
-
return new FormData(this.formRef).forEach((e, a) => {
|
|
211
|
-
switch (a) {
|
|
212
|
-
case "title":
|
|
213
|
-
this.formState.title = e.toString();
|
|
214
|
-
break;
|
|
215
|
-
case "description":
|
|
216
|
-
this.formState.description = e.toString();
|
|
217
|
-
break;
|
|
218
|
-
case "duration":
|
|
219
|
-
this.formState.duration = e.toString();
|
|
220
|
-
break;
|
|
221
|
-
case "availability":
|
|
222
|
-
this.formState.availability = JSON.parse(e.toString());
|
|
223
|
-
break;
|
|
224
|
-
case "participants":
|
|
225
|
-
this.formState.participants = JSON.parse(e.toString());
|
|
226
|
-
break;
|
|
227
|
-
case "calendars":
|
|
228
|
-
this.formState.calendarIds = e.toString().split(",");
|
|
229
|
-
break;
|
|
230
|
-
case "booking-calendar":
|
|
231
|
-
this.formState.bookingCalendar = e.toString();
|
|
232
|
-
break;
|
|
233
|
-
case "location":
|
|
234
|
-
this.formState.location = e.toString();
|
|
235
|
-
break;
|
|
236
|
-
case "booking-type":
|
|
237
|
-
this.formState.bookingType = e.toString();
|
|
238
|
-
break;
|
|
239
|
-
case "buffer-time":
|
|
240
|
-
this.formState.buffer = JSON.parse(e.toString());
|
|
241
|
-
break;
|
|
242
|
-
case "limit-future-bookings":
|
|
243
|
-
this.formState.availableDaysInFuture = parseInt(e.toString());
|
|
244
|
-
break;
|
|
245
|
-
case "min-cancellation-notice":
|
|
246
|
-
this.formState.minCancellationNotice = parseInt(e.toString());
|
|
247
|
-
break;
|
|
248
|
-
case "min-booking-notice":
|
|
249
|
-
this.formState.minBookingNotice = parseInt(e.toString());
|
|
250
|
-
break;
|
|
251
|
-
case "cancellation-policy":
|
|
252
|
-
this.formState.cancellationPolicy = e.toString();
|
|
253
|
-
break;
|
|
254
|
-
case "timeslot-interval":
|
|
255
|
-
this.formState.timeslotInterval = JSON.parse(e.toString());
|
|
256
|
-
break;
|
|
257
|
-
case "customize-booking-settings":
|
|
258
|
-
const s = JSON.parse(e.toString());
|
|
259
|
-
this.formState.additionalGuestsHidden = s.additionalGuestsHidden, this.formState.hideCancellationOptions = s.hideCancellationOptions, this.formState.hideReschedulingOptions = s.hideReschedulingOptions;
|
|
260
|
-
break;
|
|
261
|
-
}
|
|
262
|
-
}), this.formState = { ...this.formState }, this.formState;
|
|
263
|
-
}
|
|
264
|
-
setActiveTab(t, e) {
|
|
265
|
-
t.preventDefault(), this.updateFormState(), this.activeTab = e;
|
|
266
|
-
}
|
|
267
|
-
render() {
|
|
268
|
-
var e;
|
|
269
|
-
d("[nylas-editor-tabs]", "render", this.formState);
|
|
270
|
-
const t = localStorage.getItem("nylas") === "Nylas Developer";
|
|
271
|
-
return n(K, { key: "ed57de888af9f29e6be4562b8d65c9800a6b4ad9" }, n("form", { key: "5f3d154f95b47b78fe3cc83a76df4d7e39330f80", onSubmit: this.formSubmissionHandler, class: "scheduler-editor", ref: (a) => this.formRef = a, noValidate: !0 }, this.mode === "app" ? n("div", { class: "form-contents" }, n("div", { class: "tabs" }, n("button", { class: { tab: !0, active: this.activeTab == "eventInfo" }, onClick: (a) => this.setActiveTab(a, "eventInfo") }, n("calendar-info-icon", { width: "16", height: "16" }), "Event Info"), n("button", { class: { tab: !0, active: this.activeTab == "availability" }, onClick: (a) => this.setActiveTab(a, "availability") }, n("calendar-patterns-icon", { width: "16", height: "16" }), "Availability"), n("button", { class: { tab: !0, active: this.activeTab == "bookingOptions" }, onClick: (a) => this.setActiveTab(a, "bookingOptions") }, n("flow-icon", { width: "16", height: "16" }), "Booking Options"), t && n("button", { class: { tab: !0, active: this.activeTab == "participants" }, onClick: (a) => this.setActiveTab(a, "participants") }, n("people-icon", { width: "16", height: "16" }), "Participants")), n("div", { class: "tab-content" }, n(bt, { formState: this.formState, activeTab: this.activeTab, calendars: this.calendars, id: ((e = this.selectedConfiguration) == null ? void 0 : e.id) ?? "new" }))) : n("slot", null), n("div", { key: "c2a419fa59d6622e32627e476853ece732ff517c", class: "footer" }, n("div", { key: "b4eab68c7ee5d35aa1f9a77e0ef1c47d5080252a", class: "preview" }, this.schedulerPreviewLink !== "" && this.action === "edit" && n("button-component", { type: "button", disabled: this.isLoading, clickHandler: (a) => {
|
|
272
|
-
a.preventDefault(), this.previewButtonClicked.emit(this.host).defaultPrevented || window.open(q(this.schedulerPreviewLink, this.selectedConfiguration), "_blank");
|
|
273
|
-
}, variant: "basic" }, "Preview")), n("div", { key: "0d1be883712a43e918d6a24415309e7fca51ac6b", class: "buttons" }, n("p", { key: "e84e22ff1f71263e512ec95ee1513c53d4dadc10", class: {
|
|
274
|
-
"unsaved-changes": this.hasUnsavedChanges && !this.changesSaved,
|
|
275
|
-
"saved-changes": this.changesSaved,
|
|
276
|
-
error: this.error !== "",
|
|
277
|
-
"error-full-width": this.error !== "" && this.action === "create"
|
|
278
|
-
} }, this.error !== "" ? this.error : "", this.error == "" && this.hasUnsavedChanges && !this.changesSaved ? "Unsaved changes" : this.error == "" && this.changesSaved ? "Changes saved!" : ""), n("button-component", { key: "dd4e56935a6b20576b5316acb76947375084dfce", type: "button", disabled: this.isLoading, clickHandler: (a) => {
|
|
279
|
-
a.preventDefault(), this.cancelButtonClick.emit(), this.error = "";
|
|
280
|
-
}, variant: "basic" }, "Cancel"), n("button-component", { key: "16324ef17540626894bde0f55c1198d45ef0d0ce", type: "submit", disabled: this.isLoading }, this.isLoading ? n("span", null, "Saving", n("loading-icon", null), " ") : this.action == "create" ? "Create" : "Save changes")))));
|
|
281
|
-
}
|
|
282
|
-
get host() {
|
|
283
|
-
return Q(this);
|
|
284
|
-
}
|
|
285
|
-
static get watchers() {
|
|
286
|
-
return {
|
|
287
|
-
selectedConfiguration: ["configChangedHandler"]
|
|
288
|
-
};
|
|
289
|
-
}
|
|
290
|
-
};
|
|
291
|
-
pt([
|
|
292
|
-
X({
|
|
293
|
-
name: "nylas-editor-tabs",
|
|
294
|
-
stateToProps: /* @__PURE__ */ new Map([
|
|
295
|
-
["schedulerConfig.calendars", "calendars"],
|
|
296
|
-
["schedulerConfig.selectedConfiguration", "selectedConfiguration"],
|
|
297
|
-
["schedulerConfig.currentUser", "currentUser"]
|
|
298
|
-
]),
|
|
299
|
-
eventToProps: {
|
|
300
|
-
schedulerConfigChanged: async (t, e) => {
|
|
301
|
-
const { resetLoadingState: a, setError: s, action: o, config: i } = t.detail, l = (r) => {
|
|
302
|
-
const [b, u] = r;
|
|
303
|
-
!b && u && s && s(u), a && a(t);
|
|
304
|
-
};
|
|
305
|
-
if (o === "edit") {
|
|
306
|
-
const r = await e.schedulerConfig.updateConfiguration(i);
|
|
307
|
-
l(r);
|
|
308
|
-
} else {
|
|
309
|
-
const r = await e.schedulerConfig.createConfiguration(i);
|
|
310
|
-
l(r);
|
|
311
|
-
}
|
|
312
|
-
},
|
|
313
|
-
cancelButtonClick: async (t, e) => {
|
|
314
|
-
e.schedulerConfigStore.state.action = null;
|
|
315
|
-
},
|
|
316
|
-
previewButtonClicked: async (t, e) => {
|
|
317
|
-
d("[nylas-editor-tabs]", "previewButtonClicked", e);
|
|
318
|
-
},
|
|
319
|
-
formSubmitted: async (t, e) => {
|
|
320
|
-
d("[nylas-editor-tabs]", "formSubmitted", e);
|
|
321
|
-
}
|
|
322
|
-
},
|
|
323
|
-
localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
|
|
324
|
-
fireRegisterEvent: !0
|
|
325
|
-
}),
|
|
326
|
-
T("design:type", Function),
|
|
327
|
-
T("design:paramtypes", []),
|
|
328
|
-
T("design:returntype", void 0)
|
|
329
|
-
], Y.prototype, "render", null);
|
|
330
|
-
Y.style = ht;
|
|
331
|
-
const ft = ':host{display:grid;grid-auto-flow:row;width:100%;font-family:inherit;font-optical-sizing:auto;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.header{display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem;gap:1rem}@media screen and (max-width: 768px){.header{flex-direction:column;gap:0.5rem;align-items:unset}}.header h2{margin:0;font-size:1.25rem;color:var(--nylas-base-900);font-weight:600}.header p{margin:0;font-size:1rem;color:var(--nylas-base-700)}.header .actions{justify-self:end}@media screen and (max-width: 768px){.header .actions{width:100%}}.configurations{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);background:var(--nylas-base-0);height:100%;display:flex;overflow-y:auto}.configurations table{width:100%;border-spacing:0;border-collapse:collapse;font-family:inherit;height:max-content}.configurations table.no-configurations{height:100%}.configurations table tr{color:var(--nylas-base-800);border-bottom:1px solid var(--nylas-base-200);font-family:inherit}.configurations table tr:last-of-type{border-bottom:0}.configurations table tr.hide{display:none}.configurations table th{font-weight:600;text-transform:uppercase;font-size:14px;line-height:20px}.configurations table th.actions-header{text-align:right}.configurations table tr.no-configurations td>div{display:flex;height:100%;justify-content:center;align-items:center;flex-direction:column;padding:var(--nylas-border-radius-3x)}.configurations table tr.no-configurations td>div h3{margin:0 0 1rem 0;color:var(--nylas-base-700)}.configurations table tr.no-configurations td>div p{margin:0 0 1rem 0;color:var(--nylas-base-600)}.configurations table tr.no-configurations td>div calendar-icon{margin-bottom:1rem;color:var(--nylas-base-200)}.configurations table th,.configurations table td{text-align:left;padding:1rem;font-family:inherit}.configurations table .actions{text-align:right}.configurations table .actions{display:flex;justify-content:flex-end;gap:1rem}@media screen and (max-width: 768px){.configurations table .actions{flex-direction:column;gap:0.5rem}}.configurations table .title{display:flex;flex-direction:column}.configurations table .title .config-event-title{font-weight:600}.configurations table .title .config-event-description{font-size:0.75rem}.error-container{margin-top:1.5rem}.error-container .error{color:var(--nylas-error);padding:0.5rem 0;margin:1rem 0 0}button-component#copy button{width:108px}', yt = ft;
|
|
332
|
-
var mt = function(t, e, a, s) {
|
|
333
|
-
var o = arguments.length, i = o < 3 ? e : s === null ? s = Object.getOwnPropertyDescriptor(e, a) : s, l;
|
|
334
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
335
|
-
i = Reflect.decorate(t, e, a, s);
|
|
336
|
-
else
|
|
337
|
-
for (var r = t.length - 1; r >= 0; r--)
|
|
338
|
-
(l = t[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(e, a, i) : l(e, a)) || i);
|
|
339
|
-
return o > 3 && i && Object.defineProperty(e, a, i), i;
|
|
340
|
-
}, I = function(t, e) {
|
|
341
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
342
|
-
return Reflect.metadata(t, e);
|
|
343
|
-
};
|
|
344
|
-
const tt = class {
|
|
345
|
-
constructor(t) {
|
|
346
|
-
D(this, t), this.initListConfigurations = y(this, "initListConfigurations", 7), this.createButtonClick = y(this, "createButtonClick", 7), this.editButtonClick = y(this, "editButtonClick", 7), this.deleteButtonClick = y(this, "deleteButtonClick", 7), this.configurations = [], this.schedulerPreviewLink = "", this.state = "loading", this.error = "", this.copiedButtonIndex = -1;
|
|
347
|
-
}
|
|
348
|
-
connectedCallback() {
|
|
349
|
-
d("[nylas-list-configurations]", "connectedCallback");
|
|
350
|
-
}
|
|
351
|
-
componentWillLoad() {
|
|
352
|
-
d("[nylas-list-configurations]", "componentWillLoad"), this.configurations && this.configurations.length > 0 && (this.state = "loaded");
|
|
353
|
-
}
|
|
354
|
-
componentDidLoad() {
|
|
355
|
-
d("[nylas-list-configurations]", "componentDidLoad"), this.initListConfigurations.emit(this.host);
|
|
356
|
-
}
|
|
357
|
-
disconnectedCallback() {
|
|
358
|
-
d("[nylas-list-configurations]", "disconnectedCallback");
|
|
359
|
-
}
|
|
360
|
-
async getState() {
|
|
361
|
-
return this.state;
|
|
362
|
-
}
|
|
363
|
-
async setState(t) {
|
|
364
|
-
this.state = t;
|
|
365
|
-
}
|
|
366
|
-
async setError(t) {
|
|
367
|
-
this.error = t;
|
|
368
|
-
}
|
|
369
|
-
getDurationString(t) {
|
|
370
|
-
const e = Math.floor(t / 60), a = t % 60;
|
|
371
|
-
return `${e || ""} ${e ? `${e > 1 ? "hours" : "hour"}` : ""} ${a || ""} ${a ? `${a > 1 ? "mins" : "min"}` : ""}`;
|
|
372
|
-
}
|
|
373
|
-
render() {
|
|
374
|
-
return n(K, null, n("div", { class: "header" }, n("div", { class: "description" }, n("h2", null, "All scheduling pages"), n("p", null, "Create, edit and manage all your scheduling pages.")), this.configurations && this.configurations.length > 0 && n("div", { class: "actions" }, n("button-component", { clickHandler: () => {
|
|
375
|
-
this.createButtonClick.emit(this.host);
|
|
376
|
-
} }, "Create new"))), n("div", { class: "configurations" }, n("table", { class: {
|
|
377
|
-
"no-configurations": this.state !== "loading" && (!this.configurations || this.configurations.length === 0)
|
|
378
|
-
} }, n("tr", { class: {
|
|
379
|
-
hide: this.state === "loading" || this.configurations && this.configurations.length === 0
|
|
380
|
-
} }, n("th", null, "Scheduling page title"), n("th", null, "Duration"), n("th", { class: "actions-header" }, "Actions")), this.state === "loading" && n("tr", { class: "no-configurations" }, n("td", { colSpan: 3 }, n("div", null, n("h3", null, "Loading..."), n("p", null, "Please wait while we fetch the scheduling pages")))), this.state !== "loading" && (!this.configurations || this.configurations.length === 0) && n("tr", { class: "no-configurations" }, n("td", { colSpan: 3 }, n("div", null, n("calendar-icon", { width: "48", height: "48" }), n("h3", null, "No scheduling pages found"), n("p", null, "Get started with creating your first scheduling page"), n("button-component", { clickHandler: () => {
|
|
381
|
-
this.createButtonClick.emit(this.host);
|
|
382
|
-
} }, "Create new")))), this.state !== "loading" && this.configurations.map((t, e) => n("tr", { key: t.id }, n("td", null, n("div", { class: "title" }, n("span", { class: "config-event-title" }, t.event_booking.title), n("span", { class: "config-event-description" }, t.event_booking.description))), n("td", null, n("div", null, this.getDurationString(t.availability.duration_minutes))), n("td", null, n("div", { class: "actions" }, n("button-component", { variant: "basic", id: "copy", key: `copy-${e}`, clickHandler: async (a) => {
|
|
383
|
-
a.preventDefault();
|
|
384
|
-
const s = q(this.schedulerPreviewLink, t);
|
|
385
|
-
await navigator.clipboard.writeText(s), this.copiedButtonIndex = e, setTimeout(() => {
|
|
386
|
-
this.copiedButtonIndex = -1;
|
|
387
|
-
}, 3e3);
|
|
388
|
-
} }, this.copiedButtonIndex === e ? "Copied!" : "Copy link"), n("button-component", { variant: "basic", key: `edit-${e}`, clickHandler: (a) => {
|
|
389
|
-
a.preventDefault(), this.editButtonClick.emit({ host: this.host, configuration: t });
|
|
390
|
-
} }, "Edit"), n("button-component", { variant: "basic", key: `delete-${e}`, clickHandler: (a) => {
|
|
391
|
-
a.preventDefault(), this.deleteButtonClick.emit({ host: this.host, configuration: t });
|
|
392
|
-
} }, "Delete"))))))), this.state === "error" && n("div", { class: "error-container" }, n("p", { class: "error" }, this.error)));
|
|
393
|
-
}
|
|
394
|
-
get host() {
|
|
395
|
-
return Q(this);
|
|
396
|
-
}
|
|
397
|
-
};
|
|
398
|
-
mt([
|
|
399
|
-
X({
|
|
400
|
-
name: "nylas-list-configurations",
|
|
401
|
-
stateToProps: /* @__PURE__ */ new Map([["schedulerConfig.configurations", "configurations"]]),
|
|
402
|
-
localPropsToProp: /* @__PURE__ */ new Map([["schedulerPreviewLink", "schedulerPreviewLink"]]),
|
|
403
|
-
eventToProps: {
|
|
404
|
-
initListConfigurations: async (t, e) => {
|
|
405
|
-
const a = t.detail;
|
|
406
|
-
await a.setState("loading");
|
|
407
|
-
const [s, o] = await e.schedulerConfig.getConfigurations();
|
|
408
|
-
if (!s && o && o.message) {
|
|
409
|
-
await a.setState("error"), await a.setError(o.message);
|
|
410
|
-
return;
|
|
411
|
-
}
|
|
412
|
-
await a.setState("loaded");
|
|
413
|
-
},
|
|
414
|
-
createButtonClick: async (t, e) => {
|
|
415
|
-
e.schedulerConfigStore.resetSelectedConfiguration(), e.schedulerConfigStore.state.action = "create";
|
|
416
|
-
},
|
|
417
|
-
deleteButtonClick: async (t, e) => {
|
|
418
|
-
const { host: a, configuration: s } = t.detail, [o, i] = await e.schedulerConfig.deleteConfiguration(s.id);
|
|
419
|
-
!o && i && i.message && (await a.setState("error"), await a.setError(i.message));
|
|
420
|
-
},
|
|
421
|
-
editButtonClick: async (t, e) => {
|
|
422
|
-
const { configuration: a } = t.detail;
|
|
423
|
-
e.schedulerConfigStore.state.selectedConfiguration = a, e.schedulerConfigStore.state.action = "edit";
|
|
424
|
-
}
|
|
425
|
-
},
|
|
426
|
-
fireRegisterEvent: !0
|
|
427
|
-
}),
|
|
428
|
-
I("design:type", Function),
|
|
429
|
-
I("design:paramtypes", []),
|
|
430
|
-
I("design:returntype", void 0)
|
|
431
|
-
], tt.prototype, "render", null);
|
|
432
|
-
tt.style = yt;
|
|
433
|
-
export {
|
|
434
|
-
rt as google_logo_icon,
|
|
435
|
-
ct as microsoft_logo_icon,
|
|
436
|
-
Y as nylas_editor_tabs,
|
|
437
|
-
tt as nylas_list_configurations
|
|
438
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const s=require("./index-f435e814.cjs");var e=s.commonjsGlobal.process;exports.process=e;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-f435e814.cjs");require("react");require("react-dom");const p=':host{display:block;position:relative;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}@media screen and (max-width: 768px){:host{position:unset}}.dropdown{display:inline-block}.dropbtn{color:var(--nylas-base-800);padding:10px;font-size:1rem;font-family:var(--nylas-font-family);cursor:pointer;display:flex;gap:0.5rem;background:transparent;border:none;border-radius:var(--nylas-border-radius-2x);width:50px;padding:14px 16px;border-radius:var(--nylas-border-radius-2x)}.dropbtn.focus{background:transparent}.dropbtn:hover,.dropbtn:active{outline:1px solid var(--nylas-primary)}.dropbtn:active{outline:2px solid var(--nylas-primary)}.dropbtn span.chevron{display:flex;align-self:center}.dropbtn span.open{transform:rotate(90deg)}.dropbtn span.closed{transform:rotate(270deg)}.dropbtn span.selected-option{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:144px;font-size:14px;line-height:20px}@media screen and (max-width: 768px){.dropbtn span.selected-option{max-width:124px;font-size:16px}}.dropdown-content{display:block;margin-top:0.5rem;background-color:var(--nylas-base-0);max-width:306px;width:max-content;max-height:336px;overflow:auto;z-index:1;border-radius:4px;position:absolute;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.05);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1)}@media screen and (max-width: 768px){.dropdown-content{right:0;width:325px;max-width:unset}}.search-box{border-bottom:1px solid var(--nylas-base-200);padding:10px;position:sticky;top:0;background:var(--nylas-base-0)}.search-box .icon{position:absolute;top:1.25rem;left:1.25rem;color:var(--nylas-base-300)}.dropdown-content ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px}.dropdown-content ul li{padding:16px, 12px, 16px, 12px;color:black;padding:12px 16px;text-decoration:none;display:block;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:left;cursor:pointer}.dropdown-content ul li:hover,.dropdown-content ul li:focus{background-color:var(--nylas-base-100)}.dropdown-content .selected{background-color:#e7e7e7}input[type=text]{width:-webkit-fill-available;padding:inherit;border:1px solid #ccc;border-radius:4px;position:sticky;background:no-repeat scroll 7px 7px;padding-left:30px;background-size:16px 16px}',c=p,a=class{constructor(e){n.registerInstance(this,e),this.inputOptionChanged=n.createEvent(this,"inputOptionChanged",7),this.name=void 0,this.options=[],this.defaultInputOption=void 0,this.inputValue=void 0,this.pluralizedLabel="",this.selectedOption=this.defaultInputOption||null,this.isOpen=!1,this.filteredOptions=[...this.options],this.ariaActivedescendant="",this.shouldAutoScroll=!1}optionsChangedHandler(e,t){e!==t&&(this.filteredOptions=e)}defaultSelectedOptionChangedHandler(e,t){e.label!==t.label&&(this.selectedOption=e)}inputValueChangedHandler(e,t){e!==t&&(this.inputValue=e)}componentWillLoad(){this.filteredOptions=this.options,!this.selectedOption&&this.defaultInputOption&&(this.selectedOption=this.defaultInputOption),!this.selectedOption&&this.options.length>0&&(this.selectedOption=this.options[0])}toggleDropdown(){this.isOpen=!this.isOpen}selectOption(e){this.selectedOption=e,this.toggleDropdown(),this.inputOptionChanged.emit({value:e.value,name:this.name})}handleOnInput(e){const t=e.target.value,i=this.options.findIndex(o=>o.label.toLowerCase().includes(t.toLowerCase()));i>-1&&this.scrollToViewWithinParent(i),this.inputOptionChanged.emit({value:t,name:this.name})}scrollToViewWithinParent(e){var d;const t=this.options[e],i=(d=this.el.shadowRoot)==null?void 0:d.getElementById(t.value.toString()),o=this.optionsRef;this.ariaActivedescendant=t.value.toString();const r=i.getBoundingClientRect(),s=o.getBoundingClientRect();r.top<s.top?o.scrollTop-=s.top-r.top:r.bottom>s.bottom&&(o.scrollTop+=r.bottom-s.bottom)}handleSelectButtonKeyDown(e){var t;switch(e.key){case"ArrowDown":case"Enter":e.preventDefault(),this.isOpen||this.toggleDropdown(),(t=this.inputRef)==null||t.focus();break;case"Escape":this.isOpen=!1;break}}handleClick(e){if(this.isOpen){const t=e.target.value,i=this.options.findIndex(o=>o.label.toLowerCase().includes(t.toLowerCase()));i>-1&&setTimeout(()=>{this.scrollToViewWithinParent(i)},10)}}handleListboxKeydown(e){var o,r;const t=this.filteredOptions,i=t.findIndex(s=>s.value===this.ariaActivedescendant);if(e.key==="ArrowDown"||e.key==="Tab"&&!e.shiftKey){if(e.preventDefault(),i===t.length-1){this.ariaActivedescendant="",(o=this.inputRef)==null||o.focus();return}const s=i+1<t.length?i+1:0;this.ariaActivedescendant=t[s].value,this.focusOption(s)}else if(e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey){if(e.preventDefault(),i===0){this.ariaActivedescendant="",(r=this.inputRef)==null||r.focus();return}const s=i-1>=0?i-1:t.length-1;this.ariaActivedescendant=t[s].value,this.focusOption(s)}else e.key==="Enter"?(e.preventDefault(),this.ariaActivedescendant&&this.selectOption(t[i])):e.key==="Escape"&&(this.isOpen=!1)}focusOption(e){var r;const t=this.filteredOptions[e];if(!t)return;const i=t.value,o=(r=this.el.shadowRoot)==null?void 0:r.getElementById(i);o&&(o.focus(),o.scrollIntoView({behavior:"smooth",block:"nearest"}))}handleComboboxKeyDown(e){if(e.key==="ArrowDown"||e.key=="Tab"&&!e.shiftKey){if(e.preventDefault(),!this.isOpen){this.isOpen=!0,this.shouldAutoScroll=!0;return}this.ariaActivedescendant=this.filteredOptions[0].value,this.focusOption(0)}else e.key==="ArrowUp"||e.key==="Tab"&&e.shiftKey?(e.preventDefault(),this.ariaActivedescendant=this.filteredOptions[this.filteredOptions.length-1].value,this.focusOption(this.filteredOptions.length-1)):e.key==="Escape"&&(this.isOpen=!1)}handleOutsideClick(e){!e.composedPath().includes(this.el)&&this.isOpen&&(this.isOpen=!1)}render(){return n.h("div",{key:"24c46ff43e7ff2701790b5e7cd69833a4c0fa02f",class:"dropdown",part:"id_dropdown"},n.h("input",{key:"86724f295c643d3edda0de987b17f85389a0a716",type:"text",name:this.name,id:this.name,part:"id_dropdown-input",class:{dropbtn:!0,open:this.isOpen},value:this.inputValue,onClick:e=>{this.toggleDropdown(),this.shouldAutoScroll=!0,this.handleClick(e)},"aria-haspopup":"listbox","aria-label":this.name,"aria-expanded":this.isOpen?"true":"false",onKeyDown:e=>this.handleComboboxKeyDown(e),onInput:e=>this.handleOnInput(e)}),this.isOpen?n.h("div",{class:"dropdown-content",part:"id_dropdown-content",ref:e=>this.optionsRef=e},n.h("ul",{tabindex:"-1",role:"listbox","aria-label":this.name,"aria-activedescendant":this.ariaActivedescendant,onKeyDown:e=>this.handleListboxKeydown(e)},this.filteredOptions.map(e=>n.h("li",{tabindex:"0",key:e.value,id:e.value,onClick:()=>this.selectOption(e),role:"option",class:{focused:this.ariaActivedescendant===e.value.toString()}},e.labelHTML?e.labelHTML:e.label)))):null)}get el(){return n.getElement(this)}static get watchers(){return{options:["optionsChangedHandler"],defaultInputOption:["defaultSelectedOptionChangedHandler"],inputValue:["inputValueChangedHandler"]}}};a.style=c;const h=".time-period-selector.sc-time-period-selector{display:grid;gap:0.5rem;grid-template-columns:auto 1fr}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector,.time-period-selector.sc-time-period-selector input-dropdown.sc-time-period-selector{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector{width:116px}.time-period-selector.sc-time-period-selector input-dropdown.sc-time-period-selector{width:84px;display:flex;align-items:center}.time-period-selector.sc-time-period-selector select-dropdown#time-period.sc-time-period-selector::part(sd_dropdown-button){width:100%}.time-period-selector.sc-time-period-selector input-dropdown.sc-time-period-selector::part(id_dropdown){width:inherit;height:100%}.time-period-selector.sc-time-period-selector input-dropdown#time-number.sc-time-period-selector::part(id_dropdown-input){border:none;border-radius:var(--nylas-border-radius-2x)}.time-period-selector.sc-time-period-selector input-dropdown.sc-time-period-selector::part(id_dropdown-input){padding:17px;gap:1rem}.time-period-selector.sc-time-period-selector input-dropdown.sc-time-period-selector::part(id_dropdown-content){width:100%;max-height:200px}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector::part(sd_dropdown){width:inherit}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector::part(sd_dropdown-button){padding:1rem;gap:1rem;justify-content:space-between}.time-period-selector.sc-time-period-selector select-dropdown.sc-time-period-selector::part(sd_dropdown-content){width:100%;max-height:200px}",u=h,m={hours:"hour",days:"day",weeks:"week",months:"month"},l=class{constructor(e){n.registerInstance(this,e),this.timePeriodChanged=n.createEvent(this,"timePeriodChanged",7),this.timePeriods=["hour","day","week","month"],this.defaultSelectedPeriod="hour",this.defaultSelectedNumber=1,this.selectedPeriod=this.defaultSelectedPeriod,this.selectedNumber=this.defaultSelectedNumber,this.numberOptions=this.calculateOptions(this.defaultSelectedPeriod||"hour").map(t=>({label:t.toString(),value:t.toString()})),this.timePeriodOptions=this.timePeriods.map(t=>({label:t,value:t}))}defaultSelectedPeriodChangedHandler(e){this.selectedPeriod=e;const t=m[e]??e;this.updateNumberOptionsAndSelectedNumber(t)}defaultSelectedNumberChangedHandler(e){this.selectedNumber=e}timePeriodsChangedHandler(e){this.timePeriodOptions=e.map(t=>({label:t,value:t}))}calculateOptions(e){switch(e){case"hour":return Array.from({length:23},(t,i)=>i+1);case"minute":return Array.from({length:13},(t,i)=>i*5);case"day":return Array.from({length:30},(t,i)=>i+1);case"week":return Array.from({length:4},(t,i)=>i+1);case"month":return Array.from({length:12},(t,i)=>i+1);default:return[]}}inputOptionChangedHandler(e){n.debug("time-period-selector","inputOptionChangedHandler",e.detail);const{value:t,name:i}=e.detail;i==="time-number"&&(this.selectedNumber=parseInt(t));const o={number:this.selectedNumber,period:this.selectedPeriod};this.timePeriodChanged.emit(o)}nylasFormDropdownChangedHandler(e){n.debug("time-period-selector","nylasFormDropdownChangedHandler",e.detail);const{value:t,name:i}=e.detail;i==="time-period"?(this.selectedPeriod=t,this.updateNumberOptionsAndSelectedNumber(t)):i==="time-number"&&(this.selectedNumber=parseInt(t));const o={number:this.selectedNumber,period:this.selectedPeriod};this.timePeriodChanged.emit(o)}updateNumberOptionsAndSelectedNumber(e){const t=this.calculateOptions(e);this.numberOptions=t.map(i=>({label:i.toString(),value:i.toString()})),this.selectedNumber=parseInt(this.numberOptions[0].value)}render(){return n.h("div",{key:"89f218f22905064cadac4d109b631ec138b461ef",class:"time-period-selector"},n.h("input-dropdown",{key:"2b86597d92716df5196e696a82ef813d895688dc",id:"time-number",name:"time-number",inputValue:this.selectedNumber.toString(),exportparts:"sd_dropdown: tps__number-dropdown, sd_dropdown-button: tps__number-dropdown-button, sd_dropdown-content: tps__number-dropdown-content",options:this.numberOptions,defaultInputOption:this.numberOptions.find(e=>e.value==this.selectedNumber.toString())??this.numberOptions[0]}),n.h("select-dropdown",{key:"7283a087443a6c3827f41f0276e1c8024025eeca",id:"time-period",name:"time-period",options:this.timePeriodOptions,exportparts:"sd_dropdown: tps__period-dropdown, sd_dropdown-button: tps__period-dropdown-button, sd_dropdown-content: tps__period-dropdown-content",pluralizedLabel:this.selectedNumber>1?"s":"",defaultSelectedOption:this.timePeriodOptions.find(e=>e.value==this.selectedPeriod)??this.timePeriodOptions[0],withSearch:!1}))}get host(){return n.getElement(this)}static get watchers(){return{defaultSelectedPeriod:["defaultSelectedPeriodChangedHandler"],defaultSelectedNumber:["defaultSelectedNumberChangedHandler"],timePeriods:["timePeriodsChangedHandler"]}}};l.style=u;exports.input_dropdown=a;exports.time_period_selector=l;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { r as a, h as e } from "./index-f383e3c4.js";
|
|
2
|
-
import "react";
|
|
3
|
-
import "react-dom";
|
|
4
|
-
const i = ".wave{display:flex;align-items:center;justify-content:center}.dot{width:4px;height:4px;background-color:var(--dot-color, white);border-radius:50%;margin:0 2px;animation:wave 1.5s infinite ease-in-out}.dot:nth-child(2){animation-delay:0.2s}.dot:nth-child(3){animation-delay:0.4s}@keyframes wave{0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-4px)}}", n = i, o = class {
|
|
5
|
-
constructor(t) {
|
|
6
|
-
a(this, t), this.width = "15", this.height = "15";
|
|
7
|
-
}
|
|
8
|
-
render() {
|
|
9
|
-
return e("div", { key: "451777deed2c5b92613340e5c49f2b88f3149ddb", class: "wave" }, e("div", { key: "257478c933368a352a8e24e989f00f68157dc7f5", class: "dot" }), e("div", { key: "ab49e532f4228f89de93b7486ff905762a7f1e95", class: "dot" }), e("div", { key: "61a94bdcc940aec78fc5f3379be7085ee003d96a", class: "dot" }));
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
o.style = n;
|
|
13
|
-
export {
|
|
14
|
-
o as loading_icon
|
|
15
|
-
};
|