@f-ewald/components 1.46.0 → 1.46.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +200 -68
- package/dist/app-shell.d.ts.map +1 -1
- package/dist/app-shell.js +4 -0
- package/dist/app-shell.js.map +1 -1
- package/dist/calendar-day.d.ts +0 -2
- package/dist/calendar-day.d.ts.map +1 -1
- package/dist/calendar-day.js +3 -30
- package/dist/calendar-day.js.map +1 -1
- package/dist/calendar-timeline-base.d.ts +4 -0
- package/dist/calendar-timeline-base.d.ts.map +1 -1
- package/dist/calendar-timeline-base.js +31 -2
- package/dist/calendar-timeline-base.js.map +1 -1
- package/dist/calendar-week.d.ts +0 -2
- package/dist/calendar-week.d.ts.map +1 -1
- package/dist/calendar-week.js +5 -32
- package/dist/calendar-week.js.map +1 -1
- package/dist/cron-schedule.d.ts.map +1 -1
- package/dist/cron-schedule.js +4 -2
- package/dist/cron-schedule.js.map +1 -1
- package/dist/distribution-chart.d.ts +1 -0
- package/dist/distribution-chart.d.ts.map +1 -1
- package/dist/distribution-chart.js +23 -2
- package/dist/distribution-chart.js.map +1 -1
- package/dist/multi-select.d.ts.map +1 -1
- package/dist/multi-select.js +1 -1
- package/dist/multi-select.js.map +1 -1
- package/dist/price-history-chart.d.ts.map +1 -1
- package/dist/price-history-chart.js +12 -7
- package/dist/price-history-chart.js.map +1 -1
- package/dist/range-slider.d.ts.map +1 -1
- package/dist/range-slider.js +1 -1
- package/dist/range-slider.js.map +1 -1
- package/dist/ui-checkbox.d.ts.map +1 -1
- package/dist/ui-checkbox.js +1 -1
- package/dist/ui-checkbox.js.map +1 -1
- package/dist/utils/calendar.d.ts +14 -1
- package/dist/utils/calendar.d.ts.map +1 -1
- package/dist/utils/calendar.js +17 -2
- package/dist/utils/calendar.js.map +1 -1
- package/dist/utils/cron.d.ts.map +1 -1
- package/dist/utils/cron.js +19 -10
- package/dist/utils/cron.js.map +1 -1
- package/dist/utils/layer-stack.d.ts +2 -0
- package/dist/utils/layer-stack.d.ts.map +1 -1
- package/dist/utils/layer-stack.js +4 -0
- package/dist/utils/layer-stack.js.map +1 -1
- package/package.json +1 -1
package/custom-elements.json
CHANGED
|
@@ -3126,38 +3126,6 @@
|
|
|
3126
3126
|
],
|
|
3127
3127
|
"description": "Renders one lane's stacked all-day bars, given the entries assigned to it."
|
|
3128
3128
|
},
|
|
3129
|
-
{
|
|
3130
|
-
"kind": "method",
|
|
3131
|
-
"name": "_renderTimedEntry",
|
|
3132
|
-
"privacy": "private",
|
|
3133
|
-
"parameters": [
|
|
3134
|
-
{
|
|
3135
|
-
"name": "entry",
|
|
3136
|
-
"type": {
|
|
3137
|
-
"text": "LanedEntry"
|
|
3138
|
-
}
|
|
3139
|
-
},
|
|
3140
|
-
{
|
|
3141
|
-
"name": "laneCount",
|
|
3142
|
-
"type": {
|
|
3143
|
-
"text": "number"
|
|
3144
|
-
}
|
|
3145
|
-
},
|
|
3146
|
-
{
|
|
3147
|
-
"name": "dayStart",
|
|
3148
|
-
"type": {
|
|
3149
|
-
"text": "Date"
|
|
3150
|
-
}
|
|
3151
|
-
},
|
|
3152
|
-
{
|
|
3153
|
-
"name": "dayEnd",
|
|
3154
|
-
"type": {
|
|
3155
|
-
"text": "Date"
|
|
3156
|
-
}
|
|
3157
|
-
}
|
|
3158
|
-
],
|
|
3159
|
-
"description": "Renders a positioned/sized block for one timed entry, clamped to this day's bounds."
|
|
3160
|
-
},
|
|
3161
3129
|
{
|
|
3162
3130
|
"kind": "field",
|
|
3163
3131
|
"name": "entryElements",
|
|
@@ -3241,6 +3209,42 @@
|
|
|
3241
3209
|
"module": "src/calendar-timeline-base.ts"
|
|
3242
3210
|
}
|
|
3243
3211
|
},
|
|
3212
|
+
{
|
|
3213
|
+
"kind": "method",
|
|
3214
|
+
"name": "renderTimedEntry",
|
|
3215
|
+
"privacy": "protected",
|
|
3216
|
+
"parameters": [
|
|
3217
|
+
{
|
|
3218
|
+
"name": "entry",
|
|
3219
|
+
"type": {
|
|
3220
|
+
"text": "LanedEntry"
|
|
3221
|
+
}
|
|
3222
|
+
},
|
|
3223
|
+
{
|
|
3224
|
+
"name": "laneCount",
|
|
3225
|
+
"type": {
|
|
3226
|
+
"text": "number"
|
|
3227
|
+
}
|
|
3228
|
+
},
|
|
3229
|
+
{
|
|
3230
|
+
"name": "dayStart",
|
|
3231
|
+
"type": {
|
|
3232
|
+
"text": "Date"
|
|
3233
|
+
}
|
|
3234
|
+
},
|
|
3235
|
+
{
|
|
3236
|
+
"name": "dayEnd",
|
|
3237
|
+
"type": {
|
|
3238
|
+
"text": "Date"
|
|
3239
|
+
}
|
|
3240
|
+
}
|
|
3241
|
+
],
|
|
3242
|
+
"description": "Renders a positioned/sized block for one timed entry, clamped to `[dayStart, dayEnd]`.",
|
|
3243
|
+
"inheritedFrom": {
|
|
3244
|
+
"name": "CalendarTimelineBase",
|
|
3245
|
+
"module": "src/calendar-timeline-base.ts"
|
|
3246
|
+
}
|
|
3247
|
+
},
|
|
3244
3248
|
{
|
|
3245
3249
|
"kind": "method",
|
|
3246
3250
|
"name": "entryKey",
|
|
@@ -3938,6 +3942,15 @@
|
|
|
3938
3942
|
"kind": "javascript-module",
|
|
3939
3943
|
"path": "src/calendar-timeline-base.ts",
|
|
3940
3944
|
"declarations": [
|
|
3945
|
+
{
|
|
3946
|
+
"kind": "variable",
|
|
3947
|
+
"name": "HOUR_HEIGHT_REM",
|
|
3948
|
+
"type": {
|
|
3949
|
+
"text": "number"
|
|
3950
|
+
},
|
|
3951
|
+
"default": "3",
|
|
3952
|
+
"description": "Height of one hour row in the hour grid."
|
|
3953
|
+
},
|
|
3941
3954
|
{
|
|
3942
3955
|
"kind": "class",
|
|
3943
3956
|
"description": "Shared base for the hour-grid calendar views, `calendar-day` and\n`calendar-week` — not a registered custom element itself. Holds what both\nneed identically: observing declarative `calendar-entry` children for live\nupdates, resolving them into time-aware entries, and syncing hover/focus\ninteraction classes on rendered entry bars/links. Pure date/geometry math\n(parsing, lane assignment) stays in `utils/calendar.ts` per this\ncodebase's existing convention; this class holds only the parts that need\nto be instance state on a `LitElement` (observers, cached query results).\n\nSubclasses must render a default `<slot",
|
|
@@ -4006,6 +4019,38 @@
|
|
|
4006
4019
|
],
|
|
4007
4020
|
"description": "Reads, resolves, and filters slotted entries to those overlapping `[rangeStart, rangeEnd]`."
|
|
4008
4021
|
},
|
|
4022
|
+
{
|
|
4023
|
+
"kind": "method",
|
|
4024
|
+
"name": "renderTimedEntry",
|
|
4025
|
+
"privacy": "protected",
|
|
4026
|
+
"parameters": [
|
|
4027
|
+
{
|
|
4028
|
+
"name": "entry",
|
|
4029
|
+
"type": {
|
|
4030
|
+
"text": "LanedEntry"
|
|
4031
|
+
}
|
|
4032
|
+
},
|
|
4033
|
+
{
|
|
4034
|
+
"name": "laneCount",
|
|
4035
|
+
"type": {
|
|
4036
|
+
"text": "number"
|
|
4037
|
+
}
|
|
4038
|
+
},
|
|
4039
|
+
{
|
|
4040
|
+
"name": "dayStart",
|
|
4041
|
+
"type": {
|
|
4042
|
+
"text": "Date"
|
|
4043
|
+
}
|
|
4044
|
+
},
|
|
4045
|
+
{
|
|
4046
|
+
"name": "dayEnd",
|
|
4047
|
+
"type": {
|
|
4048
|
+
"text": "Date"
|
|
4049
|
+
}
|
|
4050
|
+
}
|
|
4051
|
+
],
|
|
4052
|
+
"description": "Renders a positioned/sized block for one timed entry, clamped to `[dayStart, dayEnd]`."
|
|
4053
|
+
},
|
|
4009
4054
|
{
|
|
4010
4055
|
"kind": "method",
|
|
4011
4056
|
"name": "entryKey",
|
|
@@ -4096,6 +4141,14 @@
|
|
|
4096
4141
|
}
|
|
4097
4142
|
],
|
|
4098
4143
|
"exports": [
|
|
4144
|
+
{
|
|
4145
|
+
"kind": "js",
|
|
4146
|
+
"name": "HOUR_HEIGHT_REM",
|
|
4147
|
+
"declaration": {
|
|
4148
|
+
"name": "HOUR_HEIGHT_REM",
|
|
4149
|
+
"module": "src/calendar-timeline-base.ts"
|
|
4150
|
+
}
|
|
4151
|
+
},
|
|
4099
4152
|
{
|
|
4100
4153
|
"kind": "js",
|
|
4101
4154
|
"name": "CalendarTimelineBase",
|
|
@@ -4161,38 +4214,6 @@
|
|
|
4161
4214
|
],
|
|
4162
4215
|
"description": "Renders one all-day/multi-day bar, spanning the visible-week columns it covers."
|
|
4163
4216
|
},
|
|
4164
|
-
{
|
|
4165
|
-
"kind": "method",
|
|
4166
|
-
"name": "_renderTimedEntry",
|
|
4167
|
-
"privacy": "private",
|
|
4168
|
-
"parameters": [
|
|
4169
|
-
{
|
|
4170
|
-
"name": "entry",
|
|
4171
|
-
"type": {
|
|
4172
|
-
"text": "LanedEntry"
|
|
4173
|
-
}
|
|
4174
|
-
},
|
|
4175
|
-
{
|
|
4176
|
-
"name": "laneCount",
|
|
4177
|
-
"type": {
|
|
4178
|
-
"text": "number"
|
|
4179
|
-
}
|
|
4180
|
-
},
|
|
4181
|
-
{
|
|
4182
|
-
"name": "dayStart",
|
|
4183
|
-
"type": {
|
|
4184
|
-
"text": "Date"
|
|
4185
|
-
}
|
|
4186
|
-
},
|
|
4187
|
-
{
|
|
4188
|
-
"name": "dayEnd",
|
|
4189
|
-
"type": {
|
|
4190
|
-
"text": "Date"
|
|
4191
|
-
}
|
|
4192
|
-
}
|
|
4193
|
-
],
|
|
4194
|
-
"description": "Renders a positioned/sized block for one timed entry, clamped to `day`'s bounds."
|
|
4195
|
-
},
|
|
4196
4217
|
{
|
|
4197
4218
|
"kind": "method",
|
|
4198
4219
|
"name": "_renderDayColumn",
|
|
@@ -4302,6 +4323,42 @@
|
|
|
4302
4323
|
"module": "src/calendar-timeline-base.ts"
|
|
4303
4324
|
}
|
|
4304
4325
|
},
|
|
4326
|
+
{
|
|
4327
|
+
"kind": "method",
|
|
4328
|
+
"name": "renderTimedEntry",
|
|
4329
|
+
"privacy": "protected",
|
|
4330
|
+
"parameters": [
|
|
4331
|
+
{
|
|
4332
|
+
"name": "entry",
|
|
4333
|
+
"type": {
|
|
4334
|
+
"text": "LanedEntry"
|
|
4335
|
+
}
|
|
4336
|
+
},
|
|
4337
|
+
{
|
|
4338
|
+
"name": "laneCount",
|
|
4339
|
+
"type": {
|
|
4340
|
+
"text": "number"
|
|
4341
|
+
}
|
|
4342
|
+
},
|
|
4343
|
+
{
|
|
4344
|
+
"name": "dayStart",
|
|
4345
|
+
"type": {
|
|
4346
|
+
"text": "Date"
|
|
4347
|
+
}
|
|
4348
|
+
},
|
|
4349
|
+
{
|
|
4350
|
+
"name": "dayEnd",
|
|
4351
|
+
"type": {
|
|
4352
|
+
"text": "Date"
|
|
4353
|
+
}
|
|
4354
|
+
}
|
|
4355
|
+
],
|
|
4356
|
+
"description": "Renders a positioned/sized block for one timed entry, clamped to `[dayStart, dayEnd]`.",
|
|
4357
|
+
"inheritedFrom": {
|
|
4358
|
+
"name": "CalendarTimelineBase",
|
|
4359
|
+
"module": "src/calendar-timeline-base.ts"
|
|
4360
|
+
}
|
|
4361
|
+
},
|
|
4305
4362
|
{
|
|
4306
4363
|
"kind": "method",
|
|
4307
4364
|
"name": "entryKey",
|
|
@@ -7818,6 +7875,15 @@
|
|
|
7818
7875
|
"privacy": "private",
|
|
7819
7876
|
"default": "\"\""
|
|
7820
7877
|
},
|
|
7878
|
+
{
|
|
7879
|
+
"kind": "field",
|
|
7880
|
+
"name": "_abort",
|
|
7881
|
+
"type": {
|
|
7882
|
+
"text": "AbortController | null"
|
|
7883
|
+
},
|
|
7884
|
+
"privacy": "private",
|
|
7885
|
+
"default": "null"
|
|
7886
|
+
},
|
|
7821
7887
|
{
|
|
7822
7888
|
"kind": "field",
|
|
7823
7889
|
"name": "_ro",
|
|
@@ -15875,7 +15941,8 @@
|
|
|
15875
15941
|
},
|
|
15876
15942
|
"default": "false",
|
|
15877
15943
|
"description": "Disables the whole control, preventing the popover from opening.",
|
|
15878
|
-
"attribute": "disabled"
|
|
15944
|
+
"attribute": "disabled",
|
|
15945
|
+
"reflects": true
|
|
15879
15946
|
},
|
|
15880
15947
|
{
|
|
15881
15948
|
"kind": "field",
|
|
@@ -19054,7 +19121,8 @@
|
|
|
19054
19121
|
},
|
|
19055
19122
|
"default": "false",
|
|
19056
19123
|
"description": "Disables interaction; merged with an ancestor `<fieldset disabled>`.",
|
|
19057
|
-
"attribute": "disabled"
|
|
19124
|
+
"attribute": "disabled",
|
|
19125
|
+
"reflects": true
|
|
19058
19126
|
},
|
|
19059
19127
|
{
|
|
19060
19128
|
"kind": "field",
|
|
@@ -23254,7 +23322,8 @@
|
|
|
23254
23322
|
},
|
|
23255
23323
|
"default": "false",
|
|
23256
23324
|
"description": "Disables interaction; merged with an ancestor `<fieldset disabled>`.",
|
|
23257
|
-
"attribute": "disabled"
|
|
23325
|
+
"attribute": "disabled",
|
|
23326
|
+
"reflects": true
|
|
23258
23327
|
},
|
|
23259
23328
|
{
|
|
23260
23329
|
"kind": "field",
|
|
@@ -24941,9 +25010,16 @@
|
|
|
24941
25010
|
"type": {
|
|
24942
25011
|
"text": "ResolvedCalendarEntry[]"
|
|
24943
25012
|
}
|
|
25013
|
+
},
|
|
25014
|
+
{
|
|
25015
|
+
"name": "{ exclusiveEnd = false }",
|
|
25016
|
+
"default": "{}",
|
|
25017
|
+
"type": {
|
|
25018
|
+
"text": "{ exclusiveEnd?: boolean }"
|
|
25019
|
+
}
|
|
24944
25020
|
}
|
|
24945
25021
|
],
|
|
24946
|
-
"description": "Assigns each entry a 0-based stacking lane via greedy interval\npartitioning (\"meeting rooms II\"): entries are sorted by start date, then\neach is placed in the lowest-numbered lane whose current occupant ends\nstrictly before the entry starts. Because entry ranges are\ninclusive-inclusive, an entry ending on day X and one starting on day X\nboth occupy day X and must not share a lane — hence the strict `<`.\n\nLane assignment is meant to be computed independently per `calendar-month`\n(from only the entries overlapping that month); an entry spanning a month\nboundary may therefore land in a different lane in adjacent months. This\nis an accepted v1 limitation, not a bug."
|
|
25022
|
+
"description": "Assigns each entry a 0-based stacking lane via greedy interval\npartitioning (\"meeting rooms II\"): entries are sorted by start date, then\neach is placed in the lowest-numbered lane whose current occupant ends\nstrictly before the entry starts. Because entry ranges are\ninclusive-inclusive, an entry ending on day X and one starting on day X\nboth occupy day X and must not share a lane — hence the strict `<`.\n\nLane assignment is meant to be computed independently per `calendar-month`\n(from only the entries overlapping that month); an entry spanning a month\nboundary may therefore land in a different lane in adjacent months. This\nis an accepted v1 limitation, not a bug.\n\nPass `exclusiveEnd` for timed hour-grid entries, whose end is an instant\nrather than an inclusive day: a 09:00–10:00 and a 10:00–11:00 entry then\nshare a lane."
|
|
24947
25023
|
},
|
|
24948
25024
|
{
|
|
24949
25025
|
"kind": "function",
|
|
@@ -25058,6 +25134,36 @@
|
|
|
25058
25134
|
}
|
|
25059
25135
|
],
|
|
25060
25136
|
"description": "Resolves a `CalendarEntryData`'s date/datetime strings for hour-grid\nrendering. Returns `null` when `start` is missing or unparseable. A blank\n`end` defaults to `start`; when `start` has a time but `end` doesn't (or is\nblank), `end` defaults to one hour after `start` rather than clamping to\n`start`'s instant, so a timed entry with no explicit end still renders as\na visible block. `allDay` is true only when neither endpoint carries a\ntime-of-day component — this is a separate, additive resolution path from\n`resolveEntry`/`ResolvedCalendarEntry`, which stay date-only and are used\nunchanged by `calendar-month`/`calendar-year`."
|
|
25137
|
+
},
|
|
25138
|
+
{
|
|
25139
|
+
"kind": "function",
|
|
25140
|
+
"name": "overlapsTimedRange",
|
|
25141
|
+
"return": {
|
|
25142
|
+
"type": {
|
|
25143
|
+
"text": "boolean"
|
|
25144
|
+
}
|
|
25145
|
+
},
|
|
25146
|
+
"parameters": [
|
|
25147
|
+
{
|
|
25148
|
+
"name": "entry",
|
|
25149
|
+
"type": {
|
|
25150
|
+
"text": "ResolvedTimedEntry"
|
|
25151
|
+
}
|
|
25152
|
+
},
|
|
25153
|
+
{
|
|
25154
|
+
"name": "rangeStart",
|
|
25155
|
+
"type": {
|
|
25156
|
+
"text": "Date"
|
|
25157
|
+
}
|
|
25158
|
+
},
|
|
25159
|
+
{
|
|
25160
|
+
"name": "rangeEnd",
|
|
25161
|
+
"type": {
|
|
25162
|
+
"text": "Date"
|
|
25163
|
+
}
|
|
25164
|
+
}
|
|
25165
|
+
],
|
|
25166
|
+
"description": "Whether an hour-grid entry intersects `[rangeStart, rangeEnd]`. All-day\nentries use `overlapsRange`'s inclusive days; timed entries end\nexclusively, so one ending at 00:00 does not reach into the next day. A\nzero-length timed entry still counts where it starts."
|
|
25061
25167
|
}
|
|
25062
25168
|
],
|
|
25063
25169
|
"exports": [
|
|
@@ -25196,6 +25302,14 @@
|
|
|
25196
25302
|
"name": "resolveTimedEntry",
|
|
25197
25303
|
"module": "src/utils/calendar.ts"
|
|
25198
25304
|
}
|
|
25305
|
+
},
|
|
25306
|
+
{
|
|
25307
|
+
"kind": "js",
|
|
25308
|
+
"name": "overlapsTimedRange",
|
|
25309
|
+
"declaration": {
|
|
25310
|
+
"name": "overlapsTimedRange",
|
|
25311
|
+
"module": "src/utils/calendar.ts"
|
|
25312
|
+
}
|
|
25199
25313
|
}
|
|
25200
25314
|
]
|
|
25201
25315
|
},
|
|
@@ -26148,6 +26262,16 @@
|
|
|
26148
26262
|
],
|
|
26149
26263
|
"description": "Whether this overlay currently owns global Escape/focus behavior."
|
|
26150
26264
|
},
|
|
26265
|
+
{
|
|
26266
|
+
"kind": "function",
|
|
26267
|
+
"name": "hasOpenLayer",
|
|
26268
|
+
"return": {
|
|
26269
|
+
"type": {
|
|
26270
|
+
"text": "boolean"
|
|
26271
|
+
}
|
|
26272
|
+
},
|
|
26273
|
+
"description": "Whether any overlay is open, so page-level Escape handlers can defer to it."
|
|
26274
|
+
},
|
|
26151
26275
|
{
|
|
26152
26276
|
"kind": "function",
|
|
26153
26277
|
"name": "claimEscape",
|
|
@@ -26198,6 +26322,14 @@
|
|
|
26198
26322
|
"module": "src/utils/layer-stack.ts"
|
|
26199
26323
|
}
|
|
26200
26324
|
},
|
|
26325
|
+
{
|
|
26326
|
+
"kind": "js",
|
|
26327
|
+
"name": "hasOpenLayer",
|
|
26328
|
+
"declaration": {
|
|
26329
|
+
"name": "hasOpenLayer",
|
|
26330
|
+
"module": "src/utils/layer-stack.ts"
|
|
26331
|
+
}
|
|
26332
|
+
},
|
|
26201
26333
|
{
|
|
26202
26334
|
"kind": "js",
|
|
26203
26335
|
"name": "claimEscape",
|
package/dist/app-shell.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-shell.d.ts","sourceRoot":"","sources":["../src/app-shell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAG1E,OAAO,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"app-shell.d.ts","sourceRoot":"","sources":["../src/app-shell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAG1E,OAAO,eAAe,CAAC;AAIvB,gEAAgE;AAChE,MAAM,WAAW,mBAAmB;IAClC,uCAAuC;IACvC,IAAI,EAAE,OAAO,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,qBACa,QAAS,SAAQ,UAAU;IACtC,0EAA0E;IACH,WAAW,UAAS;IAC3F,uGAAuG;IAC/C,WAAW,EAAE,SAAS,GAAG,MAAM,CAAa;IACpG,uGAAuG;IAC9C,YAAY,EAAE,MAAM,GAAG,MAAM,CAAU;IAChG,gFAAgF;IACV,UAAU,UAAS;IACzF,gEAAgE;IACvB,WAAW,EAAE,SAAS,GAAG,aAAa,CAAa;IAC5F,+MAA+M;IAC3I,QAAQ,UAAS;IAErF,6DAA6D;IACpD,OAAO,CAAC,OAAO,CAAS;IACjC,oDAAoD;IAC3C,OAAO,CAAC,UAAU,CAAS;IAEpC,OAAgB,MAAM,4BAsQpB;IAEF,OAAO,CAAC,WAAW,CAA+B;IAClD,OAAO,CAAC,cAAc,CAA4B;IAEzC,iBAAiB,IAAI,IAAI,CAMjC;IAEQ,oBAAoB,IAAI,IAAI,CAKpC;IAED,wEAAwE;IACxE,OAAO,CAAC,cAAc,CAEpB;IAEF,gFAAgF;IAChF,OAAO,CAAC,UAAU,CAwBhB;IAEF,wFAAwF;IACxF,OAAO,CAAC,iBAAiB;IAQzB,4CAA4C;IAC5C,OAAO,CAAC,cAAc;IActB,mFAAmF;IACnF,OAAO,CAAC,YAAY;IAKpB,uDAAuD;IACvD,OAAO,CAAC,QAAQ;IAKhB,4FAA4F;IAC5F,OAAO,CAAC,iBAAiB;IAQzB,UAAmB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CASxD;IAEQ,MAAM,yCA2Dd;IAED,gEAAgE;IAChE,OAAO,CAAC,mBAAmB;CAG5B;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
|
package/dist/app-shell.js
CHANGED
|
@@ -9,6 +9,7 @@ import { customElement, property, state } from "lit/decorators.js";
|
|
|
9
9
|
import { iconBars3 } from "./icons.js";
|
|
10
10
|
import "./kbd-hint.js";
|
|
11
11
|
import { tokens } from "./tokens.js";
|
|
12
|
+
import { hasOpenLayer } from "./utils/layer-stack.js";
|
|
12
13
|
/**
|
|
13
14
|
* The dashboard page shell: a slot-based CSS-grid backbone that arranges a
|
|
14
15
|
* top bar, the main content, an optional right-hand detail column, an
|
|
@@ -97,6 +98,9 @@ let AppShell = class AppShell extends LitElement {
|
|
|
97
98
|
if (event.defaultPrevented)
|
|
98
99
|
return;
|
|
99
100
|
if (event.key === "Escape" && this._mobile) {
|
|
101
|
+
// An open dialog/popover/panel above the shell owns Escape.
|
|
102
|
+
if (hasOpenLayer())
|
|
103
|
+
return;
|
|
100
104
|
if (this.detailOpen) {
|
|
101
105
|
event.preventDefault();
|
|
102
106
|
this._closeDetail();
|
package/dist/app-shell.js.map
C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AvD,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;6CAA6C;AAE3C;IAAxD,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;8CAAwC;AAE1B;IAArE,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;4CAAoB;AAEhD;IAAxC,QAAQ,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;6CAAoD;AAExB;IAAnE,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;0CAAkB;AAGpE;IAAhB,KAAK,EAAE;yCAAyB;AAEhB;IAAhB,KAAK,EAAE;4CAA4B;AAjBzB,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAocpB","sourcesContent":["import { LitElement, css, html, nothing, type PropertyValues } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport { iconBars3 } from \"./icons.js\";\nimport \"./kbd-hint.js\";\nimport { tokens } from \"./tokens.js\";\n\n/** Fired when the built-in toggle changes the sidebar state. */\nexport interface SidebarToggleDetail {\n /** Whether the sidebar is now open. */\n open: boolean;\n}\n\n/**\n * The dashboard page shell: a slot-based CSS-grid backbone that arranges a\n * top bar, the main content, an optional right-hand detail column, an\n * optional footer, and a sidebar. The top bar always spans the shell's full\n * width, in every sidebar state.\n *\n * The sidebar's visibility, width, and layout mode are three independent\n * properties:\n * - `sidebar-open` (default closed) — whether it's shown at all.\n * - `sidebar-width`: `\"full\"` (16rem, icons + labels, the default) or\n * `\"icon\"` (3.5rem rail, icons only — drives the slotted `app-sidebar`'s\n * own `collapsed` attribute).\n * - `sidebar-mode`: `\"overlay\"` (the default) floats the sidebar above the\n * shell's own content with a higher z-index, covering part of the top\n * bar's corner and whatever content sits beneath it, without ever\n * resizing or reflowing `main`/`footer`. `\"push\"` instead reserves a real\n * grid column beside `main`/`footer` (which resize to make room) — the\n * top bar still spans full width above it either way.\n *\n * Below the shared 48rem breakpoint the sidebar always behaves as a\n * full-width, modal, scrim/Escape-dismissible drawer regardless of\n * `sidebar-mode`/`sidebar-width` — those two properties only affect the\n * desktop presentation. Above 48rem, an `overlay`-mode sidebar is a\n * non-modal panel (no dimming scrim, no Escape-dismiss, since it reads as\n * an ordinary always-interactive panel rather than a blocking dialog); a\n * `push`-mode sidebar is even more clearly non-modal, since it never\n * covers anything.\n *\n * The right-hand detail column is unaffected by any of the above: it still\n * reserves an inline grid column on desktop and becomes a dismissible\n * overlay (scrim/Escape) on mobile.\n *\n * Widths are tunable per instance via `--component-sidebar-width` (16rem),\n * `--component-sidebar-rail-width` (3.5rem), and `--component-topbar-height`\n * (3rem); the detail column reuses the 20rem/25rem panel widths. The main\n * content area is white by default — override it with\n * `--component-main-background`. Give the shell a height (e.g. `height:\n * 100vh`) so the sidebar and main can size and scroll.\n *\n * Hovering or keyboard-focusing the toggle reveals a tooltip naming the\n * action and its `[` shortcut — the shortcut is not shown as permanent\n * chrome.\n *\n * Consumers with their own external top bar can set `no-topbar` to skip\n * rendering the built-in topbar row and toggle button entirely (the grid\n * drops that row rather than leaving dead space). The `[`/Escape shortcuts\n * stay fully active either way — drive `sidebar-open` from your own UI and\n * listen for `sidebar-toggle` to stay in sync with keyboard-driven changes.\n *\n * @element app-shell\n * @slot - Main content area.\n * @slot sidebar - Sidebar navigation (typically `app-sidebar`).\n * @slot topbar - Top bar content, right of the built-in toggle.\n * @slot detail - Optional right-hand detail; shown when `detail-open` is set.\n * @slot footer - Optional footer beneath the main content.\n * @fires sidebar-toggle - The built-in toggle changed the sidebar state.\n * @fires detail-close - The scrim or Escape dismissed the mobile detail overlay.\n */\n@customElement(\"app-shell\")\nexport class AppShell extends LitElement {\n /** Whether the sidebar is open. Closed by default at every breakpoint. */\n @property({ type: Boolean, reflect: true, attribute: \"sidebar-open\" }) sidebarOpen = false;\n /** `\"overlay\"` (default) floats the sidebar above content; `\"push\"` reserves a grid column instead. */\n @property({ reflect: true, attribute: \"sidebar-mode\" }) sidebarMode: \"overlay\" | \"push\" = \"overlay\";\n /** Sidebar width when open: `\"full\"` (16rem, icons + labels) or `\"icon\"` (3.5rem rail, icons only). */\n @property({ reflect: true, attribute: \"sidebar-width\" }) sidebarWidth: \"full\" | \"icon\" = \"full\";\n /** Shows the right-hand detail region (inline column, or overlay on mobile). */\n @property({ type: Boolean, reflect: true, attribute: \"detail-open\" }) detailOpen = false;\n /** Detail width: `compact` (20rem) or `comfortable` (25rem). */\n @property({ attribute: \"detail-width\" }) detailWidth: \"compact\" | \"comfortable\" = \"compact\";\n /** Skips rendering the built-in topbar row and its nav toggle entirely, for consumers with their own external top bar. The `[`/Escape shortcuts stay active regardless — this only affects what's rendered. */\n @property({ type: Boolean, reflect: true, attribute: \"no-topbar\" }) noTopbar = false;\n\n /** Whether the viewport is at/below the 48rem breakpoint. */\n @state() private _mobile = false;\n /** Whether the footer slot has assigned content. */\n @state() private _hasFooter = false;\n\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n block-size: 100%;\n }\n .shell {\n --_sidebar-w: 0px;\n --_detail-w: 0px;\n display: grid;\n grid-template-columns: var(--_sidebar-w) minmax(0, 1fr) var(--_detail-w);\n grid-template-rows: auto minmax(0, 1fr) auto;\n grid-template-areas:\n \"topbar topbar topbar\"\n \"sidebar main detail\"\n \"sidebar footer footer\";\n position: relative;\n block-size: 100%;\n min-height: 0;\n background: var(--ui-surface, #ffffff);\n }\n /* no-topbar drops the topbar row from the grid rather than rendering\n an empty one — the header element itself is skipped in render(). */\n :host([no-topbar]) .shell {\n grid-template-rows: minmax(0, 1fr) auto;\n grid-template-areas:\n \"sidebar main detail\"\n \"sidebar footer footer\";\n }\n :host([detail-open]) .shell {\n --_detail-w: 20rem;\n }\n :host([detail-open][detail-width=\"comfortable\"]) .shell {\n --_detail-w: 25rem;\n }\n /* Push mode reserves a real grid column, sized only while open — the\n column width doesn't animate (custom properties feeding a grid\n track don't transition smoothly without @property registration),\n so push mode's open/close is an instant snap, unlike overlay\n mode's sliding transform. */\n :host([sidebar-mode=\"push\"][sidebar-open]) .shell {\n --_sidebar-w: var(--component-sidebar-width, 16rem);\n }\n :host([sidebar-mode=\"push\"][sidebar-open][sidebar-width=\"icon\"]) .shell {\n --_sidebar-w: var(--component-sidebar-rail-width, 3.5rem);\n }\n .sidebar {\n /* No grid-area here: an absolutely-positioned grid item's inset\n properties resolve against its OWN grid area's box, not the\n whole grid container, once grid-area is set — even with\n explicit (non-auto) insets. Overlay mode must stay anchored to\n the whole .shell (to overlap the topbar row), so grid-area is\n assigned only in push mode below, where the sidebar is a real,\n in-flow grid item instead of an absolutely-positioned one. */\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: var(--component-sidebar-width, 16rem);\n z-index: 40;\n overflow: hidden;\n border-right: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);\n background: var(--ui-surface, #ffffff);\n transform: translateX(-100%);\n transition: transform 150ms ease;\n }\n :host([sidebar-open]) .sidebar {\n transform: translateX(0);\n }\n :host([sidebar-open]:not([sidebar-mode=\"push\"])) .sidebar {\n box-shadow: var(\n --ui-shadow-lg,\n 0 20px 25px -5px rgb(0 0 0 / 0.1),\n 0 8px 10px -6px rgb(0 0 0 / 0.1)\n );\n }\n :host([sidebar-width=\"icon\"]) .sidebar {\n width: var(--component-sidebar-rail-width, 3.5rem);\n }\n :host([sidebar-mode=\"push\"]) .sidebar {\n grid-area: sidebar;\n position: static;\n width: 100%;\n transform: none;\n }\n .topbar {\n grid-area: topbar;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n min-height: var(--component-topbar-height, 3rem);\n padding: 0.5rem 0.75rem;\n border-bottom: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);\n background: var(--ui-surface, #ffffff);\n /* Deliberately no z-index here: an explicit z-index on a CSS grid\n item creates a stacking context, which would trap .nav-toggle\n below .sidebar once an overlay-mode sidebar opens and covers this\n corner. See CLAUDE.md before adding one. */\n }\n .nav-toggle {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n width: 2rem;\n height: 2rem;\n padding: 0;\n background: none;\n border: none;\n cursor: pointer;\n color: var(--ui-text-muted, #64748b);\n border-radius: var(--ui-radius-sm, 0.25rem);\n }\n .nav-group {\n position: relative;\n z-index: 41;\n display: inline-flex;\n align-items: center;\n gap: 0.25rem;\n flex: 0 0 auto;\n }\n .nav-tip {\n position: absolute;\n top: 100%;\n left: 0;\n margin-top: 0.25rem;\n z-index: 10;\n display: inline-flex;\n align-items: center;\n gap: 0.25rem;\n white-space: nowrap;\n padding: 0.25rem 0.5rem;\n border-radius: var(--ui-radius-sm, 0.25rem);\n background: var(--ui-tooltip, #0f172a);\n color: var(--ui-tooltip-text, #ffffff);\n box-shadow: var(--ui-shadow, 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1));\n font-size: var(--ui-font-size-sm, 0.75rem);\n line-height: var(--ui-line-height-tight, 1.25);\n opacity: 0;\n visibility: hidden;\n pointer-events: none;\n transition: opacity 120ms ease;\n }\n .nav-toggle:hover + .nav-tip,\n .nav-toggle:focus-visible + .nav-tip {\n opacity: 1;\n visibility: visible;\n }\n .nav-toggle:hover {\n background: var(--ui-surface-muted, #f8fafc);\n }\n .nav-toggle:focus-visible {\n outline: none;\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n .topbar-content {\n flex: 1 1 auto;\n min-width: 0;\n }\n .main {\n grid-area: main;\n min-height: 0;\n min-width: 0;\n overflow: auto;\n padding: 1rem;\n background: var(--component-main-background, var(--ui-surface, #ffffff));\n }\n .detail {\n grid-area: detail;\n display: none;\n min-height: 0;\n overflow: auto;\n border-left: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);\n background: var(--ui-surface, #ffffff);\n }\n :host([detail-open]) .detail {\n display: block;\n }\n .footer {\n grid-area: footer;\n padding: 0.5rem 0.75rem;\n border-top: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);\n background: var(--ui-surface, #ffffff);\n }\n .footer.empty {\n display: none;\n }\n .scrim {\n display: none;\n }\n @media (max-width: 48rem) {\n .shell {\n grid-template-columns: minmax(0, 1fr) var(--_detail-w);\n grid-template-areas:\n \"topbar topbar\"\n \"main detail\"\n \"footer footer\";\n }\n :host([no-topbar]) .shell {\n grid-template-rows: minmax(0, 1fr) auto;\n grid-template-areas:\n \"main detail\"\n \"footer footer\";\n }\n /* Mobile is always a full-screen, position:absolute overlay drawer,\n regardless of sidebar-mode/sidebar-width — those two properties\n only affect the desktop presentation. A full-width sidebar sits\n above .scrim (z-index 40 vs 39), so .scrim's click target is only\n reachable on desktop, where the sidebar doesn't span the whole\n shell — Escape is the mobile dismiss path (see app-shell.spec.ts). */\n .sidebar,\n :host([sidebar-mode=\"push\"]) .sidebar {\n position: absolute;\n width: 100%;\n }\n .detail {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n width: var(--_detail-w, 20rem);\n max-width: calc(100vw - 3rem);\n z-index: 40;\n transform: translateX(110%);\n transition: transform 250ms ease;\n }\n :host([detail-open]) .detail {\n transform: translateX(0);\n box-shadow: var(\n --ui-shadow-lg,\n 0 20px 25px -5px rgb(0 0 0 / 0.1),\n 0 8px 10px -6px rgb(0 0 0 / 0.1)\n );\n }\n .scrim.show {\n display: block;\n position: absolute;\n inset: 0;\n z-index: 39;\n background: var(--ui-overlay, rgb(15 23 42 / 0.45));\n border: none;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n .sidebar,\n .detail,\n .nav-tip {\n transition: none;\n }\n }\n @media (forced-colors: active) {\n .nav-toggle:focus-visible {\n outline: 2px solid CanvasText;\n outline-offset: 2px;\n box-shadow: none;\n }\n .nav-tip {\n border: 1px solid CanvasText;\n }\n }\n `,\n ];\n\n private _mediaQuery: MediaQueryList | null = null;\n private _previousFocus: HTMLElement | null = null;\n\n override connectedCallback(): void {\n super.connectedCallback();\n this._mediaQuery = window.matchMedia(\"(max-width: 48rem)\");\n this._mobile = this._mediaQuery.matches;\n this._mediaQuery.addEventListener(\"change\", this._onMediaChange);\n window.addEventListener(\"keydown\", this._onKeydown);\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this._mediaQuery?.removeEventListener(\"change\", this._onMediaChange);\n this._mediaQuery = null;\n window.removeEventListener(\"keydown\", this._onKeydown);\n }\n\n /** Tracks the breakpoint the sidebar's width and modality depend on. */\n private _onMediaChange = (event: MediaQueryListEvent): void => {\n this._mobile = event.matches;\n };\n\n /** Handles the `[` sidebar shortcut and Escape dismissal of mobile overlays. */\n private _onKeydown = (event: KeyboardEvent): void => {\n if (event.defaultPrevented) return;\n if (event.key === \"Escape\" && this._mobile) {\n if (this.detailOpen) {\n event.preventDefault();\n this._closeDetail();\n } else if (this.sidebarOpen) {\n event.preventDefault();\n this.sidebarOpen = false;\n }\n return;\n }\n if (\n event.key === \"[\" &&\n !event.ctrlKey &&\n !event.metaKey &&\n !event.altKey &&\n !this._isEditableTarget(event)\n ) {\n event.preventDefault();\n this._toggleSidebar();\n }\n };\n\n /** Whether the keydown originated in a text field, so the shortcut defers to typing. */\n private _isEditableTarget(event: KeyboardEvent): boolean {\n const target = event.composedPath()[0] as HTMLElement | undefined;\n if (!target) return false;\n if (target.isContentEditable) return true;\n const tag = target.tagName;\n return tag === \"INPUT\" || tag === \"TEXTAREA\" || tag === \"SELECT\";\n }\n\n /** Toggles the sidebar and announces it. */\n private _toggleSidebar(): void {\n this.sidebarOpen = !this.sidebarOpen;\n if (this._mobile && this.sidebarOpen) {\n this._previousFocus = document.activeElement as HTMLElement | null;\n }\n this.dispatchEvent(\n new CustomEvent<SidebarToggleDetail>(\"sidebar-toggle\", {\n detail: { open: this.sidebarOpen },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n /** Closes the detail overlay and notifies the consumer that owns `detail-open`. */\n private _closeDetail(): void {\n this.detailOpen = false;\n this.dispatchEvent(new CustomEvent(\"detail-close\", { bubbles: true, composed: true }));\n }\n\n /** Scrim click dismisses whichever overlay is open. */\n private _onScrim(): void {\n if (this.detailOpen) this._closeDetail();\n if (this.sidebarOpen) this.sidebarOpen = false;\n }\n\n /** Mirrors `sidebar-width` onto the slotted sidebar's `collapsed` (icon rail) attribute. */\n private _syncSidebarWidth(): void {\n const icon = this.sidebarWidth === \"icon\";\n const slot = this.shadowRoot?.querySelector<HTMLSlotElement>('slot[name=\"sidebar\"]');\n for (const element of slot?.assignedElements() ?? []) {\n element.toggleAttribute(\"collapsed\", icon);\n }\n }\n\n protected override updated(changed: PropertyValues): void {\n if (changed.has(\"sidebarWidth\")) this._syncSidebarWidth();\n if (!changed.has(\"sidebarOpen\") || !this._mobile) return;\n if (this.sidebarOpen) {\n this.shadowRoot?.querySelector<HTMLElement>(\".sidebar\")?.focus();\n return;\n }\n if (this._previousFocus?.isConnected) this._previousFocus.focus();\n this._previousFocus = null;\n }\n\n override render() {\n const scrimActive = this._mobile && (this.sidebarOpen || this.detailOpen);\n return html`\n <div class=\"shell\">\n <aside\n class=\"sidebar\"\n tabindex=\"-1\"\n aria-label=\"Primary\"\n ?inert=${!this.sidebarOpen}\n aria-hidden=${String(!this.sidebarOpen)}\n >\n <slot name=\"sidebar\" @slotchange=${this._syncSidebarWidth}></slot>\n </aside>\n ${this.noTopbar\n ? nothing\n : html`\n <header class=\"topbar\">\n <div class=\"nav-group\">\n <button\n class=\"nav-toggle\"\n type=\"button\"\n aria-label=\"Toggle navigation\"\n aria-keyshortcuts=\"[\"\n aria-describedby=\"nav-tip\"\n aria-expanded=${String(this.sidebarOpen)}\n @click=${this._toggleSidebar}\n >\n ${iconBars3(18)}\n </button>\n <span class=\"nav-tip\" id=\"nav-tip\" role=\"tooltip\">\n <span>${this.sidebarOpen ? \"Hide navigation\" : \"Show navigation\"}</span>\n <kbd-hint keys=\"[\"></kbd-hint>\n </span>\n </div>\n <div class=\"topbar-content\"><slot name=\"topbar\"></slot></div>\n </header>\n `}\n <main class=\"main\"><slot></slot></main>\n <aside\n class=\"detail\"\n aria-label=\"Detail\"\n ?inert=${!this.detailOpen}\n aria-hidden=${String(!this.detailOpen)}\n >\n <slot name=\"detail\"></slot>\n </aside>\n <footer class=\"footer ${this._hasFooter ? \"\" : \"empty\"}\">\n <slot name=\"footer\" @slotchange=${this._onFooterSlotChange}></slot>\n </footer>\n <button\n class=\"scrim ${scrimActive ? \"show\" : \"\"}\"\n type=\"button\"\n tabindex=\"-1\"\n aria-label=\"Close\"\n @click=${this._onScrim}\n ?hidden=${!scrimActive}\n ></button>\n </div>\n `;\n }\n\n /** Collapses the footer row when nothing is slotted into it. */\n private _onFooterSlotChange(event: Event): void {\n this._hasFooter = (event.target as HTMLSlotElement).assignedNodes({ flatten: true }).length > 0;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"app-shell\": AppShell;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"app-shell.js","sourceRoot":"","sources":["../src/app-shell.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAQtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,UAAU;IAAjC;;QACL,0EAA0E;QACH,gBAAW,GA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AhB,KAAK,EAAE;yCAAyB;AAEhB;IAAhB,KAAK,EAAE;4CAA4B;AAjBzB,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAscpB","sourcesContent":["import { LitElement, css, html, nothing, type PropertyValues } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport { iconBars3 } from \"./icons.js\";\nimport \"./kbd-hint.js\";\nimport { tokens } from \"./tokens.js\";\nimport { hasOpenLayer } from \"./utils/layer-stack.js\";\n\n/** Fired when the built-in toggle changes the sidebar state. */\nexport interface SidebarToggleDetail {\n /** Whether the sidebar is now open. */\n open: boolean;\n}\n\n/**\n * The dashboard page shell: a slot-based CSS-grid backbone that arranges a\n * top bar, the main content, an optional right-hand detail column, an\n * optional footer, and a sidebar. The top bar always spans the shell's full\n * width, in every sidebar state.\n *\n * The sidebar's visibility, width, and layout mode are three independent\n * properties:\n * - `sidebar-open` (default closed) — whether it's shown at all.\n * - `sidebar-width`: `\"full\"` (16rem, icons + labels, the default) or\n * `\"icon\"` (3.5rem rail, icons only — drives the slotted `app-sidebar`'s\n * own `collapsed` attribute).\n * - `sidebar-mode`: `\"overlay\"` (the default) floats the sidebar above the\n * shell's own content with a higher z-index, covering part of the top\n * bar's corner and whatever content sits beneath it, without ever\n * resizing or reflowing `main`/`footer`. `\"push\"` instead reserves a real\n * grid column beside `main`/`footer` (which resize to make room) — the\n * top bar still spans full width above it either way.\n *\n * Below the shared 48rem breakpoint the sidebar always behaves as a\n * full-width, modal, scrim/Escape-dismissible drawer regardless of\n * `sidebar-mode`/`sidebar-width` — those two properties only affect the\n * desktop presentation. Above 48rem, an `overlay`-mode sidebar is a\n * non-modal panel (no dimming scrim, no Escape-dismiss, since it reads as\n * an ordinary always-interactive panel rather than a blocking dialog); a\n * `push`-mode sidebar is even more clearly non-modal, since it never\n * covers anything.\n *\n * The right-hand detail column is unaffected by any of the above: it still\n * reserves an inline grid column on desktop and becomes a dismissible\n * overlay (scrim/Escape) on mobile.\n *\n * Widths are tunable per instance via `--component-sidebar-width` (16rem),\n * `--component-sidebar-rail-width` (3.5rem), and `--component-topbar-height`\n * (3rem); the detail column reuses the 20rem/25rem panel widths. The main\n * content area is white by default — override it with\n * `--component-main-background`. Give the shell a height (e.g. `height:\n * 100vh`) so the sidebar and main can size and scroll.\n *\n * Hovering or keyboard-focusing the toggle reveals a tooltip naming the\n * action and its `[` shortcut — the shortcut is not shown as permanent\n * chrome.\n *\n * Consumers with their own external top bar can set `no-topbar` to skip\n * rendering the built-in topbar row and toggle button entirely (the grid\n * drops that row rather than leaving dead space). The `[`/Escape shortcuts\n * stay fully active either way — drive `sidebar-open` from your own UI and\n * listen for `sidebar-toggle` to stay in sync with keyboard-driven changes.\n *\n * @element app-shell\n * @slot - Main content area.\n * @slot sidebar - Sidebar navigation (typically `app-sidebar`).\n * @slot topbar - Top bar content, right of the built-in toggle.\n * @slot detail - Optional right-hand detail; shown when `detail-open` is set.\n * @slot footer - Optional footer beneath the main content.\n * @fires sidebar-toggle - The built-in toggle changed the sidebar state.\n * @fires detail-close - The scrim or Escape dismissed the mobile detail overlay.\n */\n@customElement(\"app-shell\")\nexport class AppShell extends LitElement {\n /** Whether the sidebar is open. Closed by default at every breakpoint. */\n @property({ type: Boolean, reflect: true, attribute: \"sidebar-open\" }) sidebarOpen = false;\n /** `\"overlay\"` (default) floats the sidebar above content; `\"push\"` reserves a grid column instead. */\n @property({ reflect: true, attribute: \"sidebar-mode\" }) sidebarMode: \"overlay\" | \"push\" = \"overlay\";\n /** Sidebar width when open: `\"full\"` (16rem, icons + labels) or `\"icon\"` (3.5rem rail, icons only). */\n @property({ reflect: true, attribute: \"sidebar-width\" }) sidebarWidth: \"full\" | \"icon\" = \"full\";\n /** Shows the right-hand detail region (inline column, or overlay on mobile). */\n @property({ type: Boolean, reflect: true, attribute: \"detail-open\" }) detailOpen = false;\n /** Detail width: `compact` (20rem) or `comfortable` (25rem). */\n @property({ attribute: \"detail-width\" }) detailWidth: \"compact\" | \"comfortable\" = \"compact\";\n /** Skips rendering the built-in topbar row and its nav toggle entirely, for consumers with their own external top bar. The `[`/Escape shortcuts stay active regardless — this only affects what's rendered. */\n @property({ type: Boolean, reflect: true, attribute: \"no-topbar\" }) noTopbar = false;\n\n /** Whether the viewport is at/below the 48rem breakpoint. */\n @state() private _mobile = false;\n /** Whether the footer slot has assigned content. */\n @state() private _hasFooter = false;\n\n static override styles = [\n tokens,\n css`\n :host {\n display: block;\n block-size: 100%;\n }\n .shell {\n --_sidebar-w: 0px;\n --_detail-w: 0px;\n display: grid;\n grid-template-columns: var(--_sidebar-w) minmax(0, 1fr) var(--_detail-w);\n grid-template-rows: auto minmax(0, 1fr) auto;\n grid-template-areas:\n \"topbar topbar topbar\"\n \"sidebar main detail\"\n \"sidebar footer footer\";\n position: relative;\n block-size: 100%;\n min-height: 0;\n background: var(--ui-surface, #ffffff);\n }\n /* no-topbar drops the topbar row from the grid rather than rendering\n an empty one — the header element itself is skipped in render(). */\n :host([no-topbar]) .shell {\n grid-template-rows: minmax(0, 1fr) auto;\n grid-template-areas:\n \"sidebar main detail\"\n \"sidebar footer footer\";\n }\n :host([detail-open]) .shell {\n --_detail-w: 20rem;\n }\n :host([detail-open][detail-width=\"comfortable\"]) .shell {\n --_detail-w: 25rem;\n }\n /* Push mode reserves a real grid column, sized only while open — the\n column width doesn't animate (custom properties feeding a grid\n track don't transition smoothly without @property registration),\n so push mode's open/close is an instant snap, unlike overlay\n mode's sliding transform. */\n :host([sidebar-mode=\"push\"][sidebar-open]) .shell {\n --_sidebar-w: var(--component-sidebar-width, 16rem);\n }\n :host([sidebar-mode=\"push\"][sidebar-open][sidebar-width=\"icon\"]) .shell {\n --_sidebar-w: var(--component-sidebar-rail-width, 3.5rem);\n }\n .sidebar {\n /* No grid-area here: an absolutely-positioned grid item's inset\n properties resolve against its OWN grid area's box, not the\n whole grid container, once grid-area is set — even with\n explicit (non-auto) insets. Overlay mode must stay anchored to\n the whole .shell (to overlap the topbar row), so grid-area is\n assigned only in push mode below, where the sidebar is a real,\n in-flow grid item instead of an absolutely-positioned one. */\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: var(--component-sidebar-width, 16rem);\n z-index: 40;\n overflow: hidden;\n border-right: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);\n background: var(--ui-surface, #ffffff);\n transform: translateX(-100%);\n transition: transform 150ms ease;\n }\n :host([sidebar-open]) .sidebar {\n transform: translateX(0);\n }\n :host([sidebar-open]:not([sidebar-mode=\"push\"])) .sidebar {\n box-shadow: var(\n --ui-shadow-lg,\n 0 20px 25px -5px rgb(0 0 0 / 0.1),\n 0 8px 10px -6px rgb(0 0 0 / 0.1)\n );\n }\n :host([sidebar-width=\"icon\"]) .sidebar {\n width: var(--component-sidebar-rail-width, 3.5rem);\n }\n :host([sidebar-mode=\"push\"]) .sidebar {\n grid-area: sidebar;\n position: static;\n width: 100%;\n transform: none;\n }\n .topbar {\n grid-area: topbar;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n min-height: var(--component-topbar-height, 3rem);\n padding: 0.5rem 0.75rem;\n border-bottom: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);\n background: var(--ui-surface, #ffffff);\n /* Deliberately no z-index here: an explicit z-index on a CSS grid\n item creates a stacking context, which would trap .nav-toggle\n below .sidebar once an overlay-mode sidebar opens and covers this\n corner. See CLAUDE.md before adding one. */\n }\n .nav-toggle {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n width: 2rem;\n height: 2rem;\n padding: 0;\n background: none;\n border: none;\n cursor: pointer;\n color: var(--ui-text-muted, #64748b);\n border-radius: var(--ui-radius-sm, 0.25rem);\n }\n .nav-group {\n position: relative;\n z-index: 41;\n display: inline-flex;\n align-items: center;\n gap: 0.25rem;\n flex: 0 0 auto;\n }\n .nav-tip {\n position: absolute;\n top: 100%;\n left: 0;\n margin-top: 0.25rem;\n z-index: 10;\n display: inline-flex;\n align-items: center;\n gap: 0.25rem;\n white-space: nowrap;\n padding: 0.25rem 0.5rem;\n border-radius: var(--ui-radius-sm, 0.25rem);\n background: var(--ui-tooltip, #0f172a);\n color: var(--ui-tooltip-text, #ffffff);\n box-shadow: var(--ui-shadow, 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1));\n font-size: var(--ui-font-size-sm, 0.75rem);\n line-height: var(--ui-line-height-tight, 1.25);\n opacity: 0;\n visibility: hidden;\n pointer-events: none;\n transition: opacity 120ms ease;\n }\n .nav-toggle:hover + .nav-tip,\n .nav-toggle:focus-visible + .nav-tip {\n opacity: 1;\n visibility: visible;\n }\n .nav-toggle:hover {\n background: var(--ui-surface-muted, #f8fafc);\n }\n .nav-toggle:focus-visible {\n outline: none;\n box-shadow: var(--ui-focus-ring, 0 0 0 3px rgb(79 70 229 / 0.35));\n }\n .topbar-content {\n flex: 1 1 auto;\n min-width: 0;\n }\n .main {\n grid-area: main;\n min-height: 0;\n min-width: 0;\n overflow: auto;\n padding: 1rem;\n background: var(--component-main-background, var(--ui-surface, #ffffff));\n }\n .detail {\n grid-area: detail;\n display: none;\n min-height: 0;\n overflow: auto;\n border-left: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);\n background: var(--ui-surface, #ffffff);\n }\n :host([detail-open]) .detail {\n display: block;\n }\n .footer {\n grid-area: footer;\n padding: 0.5rem 0.75rem;\n border-top: var(--ui-border-width, 1px) solid var(--ui-border, #e2e8f0);\n background: var(--ui-surface, #ffffff);\n }\n .footer.empty {\n display: none;\n }\n .scrim {\n display: none;\n }\n @media (max-width: 48rem) {\n .shell {\n grid-template-columns: minmax(0, 1fr) var(--_detail-w);\n grid-template-areas:\n \"topbar topbar\"\n \"main detail\"\n \"footer footer\";\n }\n :host([no-topbar]) .shell {\n grid-template-rows: minmax(0, 1fr) auto;\n grid-template-areas:\n \"main detail\"\n \"footer footer\";\n }\n /* Mobile is always a full-screen, position:absolute overlay drawer,\n regardless of sidebar-mode/sidebar-width — those two properties\n only affect the desktop presentation. A full-width sidebar sits\n above .scrim (z-index 40 vs 39), so .scrim's click target is only\n reachable on desktop, where the sidebar doesn't span the whole\n shell — Escape is the mobile dismiss path (see app-shell.spec.ts). */\n .sidebar,\n :host([sidebar-mode=\"push\"]) .sidebar {\n position: absolute;\n width: 100%;\n }\n .detail {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n width: var(--_detail-w, 20rem);\n max-width: calc(100vw - 3rem);\n z-index: 40;\n transform: translateX(110%);\n transition: transform 250ms ease;\n }\n :host([detail-open]) .detail {\n transform: translateX(0);\n box-shadow: var(\n --ui-shadow-lg,\n 0 20px 25px -5px rgb(0 0 0 / 0.1),\n 0 8px 10px -6px rgb(0 0 0 / 0.1)\n );\n }\n .scrim.show {\n display: block;\n position: absolute;\n inset: 0;\n z-index: 39;\n background: var(--ui-overlay, rgb(15 23 42 / 0.45));\n border: none;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n .sidebar,\n .detail,\n .nav-tip {\n transition: none;\n }\n }\n @media (forced-colors: active) {\n .nav-toggle:focus-visible {\n outline: 2px solid CanvasText;\n outline-offset: 2px;\n box-shadow: none;\n }\n .nav-tip {\n border: 1px solid CanvasText;\n }\n }\n `,\n ];\n\n private _mediaQuery: MediaQueryList | null = null;\n private _previousFocus: HTMLElement | null = null;\n\n override connectedCallback(): void {\n super.connectedCallback();\n this._mediaQuery = window.matchMedia(\"(max-width: 48rem)\");\n this._mobile = this._mediaQuery.matches;\n this._mediaQuery.addEventListener(\"change\", this._onMediaChange);\n window.addEventListener(\"keydown\", this._onKeydown);\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this._mediaQuery?.removeEventListener(\"change\", this._onMediaChange);\n this._mediaQuery = null;\n window.removeEventListener(\"keydown\", this._onKeydown);\n }\n\n /** Tracks the breakpoint the sidebar's width and modality depend on. */\n private _onMediaChange = (event: MediaQueryListEvent): void => {\n this._mobile = event.matches;\n };\n\n /** Handles the `[` sidebar shortcut and Escape dismissal of mobile overlays. */\n private _onKeydown = (event: KeyboardEvent): void => {\n if (event.defaultPrevented) return;\n if (event.key === \"Escape\" && this._mobile) {\n // An open dialog/popover/panel above the shell owns Escape.\n if (hasOpenLayer()) return;\n if (this.detailOpen) {\n event.preventDefault();\n this._closeDetail();\n } else if (this.sidebarOpen) {\n event.preventDefault();\n this.sidebarOpen = false;\n }\n return;\n }\n if (\n event.key === \"[\" &&\n !event.ctrlKey &&\n !event.metaKey &&\n !event.altKey &&\n !this._isEditableTarget(event)\n ) {\n event.preventDefault();\n this._toggleSidebar();\n }\n };\n\n /** Whether the keydown originated in a text field, so the shortcut defers to typing. */\n private _isEditableTarget(event: KeyboardEvent): boolean {\n const target = event.composedPath()[0] as HTMLElement | undefined;\n if (!target) return false;\n if (target.isContentEditable) return true;\n const tag = target.tagName;\n return tag === \"INPUT\" || tag === \"TEXTAREA\" || tag === \"SELECT\";\n }\n\n /** Toggles the sidebar and announces it. */\n private _toggleSidebar(): void {\n this.sidebarOpen = !this.sidebarOpen;\n if (this._mobile && this.sidebarOpen) {\n this._previousFocus = document.activeElement as HTMLElement | null;\n }\n this.dispatchEvent(\n new CustomEvent<SidebarToggleDetail>(\"sidebar-toggle\", {\n detail: { open: this.sidebarOpen },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n /** Closes the detail overlay and notifies the consumer that owns `detail-open`. */\n private _closeDetail(): void {\n this.detailOpen = false;\n this.dispatchEvent(new CustomEvent(\"detail-close\", { bubbles: true, composed: true }));\n }\n\n /** Scrim click dismisses whichever overlay is open. */\n private _onScrim(): void {\n if (this.detailOpen) this._closeDetail();\n if (this.sidebarOpen) this.sidebarOpen = false;\n }\n\n /** Mirrors `sidebar-width` onto the slotted sidebar's `collapsed` (icon rail) attribute. */\n private _syncSidebarWidth(): void {\n const icon = this.sidebarWidth === \"icon\";\n const slot = this.shadowRoot?.querySelector<HTMLSlotElement>('slot[name=\"sidebar\"]');\n for (const element of slot?.assignedElements() ?? []) {\n element.toggleAttribute(\"collapsed\", icon);\n }\n }\n\n protected override updated(changed: PropertyValues): void {\n if (changed.has(\"sidebarWidth\")) this._syncSidebarWidth();\n if (!changed.has(\"sidebarOpen\") || !this._mobile) return;\n if (this.sidebarOpen) {\n this.shadowRoot?.querySelector<HTMLElement>(\".sidebar\")?.focus();\n return;\n }\n if (this._previousFocus?.isConnected) this._previousFocus.focus();\n this._previousFocus = null;\n }\n\n override render() {\n const scrimActive = this._mobile && (this.sidebarOpen || this.detailOpen);\n return html`\n <div class=\"shell\">\n <aside\n class=\"sidebar\"\n tabindex=\"-1\"\n aria-label=\"Primary\"\n ?inert=${!this.sidebarOpen}\n aria-hidden=${String(!this.sidebarOpen)}\n >\n <slot name=\"sidebar\" @slotchange=${this._syncSidebarWidth}></slot>\n </aside>\n ${this.noTopbar\n ? nothing\n : html`\n <header class=\"topbar\">\n <div class=\"nav-group\">\n <button\n class=\"nav-toggle\"\n type=\"button\"\n aria-label=\"Toggle navigation\"\n aria-keyshortcuts=\"[\"\n aria-describedby=\"nav-tip\"\n aria-expanded=${String(this.sidebarOpen)}\n @click=${this._toggleSidebar}\n >\n ${iconBars3(18)}\n </button>\n <span class=\"nav-tip\" id=\"nav-tip\" role=\"tooltip\">\n <span>${this.sidebarOpen ? \"Hide navigation\" : \"Show navigation\"}</span>\n <kbd-hint keys=\"[\"></kbd-hint>\n </span>\n </div>\n <div class=\"topbar-content\"><slot name=\"topbar\"></slot></div>\n </header>\n `}\n <main class=\"main\"><slot></slot></main>\n <aside\n class=\"detail\"\n aria-label=\"Detail\"\n ?inert=${!this.detailOpen}\n aria-hidden=${String(!this.detailOpen)}\n >\n <slot name=\"detail\"></slot>\n </aside>\n <footer class=\"footer ${this._hasFooter ? \"\" : \"empty\"}\">\n <slot name=\"footer\" @slotchange=${this._onFooterSlotChange}></slot>\n </footer>\n <button\n class=\"scrim ${scrimActive ? \"show\" : \"\"}\"\n type=\"button\"\n tabindex=\"-1\"\n aria-label=\"Close\"\n @click=${this._onScrim}\n ?hidden=${!scrimActive}\n ></button>\n </div>\n `;\n }\n\n /** Collapses the footer row when nothing is slotted into it. */\n private _onFooterSlotChange(event: Event): void {\n this._hasFooter = (event.target as HTMLSlotElement).assignedNodes({ flatten: true }).length > 0;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"app-shell\": AppShell;\n }\n}\n"]}
|
package/dist/calendar-day.d.ts
CHANGED
|
@@ -47,8 +47,6 @@ export declare class CalendarDay extends CalendarTimelineBase {
|
|
|
47
47
|
private _syncMinWidth;
|
|
48
48
|
/** Renders one lane's stacked all-day bars, given the entries assigned to it. */
|
|
49
49
|
private _renderAllDayLane;
|
|
50
|
-
/** Renders a positioned/sized block for one timed entry, clamped to this day's bounds. */
|
|
51
|
-
private _renderTimedEntry;
|
|
52
50
|
protected render(): import("lit-html").TemplateResult<1>;
|
|
53
51
|
}
|
|
54
52
|
declare global {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-day.d.ts","sourceRoot":"","sources":["../src/calendar-day.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"calendar-day.d.ts","sourceRoot":"","sources":["../src/calendar-day.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAmB,MAAM,6BAA6B,CAAC;AA2DpF;;;;;;;;;;;;;;;;GAgBG;AACH,qBACa,WAAY,SAAQ,oBAAoB;IACnD,qCAAqC;IACR,IAAI,EAAE,MAAM,CAAyB;IAElE;;;;OAIG;IACmE,UAAU,UAAS;IAEzF;;;;;OAKG;IACkD,QAAQ,SAAM;IAE1D,OAAO,CAAC,IAAI,CAAc;IAEnC,OAAO,CAAC,SAAS,CAA+C;IAEhE,OAAgB,MAAM,4BAmOpB;IAEF,iFAAiF;IACxE,iBAAiB,IAAI,IAAI,CAGjC;IAED,mEAAmE;IAC1D,oBAAoB,IAAI,IAAI,CAIpC;IAED,iHAAiH;IACjH,UAAmB,OAAO,IAAI,IAAI,CAIjC;IAED,uFAAuF;IACvF,OAAO,CAAC,aAAa;IAYrB,0GAA0G;IAC1G,OAAO,CAAC,aAAa;IAQrB,iFAAiF;IACjF,OAAO,CAAC,iBAAiB;IA2BzB,UAAmB,MAAM,yCA8DxB;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,WAAW,CAAC;KAC7B;CACF"}
|
package/dist/calendar-day.js
CHANGED
|
@@ -7,12 +7,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { css, html, nothing } from "lit";
|
|
8
8
|
import { customElement, property, state } from "lit/decorators.js";
|
|
9
9
|
import { repeat } from "lit/directives/repeat.js";
|
|
10
|
-
import { CalendarTimelineBase } from "./calendar-timeline-base.js";
|
|
10
|
+
import { CalendarTimelineBase, HOUR_HEIGHT_REM } from "./calendar-timeline-base.js";
|
|
11
11
|
import { iconMapPin } from "./icons.js";
|
|
12
12
|
import { tokens } from "./tokens.js";
|
|
13
13
|
import { assignLanes, isWeekend, minutesSinceMidnight, monthName, parseIsoDate, toIsoDate, } from "./utils/calendar.js";
|
|
14
14
|
const NOW_MARKER_INTERVAL_MS = 60_000;
|
|
15
|
-
const HOUR_HEIGHT_REM = 3;
|
|
16
15
|
const HOURS = Array.from({ length: 24 }, (_, i) => i);
|
|
17
16
|
const hourLabelFormatter = new Intl.DateTimeFormat(undefined, { hour: "numeric" });
|
|
18
17
|
/** Formats hour `h` (0-23) as a locale-aware hour label, e.g. "9 AM". */
|
|
@@ -385,32 +384,6 @@ let CalendarDay = class CalendarDay extends CalendarTimelineBase {
|
|
|
385
384
|
</div>
|
|
386
385
|
`;
|
|
387
386
|
}
|
|
388
|
-
/** Renders a positioned/sized block for one timed entry, clamped to this day's bounds. */
|
|
389
|
-
_renderTimedEntry(entry, laneCount, dayStart, dayEnd) {
|
|
390
|
-
const visibleStart = entry.startDate < dayStart ? dayStart : entry.startDate;
|
|
391
|
-
const visibleEnd = entry.endDate > dayEnd ? dayEnd : entry.endDate;
|
|
392
|
-
const topRem = (minutesSinceMidnight(visibleStart) / 60) * HOUR_HEIGHT_REM;
|
|
393
|
-
const bottomRem = (minutesSinceMidnight(visibleEnd) / 60) * HOUR_HEIGHT_REM;
|
|
394
|
-
const heightRem = Math.max(bottomRem - topRem, HOUR_HEIGHT_REM / 4);
|
|
395
|
-
const widthPercent = 100 / laneCount;
|
|
396
|
-
const bodyText = [entry.label, ...(entry.details ?? []), entry.location].filter(Boolean).join("\n");
|
|
397
|
-
return html `
|
|
398
|
-
<div
|
|
399
|
-
class="entry-bar entry-block ${entry.color}"
|
|
400
|
-
data-entry-key=${this.entryKey(entry)}
|
|
401
|
-
title=${entry.href ? nothing : bodyText}
|
|
402
|
-
style="top: ${topRem}rem; height: ${heightRem}rem; left: ${entry.lane * widthPercent}%; width: ${widthPercent}%;"
|
|
403
|
-
>
|
|
404
|
-
${this.renderEntryLink(entry, bodyText)}
|
|
405
|
-
<span class="entry-title" aria-hidden=${entry.href ? "true" : nothing}>${entry.label}</span>
|
|
406
|
-
${entry.location
|
|
407
|
-
? html `<span class="entry-location" aria-hidden=${entry.href ? "true" : nothing}
|
|
408
|
-
>${iconMapPin(14)}${entry.location}</span
|
|
409
|
-
>`
|
|
410
|
-
: nothing}
|
|
411
|
-
</div>
|
|
412
|
-
`;
|
|
413
|
-
}
|
|
414
387
|
render() {
|
|
415
388
|
const day = parseIsoDate(this.date) ?? new Date();
|
|
416
389
|
const dayStart = new Date(day);
|
|
@@ -423,7 +396,7 @@ let CalendarDay = class CalendarDay extends CalendarTimelineBase {
|
|
|
423
396
|
const allDay = resolved.filter((entry) => entry.allDay);
|
|
424
397
|
const timed = resolved.filter((entry) => !entry.allDay);
|
|
425
398
|
const { entries: lanedAllDay, laneCount: allDayLaneCount } = assignLanes(allDay);
|
|
426
|
-
const { entries: lanedTimed, laneCount: timedLaneCount } = assignLanes(timed);
|
|
399
|
+
const { entries: lanedTimed, laneCount: timedLaneCount } = assignLanes(timed, { exclusiveEnd: true });
|
|
427
400
|
const nowTopRem = this.timeMarker && isToday ? (minutesSinceMidnight(new Date(this._now)) / 60) * HOUR_HEIGHT_REM : null;
|
|
428
401
|
const coveredHour = hourLabelCoveredByNow(nowTopRem);
|
|
429
402
|
return html `
|
|
@@ -448,7 +421,7 @@ let CalendarDay = class CalendarDay extends CalendarTimelineBase {
|
|
|
448
421
|
</div>
|
|
449
422
|
<div class="day-column ${isWeekendDay ? "weekend" : ""} ${isToday ? "today" : ""}">
|
|
450
423
|
${HOURS.map(() => html `<div class="hour-line"></div>`)}
|
|
451
|
-
${repeat(lanedTimed, (entry) => this.entryKey(entry), (entry) => this.
|
|
424
|
+
${repeat(lanedTimed, (entry) => this.entryKey(entry), (entry) => this.renderTimedEntry(entry, Math.max(timedLaneCount, 1), dayStart, dayEnd))}
|
|
452
425
|
${nowTopRem !== null
|
|
453
426
|
? html `<div class="now-line" style="top: ${nowTopRem}rem" aria-hidden="true">
|
|
454
427
|
<span class="now-pill">${nowLabel(new Date(this._now))}</span>
|