@nylas/react 1.0.2-canary.0 → 1.0.2-canary.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/add-circle-icon_18.entry-b66b6343.cjs +1 -0
- package/dist/add-circle-icon_18.entry-f86ae88d.js +1527 -0
- package/dist/{archive-icon_7.entry-0deb31c2.cjs → archive-icon_7.entry-052ac074.cjs} +1 -1
- package/dist/{archive-icon_7.entry-187a3484.js → archive-icon_7.entry-0e34d6e7.js} +17 -17
- package/dist/arrow-icon.entry-2afd9ea9.js +15 -0
- package/dist/{arrow-icon.entry-fb0ebc89.cjs → arrow-icon.entry-93f21385.cjs} +1 -1
- package/dist/{auth-store-764d3768-ce84fc6a.cjs → auth-store-69ac49c7-5a0bbb90.cjs} +1 -1
- package/dist/{auth-store-764d3768-3e9c24a0.js → auth-store-69ac49c7-cbfda055.js} +2 -2
- package/dist/{bold-icon_3.entry-8aebbbdb.js → bold-icon_3.entry-88ce1d25.js} +8 -8
- package/dist/bold-icon_3.entry-8f55a9e7.cjs +1 -0
- package/dist/{calendar-cancel-icon.entry-3f4d6cf2.cjs → calendar-cancel-icon.entry-574c8aa4.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-305c099c.js → calendar-cancel-icon.entry-e9c692fa.js} +5 -5
- package/dist/{calendar-check-icon_2.entry-fa7c033a.cjs → calendar-check-icon_2.entry-b0476bca.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-1bf4163c.js → calendar-check-icon_2.entry-d461c713.js} +7 -7
- package/dist/{calendar-icon.entry-b5678535.js → calendar-icon.entry-1ca202a4.js} +4 -4
- package/dist/{calendar-icon.entry-78433555.cjs → calendar-icon.entry-98936e6d.cjs} +1 -1
- package/dist/chevron-icon_3.entry-830f52c2.js +105 -0
- package/dist/chevron-icon_3.entry-f7801467.cjs +1 -0
- package/dist/close-icon.entry-37e8361f.js +15 -0
- package/dist/close-icon.entry-8d6e9816.cjs +1 -0
- package/dist/{constants-d93cf397-e3587f5c.cjs → constants-b6bf6671-27e2557d.cjs} +4 -4
- package/dist/{constants-d93cf397-dd67263d.js → constants-b6bf6671-49a0f1f2.js} +464 -442
- package/dist/{document-refresh-icon.entry-8791ab16.js → document-refresh-icon.entry-faea08ce.js} +2 -2
- package/dist/document-refresh-icon.entry-fcb33921.cjs +1 -0
- package/dist/elements/index.d.ts +9 -3
- package/dist/{forward-icon_6.entry-cb605bfc.js → forward-icon_6.entry-8da1f65d.js} +10 -10
- package/dist/{forward-icon_6.entry-903ccd33.cjs → forward-icon_6.entry-c4b37cb1.cjs} +2 -2
- package/dist/globe-icon.entry-4720304b.js +15 -0
- package/dist/globe-icon.entry-90a0b9c9.cjs +1 -0
- package/dist/{index-10914bc1-1a809477.js → index-10914bc1-346f04fa.js} +3 -3
- package/dist/{index-10914bc1-93ff6f46.cjs → index-10914bc1-c8c3a2f3.cjs} +1 -1
- package/dist/index-457dcf0b.cjs +30 -0
- package/dist/index-ce40ad47.js +1570 -0
- package/dist/info-icon_2.entry-81e95048.cjs +1 -0
- package/dist/info-icon_2.entry-9307db18.js +34 -0
- package/dist/loading-icon.entry-06d37ef0.cjs +1 -0
- package/dist/loading-icon.entry-dc518df4.js +15 -0
- package/dist/{mailbox-store-6b9425dc-a0366cf2.cjs → mailbox-store-e721b17c-4e97e07d.cjs} +1 -1
- package/dist/{mailbox-store-6b9425dc-c249fa99.js → mailbox-store-e721b17c-cf9a43dd.js} +2 -2
- package/dist/nylas-additional-participants.entry-1653dec7.js +83 -0
- package/dist/nylas-additional-participants.entry-ff8bf378.cjs +1 -0
- package/dist/nylas-booked-event-card_10.entry-06bc3c51.cjs +1 -0
- package/dist/nylas-booked-event-card_10.entry-aa971e8a.js +784 -0
- package/dist/nylas-editor-tabs.entry-49b5a3ab.cjs +1 -0
- package/dist/nylas-editor-tabs.entry-9d0959bf.js +181 -0
- package/dist/nylas-form-card.entry-69d2095b.cjs +1 -0
- package/dist/nylas-form-card.entry-c4e78f88.js +56 -0
- package/dist/{nylas-if-state_3.entry-e7b615a1.js → nylas-if-state_3.entry-2eb3f385.js} +8 -8
- package/dist/{nylas-if-state_3.entry-2093c593.cjs → nylas-if-state_3.entry-5baf6d6f.cjs} +1 -1
- package/dist/{nylas-list-folders.entry-dff7a835.cjs → nylas-list-folders.entry-3b24d92d.cjs} +1 -1
- package/dist/{nylas-list-folders.entry-744293ae.js → nylas-list-folders.entry-995fa819.js} +4 -4
- package/dist/{nylas-list-threads.entry-85ad1b74.js → nylas-list-threads.entry-21466eb3.js} +6 -6
- package/dist/{nylas-list-threads.entry-edb1d265.cjs → nylas-list-threads.entry-fda42ded.cjs} +1 -1
- package/dist/{nylas-mailbox-pagination.entry-55ef4b8c.js → nylas-mailbox-pagination.entry-02d40186.js} +3 -3
- package/dist/{nylas-mailbox-pagination.entry-5b888a0e.cjs → nylas-mailbox-pagination.entry-9dcd4901.cjs} +1 -1
- package/dist/{nylas-mailbox-toolbar-button.entry-bb42156a.cjs → nylas-mailbox-toolbar-button.entry-d1099fab.cjs} +1 -1
- package/dist/{nylas-mailbox-toolbar-button.entry-bdcf7d17.js → nylas-mailbox-toolbar-button.entry-dbad44b4.js} +9 -9
- package/dist/{nylas-provider.entry-cb1ef04e.cjs → nylas-provider.entry-78e2fa30.cjs} +1 -1
- package/dist/{nylas-provider.entry-1dc58829.js → nylas-provider.entry-bbee8c99.js} +8 -8
- package/dist/nylas-scheduler-editor.entry-550d3c59.cjs +1 -0
- package/dist/{nylas-scheduler-config.entry-2382ac1b.js → nylas-scheduler-editor.entry-8f7ecf3b.js} +32 -35
- package/dist/nylas-scheduling.entry-22b5ad07.js +236 -0
- package/dist/nylas-scheduling.entry-30a63738.cjs +1 -0
- package/dist/{nylas-threads-refresh.entry-b35f1b68.cjs → nylas-threads-refresh.entry-05258b36.cjs} +1 -1
- package/dist/{nylas-threads-refresh.entry-ef5d6dfd.js → nylas-threads-refresh.entry-414d8740.js} +12 -12
- package/dist/{nylas-threads-search.entry-e570bf8e.js → nylas-threads-search.entry-a19dc90f.js} +8 -8
- package/dist/{nylas-threads-search.entry-2dda7524.cjs → nylas-threads-search.entry-ff21fc65.cjs} +1 -1
- package/dist/{nylas-view-thread.entry-3939c913.js → nylas-view-thread.entry-38149162.js} +4 -4
- package/dist/{nylas-view-thread.entry-1ee0680f.cjs → nylas-view-thread.entry-5da81e99.cjs} +1 -1
- package/dist/{people-icon.entry-4a88822e.cjs → people-icon.entry-4b682757.cjs} +1 -1
- package/dist/{people-icon.entry-69465395.js → people-icon.entry-5c244c8d.js} +6 -6
- package/dist/play-icon_2.entry-ccdc6b9c.cjs +1 -0
- package/dist/play-icon_2.entry-f36d6d55.js +25 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +70 -64
- package/dist/{refresh-icon.entry-678f92e7.cjs → refresh-icon.entry-59fff3d4.cjs} +1 -1
- package/dist/{refresh-icon.entry-bd2bf7ce.js → refresh-icon.entry-63456c9a.js} +4 -4
- package/dist/{register-component-486ea571-cdfe1ef9.cjs → register-component-d056a880-2be11c56.cjs} +1 -1
- package/dist/{register-component-486ea571-1f151779.js → register-component-d056a880-f3003d6c.js} +2 -2
- package/dist/{scheduler-config-store-a059f30b-06c1aa21.cjs → scheduler-config-store-4d035001-0256b40c.cjs} +1 -1
- package/dist/{scheduler-config-store-a059f30b-ff3efc00.js → scheduler-config-store-4d035001-db9dc78a.js} +1 -1
- package/dist/{scheduler-store-81058220-263a5f44.js → scheduler-store-0fbe642c-14466305.js} +85 -89
- package/dist/scheduler-store-0fbe642c-410fdbf4.cjs +1 -0
- package/dist/{translate-icon.entry-0c0dbba6.cjs → translate-icon.entry-1784c18e.cjs} +1 -1
- package/dist/{translate-icon.entry-c1fcd2f8.js → translate-icon.entry-35999e70.js} +2 -2
- package/dist/{utils-df5c1963-d9833bcb.js → utils-0cd66d04-89ab163d.js} +98 -101
- package/dist/{utils-df5c1963-1c47e21c.cjs → utils-0cd66d04-94b9c3b6.cjs} +5 -5
- package/dist/{warning-icon.entry-dbd44cdb.cjs → warning-icon.entry-3a702d1d.cjs} +1 -1
- package/dist/warning-icon.entry-73de08c3.js +15 -0
- package/package.json +4 -4
- package/dist/add-circle-icon_13.entry-6dccb5e5.cjs +0 -1
- package/dist/add-circle-icon_13.entry-ab84be80.js +0 -1050
- package/dist/arrow-icon.entry-b782e05a.js +0 -15
- package/dist/bold-icon_3.entry-49e5a1d0.cjs +0 -1
- package/dist/chevron-icon.entry-49b0d3e7.cjs +0 -1
- package/dist/chevron-icon.entry-f484c9a3.js +0 -15
- package/dist/close-icon.entry-24d5c268.js +0 -15
- package/dist/close-icon.entry-37965d55.cjs +0 -1
- package/dist/document-refresh-icon.entry-0e8935fa.cjs +0 -1
- package/dist/duration-bddc4a13-05d3e3e2.cjs +0 -1
- package/dist/duration-bddc4a13-179ce826.js +0 -41
- package/dist/globe-icon_3.entry-71d83904.js +0 -109
- package/dist/globe-icon_3.entry-c6aefc52.cjs +0 -1
- package/dist/index-cee193d2.cjs +0 -30
- package/dist/index-e834697b.js +0 -1562
- package/dist/info-icon.entry-3774a4e3.js +0 -15
- package/dist/info-icon.entry-85bf3fbc.cjs +0 -1
- package/dist/loading-icon.entry-8941102c.js +0 -15
- package/dist/loading-icon.entry-ae6c7b74.cjs +0 -1
- package/dist/nylas-booked-event-card_10.entry-a166d51d.js +0 -739
- package/dist/nylas-booked-event-card_10.entry-b181a874.cjs +0 -1
- package/dist/nylas-form-card.entry-7173dd4a.js +0 -56
- package/dist/nylas-form-card.entry-8fdbefa6.cjs +0 -1
- package/dist/nylas-open-hours-picker.entry-0f4f34f6.cjs +0 -1
- package/dist/nylas-open-hours-picker.entry-7e7060fe.js +0 -187
- package/dist/nylas-scheduler-config.entry-477d2171.cjs +0 -1
- package/dist/nylas-scheduler-editor.entry-1a95d313.cjs +0 -1
- package/dist/nylas-scheduler-editor.entry-c0479087.js +0 -140
- package/dist/nylas-scheduler.entry-69ecc3ae.cjs +0 -1
- package/dist/nylas-scheduler.entry-7084c148.js +0 -231
- package/dist/play-icon_2.entry-bc24fda7.js +0 -25
- package/dist/play-icon_2.entry-bd9f650e.cjs +0 -1
- package/dist/scheduler-store-81058220-a20698af.cjs +0 -1
- package/dist/warning-icon.entry-9631cd2e.js +0 -15
|
@@ -1,1050 +0,0 @@
|
|
|
1
|
-
import { r as u, h as s, c as K, H as E, g as S } from "./index-e834697b.js";
|
|
2
|
-
import { d, r as R, s as A, v as pe, w as V, x as te, y as ae, z as he, A as fe, B as j } from "./utils-df5c1963-d9833bcb.js";
|
|
3
|
-
import { R as N } from "./register-component-486ea571-1f151779.js";
|
|
4
|
-
import { T as ye } from "./constants-d93cf397-dd67263d.js";
|
|
5
|
-
import { c as Ie } from "./_commonjsHelpers-57e89916-af061c86.js";
|
|
6
|
-
import "react";
|
|
7
|
-
import "react-dom";
|
|
8
|
-
const $e = ".sc-add-circle-icon-h{display:flex}", Ae = $e, Me = class {
|
|
9
|
-
constructor(e) {
|
|
10
|
-
u(this, e), this.width = "24", this.height = "25";
|
|
11
|
-
}
|
|
12
|
-
render() {
|
|
13
|
-
return s("svg", { key: "6ab5f6ef57d754e88589edaca8ef42f074a4bd10", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, s("path", { key: "3454421e4ce131ef5de69738d05737dcbe884a60", d: "M12 2.5c5.523 0 10 4.477 10 10s-4.477 10-10 10-10-4.477-10-10 4.477-10 10-10ZM12 4a8.5 8.5 0 1 0 0 17 8.5 8.5 0 0 0 0-17Zm0 3.5a.75.75 0 0 1 .75.75v3.5h3.5a.75.75 0 0 1 0 1.5h-3.5v3.5a.75.75 0 0 1-1.5 0v-3.5h-3.5a.75.75 0 0 1 0-1.5h3.5v-3.5A.75.75 0 0 1 12 7.5Z", fill: "currentColor" }));
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
Me.style = Ae;
|
|
17
|
-
const ze = ".sc-calendar-info-icon-h{display:flex}", He = ze, Le = class {
|
|
18
|
-
constructor(e) {
|
|
19
|
-
u(this, e), this.width = "20", this.height = "20";
|
|
20
|
-
}
|
|
21
|
-
render() {
|
|
22
|
-
return s("svg", { key: "01969629dbe43a1e860e200aa18b616924570e57", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, s("path", { key: "5b8279af2bdd3192a11be7738f79a4e5a638d397", d: "M12 0C13.3807 0 14.5 1.11929 14.5 2.5V6.59971C14.1832 6.43777 13.8486 6.30564 13.5 6.20703V4H1.5V11.5C1.5 12.3284 2.17157 13 3 13H6.70703C6.80564 13.3486 6.93777 13.6832 7.09971 14H3C1.61929 14 0.5 12.8807 0.5 11.5V2.5C0.5 1.11929 1.61929 0 3 0H12ZM12 1H3C2.17157 1 1.5 1.67157 1.5 2.5V3H13.5V2.5C13.5 1.67157 12.8284 1 12 1ZM11.375 9.5C11.375 9.15482 11.6548 8.875 12 8.875C12.3452 8.875 12.625 9.15482 12.625 9.5C12.625 9.84518 12.3452 10.125 12 10.125C11.6548 10.125 11.375 9.84518 11.375 9.5ZM12.5 13.5C12.5 13.7761 12.2761 14 12 14C11.7239 14 11.5 13.7761 11.5 13.5V11.5C11.5 11.2239 11.7239 11 12 11C12.2761 11 12.5 11.2239 12.5 11.5V13.5ZM7.5 11.5C7.5 9.01472 9.51472 7 12 7C14.4853 7 16.5 9.01472 16.5 11.5C16.5 13.9853 14.4853 16 12 16C9.51472 16 7.5 13.9853 7.5 11.5ZM8.5 11.5C8.5 13.433 10.067 15 12 15C13.933 15 15.5 13.433 15.5 11.5C15.5 9.567 13.933 8 12 8C10.067 8 8.5 9.567 8.5 11.5Z", fill: "currentColor" }));
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
Le.style = He;
|
|
26
|
-
const Ne = ".sc-calendar-patterns-icon-h{display:flex}", Fe = Ne, Pe = class {
|
|
27
|
-
constructor(e) {
|
|
28
|
-
u(this, e), this.width = "20", this.height = "20";
|
|
29
|
-
}
|
|
30
|
-
render() {
|
|
31
|
-
return s("svg", { key: "2eca4ca5315138e61f085e15e15f634f1ba49175", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, s("path", { key: "4ce6b497619836eeb66bd1bf857767c241486008", d: "M3.25 0H11.75C13.2688 0 14.5 1.23122 14.5 2.75V11.25C14.5 12.7688 13.2688 14 11.75 14H3.25C1.73122 14 0.5 12.7688 0.5 11.25V2.75C0.5 1.23122 1.73122 0 3.25 0ZM2 2.75V4H13V2.75C13 2.05964 12.4404 1.5 11.75 1.5H3.25C2.55964 1.5 2 2.05964 2 2.75ZM12.2071 5L8.20711 9H10.7929L13 6.79289V5H12.2071ZM10.7929 5H8.20711L4.20711 9H6.79289L10.7929 5ZM2.79289 9L6.79289 5H4.20711L2 7.20711V9H2.79289ZM2 5.79289L2.79289 5H2V5.79289ZM12.2071 9H13V8.20711L12.2071 9Z", fill: "currentColor" }));
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
Pe.style = Fe;
|
|
35
|
-
const Re = ":host{display:block;width:inherit;--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}.dropdown{display:inline-block;width:100%;position:relative}.dropdown .dropdown-label{display:flex;align-items:center;gap:0.25rem;color:var(--nylas-base-800)}.dropbtn{width:inherit;height:48px;color:black;padding:0.5rem;font-size:1rem;cursor:pointer;display:flex;gap:0.5rem;justify-content:space-between;align-items:center;background:transparent;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}.dropbtn.focus{background:transparent}.dropbtn:hover,.dropbtn:active{border:1px solid var(--nylas-primary)}.dropbtn:active{outline:2px solid var(--nylas-primary)}.dropbtn span.open{transform:rotate(90deg)}.dropbtn span.closed{transform:rotate(270deg)}.dropdown-content{display:block;margin-top:0.5rem;background-color:var(--nylas-base-0);width:100%;max-height:336px;overflow:auto;border:1px solid #ddd;z-index:1;border-radius:4px;position:absolute;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}.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 ul li label{display:flex;align-items:center;gap:0.5rem}.dropdown-content ul li label input{margin:0}.selected-options{display:flex;flex-wrap:wrap;gap:0.5rem;padding:0.5rem 0;margin-top:0.25rem;background:var(--nylas-base-0)}.selected-options .selected-option{display:flex;align-items:center;gap:0.5rem;padding:4px 8px;border-radius:var(--nylas-border-radius-2x);background:var(--nylas-base-100);color:var(--nylas-base-800);font-size:16px;font-weight:500;line-height:1.5rem;letter-spacing:0.5px}.selected-options .selected-option button{background:transparent;border:none;cursor:pointer;padding:0}.selected-options .selected-option button:hover{color:var(--nylas-primary)}", je = Re, Ve = class {
|
|
36
|
-
constructor(e) {
|
|
37
|
-
u(this, e), this.selectedOptionsChanged = K(this, "selectedOptionsChanged", 7), this.name = void 0, this.label = void 0, this.options = [], this.defaultSelectedOptions = void 0, this.availableOptions = this.options, this.isOpen = !1, this.ariaActivedescendant = "", this.shouldFocusFirstOption = !1;
|
|
38
|
-
}
|
|
39
|
-
componentDidRender() {
|
|
40
|
-
d("multi-select-dropdown", "componentDidRender"), this.isOpen && this.shouldFocusFirstOption && (this.ariaActivedescendant = this.availableOptions[0].value, this.focusOption(0), this.shouldFocusFirstOption = !1);
|
|
41
|
-
}
|
|
42
|
-
handleOutsideClick(e) {
|
|
43
|
-
!e.composedPath().includes(this.el) && this.isOpen && (this.isOpen = !1);
|
|
44
|
-
}
|
|
45
|
-
selectOption(e) {
|
|
46
|
-
this.availableOptions = this.availableOptions.map((a) => (a.value === e.value && (a.selected = !e.selected), a));
|
|
47
|
-
const t = this.availableOptions.filter((a) => a.selected).map((a) => a.value);
|
|
48
|
-
this.selectedOptionsChanged.emit({
|
|
49
|
-
value: t,
|
|
50
|
-
name: this.name
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
toggleDropdown() {
|
|
54
|
-
this.isOpen = !this.isOpen, this.isOpen ? this.shouldFocusFirstOption = !0 : this.ariaActivedescendant = "";
|
|
55
|
-
}
|
|
56
|
-
handleSelectButtonKeyDown(e) {
|
|
57
|
-
switch (e.key) {
|
|
58
|
-
case "ArrowDown":
|
|
59
|
-
case "Enter":
|
|
60
|
-
e.preventDefault(), this.isOpen || this.toggleDropdown();
|
|
61
|
-
break;
|
|
62
|
-
case "Escape":
|
|
63
|
-
this.isOpen = !1;
|
|
64
|
-
break;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
handleListboxKeydown(e) {
|
|
68
|
-
const t = this.availableOptions, a = t.findIndex((n) => n.value === this.ariaActivedescendant);
|
|
69
|
-
switch (e.key) {
|
|
70
|
-
case "ArrowDown":
|
|
71
|
-
case "Tab":
|
|
72
|
-
if (e.shiftKey) {
|
|
73
|
-
e.preventDefault();
|
|
74
|
-
const r = a - 1 >= 0 ? a - 1 : t.length - 1;
|
|
75
|
-
this.ariaActivedescendant = t[r].value, this.focusOption(r);
|
|
76
|
-
} else {
|
|
77
|
-
e.preventDefault();
|
|
78
|
-
const r = a + 1 < t.length ? a + 1 : 0;
|
|
79
|
-
this.ariaActivedescendant = t[r].value, this.focusOption(r);
|
|
80
|
-
}
|
|
81
|
-
break;
|
|
82
|
-
case "ArrowUp":
|
|
83
|
-
e.preventDefault();
|
|
84
|
-
const n = a - 1 >= 0 ? a - 1 : t.length - 1;
|
|
85
|
-
this.ariaActivedescendant = t[n].value, this.focusOption(n);
|
|
86
|
-
break;
|
|
87
|
-
case "Enter":
|
|
88
|
-
e.preventDefault(), this.ariaActivedescendant && this.selectOption(t[a]);
|
|
89
|
-
break;
|
|
90
|
-
case "Escape":
|
|
91
|
-
this.isOpen = !1;
|
|
92
|
-
break;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
focusOption(e) {
|
|
96
|
-
var r;
|
|
97
|
-
const t = this.availableOptions[e];
|
|
98
|
-
if (!t)
|
|
99
|
-
return;
|
|
100
|
-
const a = t.value, n = (r = this.el.shadowRoot) == null ? void 0 : r.getElementById(a);
|
|
101
|
-
n && (n.focus(), n.scrollIntoView({ behavior: "smooth", block: "nearest" }));
|
|
102
|
-
}
|
|
103
|
-
getSelectedOptions() {
|
|
104
|
-
return this.availableOptions.filter((e) => e.selected);
|
|
105
|
-
}
|
|
106
|
-
renderOption(e) {
|
|
107
|
-
return s("li", { key: e.value, id: e.value, role: "option", tabindex: "0", "aria-selected": e.selected ? "true" : "false", onClick: (t) => {
|
|
108
|
-
t.stopImmediatePropagation(), this.selectOption(e);
|
|
109
|
-
}, class: { selected: !!e.selected } }, s("label", { htmlFor: e.value }, s("input", { "aria-hidden": "true", id: e.value, type: "checkbox", checked: e.selected }), s("span", null, e.label)));
|
|
110
|
-
}
|
|
111
|
-
render() {
|
|
112
|
-
var e;
|
|
113
|
-
return s(E, { key: "8168c8bd2516ee37e44f446d6a4a1b09674a4612" }, s("div", { key: "a6f0034b3b8fc25a91240230b389d7d01ef8dd9e", class: "dropdown" }, s("label", { key: "b875970e5a7bcbe1d9e1459f1f608a355307d4a7", class: "dropdown-label" }, this.label, s("slot", { key: "83db0e22386bd6f1e11083134e6f62228da4f8fd", name: "label-icon", "aria-hidden": "true" })), s("button", { key: "5bb1558f59a34c67152f74d07b5053112dcb42b6", class: { dropbtn: !0, open: this.isOpen }, onClick: () => this.toggleDropdown(), "aria-haspopup": "listbox", "aria-expanded": this.isOpen ? "true" : "false", "aria-label": this.name, onKeyDown: (t) => this.handleSelectButtonKeyDown(t) }, s("slot", { key: "45a248b288dd90b80b2ba2ca53ee593e7c44da83", name: "select-icon", "aria-hidden": "true" }), s("span", { key: "14bbc08ed4c500cbba5ff3fb5ce28ad6027a2bc3", class: "selected-option" }, this.getSelectedOptions().length > 1 ? `Multiple ${this.name}s selected` : ((e = this.availableOptions.filter((t) => t.selected)[0]) == null ? void 0 : e.label) ?? this.availableOptions[0].label), s("span", { key: "a0d4c1ec9ef8b95bd47755a5498a9930838420aa", class: this.isOpen ? "open" : "closed", "aria-hidden": "true" }, s("chevron-icon", { key: "a9677b3b214dac36184fb8723e8001b80300faf2", width: "16", height: "16" }))), this.isOpen ? null : s("div", { class: "selected-options" }, this.getSelectedOptions().map((t) => s("span", { class: "selected-option" }, t.label, s("button", { key: t.label, onClick: () => this.selectOption(t) }, s("close-icon", null))))), this.isOpen ? s("div", { class: "dropdown-content" }, s("ul", { tabindex: "-1", role: "listbox", "aria-label": this.name, "aria-multiselectable": !0, "aria-activedescendant": this.ariaActivedescendant, onKeyDown: (t) => this.handleListboxKeydown(t) }, this.availableOptions.map((t) => this.renderOption(t)))) : null));
|
|
114
|
-
}
|
|
115
|
-
get el() {
|
|
116
|
-
return S(this);
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
Ve.style = je;
|
|
120
|
-
const Ye = ":host{display:block;margin:1rem;--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-additional-participants__title{color:var(--nylas-base-nylas-base-900-aaa, #101323);font-size:16px;font-style:normal;font-weight:600;line-height:20px;}.nylas-additional-participants__subtitle{color:var(--nylas-base-nylas-base-600-aaa, #3e4784);font-size:14px;font-style:normal;font-weight:400;line-height:20px;}.nylas-additional-participants__content{padding:1rem;display:flex;flex-direction:column;gap:1rem}.nylas-additional-participants__block{display:flex;justify-content:space-between;gap:0.5rem}.nylas-additional-participants__input_group{padding-top:8px}.nylas-additional-participants__input_wrapper{display:flex;border-width:1;border-radius:8px;border:1px solid var(--Nylas-base-Nylas-base-300, #b3b8d8)}.nylas-additional-participants__input_wrapper button{padding:12px;border:none;background:none;cursor:pointer}.nylas-additional-participants__input_wrapper button:hover,.nylas-additional-participants__input_wrapper button:active{color:var(--nylas-primary)}.nylas-additional-participants__input_wrapper_organizer{background:var(--Nylas-base-Nylas-base-50, #f8f9fc)}.nylas-additional-participants__input{flex:1;padding:12px 16px;border-right:1px solid var(--Nylas-base-Nylas-base-300, #b3b8d8)}.nylas-additional-participants__input input{border:none;outline:none;background:none;width:100%}.nylas-additional-participants__input_wrapper_invalid{border:1px solid var(--nylas-error, #cc4841);color:var(--Nylas-base-Nylas-base-400, #717bbc)}.nylas-additional-participants__add{padding:12px;display:flex;align-items:center;border:none;background:none;cursor:pointer}.nylas-additional-participants__add span{padding:0 8px;font-size:16px;font-style:normal;font-weight:500}.nylas-additional-participants__add:hover,.nylas-additional-participants__add:active{color:var(--nylas-primary)}", We = Ye;
|
|
121
|
-
var Ze = function(e, t, a, n) {
|
|
122
|
-
var r = arguments.length, i = r < 3 ? t : n === null ? n = Object.getOwnPropertyDescriptor(t, a) : n, l;
|
|
123
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
124
|
-
i = Reflect.decorate(e, t, a, n);
|
|
125
|
-
else
|
|
126
|
-
for (var o = e.length - 1; o >= 0; o--)
|
|
127
|
-
(l = e[o]) && (i = (r < 3 ? l(i) : r > 3 ? l(t, a, i) : l(t, a)) || i);
|
|
128
|
-
return r > 3 && i && Object.defineProperty(t, a, i), i;
|
|
129
|
-
}, ne = function(e, t) {
|
|
130
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
131
|
-
return Reflect.metadata(e, t);
|
|
132
|
-
};
|
|
133
|
-
const me = class {
|
|
134
|
-
constructor(e) {
|
|
135
|
-
u(this, e), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.name = "participants", this.eventParticipants = void 0, this.participants = this.eventParticipants ?? [], this.participantsValid = !0;
|
|
136
|
-
}
|
|
137
|
-
elementNameChangedHandler(e) {
|
|
138
|
-
d("nylas-additional-participants", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
|
|
139
|
-
}
|
|
140
|
-
connectedCallback() {
|
|
141
|
-
d("nylas-additional-participants", "connectedCallback");
|
|
142
|
-
}
|
|
143
|
-
componentWillLoad() {
|
|
144
|
-
d("nylas-additional-participants", "componentWillLoad"), this.host.setAttribute("name", this.name);
|
|
145
|
-
}
|
|
146
|
-
componentDidLoad() {
|
|
147
|
-
d("nylas-additional-participants", "componentDidLoad"), this.internals.setFormValue(JSON.stringify(this.participants), "participants");
|
|
148
|
-
}
|
|
149
|
-
disconnectedCallback() {
|
|
150
|
-
d("nylas-additional-participants", "disconnectedCallback");
|
|
151
|
-
}
|
|
152
|
-
onParticipantChange(e, t) {
|
|
153
|
-
d("nylas-additional-participants", "onParticipantChange"), this.participants[t].email = e.target.value, this.internals.setFormValue(JSON.stringify(this.participants), "participants");
|
|
154
|
-
}
|
|
155
|
-
addParticipant() {
|
|
156
|
-
d("nylas-additional-participants", "addParticipant"), this.participants = [...this.participants, { email: "", is_organizer: !1, availability: { calendar_ids: ["primary"] } }], this.internals.setFormValue(JSON.stringify(this.participants), "participants");
|
|
157
|
-
}
|
|
158
|
-
removeParticipant(e) {
|
|
159
|
-
d("nylas-additional-participants", "addParticipant"), this.participants = this.participants.filter((t) => t.email !== e), this.internals.setFormValue(JSON.stringify(this.participants), "participants");
|
|
160
|
-
}
|
|
161
|
-
validate(e, t) {
|
|
162
|
-
d("nylas-additional-participants", "validate");
|
|
163
|
-
const n = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(e).toLowerCase());
|
|
164
|
-
this.participants[t].is_valid = n, this.internals.setFormValue(JSON.stringify(this.participants), "participants");
|
|
165
|
-
}
|
|
166
|
-
render() {
|
|
167
|
-
return s(E, { key: "a5d05ab5b72814f0cf75df738cd3e0a201edcfb2" }, s("nylas-form-card", { key: "d43372c684b1da7b823692e09bb2bca99fdcb5b6" }, s("h3", { key: "7adc0bd80f59d305aaf1d2e11bc24e6bf08222cc", slot: "header-title", class: "nylas-additional-participants__title" }, "Additional participants"), s("p", { key: "fe9df16a37f967d9423a5deb0dfdedffccc6abdc", slot: "header-subtitle", class: "nylas-additional-participants__subtitle" }, "Add anyone else who would be joining for this event."), s("div", { key: "057a46756bb908699684ac8af5cad756c79ebe46", slot: "content", class: "nylas-additional-participants__content" }, s("div", { key: "e69357b5cfd99c17aaaf87e21ae54ed2f2ba2cfa" }, this.participants.map((e, t) => s("div", { class: "nblas-additional-participants__input_group" }, s("label", null, e.is_organizer ? "Organizer" : `Participant ${t}`), s("div", { class: `nylas-additional-participants__input_wrapper ${e.is_organizer && "nylas-additional-participants__input_wrapper_organizer"} ${e.is_valid === !1 && "nylas-additional-participants__input_wrapper_invalid"}` }, s("div", { class: "nylas-additional-participants__input" }, s("input", { type: "text", value: e.email, onInput: (a) => {
|
|
168
|
-
this.onParticipantChange(a, t);
|
|
169
|
-
}, readOnly: e.is_organizer, onBlur: () => this.validate(e.email, t) })), !e.is_organizer && s("button", { onClick: () => this.removeParticipant(e.email) }, s("close-icon", null)))))))));
|
|
170
|
-
}
|
|
171
|
-
static get formAssociated() {
|
|
172
|
-
return !0;
|
|
173
|
-
}
|
|
174
|
-
get host() {
|
|
175
|
-
return S(this);
|
|
176
|
-
}
|
|
177
|
-
static get watchers() {
|
|
178
|
-
return {
|
|
179
|
-
name: ["elementNameChangedHandler"]
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
Ze([
|
|
184
|
-
N({
|
|
185
|
-
name: "nylas-additional-participants",
|
|
186
|
-
eventToProps: {},
|
|
187
|
-
fireRegisterEvent: !0
|
|
188
|
-
}),
|
|
189
|
-
ne("design:type", Function),
|
|
190
|
-
ne("design:paramtypes", []),
|
|
191
|
-
ne("design:returntype", void 0)
|
|
192
|
-
], me.prototype, "render", null);
|
|
193
|
-
me.style = We;
|
|
194
|
-
const Ue = ":host{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;width:inherit}.nylas-availability-picker{width:inherit;display:flex;flex-direction:column;margin:1rem;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-200)}.nylas-availability-picker .header{padding:1rem;border-bottom:1px solid var(--nylas-base-200)}.nylas-availability-picker .header h3{margin:0;font-size:1rem;font-weight:600;line-height:20px;color:var(--nylas-base-900)}.nylas-availability-picker .header p{margin:0.25rem 0 0 0;font-size:0.875rem;font-weight:400;line-height:20px;color:var(--nylas-base-600)}.nylas-availability-picker .content{padding:1rem;color:var(--nylas-base-900)}.nylas-availability-picker .content .select-timezone{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--nylas-base-200);padding-bottom:1rem}.nylas-availability-picker .content .select-timezone h4{display:flex;gap:0.5rem;align-items:center;margin:0;font-size:1rem;font-weight:500;line-height:20px}.nylas-availability-picker .content .select-timezone select-dropdown{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}.nylas-availability-picker .content .availability{display:flex;flex-direction:column;gap:1rem;padding:0 0.5rem;margin:1rem 0}.nylas-availability-picker .content .availability .availability-day{display:grid;grid-template-columns:minmax(auto, 65px) 1fr minmax(auto, 40px);gap:1rem;align-items:baseline}@media screen and (max-width: 768px){.nylas-availability-picker .content .availability .availability-day{grid-template-columns:auto}}.nylas-availability-picker .content .availability .availability-day .day{display:flex;gap:0.5rem;align-items:center}.nylas-availability-picker .content .availability .availability-day .time-ranges span.unavailable{height:48px;display:flex;align-items:center}.nylas-availability-picker .content .availability .availability-day .time-ranges .time-range{display:flex;gap:1.5rem;justify-content:space-between;align-items:baseline}.nylas-availability-picker .content .availability .availability-day .time-ranges .time-range .pickers{display:flex;gap:1rem}.nylas-availability-picker .content .availability .availability-day .time-ranges .time-range .pickers span{margin-top:0.75rem}.nylas-availability-picker .content .availability .availability-day .time-ranges .time-range:not(:last-of-type){margin-bottom:1rem}.nylas-availability-picker .content .availability .availability-day .time-ranges p.error{color:var(--nylas-error)}.nylas-availability-picker .content .availability .availability-day button{border:none;background:transparent;height:40px;cursor:pointer;color:var(--nylas-base-800)}.nylas-availability-picker .content .availability .availability-day button:hover,.nylas-availability-picker .content .availability .availability-day button:active{color:var(--nylas-primary)}", Ke = Ue;
|
|
195
|
-
var Be = function(e, t, a, n) {
|
|
196
|
-
var r = arguments.length, i = r < 3 ? t : n === null ? n = Object.getOwnPropertyDescriptor(t, a) : n, l;
|
|
197
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
198
|
-
i = Reflect.decorate(e, t, a, n);
|
|
199
|
-
else
|
|
200
|
-
for (var o = e.length - 1; o >= 0; o--)
|
|
201
|
-
(l = e[o]) && (i = (r < 3 ? l(i) : r > 3 ? l(t, a, i) : l(t, a)) || i);
|
|
202
|
-
return r > 3 && i && Object.defineProperty(t, a, i), i;
|
|
203
|
-
}, ie = function(e, t) {
|
|
204
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
205
|
-
return Reflect.metadata(e, t);
|
|
206
|
-
};
|
|
207
|
-
const be = class {
|
|
208
|
-
constructor(e) {
|
|
209
|
-
u(this, e), this.selectedOpenHoursChanged = K(this, "selectedOpenHoursChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.openHours = void 0, this.name = "availability", this.schedule = {
|
|
210
|
-
SUN: [],
|
|
211
|
-
MON: [{ start: "09:00am", end: "05:00pm" }],
|
|
212
|
-
TUE: [{ start: "09:00am", end: "05:00pm" }],
|
|
213
|
-
WED: [{ start: "09:00am", end: "05:00pm" }],
|
|
214
|
-
THU: [{ start: "09:00am", end: "05:00pm" }],
|
|
215
|
-
FRI: [{ start: "09:00am", end: "05:00pm" }],
|
|
216
|
-
SAT: []
|
|
217
|
-
}, this.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.defaultTimezone = this.timezone, this.overlapDays = {};
|
|
218
|
-
}
|
|
219
|
-
elementNameChangedHandler(e) {
|
|
220
|
-
d("nylas-calendar-picker", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
|
|
221
|
-
}
|
|
222
|
-
scheduleChanged(e, t) {
|
|
223
|
-
var a;
|
|
224
|
-
if (e !== t) {
|
|
225
|
-
this.selectedOpenHoursChanged.emit({
|
|
226
|
-
value: this.scheduleToOpenHours(e, this.timezone),
|
|
227
|
-
name: this.name
|
|
228
|
-
});
|
|
229
|
-
let n = {};
|
|
230
|
-
if (Object.keys(e).forEach((r) => {
|
|
231
|
-
const i = e[r];
|
|
232
|
-
if (i.length > 0) {
|
|
233
|
-
const l = this.getOverlaps(i);
|
|
234
|
-
l.length > 0 && (n[r] = l);
|
|
235
|
-
}
|
|
236
|
-
}), this.overlapDays = n, Object.keys(n).length > 0) {
|
|
237
|
-
const r = (a = this.host.shadowRoot) == null ? void 0 : a.getElementById(Object.keys(n)[0]);
|
|
238
|
-
r && this.internals.setValidity({ customError: !0 }, "Overlapping time ranges found", r);
|
|
239
|
-
} else
|
|
240
|
-
this.internals.setValidity({ customError: !1 }), this.internals.setFormValue(JSON.stringify(this.scheduleToOpenHours(e, this.timezone)));
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
selectedOptionChangedHandler(e) {
|
|
244
|
-
const { name: t, value: a } = e.detail;
|
|
245
|
-
t === "timezone" && (this.timezone = a, this.internals.setFormValue(JSON.stringify(this.scheduleToOpenHours(this.schedule, this.timezone))));
|
|
246
|
-
}
|
|
247
|
-
connectedCallback() {
|
|
248
|
-
d("nylas-availability-picker", "connectedCallback");
|
|
249
|
-
}
|
|
250
|
-
disconnectedCallback() {
|
|
251
|
-
d("nylas-availability-picker", "disconnectedCallback");
|
|
252
|
-
}
|
|
253
|
-
componentWillLoad() {
|
|
254
|
-
d("nylas-availability-picker", "componentWillLoad"), this.host.setAttribute("name", this.name);
|
|
255
|
-
}
|
|
256
|
-
componentDidLoad() {
|
|
257
|
-
d("nylas-availability-picker", "componentDidLoad"), this.openHours && this.openHours.length > 0 && this.updateSchedule(this.openHours), this.internals.setFormValue(JSON.stringify(this.scheduleToOpenHours(this.schedule, this.timezone)));
|
|
258
|
-
}
|
|
259
|
-
getOverlaps(e) {
|
|
260
|
-
let t = e.map((n, r) => ({
|
|
261
|
-
start: R(n.start),
|
|
262
|
-
end: R(n.end),
|
|
263
|
-
originalIndex: r
|
|
264
|
-
}));
|
|
265
|
-
t.sort((n, r) => n.start - r.start);
|
|
266
|
-
let a = [];
|
|
267
|
-
for (let n = 1; n < t.length; n++)
|
|
268
|
-
t[n].start < t[n - 1].end && (a.includes(t[n].originalIndex) || a.push(t[n].originalIndex), a.includes(t[n - 1].originalIndex) || a.push(t[n - 1].originalIndex));
|
|
269
|
-
return a.sort((n, r) => n - r);
|
|
270
|
-
}
|
|
271
|
-
addTimeRange(e) {
|
|
272
|
-
const t = this.schedule[e], a = 0, n = 1425;
|
|
273
|
-
if (t.length === 0)
|
|
274
|
-
this.schedule[e] = [{ start: "09:00am", end: "05:00pm" }];
|
|
275
|
-
else {
|
|
276
|
-
const r = t.map((l) => ({
|
|
277
|
-
start: R(l.start),
|
|
278
|
-
end: R(l.end)
|
|
279
|
-
})).sort((l, o) => l.start - o.start), i = r[r.length - 1].end;
|
|
280
|
-
if (i + 60 <= n)
|
|
281
|
-
this.schedule[e].push({
|
|
282
|
-
start: A(j(i)),
|
|
283
|
-
end: A(j(i + 60))
|
|
284
|
-
});
|
|
285
|
-
else {
|
|
286
|
-
let l = !1;
|
|
287
|
-
if (r[0].start > a + 60 && (this.schedule[e].push({
|
|
288
|
-
start: A(j(a)),
|
|
289
|
-
end: A(j(a + 60))
|
|
290
|
-
}), l = !0), !l)
|
|
291
|
-
for (let o = 0; o < r.length - 1; o++) {
|
|
292
|
-
const m = r[o].end;
|
|
293
|
-
if (r[o + 1].start - m >= 60) {
|
|
294
|
-
this.schedule[e].push({
|
|
295
|
-
start: A(j(m)),
|
|
296
|
-
end: A(j(m + 60))
|
|
297
|
-
});
|
|
298
|
-
break;
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
this.schedule[e].sort((r, i) => R(r.start) - R(i.start)), this.schedule = { ...this.schedule };
|
|
304
|
-
}
|
|
305
|
-
removeTimeRange(e, t) {
|
|
306
|
-
this.schedule[e].splice(t, 1), this.schedule = { ...this.schedule };
|
|
307
|
-
}
|
|
308
|
-
setTime(e, t, a) {
|
|
309
|
-
const [n, r] = e.split("_"), [i, l] = n.split(":");
|
|
310
|
-
r === "start" ? this.schedule[i][l].start = a : r === "end" && (this.schedule[i][l].end = a), this.internals.setValidity({ customError: !1 }), this.schedule = { ...this.schedule };
|
|
311
|
-
}
|
|
312
|
-
setFormError(e, t, a) {
|
|
313
|
-
var l;
|
|
314
|
-
const [n, r] = e.split("_"), i = (l = this.host.shadowRoot) == null ? void 0 : l.getElementById(e);
|
|
315
|
-
i && this.internals.setValidity({ customError: !0 }, `Invalid ${r} time`, i);
|
|
316
|
-
}
|
|
317
|
-
updateSchedule(e) {
|
|
318
|
-
const t = {
|
|
319
|
-
SUN: [],
|
|
320
|
-
MON: [],
|
|
321
|
-
TUE: [],
|
|
322
|
-
WED: [],
|
|
323
|
-
THU: [],
|
|
324
|
-
FRI: [],
|
|
325
|
-
SAT: []
|
|
326
|
-
};
|
|
327
|
-
e.forEach((a) => {
|
|
328
|
-
a.days.forEach((n) => {
|
|
329
|
-
const r = this.getDayKey(n), i = A(a.start), l = A(a.end), o = { start: i, end: l };
|
|
330
|
-
let m = !1;
|
|
331
|
-
t[r] && (m = t[r].some((h) => h.start === o.start && h.end === o.end)), m || (t[r] ? t[r].push(o) : t[r] = [o]);
|
|
332
|
-
});
|
|
333
|
-
}), e.length === 0 && (this.timezone = e[0].timezone), this.defaultTimezone = e[0].timezone, this.timezone = e[0].timezone, this.schedule = t;
|
|
334
|
-
}
|
|
335
|
-
getDayKey(e) {
|
|
336
|
-
return ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"][e];
|
|
337
|
-
}
|
|
338
|
-
scheduleToOpenHours(e, t = "UTC") {
|
|
339
|
-
const a = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"];
|
|
340
|
-
let n = /* @__PURE__ */ new Map();
|
|
341
|
-
a.forEach((i, l) => {
|
|
342
|
-
e[i] && e[i].forEach((o) => {
|
|
343
|
-
const m = pe(o.start), h = pe(o.end), x = `${m}-${h}`;
|
|
344
|
-
if (!n.has(x))
|
|
345
|
-
n.set(x, { days: [l], start: m, end: h });
|
|
346
|
-
else {
|
|
347
|
-
let b = n.get(x);
|
|
348
|
-
b && (b.days.push(l), n.set(x, b));
|
|
349
|
-
}
|
|
350
|
-
});
|
|
351
|
-
});
|
|
352
|
-
let r = [];
|
|
353
|
-
return n.forEach((i, l) => {
|
|
354
|
-
r.push({
|
|
355
|
-
days: i.days,
|
|
356
|
-
start: i.start,
|
|
357
|
-
end: i.end,
|
|
358
|
-
timezone: t
|
|
359
|
-
});
|
|
360
|
-
}), r;
|
|
361
|
-
}
|
|
362
|
-
render() {
|
|
363
|
-
const e = Object.keys(ye).map((a) => ({
|
|
364
|
-
label: ye[a],
|
|
365
|
-
value: a
|
|
366
|
-
})), t = e.find((a) => a.value === this.defaultTimezone);
|
|
367
|
-
return s(E, { key: "87e05dca330a4e1c97886a0860ed6a8d3e4e6157" }, s("div", { key: "8db4597b9676e9c9ea0f289781fed798ecc59a1d", class: "nylas-availability-picker" }, s("div", { key: "8f797bdd2e4c9ecdcbbb1c07414d7a8ed6cff83c", class: "header", part: "ncp__header" }, s("h3", { key: "676aef337f7a16b1546e3c9767c1ef2cc0439627" }, "General availability"), s("p", { key: "6cd6625935e4a159c50c40214e374ffeb4ee8007" }, "Set your availability for scheduling meetings.")), s("div", { key: "7f0d04ecf59411c951c7794981c160a9346859bc", class: "content" }, s("div", { key: "51bf7684a9bba1bc2c2344c243156f54f278c087", class: "select-timezone" }, s("h4", { key: "67e5491c4793623f76759e1935214a0793359b59", class: "sub-header" }, "Select timezone", s("span", { key: "ad75d494f59fc45d4088af710b62862fabf8bac9", class: "icon" }, s("info-icon", { key: "a75dc274e1067e3be3537a0912072e950deb49dc" }))), s("select-dropdown", { key: "3e5f45ee1f06d45f7da02ba01cdc248b5fd56742", name: "timezone", options: e, defaultSelectedOption: t }, s("span", { key: "8cfcaf9954132a734794d0a2723eaf71eafa3412", slot: "select-icon" }, s("globe-icon", { key: "7ffa5b0de8b4061269a1257447c9cf8d1e2d7d4a", width: "20", height: "20" })))), s("div", { key: "a53a34383d56e1ab24323341856fd2fce0d62d93", class: "availability" }, Object.keys(this.schedule).map((a) => {
|
|
368
|
-
const n = a, r = this.schedule[a];
|
|
369
|
-
return s("div", { class: "availability-day" }, s("div", { class: "day", part: "ndp__day" }, s("input", { type: "checkbox", name: n, id: n, checked: r.length > 0, onClick: () => {
|
|
370
|
-
r.length > 0 ? this.schedule[n] = [] : this.schedule[n] = [{ start: "09:00am", end: "05:00pm" }], this.schedule = { ...this.schedule };
|
|
371
|
-
} }), s("label", { htmlFor: n, "aria-label": "Select day" }, n)), s("div", { class: "time-ranges" }, r.length ? null : s("span", { class: "unavailable" }, "Unavailable"), r.length > 0 && r.map((i, l) => {
|
|
372
|
-
var h, x;
|
|
373
|
-
const o = `${a}:${l}_start`, m = `${a}:${l}_end`;
|
|
374
|
-
return s("div", { class: "time-range" }, s("div", { class: "pickers" }, s("nylas-time-window-picker", { id: o, hasError: (h = this.overlapDays[n]) == null ? void 0 : h.includes(l), time: i.start, name: o, key: o, setTime: (b, k) => this.setTime(o, b, k), setFormError: (b, k) => this.setFormError(o, b, k) }), s("span", null, " - "), s("nylas-time-window-picker", { id: m, hasError: (x = this.overlapDays[n]) == null ? void 0 : x.includes(l), time: i.end, name: m, key: m, minimumStartTime: i.start, setTime: (b, k) => this.setTime(m, b, k), setFormError: (b, k) => this.setFormError(m, b, k) })), s("button", { onClick: () => this.removeTimeRange(n, l) }, s("close-icon", null)));
|
|
375
|
-
}), s("p", { class: "error" }, this.overlapDays[n] ? "Overlapping time ranges" : "")), s("div", null, r.length > 0 ? s("button", { onClick: () => this.addTimeRange(n) }, s("add-circle-icon", null)) : null));
|
|
376
|
-
})))));
|
|
377
|
-
}
|
|
378
|
-
static get formAssociated() {
|
|
379
|
-
return !0;
|
|
380
|
-
}
|
|
381
|
-
get host() {
|
|
382
|
-
return S(this);
|
|
383
|
-
}
|
|
384
|
-
static get watchers() {
|
|
385
|
-
return {
|
|
386
|
-
name: ["elementNameChangedHandler"],
|
|
387
|
-
schedule: ["scheduleChanged"]
|
|
388
|
-
};
|
|
389
|
-
}
|
|
390
|
-
};
|
|
391
|
-
Be([
|
|
392
|
-
N({
|
|
393
|
-
name: "nylas-availability-picker",
|
|
394
|
-
fireRegisterEvent: !0
|
|
395
|
-
}),
|
|
396
|
-
ie("design:type", Function),
|
|
397
|
-
ie("design:paramtypes", []),
|
|
398
|
-
ie("design:returntype", void 0)
|
|
399
|
-
], be.prototype, "render", null);
|
|
400
|
-
be.style = Ke;
|
|
401
|
-
const Je = ":host{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;width:inherit}.nylas-calendar-picker{width:inherit;display:flex;flex-direction:column;margin:1rem;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-200)}.nylas-calendar-picker .header{padding:1rem;border-bottom:1px solid var(--nylas-base-200)}.nylas-calendar-picker .header h3{margin:0;font-size:1rem;font-weight:600;line-height:20px;color:var(--nylas-base-900)}.nylas-calendar-picker .header p{margin:0.25rem 0 0 0;font-size:0.875rem;font-weight:400;line-height:20px;color:var(--nylas-base-600)}.nylas-calendar-picker .nylas-calendar-picker__loading{padding-bottom:1rem}.nylas-calendar-picker .nylas-calendar-picker__loading .label{display:flex;align-items:center;gap:0.5rem;margin:1rem 1rem 0;color:var(--nylas-base-800)}.nylas-calendar-picker .nylas-calendar-picker__loading .loading-button{margin:0 1rem;padding:0;width:inherit;height:48px;color:black;font-size:1rem;cursor:not-allowed;display:flex;gap:0.5rem;justify-content:space-between;align-items:center;background:transparent;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}.nylas-calendar-picker .nylas-calendar-picker__loading .loading-button span{padding:0 1rem}.nylas-calendar-picker .nylas-calendar-picker__dropdown{padding:1rem}", Xe = Je;
|
|
402
|
-
var Ge = function(e, t, a, n) {
|
|
403
|
-
var r = arguments.length, i = r < 3 ? t : n === null ? n = Object.getOwnPropertyDescriptor(t, a) : n, l;
|
|
404
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
405
|
-
i = Reflect.decorate(e, t, a, n);
|
|
406
|
-
else
|
|
407
|
-
for (var o = e.length - 1; o >= 0; o--)
|
|
408
|
-
(l = e[o]) && (i = (r < 3 ? l(i) : r > 3 ? l(t, a, i) : l(t, a)) || i);
|
|
409
|
-
return r > 3 && i && Object.defineProperty(t, a, i), i;
|
|
410
|
-
}, se = function(e, t) {
|
|
411
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
412
|
-
return Reflect.metadata(e, t);
|
|
413
|
-
};
|
|
414
|
-
const ue = class {
|
|
415
|
-
constructor(e) {
|
|
416
|
-
u(this, e), this.selectedCalendarsChanged = K(this, "selectedCalendarsChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.calendars = void 0, this.organizerEmail = void 0, this.name = "calendar", this.defaultSelectedCalendars = [], this.selectedCalendars = [];
|
|
417
|
-
}
|
|
418
|
-
connectedCallback() {
|
|
419
|
-
d("nylas-calendar-picker", "connectedCallback");
|
|
420
|
-
}
|
|
421
|
-
disconnectedCallback() {
|
|
422
|
-
d("nylas-calendar-picker", "disconnectedCallback");
|
|
423
|
-
}
|
|
424
|
-
componentWillLoad() {
|
|
425
|
-
d("nylas-calendar-picker", "componentWillLoad"), this.host.setAttribute("name", this.name);
|
|
426
|
-
}
|
|
427
|
-
componentDidLoad() {
|
|
428
|
-
d("nylas-calendar-picker", "componentDidLoad"), typeof this.internals.setFormValue == "function" && this.internals.setFormValue(this.defaultSelectedCalendars.toString(), "calendar");
|
|
429
|
-
}
|
|
430
|
-
componentWillUpdate() {
|
|
431
|
-
d("nylas-calendar-picker", "componentWillUpdate");
|
|
432
|
-
}
|
|
433
|
-
componentDidUpdate() {
|
|
434
|
-
d("nylas-calendar-picker", "componentDidUpdate");
|
|
435
|
-
}
|
|
436
|
-
componentWillRender() {
|
|
437
|
-
d("nylas-calendar-picker", "componentWillRender");
|
|
438
|
-
}
|
|
439
|
-
componentDidRender() {
|
|
440
|
-
d("nylas-calendar-picker", "componentDidRender");
|
|
441
|
-
}
|
|
442
|
-
elementNameChangedHandler(e) {
|
|
443
|
-
d("nylas-calendar-picker", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
|
|
444
|
-
}
|
|
445
|
-
selectedOptionsChangedHandler(e) {
|
|
446
|
-
d("nylas-calendar-picker", "selectedOptionChangedHandler", e.detail);
|
|
447
|
-
const t = (a) => {
|
|
448
|
-
const { value: n } = a.detail;
|
|
449
|
-
this.selectedCalendars = [...n], this.internals.setFormValue(n.toString(), "calendar");
|
|
450
|
-
};
|
|
451
|
-
this.selectedCalendarsChanged.emit({ ...e.detail, selectedCalendarsChangedHandler: t });
|
|
452
|
-
}
|
|
453
|
-
render() {
|
|
454
|
-
var a;
|
|
455
|
-
const e = ((a = this.calendars) == null ? void 0 : a.map((n) => {
|
|
456
|
-
var r, i;
|
|
457
|
-
return {
|
|
458
|
-
value: n.id,
|
|
459
|
-
label: n.name,
|
|
460
|
-
selected: ((r = this.defaultSelectedCalendars) == null ? void 0 : r.includes(n.id)) || ((i = this.defaultSelectedCalendars) == null ? void 0 : i.includes("primary")) && n.id === this.organizerEmail
|
|
461
|
-
};
|
|
462
|
-
})) ?? [], t = this.defaultSelectedCalendars ?? [e[0].value];
|
|
463
|
-
return s(E, null, s("div", { class: "nylas-calendar-picker" }, s("div", { class: "header", part: "ncp__header" }, s("h3", null, "Calendar availability"), s("p", null, "Select calendars that you’d like to use for checking your availability.")), e.length > 0 ? s("div", { class: "nylas-calendar-picker__dropdown" }, s("multi-select-dropdown", { name: "calendar", label: "Only schedule meetings when I'm available on", options: e, defaultSelectedOptions: t }, s("span", { slot: "label-icon" }, s("tooltip-component", null, s("info-icon", { slot: "tooltip-icon" }), s("span", { slot: "tooltip-content" }, "When selecting multiple calendars, the time slot must be open on all chosen calendars for it to be visible to an attendee on the Scheduling page."))))) : s("div", { class: "nylas-calendar-picker__loading" }, s("span", { class: "label" }, "Select calendars that will be checked for availability ", s("info-icon", null)), s("div", { class: "loading-button" }, s("span", null, "Loading...")))));
|
|
464
|
-
}
|
|
465
|
-
static get formAssociated() {
|
|
466
|
-
return !0;
|
|
467
|
-
}
|
|
468
|
-
get host() {
|
|
469
|
-
return S(this);
|
|
470
|
-
}
|
|
471
|
-
static get watchers() {
|
|
472
|
-
return {
|
|
473
|
-
name: ["elementNameChangedHandler"]
|
|
474
|
-
};
|
|
475
|
-
}
|
|
476
|
-
};
|
|
477
|
-
Ge([
|
|
478
|
-
N({
|
|
479
|
-
name: "nylas-calendar-picker",
|
|
480
|
-
eventToProps: {
|
|
481
|
-
selectedCalendarsChanged: async (e, t) => {
|
|
482
|
-
const { selectedCalendarsChangedHandler: a } = e.detail;
|
|
483
|
-
a && a(e);
|
|
484
|
-
}
|
|
485
|
-
},
|
|
486
|
-
fireRegisterEvent: !0
|
|
487
|
-
}),
|
|
488
|
-
se("design:type", Function),
|
|
489
|
-
se("design:paramtypes", []),
|
|
490
|
-
se("design:returntype", void 0)
|
|
491
|
-
], ue.prototype, "render", null);
|
|
492
|
-
ue.style = Xe;
|
|
493
|
-
const qe = ":host{--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-event-description{display:flex;flex-direction:column;gap:4px}.nylas-event-description span{color:var(--nylas-base-nylas-base-800-aaa, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%;}.nylas-event-description textarea{padding:12px 16px;border-width:1;resize:vertical;border-radius:8px;border:1px solid var(--Nylas-base-Nylas-base-200, #b3b8d8)}.nylas-event-description textarea::-webkit-resizer{display:none}", Qe = qe;
|
|
494
|
-
var et = function(e, t, a, n) {
|
|
495
|
-
var r = arguments.length, i = r < 3 ? t : n === null ? n = Object.getOwnPropertyDescriptor(t, a) : n, l;
|
|
496
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
497
|
-
i = Reflect.decorate(e, t, a, n);
|
|
498
|
-
else
|
|
499
|
-
for (var o = e.length - 1; o >= 0; o--)
|
|
500
|
-
(l = e[o]) && (i = (r < 3 ? l(i) : r > 3 ? l(t, a, i) : l(t, a)) || i);
|
|
501
|
-
return r > 3 && i && Object.defineProperty(t, a, i), i;
|
|
502
|
-
}, re = function(e, t) {
|
|
503
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
504
|
-
return Reflect.metadata(e, t);
|
|
505
|
-
};
|
|
506
|
-
const ve = class {
|
|
507
|
-
constructor(e) {
|
|
508
|
-
u(this, e), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.eventDescription = void 0, this.description = this.eventDescription ?? "", this.name = "description";
|
|
509
|
-
}
|
|
510
|
-
elementNameChangedHandler(e) {
|
|
511
|
-
d("nylas-event-description", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
|
|
512
|
-
}
|
|
513
|
-
connectedCallback() {
|
|
514
|
-
d("nylas-event-description", "connectedCallback");
|
|
515
|
-
}
|
|
516
|
-
componentWillLoad() {
|
|
517
|
-
d("nylas-event-description", "componentWillLoad"), this.host.setAttribute("name", this.name);
|
|
518
|
-
}
|
|
519
|
-
componentDidLoad() {
|
|
520
|
-
d("nylas-event-description", "componentDidLoad");
|
|
521
|
-
}
|
|
522
|
-
disconnectedCallback() {
|
|
523
|
-
d("nylas-event-description", "disconnectedCallback");
|
|
524
|
-
}
|
|
525
|
-
handleChange(e) {
|
|
526
|
-
this.description = e.target.value, this.internals.setFormValue(e.target.value, "description");
|
|
527
|
-
}
|
|
528
|
-
render() {
|
|
529
|
-
return s(E, { key: "9ce72affc0514ef34d4362566a73127001acbfcf" }, s("div", { key: "0214ece174d57b5f1b48551d0bf311fd6314e66d", class: "nylas-event-description" }, s("span", { key: "670039c8d29c953a25d3e7ff9fc8af1136688d39" }, "Event description"), s("textarea", { key: "80775cb98f237b0415d3f06165ad322cf79d00ff", name: "description", value: this.description, onInput: (e) => this.handleChange(e) })));
|
|
530
|
-
}
|
|
531
|
-
static get formAssociated() {
|
|
532
|
-
return !0;
|
|
533
|
-
}
|
|
534
|
-
get host() {
|
|
535
|
-
return S(this);
|
|
536
|
-
}
|
|
537
|
-
static get watchers() {
|
|
538
|
-
return {
|
|
539
|
-
name: ["elementNameChangedHandler"]
|
|
540
|
-
};
|
|
541
|
-
}
|
|
542
|
-
};
|
|
543
|
-
et([
|
|
544
|
-
N({
|
|
545
|
-
name: "nylas-event-description",
|
|
546
|
-
eventToProps: {},
|
|
547
|
-
fireRegisterEvent: !0
|
|
548
|
-
}),
|
|
549
|
-
re("design:type", Function),
|
|
550
|
-
re("design:paramtypes", []),
|
|
551
|
-
re("design:returntype", void 0)
|
|
552
|
-
], ve.prototype, "render", null);
|
|
553
|
-
ve.style = Qe;
|
|
554
|
-
const tt = ":host{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-event-duration{display:flex;flex-direction:column;gap:4px}.nylas-event-duration span{color:var(--nylas-base-nylas-base-800-aaa, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%;}.nylas-event-duration span span{color:var(--nylas-error, #cc4841)}.nylas-event-duration__wrapper{display:flex;justify-content:space-between;align-items:center;gap:0.5rem}.nylas-event-duration__wrapper input{padding:12px 16px;border-width:1;border-radius:8px;border:1px solid var(--Nylas-base-Nylas-base-200, #b3b8d8)}", at = tt;
|
|
555
|
-
var nt = function(e, t, a, n) {
|
|
556
|
-
var r = arguments.length, i = r < 3 ? t : n === null ? n = Object.getOwnPropertyDescriptor(t, a) : n, l;
|
|
557
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
558
|
-
i = Reflect.decorate(e, t, a, n);
|
|
559
|
-
else
|
|
560
|
-
for (var o = e.length - 1; o >= 0; o--)
|
|
561
|
-
(l = e[o]) && (i = (r < 3 ? l(i) : r > 3 ? l(t, a, i) : l(t, a)) || i);
|
|
562
|
-
return r > 3 && i && Object.defineProperty(t, a, i), i;
|
|
563
|
-
}, le = function(e, t) {
|
|
564
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
565
|
-
return Reflect.metadata(e, t);
|
|
566
|
-
};
|
|
567
|
-
const ge = class {
|
|
568
|
-
constructor(e) {
|
|
569
|
-
u(this, e), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.name = "duration", this.eventDurationMinutes = void 0, this.duration = this.eventDurationMinutes ? this.eventDurationMinutes >= 60 ? this.eventDurationMinutes / 60 : this.eventDurationMinutes : 10, this.durationMinutes = this.eventDurationMinutes ?? 10, this.durationIncrement = this.eventDurationMinutes && this.eventDurationMinutes >= 60 ? 60 : 1;
|
|
570
|
-
}
|
|
571
|
-
elementNameChangedHandler(e) {
|
|
572
|
-
d("nylas-event-duration", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
|
|
573
|
-
}
|
|
574
|
-
connectedCallback() {
|
|
575
|
-
d("nylas-event-duration", "connectedCallback");
|
|
576
|
-
}
|
|
577
|
-
componentWillLoad() {
|
|
578
|
-
d("nylas-event-duration", "componentWillLoad"), this.host.setAttribute("name", this.name);
|
|
579
|
-
}
|
|
580
|
-
componentDidLoad() {
|
|
581
|
-
d("nylas-event-duration", "componentDidLoad"), this.internals.setFormValue(this.durationMinutes.toString(), "duration");
|
|
582
|
-
}
|
|
583
|
-
disconnectedCallback() {
|
|
584
|
-
d("nylas-event-duration", "disconnectedCallback");
|
|
585
|
-
}
|
|
586
|
-
handleChange(e) {
|
|
587
|
-
this.duration = e.target.value, this.durationMinutes = this.duration * this.durationIncrement, this.internals.setFormValue(this.durationMinutes.toString(), "duration");
|
|
588
|
-
}
|
|
589
|
-
handleBlur() {
|
|
590
|
-
console.log("on blur duration" + this.duration, this.duration, this.durationIncrement), (this.duration === null || this.duration === void 0) && this.durationIncrement === 1 && (this.duration = 10), (this.duration <= 0 || this.duration === null || this.duration === void 0) && this.durationIncrement === 60 && (this.duration = 1), this.duration < 10 && this.durationIncrement === 1 && (this.duration = 10), this.duration > 720 && this.durationIncrement === 1 && (this.duration = 720), this.duration > 12 && this.durationIncrement === 60 && (this.duration = 12), this.durationMinutes = this.duration * this.durationIncrement, this.internals.setFormValue(this.durationMinutes.toString(), "duration");
|
|
591
|
-
}
|
|
592
|
-
selectedOptionChangedHandler(e) {
|
|
593
|
-
d("nylas-calendar-picker", "selectedOptionChangedHandler", e.detail);
|
|
594
|
-
const { value: t } = e.detail;
|
|
595
|
-
this.durationIncrement = parseInt(t), this.durationIncrement === 1 ? this.duration = 10 : this.duration = 1, this.durationMinutes = this.duration * this.durationIncrement, this.internals.setFormValue(this.durationMinutes.toString(), "duration");
|
|
596
|
-
}
|
|
597
|
-
render() {
|
|
598
|
-
const e = [
|
|
599
|
-
{ value: 1, label: "minutes" },
|
|
600
|
-
{ value: 60, label: "hours" }
|
|
601
|
-
];
|
|
602
|
-
return s(E, { key: "865d546fd5a00a80491c87ede2da950fdeebae63" }, s("div", { key: "04ed91e87c31cf1332003173ff0bcc43a8d44e0b", class: "nylas-event-duration" }, s("span", { key: "c80ec90827aa06635fe22dc9109f905571fc9668" }, "Event duration", s("span", { key: "9f6a16d40771a5dffefb2a2dbe74f4f525e9d102" }, "*")), s("div", { key: "5c0f475c25dab78696a1163bb5db452013cbac21", class: "nylas-event-duration__wrapper" }, s("input", { key: "695a40294e996cba76c2cb300906a24e73e99497", type: "number", name: "duration", value: this.duration, onBlur: () => this.handleBlur(), onInput: (t) => this.handleChange(t) }), s("select-dropdown", { key: "ac2948b82048c9f81bc391c4743bf3148622b054", name: "event-duration", options: e, defaultSelectedOption: e.find((t) => t.value == this.durationIncrement) ?? e[0], withSearch: !1 }))));
|
|
603
|
-
}
|
|
604
|
-
static get formAssociated() {
|
|
605
|
-
return !0;
|
|
606
|
-
}
|
|
607
|
-
get host() {
|
|
608
|
-
return S(this);
|
|
609
|
-
}
|
|
610
|
-
static get watchers() {
|
|
611
|
-
return {
|
|
612
|
-
name: ["elementNameChangedHandler"]
|
|
613
|
-
};
|
|
614
|
-
}
|
|
615
|
-
};
|
|
616
|
-
nt([
|
|
617
|
-
N({
|
|
618
|
-
name: "nylas-event-duration",
|
|
619
|
-
eventToProps: {},
|
|
620
|
-
fireRegisterEvent: !0
|
|
621
|
-
}),
|
|
622
|
-
le("design:type", Function),
|
|
623
|
-
le("design:paramtypes", []),
|
|
624
|
-
le("design:returntype", void 0)
|
|
625
|
-
], ge.prototype, "render", null);
|
|
626
|
-
ge.style = at;
|
|
627
|
-
const it = ":host{display:block;margin:1rem;--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-event-info__title{color:var(--nylas-base-nylas-base-900-aaa, #101323);font-size:16px;font-style:normal;font-weight:600;line-height:20px;}.nylas-event-info__subtitle{color:var(--nylas-base-nylas-base-600-aaa, #3e4784);font-size:14px;font-style:normal;font-weight:400;line-height:20px;}.nylas-event-info__content{padding:1rem;display:flex;flex-direction:column;gap:1rem}.nylas-event-info__block{display:flex;justify-content:space-between;gap:0.5rem}", st = it;
|
|
628
|
-
var rt = function(e, t, a, n) {
|
|
629
|
-
var r = arguments.length, i = r < 3 ? t : n === null ? n = Object.getOwnPropertyDescriptor(t, a) : n, l;
|
|
630
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
631
|
-
i = Reflect.decorate(e, t, a, n);
|
|
632
|
-
else
|
|
633
|
-
for (var o = e.length - 1; o >= 0; o--)
|
|
634
|
-
(l = e[o]) && (i = (r < 3 ? l(i) : r > 3 ? l(t, a, i) : l(t, a)) || i);
|
|
635
|
-
return r > 3 && i && Object.defineProperty(t, a, i), i;
|
|
636
|
-
}, oe = function(e, t) {
|
|
637
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
638
|
-
return Reflect.metadata(e, t);
|
|
639
|
-
};
|
|
640
|
-
const xe = class {
|
|
641
|
-
constructor(e) {
|
|
642
|
-
u(this, e), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals);
|
|
643
|
-
}
|
|
644
|
-
connectedCallback() {
|
|
645
|
-
d("nylas-event-info", "connectedCallback");
|
|
646
|
-
}
|
|
647
|
-
componentWillLoad() {
|
|
648
|
-
d("nylas-event-info", "componentWillLoad");
|
|
649
|
-
}
|
|
650
|
-
componentDidLoad() {
|
|
651
|
-
d("nylas-event-info", "componentDidLoad");
|
|
652
|
-
}
|
|
653
|
-
disconnectedCallback() {
|
|
654
|
-
d("nylas-event-info", "disconnectedCallback");
|
|
655
|
-
}
|
|
656
|
-
render() {
|
|
657
|
-
return s(E, { key: "51b0b5ee1cb100d81b2e4bc362463e76cf622a7c" }, s("nylas-form-card", { key: "622f7bd1342930fdd87e58e91c8dc85b8f42c4da" }, s("h1", { key: "5180817bacbc4a250a818150015486cef6476dab", slot: "header-title", class: "nylas-event-info__title" }, "Event information"), s("h3", { key: "a78155d0bbf65e30074923fce212ca1ba657eb02", slot: "header-subtitle", class: "nylas-event-info__subtitle" }, "Enter all event information."), s("div", { key: "51e393b952e7e038f7a79bf0ceca6db94b9e199c", slot: "content", class: "nylas-event-info__content" }, s("slot", { key: "119b963d96300abd7ed6f65bede1f5e5943a9eb6", name: "inputs" }))));
|
|
658
|
-
}
|
|
659
|
-
static get formAssociated() {
|
|
660
|
-
return !0;
|
|
661
|
-
}
|
|
662
|
-
};
|
|
663
|
-
rt([
|
|
664
|
-
N({
|
|
665
|
-
name: "nylas-event-info",
|
|
666
|
-
eventToProps: {},
|
|
667
|
-
fireRegisterEvent: !0
|
|
668
|
-
}),
|
|
669
|
-
oe("design:type", Function),
|
|
670
|
-
oe("design:paramtypes", []),
|
|
671
|
-
oe("design:returntype", void 0)
|
|
672
|
-
], xe.prototype, "render", null);
|
|
673
|
-
xe.style = st;
|
|
674
|
-
const lt = ":host{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-event-title{display:flex;flex-direction:column;gap:4px}.nylas-event-title input{padding:12px 16px;border-width:1;border-radius:8px;border:1px solid var(--Nylas-base-Nylas-base-200, #b3b8d8)}.nylas-event-title span{color:var(--nylas-base-nylas-base-800-aaa, #293056);font-size:14px;font-style:normal;font-weight:400;line-height:150%;}.nylas-event-title span span{color:var(--nylas-error, #cc4841)}", ot = lt;
|
|
675
|
-
var dt = function(e, t, a, n) {
|
|
676
|
-
var r = arguments.length, i = r < 3 ? t : n === null ? n = Object.getOwnPropertyDescriptor(t, a) : n, l;
|
|
677
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
678
|
-
i = Reflect.decorate(e, t, a, n);
|
|
679
|
-
else
|
|
680
|
-
for (var o = e.length - 1; o >= 0; o--)
|
|
681
|
-
(l = e[o]) && (i = (r < 3 ? l(i) : r > 3 ? l(t, a, i) : l(t, a)) || i);
|
|
682
|
-
return r > 3 && i && Object.defineProperty(t, a, i), i;
|
|
683
|
-
}, de = function(e, t) {
|
|
684
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
685
|
-
return Reflect.metadata(e, t);
|
|
686
|
-
};
|
|
687
|
-
const ke = class {
|
|
688
|
-
constructor(e) {
|
|
689
|
-
u(this, e), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.eventTitle = void 0, this.title = this.eventTitle ?? "", this.name = "availability";
|
|
690
|
-
}
|
|
691
|
-
elementNameChangedHandler(e) {
|
|
692
|
-
d("nylas-event-title", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
|
|
693
|
-
}
|
|
694
|
-
connectedCallback() {
|
|
695
|
-
d("nylas-event-title", "connectedCallback");
|
|
696
|
-
}
|
|
697
|
-
componentWillLoad() {
|
|
698
|
-
d("nylas-event-title", "componentWillLoad"), this.host.setAttribute("name", this.name);
|
|
699
|
-
}
|
|
700
|
-
componentDidLoad() {
|
|
701
|
-
d("nylas-event-title", "componentDidLoad");
|
|
702
|
-
}
|
|
703
|
-
disconnectedCallback() {
|
|
704
|
-
d("nylas-event-title", "disconnectedCallback");
|
|
705
|
-
}
|
|
706
|
-
handleChange(e) {
|
|
707
|
-
this.title = e.target.value, this.internals.setFormValue(e.target.value, "title");
|
|
708
|
-
}
|
|
709
|
-
render() {
|
|
710
|
-
return s(E, { key: "09c9b2bae4a00656fe226ecf51d3800381cd52da" }, s("div", { key: "3ffbc5f35edf88831014b18ed4fc719953b344ab", class: "nylas-event-title" }, s("span", { key: "6fd19b8268c7d5d2a048357bdc03eee1a84ef42c" }, "Event title", s("span", { key: "5ecccdc80f6ecf1fb7cdcacbbc789c9cc0e61f2a" }, "*")), s("input", { key: "ec68df2d717858da7562388db96f8c0413afe22c", type: "text", name: "title", value: this.title, onInput: (e) => this.handleChange(e) })));
|
|
711
|
-
}
|
|
712
|
-
static get formAssociated() {
|
|
713
|
-
return !0;
|
|
714
|
-
}
|
|
715
|
-
get host() {
|
|
716
|
-
return S(this);
|
|
717
|
-
}
|
|
718
|
-
static get watchers() {
|
|
719
|
-
return {
|
|
720
|
-
name: ["elementNameChangedHandler"]
|
|
721
|
-
};
|
|
722
|
-
}
|
|
723
|
-
};
|
|
724
|
-
dt([
|
|
725
|
-
N({
|
|
726
|
-
name: "nylas-event-title",
|
|
727
|
-
eventToProps: {},
|
|
728
|
-
fireRegisterEvent: !0
|
|
729
|
-
}),
|
|
730
|
-
de("design:type", Function),
|
|
731
|
-
de("design:paramtypes", []),
|
|
732
|
-
de("design:returntype", void 0)
|
|
733
|
-
], ke.prototype, "render", null);
|
|
734
|
-
ke.style = ot;
|
|
735
|
-
var we = { exports: {} };
|
|
736
|
-
(function(e, t) {
|
|
737
|
-
(function(a, n) {
|
|
738
|
-
e.exports = n();
|
|
739
|
-
})(Ie, function() {
|
|
740
|
-
var a = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, n = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, r = /\d\d/, i = /\d\d?/, l = /\d*[^-_:/,()\s\d]+/, o = {}, m = function(c) {
|
|
741
|
-
return (c = +c) + (c > 68 ? 1900 : 2e3);
|
|
742
|
-
}, h = function(c) {
|
|
743
|
-
return function(p) {
|
|
744
|
-
this[c] = +p;
|
|
745
|
-
};
|
|
746
|
-
}, x = [/[+-]\d\d:?(\d\d)?|Z/, function(c) {
|
|
747
|
-
(this.zone || (this.zone = {})).offset = function(p) {
|
|
748
|
-
if (!p || p === "Z")
|
|
749
|
-
return 0;
|
|
750
|
-
var f = p.match(/([+-]|\d\d)/g), y = 60 * f[1] + (+f[2] || 0);
|
|
751
|
-
return y === 0 ? 0 : f[0] === "+" ? -y : y;
|
|
752
|
-
}(c);
|
|
753
|
-
}], b = function(c) {
|
|
754
|
-
var p = o[c];
|
|
755
|
-
return p && (p.indexOf ? p : p.s.concat(p.f));
|
|
756
|
-
}, k = function(c, p) {
|
|
757
|
-
var f, y = o.meridiem;
|
|
758
|
-
if (y) {
|
|
759
|
-
for (var C = 1; C <= 24; C += 1)
|
|
760
|
-
if (c.indexOf(y(C, 0, p)) > -1) {
|
|
761
|
-
f = C > 12;
|
|
762
|
-
break;
|
|
763
|
-
}
|
|
764
|
-
} else
|
|
765
|
-
f = c === (p ? "pm" : "PM");
|
|
766
|
-
return f;
|
|
767
|
-
}, Ce = { A: [l, function(c) {
|
|
768
|
-
this.afternoon = k(c, !1);
|
|
769
|
-
}], a: [l, function(c) {
|
|
770
|
-
this.afternoon = k(c, !0);
|
|
771
|
-
}], S: [/\d/, function(c) {
|
|
772
|
-
this.milliseconds = 100 * +c;
|
|
773
|
-
}], SS: [r, function(c) {
|
|
774
|
-
this.milliseconds = 10 * +c;
|
|
775
|
-
}], SSS: [/\d{3}/, function(c) {
|
|
776
|
-
this.milliseconds = +c;
|
|
777
|
-
}], s: [i, h("seconds")], ss: [i, h("seconds")], m: [i, h("minutes")], mm: [i, h("minutes")], H: [i, h("hours")], h: [i, h("hours")], HH: [i, h("hours")], hh: [i, h("hours")], D: [i, h("day")], DD: [r, h("day")], Do: [l, function(c) {
|
|
778
|
-
var p = o.ordinal, f = c.match(/\d+/);
|
|
779
|
-
if (this.day = f[0], p)
|
|
780
|
-
for (var y = 1; y <= 31; y += 1)
|
|
781
|
-
p(y).replace(/\[|\]/g, "") === c && (this.day = y);
|
|
782
|
-
}], M: [i, h("month")], MM: [r, h("month")], MMM: [l, function(c) {
|
|
783
|
-
var p = b("months"), f = (b("monthsShort") || p.map(function(y) {
|
|
784
|
-
return y.slice(0, 3);
|
|
785
|
-
})).indexOf(c) + 1;
|
|
786
|
-
if (f < 1)
|
|
787
|
-
throw new Error();
|
|
788
|
-
this.month = f % 12 || f;
|
|
789
|
-
}], MMMM: [l, function(c) {
|
|
790
|
-
var p = b("months").indexOf(c) + 1;
|
|
791
|
-
if (p < 1)
|
|
792
|
-
throw new Error();
|
|
793
|
-
this.month = p % 12 || p;
|
|
794
|
-
}], Y: [/[+-]?\d+/, h("year")], YY: [r, function(c) {
|
|
795
|
-
this.year = m(c);
|
|
796
|
-
}], YYYY: [/\d{4}/, h("year")], Z: x, ZZ: x };
|
|
797
|
-
function _e(c) {
|
|
798
|
-
var p, f;
|
|
799
|
-
p = c, f = o && o.formats;
|
|
800
|
-
for (var y = (c = p.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(z, D, w) {
|
|
801
|
-
var v = w && w.toUpperCase();
|
|
802
|
-
return D || f[w] || a[w] || f[v].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(I, $, H) {
|
|
803
|
-
return $ || H.slice(1);
|
|
804
|
-
});
|
|
805
|
-
})).match(n), C = y.length, _ = 0; _ < C; _ += 1) {
|
|
806
|
-
var Y = y[_], M = Ce[Y], T = M && M[0], O = M && M[1];
|
|
807
|
-
y[_] = O ? { regex: T, parser: O } : Y.replace(/^\[|\]$/g, "");
|
|
808
|
-
}
|
|
809
|
-
return function(z) {
|
|
810
|
-
for (var D = {}, w = 0, v = 0; w < C; w += 1) {
|
|
811
|
-
var I = y[w];
|
|
812
|
-
if (typeof I == "string")
|
|
813
|
-
v += I.length;
|
|
814
|
-
else {
|
|
815
|
-
var $ = I.regex, H = I.parser, W = z.slice(v), F = $.exec(W)[0];
|
|
816
|
-
H.call(D, F), z = z.replace(F, "");
|
|
817
|
-
}
|
|
818
|
-
}
|
|
819
|
-
return function(L) {
|
|
820
|
-
var g = L.afternoon;
|
|
821
|
-
if (g !== void 0) {
|
|
822
|
-
var P = L.hours;
|
|
823
|
-
g ? P < 12 && (L.hours += 12) : P === 12 && (L.hours = 0), delete L.afternoon;
|
|
824
|
-
}
|
|
825
|
-
}(D), D;
|
|
826
|
-
};
|
|
827
|
-
}
|
|
828
|
-
return function(c, p, f) {
|
|
829
|
-
f.p.customParseFormat = !0, c && c.parseTwoDigitYear && (m = c.parseTwoDigitYear);
|
|
830
|
-
var y = p.prototype, C = y.parse;
|
|
831
|
-
y.parse = function(_) {
|
|
832
|
-
var Y = _.date, M = _.utc, T = _.args;
|
|
833
|
-
this.$u = M;
|
|
834
|
-
var O = T[1];
|
|
835
|
-
if (typeof O == "string") {
|
|
836
|
-
var z = T[2] === !0, D = T[3] === !0, w = z || D, v = T[2];
|
|
837
|
-
D && (v = T[2]), o = this.$locale(), !z && v && (o = f.Ls[v]), this.$d = function(W, F, L) {
|
|
838
|
-
try {
|
|
839
|
-
if (["x", "X"].indexOf(F) > -1)
|
|
840
|
-
return new Date((F === "X" ? 1e3 : 1) * W);
|
|
841
|
-
var g = _e(F)(W), P = g.year, Z = g.month, Te = g.day, Oe = g.hours, Ee = g.minutes, Se = g.seconds, De = g.milliseconds, ce = g.zone, B = /* @__PURE__ */ new Date(), J = Te || (P || Z ? 1 : B.getDate()), X = P || B.getFullYear(), U = 0;
|
|
842
|
-
P && !Z || (U = Z > 0 ? Z - 1 : B.getMonth());
|
|
843
|
-
var G = Oe || 0, q = Ee || 0, Q = Se || 0, ee = De || 0;
|
|
844
|
-
return ce ? new Date(Date.UTC(X, U, J, G, q, Q, ee + 60 * ce.offset * 1e3)) : L ? new Date(Date.UTC(X, U, J, G, q, Q, ee)) : new Date(X, U, J, G, q, Q, ee);
|
|
845
|
-
} catch {
|
|
846
|
-
return /* @__PURE__ */ new Date("");
|
|
847
|
-
}
|
|
848
|
-
}(Y, O, M), this.init(), v && v !== !0 && (this.$L = this.locale(v).$L), w && Y != this.format(O) && (this.$d = /* @__PURE__ */ new Date("")), o = {};
|
|
849
|
-
} else if (O instanceof Array)
|
|
850
|
-
for (var I = O.length, $ = 1; $ <= I; $ += 1) {
|
|
851
|
-
T[1] = O[$ - 1];
|
|
852
|
-
var H = f.apply(this, T);
|
|
853
|
-
if (H.isValid()) {
|
|
854
|
-
this.$d = H.$d, this.$L = H.$L, this.init();
|
|
855
|
-
break;
|
|
856
|
-
}
|
|
857
|
-
$ === I && (this.$d = /* @__PURE__ */ new Date(""));
|
|
858
|
-
}
|
|
859
|
-
else
|
|
860
|
-
C.call(this, _);
|
|
861
|
-
};
|
|
862
|
-
};
|
|
863
|
-
});
|
|
864
|
-
})(we);
|
|
865
|
-
const ct = we.exports, pt = ":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}.time-picker{display:inline-block;width:150px;position:relative}@media screen and (max-width: 768px){.time-picker{width:auto}}.time-picker input{width:150px;height:48px;text-align:center;font-size:1rem;cursor:pointer;background:transparent;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.time-picker input{width:98px}}.time-picker input.focus{background:transparent}.time-picker input:hover,.time-picker input:active{border:1px solid var(--nylas-primary)}.time-picker input:active{outline:2px solid var(--nylas-primary)}.time-picker input span.open{transform:rotate(90deg)}.time-picker input span.closed{transform:rotate(270deg)}.time-picker input.error{border:1px solid var(--nylas-error)}.time-picker p.error{color:var(--nylas-error);font-size:0.875rem;margin:0}.times{display:block;margin-top:0.5rem;background-color:var(--nylas-base-0);width:100%;max-height:336px;overflow:auto;border:1px solid #ddd;z-index:1;border-radius:4px;position:absolute;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}.times ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px}.times 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:center;cursor:pointer}.times ul li.focused{background-color:var(--nylas-base-100)}.times ul li:hover,.times ul li:focus{background-color:var(--nylas-base-100)}.times ul li label{display:flex;align-items:center;gap:0.5rem}.times ul li label input{margin:0}", ht = pt;
|
|
866
|
-
V.extend(ct);
|
|
867
|
-
const ft = class {
|
|
868
|
-
constructor(e) {
|
|
869
|
-
u(this, e), this.timeChange = K(this, "timeChange", 7), this.time = void 0, this.minimumStartTime = null, this.placeholder = "hh:mmam/pm", this.setTime = void 0, this.name = void 0, this.hasError = !1, this.setFormError = void 0, this.err = "", this.showTimes = !1, this.ariaActivedescendant = "", this.times = this.generateTimes(), this.shouldAutoScroll = !1;
|
|
870
|
-
}
|
|
871
|
-
handleOutsideClick(e) {
|
|
872
|
-
!e.composedPath().includes(this.el) && this.showTimes && (this.showTimes = !1);
|
|
873
|
-
}
|
|
874
|
-
minimumStartTimeChangedHandler() {
|
|
875
|
-
if (this.minimumStartTime) {
|
|
876
|
-
let e = V().hour(parseInt(this.minimumStartTime)).minute(parseInt(this.minimumStartTime.slice(-4, -2)));
|
|
877
|
-
this.minimumStartTime.slice(-2).toLowerCase() === "pm" && parseInt(this.minimumStartTime) !== 12 ? e = e.add(12, "hour") : this.minimumStartTime.slice(-2).toLowerCase() === "am" && parseInt(this.minimumStartTime) === 12 && (e = e.subtract(12, "hour")), this.times = this.generateTimes();
|
|
878
|
-
const t = V(this.times[0].value, "hh:mma");
|
|
879
|
-
V(this.time, "hh:mma").isBefore(t) && (this.err = "Invalid", this.setFormError(null, "Invalid"));
|
|
880
|
-
}
|
|
881
|
-
}
|
|
882
|
-
componentDidRender() {
|
|
883
|
-
if (this.showTimes && this.shouldAutoScroll) {
|
|
884
|
-
const e = te(this.time), t = this.times.findIndex((a) => a.value === e);
|
|
885
|
-
t > -1 && (this.shouldAutoScroll = !1, this.scrollToViewWithinParent(t));
|
|
886
|
-
return;
|
|
887
|
-
}
|
|
888
|
-
}
|
|
889
|
-
handleTimeChange(e, t) {
|
|
890
|
-
const a = t.split(":");
|
|
891
|
-
a[0] === "00" && a[1].slice(-2) == "pm" && (this.err = "Invalid", this.setFormError(e, "Invalid")), ae(t) ? (this.err = "", this.setFormError(null)) : (this.err = "Invalid", this.setFormError(e, "Invalid")), this.setTime(e, t), this.timeChange.emit(t);
|
|
892
|
-
}
|
|
893
|
-
handleTimeAutocomplete(e) {
|
|
894
|
-
var a;
|
|
895
|
-
const t = (a = e.target) == null ? void 0 : a.value;
|
|
896
|
-
if (!ae(t)) {
|
|
897
|
-
this.err = "Invalid", this.setFormError(e, "Invalid");
|
|
898
|
-
return;
|
|
899
|
-
}
|
|
900
|
-
if (t === "") {
|
|
901
|
-
const n = he().format("hh:mma");
|
|
902
|
-
this.setTime(e, n);
|
|
903
|
-
return;
|
|
904
|
-
}
|
|
905
|
-
if (!fe(t)) {
|
|
906
|
-
const n = te(t);
|
|
907
|
-
this.setTime(n);
|
|
908
|
-
return;
|
|
909
|
-
}
|
|
910
|
-
this.setTime(e, t);
|
|
911
|
-
}
|
|
912
|
-
handleOnInput(e) {
|
|
913
|
-
var a;
|
|
914
|
-
const t = (a = e.target) == null ? void 0 : a.value;
|
|
915
|
-
if (ae(t)) {
|
|
916
|
-
if (t === "") {
|
|
917
|
-
const n = he().format("hh:mma"), r = this.times.findIndex((i) => i.value === n);
|
|
918
|
-
r > -1 && this.scrollToViewWithinParent(r);
|
|
919
|
-
return;
|
|
920
|
-
}
|
|
921
|
-
if (!fe(t)) {
|
|
922
|
-
const n = te(t), r = this.times.findIndex((i) => i.value === n);
|
|
923
|
-
r > -1 && this.scrollToViewWithinParent(r);
|
|
924
|
-
return;
|
|
925
|
-
}
|
|
926
|
-
}
|
|
927
|
-
}
|
|
928
|
-
generateTimes() {
|
|
929
|
-
const e = [];
|
|
930
|
-
let t = V().set("hour", 0).set("minute", 0).set("second", 0);
|
|
931
|
-
this.minimumStartTime && (t = V(this.minimumStartTime, "hh:mma"));
|
|
932
|
-
const a = t.endOf("day").diff(t, "minutes"), n = Math.round(a / 15);
|
|
933
|
-
for (let r = 0; r < n + 1; r++) {
|
|
934
|
-
const i = t.add(r * 15, "minute");
|
|
935
|
-
if (r == n && i.format("hh:mma").includes("am"))
|
|
936
|
-
break;
|
|
937
|
-
e.push({ id: r, value: i.format("hh:mma") });
|
|
938
|
-
}
|
|
939
|
-
return e;
|
|
940
|
-
}
|
|
941
|
-
handleComboboxKeyDown(e) {
|
|
942
|
-
if (e.key === "ArrowDown") {
|
|
943
|
-
if (e.preventDefault(), !this.showTimes) {
|
|
944
|
-
this.showTimes = !0, this.shouldAutoScroll = !0;
|
|
945
|
-
return;
|
|
946
|
-
}
|
|
947
|
-
if (this.ariaActivedescendant === "")
|
|
948
|
-
this.ariaActivedescendant = this.times[0].id.toString(), this.focusOption(0);
|
|
949
|
-
else {
|
|
950
|
-
const t = this.times.findIndex((n) => n.id.toString() === this.ariaActivedescendant), a = t + 1 < this.times.length ? t + 1 : 0;
|
|
951
|
-
this.ariaActivedescendant = this.times[a].id.toString(), this.focusOption(a);
|
|
952
|
-
}
|
|
953
|
-
} else if (e.key === "ArrowUp")
|
|
954
|
-
if (e.preventDefault(), this.ariaActivedescendant === "")
|
|
955
|
-
this.ariaActivedescendant = this.times[this.times.length - 1].id.toString(), this.focusOption(this.times.length - 1);
|
|
956
|
-
else {
|
|
957
|
-
const t = this.times.findIndex((n) => n.id.toString() === this.ariaActivedescendant), a = t - 1 >= 0 ? t - 1 : this.times.length - 1;
|
|
958
|
-
this.ariaActivedescendant = this.times[a].id.toString(), this.focusOption(a);
|
|
959
|
-
}
|
|
960
|
-
else
|
|
961
|
-
e.key === "Escape" && (this.showTimes = !1, this.timeInput.focus());
|
|
962
|
-
}
|
|
963
|
-
handleListboxKeydown(e) {
|
|
964
|
-
const t = this.times, a = t.findIndex((n) => n.id.toString() === this.ariaActivedescendant);
|
|
965
|
-
if (e.key === "ArrowDown" || e.key === "Tab" && !e.shiftKey) {
|
|
966
|
-
e.preventDefault();
|
|
967
|
-
const n = a + 1 < t.length ? a + 1 : 0;
|
|
968
|
-
this.ariaActivedescendant = t[n].id.toString(), this.focusOption(n);
|
|
969
|
-
} else if (e.key === "ArrowUp" || e.key === "Tab" && e.shiftKey) {
|
|
970
|
-
e.preventDefault();
|
|
971
|
-
const n = a - 1 >= 0 ? a - 1 : t.length - 1;
|
|
972
|
-
this.ariaActivedescendant = t[n].id.toString(), this.focusOption(n);
|
|
973
|
-
} else if (e.key === "Enter") {
|
|
974
|
-
if (e.preventDefault(), this.ariaActivedescendant) {
|
|
975
|
-
const n = t[a];
|
|
976
|
-
this.handleTimeChange(e, n.value), this.showTimes = !1, this.ariaActivedescendant = "", this.timeInput.focus();
|
|
977
|
-
}
|
|
978
|
-
} else
|
|
979
|
-
e.key === "Escape" && (this.showTimes = !1, this.timeInput.focus());
|
|
980
|
-
}
|
|
981
|
-
scrollToViewWithinParent(e) {
|
|
982
|
-
var l;
|
|
983
|
-
const t = this.times[e], a = (l = this.el.shadowRoot) == null ? void 0 : l.getElementById(t.id.toString()), n = this.timeMenu;
|
|
984
|
-
this.ariaActivedescendant = t.id.toString();
|
|
985
|
-
const r = a.getBoundingClientRect(), i = n.getBoundingClientRect();
|
|
986
|
-
r.top < i.top ? n.scrollTop -= i.top - r.top : r.bottom > i.bottom && (n.scrollTop += r.bottom - i.bottom), r.left < i.left ? n.scrollLeft -= i.left - r.left : r.right > i.right && (n.scrollLeft += r.right - i.right);
|
|
987
|
-
}
|
|
988
|
-
focusOption(e) {
|
|
989
|
-
var r;
|
|
990
|
-
const t = this.times[e];
|
|
991
|
-
if (!t)
|
|
992
|
-
return;
|
|
993
|
-
const a = t.id.toString(), n = (r = this.el.shadowRoot) == null ? void 0 : r.getElementById(a);
|
|
994
|
-
n && (n.focus(), n.scrollIntoView({ behavior: "smooth", block: "nearest" }));
|
|
995
|
-
}
|
|
996
|
-
render() {
|
|
997
|
-
return s(E, { key: "a9ca940f0e6ecc5d67ba71e11bdc4ba72b8f9afa" }, s("div", { key: "c5b8768e687814eba088370dea00cf3c74767769", class: "time-picker" }, s("input", { key: "5a3e2ee11694647ba3ccb24e5bd8fdced0c804b4", type: "text", name: this.name, id: this.name, class: {
|
|
998
|
-
"time-input": !0,
|
|
999
|
-
error: !!this.err || this.hasError
|
|
1000
|
-
}, ref: (e) => this.timeInput = e, value: this.time, onClick: () => {
|
|
1001
|
-
this.showTimes = !0, this.shouldAutoScroll = !0;
|
|
1002
|
-
}, "aria-haspopup": "listbox", "aria-label": this.name, "aria-expanded": this.showTimes ? "true" : "false", placeholder: this.placeholder, onKeyDown: (e) => this.handleComboboxKeyDown(e), onInput: (e) => this.handleOnInput(e), onBlur: (e) => this.handleTimeAutocomplete(e) }), this.err && s("div", { class: "invalid-time-icon" }), this.showTimes && s("div", { class: "times", ref: (e) => this.timeMenu = e }, s("ul", { tabindex: "-1", role: "listbox", "aria-label": this.name, "aria-activedescendant": this.ariaActivedescendant, onKeyDown: (e) => this.handleListboxKeydown(e) }, this.times.map((e) => s("li", { tabindex: "0", key: e.id, id: e.id.toString(), class: {
|
|
1003
|
-
focused: this.ariaActivedescendant === e.id.toString()
|
|
1004
|
-
}, onClick: (t) => {
|
|
1005
|
-
this.handleTimeChange(t, e.value), this.showTimes = !1, this.timeInput.focus();
|
|
1006
|
-
}, role: "option" }, `${e.value}`)))), !this.showTimes && this.err && s("p", { class: "error", id: "email-error" }, this.err)));
|
|
1007
|
-
}
|
|
1008
|
-
get el() {
|
|
1009
|
-
return S(this);
|
|
1010
|
-
}
|
|
1011
|
-
static get watchers() {
|
|
1012
|
-
return {
|
|
1013
|
-
minimumStartTime: ["minimumStartTimeChangedHandler"]
|
|
1014
|
-
};
|
|
1015
|
-
}
|
|
1016
|
-
};
|
|
1017
|
-
ft.style = ht;
|
|
1018
|
-
const yt = '.tooltip-container{position:relative;display:inline-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}.tooltip-content{visibility:hidden;background-color:var(--nylas-base-800);color:var(--nylas-base-0);text-align:center;border-radius:6px;padding:5px 0;position:absolute;z-index:1;opacity:0;transition:opacity 0.3s;padding:0.5rem 1rem;max-width:200px;width:max-content}.tooltip-content.top{bottom:0;left:0;margin-bottom:1.25rem;transform:translateX(-50%)}.tooltip-content.right{top:50%;left:0%;margin-left:1.25rem;transform:translateY(-50%)}.tooltip-content.bottom{top:0;left:0;margin-top:1.25rem;transform:translateX(-50%)}.tooltip-content.left{top:50%;right:0%;margin-right:1.25rem;transform:translateY(-50%)}.tooltip-container:hover .tooltip-content,.tooltip-container:focus-within .tooltip-content{visibility:visible;opacity:1}.tooltip-content::after{content:"";position:absolute;top:-0.75rem;left:50%;transform:rotate(180deg);border-width:6px;border-style:solid;border-color:black transparent transparent transparent}.tooltip-content.top::after{top:100%;left:50%;transform:rotate(0deg)}.tooltip-content.bottom::after{top:-0.75rem;left:50%;transform:rotate(180deg)}.tooltip-content.left::after{top:47.5%;left:100%;transform:rotate(270deg)}.tooltip-content.right::after{top:47.5%;left:-0.75rem;transform:rotate(90deg)}', mt = yt, bt = class {
|
|
1019
|
-
constructor(e) {
|
|
1020
|
-
u(this, e), this.position = "bottom";
|
|
1021
|
-
}
|
|
1022
|
-
showTooltip(e) {
|
|
1023
|
-
e.target.nextElementSibling.style.visibility = "visible", e.target.nextElementSibling.style.opacity = "1";
|
|
1024
|
-
}
|
|
1025
|
-
hideTooltip(e) {
|
|
1026
|
-
e.target.nextElementSibling.style.visibility = "hidden", e.target.nextElementSibling.style.opacity = "0";
|
|
1027
|
-
}
|
|
1028
|
-
render() {
|
|
1029
|
-
return s("div", { key: "17c8fe0c2bda1b075857ff0d852a9988e954e888", class: "tooltip-container" }, s("span", { key: "0b77ce5466902f1b65a08d468d4f66405fefe140", class: "info-icon", tabindex: "0", onFocus: this.showTooltip.bind(this), onBlur: this.hideTooltip.bind(this) }, s("slot", { key: "73c5ddae08da5e0231f5fcbcba453ec0c5167a28", name: "tooltip-icon" }, "i")), s("span", { key: "b57b0fe4faf74a854ea2b45d665a1814e7419e2e", class: `tooltip-content ${this.position}` }, s("slot", { key: "f8072d5c5ef07bad1eee82b802b95cd75d865710", name: "tooltip-content" }, "This is a help text.")));
|
|
1030
|
-
}
|
|
1031
|
-
get el() {
|
|
1032
|
-
return S(this);
|
|
1033
|
-
}
|
|
1034
|
-
};
|
|
1035
|
-
bt.style = mt;
|
|
1036
|
-
export {
|
|
1037
|
-
Me as add_circle_icon,
|
|
1038
|
-
Le as calendar_info_icon,
|
|
1039
|
-
Pe as calendar_patterns_icon,
|
|
1040
|
-
Ve as multi_select_dropdown,
|
|
1041
|
-
me as nylas_additional_participants,
|
|
1042
|
-
be as nylas_availability_picker,
|
|
1043
|
-
ue as nylas_calendar_picker,
|
|
1044
|
-
ve as nylas_event_description,
|
|
1045
|
-
ge as nylas_event_duration,
|
|
1046
|
-
xe as nylas_event_info,
|
|
1047
|
-
ke as nylas_event_title,
|
|
1048
|
-
ft as nylas_time_window_picker,
|
|
1049
|
-
bt as tooltip_component
|
|
1050
|
-
};
|