@redvars/peacock 4.3.4 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BaseField-DPyW5Zm5.js → BaseField-BbOj212R.js} +3 -3
- package/dist/{BaseField-DPyW5Zm5.js.map → BaseField-BbOj212R.js.map} +1 -1
- package/dist/{BaseInput-FhjvfMjF.js → BaseInput-Cv03GZLu.js} +2 -2
- package/dist/{BaseInput-FhjvfMjF.js.map → BaseInput-Cv03GZLu.js.map} +1 -1
- package/dist/ai-badge.js +2 -2
- package/dist/ai-summary.js +2 -2
- package/dist/alert.js +2 -2
- package/dist/anchor-nav.js +2 -2
- package/dist/app-shell.js +2 -2
- package/dist/assistant-panel.js +2 -2
- package/dist/assistant-step.js +2 -2
- package/dist/assistant-steps.js +2 -2
- package/dist/avatar-group.js +2 -2
- package/dist/banner.js +2 -2
- package/dist/{base-progress-D8-x6XS4.js → base-progress-CqsyiVOV.js} +2 -2
- package/dist/{base-progress-D8-x6XS4.js.map → base-progress-CqsyiVOV.js.map} +1 -1
- package/dist/bottom-sheet.js +2 -2
- package/dist/breadcrumb.js +2 -2
- package/dist/calendar-column-view.js +648 -30
- package/dist/calendar-column-view.js.map +1 -1
- package/dist/calendar-drag-IXMPZrTN.js +344 -0
- package/dist/calendar-drag-IXMPZrTN.js.map +1 -0
- package/dist/{calendar-event-_OYdAT3c.js → calendar-event-BQChlMXy.js} +15 -4
- package/dist/calendar-event-BQChlMXy.js.map +1 -0
- package/dist/calendar-header-DVrfThwr.js +59 -0
- package/dist/calendar-header-DVrfThwr.js.map +1 -0
- package/dist/calendar-month-view.js +311 -21
- package/dist/calendar-month-view.js.map +1 -1
- package/dist/calendar-timeline.js +1877 -0
- package/dist/calendar-timeline.js.map +1 -0
- package/dist/calendar.js +224 -62
- package/dist/calendar.js.map +1 -1
- package/dist/{canvas-base-CjxNdEsR.js → canvas-base-BjiU3Ecl.js} +2 -2
- package/dist/{canvas-base-CjxNdEsR.js.map → canvas-base-BjiU3Ecl.js.map} +1 -1
- package/dist/carousel.js +2 -2
- package/dist/{cartesian-chart-D30aTNVm.js → cartesian-chart-iE3cmeGF.js} +2 -2
- package/dist/{cartesian-chart-D30aTNVm.js.map → cartesian-chart-iE3cmeGF.js.map} +1 -1
- package/dist/{cb-group-base-BhWC78b0.js → cb-group-base-CWctDJvy.js} +2 -2
- package/dist/{cb-group-base-BhWC78b0.js.map → cb-group-base-CWctDJvy.js.map} +1 -1
- package/dist/cb-group.js +3 -3
- package/dist/cb-rule.js +3 -3
- package/dist/chart-area.js +4 -4
- package/dist/chart-bar.js +4 -4
- package/dist/{chart-base-D2kPte5J.js → chart-base-CDyVDmz7.js} +2 -2
- package/dist/{chart-base-D2kPte5J.js.map → chart-base-CDyVDmz7.js.map} +1 -1
- package/dist/chart-doughnut.js +3 -3
- package/dist/chart-line.js +4 -4
- package/dist/chart-pie.js +3 -3
- package/dist/chat-event.js +2 -2
- package/dist/chat-message.js +2 -2
- package/dist/chat-thread.js +2 -2
- package/dist/checkbox-group.js +3 -3
- package/dist/checkbox.js +3 -3
- package/dist/chip-set.js +2 -2
- package/dist/chip.js +2 -2
- package/dist/circular-progress.js +3 -3
- package/dist/citation.js +2 -2
- package/dist/code-editor.js +3 -3
- package/dist/code-highlighter.js +2 -2
- package/dist/color-field.js +4 -4
- package/dist/color-picker.js +2 -2
- package/dist/command-palette.js +2 -2
- package/dist/comment-composer.js +4 -4
- package/dist/condition-builder.js +3 -3
- package/dist/confirm-dialog.js +2 -2
- package/dist/copy-button.js +2 -2
- package/dist/currency-field.js +4 -4
- package/dist/custom-elements-jsdocs.json +52 -129
- package/dist/custom-elements.json +3109 -5
- package/dist/{date-vFrYT1S9.js → date-cfPx3alz.js} +20 -3
- package/dist/date-cfPx3alz.js.map +1 -0
- package/dist/date-field.js +8 -8
- package/dist/date-picker.js +4 -4
- package/dist/date-range-field.js +8 -8
- package/dist/datetime-field.js +7 -7
- package/dist/dependency-map.js +3 -3
- package/dist/description-item.js +2 -2
- package/dist/description-list.js +2 -2
- package/dist/{diagram-BFGq2POp.js → diagram-D2aM93kf.js} +2 -2
- package/dist/{diagram-BFGq2POp.js.map → diagram-D2aM93kf.js.map} +1 -1
- package/dist/diagram-controls.js +2 -2
- package/dist/diagram-minimap.js +2 -2
- package/dist/diagram.js +4 -4
- package/dist/diff-viewer.js +2 -2
- package/dist/discussion-activity.js +2 -2
- package/dist/discussion-comment.js +2 -2
- package/dist/discussion.js +4 -4
- package/dist/{document-editor-CC7MTHMO.js → document-editor-BS6al7Hq.js} +2 -2
- package/dist/{document-editor-CC7MTHMO.js.map → document-editor-BS6al7Hq.js.map} +1 -1
- package/dist/document-editor.js +3 -3
- package/dist/draft-card.js +2 -2
- package/dist/erd.js +3 -3
- package/dist/{event-manager-CWAWPOUE.js → event-manager-KGMT2x2Q.js} +10 -8
- package/dist/event-manager-KGMT2x2Q.js.map +1 -0
- package/dist/file-upload.js +3 -3
- package/dist/filter-bar.js +4 -4
- package/dist/flow.js +4 -4
- package/dist/form.js +2 -2
- package/dist/{generative-view-DoT9YwHL.js → generative-view-DsSOPf26.js} +2 -2
- package/dist/{generative-view-DoT9YwHL.js.map → generative-view-DsSOPf26.js.map} +1 -1
- package/dist/generative-view.js +3 -3
- package/dist/html-editor.js +4 -4
- package/dist/{i18n-controller-Co6pasNo.js → i18n-controller-BTeChxE0.js} +2 -2
- package/dist/{i18n-controller-Co6pasNo.js.map → i18n-controller-BTeChxE0.js.map} +1 -1
- package/dist/image.js +2 -2
- package/dist/index.js +26 -23
- package/dist/index.js.map +1 -1
- package/dist/inline-edit.js +2 -2
- package/dist/input.js +3 -3
- package/dist/json-viewer.js +2 -2
- package/dist/kanban.js +2 -2
- package/dist/kbd.js +2 -2
- package/dist/linear-progress.js +3 -3
- package/dist/listbox.js +2 -2
- package/dist/loader-full.js +13 -13
- package/dist/loader.js +17 -13
- package/dist/loader.js.map +1 -1
- package/dist/markdown-editor.js +4 -4
- package/dist/mention-input.js +4 -4
- package/dist/modal.js +2 -2
- package/dist/navigation-bar.js +2 -2
- package/dist/navigation-drawer.js +2 -2
- package/dist/navigation-rail.js +2 -2
- package/dist/notification-center.js +2 -2
- package/dist/number-field.js +4 -4
- package/dist/page-header.js +2 -2
- package/dist/pagination.js +2 -2
- package/dist/password-field.js +4 -4
- package/dist/password-rules.js +2 -2
- package/dist/phone-field.js +4 -4
- package/dist/{picker-field-BliKNENo.js → picker-field-DmXYPvbF.js} +3 -3
- package/dist/{picker-field-BliKNENo.js.map → picker-field-DmXYPvbF.js.map} +1 -1
- package/dist/pin-input.js +4 -4
- package/dist/presence-indicator.js +2 -2
- package/dist/prompt-input.js +4 -4
- package/dist/radio.js +3 -3
- package/dist/{range-utils-BoKOhxVX.js → range-utils-DZe96GnO.js} +2 -2
- package/dist/{range-utils-BoKOhxVX.js.map → range-utils-DZe96GnO.js.map} +1 -1
- package/dist/rating.js +3 -3
- package/dist/redvars-loader.js +2 -2
- package/dist/relative-time.js +2 -2
- package/dist/resizable-panels.js +2 -2
- package/dist/{rich-text-input-YeqK1or-.js → rich-text-input-BCZ46UF8.js} +3 -3
- package/dist/{rich-text-input-YeqK1or-.js.map → rich-text-input-BCZ46UF8.js.map} +1 -1
- package/dist/{schema-CuHBNpzo.js → schema-D0PCeIEA.js} +2 -2
- package/dist/{schema-CuHBNpzo.js.map → schema-D0PCeIEA.js.map} +1 -1
- package/dist/search.js +3 -3
- package/dist/select.js +4 -4
- package/dist/side-sheet.js +2 -2
- package/dist/signature-pad.js +3 -3
- package/dist/site-header.js +2 -2
- package/dist/slider.js +3 -3
- package/dist/snackbar.js +2 -2
- package/dist/sparkline.js +2 -2
- package/dist/split-button.js +2 -2
- package/dist/src/__internal/i18n/strings.d.ts +20 -0
- package/dist/src/__internal/utils/date.d.ts +5 -0
- package/dist/src/calendar/base-event.d.ts +5 -0
- package/dist/src/calendar/calendar-column-view.d.ts +65 -1
- package/dist/src/calendar/calendar-drag.d.ts +91 -0
- package/dist/src/calendar/calendar-header.d.ts +28 -0
- package/dist/src/calendar/calendar-month-view.d.ts +39 -1
- package/dist/src/calendar/calendar.d.ts +83 -6
- package/dist/src/calendar/index.d.ts +2 -2
- package/dist/src/calendar/types.d.ts +32 -0
- package/dist/src/calendar/utils.d.ts +53 -0
- package/dist/src/calendar-timeline/calendar-timeline.d.ts +287 -0
- package/dist/src/calendar-timeline/index.d.ts +3 -0
- package/dist/src/calendar-timeline/layout.d.ts +39 -0
- package/dist/src/calendar-timeline/types.d.ts +60 -0
- package/dist/src/index.d.ts +4 -2
- package/dist/src/workflow/workflow-model.d.ts +12 -3
- package/dist/stat.js +2 -2
- package/dist/status-indicator.js +2 -2
- package/dist/step.js +2 -2
- package/dist/stepper.js +2 -2
- package/dist/{strings-DYwXSSu_.js → strings-DeiQWMd9.js} +22 -1
- package/dist/strings-DeiQWMd9.js.map +1 -0
- package/dist/svg.js +2 -2
- package/dist/switch.js +3 -3
- package/dist/table.js +2 -2
- package/dist/test/calendar-timeline.test.d.ts +1 -0
- package/dist/textarea.js +4 -4
- package/dist/time-field.js +7 -7
- package/dist/time-picker.js +4 -4
- package/dist/timeline-item.js +2 -2
- package/dist/timeline.js +2 -2
- package/dist/{toggle-base-B-HOnUIy.js → toggle-base-BtjRAZ5z.js} +2 -2
- package/dist/{toggle-base-B-HOnUIy.js.map → toggle-base-BtjRAZ5z.js.map} +1 -1
- package/dist/tour.js +2 -2
- package/dist/transfer-list.js +3 -3
- package/dist/tree-chart.js +3 -3
- package/dist/tree-item.js +2 -2
- package/dist/tree.js +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/typing-indicator.js +2 -2
- package/dist/url-field.js +4 -4
- package/dist/user-menu.js +2 -2
- package/dist/{utils-D92ldd1V.js → utils-DcvLgexs.js} +116 -19
- package/dist/utils-DcvLgexs.js.map +1 -0
- package/dist/{video-u-Vs7M9g.js → video-DPjOBk6I.js} +2 -2
- package/dist/{video-u-Vs7M9g.js.map → video-DPjOBk6I.js.map} +1 -1
- package/dist/video.js +3 -3
- package/dist/virtual-list.js +2 -2
- package/dist/workflow-model-CauduOG2.js.map +1 -1
- package/dist/workflow-timeline.js +2 -2
- package/dist/workflow.js +16 -5
- package/dist/workflow.js.map +1 -1
- package/dist/workspace-switcher.js +2 -2
- package/package.json +1 -1
- package/readme.md +1 -0
- package/src/__internal/i18n/strings.ts +29 -0
- package/src/__internal/utils/date.ts +19 -0
- package/src/calendar/_calendar-header.scss +33 -0
- package/src/calendar/base-event.ts +19 -2
- package/src/calendar/calendar-column-view.scss +174 -2
- package/src/calendar/calendar-column-view.ts +665 -37
- package/src/calendar/calendar-drag.ts +403 -0
- package/src/calendar/calendar-header.ts +78 -0
- package/src/calendar/calendar-month-view.scss +89 -0
- package/src/calendar/calendar-month-view.ts +289 -23
- package/src/calendar/calendar.scss +2 -27
- package/src/calendar/calendar.ts +264 -62
- package/src/calendar/event-manager.ts +11 -7
- package/src/calendar/index.ts +8 -2
- package/src/calendar/types.ts +35 -0
- package/src/calendar/utils.ts +160 -20
- package/src/calendar-timeline/calendar-timeline.scss +554 -0
- package/src/calendar-timeline/calendar-timeline.ts +1528 -0
- package/src/calendar-timeline/index.ts +14 -0
- package/src/calendar-timeline/layout.ts +129 -0
- package/src/calendar-timeline/types.ts +65 -0
- package/src/index.ts +18 -0
- package/src/loader.ts +4 -0
- package/src/workflow/workflow-model.ts +12 -3
- package/src/workflow/workflow.scss +5 -0
- package/src/workflow/workflow.ts +10 -2
- package/dist/calendar-event-_OYdAT3c.js.map +0 -1
- package/dist/date-vFrYT1S9.js.map +0 -1
- package/dist/event-manager-CWAWPOUE.js.map +0 -1
- package/dist/strings-DYwXSSu_.js.map +0 -1
- package/dist/utils-D92ldd1V.js.map +0 -1
|
@@ -3,11 +3,11 @@ import { n } from './property-B2TG3KEE.js';
|
|
|
3
3
|
import { r } from './state-BCeDVCI9.js';
|
|
4
4
|
import { e } from './query-CHb9Ft_d.js';
|
|
5
5
|
import { e as e$1 } from './class-map-NDIkZErE.js';
|
|
6
|
-
import { I as I18nController } from './i18n-controller-
|
|
6
|
+
import { I as I18nController } from './i18n-controller-BTeChxE0.js';
|
|
7
7
|
import { M as MenuTriggerController } from './menu-trigger-controller-CEJq1ugC.js';
|
|
8
8
|
import './base-Cl6v8-BZ.js';
|
|
9
9
|
import './directive-ZPhl09Yt.js';
|
|
10
|
-
import './strings-
|
|
10
|
+
import './strings-DeiQWMd9.js';
|
|
11
11
|
import './locale-DEsJZCQG.js';
|
|
12
12
|
|
|
13
13
|
var css_248z = i`* {
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -240,6 +240,7 @@ Every component below ships in 4.0, except the [AI](#ai) group, which arrives in
|
|
|
240
240
|
[Time picker](https://peacock.redvars.com/components/time-picker) `wc-time-picker` ·
|
|
241
241
|
[Date time field](https://peacock.redvars.com/components/datetime-field) `wc-datetime-field` ·
|
|
242
242
|
[Calendar](https://peacock.redvars.com/components/calendar) `wc-calendar` ·
|
|
243
|
+
[Calendar timeline](https://peacock.redvars.com/components/calendar-timeline) `wc-calendar-timeline` ·
|
|
243
244
|
[Clock](https://peacock.redvars.com/components/clock) `wc-clock` ·
|
|
244
245
|
[Relative time](https://peacock.redvars.com/components/relative-time) `wc-relative-time`
|
|
245
246
|
|
|
@@ -108,6 +108,31 @@ export const defaultStrings = {
|
|
|
108
108
|
previousPeriod: 'Previous',
|
|
109
109
|
nextPeriod: 'Next',
|
|
110
110
|
invalidView: 'Invalid view',
|
|
111
|
+
/** Title shown for a calendar event without one. */
|
|
112
|
+
calendarUntitled: '(no title)',
|
|
113
|
+
/** Title of the block that marks a new calendar event while it is drawn, until the app adds it. */
|
|
114
|
+
calendarNewEvent: 'New event',
|
|
115
|
+
/** Announced when an event is dragged to a new time, for example "Moved Standup to Nov 4, 2026, 10:00 – 10:30 AM." */
|
|
116
|
+
calendarEventMoved: (title: string, when: string): string =>
|
|
117
|
+
`Moved ${title} to ${when}.`,
|
|
118
|
+
/** Announced when an event's start or end is dragged, for example "Changed Standup to Nov 4, 2026, 9:00 – 10:30 AM." */
|
|
119
|
+
calendarEventResized: (title: string, when: string): string =>
|
|
120
|
+
`Changed ${title} to ${when}.`,
|
|
121
|
+
|
|
122
|
+
// ── Calendar timeline ────────────────────────────────────────────────────
|
|
123
|
+
/** Header of a calendar timeline's resource column, unless `resource-label` names it. */
|
|
124
|
+
calendarTimelineResources: 'Resources',
|
|
125
|
+
/** A calendar timeline without resources. */
|
|
126
|
+
calendarTimelineEmpty: 'No resources',
|
|
127
|
+
/** Resource count of a calendar timeline's group header; `count` is formatted, `n` the number for plural rules. */
|
|
128
|
+
calendarTimelineGroupCount: (count: string, n: number): string =>
|
|
129
|
+
n === 1 ? `${count} resource` : `${count} resources`,
|
|
130
|
+
/** Announced when an event is dragged to another resource's row, for example "Moved Standup to Room B, Nov 4, 2026, 10:00 – 10:30 AM." */
|
|
131
|
+
calendarTimelineEventMoved: (
|
|
132
|
+
title: string,
|
|
133
|
+
resource: string,
|
|
134
|
+
when: string,
|
|
135
|
+
): string => `Moved ${title} to ${resource}, ${when}.`,
|
|
111
136
|
|
|
112
137
|
// ── Overlays and feedback ────────────────────────────────────────────────
|
|
113
138
|
closeDialog: 'Close dialog',
|
|
@@ -986,6 +1011,7 @@ export const defaultStrings = {
|
|
|
986
1011
|
workflowNoSteps: 'No matching steps',
|
|
987
1012
|
workflowOnError: 'On error',
|
|
988
1013
|
workflowWaitForAll: 'Wait for all',
|
|
1014
|
+
workflowFirstToFinish: 'First to finish',
|
|
989
1015
|
workflowEnd: 'End',
|
|
990
1016
|
workflowMoreActions: 'More actions',
|
|
991
1017
|
workflowDuplicate: 'Duplicate',
|
|
@@ -1003,6 +1029,9 @@ export const defaultStrings = {
|
|
|
1003
1029
|
count === 1 ? '1 problem' : `${count} problems`,
|
|
1004
1030
|
workflowUnreachable: 'This step never runs: the path before it ends.',
|
|
1005
1031
|
workflowLoopForEach: 'For each',
|
|
1032
|
+
workflowLoopTimes: 'Repeat',
|
|
1033
|
+
/** After a `times` loop's count, for example "3 times". */
|
|
1034
|
+
workflowLoopTimesSuffix: 'times',
|
|
1006
1035
|
workflowLoopWhile: 'While',
|
|
1007
1036
|
workflowLoopUntil: 'Repeat until',
|
|
1008
1037
|
/** Announced after a step is added, for example "Send email added". */
|
|
@@ -45,6 +45,25 @@ export function weekStart(locale: string): WeekDay {
|
|
|
45
45
|
return 0;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
/**
|
|
49
|
+
* The weekend days of a locale (0 = Sunday), from `Intl.Locale` week info when available, else
|
|
50
|
+
* Saturday and Sunday.
|
|
51
|
+
*/
|
|
52
|
+
export function weekendDays(locale: string): WeekDay[] {
|
|
53
|
+
try {
|
|
54
|
+
const loc = new Intl.Locale(locale) as Intl.Locale & {
|
|
55
|
+
weekInfo?: { weekend: number[] };
|
|
56
|
+
getWeekInfo?: () => { weekend: number[] };
|
|
57
|
+
};
|
|
58
|
+
const info = loc.getWeekInfo?.() ?? loc.weekInfo;
|
|
59
|
+
// Week info numbers days 1 (Monday) to 7 (Sunday).
|
|
60
|
+
if (info?.weekend) return info.weekend.map(day => (day % 7) as WeekDay);
|
|
61
|
+
} catch {
|
|
62
|
+
// Unknown locale tag: fall through.
|
|
63
|
+
}
|
|
64
|
+
return [6, 0];
|
|
65
|
+
}
|
|
66
|
+
|
|
48
67
|
/** The locale's preferred hour cycle. */
|
|
49
68
|
export function localeHourCycle(locale: string): HourCycle {
|
|
50
69
|
const options = new Intl.DateTimeFormat(locale, {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// The header `wc-calendar` and `wc-calendar-timeline` share (calendar-header.ts): Today, Previous and
|
|
2
|
+
// Next, the period shown, and the views as segmented buttons. Include it inside the element that
|
|
3
|
+
// holds the header.
|
|
4
|
+
|
|
5
|
+
@mixin styles {
|
|
6
|
+
.calendar-header-classic {
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
padding: 0.75rem 1rem;
|
|
10
|
+
gap: 0.5rem;
|
|
11
|
+
|
|
12
|
+
.header-left {
|
|
13
|
+
display: flex;
|
|
14
|
+
gap: 0.5rem;
|
|
15
|
+
align-items: center;
|
|
16
|
+
flex: 1;
|
|
17
|
+
|
|
18
|
+
.title {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
font-weight: 500;
|
|
22
|
+
font-size: 1rem;
|
|
23
|
+
color: var(--calendar-on-surface, var(--color-on-surface));
|
|
24
|
+
padding-inline-start: 0.5rem;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.header-right {
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
import { startOfDay, endOfDay } from './utils.js';
|
|
1
|
+
import { startOfDay, endOfDay, isAllDayRange, lastDayOf } from './utils.js';
|
|
2
|
+
|
|
3
|
+
let lastId = 0;
|
|
2
4
|
|
|
3
5
|
export class BaseEvent {
|
|
6
|
+
/** Identifies the event within a layout pass. */
|
|
4
7
|
gid: string;
|
|
8
|
+
|
|
5
9
|
start: Date;
|
|
10
|
+
|
|
6
11
|
end: Date;
|
|
7
12
|
|
|
8
13
|
constructor(start: Date, end: Date) {
|
|
9
|
-
|
|
14
|
+
// A counter, not `crypto.randomUUID()`, which only exists in secure contexts.
|
|
15
|
+
lastId += 1;
|
|
16
|
+
this.gid = `calendar-event-${lastId}`;
|
|
10
17
|
this.start = start;
|
|
11
18
|
this.end = end;
|
|
12
19
|
}
|
|
@@ -15,6 +22,16 @@ export class BaseEvent {
|
|
|
15
22
|
return this.end.valueOf() - this.start.valueOf();
|
|
16
23
|
}
|
|
17
24
|
|
|
25
|
+
/** Whether the event belongs in the all-day row: it lasts a day or more, or midnight to midnight. */
|
|
26
|
+
isAllDay(): boolean {
|
|
27
|
+
return isAllDayRange(this.start, this.end);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** The last day the event covers; `end` is exclusive, so an event ending at midnight ends the day before. */
|
|
31
|
+
lastDay(): Date {
|
|
32
|
+
return lastDayOf(this.start, this.end);
|
|
33
|
+
}
|
|
34
|
+
|
|
18
35
|
isOverlapping(event: BaseEvent): boolean {
|
|
19
36
|
let totalLength: number;
|
|
20
37
|
if (this.start.valueOf() <= event.start.valueOf()) {
|
|
@@ -123,12 +123,16 @@
|
|
|
123
123
|
&:first-child {
|
|
124
124
|
border-inline-start: 0;
|
|
125
125
|
}
|
|
126
|
+
|
|
127
|
+
&.drop-target {
|
|
128
|
+
background: color-mix(in srgb, var(--color-primary) 12%, transparent);
|
|
129
|
+
}
|
|
126
130
|
}
|
|
127
131
|
}
|
|
128
132
|
}
|
|
129
133
|
|
|
130
134
|
.multi-events {
|
|
131
|
-
padding:
|
|
135
|
+
padding-inline-start: var(--scale-size);
|
|
132
136
|
|
|
133
137
|
.row {
|
|
134
138
|
height: 1.8rem;
|
|
@@ -323,7 +327,8 @@
|
|
|
323
327
|
&:hover {
|
|
324
328
|
background: var(--calendar-event-bg-color--hover);
|
|
325
329
|
|
|
326
|
-
.event-title
|
|
330
|
+
.event-title,
|
|
331
|
+
.resize-handle {
|
|
327
332
|
color: var(--calendar-event-text-color--hover);
|
|
328
333
|
}
|
|
329
334
|
}
|
|
@@ -334,3 +339,170 @@
|
|
|
334
339
|
}
|
|
335
340
|
}
|
|
336
341
|
}
|
|
342
|
+
|
|
343
|
+
/* ── Editing ── */
|
|
344
|
+
|
|
345
|
+
// Empty time takes presses that add events, so it must not start a text selection or a
|
|
346
|
+
// long-press callout.
|
|
347
|
+
.calendar-column-view.addable {
|
|
348
|
+
.drawing-area,
|
|
349
|
+
.multi-day-section {
|
|
350
|
+
user-select: none;
|
|
351
|
+
-webkit-touch-callout: none;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
// Leave room to draw an all-day event when there are none yet.
|
|
355
|
+
.multi-events {
|
|
356
|
+
min-height: 2rem;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.calendar-column-view.dragging {
|
|
361
|
+
user-select: none;
|
|
362
|
+
|
|
363
|
+
// Other events let the pointer through, so they neither flicker on hover nor set the cursor.
|
|
364
|
+
.event {
|
|
365
|
+
pointer-events: none;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
.calendar-column-view.drag-move {
|
|
370
|
+
cursor: grabbing;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
.calendar-column-view.drag-resize-y {
|
|
374
|
+
cursor: ns-resize;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
.calendar-column-view.drag-resize-x {
|
|
378
|
+
cursor: ew-resize;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.event {
|
|
382
|
+
&.editable {
|
|
383
|
+
cursor: grab;
|
|
384
|
+
user-select: none;
|
|
385
|
+
-webkit-touch-callout: none;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
// The event being moved stays at its old time, faded, while a copy shows where it will land.
|
|
389
|
+
&.drag-source {
|
|
390
|
+
opacity: 0.4;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
// The event being resized, or moved along the all-day row, in place. Its times may wrap in a
|
|
394
|
+
// narrow column.
|
|
395
|
+
&.lifted {
|
|
396
|
+
z-index: 2;
|
|
397
|
+
overflow: hidden;
|
|
398
|
+
box-shadow: var(--elevation-level2);
|
|
399
|
+
|
|
400
|
+
.event-time {
|
|
401
|
+
white-space: normal;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
// A new event while it is drawn, a moved one where it will land, and the placeholder that
|
|
406
|
+
// marks a new event until the app adds it.
|
|
407
|
+
&.preview {
|
|
408
|
+
z-index: 2;
|
|
409
|
+
overflow: hidden;
|
|
410
|
+
pointer-events: none;
|
|
411
|
+
box-shadow: var(--elevation-level2);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
&.placeholder {
|
|
415
|
+
box-shadow: var(--elevation-level3);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
.event-time {
|
|
419
|
+
padding: 0 0.375rem 0.25rem;
|
|
420
|
+
font-size: 0.75rem;
|
|
421
|
+
color: var(--calendar-event-text-color);
|
|
422
|
+
white-space: nowrap;
|
|
423
|
+
overflow: hidden;
|
|
424
|
+
text-overflow: ellipsis;
|
|
425
|
+
// Times start with digits, which take no direction of their own: without this, "9:00 – 10:00
|
|
426
|
+
// AM" reads "AM 10:00 – 9:00" in a right-to-left page.
|
|
427
|
+
unicode-bidi: plaintext;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
// A grip at each edge an event can be resized by; the line in it shows on hover and focus.
|
|
432
|
+
.resize-handle {
|
|
433
|
+
position: absolute;
|
|
434
|
+
z-index: 1;
|
|
435
|
+
color: var(--calendar-event-text-color);
|
|
436
|
+
|
|
437
|
+
&::after {
|
|
438
|
+
content: '';
|
|
439
|
+
position: absolute;
|
|
440
|
+
margin: auto;
|
|
441
|
+
border-radius: var(--shape-corner-full);
|
|
442
|
+
background: currentColor;
|
|
443
|
+
opacity: 0;
|
|
444
|
+
transition: opacity 150ms ease;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
.event.editable:hover,
|
|
449
|
+
.event.editable:focus-visible,
|
|
450
|
+
.event.lifted {
|
|
451
|
+
.resize-handle::after {
|
|
452
|
+
opacity: 0.6;
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
// Timed events resize at the top and bottom.
|
|
457
|
+
.events-container .resize-handle {
|
|
458
|
+
inset-inline: 0;
|
|
459
|
+
block-size: 0.375rem;
|
|
460
|
+
cursor: ns-resize;
|
|
461
|
+
|
|
462
|
+
&.start {
|
|
463
|
+
inset-block-start: 0;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
&.end {
|
|
467
|
+
inset-block-end: 0;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
&::after {
|
|
471
|
+
inset: 0;
|
|
472
|
+
inline-size: 1rem;
|
|
473
|
+
block-size: 0.125rem;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
// All-day events resize at their start and end.
|
|
478
|
+
.multi-events .resize-handle {
|
|
479
|
+
inset-block: 0;
|
|
480
|
+
inline-size: 0.375rem;
|
|
481
|
+
cursor: ew-resize;
|
|
482
|
+
|
|
483
|
+
&.start {
|
|
484
|
+
inset-inline-start: 0;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
&.end {
|
|
488
|
+
inset-inline-end: 0;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
&::after {
|
|
492
|
+
inset: 0;
|
|
493
|
+
inline-size: 0.125rem;
|
|
494
|
+
block-size: 0.875rem;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
@media (forced-colors: active) {
|
|
499
|
+
.event.preview,
|
|
500
|
+
.event.lifted {
|
|
501
|
+
outline: 2px solid Highlight;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
.multi-day-background .column.drop-target {
|
|
505
|
+
outline: 2px solid Highlight;
|
|
506
|
+
outline-offset: -2px;
|
|
507
|
+
}
|
|
508
|
+
}
|