@nylas/web-elements 2.3.1-canary-20260108155609 → 2.3.1
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/cdn/nylas-scheduler-editor/nylas-scheduler-editor.es.js +228 -228
- package/dist/cdn/nylas-scheduling/nylas-scheduling.es.js +4069 -4071
- package/dist/cjs/google-logo-icon.microsoft-logo-icon.nylas-editor-tabs.nylas-editor-tabs-group.nylas-list-configurations.nylas-select-event-type.entry.cjs.js.map +1 -1
- package/dist/cjs/google-logo-icon_6.cjs.entry.js +7 -7
- package/dist/cjs/google-logo-icon_6.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-booked-event-card_11.cjs.entry.js +10 -2
- package/dist/cjs/nylas-booked-event-card_11.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-scheduler-editor.cjs.entry.js +1 -1
- package/dist/cjs/nylas-scheduling.cjs.entry.js +3 -16
- package/dist/cjs/nylas-scheduling.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-scheduling.entry.cjs.js.map +1 -1
- package/dist/cjs/{version-7tiQyQzm.js → version-TA6fPT8q.js} +3 -3
- package/dist/{esm/version-CJAr1BgW.js.map → cjs/version-TA6fPT8q.js.map} +1 -1
- package/dist/collection/components/scheduler/nylas-date-picker/nylas-date-picker.js +10 -2
- package/dist/collection/components/scheduler/nylas-date-picker/nylas-date-picker.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-editor-tabs-group/nylas-editor-tabs-group.js +6 -6
- package/dist/collection/components/scheduler-editor/nylas-editor-tabs-group/nylas-editor-tabs-group.js.map +1 -1
- package/dist/collection/connector/shared/api/scheduler.js +2 -18
- package/dist/collection/connector/shared/api/scheduler.js.map +1 -1
- package/dist/collection/version.js +1 -1
- package/dist/collection/version.js.map +1 -1
- package/dist/components/nylas-date-picker.js +1 -1
- package/dist/components/nylas-editor-tabs-group.js +1 -1
- package/dist/components/nylas-editor-tabs.js +1 -1
- package/dist/components/nylas-scheduler-editor.js +3 -3
- package/dist/components/nylas-scheduling.js +5 -18
- package/dist/components/nylas-scheduling.js.map +1 -1
- package/dist/components/{p-jdTk8JQH.js → p-BOnzTQbE.js} +3 -3
- package/dist/components/{p-jdTk8JQH.js.map → p-BOnzTQbE.js.map} +1 -1
- package/dist/components/{p-B_1k1rpl.js → p-BtSPSFdA.js} +3 -3
- package/dist/components/{p-B_1k1rpl.js.map → p-BtSPSFdA.js.map} +1 -1
- package/dist/components/{p-CfFKgyg4.js → p-CMouzL9_.js} +9 -9
- package/dist/components/{p-CfFKgyg4.js.map → p-CMouzL9_.js.map} +1 -1
- package/dist/components/{p-CrkAtQ72.js → p-D9LfvAE5.js} +12 -4
- package/dist/components/p-D9LfvAE5.js.map +1 -0
- package/dist/esm/google-logo-icon.microsoft-logo-icon.nylas-editor-tabs.nylas-editor-tabs-group.nylas-list-configurations.nylas-select-event-type.entry.js.map +1 -1
- package/dist/esm/google-logo-icon_6.entry.js +7 -7
- package/dist/esm/google-logo-icon_6.entry.js.map +1 -1
- package/dist/esm/nylas-booked-event-card_11.entry.js +10 -2
- package/dist/esm/nylas-booked-event-card_11.entry.js.map +1 -1
- package/dist/esm/nylas-scheduler-editor.entry.js +1 -1
- package/dist/esm/nylas-scheduling.entry.js +4 -17
- package/dist/esm/nylas-scheduling.entry.js.map +1 -1
- package/dist/esm/{version-CJAr1BgW.js → version-CIhCCVPS.js} +3 -3
- package/dist/{cjs/version-7tiQyQzm.js.map → esm/version-CIhCCVPS.js.map} +1 -1
- package/dist/nylas-web-elements/google-logo-icon.microsoft-logo-icon.nylas-editor-tabs.nylas-editor-tabs-group.nylas-list-configurations.nylas-select-event-type.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/nylas-scheduling.entry.esm.js.map +1 -1
- package/dist/nylas-web-elements/nylas-web-elements.esm.js +1 -1
- package/dist/nylas-web-elements/{p-a80bea66.entry.js → p-10b9c8eb.entry.js} +2 -2
- package/dist/nylas-web-elements/p-197e9602.entry.js +2 -0
- package/dist/nylas-web-elements/p-197e9602.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-9a4d5f1b.entry.js → p-6ed560fe.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-9a4d5f1b.entry.js.map → p-6ed560fe.entry.js.map} +1 -1
- package/dist/nylas-web-elements/p-CIhCCVPS.js +2 -0
- package/dist/nylas-web-elements/{p-CJAr1BgW.js.map → p-CIhCCVPS.js.map} +1 -1
- package/dist/nylas-web-elements/{p-544c4297.entry.js → p-ab80b127.entry.js} +2 -2
- package/dist/nylas-web-elements/p-ab80b127.entry.js.map +1 -0
- package/dist/types/connector/shared/api/scheduler.d.ts +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
- package/dist/components/p-CrkAtQ72.js.map +0 -1
- package/dist/nylas-web-elements/p-544c4297.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-CJAr1BgW.js +0 -2
- package/dist/nylas-web-elements/p-c3b1d596.entry.js +0 -2
- package/dist/nylas-web-elements/p-c3b1d596.entry.js.map +0 -1
- /package/dist/nylas-web-elements/{p-a80bea66.entry.js.map → p-10b9c8eb.entry.js.map} +0 -0
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
var u = /* @__PURE__ */ ((r) => (r.Error = "error", r.Warning = "warning", r.Info = "info", r.Success = "success", r))(u || {});
|
|
4
4
|
const o = (r) => r !== null && typeof r == "object" && "error" in r;
|
|
5
5
|
|
|
6
|
-
const version = '2.3.1
|
|
6
|
+
const version = '2.3.1';
|
|
7
7
|
|
|
8
8
|
exports.o = o;
|
|
9
9
|
exports.u = u;
|
|
10
10
|
exports.version = version;
|
|
11
|
-
//# sourceMappingURL=version-
|
|
11
|
+
//# sourceMappingURL=version-TA6fPT8q.js.map
|
|
12
12
|
|
|
13
|
-
//# sourceMappingURL=version-
|
|
13
|
+
//# sourceMappingURL=version-TA6fPT8q.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version-
|
|
1
|
+
{"version":3,"file":"version-TA6fPT8q.js","sources":["../nylas-js-core/dist/index.es.js","src/version.ts"],"sourcesContent":["var t = Object.defineProperty;\nvar c = (r, n, s) => n in r ? t(r, n, { enumerable: !0, configurable: !0, writable: !0, value: s }) : r[n] = s;\nvar a = (r, n, s) => (c(r, typeof n != \"symbol\" ? n + \"\" : n, s), s);\nvar u = /* @__PURE__ */ ((r) => (r.Error = \"error\", r.Warning = \"warning\", r.Info = \"info\", r.Success = \"success\", r))(u || {});\nconst e = (r) => r !== null && typeof r == \"object\" && \"data\" in r, o = (r) => r !== null && typeof r == \"object\" && \"error\" in r;\nclass E extends Error {\n constructor(s) {\n super(s == null ? void 0 : s.message);\n a(this, \"apiError\");\n this.name = \"NylasAPIError\", this.stack = new Error().stack, this.apiError = s;\n }\n}\nexport {\n u as NotificationType,\n E as NylasAPIError,\n o as isNylasErrorResponse,\n e as isNylasSuccessResponse\n};\n","export const version = '2.3.1';\n"],"names":[],"mappings":";;AAGG,IAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,GAAG,OAAO,EAAE,CAAC,CAAC,OAAO,GAAG,SAAS,EAAE,CAAC,CAAC,IAAI,GAAG,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE;AACzH,MAA+D,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,IAAI,OAAO,CAAC,IAAI,QAAQ,IAAI,OAAO,IAAI;;ACJzH,MAAM,OAAO,GAAG;;;;;;"}
|
|
@@ -101,7 +101,15 @@ export class NylasDatePicker {
|
|
|
101
101
|
return timeDay.range(timeDay.offset(firstDayOfMonth, -firstDayOfMonth.getDay()), timeDay.offset(lastDayOfMonth, 7 - lastDayOfMonth.getDay()));
|
|
102
102
|
}
|
|
103
103
|
selectDate(date) {
|
|
104
|
-
|
|
104
|
+
if (!date) {
|
|
105
|
+
this.dateSelected.emit(date);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const year = date.getFullYear();
|
|
109
|
+
const month = date.getMonth();
|
|
110
|
+
const day = date.getDate();
|
|
111
|
+
const dateInSelectedTimezone = dayjs.tz(`${year}-${String(month + 1).padStart(2, '0')}-${String(day).padStart(2, '0')} 12:00`, this.selectedTimezone);
|
|
112
|
+
this.dateSelected.emit(dateInSelectedTimezone.toDate());
|
|
105
113
|
}
|
|
106
114
|
changeMonth(change) {
|
|
107
115
|
this.month = new Date(this.month.getFullYear(), this.month.getMonth() + change, 1);
|
|
@@ -129,7 +137,7 @@ export class NylasDatePicker {
|
|
|
129
137
|
});
|
|
130
138
|
}
|
|
131
139
|
render() {
|
|
132
|
-
return (h(Host, { key: '
|
|
140
|
+
return (h(Host, { key: '6fe0131e53169edbb33d4181bca86faf66062842', part: "ndp" }, h("div", { key: 'aff6d815dcfa418a60a08f5a55fdbe3224996729', class: "nylas-date-picker" }, h("div", { key: '15a64ed69236a904fc4ee965680466a85bbe6c4e', class: "title", part: "ndp__title" }, this.configSettings?.name ? (h("h1", null, this.configSettings?.name)) : (this.configSettings?.organizer?.name && (h("h1", null, h("person-icon", null), this.configSettings?.organizer?.name || 'Organizer'))), h("p", { key: '5a9692a1535f4103b4b06107e2d80ca0ffb964da' }, h("clock-icon", { key: 'c5065ce5474422bd3aa8091ef4ab4e90d703fa82' }), this.eventDuration ? convertMinutesToHoursAndMinutes(this.eventDuration) : `- ${i18next.t('time.minutes')}`)), h("div", { key: '72d7263de5e11341b131aedebb955467653ec263', class: 'header flex-row' }, h("h2", { key: '064ff2e251c14ab989dce98f2a99ab4d1e69c17a', part: 'ndp__month-header' }, h("strong", { key: '7561ab851be1ed699f56c85672cfca7b976ae159' }, translateMonth(this.month.toLocaleDateString('en-US', { month: 'long' }).toLowerCase())), "\u00A0", this.month.toLocaleDateString(undefined, { year: 'numeric' })), h("div", { key: 'a6683748b031a60a5f451f9698e8c264a9ed7f5f', class: 'pagination' }, h("button", { key: '2add26a5b2a648968c868e73f08e2c7cae0b74dd', title: "Previous month", onClick: () => this.changeMonth(-1), class: { 'chevron-left': true, 'button': true }, disabled: this.month <= new Date(), part: "ndp__month-button" }, h("chevron-icon", { key: '4e0bd46d2e3ba3f05636072468f68662d6dfc0b7' })), h("button", { key: '9966fd865b9ccb002b8995c43503808a70364047', title: "Next month", onClick: () => this.changeMonth(1), class: { 'chevron-right': true, 'button': true }, disabled: this.disableNextMonthButton, part: "ndp__month-button" }, h("chevron-icon", { key: '47846202155d56f19e9a0dab23789335a546342e' })))), h("div", { key: '35eda68be8f2f757e498426e5070144452e18c0a', class: 'dates' }, [
|
|
133
141
|
i18next.t('days.sunday'),
|
|
134
142
|
i18next.t('days.monday'),
|
|
135
143
|
i18next.t('days.tuesday'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nylas-date-picker.js","sourceRoot":"","sources":["../../../../../src/components/scheduler/nylas-date-picker/nylas-date-picker.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,+BAA+B,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,SAAS,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACrK,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACrG,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAC7C,OAAO,GAAG,MAAM,kBAA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MAAM,CAAC,CAAC;YAC3D,CAAC;SACF;QACD,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;6CAwGD","sourcesContent":["import { RegisterComponent } from '@/common/register-component';\nimport { addDaysToCurrentDate, convertMinutesToHoursAndMinutes, getFirstDayOfMonth, getLastDayOfMonth, isSameDay, isSameMonth, translateMonth } from '@/utils/utils';\nimport { Component, Element, Event, EventEmitter, Host, Prop, State, Watch, h } from '@stencil/core';\nimport { timeDay } from 'd3-time';\nimport { NylasSchedulerConnector } from '../../..';\nimport { LANGUAGE_CODE } from '@/common/constants';\nimport { NylasScheduling } from '../nylas-scheduling/nylas-scheduling';\nimport { ConfigSettings } from '@/stores/scheduler-store';\nimport i18next from '@/utils/i18n';\nimport { debug } from '@/utils/utils';\nimport { ThemeConfig } from '@nylas/core';\nimport dayjs from 'dayjs';\nimport timezone from 'dayjs/plugin/timezone';\nimport utc from 'dayjs/plugin/utc';\n\n// Initialize dayjs plugins needed for timezone handling\ndayjs.extend(utc);\ndayjs.extend(timezone);\n\n/**\n * The `nylas-date-picker` component is a UI component that allows users to select a date.\n *\n * @part ndp - The date picker host.\n * @part ndp__title - The title.\n * @part ndp__month-header - The month header.\n * @part ndp__month-button - The month button.\n * @part ndp__day - The day.\n * @part ndp__date - The date.\n * @part ndp__date--selected - The selected date.\n * @part ndp__date--current-day - The current day.\n * @part ndp__date--current-month - The dates in the current month.\n * @part ndp__date--disabled - The disabled dates.\n */\n@Component({\n tag: 'nylas-date-picker',\n styleUrl: 'nylas-date-picker.scss',\n shadow: true,\n})\nexport class NylasDatePicker {\n /**\n * The host element.\n * Used to manage the host element of the provider.\n */\n @Element() private host!: HTMLNylasDatePickerElement;\n\n /**\n * @standalone\n * The dates that are selectable.\n */\n @Prop() selectableDates?: Date[];\n\n /**\n * @standalone\n * The config settings.\n */\n @Prop() configSettings?: ConfigSettings;\n\n /**\n * @standalone\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: any;\n\n /**\n * The selected timezone.\n */\n @Prop({ attribute: 'selected-timezone' }) readonly selectedTimezone: string = Intl.DateTimeFormat().resolvedOptions().timeZone;\n\n /**\n * The selected date.\n */\n @Prop() selectedDate?: Date;\n\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n\n /**\n * The loading state.\n */\n @Prop() readonly isLoading?: boolean;\n\n /**\n * The event duration.\n */\n @Prop() readonly eventDuration?: number;\n\n /**\n * The month to display.\n */\n @State() month: Date = this.selectedDate || new Date();\n\n /**\n * The dates to render.\n */\n @State() dates: Date[] = this.getDates();\n\n /**\n * The state to disable the next month button.\n */\n @State() disableNextMonthButton: boolean = false;\n\n /**\n * The state to store the selected dates as per the timezone.\n */\n @State() selectableDatesTimezone: Date[] = [];\n\n /**\n * This event is fired when a date is selected.\n */\n @Event() dateSelected!: EventEmitter<Date>;\n\n /**\n * This event is fired when the month is changed.\n */\n @Event() monthChanged!: EventEmitter<Date>;\n\n @Watch('configSettings')\n configSettingsChanged(newConfigSettings: ConfigSettings) {\n const nextMonth = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1);\n const availableDaysInFuture = newConfigSettings?.scheduler?.available_days_in_future;\n if (availableDaysInFuture === undefined) {\n return;\n }\n const endDate = addDaysToCurrentDate(new Date(), availableDaysInFuture);\n if (endDate.getTime() < nextMonth.getTime()) {\n this.disableNextMonthButton = true;\n } else {\n this.disableNextMonthButton = false;\n }\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChanged(newLanguage: string) {\n i18next.changeLanguage(newLanguage);\n }\n\n @Watch('themeConfig')\n themeConfigChanged(newThemeConfig: ThemeConfig) {\n this.applyThemeConfig(newThemeConfig);\n }\n\n @Watch('selectedDate')\n selectedDateChanged(newSelectedDate: Date) {\n if (!newSelectedDate || !isSameMonth(newSelectedDate, this.month)) {\n this.month = newSelectedDate || new Date();\n }\n this.dates = this.getDates();\n }\n\n /**\n * Helper method to convert dates to the specified timezone, preserving only the date part\n */\n private convertDatesToTimezone(dates: Date[] | undefined, targetTimezone: string): Date[] {\n if (!dates || dates.length === 0) {\n return [];\n }\n\n return dates.map(d => {\n const tzDate = dayjs(d).tz(targetTimezone);\n return new Date(tzDate.year(), tzDate.month(), tzDate.date());\n });\n }\n\n @Watch('selectedTimezone')\n selectedTimezoneChanged(newSelectedTimezone: string) {\n this.selectableDatesTimezone = this.convertDatesToTimezone(this.selectableDates, newSelectedTimezone);\n }\n\n @Watch('selectableDates')\n selectableDatesChanged(newSelectableDates: Date[] | undefined) {\n this.selectableDatesTimezone = this.convertDatesToTimezone(newSelectableDates, this.selectedTimezone);\n }\n\n connectedCallback() {\n // Use queueMicrotask to defer theme application until after React has set props.\n // This fixes the timing issue where connectedCallback fires before React sets themeConfig.\n queueMicrotask(() => {\n if (this.themeConfig) {\n this.applyThemeConfig(this.themeConfig);\n this.host.setAttribute('data-themed', '');\n }\n });\n }\n\n disconnectedCallback() {}\n\n componentWillLoad() {}\n\n componentDidLoad() {\n debug(`[nylas-date-picker] Component did load`);\n this.month = this.selectedDate || new Date();\n this.dates = this.getDates();\n this.selectableDatesTimezone = this.convertDatesToTimezone(this.selectableDates, this.selectedTimezone);\n }\n\n applyThemeConfig(themeConfig?: ThemeConfig) {\n if (themeConfig) {\n for (const [key, value] of Object.entries(themeConfig)) {\n this.host.style.setProperty(`${key}`, value);\n }\n }\n }\n\n /**\n * Get the dates to render, including the days from the previous and next months.\n * @returns The dates to render.\n */\n private getDates() {\n const lastDayOfMonth = getLastDayOfMonth(this.month);\n const firstDayOfMonth = getFirstDayOfMonth(this.month);\n\n return timeDay.range(timeDay.offset(firstDayOfMonth, -firstDayOfMonth.getDay()), timeDay.offset(lastDayOfMonth, 7 - lastDayOfMonth.getDay()));\n }\n\n /**\n * Select a date.\n * @param date The date to select.\n */\n private selectDate(date?: Date) {\n this.dateSelected.emit(date);\n }\n\n /**\n * Change the month.\n * @param change The change in months.\n */\n private changeMonth(change: number) {\n this.month = new Date(this.month.getFullYear(), this.month.getMonth() + change, 1);\n const nextMonth = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1);\n const availableDaysInFuture = this.configSettings?.scheduler?.available_days_in_future;\n const endDate = addDaysToCurrentDate(new Date(), availableDaysInFuture);\n if (endDate.getTime() < nextMonth.getTime()) {\n this.disableNextMonthButton = true;\n } else {\n this.disableNextMonthButton = false;\n }\n this.dates = this.getDates();\n this.monthChanged.emit(this.month);\n }\n\n private isSelected(date: Date | undefined, selectedDate: Date | undefined, selectableDates: Date[] | undefined) {\n return date && selectedDate && isSameDay(date, selectedDate) && selectableDates && selectableDates?.length > 0;\n }\n\n private isDisabled(date: Date | undefined) {\n if (!date || !this.selectableDatesTimezone || this.selectableDatesTimezone.length === 0) {\n return true;\n }\n\n // Compare only the date parts (year, month, day), ignoring time\n return !this.selectableDatesTimezone.some(d => {\n return date.getFullYear() === d.getFullYear() && date.getMonth() === d.getMonth() && date.getDate() === d.getDate();\n });\n }\n\n @RegisterComponent<NylasDatePicker, NylasSchedulerConnector, Exclude<NylasScheduling['stores'], undefined>>({\n name: 'nylas-date-picker',\n stateToProps: new Map([\n ['scheduler.selectableDates', 'selectableDates'],\n ['scheduler.selectedDate', 'selectedDate'],\n ['scheduler.isLoading', 'isLoading'],\n ['scheduler.configSettings', 'configSettings'],\n ['scheduler.eventDuration', 'eventDuration'],\n ['scheduler.selectedLanguage', 'selectedLanguage'],\n ['scheduler.themeConfig', 'themeConfig'],\n ['scheduler.selectedTimezone', 'selectedTimezone'],\n ]),\n eventToProps: {\n dateSelected: async (event: CustomEvent<Date>, nylasSchedulerConnector: NylasSchedulerConnector) => {\n debug('nylas-date-picker', 'dateSelected', event.detail);\n nylasSchedulerConnector.scheduler.selectDate(event.detail);\n },\n monthChanged: async (event: CustomEvent<Date>, _nylasSchedulerConnector: NylasSchedulerConnector) => {\n debug('nylas-date-picker', 'monthChanged', event.detail);\n },\n },\n fireRegisterEvent: true,\n })\n render() {\n return (\n <Host part=\"ndp\">\n <div class=\"nylas-date-picker\">\n <div class=\"title\" part=\"ndp__title\">\n {this.configSettings?.name ? (\n <h1>{this.configSettings?.name}</h1>\n ) : (\n this.configSettings?.organizer?.name && (\n <h1>\n <person-icon />\n {this.configSettings?.organizer?.name || 'Organizer'}\n </h1>\n )\n )}\n <p>\n <clock-icon />\n {this.eventDuration ? convertMinutesToHoursAndMinutes(this.eventDuration) : `- ${i18next.t('time.minutes')}`}\n </p>\n </div>\n <div class={'header flex-row'}>\n <h2 part={'ndp__month-header'}>\n <strong>{translateMonth(this.month.toLocaleDateString('en-US', { month: 'long' }).toLowerCase())}</strong>\n \n {this.month.toLocaleDateString(undefined, { year: 'numeric' })}\n </h2>\n <div class={'pagination'}>\n <button\n title=\"Previous month\"\n onClick={() => this.changeMonth(-1)}\n class={{ 'chevron-left': true, 'button': true }}\n disabled={this.month <= new Date()}\n part=\"ndp__month-button\"\n >\n <chevron-icon />\n </button>\n <button\n title=\"Next month\"\n onClick={() => this.changeMonth(1)}\n class={{ 'chevron-right': true, 'button': true }}\n disabled={this.disableNextMonthButton}\n part=\"ndp__month-button\"\n >\n <chevron-icon />\n </button>\n </div>\n </div>\n\n <div class={'dates'}>\n {[\n i18next.t('days.sunday'),\n i18next.t('days.monday'),\n i18next.t('days.tuesday'),\n i18next.t('days.wednesday'),\n i18next.t('days.thursday'),\n i18next.t('days.friday'),\n i18next.t('days.saturday'),\n ].map(day => {\n return (\n <div class={'day'} part=\"ndp__day\">\n {day}\n </div>\n );\n })}\n {this.dates.map((date, i) => {\n const isDisabled = this.isDisabled(date);\n\n if (this.isLoading) {\n return (\n <button\n disabled\n class={{\n 'date day-skeleton': true,\n 'current-month': isSameMonth(date, this.month),\n }}\n style={{ animationDelay: `${i * 20}ms` }}\n part={`ndp__date ndp__date--disabled`}\n >\n {date.getDate()}\n </button>\n );\n }\n return (\n <button\n class={{\n 'date': true,\n 'selected': !!(this.selectedDate && isSameDay(date, this.selectedDate) && this.selectableDates && this.selectableDates?.length > 0),\n 'current-day': isSameDay(date, new Date()),\n 'current-month': isSameMonth(date, this.month),\n }}\n aria-label={date.toLocaleDateString(undefined, { dateStyle: 'full' })}\n disabled={isDisabled}\n onClick={() => this.selectDate(date)}\n part={`ndp__date ${this.isSelected(date, this.selectedDate, this.selectableDates) ? 'ndp__date--selected' : ''} ${isSameDay(date, new Date()) ? 'ndp__date--current-day' : ''} ${isSameMonth(date, this.month) ? 'ndp__date--current-month' : ''}`}\n >\n {date.getDate()}\n </button>\n );\n })}\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"nylas-date-picker.js","sourceRoot":"","sources":["../../../../../src/components/scheduler/nylas-date-picker/nylas-date-picker.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,+BAA+B,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,SAAS,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACrK,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACrG,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,uBAAuB,CAAC;AAC7C,OAAO,GAAG,MAAM,kBAAkB,CAAC;AAGnC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAClB,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAqBvB,MAAM,OAAO,eAAe;IAL5B;QAiCqD,qBAAgB,GAAW,IAAI,CAAC,cAA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E,kBAAkB,CAAC;SACnD,CAAC;QACF,YAAY,EAAE;YACZ,YAAY,EAAE,KAAK,EAAE,KAAwB,EAAE,uBAAgD,EAAE,EAAE;gBACjG,KAAK,CAAC,mBAAmB,EAAE,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;gBACzD,uBAAuB,CAAC,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YAC7D,CAAC;YACD,YAAY,EAAE,KAAK,EAAE,KAAwB,EAAE,wBAAiD,EAAE,EAAE;gBAClG,KAAK,CAAC,mBAAmB,EAAE,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;YAC3D,CAAC;SACF;QACD,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;6CAwGD","sourcesContent":["import { RegisterComponent } from '@/common/register-component';\nimport { addDaysToCurrentDate, convertMinutesToHoursAndMinutes, getFirstDayOfMonth, getLastDayOfMonth, isSameDay, isSameMonth, translateMonth } from '@/utils/utils';\nimport { Component, Element, Event, EventEmitter, Host, Prop, State, Watch, h } from '@stencil/core';\nimport { timeDay } from 'd3-time';\nimport { NylasSchedulerConnector } from '../../..';\nimport { LANGUAGE_CODE } from '@/common/constants';\nimport { NylasScheduling } from '../nylas-scheduling/nylas-scheduling';\nimport { ConfigSettings } from '@/stores/scheduler-store';\nimport i18next from '@/utils/i18n';\nimport { debug } from '@/utils/utils';\nimport { ThemeConfig } from '@nylas/core';\nimport dayjs from 'dayjs';\nimport timezone from 'dayjs/plugin/timezone';\nimport utc from 'dayjs/plugin/utc';\n\n// Initialize dayjs plugins needed for timezone handling\ndayjs.extend(utc);\ndayjs.extend(timezone);\n\n/**\n * The `nylas-date-picker` component is a UI component that allows users to select a date.\n *\n * @part ndp - The date picker host.\n * @part ndp__title - The title.\n * @part ndp__month-header - The month header.\n * @part ndp__month-button - The month button.\n * @part ndp__day - The day.\n * @part ndp__date - The date.\n * @part ndp__date--selected - The selected date.\n * @part ndp__date--current-day - The current day.\n * @part ndp__date--current-month - The dates in the current month.\n * @part ndp__date--disabled - The disabled dates.\n */\n@Component({\n tag: 'nylas-date-picker',\n styleUrl: 'nylas-date-picker.scss',\n shadow: true,\n})\nexport class NylasDatePicker {\n /**\n * The host element.\n * Used to manage the host element of the provider.\n */\n @Element() private host!: HTMLNylasDatePickerElement;\n\n /**\n * @standalone\n * The dates that are selectable.\n */\n @Prop() selectableDates?: Date[];\n\n /**\n * @standalone\n * The config settings.\n */\n @Prop() configSettings?: ConfigSettings;\n\n /**\n * @standalone\n * The theme configuration.\n */\n @Prop({ attribute: 'theme-config' }) readonly themeConfig?: any;\n\n /**\n * The selected timezone.\n */\n @Prop({ attribute: 'selected-timezone' }) readonly selectedTimezone: string = Intl.DateTimeFormat().resolvedOptions().timeZone;\n\n /**\n * The selected date.\n */\n @Prop() selectedDate?: Date;\n\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n\n /**\n * The loading state.\n */\n @Prop() readonly isLoading?: boolean;\n\n /**\n * The event duration.\n */\n @Prop() readonly eventDuration?: number;\n\n /**\n * The month to display.\n */\n @State() month: Date = this.selectedDate || new Date();\n\n /**\n * The dates to render.\n */\n @State() dates: Date[] = this.getDates();\n\n /**\n * The state to disable the next month button.\n */\n @State() disableNextMonthButton: boolean = false;\n\n /**\n * The state to store the selected dates as per the timezone.\n */\n @State() selectableDatesTimezone: Date[] = [];\n\n /**\n * This event is fired when a date is selected.\n */\n @Event() dateSelected!: EventEmitter<Date>;\n\n /**\n * This event is fired when the month is changed.\n */\n @Event() monthChanged!: EventEmitter<Date>;\n\n @Watch('configSettings')\n configSettingsChanged(newConfigSettings: ConfigSettings) {\n const nextMonth = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1);\n const availableDaysInFuture = newConfigSettings?.scheduler?.available_days_in_future;\n if (availableDaysInFuture === undefined) {\n return;\n }\n const endDate = addDaysToCurrentDate(new Date(), availableDaysInFuture);\n if (endDate.getTime() < nextMonth.getTime()) {\n this.disableNextMonthButton = true;\n } else {\n this.disableNextMonthButton = false;\n }\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChanged(newLanguage: string) {\n i18next.changeLanguage(newLanguage);\n }\n\n @Watch('themeConfig')\n themeConfigChanged(newThemeConfig: ThemeConfig) {\n this.applyThemeConfig(newThemeConfig);\n }\n\n @Watch('selectedDate')\n selectedDateChanged(newSelectedDate: Date) {\n if (!newSelectedDate || !isSameMonth(newSelectedDate, this.month)) {\n this.month = newSelectedDate || new Date();\n }\n this.dates = this.getDates();\n }\n\n /**\n * Helper method to convert dates to the specified timezone, preserving only the date part\n */\n private convertDatesToTimezone(dates: Date[] | undefined, targetTimezone: string): Date[] {\n if (!dates || dates.length === 0) {\n return [];\n }\n\n return dates.map(d => {\n const tzDate = dayjs(d).tz(targetTimezone);\n return new Date(tzDate.year(), tzDate.month(), tzDate.date());\n });\n }\n\n @Watch('selectedTimezone')\n selectedTimezoneChanged(newSelectedTimezone: string) {\n this.selectableDatesTimezone = this.convertDatesToTimezone(this.selectableDates, newSelectedTimezone);\n }\n\n @Watch('selectableDates')\n selectableDatesChanged(newSelectableDates: Date[] | undefined) {\n this.selectableDatesTimezone = this.convertDatesToTimezone(newSelectableDates, this.selectedTimezone);\n }\n\n connectedCallback() {\n // Use queueMicrotask to defer theme application until after React has set props.\n // This fixes the timing issue where connectedCallback fires before React sets themeConfig.\n queueMicrotask(() => {\n if (this.themeConfig) {\n this.applyThemeConfig(this.themeConfig);\n this.host.setAttribute('data-themed', '');\n }\n });\n }\n\n disconnectedCallback() {}\n\n componentWillLoad() {}\n\n componentDidLoad() {\n debug(`[nylas-date-picker] Component did load`);\n this.month = this.selectedDate || new Date();\n this.dates = this.getDates();\n this.selectableDatesTimezone = this.convertDatesToTimezone(this.selectableDates, this.selectedTimezone);\n }\n\n applyThemeConfig(themeConfig?: ThemeConfig) {\n if (themeConfig) {\n for (const [key, value] of Object.entries(themeConfig)) {\n this.host.style.setProperty(`${key}`, value);\n }\n }\n }\n\n /**\n * Get the dates to render, including the days from the previous and next months.\n * @returns The dates to render.\n */\n private getDates() {\n const lastDayOfMonth = getLastDayOfMonth(this.month);\n const firstDayOfMonth = getFirstDayOfMonth(this.month);\n\n return timeDay.range(timeDay.offset(firstDayOfMonth, -firstDayOfMonth.getDay()), timeDay.offset(lastDayOfMonth, 7 - lastDayOfMonth.getDay()));\n }\n\n /**\n * Select a date.\n * @param date The date to select (in local timezone from the calendar grid).\n *\n * The calendar grid displays dates as local timezone Date objects. When a user clicks\n * on a date, we need to convert it to represent that same calendar day in the\n * SELECTED timezone, not the user's local timezone. This ensures that if the user\n * has selected America/Los_Angeles but their local timezone is America/Toronto,\n * clicking on \"January 8th\" will create a Date representing January 8th in Los Angeles.\n */\n private selectDate(date?: Date) {\n if (!date) {\n this.dateSelected.emit(date);\n return;\n }\n\n // Get the calendar day (year, month, date) from the clicked date (which is in local timezone)\n const year = date.getFullYear();\n const month = date.getMonth();\n const day = date.getDate();\n\n // Create a new Date representing noon on that calendar day in the SELECTED timezone\n // We use noon to avoid edge cases near midnight\n const dateInSelectedTimezone = dayjs.tz(`${year}-${String(month + 1).padStart(2, '0')}-${String(day).padStart(2, '0')} 12:00`, this.selectedTimezone);\n\n this.dateSelected.emit(dateInSelectedTimezone.toDate());\n }\n\n /**\n * Change the month.\n * @param change The change in months.\n */\n private changeMonth(change: number) {\n this.month = new Date(this.month.getFullYear(), this.month.getMonth() + change, 1);\n const nextMonth = new Date(this.month.getFullYear(), this.month.getMonth() + 1, 1);\n const availableDaysInFuture = this.configSettings?.scheduler?.available_days_in_future;\n const endDate = addDaysToCurrentDate(new Date(), availableDaysInFuture);\n if (endDate.getTime() < nextMonth.getTime()) {\n this.disableNextMonthButton = true;\n } else {\n this.disableNextMonthButton = false;\n }\n this.dates = this.getDates();\n this.monthChanged.emit(this.month);\n }\n\n private isSelected(date: Date | undefined, selectedDate: Date | undefined, selectableDates: Date[] | undefined) {\n return date && selectedDate && isSameDay(date, selectedDate) && selectableDates && selectableDates?.length > 0;\n }\n\n private isDisabled(date: Date | undefined) {\n if (!date || !this.selectableDatesTimezone || this.selectableDatesTimezone.length === 0) {\n return true;\n }\n\n // Compare only the date parts (year, month, day), ignoring time\n return !this.selectableDatesTimezone.some(d => {\n return date.getFullYear() === d.getFullYear() && date.getMonth() === d.getMonth() && date.getDate() === d.getDate();\n });\n }\n\n @RegisterComponent<NylasDatePicker, NylasSchedulerConnector, Exclude<NylasScheduling['stores'], undefined>>({\n name: 'nylas-date-picker',\n stateToProps: new Map([\n ['scheduler.selectableDates', 'selectableDates'],\n ['scheduler.selectedDate', 'selectedDate'],\n ['scheduler.isLoading', 'isLoading'],\n ['scheduler.configSettings', 'configSettings'],\n ['scheduler.eventDuration', 'eventDuration'],\n ['scheduler.selectedLanguage', 'selectedLanguage'],\n ['scheduler.themeConfig', 'themeConfig'],\n ['scheduler.selectedTimezone', 'selectedTimezone'],\n ]),\n eventToProps: {\n dateSelected: async (event: CustomEvent<Date>, nylasSchedulerConnector: NylasSchedulerConnector) => {\n debug('nylas-date-picker', 'dateSelected', event.detail);\n nylasSchedulerConnector.scheduler.selectDate(event.detail);\n },\n monthChanged: async (event: CustomEvent<Date>, _nylasSchedulerConnector: NylasSchedulerConnector) => {\n debug('nylas-date-picker', 'monthChanged', event.detail);\n },\n },\n fireRegisterEvent: true,\n })\n render() {\n return (\n <Host part=\"ndp\">\n <div class=\"nylas-date-picker\">\n <div class=\"title\" part=\"ndp__title\">\n {this.configSettings?.name ? (\n <h1>{this.configSettings?.name}</h1>\n ) : (\n this.configSettings?.organizer?.name && (\n <h1>\n <person-icon />\n {this.configSettings?.organizer?.name || 'Organizer'}\n </h1>\n )\n )}\n <p>\n <clock-icon />\n {this.eventDuration ? convertMinutesToHoursAndMinutes(this.eventDuration) : `- ${i18next.t('time.minutes')}`}\n </p>\n </div>\n <div class={'header flex-row'}>\n <h2 part={'ndp__month-header'}>\n <strong>{translateMonth(this.month.toLocaleDateString('en-US', { month: 'long' }).toLowerCase())}</strong>\n \n {this.month.toLocaleDateString(undefined, { year: 'numeric' })}\n </h2>\n <div class={'pagination'}>\n <button\n title=\"Previous month\"\n onClick={() => this.changeMonth(-1)}\n class={{ 'chevron-left': true, 'button': true }}\n disabled={this.month <= new Date()}\n part=\"ndp__month-button\"\n >\n <chevron-icon />\n </button>\n <button\n title=\"Next month\"\n onClick={() => this.changeMonth(1)}\n class={{ 'chevron-right': true, 'button': true }}\n disabled={this.disableNextMonthButton}\n part=\"ndp__month-button\"\n >\n <chevron-icon />\n </button>\n </div>\n </div>\n\n <div class={'dates'}>\n {[\n i18next.t('days.sunday'),\n i18next.t('days.monday'),\n i18next.t('days.tuesday'),\n i18next.t('days.wednesday'),\n i18next.t('days.thursday'),\n i18next.t('days.friday'),\n i18next.t('days.saturday'),\n ].map(day => {\n return (\n <div class={'day'} part=\"ndp__day\">\n {day}\n </div>\n );\n })}\n {this.dates.map((date, i) => {\n const isDisabled = this.isDisabled(date);\n\n if (this.isLoading) {\n return (\n <button\n disabled\n class={{\n 'date day-skeleton': true,\n 'current-month': isSameMonth(date, this.month),\n }}\n style={{ animationDelay: `${i * 20}ms` }}\n part={`ndp__date ndp__date--disabled`}\n >\n {date.getDate()}\n </button>\n );\n }\n return (\n <button\n class={{\n 'date': true,\n 'selected': !!(this.selectedDate && isSameDay(date, this.selectedDate) && this.selectableDates && this.selectableDates?.length > 0),\n 'current-day': isSameDay(date, new Date()),\n 'current-month': isSameMonth(date, this.month),\n }}\n aria-label={date.toLocaleDateString(undefined, { dateStyle: 'full' })}\n disabled={isDisabled}\n onClick={() => this.selectDate(date)}\n part={`ndp__date ${this.isSelected(date, this.selectedDate, this.selectableDates) ? 'ndp__date--selected' : ''} ${isSameDay(date, new Date()) ? 'ndp__date--current-day' : ''} ${isSameMonth(date, this.month) ? 'ndp__date--current-month' : ''}`}\n >\n {date.getDate()}\n </button>\n );\n })}\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -429,7 +429,7 @@ export class NylasEditorTabsGroup {
|
|
|
429
429
|
location: !conferencing ? formState.location : undefined,
|
|
430
430
|
participants: formState.participants,
|
|
431
431
|
organizer: organizer,
|
|
432
|
-
conferencing: !formState.location ? conferencing :
|
|
432
|
+
conferencing: !formState.location ? conferencing : undefined,
|
|
433
433
|
when: formState.eventTimeslot.when,
|
|
434
434
|
recurrence: formState.eventTimeslot.recurrence,
|
|
435
435
|
calendar_id: organizerDefaultCal?.id || 'primary',
|
|
@@ -605,9 +605,9 @@ export class NylasEditorTabsGroup {
|
|
|
605
605
|
}
|
|
606
606
|
render() {
|
|
607
607
|
debug('[nylas-editor-tabs-group]', 'render', this.formState);
|
|
608
|
-
return (h(Host, { key: '
|
|
608
|
+
return (h(Host, { key: '8f61e0ba84b0b86a27440220560eabcaeea4e1e5' }, h("nylas-notification", { key: '94cae29c1400ff371141100848c1037a8a7d322c' }), h("form", { key: 'a88d6973a4711a4489115b184db1b0535e123be7', onSubmit: this.formSubmissionHandler, class: "scheduler-editor", ref: el => (this.formRef = el), noValidate: true }, this.mode === 'app' ? (h("div", { class: "return-to-calendar-view", part: "editor__return-to-calendar-view net__return-to-calendar-view" }, h("button-component", { id: "return-to-calendar-view-button", variant: "invisible", part: "nset__header__back-button", type: "button", onClick: e => {
|
|
609
609
|
this.setActiveTab(e, TabGroup.CalendarView);
|
|
610
|
-
} }, h("chevron-icon", { width: "16", height: "16" }), h("span", null, i18next.t('returnToCalendarView'))))) : null, this.mode === 'app' ? (h("div", { class: "form-contents", part: "editor__form-contents net__form-contents" }, h("div", { class: "tabs", part: "editor__tabs net__tabs" }, h("button", { name: TabGroup.BookingOptions, class: { tab: true, active: this.activeTab == TabGroup.BookingOptions, hide: this.hideTab(TabGroup.BookingOptions) }, part: "editortab__booking-options net__tab-booking-options", onClick: e => this.setActiveTab(e, TabGroup.BookingOptions) }, h("flow-icon", { width: "16", height: "16" }), i18next.t('bookingOptionsTab')), h("button", { name: TabGroup.BookingForm, class: { tab: true, active: this.activeTab == TabGroup.BookingForm, hide: this.hideTab(TabGroup.BookingForm) }, part: "editortab__booking-form net__tab-booking-form", onClick: e => this.setActiveTab(e, TabGroup.BookingForm) }, this.activeTab == TabGroup.BookingForm ? h("calendar-agenda-fill-icon", { width: "16", height: "16" }) : h("calendar-agenda-icon", { width: "16", height: "16" }), i18next.t('bookingFormTab')), h("button", { name: TabGroup.Communications, class: { tab: true, active: this.activeTab == TabGroup.Communications, hide: this.hideTab(TabGroup.Communications) }, onClick: e => this.setActiveTab(e, TabGroup.Communications), part: "editortab__communications net__tab-communications" }, this.activeTab == TabGroup.Communications ? h("envelope-fill-icon", { width: "16", height: "16" }) : h("envelope-icon", { width: "16", height: "16" }), i18next.t('communicationsTab')), h("button", { name: TabGroup.PageStyles, class: { tab: true, active: this.activeTab == TabGroup.PageStyles, hide: this.hideTab(TabGroup.PageStyles) }, onClick: e => this.setActiveTab(e, TabGroup.PageStyles), part: "editortab__page-styles net__tab-page-styles" }, this.activeTab == TabGroup.PageStyles ? h("paintbrush-fill-icon", { width: "16", height: "16" }) : h("paintbrush-icon", { width: "16", height: "16" }), i18next.t('pageStylesTab'))), h("div", { class: "tab-content", part: "editor__tab-content net__tab-content" }, h(TabContentsGroup, { formState: this.formState, activeTab: this.activeTab, currentUser: this.currentUser, calendars: this.calendars, id: this.selectedConfiguration?.id ?? 'new', i18next: i18next })))) : (h("div", { class: "composable", key: this.selectedConfiguration?.id }, h("slot", null))), h("div", { key: '
|
|
610
|
+
} }, h("chevron-icon", { width: "16", height: "16" }), h("span", null, i18next.t('returnToCalendarView'))))) : null, this.mode === 'app' ? (h("div", { class: "form-contents", part: "editor__form-contents net__form-contents" }, h("div", { class: "tabs", part: "editor__tabs net__tabs" }, h("button", { name: TabGroup.BookingOptions, class: { tab: true, active: this.activeTab == TabGroup.BookingOptions, hide: this.hideTab(TabGroup.BookingOptions) }, part: "editortab__booking-options net__tab-booking-options", onClick: e => this.setActiveTab(e, TabGroup.BookingOptions) }, h("flow-icon", { width: "16", height: "16" }), i18next.t('bookingOptionsTab')), h("button", { name: TabGroup.BookingForm, class: { tab: true, active: this.activeTab == TabGroup.BookingForm, hide: this.hideTab(TabGroup.BookingForm) }, part: "editortab__booking-form net__tab-booking-form", onClick: e => this.setActiveTab(e, TabGroup.BookingForm) }, this.activeTab == TabGroup.BookingForm ? h("calendar-agenda-fill-icon", { width: "16", height: "16" }) : h("calendar-agenda-icon", { width: "16", height: "16" }), i18next.t('bookingFormTab')), h("button", { name: TabGroup.Communications, class: { tab: true, active: this.activeTab == TabGroup.Communications, hide: this.hideTab(TabGroup.Communications) }, onClick: e => this.setActiveTab(e, TabGroup.Communications), part: "editortab__communications net__tab-communications" }, this.activeTab == TabGroup.Communications ? h("envelope-fill-icon", { width: "16", height: "16" }) : h("envelope-icon", { width: "16", height: "16" }), i18next.t('communicationsTab')), h("button", { name: TabGroup.PageStyles, class: { tab: true, active: this.activeTab == TabGroup.PageStyles, hide: this.hideTab(TabGroup.PageStyles) }, onClick: e => this.setActiveTab(e, TabGroup.PageStyles), part: "editortab__page-styles net__tab-page-styles" }, this.activeTab == TabGroup.PageStyles ? h("paintbrush-fill-icon", { width: "16", height: "16" }) : h("paintbrush-icon", { width: "16", height: "16" }), i18next.t('pageStylesTab'))), h("div", { class: "tab-content", part: "editor__tab-content net__tab-content" }, h(TabContentsGroup, { formState: this.formState, activeTab: this.activeTab, currentUser: this.currentUser, calendars: this.calendars, id: this.selectedConfiguration?.id ?? 'new', i18next: i18next })))) : (h("div", { class: "composable", key: this.selectedConfiguration?.id }, h("slot", null))), h("div", { key: '3cc55875cbb83e00b3007c06b5804399ae24c164', class: "footer", part: "editor__footer net__footer" }, h("div", { key: '661552aaedc6dfde5eb0725c4b37f975e11b8f2e', class: "preview", part: "editor__footer-preview net__footer-preview" }, this.enableUserFeedback && (h("button-component", { key: 'e2daf60e19bc54d7c3e9a520e0f4ce1d5ffb66ad', title: "Share your feedback", id: "report-issue", variant: 'basic', onClick: e => this.onFeedbackClick(e) }, h("feedback-icon", { key: 'fe1744b7062f50672ff51f8d850145935c1c94fe' }))), this.activeTab === TabGroup.CalendarView && (h("button-component", { key: '0c5a82186e7ba4b919342613b55740a5c15d7ee5', class: "page-settings-button", title: "Go to page settings", id: "page-settings", variant: 'basic', onClick: e => this.setActiveTab(e, TabGroup.BookingOptions) }, i18next.t('pageSettingsButton')))), h("div", { key: 'df369d271cd6fc78c9b4ad5667a88382d9f29a65', class: "buttons", part: "editor__footer-buttons net__footer-buttons" }, h("p", { key: '47b63ac1f8a5a90d4ba154acb2e6c4c5d6ef7545', class: {
|
|
611
611
|
'unsaved-changes': this.hasUnsavedChanges && !this.changesSaved,
|
|
612
612
|
'saved-changes': this.changesSaved,
|
|
613
613
|
'error': this.error?.message !== '',
|
|
@@ -616,17 +616,17 @@ export class NylasEditorTabsGroup {
|
|
|
616
616
|
? i18next.t('unsavedChangesLabel')
|
|
617
617
|
: this.error?.message == '' && this.changesSaved
|
|
618
618
|
? `${i18next.t('changesSavedLabel')}!`
|
|
619
|
-
: ''), h("div", { key: '
|
|
619
|
+
: ''), h("div", { key: '1b1436cdc1da5ba05094e269cf1d4477bd8c25dd', class: "footer-buttons__row" }, this.schedulerPreviewLink !== '' && this.action === 'edit' && (h("button-component", { key: '62cf4336c52211179fb5900d756f3ed62936c498', title: "Preview", type: "button", disabled: this.isLoading, clickHandler: event => {
|
|
620
620
|
event.preventDefault();
|
|
621
621
|
const previewEvent = this.previewButtonClicked.emit(this.host);
|
|
622
622
|
if (!previewEvent.defaultPrevented) {
|
|
623
623
|
window.open(parsePreviewLink(this.schedulerPreviewLink, this.selectedConfiguration), '_blank');
|
|
624
624
|
}
|
|
625
|
-
}, variant: 'basic' }, h("eye-icon", { key: '
|
|
625
|
+
}, variant: 'basic' }, h("eye-icon", { key: '9b32f09007c8eb0db6b093e5dde173790fc5537e' }))), h("button-component", { key: '692558a733120ce097966909ecdafb22de98e67e', type: "button", disabled: this.isLoading, clickHandler: event => {
|
|
626
626
|
event.preventDefault();
|
|
627
627
|
this.cancelButtonClick.emit();
|
|
628
628
|
this.host.resetError();
|
|
629
|
-
}, variant: 'basic', part: "editor__footer-cancel net__footer-cancel" }, i18next.t('cancelButton')), h("button-component", { key: '
|
|
629
|
+
}, variant: 'basic', part: "editor__footer-cancel net__footer-cancel" }, i18next.t('cancelButton')), h("button-component", { key: '4eda146ceacc6749da0f95152060a925e6f9cf06', class: { 'save-changes': this.action === 'edit' }, type: "submit", disabled: this.isLoading, part: "editor__footer-cta, net__footer-cta" }, !this.componentLoaded ? (h("span", null, h("loading-icon", null), ' ')) : this.isLoading ? (h("span", null, i18next.t('savingButtonText'), h("loading-icon", null), ' ')) : this.action === 'create' ? (`${i18next.t('createButtonText')}`) : (`${i18next.t('saveChangesButtonText')}`)))))), this.showFeedbackModal && h("nylas-feedback-form", { key: '62ab497f55fc337f2ac530df8def914157198e06' })));
|
|
630
630
|
}
|
|
631
631
|
static get is() { return "nylas-editor-tabs-group"; }
|
|
632
632
|
static get encapsulation() { return "scoped"; }
|