@nylas/web-elements 1.4.2 → 1.4.4
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 +56 -27
- package/dist/cdn/nylas-scheduling/nylas-scheduling.es.js +4842 -4822
- package/dist/cjs/checkmark-icon_15.cjs.entry.js +3 -3
- package/dist/cjs/checkmark-icon_15.cjs.entry.js.map +1 -1
- package/dist/cjs/google-logo-icon_6.cjs.entry.js +4 -4
- package/dist/cjs/input-component.cjs.entry.js +13 -2
- package/dist/cjs/input-component.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/nylas-booked-event-card_12.cjs.entry.js +40 -11
- package/dist/cjs/nylas-booked-event-card_12.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-event-calendar_3.cjs.entry.js +53 -24
- package/dist/cjs/nylas-event-calendar_3.cjs.entry.js.map +1 -1
- package/dist/cjs/nylas-provider.cjs.entry.js +1 -1
- package/dist/cjs/nylas-scheduling.cjs.entry.js +3 -3
- package/dist/cjs/nylas-web-elements.cjs.js +1 -1
- package/dist/cjs/{scheduler-store-d6f5cff3.js → scheduler-store-5dcefe7e.js} +2 -2
- package/dist/cjs/{scheduler-store-d6f5cff3.js.map → scheduler-store-5dcefe7e.js.map} +1 -1
- package/dist/collection/components/design-system/input-component/input-component.js +13 -2
- package/dist/collection/components/design-system/input-component/input-component.js.map +1 -1
- package/dist/collection/components/scheduler/nylas-date-picker/nylas-date-picker.js +40 -6
- package/dist/collection/components/scheduler/nylas-date-picker/nylas-date-picker.js.map +1 -1
- package/dist/collection/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.js +8 -5
- package/dist/collection/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-event-calendar/nylas-event-calendar.js +28 -17
- package/dist/collection/components/scheduler-editor/nylas-event-calendar/nylas-event-calendar.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-event-capacity/nylas-event-capacity.css +15 -0
- package/dist/collection/components/scheduler-editor/nylas-event-capacity/nylas-event-capacity.js +13 -2
- package/dist/collection/components/scheduler-editor/nylas-event-capacity/nylas-event-capacity.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-event-timeslot/nylas-event-timeslot.css +1 -1
- package/dist/collection/components/scheduler-editor/nylas-event-timeslot/nylas-event-timeslot.js +12 -4
- package/dist/collection/components/scheduler-editor/nylas-event-timeslot/nylas-event-timeslot.js.map +1 -1
- package/dist/collection/components/scheduler-editor/nylas-event-title/nylas-event-title.js +3 -3
- package/dist/collection/components/scheduler-editor/nylas-event-title/nylas-event-title.js.map +1 -1
- package/dist/components/index.es.js +1 -1
- package/dist/components/input-component2.js +13 -2
- package/dist/components/input-component2.js.map +1 -1
- package/dist/components/nylas-date-picker2.js +38 -8
- package/dist/components/nylas-date-picker2.js.map +1 -1
- package/dist/components/nylas-editor-tabs-group2.js +2 -2
- package/dist/components/nylas-editor-tabs2.js +2 -2
- package/dist/components/nylas-event-calendar2.js +29 -18
- package/dist/components/nylas-event-calendar2.js.map +1 -1
- package/dist/components/nylas-event-capacity2.js +14 -3
- package/dist/components/nylas-event-capacity2.js.map +1 -1
- package/dist/components/nylas-event-timeslot2.js +14 -6
- package/dist/components/nylas-event-timeslot2.js.map +1 -1
- package/dist/components/nylas-event-title2.js +3 -3
- package/dist/components/nylas-event-title2.js.map +1 -1
- package/dist/components/nylas-list-configurations2.js +1 -1
- package/dist/components/nylas-locale-switch2.js +1 -1
- package/dist/components/nylas-scheduler-editor.js +1 -1
- package/dist/components/nylas-scheduling.js +3 -3
- package/dist/components/nylas-timeslot-picker2.js +9 -6
- package/dist/components/nylas-timeslot-picker2.js.map +1 -1
- package/dist/components/scheduler-store.js +2 -2
- package/dist/components/utils.js +1 -1
- package/dist/esm/calendar-agenda-fill-icon_36.entry.js +2 -2
- package/dist/esm/checkmark-icon_15.entry.js +5 -5
- package/dist/esm/checkmark-icon_15.entry.js.map +1 -1
- package/dist/esm/{feedbackSync-aa8d23d1.js → feedbackSync-57bb471a.js} +2 -2
- package/dist/esm/{feedbackSync-aa8d23d1.js.map → feedbackSync-57bb471a.js.map} +1 -1
- package/dist/esm/globe-icon_2.entry.js +1 -1
- package/dist/esm/google-logo-icon_6.entry.js +7 -7
- package/dist/esm/{index.es-6d4b50d5.js → index.es-13ff6710.js} +2 -2
- package/dist/esm/{index.es-6d4b50d5.js.map → index.es-13ff6710.js.map} +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/input-component.entry.js +14 -3
- package/dist/esm/input-component.entry.js.map +1 -1
- package/dist/esm/input-dropdown_2.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/multi-select-dropdown_2.entry.js +1 -1
- package/dist/esm/{nylas-api-request-c5400df5.js → nylas-api-request-2e5f4c7f.js} +2 -2
- package/dist/esm/{nylas-api-request-c5400df5.js.map → nylas-api-request-2e5f4c7f.js.map} +1 -1
- package/dist/esm/nylas-booked-event-card_12.entry.js +42 -13
- package/dist/esm/nylas-booked-event-card_12.entry.js.map +1 -1
- package/dist/esm/nylas-event-calendar_3.entry.js +55 -26
- package/dist/esm/nylas-event-calendar_3.entry.js.map +1 -1
- package/dist/esm/nylas-form-card.entry.js +2 -2
- package/dist/esm/nylas-if-state.entry.js +2 -2
- package/dist/esm/nylas-login.entry.js +2 -2
- package/dist/esm/nylas-provider.entry.js +3 -3
- package/dist/esm/nylas-scheduler-editor.entry.js +3 -3
- package/dist/esm/nylas-scheduling.entry.js +6 -6
- package/dist/esm/nylas-web-elements.js +1 -1
- package/dist/esm/{register-component-238f28de.js → register-component-02a05665.js} +2 -2
- package/dist/esm/{register-component-238f28de.js.map → register-component-02a05665.js.map} +1 -1
- package/dist/esm/{scheduler-store-82bb212a.js → scheduler-store-fe9e85a4.js} +3 -3
- package/dist/esm/{scheduler-store-82bb212a.js.map → scheduler-store-fe9e85a4.js.map} +1 -1
- package/dist/esm/textarea-component.entry.js +1 -1
- package/dist/esm/{utils-7d962146.js → utils-e27d0e4b.js} +2 -2
- package/dist/esm/{utils-7d962146.js.map → utils-e27d0e4b.js.map} +1 -1
- package/dist/nylas-web-elements/index.esm.js +1 -1
- package/dist/nylas-web-elements/nylas-web-elements.esm.js +1 -1
- package/dist/nylas-web-elements/nylas-web-elements.esm.js.map +1 -1
- package/dist/nylas-web-elements/{p-12bf5148.js → p-189b24e6.js} +2 -2
- package/dist/nylas-web-elements/p-1cbe8a56.entry.js +2 -0
- package/dist/nylas-web-elements/{p-d132fbaa.entry.js.map → p-1cbe8a56.entry.js.map} +1 -1
- package/dist/nylas-web-elements/{p-fdc35ad8.entry.js → p-23971057.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-ba831977.entry.js → p-2dd05606.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-797578de.js → p-388c456c.js} +2 -2
- package/dist/nylas-web-elements/{p-cf650f4f.js → p-3ea1c7c9.js} +2 -2
- package/dist/nylas-web-elements/{p-de9d8218.entry.js → p-5f683e34.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-c2b6e0ca.entry.js → p-68ab7563.entry.js} +2 -2
- package/dist/nylas-web-elements/p-68ab7563.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-ec2c12a9.js → p-6b7fb948.js} +2 -2
- package/dist/nylas-web-elements/{p-cfd42146.js → p-7477410d.js} +2 -2
- package/dist/nylas-web-elements/{p-b62ef1be.js → p-7d9cdd23.js} +2 -2
- package/dist/nylas-web-elements/{p-00577fba.entry.js → p-8a7a6947.entry.js} +2 -2
- package/dist/nylas-web-elements/p-97f87422.entry.js +2 -0
- package/dist/nylas-web-elements/p-97f87422.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-9999c233.entry.js → p-aaf12216.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-a452d4ea.entry.js → p-b55a87fa.entry.js} +2 -2
- package/dist/nylas-web-elements/p-b55a87fa.entry.js.map +1 -0
- package/dist/nylas-web-elements/{p-888d0c66.entry.js → p-c5f86111.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-dd98c443.entry.js → p-cc6dbd73.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-b59288fd.entry.js → p-d5a2cec8.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-83216795.entry.js → p-deb33dfb.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-83216795.entry.js.map → p-deb33dfb.entry.js.map} +1 -1
- package/dist/nylas-web-elements/{p-2531d4fa.entry.js → p-e2dc32d9.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-a263330c.entry.js → p-eedabd6a.entry.js} +2 -2
- package/dist/nylas-web-elements/{p-355b34cb.entry.js → p-f57e68b1.entry.js} +2 -2
- package/dist/types/components/scheduler/nylas-date-picker/nylas-date-picker.d.ts +4 -0
- package/dist/types/components/scheduler-editor/nylas-event-capacity/nylas-event-capacity.d.ts +1 -0
- package/package.json +4 -5
- package/CHANGELOG.md +0 -878
- package/dist/nylas-web-elements/p-203beca4.entry.js +0 -2
- package/dist/nylas-web-elements/p-203beca4.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-a452d4ea.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-c2b6e0ca.entry.js.map +0 -1
- package/dist/nylas-web-elements/p-d132fbaa.entry.js +0 -2
- /package/dist/nylas-web-elements/{p-12bf5148.js.map → p-189b24e6.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-fdc35ad8.entry.js.map → p-23971057.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-ba831977.entry.js.map → p-2dd05606.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-797578de.js.map → p-388c456c.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-cf650f4f.js.map → p-3ea1c7c9.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-de9d8218.entry.js.map → p-5f683e34.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-ec2c12a9.js.map → p-6b7fb948.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-cfd42146.js.map → p-7477410d.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-b62ef1be.js.map → p-7d9cdd23.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-00577fba.entry.js.map → p-8a7a6947.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-9999c233.entry.js.map → p-aaf12216.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-888d0c66.entry.js.map → p-c5f86111.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-dd98c443.entry.js.map → p-cc6dbd73.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-b59288fd.entry.js.map → p-d5a2cec8.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-2531d4fa.entry.js.map → p-e2dc32d9.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-a263330c.entry.js.map → p-eedabd6a.entry.js.map} +0 -0
- /package/dist/nylas-web-elements/{p-355b34cb.entry.js.map → p-f57e68b1.entry.js.map} +0 -0
package/dist/collection/components/scheduler-editor/nylas-event-timeslot/nylas-event-timeslot.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nylas-event-timeslot.js","sourceRoot":"","sources":["../../../../src/components/scheduler-editor/nylas-event-timeslot/nylas-event-timeslot.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAE9H,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,a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QACjF,YAAY,EAAE;YACZ,YAAY,EAAE,KAAK,EAAE,KAAmD,EAAE,eAA8C,EAAE,EAAE;gBAC1H,KAAK,CAAC,sBAAsB,EAAE,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;YAC9D,CAAC;SACF;QACD,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;gDA8LD","sourcesContent":["import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug, generateRRule, getTimezoneOffset } from '@/utils/utils';\nimport { AttachInternals, Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE, TIMEZONE_MAP } from '@/common/constants';\nimport dayjs from 'dayjs';\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\nimport utc from 'dayjs/plugin/utc';\nimport timezone from 'dayjs/plugin/timezone';\n\ndayjs.extend(customParseFormat);\ndayjs.extend(utc);\ndayjs.extend(timezone);\n\nconst periodMap = {\n day: 'daily',\n week: 'weekly',\n month: 'monthly',\n year: 'yearly',\n};\n\ntype RepeatEndType = 'never' | 'on' | 'after';\ntype RecurrenceType = 'none' | 'daily' | 'weekly' | 'monthly' | 'yearly' | 'custom';\n\n/**\n * The `nylas-event-timeslot` component is a UI component that allows users to select the event type for the scheduler configuration.\n */\n@Component({\n tag: 'nylas-event-timeslot',\n styleUrl: 'nylas-event-timeslot.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasEventTimeslot {\n @Element() host!: HTMLNylasEventTimeslotElement;\n\n /**\n * @standalone\n * The name of the component\n */\n @Prop() name: string = 'event-timeslot';\n /**\n * The initial value of the event timeslot.\n */\n @Prop() initialValue?: {\n when: {\n start_time: number;\n end_time: number;\n start_timezone: string;\n end_timezone: string;\n };\n recurrence: string[];\n };\n\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n\n /**\n * The selected date.\n */\n @State() selectedDate!: string;\n\n /**\n * The selected start time.\n */\n @State() selectedStartTime!: string;\n\n /**\n * The selected end time.\n */\n @State() selectedEndTime!: string;\n\n /**\n * The timezone.\n */\n @State() selectedTimezone!: string;\n\n /**\n * The selected recurrence type.\n */\n @State() selectedRecurrenceType!: RecurrenceType;\n\n /**\n * Time range error.\n */\n @State() timeRangeError: boolean = false;\n\n /**\n * The selected rrule.\n */\n @State() selectedRrule!: string | null;\n\n /**\n * Recurrence options.\n */\n @State() recurrenceOptions: { label: string; value: string }[] = [];\n /**\n * Repeat every frequency.\n */\n @State() repeatEveryInterval: number = 1;\n /**\n * Repeat every period.\n */\n @State() repeatEveryFrequency: string = 'week';\n /**\n * Repeat on days.\n */\n @State() repeatOnDays: string[] = [];\n /**\n * Repeat monthly on.\n */\n @State() repeatMonthlySameDate: boolean = true;\n /**\n * Repeat end type.\n */\n @State() repeatEndType: RepeatEndType = 'never';\n /**\n * Repeat end after.\n */\n @State() repeatEndAfter: number = 1;\n /**\n * Repeat end on (custom recurrence).\n */\n @State() repeatEndOn: string | undefined;\n /**\n * Month recurrence options.\n */\n @State() monthRecurrenceOptions: { label: string; value: string }[] = [];\n /**\n * The end date for recurrence (non-custom recurrence).\n */\n @State() endDate: string | undefined;\n\n /**\n * The element internals.\n */\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * This event is fired when the value of the event location changes.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n /**\n * This event is fired when the value of the event timeslot changes.\n */\n @Event() timeWindowFormError!: EventEmitter<{\n key: string;\n message: string;\n }>;\n\n // Lifecycle methods\n connectedCallback() {\n debug('nylas-event-timeslot', 'connectedCallback');\n }\n\n disconnectedCallback() {\n debug('nylas-event-timeslot', 'disconnectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-event-timeslot', 'componentWillLoad');\n // See comment in the @Watch('name') decorator for more information.\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('nylas-event-timeslot', 'componentDidLoad');\n\n // Set defaults from initialValue or fallback to current values\n if (this.initialValue) {\n const { when, recurrence } = this.initialValue;\n\n if (when) {\n this.selectedDate = dayjs.unix(when.start_time).tz(when.start_timezone).format('YYYY-MM-DD');\n this.selectedStartTime = dayjs.unix(when.start_time).tz(when.start_timezone).format('hh:mma');\n this.selectedEndTime = dayjs.unix(when.end_time).tz(when.end_timezone).format('hh:mma');\n this.selectedTimezone = when.start_timezone;\n } else {\n this.selectedDate = new Date().toISOString().split('T')[0];\n const defaultTimes = this.getSuggestedTime();\n this.selectedStartTime = defaultTimes.startTime;\n this.selectedEndTime = defaultTimes.endTime;\n this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n if (recurrence && recurrence.length > 0) {\n this.selectedRrule = recurrence[0];\n const repeatEndAfter = recurrence[0]?.split(';')?.find(s => s.includes('COUNT'));\n if (repeatEndAfter) {\n this.repeatEndAfter = parseInt(repeatEndAfter.split('=')[1]);\n }\n const daysString = recurrence[0]?.split(';')?.find(s => s.includes('BYDAY'));\n if (daysString) {\n this.repeatOnDays = daysString.split('=')[1].split(',');\n }\n const until = recurrence[0]?.split(';')?.find(s => s.includes('UNTIL'));\n if (until) {\n const untilDate = dayjs(until.split('=')[1], 'YYYYMMDDTHHmmss').toDate();\n this.repeatEndOn = dayjs(untilDate).toISOString().split('T')[0];\n this.repeatEndType = 'on';\n }\n const recurrenceType = this.getRecurrenceTypeFromRrule(recurrence[0]);\n this.selectedRecurrenceType = recurrenceType || 'none';\n } else {\n this.selectedRecurrenceType = 'none';\n this.selectedRrule = generateRRule(this.selectedDate, this.selectedRecurrenceType, undefined, undefined, this.selectedTimezone);\n }\n } else {\n this.selectedDate = new Date().toISOString().split('T')[0];\n const defaultTimes = this.getSuggestedTime();\n this.selectedStartTime = defaultTimes.startTime;\n this.selectedEndTime = defaultTimes.endTime;\n this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n this.selectedRecurrenceType = 'none';\n this.selectedRrule = generateRRule(this.selectedDate, this.selectedRecurrenceType, undefined, undefined, this.selectedTimezone);\n }\n\n this.recurrenceOptions = this.generateRecurrenceOptions(this.selectedDate, this.selectedTimezone);\n this.monthRecurrenceOptions = this.getMonthRecurrenceOptions(this.selectedDate, this.selectedTimezone);\n\n // Trigger initial value change\n this.handleValueChanged(true);\n }\n\n /**\n * When a name prop is passed, stencil does not automatically set the name attribute on the host element.\n * Since this component is form-associated, the name attribute is required for form submission.\n * This is a workaround to ensure that the name attribute is set on the host element.\n */\n @Watch('name')\n elementNameChangedHandler(newValue: string) {\n debug('nylas-event-timeslot', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n i18next.changeLanguage(newVal);\n }\n\n // Utility function to get the ordinal suffix (e.g., 1st, 2nd, 3rd)\n getOrdinalSuffix(n) {\n const s = ['th', 'st', 'nd', 'rd'];\n const v = n % 100;\n return n + (s[(v - 20) % 10] || s[v] || s[0]);\n }\n\n getRecurrenceTypeFromRrule(rrule: string): RecurrenceType | undefined {\n if (rrule.includes('INTERVAL')) return 'custom';\n if (rrule.includes('FREQ=DAILY')) return 'daily';\n if (rrule.includes('FREQ=WEEKLY')) return 'weekly';\n if (rrule.includes('FREQ=MONTHLY')) return 'monthly';\n if (rrule.includes('FREQ=YEARLY')) return 'yearly';\n return undefined;\n }\n\n // Function to generate dynamic recurrence options\n generateRecurrenceOptions(selectedDate: string, timezoneStr: string) {\n const daysOfWeek = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\n\n // Parse the date in the given timezone\n const selectedDay = dayjs.tz(selectedDate, timezoneStr);\n\n const dayOfWeek = daysOfWeek[selectedDay.day()]; // Get the day of the week (e.g., Thursday)\n\n // Determine the occurrence of the day in the month (e.g., 1st, 2nd, etc.)\n const date = selectedDay.date();\n const occurrenceInMonth = Math.ceil(date / 7); // e.g., 1st Thursday\n\n // Generate options\n return [\n { label: i18next.t('nylasEventTimeslot.recurrenceOptions.none'), value: 'none' },\n { label: i18next.t('nylasEventTimeslot.recurrenceOptions.daily'), value: 'daily' },\n { label: i18next.t('nylasEventTimeslot.recurrenceOptions.weekly', { dayOfWeek: dayOfWeek }), value: 'weekly' },\n { label: i18next.t('nylasEventTimeslot.recurrenceOptions.monthly', { dayOfMonth: `${this.getOrdinalSuffix(occurrenceInMonth)} ${dayOfWeek}` }), value: 'monthly' },\n {\n label: i18next.t('nylasEventTimeslot.recurrenceOptions.yearly', { dateOfMonth: `${selectedDay.format('MMMM D')}` }),\n value: 'yearly',\n },\n { label: i18next.t('nylasEventTimeslot.recurrenceOptions.custom'), value: 'custom' },\n ];\n }\n\n // Function to generate dynamic month recurrence options\n getMonthRecurrenceOptions(selectedDate: string, timezoneStr: string) {\n const daysOfWeek = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\n\n const selectedDay = dayjs.tz(selectedDate, timezoneStr);\n const dayOfWeek = daysOfWeek[selectedDay.day()]; // Get the day of the week (e.g., Thursday)\n const date = selectedDay.date();\n const occurrenceInMonth = Math.ceil(date / 7);\n\n return [\n { label: i18next.t('nylasEventTimeslot.recurrenceOptions.monthOnDay', { date: date }), value: 'monthly-same-date' },\n { label: i18next.t('nylasEventTimeslot.recurrenceOptions.monthly', { dayOfMonth: `${this.getOrdinalSuffix(occurrenceInMonth)} ${dayOfWeek}` }), value: 'monthly' },\n ];\n }\n\n // Function to get the default suggested time shown in the time range picker\n getSuggestedTime() {\n const now = dayjs();\n\n // Round current time to the next 30-minute increment\n const minutes = now.minute();\n const roundedMinutes = minutes <= 30 ? 30 : 60;\n const startTime = now.set('minute', roundedMinutes).set('second', 0);\n\n // Calculate end time (30 minutes after start time)\n const endTime = startTime.add(30, 'minute');\n\n // Format the times in \"hh:mma\" format\n return {\n startTime: startTime.format('hh:mma'), // e.g., \"03:00pm\"\n endTime: endTime.format('hh:mma'), // e.g., \"03:30pm\"\n };\n }\n\n getTimezoneLabelHTML(timezone: string) {\n const offset = getTimezoneOffset(timezone);\n return (\n <span\n class=\"timezone-label\"\n style={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n width: '-webkit-fill-available',\n }}\n >\n {TIMEZONE_MAP[timezone]}{' '}\n <span\n class=\"timezone-offset\"\n style={{\n fontSize: '14px',\n fontWeight: '400',\n color: 'var(--nylas-base-500)',\n }}\n >\n {offset}\n </span>\n </span>\n );\n }\n\n // Function to check if the start time is after the end time (used for validation)\n isStartTimeAfterEndTime(startTime: string, endTime: string): boolean {\n // Parse the times using Day.js\n const start = dayjs(startTime, 'hh:mma');\n const end = dayjs(endTime, 'hh:mma');\n\n // Compare start and end times\n return start.isAfter(end);\n }\n\n isStartTimeEqualToEndTime(startTime: string, endTime: string): boolean {\n const start = dayjs(startTime, 'hh:mma');\n const end = dayjs(endTime, 'hh:mma');\n return start.isSame(end);\n }\n\n // Function to get the start and end times in Unix timestamp format (used in the valueChanged event)\n getStartAndEndTimes() {\n const start_time = dayjs(`${this.selectedDate} ${this.selectedStartTime}`, 'YYYY-MM-DD hh:mma').toDate();\n const end_time = dayjs(`${this.selectedDate} ${this.selectedEndTime}`, 'YYYY-MM-DD hh:mma').toDate();\n\n return {\n start_time: Math.round(start_time.getTime() / 1000),\n end_time: Math.round(end_time.getTime() / 1000),\n };\n }\n\n // Function to get the custom options for the RRule\n getCustomOptions() {\n if (this.selectedRecurrenceType !== 'custom') {\n return undefined;\n }\n\n const repeatFreq = periodMap[this.repeatEveryFrequency];\n\n return {\n frequency: repeatFreq,\n interval: this.repeatEveryInterval,\n daysOfWeek: this.repeatEveryFrequency === 'week' ? this.repeatOnDays : undefined,\n monthlySameDate: this.repeatEveryFrequency === 'month' ? this.repeatMonthlySameDate : undefined,\n end: {\n type: this.repeatEndType,\n count: this.repeatEndType === 'after' ? this.repeatEndAfter : undefined,\n date: this.repeatEndType === 'on' ? this.repeatEndOn : undefined,\n },\n };\n }\n\n handleValueChanged(noValue: boolean = false) {\n const customOptions = this.getCustomOptions();\n this.selectedRrule = generateRRule(this.selectedDate, this.selectedRecurrenceType, this.repeatEndOn, customOptions, this.selectedTimezone);\n const { start_time, end_time } = this.getStartAndEndTimes();\n const internalsObj = {\n when: {\n start_time: start_time,\n end_time: end_time,\n start_timezone: this.selectedTimezone,\n end_timezone: this.selectedTimezone,\n },\n recurrence: this.selectedRrule ? [this.selectedRrule] : [],\n };\n this.internals.setFormValue(JSON.stringify(internalsObj), this.name);\n if (!noValue) {\n this.valueChanged.emit({\n value: JSON.stringify(internalsObj),\n name: this.name,\n });\n }\n }\n\n // Listeners\n @Listen('timeChange')\n setTime(event: CustomEvent<{ key: string; value: string }>) {\n const { key, value } = event.detail;\n if (key === 'start-time') {\n this.selectedStartTime = value;\n } else if (key === 'end-time') {\n this.selectedEndTime = value;\n }\n const validateStartTimeAfterEndTime = this.isStartTimeAfterEndTime(this.selectedStartTime, this.selectedEndTime);\n const validateStartTimeEqualToEndTime = this.isStartTimeEqualToEndTime(this.selectedStartTime, this.selectedEndTime);\n this.timeRangeError = validateStartTimeAfterEndTime || validateStartTimeEqualToEndTime;\n if (validateStartTimeAfterEndTime) {\n this.timeWindowFormError.emit({\n key: this.name,\n message: 'Invalid time range',\n });\n return;\n } else if (validateStartTimeEqualToEndTime) {\n this.timeWindowFormError.emit({\n key: this.name,\n message: 'Start time and end time cannot be the same',\n });\n return;\n }\n\n this.handleValueChanged();\n }\n\n @Listen('nylasFormDropdownChanged')\n nylasFormDropdownChangedHandler(\n event: CustomEvent<{\n value: RecurrenceType | RepeatEndType | string;\n name: string;\n }>,\n ) {\n const { name, value } = event.detail;\n if (name === 'timezone') {\n this.selectedTimezone = value;\n } else if (name === 'recurrence-type') {\n this.selectedRecurrenceType = value as RecurrenceType;\n } else if (name === 'month-recurrence-type') {\n this.repeatMonthlySameDate = value === 'monthly-same-date';\n } else if (name === 'custom-recurrence-end-type') {\n this.repeatEndType = value as RepeatEndType;\n }\n\n this.handleValueChanged();\n }\n\n @Listen('nylasFormInputChanged')\n nylasFormInputChangedHandler(event: CustomEvent<{ value: string; name: string }>) {\n const { name, value } = event.detail;\n if (name === 'date-time-input') {\n this.selectedDate = value;\n this.recurrenceOptions = this.generateRecurrenceOptions(this.selectedDate, this.selectedTimezone);\n this.monthRecurrenceOptions = this.getMonthRecurrenceOptions(this.selectedDate, this.selectedTimezone);\n } else if (name === 'recurrence-end-date') {\n this.repeatEndOn = value;\n } else if (name === 'custom-recurrence-end-date') {\n this.repeatEndOn = value;\n } else if (name === 'recurrence-end-after') {\n this.repeatEndAfter = parseInt(value);\n }\n\n this.handleValueChanged();\n }\n\n @Listen('timePeriodChanged')\n timePeriodChangedHandler(event: CustomEvent<{ number: number; period: 'day' | 'week' | 'month' | 'year' }>) {\n const { number, period } = event.detail;\n this.repeatEveryInterval = number;\n this.repeatEveryFrequency = period;\n\n if (period === 'month') {\n this.monthRecurrenceOptions = this.getMonthRecurrenceOptions(this.selectedDate, this.selectedTimezone);\n }\n\n this.handleValueChanged();\n }\n\n @RegisterComponent<NylasEventTimeslot, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-event-timeslot',\n stateToProps: new Map([['schedulerConfig.selectedLanguage', 'selectedLanguage']]),\n eventToProps: {\n valueChanged: async (event: CustomEvent<{ value: string; name: string }>, _nylasConnector: NylasSchedulerConfigConnector) => {\n debug('nylas-event-timeslot', 'valueChanged', event.detail);\n },\n },\n fireRegisterEvent: true,\n })\n render() {\n const defaultRecurrenceOption = this.recurrenceOptions.find(option => option.value === this.selectedRecurrenceType);\n const timezoneOptions = Object.keys(TIMEZONE_MAP).map(key => ({\n labelHTML: this.getTimezoneLabelHTML(key),\n label: TIMEZONE_MAP[key],\n value: key,\n }));\n const selectedTimezoneOption = timezoneOptions.find(i => i.value === this.selectedTimezone);\n const endOptions = [\n { label: i18next.t('nylasEventTimeslot.customRecurrence.endsOptions.never'), value: 'never' },\n { label: i18next.t('nylasEventTimeslot.customRecurrence.endsOptions.on'), value: 'on' },\n { label: i18next.t('nylasEventTimeslot.customRecurrence.endsOptions.after'), value: 'after' },\n ];\n const defaultEndOnDate = dayjs(this.selectedDate).add(1, 'year').toISOString().split('T')[0];\n const defaultEndAfter = this.repeatEveryFrequency === 'week' ? 4 : this.repeatEveryFrequency === 'month' ? 12 : 5;\n this.repeatEndOn = this.repeatEndOn || defaultEndOnDate;\n this.repeatEndAfter = this.repeatEndAfter || defaultEndAfter;\n\n return (\n <Host>\n <div class=\"nylas-event-timeslot\" part=\"netimeslot\">\n <label htmlFor=\"date-time-input\">{i18next.t('nylasEventTimeslot.dateTimeLabel')}</label>\n <div class=\"date-time-input\" part=\"netimeslot__date-time-input\">\n <div class=\"date-time-picker\" part=\"netimeslot__date-time-picker\">\n <nylas-date-component name=\"date-time-input\" defaultValue={this.selectedDate} id={'date-time-input'} required={true}></nylas-date-component>\n <div class=\"time-range\" part=\"netimeslot__time-range\">\n <nylas-time-window-picker\n id={'start-time'}\n hasError={this.timeRangeError}\n time={this.selectedStartTime}\n language={this.selectedLanguage}\n name={'start-time'}\n key={'start-time'}\n exportparts=\"time-picker: nap__time-picker-container, time-input: nap__time-picker-input, times: nap__time-picker-times\"\n />\n <span>–</span>\n <nylas-time-window-picker\n id={'end-time'}\n hasError={this.timeRangeError}\n time={this.selectedEndTime}\n language={this.selectedLanguage}\n name={'end-time'}\n key={'end-time'}\n minimumStartTime={this.selectedStartTime}\n exportparts=\"time-picker: nap__time-picker-container, time-input: nap__time-picker-input, times: nap__time-picker-times\"\n />\n </div>\n {selectedTimezoneOption?.label && (\n <select-dropdown\n name=\"timezone\"\n exportparts=\"sd_dropdown: nap__timezone-container, sd_dropdown-button: nap__timezone-button, sd_dropdown-content: nap__timezone-dropdown-content\"\n options={timezoneOptions}\n withChevron={false}\n defaultSelectedOption={selectedTimezoneOption}\n >\n <span slot=\"select-icon\">\n <globe-icon width=\"20\" height=\"20\" />\n </span>\n </select-dropdown>\n )}\n </div>\n <div class=\"recurrence-options\" part=\"netimeslot__recurrence-options\">\n {defaultRecurrenceOption && defaultRecurrenceOption?.label && (\n <div class=\"recurrence-type\" part=\"netimeslot__recurrence-type\">\n <label htmlFor=\"recurrence-type\">{i18next.t('nylasEventTimeslot.recurrenceLabel')}</label>\n <select-dropdown\n withSearch={false}\n id=\"recurrence-type\"\n name=\"recurrence-type\"\n options={this.recurrenceOptions}\n defaultSelectedOption={defaultRecurrenceOption}\n exportparts=\"sd_dropdown: netimeslot__dropdown, sd_dropdown-button: netimeslot__dropdown-button, sd_dropdown-content: netimeslot__dropdown-content\"\n ></select-dropdown>\n </div>\n )}\n {this.selectedRecurrenceType !== 'custom' && this.selectedRecurrenceType !== 'none' && (\n <div class=\"recurrence-end\" part=\"netimeslot__recurrence-end\">\n <label>{i18next.t('nylasEventTimeslot.endDate')}</label>\n <nylas-date-component\n name=\"recurrence-end-date\"\n defaultValue={this.repeatEndOn || defaultEndOnDate}\n id={'recurrence-end-date'}\n required={true}\n ></nylas-date-component>\n </div>\n )}\n\n {this.selectedRecurrenceType === 'custom' && (\n <div class=\"custom-recurrence-time-period\" part=\"netimeslot__custom-recurrence\">\n <label htmlFor=\"\">{i18next.t('nylasEventTimeslot.customRecurrence.repeatEvery')}</label>\n <time-period-selector\n id=\"custom-recurrence-time-period\"\n exportparts=\"tps__number-dropdown: netimeslot__number-dropdown, tps__number-dropdown-button: netimeslot__number-dropdown-button, tps__number-dropdown-content: netimeslot__number-dropdown-content, tps__period-dropdown: netimeslot__period-dropdown, tps__period-dropdown-button: netimeslot__period-dropdown-button, tps__period-dropdown-content: netimeslot__period-dropdown-content\"\n timePeriods={[\n { value: 'day', label: i18next.t('timePeriod', { context: 'day' }) },\n { value: 'week', label: i18next.t('timePeriod', { context: 'week' }) },\n { value: 'month', label: i18next.t('timePeriod', { context: 'month' }) },\n { value: 'year', label: i18next.t('timePeriod', { context: 'year' }) },\n ]}\n defaultSelectedNumber={this.repeatEveryInterval}\n defaultSelectedPeriod={this.repeatEveryFrequency}\n />\n </div>\n )}\n <div class=\"repeat-on\">\n {this.selectedRecurrenceType === 'custom' && this.repeatEveryFrequency === 'week' && (\n <div class=\"days\">\n <label>{i18next.t('nylasEventTimeslot.customRecurrence.repeatOn')}</label>\n <div class=\"buttons\">\n {[\n { label: 'S', value: 'SU', title: 'Sunday' },\n { label: 'M', value: 'MO', title: 'Monday' },\n { label: 'T', value: 'TU', title: 'Tuesday' },\n { label: 'W', value: 'WE', title: 'Wednesday' },\n { label: 'T', value: 'TH', title: 'Thursday' },\n { label: 'F', value: 'FR', title: 'Friday' },\n { label: 'S', value: 'SA', title: 'Saturday' },\n ].map(day => (\n <button\n class={{ selected: this.repeatOnDays.includes(day.value) }}\n title={day.title}\n onClick={() => {\n this.repeatOnDays = this.repeatOnDays.includes(day.value) ? this.repeatOnDays.filter(d => d !== day.value) : [...this.repeatOnDays, day.value];\n this.handleValueChanged();\n }}\n >\n {day.label}\n </button>\n ))}\n </div>\n </div>\n )}\n {this.selectedRecurrenceType === 'custom' && this.repeatEveryFrequency === 'month' && (\n <div class=\"month-recurrence\">\n <span></span>\n <select-dropdown\n withSearch={false}\n id=\"month-recurrence-type\"\n name=\"month-recurrence-type\"\n options={this.monthRecurrenceOptions}\n defaultSelectedOption={this.repeatMonthlySameDate ? this.monthRecurrenceOptions[0] : this.monthRecurrenceOptions[1]}\n exportparts=\"sd_dropdown: netimeslot__dropdown, sd_dropdown-button: netimeslot__dropdown-button, sd_dropdown-content: netimeslot__dropdown-content\"\n ></select-dropdown>\n </div>\n )}\n <div class=\"custom-recurrence\">\n {this.selectedRecurrenceType === 'custom' && (\n <div class=\"custom-recurrence-ends\">\n <label htmlFor=\"recurrence-type\">{i18next.t('nylasEventTimeslot.customRecurrence.ends')}</label>\n <select-dropdown\n withSearch={false}\n id=\"custom-recurrence-end-type\"\n name=\"custom-recurrence-end-type\"\n options={endOptions}\n defaultSelectedOption={endOptions.find(option => option.value === this.repeatEndType)}\n exportparts=\"sd_dropdown: netimeslot__dropdown, sd_dropdown-button: netimeslot__dropdown-button, sd_dropdown-content: netimeslot__dropdown-content\"\n ></select-dropdown>\n </div>\n )}\n {this.selectedRecurrenceType === 'custom' && this.repeatEndType === 'on' && (\n <div>\n <nylas-date-component\n name=\"custom-recurrence-end-date\"\n defaultValue={this.repeatEndOn || defaultEndOnDate}\n id={'custom-recurrence-end-date'}\n required={true}\n ></nylas-date-component>\n </div>\n )}\n {this.selectedRecurrenceType === 'custom' && this.repeatEndType === 'after' && (\n <div class=\"custom-recurrence-end-after\">\n <input-component\n name=\"recurrence-end-after\"\n id=\"recurrence-end-after\"\n type=\"number\"\n minValue={1}\n defaultValue={defaultEndAfter.toString()}\n exportparts=\"ic_input: netimeslot__input-textfield\"\n />\n <span>{i18next.t('nylasEventTimeslot.customRecurrence.occurrences')}</span>\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"nylas-event-timeslot.js","sourceRoot":"","sources":["../../../../src/components/scheduler-editor/nylas-event-timeslot/nylas-event-timeslot.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAE9H,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AA9LC;IAVC,iBAAiB,CAAwG;QACxH,IAAI,EAAE,sBAAsB;QAC5B,YAAY,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,kCAAkC,EAAE,kBAAkB,CAAC,CAAC,CAAC;QACjF,YAAY,EAAE;YACZ,YAAY,EAAE,KAAK,EAAE,KAAmD,EAAE,eAA8C,EAAE,EAAE;gBAC1H,KAAK,CAAC,sBAAsB,EAAE,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;YAC9D,CAAC;SACF;QACD,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;gDA8LD","sourcesContent":["import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug, generateRRule, getTimezoneOffset } from '@/utils/utils';\nimport { AttachInternals, Component, Element, Event, EventEmitter, Host, Listen, Prop, State, Watch, h } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE, TIMEZONE_MAP } from '@/common/constants';\nimport dayjs from 'dayjs';\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\nimport utc from 'dayjs/plugin/utc';\nimport timezone from 'dayjs/plugin/timezone';\n\ndayjs.extend(customParseFormat);\ndayjs.extend(utc);\ndayjs.extend(timezone);\n\nconst periodMap = {\n day: 'daily',\n week: 'weekly',\n month: 'monthly',\n year: 'yearly',\n};\n\ntype RepeatEndType = 'never' | 'on' | 'after';\ntype RecurrenceType = 'none' | 'daily' | 'weekly' | 'monthly' | 'yearly' | 'custom';\n\n/**\n * The `nylas-event-timeslot` component is a UI component that allows users to select the event type for the scheduler configuration.\n */\n@Component({\n tag: 'nylas-event-timeslot',\n styleUrl: 'nylas-event-timeslot.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasEventTimeslot {\n @Element() host!: HTMLNylasEventTimeslotElement;\n\n /**\n * @standalone\n * The name of the component\n */\n @Prop() name: string = 'event-timeslot';\n /**\n * The initial value of the event timeslot.\n */\n @Prop() initialValue?: {\n when: {\n start_time: number;\n end_time: number;\n start_timezone: string;\n end_timezone: string;\n };\n recurrence: string[];\n };\n\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n\n /**\n * The selected date.\n */\n @State() selectedDate!: string;\n\n /**\n * The selected start time.\n */\n @State() selectedStartTime!: string;\n\n /**\n * The selected end time.\n */\n @State() selectedEndTime!: string;\n\n /**\n * The timezone.\n */\n @State() selectedTimezone!: string;\n\n /**\n * The selected recurrence type.\n */\n @State() selectedRecurrenceType!: RecurrenceType;\n\n /**\n * Time range error.\n */\n @State() timeRangeError: boolean = false;\n\n /**\n * The selected rrule.\n */\n @State() selectedRrule!: string | null;\n\n /**\n * Recurrence options.\n */\n @State() recurrenceOptions: { label: string; value: string }[] = [];\n /**\n * Repeat every frequency.\n */\n @State() repeatEveryInterval: number = 1;\n /**\n * Repeat every period.\n */\n @State() repeatEveryFrequency: string = 'week';\n /**\n * Repeat on days.\n */\n @State() repeatOnDays: string[] = [];\n /**\n * Repeat monthly on.\n */\n @State() repeatMonthlySameDate: boolean = true;\n /**\n * Repeat end type.\n */\n @State() repeatEndType: RepeatEndType = 'never';\n /**\n * Repeat end after.\n */\n @State() repeatEndAfter: number = 1;\n /**\n * Repeat end on (custom recurrence).\n */\n @State() repeatEndOn: string | undefined;\n /**\n * Month recurrence options.\n */\n @State() monthRecurrenceOptions: { label: string; value: string }[] = [];\n /**\n * The end date for recurrence (non-custom recurrence).\n */\n @State() endDate: string | undefined;\n\n /**\n * The element internals.\n */\n @AttachInternals() internals!: ElementInternals;\n\n /**\n * This event is fired when the value of the event location changes.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n /**\n * This event is fired when the value of the event timeslot changes.\n */\n @Event() timeWindowFormError!: EventEmitter<{\n key: string;\n message: string;\n }>;\n\n // Lifecycle methods\n connectedCallback() {\n debug('nylas-event-timeslot', 'connectedCallback');\n }\n\n disconnectedCallback() {\n debug('nylas-event-timeslot', 'disconnectedCallback');\n }\n\n componentWillLoad() {\n debug('nylas-event-timeslot', 'componentWillLoad');\n // See comment in the @Watch('name') decorator for more information.\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('nylas-event-timeslot', 'componentDidLoad');\n\n // Set defaults from initialValue or fallback to current values\n if (this.initialValue) {\n const { when, recurrence } = this.initialValue;\n\n if (when) {\n this.selectedDate = dayjs.unix(when.start_time).tz(when.start_timezone).format('YYYY-MM-DD');\n this.selectedStartTime = dayjs.unix(when.start_time).tz(when.start_timezone).format('hh:mma');\n this.selectedEndTime = dayjs.unix(when.end_time).tz(when.end_timezone).format('hh:mma');\n this.selectedTimezone = when.start_timezone;\n } else {\n this.selectedDate = new Date().toISOString().split('T')[0];\n const defaultTimes = this.getSuggestedTime();\n this.selectedStartTime = defaultTimes.startTime;\n this.selectedEndTime = defaultTimes.endTime;\n this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n }\n\n if (recurrence && recurrence.length > 0) {\n this.selectedRrule = recurrence[0];\n const repeatEndAfter = recurrence[0]?.split(';')?.find(s => s.includes('COUNT'));\n if (repeatEndAfter) {\n this.repeatEndAfter = parseInt(repeatEndAfter.split('=')[1]);\n }\n const daysString = recurrence[0]?.split(';')?.find(s => s.includes('BYDAY'));\n if (daysString) {\n this.repeatOnDays = daysString.split('=')[1].split(',');\n }\n const until = recurrence[0]?.split(';')?.find(s => s.includes('UNTIL'));\n if (until) {\n const untilDate = dayjs(until.split('=')[1], 'YYYYMMDDTHHmmss').toDate();\n this.repeatEndOn = dayjs(untilDate).toISOString().split('T')[0];\n this.repeatEndType = 'on';\n }\n const recurrenceType = this.getRecurrenceTypeFromRrule(recurrence[0]);\n this.selectedRecurrenceType = recurrenceType || 'none';\n } else {\n this.selectedRecurrenceType = 'none';\n this.selectedRrule = generateRRule(this.selectedDate, this.selectedRecurrenceType, undefined, undefined, this.selectedTimezone);\n }\n } else {\n this.selectedDate = new Date().toISOString().split('T')[0];\n const defaultTimes = this.getSuggestedTime();\n this.selectedStartTime = defaultTimes.startTime;\n this.selectedEndTime = defaultTimes.endTime;\n this.selectedTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n this.selectedRecurrenceType = 'none';\n this.selectedRrule = generateRRule(this.selectedDate, this.selectedRecurrenceType, undefined, undefined, this.selectedTimezone);\n }\n\n this.recurrenceOptions = this.generateRecurrenceOptions(this.selectedDate, this.selectedTimezone);\n this.monthRecurrenceOptions = this.getMonthRecurrenceOptions(this.selectedDate, this.selectedTimezone);\n\n // Trigger initial value change\n this.handleValueChanged(true);\n }\n\n /**\n * When a name prop is passed, stencil does not automatically set the name attribute on the host element.\n * Since this component is form-associated, the name attribute is required for form submission.\n * This is a workaround to ensure that the name attribute is set on the host element.\n */\n @Watch('name')\n elementNameChangedHandler(newValue: string) {\n debug('nylas-event-timeslot', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n i18next.changeLanguage(newVal);\n }\n\n // Utility function to get the ordinal suffix (e.g., 1st, 2nd, 3rd)\n getOrdinalSuffix(n) {\n const s = ['th', 'st', 'nd', 'rd'];\n const v = n % 100;\n return n + (s[(v - 20) % 10] || s[v] || s[0]);\n }\n\n getRecurrenceTypeFromRrule(rrule: string): RecurrenceType | undefined {\n if (rrule.includes('INTERVAL')) return 'custom';\n if (rrule.includes('FREQ=DAILY')) return 'daily';\n if (rrule.includes('FREQ=WEEKLY')) return 'weekly';\n if (rrule.includes('FREQ=MONTHLY')) return 'monthly';\n if (rrule.includes('FREQ=YEARLY')) return 'yearly';\n return undefined;\n }\n\n // Function to generate dynamic recurrence options\n generateRecurrenceOptions(selectedDate: string, timezoneStr: string) {\n const daysOfWeek = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\n\n // Parse the date in the given timezone\n const selectedDay = dayjs.tz(selectedDate, timezoneStr);\n\n const dayOfWeek = daysOfWeek[selectedDay.day()]; // Get the day of the week (e.g., Thursday)\n\n // Determine the occurrence of the day in the month (e.g., 1st, 2nd, etc.)\n const date = selectedDay.date();\n const occurrenceInMonth = Math.ceil(date / 7); // e.g., 1st Thursday\n\n // Generate options\n return [\n { label: i18next.t('nylasEventTimeslot.recurrenceOptions.none'), value: 'none' },\n { label: i18next.t('nylasEventTimeslot.recurrenceOptions.daily'), value: 'daily' },\n { label: i18next.t('nylasEventTimeslot.recurrenceOptions.weekly', { dayOfWeek: dayOfWeek }), value: 'weekly' },\n { label: i18next.t('nylasEventTimeslot.recurrenceOptions.monthly', { dayOfMonth: `${this.getOrdinalSuffix(occurrenceInMonth)} ${dayOfWeek}` }), value: 'monthly' },\n {\n label: i18next.t('nylasEventTimeslot.recurrenceOptions.yearly', { dateOfMonth: `${selectedDay.format('MMMM D')}` }),\n value: 'yearly',\n },\n { label: i18next.t('nylasEventTimeslot.recurrenceOptions.custom'), value: 'custom' },\n ];\n }\n\n // Function to generate dynamic month recurrence options\n getMonthRecurrenceOptions(selectedDate: string, timezoneStr: string) {\n const daysOfWeek = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\n\n const selectedDay = dayjs.tz(selectedDate, timezoneStr);\n const dayOfWeek = daysOfWeek[selectedDay.day()]; // Get the day of the week (e.g., Thursday)\n const date = selectedDay.date();\n const occurrenceInMonth = Math.ceil(date / 7);\n\n return [\n { label: i18next.t('nylasEventTimeslot.recurrenceOptions.monthOnDay', { date: date }), value: 'monthly-same-date' },\n { label: i18next.t('nylasEventTimeslot.recurrenceOptions.monthly', { dayOfMonth: `${this.getOrdinalSuffix(occurrenceInMonth)} ${dayOfWeek}` }), value: 'monthly' },\n ];\n }\n\n // Function to get the default suggested time shown in the time range picker\n getSuggestedTime() {\n const now = dayjs();\n\n // Round current time to the next 30-minute increment\n const minutes = now.minute();\n const roundedMinutes = minutes <= 30 ? 30 : 60;\n const startTime = now.set('minute', roundedMinutes).set('second', 0);\n\n // Calculate end time (30 minutes after start time)\n const endTime = startTime.add(30, 'minute');\n\n // Format the times in \"hh:mma\" format\n return {\n startTime: startTime.format('hh:mma'), // e.g., \"03:00pm\"\n endTime: endTime.format('hh:mma'), // e.g., \"03:30pm\"\n };\n }\n\n getTimezoneLabelHTML(timezone: string) {\n const offset = getTimezoneOffset(timezone);\n return (\n <span\n class=\"timezone-label\"\n style={{\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n width: '-webkit-fill-available',\n }}\n >\n {TIMEZONE_MAP[timezone]}{' '}\n <span\n class=\"timezone-offset\"\n style={{\n fontSize: '14px',\n fontWeight: '400',\n color: 'var(--nylas-base-500)',\n }}\n >\n {offset}\n </span>\n </span>\n );\n }\n\n // Function to check if the start time is after the end time (used for validation)\n isStartTimeAfterEndTime(startTime: string, endTime: string): boolean {\n // Parse the times using Day.js\n const start = dayjs(startTime, 'hh:mma');\n const end = dayjs(endTime, 'hh:mma');\n\n // Compare start and end times\n return start.isAfter(end);\n }\n\n isStartTimeEqualToEndTime(startTime: string, endTime: string): boolean {\n const start = dayjs(startTime, 'hh:mma');\n const end = dayjs(endTime, 'hh:mma');\n return start.isSame(end);\n }\n\n // Function to get the start and end times in Unix timestamp format (used in the valueChanged event)\n getStartAndEndTimes() {\n const start_time = dayjs(`${this.selectedDate} ${this.selectedStartTime}`, 'YYYY-MM-DD hh:mma').toDate();\n const end_time = dayjs(`${this.selectedDate} ${this.selectedEndTime}`, 'YYYY-MM-DD hh:mma').toDate();\n\n return {\n start_time: Math.round(start_time.getTime() / 1000),\n end_time: Math.round(end_time.getTime() / 1000),\n };\n }\n\n // Function to get the custom options for the RRule\n getCustomOptions() {\n if (this.selectedRecurrenceType !== 'custom') {\n return undefined;\n }\n\n const repeatFreq = periodMap[this.repeatEveryFrequency];\n\n return {\n frequency: repeatFreq,\n interval: this.repeatEveryInterval,\n daysOfWeek: this.repeatEveryFrequency === 'week' ? this.repeatOnDays : undefined,\n monthlySameDate: this.repeatEveryFrequency === 'month' ? this.repeatMonthlySameDate : undefined,\n end: {\n type: this.repeatEndType,\n count: this.repeatEndType === 'after' ? this.repeatEndAfter : undefined,\n date: this.repeatEndType === 'on' ? this.repeatEndOn : undefined,\n },\n };\n }\n\n handleValueChanged(noValue: boolean = false) {\n const customOptions = this.getCustomOptions();\n this.selectedRrule = generateRRule(this.selectedDate, this.selectedRecurrenceType, this.repeatEndOn, customOptions, this.selectedTimezone);\n const { start_time, end_time } = this.getStartAndEndTimes();\n const internalsObj = {\n when: {\n start_time: start_time,\n end_time: end_time,\n start_timezone: this.selectedTimezone,\n end_timezone: this.selectedTimezone,\n },\n recurrence: this.selectedRrule ? [this.selectedRrule] : [],\n };\n this.internals.setFormValue(JSON.stringify(internalsObj), this.name);\n if (!noValue) {\n this.valueChanged.emit({\n value: JSON.stringify(internalsObj),\n name: this.name,\n });\n }\n }\n\n // Listeners\n @Listen('timeChange')\n setTime(event: CustomEvent<{ key: string; value: string }>) {\n const { key, value } = event.detail;\n if (key === 'start-time') {\n this.selectedStartTime = value;\n } else if (key === 'end-time') {\n this.selectedEndTime = value;\n }\n const validateStartTimeAfterEndTime = this.isStartTimeAfterEndTime(this.selectedStartTime, this.selectedEndTime);\n const validateStartTimeEqualToEndTime = this.isStartTimeEqualToEndTime(this.selectedStartTime, this.selectedEndTime);\n this.timeRangeError = validateStartTimeAfterEndTime || validateStartTimeEqualToEndTime;\n if (validateStartTimeAfterEndTime) {\n this.timeWindowFormError.emit({\n key: this.name,\n message: 'Invalid time range',\n });\n return;\n } else if (validateStartTimeEqualToEndTime) {\n this.timeWindowFormError.emit({\n key: this.name,\n message: 'Start time and end time cannot be the same',\n });\n return;\n }\n\n this.handleValueChanged();\n }\n\n @Listen('nylasFormDropdownChanged')\n nylasFormDropdownChangedHandler(\n event: CustomEvent<{\n value: RecurrenceType | RepeatEndType | string;\n name: string;\n }>,\n ) {\n const { name, value } = event.detail;\n if (name === 'timezone') {\n this.selectedTimezone = value;\n } else if (name === 'recurrence-type') {\n this.selectedRecurrenceType = value as RecurrenceType;\n } else if (name === 'month-recurrence-type') {\n this.repeatMonthlySameDate = value === 'monthly-same-date';\n } else if (name === 'custom-recurrence-end-type') {\n this.repeatEndType = value as RepeatEndType;\n }\n\n this.handleValueChanged();\n }\n\n @Listen('nylasFormInputChanged')\n nylasFormInputChangedHandler(event: CustomEvent<{ value: string; name: string }>) {\n const { name, value } = event.detail;\n if (name === 'date-time-input') {\n this.selectedDate = value;\n this.recurrenceOptions = this.generateRecurrenceOptions(this.selectedDate, this.selectedTimezone);\n this.monthRecurrenceOptions = this.getMonthRecurrenceOptions(this.selectedDate, this.selectedTimezone);\n } else if (name === 'recurrence-end-date') {\n this.repeatEndOn = value;\n } else if (name === 'custom-recurrence-end-date') {\n this.repeatEndOn = value;\n } else if (name === 'recurrence-end-after') {\n const parsedValue = parseInt(value);\n if (parsedValue < 1 || isNaN(parsedValue)) {\n this.timeWindowFormError.emit({\n key: this.name,\n message: i18next.t('fixFormErrors'),\n });\n return;\n }\n this.repeatEndAfter = parsedValue;\n }\n\n this.handleValueChanged();\n }\n\n @Listen('timePeriodChanged')\n timePeriodChangedHandler(event: CustomEvent<{ number: number; period: 'day' | 'week' | 'month' | 'year' }>) {\n const { number, period } = event.detail;\n this.repeatEveryInterval = number;\n this.repeatEveryFrequency = period;\n\n if (period === 'month') {\n this.monthRecurrenceOptions = this.getMonthRecurrenceOptions(this.selectedDate, this.selectedTimezone);\n }\n\n this.handleValueChanged();\n }\n\n @RegisterComponent<NylasEventTimeslot, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-event-timeslot',\n stateToProps: new Map([['schedulerConfig.selectedLanguage', 'selectedLanguage']]),\n eventToProps: {\n valueChanged: async (event: CustomEvent<{ value: string; name: string }>, _nylasConnector: NylasSchedulerConfigConnector) => {\n debug('nylas-event-timeslot', 'valueChanged', event.detail);\n },\n },\n fireRegisterEvent: true,\n })\n render() {\n const defaultRecurrenceOption = this.recurrenceOptions.find(option => option.value === this.selectedRecurrenceType);\n const timezoneOptions = Object.keys(TIMEZONE_MAP).map(key => ({\n labelHTML: this.getTimezoneLabelHTML(key),\n label: TIMEZONE_MAP[key],\n value: key,\n }));\n const selectedTimezoneOption = timezoneOptions.find(i => i.value === this.selectedTimezone);\n const endOptions = [\n { label: i18next.t('nylasEventTimeslot.customRecurrence.endsOptions.never'), value: 'never' },\n { label: i18next.t('nylasEventTimeslot.customRecurrence.endsOptions.on'), value: 'on' },\n { label: i18next.t('nylasEventTimeslot.customRecurrence.endsOptions.after'), value: 'after' },\n ];\n const defaultEndOnDate = dayjs(this.selectedDate).add(1, 'year').toISOString().split('T')[0];\n const defaultEndAfter = this.repeatEveryFrequency === 'week' ? 4 : this.repeatEveryFrequency === 'month' ? 12 : 5;\n this.repeatEndOn = this.repeatEndOn || defaultEndOnDate;\n this.repeatEndAfter = this.repeatEndAfter || defaultEndAfter;\n\n return (\n <Host>\n <div class=\"nylas-event-timeslot\" part=\"netimeslot\">\n <label htmlFor=\"date-time-input\">{i18next.t('nylasEventTimeslot.dateTimeLabel')}</label>\n <div class=\"date-time-input\" part=\"netimeslot__date-time-input\">\n <div class=\"date-time-picker\" part=\"netimeslot__date-time-picker\">\n <nylas-date-component name=\"date-time-input\" defaultValue={this.selectedDate} id={'date-time-input'} required={true}></nylas-date-component>\n <div class=\"time-range\" part=\"netimeslot__time-range\">\n <nylas-time-window-picker\n id={'start-time'}\n hasError={this.timeRangeError}\n time={this.selectedStartTime}\n language={this.selectedLanguage}\n name={'start-time'}\n key={'start-time'}\n exportparts=\"time-picker: nap__time-picker-container, time-input: nap__time-picker-input, times: nap__time-picker-times\"\n />\n <span>–</span>\n <nylas-time-window-picker\n id={'end-time'}\n hasError={this.timeRangeError}\n time={this.selectedEndTime}\n language={this.selectedLanguage}\n name={'end-time'}\n key={'end-time'}\n minimumStartTime={this.selectedStartTime}\n exportparts=\"time-picker: nap__time-picker-container, time-input: nap__time-picker-input, times: nap__time-picker-times\"\n />\n </div>\n {selectedTimezoneOption?.label && (\n <select-dropdown\n name=\"timezone\"\n exportparts=\"sd_dropdown: nap__timezone-container, sd_dropdown-button: nap__timezone-button, sd_dropdown-content: nap__timezone-dropdown-content\"\n options={timezoneOptions}\n withChevron={false}\n defaultSelectedOption={selectedTimezoneOption}\n >\n <span slot=\"select-icon\">\n <globe-icon width=\"20\" height=\"20\" />\n </span>\n </select-dropdown>\n )}\n </div>\n <div class=\"recurrence-options\" part=\"netimeslot__recurrence-options\">\n {defaultRecurrenceOption && defaultRecurrenceOption?.label && (\n <div class=\"recurrence-type\" part=\"netimeslot__recurrence-type\">\n <label htmlFor=\"recurrence-type\">{i18next.t('nylasEventTimeslot.recurrenceLabel')}</label>\n <select-dropdown\n withSearch={false}\n id=\"recurrence-type\"\n name=\"recurrence-type\"\n options={this.recurrenceOptions}\n defaultSelectedOption={defaultRecurrenceOption}\n exportparts=\"sd_dropdown: netimeslot__dropdown, sd_dropdown-button: netimeslot__dropdown-button, sd_dropdown-content: netimeslot__dropdown-content\"\n ></select-dropdown>\n </div>\n )}\n {this.selectedRecurrenceType !== 'custom' && this.selectedRecurrenceType !== 'none' && (\n <div class=\"recurrence-end\" part=\"netimeslot__recurrence-end\">\n <label>{i18next.t('nylasEventTimeslot.endDate')}</label>\n <nylas-date-component\n name=\"recurrence-end-date\"\n defaultValue={this.repeatEndOn || defaultEndOnDate}\n id={'recurrence-end-date'}\n required={true}\n ></nylas-date-component>\n </div>\n )}\n\n {this.selectedRecurrenceType === 'custom' && (\n <div class=\"custom-recurrence-time-period\" part=\"netimeslot__custom-recurrence\">\n <label htmlFor=\"\">{i18next.t('nylasEventTimeslot.customRecurrence.repeatEvery')}</label>\n <time-period-selector\n id=\"custom-recurrence-time-period\"\n exportparts=\"tps__number-dropdown: netimeslot__number-dropdown, tps__number-dropdown-button: netimeslot__number-dropdown-button, tps__number-dropdown-content: netimeslot__number-dropdown-content, tps__period-dropdown: netimeslot__period-dropdown, tps__period-dropdown-button: netimeslot__period-dropdown-button, tps__period-dropdown-content: netimeslot__period-dropdown-content\"\n timePeriods={[\n { value: 'day', label: i18next.t('timePeriod', { context: 'day' }) },\n { value: 'week', label: i18next.t('timePeriod', { context: 'week' }) },\n { value: 'month', label: i18next.t('timePeriod', { context: 'month' }) },\n { value: 'year', label: i18next.t('timePeriod', { context: 'year' }) },\n ]}\n defaultSelectedNumber={this.repeatEveryInterval}\n defaultSelectedPeriod={this.repeatEveryFrequency}\n />\n </div>\n )}\n <div class=\"repeat-on\">\n {this.selectedRecurrenceType === 'custom' && this.repeatEveryFrequency === 'week' && (\n <div class=\"days\">\n <label>{i18next.t('nylasEventTimeslot.customRecurrence.repeatOn')}</label>\n <div class=\"buttons\">\n {[\n { label: 'S', value: 'SU', title: 'Sunday' },\n { label: 'M', value: 'MO', title: 'Monday' },\n { label: 'T', value: 'TU', title: 'Tuesday' },\n { label: 'W', value: 'WE', title: 'Wednesday' },\n { label: 'T', value: 'TH', title: 'Thursday' },\n { label: 'F', value: 'FR', title: 'Friday' },\n { label: 'S', value: 'SA', title: 'Saturday' },\n ].map(day => (\n <button\n class={{ selected: this.repeatOnDays.includes(day.value) }}\n title={day.title}\n onClick={() => {\n this.repeatOnDays = this.repeatOnDays.includes(day.value) ? this.repeatOnDays.filter(d => d !== day.value) : [...this.repeatOnDays, day.value];\n this.handleValueChanged();\n }}\n >\n {day.label}\n </button>\n ))}\n </div>\n </div>\n )}\n {this.selectedRecurrenceType === 'custom' && this.repeatEveryFrequency === 'month' && (\n <div class=\"month-recurrence\">\n <span></span>\n <select-dropdown\n withSearch={false}\n id=\"month-recurrence-type\"\n name=\"month-recurrence-type\"\n options={this.monthRecurrenceOptions}\n defaultSelectedOption={this.repeatMonthlySameDate ? this.monthRecurrenceOptions[0] : this.monthRecurrenceOptions[1]}\n exportparts=\"sd_dropdown: netimeslot__dropdown, sd_dropdown-button: netimeslot__dropdown-button, sd_dropdown-content: netimeslot__dropdown-content\"\n ></select-dropdown>\n </div>\n )}\n <div class=\"custom-recurrence\">\n {this.selectedRecurrenceType === 'custom' && (\n <div class=\"custom-recurrence-ends\">\n <label htmlFor=\"recurrence-type\">{i18next.t('nylasEventTimeslot.customRecurrence.ends')}</label>\n <select-dropdown\n withSearch={false}\n id=\"custom-recurrence-end-type\"\n name=\"custom-recurrence-end-type\"\n options={endOptions}\n defaultSelectedOption={endOptions.find(option => option.value === this.repeatEndType)}\n exportparts=\"sd_dropdown: netimeslot__dropdown, sd_dropdown-button: netimeslot__dropdown-button, sd_dropdown-content: netimeslot__dropdown-content\"\n ></select-dropdown>\n </div>\n )}\n {this.selectedRecurrenceType === 'custom' && this.repeatEndType === 'on' && (\n <div>\n <nylas-date-component\n name=\"custom-recurrence-end-date\"\n defaultValue={this.repeatEndOn || defaultEndOnDate}\n id={'custom-recurrence-end-date'}\n required={true}\n ></nylas-date-component>\n </div>\n )}\n {this.selectedRecurrenceType === 'custom' && this.repeatEndType === 'after' && (\n <div class=\"custom-recurrence-end-after\">\n <input-component\n name=\"recurrence-end-after\"\n id=\"recurrence-end-after\"\n type=\"number\"\n minValue={1}\n defaultValue={defaultEndAfter.toString()}\n exportparts=\"ic_input: netimeslot__input-textfield\"\n />\n <span>{i18next.t('nylasEventTimeslot.customRecurrence.occurrences')}</span>\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -123,8 +123,8 @@ export class NylasEventTitle {
|
|
|
123
123
|
}
|
|
124
124
|
valueChangedHandler(event) {
|
|
125
125
|
const { name, value } = event.detail;
|
|
126
|
-
const additionalFields = value || {};
|
|
127
126
|
if (name === 'additional-fields') {
|
|
127
|
+
const additionalFields = JSON.parse(value.toString());
|
|
128
128
|
const newKeys = Object.keys(additionalFields) || [];
|
|
129
129
|
const newTokens = newKeys.map(key => {
|
|
130
130
|
return {
|
|
@@ -386,10 +386,10 @@ export class NylasEventTitle {
|
|
|
386
386
|
return (h("div", { class: "token-label" }, h("span", { class: "token" }, token.token), h("span", { class: "description" }, token.description)));
|
|
387
387
|
}
|
|
388
388
|
render() {
|
|
389
|
-
return (h(Host, { key: '
|
|
389
|
+
return (h(Host, { key: 'be5c644520aa3a3a32699d33a74a53be4a874f6c' }, h("div", { key: '3ccaeb04b75c6e7e15ebeda6b0f6c02f3b9c0869', class: "nylas-event-title", part: "net" }, h("label", { key: '4cd1348b60a56dca4a8092aecfe51103c53f048e', htmlFor: "title" }, i18next.t('nylasEventTitle.headerTitle'), h("span", { key: '5d18db7ede458a9ab2d1b5bb19319d072ff2b70e', class: "required" }, "*")), h("div", { key: 'e4c00b94be0a861696d81526c26703fef888f536', class: {
|
|
390
390
|
title: true,
|
|
391
391
|
error: this.validationError !== '',
|
|
392
|
-
}, part: "net__title", ref: el => (this.titleRef = el), contentEditable: "true", onInput: e => this.handleChange(e), onKeyDown: event => this.handleInputKeyDown(event) }), this.showTokens && this.filteredTokens?.length > 0 && (h("div", { class: "token-options", part: "net__dropdown-content" }, h("ul", { tabindex: "-1", role: "listbox", "aria-label": this.name, "aria-activedescendant": this.ariaActivedescendant }, this.filteredTokens.map(option => (h("li", { tabindex: "0", key: option.label, id: option.label, class: { active: this.ariaActivedescendant === option.label }, onClick: e => this.selectOption(e, option), role: "option" }, this.getLabelHTML(option.labelHTML))))))), h("span", { key: '
|
|
392
|
+
}, part: "net__title", ref: el => (this.titleRef = el), contentEditable: "true", onInput: e => this.handleChange(e), onKeyDown: event => this.handleInputKeyDown(event) }), this.showTokens && this.filteredTokens?.length > 0 && (h("div", { class: "token-options", part: "net__dropdown-content" }, h("ul", { tabindex: "-1", role: "listbox", "aria-label": this.name, "aria-activedescendant": this.ariaActivedescendant }, this.filteredTokens.map(option => (h("li", { tabindex: "0", key: option.label, id: option.label, class: { active: this.ariaActivedescendant === option.label }, onClick: e => this.selectOption(e, option), role: "option" }, this.getLabelHTML(option.labelHTML))))))), h("span", { key: '287386dc6cfafe56e01f6a51e3538da909cbd2db', class: "help-text" }, i18next.t('nylasEventTitle.helpText', { context: 'start', field: i18next.t('nylasEventTitle.title') }), " ", h("code", { key: '0a12678367abd26be60e14253837dfb8648f00b4' }, "$"), ' ', i18next.t('nylasEventTitle.helpText', { context: 'end' }), h("span", { key: '18102bdb2013e451ece515ae09acf18a529e8f78', class: "label-icon" }, h("tooltip-component", { key: 'b79fccb2ca7864ae7446546be6d255c11ba4eced' }, h("info-icon", { key: 'ff624259a594a5ff192ab0e24ebd6f621d99cf63', slot: "tooltip-icon" }), h("span", { key: 'd406f605a1b2f7c503cb16c16b9205a4fa6e8c03', slot: "tooltip-content" }, i18next.t('nylasEventTitle.tooltip.desc'), " ", h("code", { key: 'a4cf09de868ab908598a6d96a08b3880d76ff89d' }, '${invitee}'))))), this.validationError != '' && h("span", { class: "error-message" }, i18next.t(`nylasEventTitle.${this.validationError}`)))));
|
|
393
393
|
}
|
|
394
394
|
static get is() { return "nylas-event-title"; }
|
|
395
395
|
static get encapsulation() { return "shadow"; }
|
package/dist/collection/components/scheduler-editor/nylas-event-title/nylas-event-title.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nylas-event-title.js","sourceRoot":"","sources":["../../../../src/components/scheduler-editor/nylas-event-title/nylas-event-title.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE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AA8B,CAAC;;gCAAE,+DAAO,YAAY,CAAQ,CAClE,CACW,CACf,CACF;gBACN,IAAI,CAAC,eAAe,IAAI,EAAE,IAAI,YAAM,KAAK,EAAC,eAAe,IAAE,OAAO,CAAC,CAAC,CAAC,mBAAmB,IAAI,CAAC,eAAe,EAAE,CAAC,CAAQ,CACpH,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAtDC;IATC,iBAAiB,CAAqG;QACrH,IAAI,EAAE,mBAAmB;QACzB,YAAY,EAAE,IAAI,GAAG,CAAC;YACpB,CAAC,uCAAuC,EAAE,uBAAuB,CAAC;YAClE,CAAC,kCAAkC,EAAE,kBAAkB,CAAC;SACzD,CAAC;QACF,YAAY,EAAE,EAAE;QAChB,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;6CAsDD","sourcesContent":["import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug, getBrowser, isNonPrintableKey, sanitize } from '@/utils/utils';\nimport { AttachInternals, Component, Host, State, h, Element, Prop, Watch, Event, EventEmitter, Listen } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { EVENT_TITLE_TOKENS as eventTitleTokens } from '@/common/constants';\nimport { Configuration } from '@nylas/core';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE } from '@/common/constants';\n\ninterface CustomShadowRoot extends ShadowRoot {\n getSelection: () => Selection | null;\n}\n\ntype Token = {\n token: string;\n value: string;\n description: string;\n};\n\n/**\n * The `nylas-event-title` component is a form input for the title of an event.\n * @part net - The event title container\n * @part net__title - The event title input\n * @part net__dropdown-content - The token options container\n */\n@Component({\n tag: 'nylas-event-title',\n styleUrl: 'nylas-event-title.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasEventTitle {\n @Element() host!: HTMLElement;\n @AttachInternals() internals!: ElementInternals;\n\n // Properties\n /**\n * @standalone\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n /**\n * @standalone\n * The title of the event from the cofiguration.\n */\n @Prop() eventTitle?: string = this.selectedConfiguration?.event_booking?.title;\n /**\n * @standalone\n * The name attribute of this component.\n */\n @Prop() name: string = 'title';\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n\n // State variables\n /**\n * Whether to show the tokens dropdown.\n */\n @State() showTokens: boolean = false;\n /**\n * The available token options for the dropdown.\n */\n @State() availableTokens: { label: string; value: string; labelHTML: Token }[] = eventTitleTokens.map(token => ({\n label: token.token,\n value: token.value,\n labelHTML: token,\n }));\n /**\n * The filtered token options for the dropdown based on the current query.\n */\n @State() filteredTokens: { label: string; value: string; labelHTML: Token }[] = this.availableTokens;\n /**\n * The aria-activedescendant attribute value. This is used to indicate the\n * currently active descendant in the tokens dropdown.\n */\n @State() ariaActivedescendant: string = '';\n /**\n * Stores the reference to the current word being typed.\n * This is used to update the event title with the selected token tag when\n * an option is selected from the dropdown by clicking on it.\n */\n @State() currentWord: {\n $value: string;\n fullText: string;\n index: number;\n focusOffset: number;\n } = { $value: '', fullText: '', index: -1, focusOffset: -1 };\n\n @State() validationError: string = '';\n @State() configEventTitle: string = '';\n\n @State() additionalFieldTokens: Token[] = [];\n // Reference to the title div element\n private titleRef!: HTMLDivElement;\n\n /**\n * When a name prop is passed, stencil does not automatically set the name attribute on the host element.\n * Since this component is form-associated, the name attribute is required for form submission.\n * This is a workaround to ensure that the name attribute is set on the host element.\n */\n @Watch('name')\n elementNameChangedHandler(newValue: string) {\n debug('[nylas-event-title]', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('ariaActivedescendant')\n ariaActivedescendantChangedHandler(newValue: string) {\n debug('[nylas-event-title]', 'ariaActivedescendantChangedHandler', newValue);\n if (newValue !== '') {\n const activeOption = this.host.shadowRoot?.getElementById(newValue);\n activeOption?.classList.add('active');\n } else {\n const options = this.host.shadowRoot?.querySelectorAll('.token-options li.active');\n options?.forEach(option => option.classList.remove('active'));\n }\n }\n\n @Watch('selectedConfiguration')\n configChangedHandler(newVal: Configuration) {\n const title = newVal?.event_booking?.title;\n const additionalFields = newVal?.scheduler?.additional_fields || {};\n const newKeys = Object.keys(additionalFields) || [];\n const newTokens = newKeys.map(key => {\n return {\n token: `$${key}`,\n value: `\\${${key}}`,\n description: additionalFields[key].label || '',\n };\n });\n this.additionalFieldTokens = [...newTokens];\n this.availableTokens = [...eventTitleTokens, ...newTokens].map(token => ({\n label: token.token,\n value: token.value,\n labelHTML: token,\n }));\n this.filteredTokens = [...this.availableTokens];\n if (title) {\n this.configEventTitle = title;\n this.updateEventTitleFromProp(title);\n }\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n i18next.changeLanguage(newVal);\n const titleTokens = {\n $invitee: 'invitee',\n $invitee_email: 'inviteeEmail',\n $duration: 'duration',\n };\n this.availableTokens = this.availableTokens.map(token => {\n if (titleTokens[token.label]) {\n token.labelHTML.description = i18next.t(`nylasEventTitle.eventTitleTokenDescription.${titleTokens[token.label]}`);\n }\n return token;\n });\n this.filteredTokens = [...this.availableTokens];\n }\n\n // Events\n /**\n * This event is fired when the value of the event title changes.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n // Lifecycle methods\n connectedCallback() {\n debug('[nylas-event-title]', 'connectedCallback');\n }\n\n componentWillLoad() {\n debug('[nylas-event-title]', 'componentWillLoad');\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('[nylas-event-title]', 'componentDidLoad');\n let title = this.eventTitle || this.configEventTitle;\n if (this.selectedConfiguration?.event_booking?.title) {\n title = this.selectedConfiguration?.event_booking?.title;\n }\n if (title) {\n this.updateEventTitleFromProp(title);\n this.updateEventTitle(title, true);\n }\n }\n\n disconnectedCallback() {\n debug('[nylas-event-title]', 'disconnectedCallback');\n }\n\n @Listen('formSubmitted', { target: 'window' })\n formSubmittedHandler(event: CustomEvent) {\n debug('[nylas-event-title]', 'formSubmittedHandler', event);\n if (!this.internals?.validity?.valid) {\n this.validationError = 'eventTitleRequired';\n } else {\n this.validationError = '';\n }\n }\n\n @Listen('valueChanged', { target: 'document' })\n valueChangedHandler(event: CustomEvent<{ value: string; name: string }>) {\n const { name, value } = event.detail;\n const additionalFields = value || {};\n if (name === 'additional-fields') {\n const newKeys = Object.keys(additionalFields) || [];\n const newTokens = newKeys.map(key => {\n return {\n token: `$${key}`,\n value: `\\${${key}}`,\n description: additionalFields[key].label || '',\n };\n });\n this.additionalFieldTokens = [...newTokens];\n this.availableTokens = [...eventTitleTokens, ...newTokens].map(token => ({\n label: token.token,\n value: token.value,\n labelHTML: token,\n }));\n this.filteredTokens = [...this.availableTokens];\n }\n }\n\n updateEventTitleFromProp(newValue: string) {\n debug('[nylas-event-title]', 'eventTitleChangedHandler', newValue);\n const title = newValue || this.configEventTitle;\n if (this.titleRef) {\n this.titleRef.innerHTML = this.highlightTokens(title);\n if (typeof this.internals.setValidity === 'function') {\n if (!title || title === '') {\n this.titleRef.focus();\n this.internals?.setValidity({ customError: true }, `Event title is required`, this.titleRef);\n } else {\n this.internals?.setValidity({ customError: false });\n this.isInternalsAvailable && this.internals?.setFormValue(title, this.name);\n }\n }\n }\n }\n\n highlightTokens(title: string) {\n let outputHtml = title;\n [...eventTitleTokens, ...this.additionalFieldTokens].forEach(tokenObj => {\n const token = tokenObj.value;\n // Create a regular expression that matches the token as a whole word\n const regex = new RegExp(`(\\\\${token})(?!\\\\w)`, 'g');\n // Replace the token with a span element\n outputHtml = outputHtml?.replace(regex, '<span class=\"highlighted-tag\">$1</span>') || '';\n });\n return outputHtml;\n }\n\n getCurrentSelectionForBrowser() {\n const getSelectionTextData = (nodeValue, offset, node, allSelected) => {\n // Remove zero-width space characters from the text, because they are not visible and cause issues with the selection\n const text = nodeValue.replace(/[\\u200B-\\u200D\\uFEFF]/g, '');\n const dollarIndex = text.lastIndexOf('$');\n const lastWord = text.substring(dollarIndex).split(' ')[0];\n return {\n focusOffset: offset,\n dollarIndex,\n lastWord,\n currentText: text,\n node,\n allSelected,\n };\n };\n\n // Check if the selection has selected all the text in the node, we need this to handle the case where the user selects all the text and then types or deletes\n const isAllSelected = (selection: Selection) => selection.anchorOffset === 0 && selection.focusOffset === selection.focusNode?.nodeValue?.length;\n\n const currentBrowser = getBrowser();\n switch (currentBrowser) {\n case 'Chrome': {\n const shadowRootSelection = (this.host.shadowRoot as CustomShadowRoot)?.getSelection();\n const focusNode = shadowRootSelection?.focusNode;\n const focusNodeValue = focusNode?.nodeValue || '';\n const allSelected = shadowRootSelection && isAllSelected(shadowRootSelection);\n return getSelectionTextData(focusNodeValue, shadowRootSelection?.focusOffset || -1, focusNode, allSelected);\n }\n case 'Firefox': {\n const selection = document.getSelection();\n const anchorNodeValue = selection?.anchorNode?.nodeValue || '';\n const allSelectedFirefox = selection && isAllSelected(selection);\n return getSelectionTextData(anchorNodeValue, selection?.focusOffset || -1, selection?.anchorNode, allSelectedFirefox);\n }\n case 'Safari': {\n const windowSelection = window.getSelection();\n const anchorNode = (windowSelection as any)?.getComposedRanges(this.host.shadowRoot as CustomShadowRoot)[0];\n const currentText = anchorNode?.startContainer?.nodeValue || '';\n const allSelectedSafari = windowSelection && isAllSelected(windowSelection);\n return getSelectionTextData(currentText, anchorNode?.endOffset || -1, anchorNode?.startContainer, allSelectedSafari);\n }\n default: {\n console.warn('Browser not supported');\n return null;\n }\n }\n }\n\n handleChange(event: Event) {\n let textContent = (event.target as HTMLDivElement).textContent || '';\n textContent = sanitize(textContent);\n\n // All browsers handle Selection within Shadow DOM differently, so get the current selection based on the browser\n const currentSelection = this.getCurrentSelectionForBrowser();\n if (!currentSelection) {\n this.updateEventTitle(textContent);\n this.resetDropdown();\n return;\n }\n const { focusOffset, dollarIndex, lastWord, currentText } = currentSelection;\n\n if (dollarIndex === -1 || focusOffset < dollarIndex) {\n this.updateEventTitle(textContent);\n this.resetDropdown();\n return;\n }\n if (lastWord.startsWith('$')) {\n this.showTokens = true;\n // Update the current word being typed, we need this reference to update the event title with the selected token\n // because the user can select an option from the dropdown by clicking on it, which will not trigger the input event.\n this.currentWord = {\n $value: lastWord,\n fullText: currentText,\n index: dollarIndex,\n focusOffset,\n };\n this.populateSuggestionsDropdown(lastWord);\n } else {\n this.resetDropdown();\n }\n this.updateEventTitle(textContent);\n }\n\n handleInputKeyDown(event) {\n const selection = this.getCurrentSelectionForBrowser();\n\n // If no text is remaining in the title, reset the title to an empty string\n if (selection?.allSelected && !isNonPrintableKey(event)) {\n this.titleRef.innerHTML = '';\n }\n\n if (event.key === 'Enter') {\n event.preventDefault();\n const activeOption = this.host.shadowRoot?.getElementById(this.ariaActivedescendant);\n if (activeOption) {\n activeOption.click();\n this.ariaActivedescendant = '';\n }\n } else if (event.key === 'ArrowDown') {\n event.preventDefault();\n const activeOption = this.host.shadowRoot?.getElementById(this.ariaActivedescendant);\n if (activeOption) {\n const nextOption = activeOption.nextElementSibling;\n if (nextOption) {\n this.ariaActivedescendant = nextOption.id;\n } else {\n this.ariaActivedescendant = this.filteredTokens[0].label;\n }\n } else {\n this.ariaActivedescendant = this.filteredTokens[0].label;\n }\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n const activeOption = this.host.shadowRoot?.getElementById(this.ariaActivedescendant);\n if (activeOption) {\n const prevOption = activeOption.previousElementSibling;\n if (prevOption) {\n this.ariaActivedescendant = prevOption.id;\n } else {\n this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;\n }\n } else {\n this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;\n }\n } else if (event.key === 'Escape') {\n event.preventDefault();\n this.resetDropdown();\n } else if (event.key === 'Backspace' || event.key === 'Delete') {\n const parentNode = selection?.node?.parentNode;\n if (selection?.currentText.startsWith('${') && parentNode && parentNode.nodeName === 'SPAN') {\n event.preventDefault();\n parentNode.removeChild(selection.node);\n parentNode.remove();\n this.resetDropdown();\n this.updateEventTitle(this.titleRef?.textContent || '');\n }\n if (this.titleRef.textContent === '' || selection?.allSelected) {\n this.titleRef.innerHTML = '';\n this.updateEventTitle('');\n }\n }\n }\n\n selectOption(e: Event, option: { label: string; value: string; labelHTML: Token }) {\n e.preventDefault();\n const word = this.currentWord.fullText;\n const dollarWord = this.currentWord.$value;\n\n // Traverse the DOM to find the text node that contains the current word fullText\n let currentNode = this.titleRef.firstChild;\n let textNode: ChildNode | null = null;\n\n while (currentNode) {\n if (currentNode.nodeType === 3) {\n const currentNodeText = currentNode.textContent?.replace(/[\\u200B-\\u200D\\uFEFF]/g, '') || '';\n const wordText = word.replace(/[\\u200B-\\u200D\\uFEFF]/g, '');\n if (currentNodeText.includes(wordText)) {\n textNode = currentNode;\n break;\n }\n }\n currentNode = currentNode.nextSibling;\n }\n\n if (!textNode) {\n return;\n }\n // Split the text node into three parts: text before the token, the token, and text after the token\n const text = textNode.textContent || '';\n const index = text.indexOf(dollarWord);\n const textBefore = text.substring(0, index);\n const textAfter = text.substring(index + dollarWord.length);\n const newTextNode = document.createTextNode(textBefore);\n const newRange = document.createRange();\n\n // Create a new span element to replace the text node\n const tagSpan = document.createElement('span');\n tagSpan.classList.add('highlighted-tag');\n tagSpan.textContent = `${option.value}`;\n const newTextNodeAfter = document.createTextNode(textAfter);\n\n if (textAfter !== '') {\n // If there is text after the token, add it to the new span element\n textNode.replaceWith(newTextNode, tagSpan, newTextNodeAfter);\n newRange.setStart(newTextNodeAfter, 1);\n } else {\n // If there is no text after the token, add a zero-width space character (Without this, the cursor will not move outside the highlighted span element)\n const afterNode = document.createTextNode('\\u200B');\n textNode.replaceWith(newTextNode, tagSpan, afterNode);\n newRange.setStart(afterNode, 1);\n }\n\n // Hide the dropdown\n this.resetDropdown();\n this.titleRef.focus();\n\n // Set the focus to the new span element\n const sel = window.getSelection();\n newRange.collapse(true);\n sel?.removeAllRanges();\n sel?.addRange(newRange);\n\n // Update the event title with the selected token\n this.updateEventTitle(this.titleRef.textContent || '');\n }\n\n populateSuggestionsDropdown(query: string = '') {\n this.filteredTokens = this.availableTokens.filter(obj => {\n return obj.label.startsWith(query.toString()) || obj.value.startsWith(query.toString());\n });\n\n // Set the first option as the active descendant\n if (this.filteredTokens.length > 0) {\n this.ariaActivedescendant = this.filteredTokens[0].label;\n }\n }\n\n get isInternalsAvailable() {\n return typeof this.internals !== 'undefined' && typeof this.internals.setValidity === 'function' && typeof this.internals.setFormValue === 'function';\n }\n\n updateEventTitle(text: string, noValue: boolean = false) {\n const value = text.replace(/ +/g, ' ');\n if (value === '' || /^[\\s]*$/.test(value)) {\n this.validationError = 'eventTitleRequired';\n this.isInternalsAvailable && this.internals?.setValidity({ customError: true }, `Event title is required`, this.titleRef);\n } else {\n this.validationError = '';\n this.isInternalsAvailable && this.internals?.setValidity({ customError: false });\n }\n\n this.isInternalsAvailable && this.internals?.setFormValue(value, this.name);\n if (!noValue) {\n this.valueChanged.emit({ value: value, name: this.name });\n }\n }\n\n resetDropdown() {\n this.showTokens = false;\n this.ariaActivedescendant = '';\n }\n\n getLabelHTML(token: { token: string; description: string }) {\n return (\n <div class=\"token-label\">\n <span class=\"token\">{token.token}</span>\n <span class=\"description\">{token.description}</span>\n </div>\n );\n }\n\n @RegisterComponent<NylasEventTitle, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-event-title',\n stateToProps: new Map([\n ['schedulerConfig.selectedConfiguration', 'selectedConfiguration'],\n ['schedulerConfig.selectedLanguage', 'selectedLanguage'],\n ]),\n eventToProps: {},\n fireRegisterEvent: true,\n })\n render() {\n return (\n <Host>\n <div class=\"nylas-event-title\" part=\"net\">\n <label htmlFor=\"title\">\n {i18next.t('nylasEventTitle.headerTitle')}\n <span class=\"required\">*</span>\n </label>\n <div\n class={{\n title: true,\n error: this.validationError !== '',\n }}\n part=\"net__title\"\n ref={el => (this.titleRef = el as HTMLDivElement)}\n contentEditable=\"true\"\n onInput={e => this.handleChange(e)}\n onKeyDown={event => this.handleInputKeyDown(event)}\n ></div>\n {this.showTokens && this.filteredTokens?.length > 0 && (\n <div class=\"token-options\" part=\"net__dropdown-content\">\n <ul tabindex=\"-1\" role=\"listbox\" aria-label={this.name} aria-activedescendant={this.ariaActivedescendant}>\n {this.filteredTokens.map(option => (\n <li\n tabindex=\"0\"\n key={option.label}\n id={option.label}\n class={{ active: this.ariaActivedescendant === option.label }}\n onClick={e => this.selectOption(e, option)}\n role=\"option\"\n >\n {this.getLabelHTML(option.labelHTML)}\n </li>\n ))}\n </ul>\n </div>\n )}\n <span class=\"help-text\">\n {i18next.t('nylasEventTitle.helpText', { context: 'start', field: i18next.t('nylasEventTitle.title') })} <code>$</code>{' '}\n {i18next.t('nylasEventTitle.helpText', { context: 'end' })}\n <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">\n {i18next.t('nylasEventTitle.tooltip.desc')} <code>{'${invitee}'}</code>\n </span>\n </tooltip-component>\n </span>\n </span>\n {this.validationError != '' && <span class=\"error-message\">{i18next.t(`nylasEventTitle.${this.validationError}`)}</span>}\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"nylas-event-title.js","sourceRoot":"","sources":["../../../../src/components/scheduler-editor/nylas-event-title/nylas-event-title.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,SAAS,EA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,GAAG;4BACjC,6DAAM,IAAI,EAAC,iBAAiB;gCACzB,OAAO,CAAC,CAAC,CAAC,8BAA8B,CAAC;;gCAAE,+DAAO,YAAY,CAAQ,CAClE,CACW,CACf,CACF;gBACN,IAAI,CAAC,eAAe,IAAI,EAAE,IAAI,YAAM,KAAK,EAAC,eAAe,IAAE,OAAO,CAAC,CAAC,CAAC,mBAAmB,IAAI,CAAC,eAAe,EAAE,CAAC,CAAQ,CACpH,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAtDC;IATC,iBAAiB,CAAqG;QACrH,IAAI,EAAE,mBAAmB;QACzB,YAAY,EAAE,IAAI,GAAG,CAAC;YACpB,CAAC,uCAAuC,EAAE,uBAAuB,CAAC;YAClE,CAAC,kCAAkC,EAAE,kBAAkB,CAAC;SACzD,CAAC;QACF,YAAY,EAAE,EAAE;QAChB,iBAAiB,EAAE,IAAI;KACxB,CAAC;;;;6CAsDD","sourcesContent":["import { RegisterComponent } from '@/common/register-component';\nimport { NylasSchedulerConfigConnector } from '@/connector/nylas-scheduler-config-connector';\nimport { debug, getBrowser, isNonPrintableKey, sanitize } from '@/utils/utils';\nimport { AttachInternals, Component, Host, State, h, Element, Prop, Watch, Event, EventEmitter, Listen } from '@stencil/core';\nimport { NylasSchedulerEditor } from '../nylas-scheduler-editor/nylas-scheduler-editor';\nimport { EVENT_TITLE_TOKENS as eventTitleTokens } from '@/common/constants';\nimport { Configuration } from '@nylas/core';\nimport i18next from '@/utils/i18n';\nimport { LANGUAGE_CODE } from '@/common/constants';\n\ninterface CustomShadowRoot extends ShadowRoot {\n getSelection: () => Selection | null;\n}\n\ntype Token = {\n token: string;\n value: string;\n description: string;\n};\n\n/**\n * The `nylas-event-title` component is a form input for the title of an event.\n * @part net - The event title container\n * @part net__title - The event title input\n * @part net__dropdown-content - The token options container\n */\n@Component({\n tag: 'nylas-event-title',\n styleUrl: 'nylas-event-title.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NylasEventTitle {\n @Element() host!: HTMLElement;\n @AttachInternals() internals!: ElementInternals;\n\n // Properties\n /**\n * @standalone\n * The selected config\n */\n @Prop() selectedConfiguration?: Configuration;\n /**\n * @standalone\n * The title of the event from the cofiguration.\n */\n @Prop() eventTitle?: string = this.selectedConfiguration?.event_booking?.title;\n /**\n * @standalone\n * The name attribute of this component.\n */\n @Prop() name: string = 'title';\n /**\n * The selected language.\n */\n @Prop() selectedLanguage?: LANGUAGE_CODE;\n\n // State variables\n /**\n * Whether to show the tokens dropdown.\n */\n @State() showTokens: boolean = false;\n /**\n * The available token options for the dropdown.\n */\n @State() availableTokens: { label: string; value: string; labelHTML: Token }[] = eventTitleTokens.map(token => ({\n label: token.token,\n value: token.value,\n labelHTML: token,\n }));\n /**\n * The filtered token options for the dropdown based on the current query.\n */\n @State() filteredTokens: { label: string; value: string; labelHTML: Token }[] = this.availableTokens;\n /**\n * The aria-activedescendant attribute value. This is used to indicate the\n * currently active descendant in the tokens dropdown.\n */\n @State() ariaActivedescendant: string = '';\n /**\n * Stores the reference to the current word being typed.\n * This is used to update the event title with the selected token tag when\n * an option is selected from the dropdown by clicking on it.\n */\n @State() currentWord: {\n $value: string;\n fullText: string;\n index: number;\n focusOffset: number;\n } = { $value: '', fullText: '', index: -1, focusOffset: -1 };\n\n @State() validationError: string = '';\n @State() configEventTitle: string = '';\n\n @State() additionalFieldTokens: Token[] = [];\n // Reference to the title div element\n private titleRef!: HTMLDivElement;\n\n /**\n * When a name prop is passed, stencil does not automatically set the name attribute on the host element.\n * Since this component is form-associated, the name attribute is required for form submission.\n * This is a workaround to ensure that the name attribute is set on the host element.\n */\n @Watch('name')\n elementNameChangedHandler(newValue: string) {\n debug('[nylas-event-title]', 'elementNameChangedHandler', newValue);\n this.host.setAttribute('name', newValue);\n }\n\n @Watch('ariaActivedescendant')\n ariaActivedescendantChangedHandler(newValue: string) {\n debug('[nylas-event-title]', 'ariaActivedescendantChangedHandler', newValue);\n if (newValue !== '') {\n const activeOption = this.host.shadowRoot?.getElementById(newValue);\n activeOption?.classList.add('active');\n } else {\n const options = this.host.shadowRoot?.querySelectorAll('.token-options li.active');\n options?.forEach(option => option.classList.remove('active'));\n }\n }\n\n @Watch('selectedConfiguration')\n configChangedHandler(newVal: Configuration) {\n const title = newVal?.event_booking?.title;\n const additionalFields = newVal?.scheduler?.additional_fields || {};\n const newKeys = Object.keys(additionalFields) || [];\n const newTokens = newKeys.map(key => {\n return {\n token: `$${key}`,\n value: `\\${${key}}`,\n description: additionalFields[key].label || '',\n };\n });\n this.additionalFieldTokens = [...newTokens];\n this.availableTokens = [...eventTitleTokens, ...newTokens].map(token => ({\n label: token.token,\n value: token.value,\n labelHTML: token,\n }));\n this.filteredTokens = [...this.availableTokens];\n if (title) {\n this.configEventTitle = title;\n this.updateEventTitleFromProp(title);\n }\n }\n\n @Watch('selectedLanguage')\n selectedLanguageChangedHandler(newVal: LANGUAGE_CODE, oldVal: LANGUAGE_CODE) {\n if (newVal === oldVal) return;\n i18next.changeLanguage(newVal);\n const titleTokens = {\n $invitee: 'invitee',\n $invitee_email: 'inviteeEmail',\n $duration: 'duration',\n };\n this.availableTokens = this.availableTokens.map(token => {\n if (titleTokens[token.label]) {\n token.labelHTML.description = i18next.t(`nylasEventTitle.eventTitleTokenDescription.${titleTokens[token.label]}`);\n }\n return token;\n });\n this.filteredTokens = [...this.availableTokens];\n }\n\n // Events\n /**\n * This event is fired when the value of the event title changes.\n */\n @Event() valueChanged!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n // Lifecycle methods\n connectedCallback() {\n debug('[nylas-event-title]', 'connectedCallback');\n }\n\n componentWillLoad() {\n debug('[nylas-event-title]', 'componentWillLoad');\n this.host.setAttribute('name', this.name);\n }\n\n componentDidLoad() {\n debug('[nylas-event-title]', 'componentDidLoad');\n let title = this.eventTitle || this.configEventTitle;\n if (this.selectedConfiguration?.event_booking?.title) {\n title = this.selectedConfiguration?.event_booking?.title;\n }\n if (title) {\n this.updateEventTitleFromProp(title);\n this.updateEventTitle(title, true);\n }\n }\n\n disconnectedCallback() {\n debug('[nylas-event-title]', 'disconnectedCallback');\n }\n\n @Listen('formSubmitted', { target: 'window' })\n formSubmittedHandler(event: CustomEvent) {\n debug('[nylas-event-title]', 'formSubmittedHandler', event);\n if (!this.internals?.validity?.valid) {\n this.validationError = 'eventTitleRequired';\n } else {\n this.validationError = '';\n }\n }\n\n @Listen('valueChanged', { target: 'document' })\n valueChangedHandler(event: CustomEvent<{ value: string; name: string }>) {\n const { name, value } = event.detail;\n if (name === 'additional-fields') {\n const additionalFields = JSON.parse(value.toString());\n const newKeys = Object.keys(additionalFields) || [];\n const newTokens = newKeys.map(key => {\n return {\n token: `$${key}`,\n value: `\\${${key}}`,\n description: additionalFields[key].label || '',\n };\n });\n this.additionalFieldTokens = [...newTokens];\n this.availableTokens = [...eventTitleTokens, ...newTokens].map(token => ({\n label: token.token,\n value: token.value,\n labelHTML: token,\n }));\n this.filteredTokens = [...this.availableTokens];\n }\n }\n\n updateEventTitleFromProp(newValue: string) {\n debug('[nylas-event-title]', 'eventTitleChangedHandler', newValue);\n const title = newValue || this.configEventTitle;\n if (this.titleRef) {\n this.titleRef.innerHTML = this.highlightTokens(title);\n if (typeof this.internals.setValidity === 'function') {\n if (!title || title === '') {\n this.titleRef.focus();\n this.internals?.setValidity({ customError: true }, `Event title is required`, this.titleRef);\n } else {\n this.internals?.setValidity({ customError: false });\n this.isInternalsAvailable && this.internals?.setFormValue(title, this.name);\n }\n }\n }\n }\n\n highlightTokens(title: string) {\n let outputHtml = title;\n [...eventTitleTokens, ...this.additionalFieldTokens].forEach(tokenObj => {\n const token = tokenObj.value;\n // Create a regular expression that matches the token as a whole word\n const regex = new RegExp(`(\\\\${token})(?!\\\\w)`, 'g');\n // Replace the token with a span element\n outputHtml = outputHtml?.replace(regex, '<span class=\"highlighted-tag\">$1</span>') || '';\n });\n return outputHtml;\n }\n\n getCurrentSelectionForBrowser() {\n const getSelectionTextData = (nodeValue, offset, node, allSelected) => {\n // Remove zero-width space characters from the text, because they are not visible and cause issues with the selection\n const text = nodeValue.replace(/[\\u200B-\\u200D\\uFEFF]/g, '');\n const dollarIndex = text.lastIndexOf('$');\n const lastWord = text.substring(dollarIndex).split(' ')[0];\n return {\n focusOffset: offset,\n dollarIndex,\n lastWord,\n currentText: text,\n node,\n allSelected,\n };\n };\n\n // Check if the selection has selected all the text in the node, we need this to handle the case where the user selects all the text and then types or deletes\n const isAllSelected = (selection: Selection) => selection.anchorOffset === 0 && selection.focusOffset === selection.focusNode?.nodeValue?.length;\n\n const currentBrowser = getBrowser();\n switch (currentBrowser) {\n case 'Chrome': {\n const shadowRootSelection = (this.host.shadowRoot as CustomShadowRoot)?.getSelection();\n const focusNode = shadowRootSelection?.focusNode;\n const focusNodeValue = focusNode?.nodeValue || '';\n const allSelected = shadowRootSelection && isAllSelected(shadowRootSelection);\n return getSelectionTextData(focusNodeValue, shadowRootSelection?.focusOffset || -1, focusNode, allSelected);\n }\n case 'Firefox': {\n const selection = document.getSelection();\n const anchorNodeValue = selection?.anchorNode?.nodeValue || '';\n const allSelectedFirefox = selection && isAllSelected(selection);\n return getSelectionTextData(anchorNodeValue, selection?.focusOffset || -1, selection?.anchorNode, allSelectedFirefox);\n }\n case 'Safari': {\n const windowSelection = window.getSelection();\n const anchorNode = (windowSelection as any)?.getComposedRanges(this.host.shadowRoot as CustomShadowRoot)[0];\n const currentText = anchorNode?.startContainer?.nodeValue || '';\n const allSelectedSafari = windowSelection && isAllSelected(windowSelection);\n return getSelectionTextData(currentText, anchorNode?.endOffset || -1, anchorNode?.startContainer, allSelectedSafari);\n }\n default: {\n console.warn('Browser not supported');\n return null;\n }\n }\n }\n\n handleChange(event: Event) {\n let textContent = (event.target as HTMLDivElement).textContent || '';\n textContent = sanitize(textContent);\n\n // All browsers handle Selection within Shadow DOM differently, so get the current selection based on the browser\n const currentSelection = this.getCurrentSelectionForBrowser();\n if (!currentSelection) {\n this.updateEventTitle(textContent);\n this.resetDropdown();\n return;\n }\n const { focusOffset, dollarIndex, lastWord, currentText } = currentSelection;\n\n if (dollarIndex === -1 || focusOffset < dollarIndex) {\n this.updateEventTitle(textContent);\n this.resetDropdown();\n return;\n }\n if (lastWord.startsWith('$')) {\n this.showTokens = true;\n // Update the current word being typed, we need this reference to update the event title with the selected token\n // because the user can select an option from the dropdown by clicking on it, which will not trigger the input event.\n this.currentWord = {\n $value: lastWord,\n fullText: currentText,\n index: dollarIndex,\n focusOffset,\n };\n this.populateSuggestionsDropdown(lastWord);\n } else {\n this.resetDropdown();\n }\n this.updateEventTitle(textContent);\n }\n\n handleInputKeyDown(event) {\n const selection = this.getCurrentSelectionForBrowser();\n\n // If no text is remaining in the title, reset the title to an empty string\n if (selection?.allSelected && !isNonPrintableKey(event)) {\n this.titleRef.innerHTML = '';\n }\n\n if (event.key === 'Enter') {\n event.preventDefault();\n const activeOption = this.host.shadowRoot?.getElementById(this.ariaActivedescendant);\n if (activeOption) {\n activeOption.click();\n this.ariaActivedescendant = '';\n }\n } else if (event.key === 'ArrowDown') {\n event.preventDefault();\n const activeOption = this.host.shadowRoot?.getElementById(this.ariaActivedescendant);\n if (activeOption) {\n const nextOption = activeOption.nextElementSibling;\n if (nextOption) {\n this.ariaActivedescendant = nextOption.id;\n } else {\n this.ariaActivedescendant = this.filteredTokens[0].label;\n }\n } else {\n this.ariaActivedescendant = this.filteredTokens[0].label;\n }\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n const activeOption = this.host.shadowRoot?.getElementById(this.ariaActivedescendant);\n if (activeOption) {\n const prevOption = activeOption.previousElementSibling;\n if (prevOption) {\n this.ariaActivedescendant = prevOption.id;\n } else {\n this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;\n }\n } else {\n this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;\n }\n } else if (event.key === 'Escape') {\n event.preventDefault();\n this.resetDropdown();\n } else if (event.key === 'Backspace' || event.key === 'Delete') {\n const parentNode = selection?.node?.parentNode;\n if (selection?.currentText.startsWith('${') && parentNode && parentNode.nodeName === 'SPAN') {\n event.preventDefault();\n parentNode.removeChild(selection.node);\n parentNode.remove();\n this.resetDropdown();\n this.updateEventTitle(this.titleRef?.textContent || '');\n }\n if (this.titleRef.textContent === '' || selection?.allSelected) {\n this.titleRef.innerHTML = '';\n this.updateEventTitle('');\n }\n }\n }\n\n selectOption(e: Event, option: { label: string; value: string; labelHTML: Token }) {\n e.preventDefault();\n const word = this.currentWord.fullText;\n const dollarWord = this.currentWord.$value;\n\n // Traverse the DOM to find the text node that contains the current word fullText\n let currentNode = this.titleRef.firstChild;\n let textNode: ChildNode | null = null;\n\n while (currentNode) {\n if (currentNode.nodeType === 3) {\n const currentNodeText = currentNode.textContent?.replace(/[\\u200B-\\u200D\\uFEFF]/g, '') || '';\n const wordText = word.replace(/[\\u200B-\\u200D\\uFEFF]/g, '');\n if (currentNodeText.includes(wordText)) {\n textNode = currentNode;\n break;\n }\n }\n currentNode = currentNode.nextSibling;\n }\n\n if (!textNode) {\n return;\n }\n // Split the text node into three parts: text before the token, the token, and text after the token\n const text = textNode.textContent || '';\n const index = text.indexOf(dollarWord);\n const textBefore = text.substring(0, index);\n const textAfter = text.substring(index + dollarWord.length);\n const newTextNode = document.createTextNode(textBefore);\n const newRange = document.createRange();\n\n // Create a new span element to replace the text node\n const tagSpan = document.createElement('span');\n tagSpan.classList.add('highlighted-tag');\n tagSpan.textContent = `${option.value}`;\n const newTextNodeAfter = document.createTextNode(textAfter);\n\n if (textAfter !== '') {\n // If there is text after the token, add it to the new span element\n textNode.replaceWith(newTextNode, tagSpan, newTextNodeAfter);\n newRange.setStart(newTextNodeAfter, 1);\n } else {\n // If there is no text after the token, add a zero-width space character (Without this, the cursor will not move outside the highlighted span element)\n const afterNode = document.createTextNode('\\u200B');\n textNode.replaceWith(newTextNode, tagSpan, afterNode);\n newRange.setStart(afterNode, 1);\n }\n\n // Hide the dropdown\n this.resetDropdown();\n this.titleRef.focus();\n\n // Set the focus to the new span element\n const sel = window.getSelection();\n newRange.collapse(true);\n sel?.removeAllRanges();\n sel?.addRange(newRange);\n\n // Update the event title with the selected token\n this.updateEventTitle(this.titleRef.textContent || '');\n }\n\n populateSuggestionsDropdown(query: string = '') {\n this.filteredTokens = this.availableTokens.filter(obj => {\n return obj.label.startsWith(query.toString()) || obj.value.startsWith(query.toString());\n });\n\n // Set the first option as the active descendant\n if (this.filteredTokens.length > 0) {\n this.ariaActivedescendant = this.filteredTokens[0].label;\n }\n }\n\n get isInternalsAvailable() {\n return typeof this.internals !== 'undefined' && typeof this.internals.setValidity === 'function' && typeof this.internals.setFormValue === 'function';\n }\n\n updateEventTitle(text: string, noValue: boolean = false) {\n const value = text.replace(/ +/g, ' ');\n if (value === '' || /^[\\s]*$/.test(value)) {\n this.validationError = 'eventTitleRequired';\n this.isInternalsAvailable && this.internals?.setValidity({ customError: true }, `Event title is required`, this.titleRef);\n } else {\n this.validationError = '';\n this.isInternalsAvailable && this.internals?.setValidity({ customError: false });\n }\n\n this.isInternalsAvailable && this.internals?.setFormValue(value, this.name);\n if (!noValue) {\n this.valueChanged.emit({ value: value, name: this.name });\n }\n }\n\n resetDropdown() {\n this.showTokens = false;\n this.ariaActivedescendant = '';\n }\n\n getLabelHTML(token: { token: string; description: string }) {\n return (\n <div class=\"token-label\">\n <span class=\"token\">{token.token}</span>\n <span class=\"description\">{token.description}</span>\n </div>\n );\n }\n\n @RegisterComponent<NylasEventTitle, NylasSchedulerConfigConnector, Exclude<NylasSchedulerEditor['stores'], undefined>>({\n name: 'nylas-event-title',\n stateToProps: new Map([\n ['schedulerConfig.selectedConfiguration', 'selectedConfiguration'],\n ['schedulerConfig.selectedLanguage', 'selectedLanguage'],\n ]),\n eventToProps: {},\n fireRegisterEvent: true,\n })\n render() {\n return (\n <Host>\n <div class=\"nylas-event-title\" part=\"net\">\n <label htmlFor=\"title\">\n {i18next.t('nylasEventTitle.headerTitle')}\n <span class=\"required\">*</span>\n </label>\n <div\n class={{\n title: true,\n error: this.validationError !== '',\n }}\n part=\"net__title\"\n ref={el => (this.titleRef = el as HTMLDivElement)}\n contentEditable=\"true\"\n onInput={e => this.handleChange(e)}\n onKeyDown={event => this.handleInputKeyDown(event)}\n ></div>\n {this.showTokens && this.filteredTokens?.length > 0 && (\n <div class=\"token-options\" part=\"net__dropdown-content\">\n <ul tabindex=\"-1\" role=\"listbox\" aria-label={this.name} aria-activedescendant={this.ariaActivedescendant}>\n {this.filteredTokens.map(option => (\n <li\n tabindex=\"0\"\n key={option.label}\n id={option.label}\n class={{ active: this.ariaActivedescendant === option.label }}\n onClick={e => this.selectOption(e, option)}\n role=\"option\"\n >\n {this.getLabelHTML(option.labelHTML)}\n </li>\n ))}\n </ul>\n </div>\n )}\n <span class=\"help-text\">\n {i18next.t('nylasEventTitle.helpText', { context: 'start', field: i18next.t('nylasEventTitle.title') })} <code>$</code>{' '}\n {i18next.t('nylasEventTitle.helpText', { context: 'end' })}\n <span class=\"label-icon\">\n <tooltip-component>\n <info-icon slot=\"tooltip-icon\" />\n <span slot=\"tooltip-content\">\n {i18next.t('nylasEventTitle.tooltip.desc')} <code>{'${invitee}'}</code>\n </span>\n </tooltip-component>\n </span>\n </span>\n {this.validationError != '' && <span class=\"error-message\">{i18next.t(`nylasEventTitle.${this.validationError}`)}</span>}\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as debug,
|
|
1
|
+
import { a as debug, K as uniqueID, L as formatEventName, G as global } from './utils.js';
|
|
2
2
|
|
|
3
3
|
class NylasAbstractProvider {
|
|
4
4
|
constructor(host, stores, automaticComponentRegistration = true, eventOverrides) {
|
|
@@ -72,7 +72,18 @@ const InputComponent = proxyCustomElement(class InputComponent extends HTMLEleme
|
|
|
72
72
|
if (this.type === 'number') {
|
|
73
73
|
const numericValue = parseFloat(inputValue);
|
|
74
74
|
if ((this.maxValue !== undefined && numericValue > this.maxValue) || (this.minValue !== undefined && numericValue < this.minValue)) {
|
|
75
|
-
|
|
75
|
+
if (this.minValue === undefined) {
|
|
76
|
+
this.error = `Value must be less than ${this.maxValue}`;
|
|
77
|
+
}
|
|
78
|
+
else if (this.maxValue === undefined) {
|
|
79
|
+
this.error = `Value must be greater than ${this.minValue}`;
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
this.error = `Value must be between ${this.minValue} and ${this.maxValue}`;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
else if (isNaN(numericValue)) {
|
|
86
|
+
this.error = this.patternError || 'Invalid format.';
|
|
76
87
|
}
|
|
77
88
|
}
|
|
78
89
|
this.value = sanitize(inputValue);
|
|
@@ -114,7 +125,7 @@ const InputComponent = proxyCustomElement(class InputComponent extends HTMLEleme
|
|
|
114
125
|
}
|
|
115
126
|
}
|
|
116
127
|
render() {
|
|
117
|
-
return (h("label", { key: '
|
|
128
|
+
return (h("label", { key: 'e993ec134622eeed719e170c454e7ec29879d444', part: this.error ? 'ic__label ic__label--error' : 'ic__label', class: { error: !!this.error } }, this.label && (h("p", null, h("span", { class: "label" }, this.label), this.required && h("span", { class: "required" }, "*"))), h("div", { key: '3685c05f586fc78d77888ae3e8e3167c5c1bbd0c', part: "ic__input_wrapper", class: "input_wrapper" }, h("input", { key: 'c8aad7e2f76e2ef88a9af6864243c2620d805fb1', type: this.type, name: this.name, part: this.error ? 'ic__input ic__input--error' : 'ic__input', title: this.readOnly ? 'read-only field' : undefined, readOnly: this.readOnly, autoFocus: this.autoFocus, value: this.value, maxLength: this.maxLength, max: this.type === 'number' ? this.maxValue : undefined, min: this.type === 'number' ? this.minValue : undefined, placeholder: this.placeholder, class: { error: !!this.error }, onInput: e => this.handleInput(e), onFocus: () => this.handleFocus(), onBlur: () => this.handleBlur() }), h("slot", { key: 'b7c031e9ddc0c81a241c6c3d9efae8c6c2c40274', name: "additional-input" })), this.error && (h("span", { class: "error help-text", part: "ic__error_message" }, this.error))));
|
|
118
129
|
}
|
|
119
130
|
get el() { return this; }
|
|
120
131
|
static get watchers() { return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"input-component2.js","mappings":";;;AAAA,MAAM,iBAAiB,GAAG,gvHAAgvH,CAAC;AAC3wH,6BAAe,iBAAiB;;ACEhC,MAAM,cAAc,GAAG;IACrB,KAAK,EAAE,sIAAsI;IAC7I,YAAY,EAAE,eAAe;CAC9B,CAAC;AAEF,MAAM,kBAAkB,GAAG;IACzB,KAAK,EAAE,kBAAkB;IACzB,YAAY,EAAE,YAAY;CAC3B,CAAC;MAYW,cAAc;;;;;;;;oBAQF,OAAO;;qBAQN,EAAE;oBAKmC,MAAM;2BAIrC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC;wBAK/B,KAAK;wBAKL,KAAK;yBAMJ,KAAK;;yBAUN,GAAG;4BAKA,EAAE;6BAKD,EAAE;;;;qBAWT,EAAE;;IA4B3B,wBAAwB,CAAC,QAAgB;QACvC,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAChC,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAClC;KACF;IAED,gBAAgB;QACd,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;QAC/C,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACzC,IAAI,CAAC,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAC1C;QAED,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,IAAI,CAAC,eAAe,CAAC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;;;;;;","names":[],"sources":["src/components/design-system/input-component/input-component.scss?tag=input-component&encapsulation=shadow","src/components/design-system/input-component/input-component.tsx"],"sourcesContent":["@import '../../../common/styles/variables.scss';\n@import '../../../common/mixins/inputs.scss';\n\n:host {\n display: block;\n height: auto;\n @include default-css-variables;\n width: 100%;\n}\n\nlabel {\n @include input-label;\n flex-direction: column;\n gap: 4px;\n font-family: var(--nylas-font-family);\n font-size: 16px;\n color: var(--nylas-base-800);\n\n p {\n margin: 0;\n }\n\n .error {\n color: var(--nylas-error);\n }\n}\n\n.input_wrapper {\n display: flex;\n align-items: center;\n gap: 1rem;\n}\n\ninput[type='text'],\ninput[type='number'],\ninput[type='email'],\ninput[type='phone_number'] {\n @include textfield;\n width: -moz-available;\n width: -webkit-fill-available;\n}\n\ninput:read-only {\n background-color: var(--nylas-base-100);\n cursor: not-allowed;\n}","import { Component, h, Prop, State, Event, EventEmitter, Listen, Watch, Element } from '@stencil/core';\nimport { sanitize } from '@/utils/utils';\n\nconst DefaultPattern = {\n email: /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,\n phone_number: /^\\+?\\d{1,15}$/,\n};\n\nconst DefaultPlaceholder = {\n email: 'name@example.com',\n phone_number: '1234567890',\n};\n\n/**\n * The `input-component` component is a UI component that allows users to input text, email, or phone number values.\n * This component is used in the scheduling form to input text, email and phone number type inputs.\n */\n\n@Component({\n tag: 'input-component',\n styleUrl: 'input-component.scss',\n shadow: true,\n})\nexport class InputComponent {\n /**\n * The host element\n */\n @Element() el!: HTMLElement;\n /**\n * The name of the input. This is used to identify the input when submitting a form.\n */\n @Prop() name: string = 'input';\n /**\n * The default value of the input. This is the value that is displayed when the input is rendered.\n */\n @Prop() defaultValue?: string;\n /**\n * The label of the input. This is displayed above the input.\n */\n @Prop() label: string = '';\n /**\n * The type of the input. This is used to determine the input's behavior.\n * Supported types are 'text', 'email', and 'phone_number'.\n */\n @Prop() type: 'text' | 'email' | 'phone_number' | 'number' = 'text';\n /**\n * The placeholder of the input. This is displayed when the input is empty.\n */\n @Prop() placeholder: string = DefaultPlaceholder[this.type];\n /**\n * Whether the input is required. If true, the input must have a value when submitting a form.\n * Default is false. If the input is required and the value is empty, an error message is displayed.\n */\n @Prop() required: boolean = false;\n /**\n * Whether the input is read-only. If true, the input cannot be edited.\n * Default is false.\n */\n @Prop() readOnly: boolean = false;\n /**\n * Whether the input should be focused when rendered.\n * Default is false. If true, the input is focused when rendered.\n * Use this to set the focus on the first input in a form.\n */\n @Prop() autoFocus: boolean = false;\n /**\n * The pattern to validate the input value. If the value does not match the pattern, an error message is displayed.\n * Default is null. If the pattern is not set, the pattern is determined by the input type for 'email' and 'phone_number'.\n */\n @Prop() pattern?: RegExp;\n /**\n * The maximum length of the input value. If the value is longer than the maximum length, an error message is displayed.\n * Default is 255.\n */\n @Prop() maxLength: number = 255;\n /**\n * The error message to display when the value does not match the pattern.\n * Default is 'Invalid <field> format.' where <field> is the input label.\n */\n @Prop() patternError: string = '';\n\n /**\n * This error message is displayed when the input value is empty and the input is required.\n */\n @Prop() requiredError: string = '';\n @Prop() maxValue?: number; // Optional max value for 'number'\n @Prop() minValue?: number; // Optional min value for 'number'\n\n /**\n * The input value state.\n */\n @State() value!: string;\n /**\n * The error message state.\n */\n @State() error: string = '';\n\n /**\n * This event is fired when the input value is changed.\n * The scheduling form listens for this event to validate the input value and submit the form.\n * If using outside of the scheduling form, listen for this event to validate the input value\n * and handle the input value change.\n */\n @Event() nylasFormInputChanged!: EventEmitter<{\n value: string;\n name: string;\n label: string;\n type: string;\n error: string;\n }>;\n\n @Event() nylasFormInputFocused!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n @Event() nylasFormInputBlurred!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n // Lifecycle methods\n @Watch('defaultValue')\n handleDefaultValueChange(newValue: string) {\n this.value = sanitize(newValue);\n if (this.value) {\n this.validatePattern(this.value);\n }\n }\n\n componentDidLoad() {\n this.value = sanitize(this.defaultValue || '');\n if (this.type !== 'text' && !this.pattern) {\n this.pattern = DefaultPattern[this.type];\n }\n\n if (this.value) {\n this.validatePattern(this.value);\n }\n }\n\n // Event listeners\n /**\n * Listen for the bookingFormSubmitted event to validate the input value when the form is submitted.\n */\n @Listen('bookingFormSubmitted', { target: 'document' })\n handleBookingFormSubmitted(event: CustomEvent) {\n this.validatePattern(this.value);\n if (this.error) {\n event.preventDefault();\n }\n }\n\n @Listen('formSubmitted', { target: 'document' })\n async handleFormSubmitted(event: CustomEvent) {\n if (this.el?.getAttribute('data-page-styling')) {\n this.validatePattern(this.value);\n if (this.error) {\n event.preventDefault();\n }\n }\n }\n\n // Methods\n handleInput(e: Event) {\n this.error = '';\n const inputValue = (e.target as HTMLInputElement).value;\n\n // For 'number', ensure the value is valid\n if (this.type === 'number') {\n const numericValue = parseFloat(inputValue);\n if ((this.maxValue !== undefined && numericValue > this.maxValue) || (this.minValue !== undefined && numericValue < this.minValue)) {\n this.error = `Value must be between ${this.minValue} and ${this.maxValue}`;\n }\n }\n\n this.value = sanitize(inputValue);\n this.nylasFormInputChanged.emit({\n value: this.value,\n name: this.name,\n label: this.label,\n error: this.error,\n type: this.type,\n });\n }\n\n handleBlur() {\n this.nylasFormInputBlurred.emit({\n value: this.value,\n name: this.name,\n });\n }\n\n handleFocus() {\n this.nylasFormInputFocused.emit({\n value: this.value,\n name: this.name,\n });\n }\n\n validatePattern(value: string) {\n // Reset error\n this.error = '';\n\n if (this.required && !value) {\n this.error = this.requiredError || 'This field is required.';\n return;\n }\n\n if (this.type === 'number' && value) {\n const numericValue = parseFloat(value);\n if ((this.maxValue !== undefined && numericValue > this.maxValue) || (this.minValue !== undefined && numericValue < this.minValue)) {\n this.error = `Value must be between ${this.minValue} and ${this.maxValue}`;\n return;\n }\n }\n\n if (this.pattern && value && !this.pattern.test(value)) {\n this.error = this.patternError || 'Invalid format.';\n }\n }\n\n render() {\n return (\n <label part=\"ic__label\" class={{ error: !!this.error }}>\n {this.label && (\n <p>\n <span class=\"label\">{this.label}</span>\n {this.required && <span class=\"required\">*</span>}\n </p>\n )}\n <div part=\"ic__input_wrapper\" class=\"input_wrapper\">\n <input\n type={this.type}\n name={this.name}\n part=\"ic__input\"\n title={this.readOnly ? 'read-only field' : undefined}\n readOnly={this.readOnly}\n autoFocus={this.autoFocus}\n value={this.value}\n maxLength={this.maxLength}\n max={this.type === 'number' ? this.maxValue : undefined}\n min={this.type === 'number' ? this.minValue : undefined}\n placeholder={this.placeholder}\n class={{ error: !!this.error }}\n onInput={e => this.handleInput(e)}\n onFocus={() => this.handleFocus()}\n onBlur={() => this.handleBlur()}\n />\n <slot name=\"additional-input\"></slot>\n </div>\n {this.error && <span class=\"error help-text\">{this.error}</span>}\n </label>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"input-component2.js","mappings":";;;AAAA,MAAM,iBAAiB,GAAG,gvHAAgvH,CAAC;AAC3wH,6BAAe,iBAAiB;;ACEhC,MAAM,cAAc,GAAG;IACrB,KAAK,EAAE,sIAAsI;IAC7I,YAAY,EAAE,eAAe;CAC9B,CAAC;AAEF,MAAM,kBAAkB,GAAG;IACzB,KAAK,EAAE,kBAAkB;IACzB,YAAY,EAAE,YAAY;CAC3B,CAAC;MAYW,cAAc;;;;;;;;oBAQF,OAAO;;qBAQN,EAAE;oBAKmC,MAAM;2BAIrC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC;wBAK/B,KAAK;wBAKL,KAAK;yBAMJ,KAAK;;yBAUN,GAAG;4BAKA,EAAE;6BAKD,EAAE;;;;qBAWT,EAAE;;IA4B3B,wBAAwB,CAAC,QAAgB;QACvC,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAChC,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,IAAI,CAAC,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AAE,IAAI,CAAC,QAAQ,GAAG,iBAAiB,GAAG,SAAS,EACpD,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,GAAG,EAAE,IAAI,CAAC,IAAI,KAAK,QAAQ,GAAG,IAAI,CAAC,QAAQ,GAAG,SAAS,EACvD,GAAG,EAAE,IAAI,CAAC,IAAI,KAAK,QAAQ,GAAG,IAAI,CAAC,QAAQ,GAAG,SAAS,EACvD,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,EAC9B,OAAO,EAAE,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EACjC,OAAO,EAAE,MAAM,IAAI,CAAC,WAAW,EAAE,EACjC,MAAM,EAAE,MAAM,IAAI,CAAC,UAAU,EAAE,GAC/B,EACF,6DAAM,IAAI,EAAC,kBAAkB,GAAQ,CACjC,EACL,IAAI,CAAC,KAAK,KACT,YAAM,KAAK,EAAC,iBAAiB,EAAC,IAAI,EAAC,mBAAmB,IACnD,IAAI,CAAC,KAAK,CACN,CACR,CACK,EACR;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/design-system/input-component/input-component.scss?tag=input-component&encapsulation=shadow","src/components/design-system/input-component/input-component.tsx"],"sourcesContent":["@import '../../../common/styles/variables.scss';\n@import '../../../common/mixins/inputs.scss';\n\n:host {\n display: block;\n height: auto;\n @include default-css-variables;\n width: 100%;\n}\n\nlabel {\n @include input-label;\n flex-direction: column;\n gap: 4px;\n font-family: var(--nylas-font-family);\n font-size: 16px;\n color: var(--nylas-base-800);\n\n p {\n margin: 0;\n }\n\n .error {\n color: var(--nylas-error);\n }\n}\n\n.input_wrapper {\n display: flex;\n align-items: center;\n gap: 1rem;\n}\n\ninput[type='text'],\ninput[type='number'],\ninput[type='email'],\ninput[type='phone_number'] {\n @include textfield;\n width: -moz-available;\n width: -webkit-fill-available;\n}\n\ninput:read-only {\n background-color: var(--nylas-base-100);\n cursor: not-allowed;\n}","import { Component, h, Prop, State, Event, EventEmitter, Listen, Watch, Element } from '@stencil/core';\nimport { sanitize } from '@/utils/utils';\n\nconst DefaultPattern = {\n email: /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,\n phone_number: /^\\+?\\d{1,15}$/,\n};\n\nconst DefaultPlaceholder = {\n email: 'name@example.com',\n phone_number: '1234567890',\n};\n\n/**\n * The `input-component` component is a UI component that allows users to input text, email, or phone number values.\n * This component is used in the scheduling form to input text, email and phone number type inputs.\n */\n\n@Component({\n tag: 'input-component',\n styleUrl: 'input-component.scss',\n shadow: true,\n})\nexport class InputComponent {\n /**\n * The host element\n */\n @Element() el!: HTMLElement;\n /**\n * The name of the input. This is used to identify the input when submitting a form.\n */\n @Prop() name: string = 'input';\n /**\n * The default value of the input. This is the value that is displayed when the input is rendered.\n */\n @Prop() defaultValue?: string;\n /**\n * The label of the input. This is displayed above the input.\n */\n @Prop() label: string = '';\n /**\n * The type of the input. This is used to determine the input's behavior.\n * Supported types are 'text', 'email', and 'phone_number'.\n */\n @Prop() type: 'text' | 'email' | 'phone_number' | 'number' = 'text';\n /**\n * The placeholder of the input. This is displayed when the input is empty.\n */\n @Prop() placeholder: string = DefaultPlaceholder[this.type];\n /**\n * Whether the input is required. If true, the input must have a value when submitting a form.\n * Default is false. If the input is required and the value is empty, an error message is displayed.\n */\n @Prop() required: boolean = false;\n /**\n * Whether the input is read-only. If true, the input cannot be edited.\n * Default is false.\n */\n @Prop() readOnly: boolean = false;\n /**\n * Whether the input should be focused when rendered.\n * Default is false. If true, the input is focused when rendered.\n * Use this to set the focus on the first input in a form.\n */\n @Prop() autoFocus: boolean = false;\n /**\n * The pattern to validate the input value. If the value does not match the pattern, an error message is displayed.\n * Default is null. If the pattern is not set, the pattern is determined by the input type for 'email' and 'phone_number'.\n */\n @Prop() pattern?: RegExp;\n /**\n * The maximum length of the input value. If the value is longer than the maximum length, an error message is displayed.\n * Default is 255.\n */\n @Prop() maxLength: number = 255;\n /**\n * The error message to display when the value does not match the pattern.\n * Default is 'Invalid <field> format.' where <field> is the input label.\n */\n @Prop() patternError: string = '';\n\n /**\n * This error message is displayed when the input value is empty and the input is required.\n */\n @Prop() requiredError: string = '';\n @Prop() maxValue?: number; // Optional max value for 'number'\n @Prop() minValue?: number; // Optional min value for 'number'\n\n /**\n * The input value state.\n */\n @State() value!: string;\n /**\n * The error message state.\n */\n @State() error: string = '';\n\n /**\n * This event is fired when the input value is changed.\n * The scheduling form listens for this event to validate the input value and submit the form.\n * If using outside of the scheduling form, listen for this event to validate the input value\n * and handle the input value change.\n */\n @Event() nylasFormInputChanged!: EventEmitter<{\n value: string;\n name: string;\n label: string;\n type: string;\n error: string;\n }>;\n\n @Event() nylasFormInputFocused!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n @Event() nylasFormInputBlurred!: EventEmitter<{\n value: string;\n name: string;\n }>;\n\n // Lifecycle methods\n @Watch('defaultValue')\n handleDefaultValueChange(newValue: string) {\n this.value = sanitize(newValue);\n if (this.value) {\n this.validatePattern(this.value);\n }\n }\n\n componentDidLoad() {\n this.value = sanitize(this.defaultValue || '');\n if (this.type !== 'text' && !this.pattern) {\n this.pattern = DefaultPattern[this.type];\n }\n\n if (this.value) {\n this.validatePattern(this.value);\n }\n }\n\n // Event listeners\n /**\n * Listen for the bookingFormSubmitted event to validate the input value when the form is submitted.\n */\n @Listen('bookingFormSubmitted', { target: 'document' })\n handleBookingFormSubmitted(event: CustomEvent) {\n this.validatePattern(this.value);\n if (this.error) {\n event.preventDefault();\n }\n }\n\n @Listen('formSubmitted', { target: 'document' })\n async handleFormSubmitted(event: CustomEvent) {\n if (this.el?.getAttribute('data-page-styling')) {\n this.validatePattern(this.value);\n if (this.error) {\n event.preventDefault();\n }\n }\n }\n\n // Methods\n handleInput(e: Event) {\n this.error = '';\n const inputValue = (e.target as HTMLInputElement).value;\n\n // For 'number', ensure the value is valid\n if (this.type === 'number') {\n const numericValue = parseFloat(inputValue);\n if ((this.maxValue !== undefined && numericValue > this.maxValue) || (this.minValue !== undefined && numericValue < this.minValue)) {\n if (this.minValue === undefined) {\n this.error = `Value must be less than ${this.maxValue}`;\n } else if (this.maxValue === undefined) {\n this.error = `Value must be greater than ${this.minValue}`;\n } else {\n this.error = `Value must be between ${this.minValue} and ${this.maxValue}`;\n }\n } else if (isNaN(numericValue)) {\n this.error = this.patternError || 'Invalid format.';\n }\n }\n\n this.value = sanitize(inputValue);\n this.nylasFormInputChanged.emit({\n value: this.value,\n name: this.name,\n label: this.label,\n error: this.error,\n type: this.type,\n });\n }\n\n handleBlur() {\n this.nylasFormInputBlurred.emit({\n value: this.value,\n name: this.name,\n });\n }\n\n handleFocus() {\n this.nylasFormInputFocused.emit({\n value: this.value,\n name: this.name,\n });\n }\n\n validatePattern(value: string) {\n // Reset error\n this.error = '';\n\n if (this.required && !value) {\n this.error = this.requiredError || 'This field is required.';\n return;\n }\n\n if (this.type === 'number' && value) {\n const numericValue = parseFloat(value);\n if ((this.maxValue !== undefined && numericValue > this.maxValue) || (this.minValue !== undefined && numericValue < this.minValue)) {\n this.error = `Value must be between ${this.minValue} and ${this.maxValue}`;\n return;\n }\n }\n\n if (this.pattern && value && !this.pattern.test(value)) {\n this.error = this.patternError || 'Invalid format.';\n }\n }\n\n render() {\n return (\n <label part={this.error ? 'ic__label ic__label--error' : 'ic__label'} class={{ error: !!this.error }}>\n {this.label && (\n <p>\n <span class=\"label\">{this.label}</span>\n {this.required && <span class=\"required\">*</span>}\n </p>\n )}\n <div part=\"ic__input_wrapper\" class=\"input_wrapper\">\n <input\n type={this.type}\n name={this.name}\n part={this.error ? 'ic__input ic__input--error' : 'ic__input'}\n title={this.readOnly ? 'read-only field' : undefined}\n readOnly={this.readOnly}\n autoFocus={this.autoFocus}\n value={this.value}\n maxLength={this.maxLength}\n max={this.type === 'number' ? this.maxValue : undefined}\n min={this.type === 'number' ? this.minValue : undefined}\n placeholder={this.placeholder}\n class={{ error: !!this.error }}\n onInput={e => this.handleInput(e)}\n onFocus={() => this.handleFocus()}\n onBlur={() => this.handleBlur()}\n />\n <slot name=\"additional-input\"></slot>\n </div>\n {this.error && (\n <span class=\"error help-text\" part=\"ic__error_message\">\n {this.error}\n </span>\n )}\n </label>\n );\n }\n}\n"],"version":3}
|