@object-ui/plugin-calendar 17.6.0 → 17.7.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/CHANGELOG.md +2791 -0
- package/README.md +158 -45
- package/dist/CalendarView.d.ts.map +1 -1
- package/dist/ObjectCalendar.d.ts +64 -15
- package/dist/ObjectCalendar.d.ts.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +687 -560
- package/dist/index.umd.cjs +1 -1
- package/package.json +15 -13
package/README.md
CHANGED
|
@@ -28,8 +28,8 @@ Calendar view plugins for Object UI - includes both ObjectQL-integrated and stan
|
|
|
28
28
|
|
|
29
29
|
| Gesture | Effect |
|
|
30
30
|
| --- | --- |
|
|
31
|
-
| Drag the event pill body to another day cell |
|
|
32
|
-
| Drag the right-edge handle of a multi-day pill |
|
|
31
|
+
| Drag the event pill body to another day cell | Moves both `startDateField` and `endDateField` by the calendar days from the grabbed cell to the drop cell, each keeping its time of day: a 10:00 event stays at 10:00, even across a DST change. Grab cell → drop cell defines the days, so dragging from any day of a multi-day span works as expected. |
|
|
32
|
+
| Drag the right-edge handle of a multi-day pill | Moves only `endDateField` to the drop day, keeping its time of day; start is preserved. Refuses drops earlier than start. |
|
|
33
33
|
|
|
34
34
|
### Week / Day view (time grid)
|
|
35
35
|
|
|
@@ -149,30 +149,56 @@ ComponentRegistry.register('my-calendar', ObjectCalendarRenderer);
|
|
|
149
149
|
### CalendarView
|
|
150
150
|
|
|
151
151
|
Display a calendar computed from the node's `data` records. This is the full
|
|
152
|
-
authored surface: `CalendarViewSchema` in `@object-ui/types` declares
|
|
153
|
-
its own
|
|
154
|
-
reads (objectui#5667)
|
|
155
|
-
|
|
156
|
-
any node.
|
|
152
|
+
authored surface: `CalendarViewSchema` in `@object-ui/types` declares 15 keys of
|
|
153
|
+
its own. **13 of them are authorable**, converged on what the registered
|
|
154
|
+
`calendar-view` renderer actually reads (objectui#5667), and they are the ones
|
|
155
|
+
listed below. Two of them — `data` and `className` — refine common `BaseSchema`
|
|
156
|
+
keys; the rest of `BaseSchema` (`id`, `visible`, ...) applies as on any node.
|
|
157
|
+
|
|
158
|
+
**The other two are REFUSALS, not keys you can write.** `body` and `children`
|
|
159
|
+
are declared `never` (objectui#9256): a read-site sweep of every package that
|
|
160
|
+
registers a component measured that no renderer read consumes either content
|
|
161
|
+
channel for a `calendar-view` node — it renders events computed from `data`, not
|
|
162
|
+
child nodes — so authoring one is now refused at `tsc` and at validation instead
|
|
163
|
+
of silently rendering nothing. They are counted above because the interface
|
|
164
|
+
declares them; they are absent from the listing below because the listing is the
|
|
165
|
+
*authorable* surface.
|
|
157
166
|
|
|
158
167
|
```typescript
|
|
159
|
-
{
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
168
|
+
import type { CalendarViewSchema, CalendarViewMode, CalendarEvent } from '@object-ui/types';
|
|
169
|
+
|
|
170
|
+
type CalendarViewNode = {
|
|
171
|
+
type: 'calendar-view';
|
|
172
|
+
data?: any; // records rendered as events (array, or a binding expression)
|
|
173
|
+
titleField?: string; // default 'title'
|
|
174
|
+
startDateField?: string; // default 'start'
|
|
175
|
+
endDateField?: string; // default 'end'
|
|
176
|
+
allDayField?: string; // default 'allDay'
|
|
177
|
+
colorField?: string; // default 'color'
|
|
178
|
+
view?: CalendarViewMode; // 'month' | 'week' | 'day' (default 'month')
|
|
179
|
+
currentDate?: string | Date; // ISO string authored; Date from a React host
|
|
180
|
+
allowCreate?: boolean; // default false — shows the "New event" button
|
|
181
|
+
className?: string; // Tailwind classes for the container
|
|
182
|
+
onEventClick?: (event: CalendarEvent) => void; // HOST-ONLY (see below)
|
|
183
|
+
onViewChange?: (view: CalendarViewMode) => void; // HOST-ONLY (see below)
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
// The listing above is held to the shipped type BY THE COMPILER, both
|
|
187
|
+
// directions, rather than by this paragraph: a key whose type here disagrees
|
|
188
|
+
// with what `CalendarViewSchema` declares is a compile error.
|
|
189
|
+
declare const authored: CalendarViewNode;
|
|
190
|
+
declare const shipped: CalendarViewSchema;
|
|
191
|
+
const forwards: CalendarViewSchema = authored;
|
|
192
|
+
const backwards: CalendarViewNode = shipped;
|
|
174
193
|
```
|
|
175
194
|
|
|
195
|
+
> **What those two assignments do and do not buy.** They check every key's
|
|
196
|
+
> **type**, in both directions. They do **not** check a key's **spelling**:
|
|
197
|
+
> `CalendarViewSchema` extends `BaseSchema`, whose `[key: string]: any` accepts
|
|
198
|
+
> any name, so a key invented or misspelled here is `any` rather than an error
|
|
199
|
+
> (objectui#7927). Key-level validity is the strict `@objectstack/spec` twin's
|
|
200
|
+
> question, not TypeScript's.
|
|
201
|
+
|
|
176
202
|
There is deliberately **no authorable `events` key**: the renderer computes its
|
|
177
203
|
events from `data` plus the field-name keys, and drops an authored `events`
|
|
178
204
|
(objectui#4433). Nine formerly declared keys — `events`, `defaultView`,
|
|
@@ -233,34 +259,93 @@ const schema = {
|
|
|
233
259
|
```
|
|
234
260
|
|
|
235
261
|
The records above already use the default field names (`title`, `start`, `end`,
|
|
236
|
-
`color`), so no field-name keys are needed;
|
|
237
|
-
`startDateField` / `endDateField` / `allDayField` / `colorField`
|
|
238
|
-
fields when they differ.
|
|
262
|
+
`color`), so no field-name keys are needed; on a `calendar-view` node, point
|
|
263
|
+
`titleField` / `startDateField` / `endDateField` / `allDayField` / `colorField`
|
|
264
|
+
at your own fields when they differ. They sit flat on this node because
|
|
265
|
+
`CalendarViewSchema` has no `calendar` block: here the flat keys are the only
|
|
266
|
+
spelling. An `object-calendar` takes the same five inside its `calendar` block
|
|
267
|
+
instead (next section).
|
|
239
268
|
|
|
240
269
|
### With ObjectQL Integration
|
|
241
270
|
|
|
271
|
+
Every key below is one `ObjectCalendarSchema` declares. The five field-name keys
|
|
272
|
+
go inside the `calendar` block: `getCalendarConfig` reads that block first and
|
|
273
|
+
returns it whole. A misspelt start-date key inside it is therefore not a partial
|
|
274
|
+
failure either: no record has a date to be placed by, so every one is counted
|
|
275
|
+
as unscheduled under the calendar instead of drawn.
|
|
276
|
+
|
|
277
|
+
`startDateField` is the only one of the five the calendar needs — `titleField`
|
|
278
|
+
is optional, and an event with no explicit title resolves one through the
|
|
279
|
+
ADR-0079 record display-name chain. A calendar authored with no `calendar`
|
|
280
|
+
block renders the "Calendar configuration required" refusal screen, which says
|
|
281
|
+
so and also names where the key belongs: the view's `calendar` block. That
|
|
282
|
+
matters on an **interface page**, whose `interfaceConfig` has no calendar slot
|
|
283
|
+
of its own — the only lever there is `sourceView`, pointed at a view that
|
|
284
|
+
declares the block (objectui#8170).
|
|
285
|
+
|
|
286
|
+
The same five keys written flat on the node are **not** a second way to author
|
|
287
|
+
this. That flat spelling is the runtime handoff — `ObjectView` and `ListView`
|
|
288
|
+
emit it on the node they build, and `getCalendarConfig` falls back to it only
|
|
289
|
+
when the node has no `calendar` block — so `ObjectCalendarSchema` declares it
|
|
290
|
+
because the renderer reads it. `@objectstack/spec` refuses it at authoring with
|
|
291
|
+
`unrecognized_keys` and names the `calendar` block in the same diagnostic (one
|
|
292
|
+
key per concept, its Prime Directive #12).
|
|
293
|
+
|
|
242
294
|
```typescript
|
|
243
|
-
|
|
295
|
+
import type { ObjectCalendarSchema } from '@object-ui/types';
|
|
296
|
+
|
|
297
|
+
// What this annotation buys, and what it does not - measured, objectui#7925.
|
|
298
|
+
// It type-checks the VALUES of the declared keys: `defaultView: 'agenda'` and
|
|
299
|
+
// `calendar: { titleField: 42 }` are both compile errors, and
|
|
300
|
+
// `check:doc-snippets` re-runs that check on every commit. It does NOT check
|
|
301
|
+
// key NAMES - this interface extends `BaseSchema`, whose `[key: string]: any`
|
|
302
|
+
// admits any spelling, and the `calendar` block is open the same way, so a
|
|
303
|
+
// misspelt key still compiles clean. Read the block as type-checked values,
|
|
304
|
+
// never as a guarded key set.
|
|
305
|
+
const schema: ObjectCalendarSchema = {
|
|
244
306
|
type: 'object-calendar',
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
307
|
+
objectName: 'events',
|
|
308
|
+
calendar: {
|
|
309
|
+
titleField: 'name',
|
|
310
|
+
startDateField: 'startDate',
|
|
311
|
+
endDateField: 'endDate',
|
|
312
|
+
allDayField: 'isAllDay',
|
|
313
|
+
colorField: 'statusColor'
|
|
314
|
+
},
|
|
315
|
+
defaultView: 'month',
|
|
316
|
+
navigation: { mode: 'modal' } // what an event click opens - see below
|
|
250
317
|
};
|
|
251
318
|
```
|
|
252
319
|
|
|
320
|
+
`navigation` is what an event click opens — the spec's `NavigationConfig` by
|
|
321
|
+
reference, `ViewNavigationConfig` in `@object-ui/types`, the type
|
|
322
|
+
`ObjectGridSchema.navigation` uses: `mode` (`page`, `drawer`, `modal`, `split`,
|
|
323
|
+
`popover`, `new_window` or `none`) with `size`, `openNewTab` and
|
|
324
|
+
`preventNavigation`. With the key absent a click opens the record in a drawer.
|
|
325
|
+
An overlay mode keeps the click from a parent view's `onRowClick` /
|
|
326
|
+
`onEventClick`; any other mode hands it to them. `page` — and a block written
|
|
327
|
+
without `mode`, which takes the spec's `page` default — opens the record page
|
|
328
|
+
through the record navigator the host publishes on `RelatedRecordActionsContext`
|
|
329
|
+
(objectui#11293); the console publishes one on its custom pages, record pages and
|
|
330
|
+
list views. Under a host that publishes none, such as an embedded renderer,
|
|
331
|
+
there is no record page to open and the click opens nothing.
|
|
332
|
+
|
|
253
333
|
### Interactive Calendar
|
|
254
334
|
|
|
255
335
|
The handlers are host-only — a function can only come from a React host
|
|
256
336
|
building the node in code, never from authored JSON:
|
|
257
337
|
|
|
258
338
|
```typescript
|
|
259
|
-
|
|
339
|
+
import type { CalendarViewSchema } from '@object-ui/types';
|
|
340
|
+
|
|
341
|
+
// The annotation is what types the two handler parameters: `event` is
|
|
342
|
+
// `CalendarEvent` and `view` is `CalendarViewMode`, read off the shipped
|
|
343
|
+
// schema. Without it both are implicitly `any`.
|
|
344
|
+
const schema: CalendarViewSchema = {
|
|
260
345
|
type: 'calendar-view',
|
|
261
346
|
data: [],
|
|
262
347
|
onEventClick: (event) => {
|
|
263
|
-
console.log('Event clicked:', event);
|
|
348
|
+
console.log('Event clicked:', event.title);
|
|
264
349
|
// Open event details modal
|
|
265
350
|
},
|
|
266
351
|
onViewChange: (view) => {
|
|
@@ -276,38 +361,66 @@ Authored JSON reacts to clicks through the node's action channel instead
|
|
|
276
361
|
|
|
277
362
|
## ObjectQL Integration
|
|
278
363
|
|
|
279
|
-
When using with ObjectStack, the calendar can automatically fetch and display
|
|
364
|
+
When using with ObjectStack, the calendar can automatically fetch and display
|
|
365
|
+
events. The adapter is **not** a schema key: `ObjectCalendarRenderer` reads it
|
|
366
|
+
from the renderer context that `SchemaRendererProvider` supplies. The schema
|
|
367
|
+
names the object with `objectName` and its fields inside the same `calendar`
|
|
368
|
+
block as above - there is no `fields` container.
|
|
280
369
|
|
|
281
370
|
```typescript
|
|
282
371
|
import { createObjectStackAdapter } from '@object-ui/data-objectstack';
|
|
372
|
+
import type { ObjectCalendarSchema } from '@object-ui/types';
|
|
283
373
|
|
|
284
374
|
const dataSource = createObjectStackAdapter({
|
|
285
375
|
baseUrl: 'https://api.example.com',
|
|
286
376
|
token: 'your-auth-token'
|
|
287
377
|
});
|
|
288
378
|
|
|
289
|
-
|
|
379
|
+
// The annotation checks the values of the declared keys, not the key names -
|
|
380
|
+
// see the note on the first `object-calendar` block above.
|
|
381
|
+
const schema: ObjectCalendarSchema = {
|
|
290
382
|
type: 'object-calendar',
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
}
|
|
383
|
+
objectName: 'calendar_events',
|
|
384
|
+
calendar: {
|
|
385
|
+
titleField: 'title',
|
|
386
|
+
startDateField: 'start_time',
|
|
387
|
+
endDateField: 'end_time'
|
|
388
|
+
},
|
|
389
|
+
defaultView: 'month'
|
|
299
390
|
};
|
|
300
391
|
```
|
|
301
392
|
|
|
393
|
+
Pass the adapter to `SchemaRendererProvider` to wire the fetch up.
|
|
394
|
+
|
|
395
|
+
**The provider does not change which query keys apply** (objectui#9061, the port
|
|
396
|
+
of objectui#8769). An authored `filter` and `sort` narrow and order the records
|
|
397
|
+
on **every** provider, inline ones included — both `staticData` and
|
|
398
|
+
`data: { provider: 'value', items }` reach the same in-memory adapter the
|
|
399
|
+
`object` provider goes through, so `filter` is evaluated with the same matcher.
|
|
400
|
+
Before objectui#9061 the inline provider skipped that query and drew every
|
|
401
|
+
authored record with an authored `filter` silently dropped. The platform row
|
|
402
|
+
ceiling (2,000 drawn rows, with a footnote naming both numbers — objectui#7210,
|
|
403
|
+
ruling a′) applies to inline records too, and it is applied to the **filtered**
|
|
404
|
+
set, never to the raw one: a large inline array that a `filter` cuts below the
|
|
405
|
+
ceiling draws every matching record and shows no footnote.
|
|
406
|
+
|
|
407
|
+
⚠️ Two consequences of routing inline records through the adapter. They reach the
|
|
408
|
+
calendar as that adapter's own deep copy rather than as the authored array's
|
|
409
|
+
object identities, so code comparing a record handed to `onEventClick` against
|
|
410
|
+
the authored array with `===` needs `id` equality instead; and the copy is a JSON
|
|
411
|
+
round-trip, so inline records must be JSON-serializable.
|
|
412
|
+
|
|
302
413
|
## Customization
|
|
303
414
|
|
|
304
415
|
Style the calendar with Tailwind classes:
|
|
305
416
|
|
|
306
417
|
```typescript
|
|
307
|
-
|
|
418
|
+
import type { CalendarViewSchema } from '@object-ui/types';
|
|
419
|
+
|
|
420
|
+
const schema: CalendarViewSchema = {
|
|
308
421
|
type: 'calendar-view',
|
|
309
422
|
className: 'border rounded-lg shadow-lg',
|
|
310
|
-
data: [
|
|
423
|
+
data: [] // your records
|
|
311
424
|
};
|
|
312
425
|
```
|
|
313
426
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CalendarView.d.ts","sourceRoot":"","sources":["../src/CalendarView.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AA0C9B;;;;;;;;;;GAUG;AACH,iBAAS,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAUtG;
|
|
1
|
+
{"version":3,"file":"CalendarView.d.ts","sourceRoot":"","sources":["../src/CalendarView.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AA0C9B;;;;;;;;;;GAUG;AACH,iBAAS,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAUtG;AAoCD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,IAAI,CAAA;IACX,GAAG,CAAC,EAAE,IAAI,CAAA;IACV,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,GAAG,CAAA;CACX;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,EAAE,iBAAiB,EAAE,CAAA;IAC5B,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,KAAK,CAAA;IAC/B,WAAW,CAAC,EAAE,IAAI,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAA;IACjD,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;IAClC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,KAAK,KAAK,IAAI,CAAA;IACvD,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;IACjC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;IACvB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,IAAI,KAAK,IAAI,CAAA;IAC/E;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,KAAK,IAAI,CAAA;IACpD;2EACuE;IACvE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,iBAAS,YAAY,CAAC,EACpB,MAAW,EACX,IAAc,EACd,WAAiC,EACjC,MAAkB,EAClB,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,UAAU,EACV,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,WAAgB,EAChB,SAAS,GACV,EAAE,iBAAiB,qBAmQnB;AAqpCD,OAAO,EAAE,YAAY,EAAE,CAAA;AACvB,OAAO,EAAE,iBAAiB,IAAI,0BAA0B,EAAE,CAAA"}
|
package/dist/ObjectCalendar.d.ts
CHANGED
|
@@ -1,17 +1,52 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
import { ObjectCalendarSchema, DataSource } from '@object-ui/types';
|
|
3
|
+
/**
|
|
4
|
+
* ⛔ RETIRED (objectui#8651) — a plugin-local `CalendarSchema` used to sit here,
|
|
5
|
+
* and `ObjectCalendarComponentProps.schema` below was the union of it with
|
|
6
|
+
* `ObjectGridSchema`. Both arms are gone; the prop is now the published schema
|
|
7
|
+
* of the element this file is registered as (`index.tsx`, both tags).
|
|
8
|
+
*
|
|
9
|
+
* What the union cost, measured with the TypeScript checker on the merge-base
|
|
10
|
+
* (`getPropertyOfType`, never a grep — objectui#8410). Of the fifteen keys this
|
|
11
|
+
* renderer reads off the node, FOUR were declared on neither arm and EIGHT on
|
|
12
|
+
* exactly one, while `ObjectCalendarSchema` already declared ELEVEN of the
|
|
13
|
+
* fifteen.
|
|
14
|
+
*
|
|
15
|
+
* ⚠️ But the cast count is NOT twelve, and an earlier cut of this comment said
|
|
16
|
+
* it was. `ObjectGridSchema` carries `BaseSchema`'s `[key: string]: any`, so on
|
|
17
|
+
* the UNION the five `CalendarSchema`-only keys resolved through that index
|
|
18
|
+
* signature and compiled with no cast at all. The checker on the union itself:
|
|
19
|
+
* DECLARED 8 of 15 (`colorField` `dateField` `defaultView` `endField` `filter`
|
|
20
|
+
* `objectName` `sort` `titleField`), NOT declared 7 (`allDayField` `calendar`
|
|
21
|
+
* `data` `endDateField` `navigation` `startDateField` `staticData`), nonsense
|
|
22
|
+
* control `false`. ⇒ SEVEN reads needed a cast, not twelve.
|
|
23
|
+
*
|
|
24
|
+
* ⭐ That reading is worse for the old shape, not better: those five compiled
|
|
25
|
+
* silently as `any` — admitted through an index signature, never examined —
|
|
26
|
+
* which is the objectui#6914 defect itself rather than an absence of one. A
|
|
27
|
+
* cast at least announces the gap. The union's own index signature is `false`,
|
|
28
|
+
* which is why the other seven had to be cast.
|
|
29
|
+
*
|
|
30
|
+
* The two arms failed differently and neither was salvageable:
|
|
31
|
+
*
|
|
32
|
+
* - `ObjectGridSchema` is `type: 'object-grid'`. No producer hands this
|
|
33
|
+
* component one: the single call site is this package's `index.tsx`, whose
|
|
34
|
+
* two registrations both publish `OBJECT_CALENDAR_INPUTS`.
|
|
35
|
+
* - the local interface was absent from this package's barrel, so no importer
|
|
36
|
+
* could name it, and it SHADOWED `@object-ui/types`' own published
|
|
37
|
+
* `CalendarSchema` — the date-picker primitive reachable at `ui:calendar`
|
|
38
|
+
* only (objectui#8499). Its two distinctive members were the alias spellings
|
|
39
|
+
* `dateField` / `endField`, which objectui#8355 has since RETIRED at both
|
|
40
|
+
* faces — `getCalendarConfig` below reads the declared spellings only, and
|
|
41
|
+
* `@object-ui/types` refuses the two by name.
|
|
42
|
+
*
|
|
43
|
+
* The shape this leaves is the family's: `ObjectKanban` takes
|
|
44
|
+
* `ObjectKanbanSchema`, `ObjectGantt` takes `ObjectGanttSchema`, `ObjectMap`
|
|
45
|
+
* takes `ObjectMapSchema` — and `plugin-map` is registered under two tags with
|
|
46
|
+
* one published props type, exactly as this package is.
|
|
47
|
+
*
|
|
48
|
+
* Pinned in `__tests__/calendarUnionReads-8651.test.tsx`.
|
|
49
|
+
*/
|
|
15
50
|
/**
|
|
16
51
|
* Props of the `ObjectCalendar` React component.
|
|
17
52
|
*
|
|
@@ -29,7 +64,7 @@ export interface CalendarSchema {
|
|
|
29
64
|
* no importer breaks. Tripwire: `__tests__/spec-symbol-4650.test.ts`.
|
|
30
65
|
*/
|
|
31
66
|
export interface ObjectCalendarComponentProps {
|
|
32
|
-
schema:
|
|
67
|
+
schema: ObjectCalendarSchema;
|
|
33
68
|
dataSource?: DataSource;
|
|
34
69
|
className?: string;
|
|
35
70
|
/** Pre-fetched records passed by a parent (e.g. ObjectView). When provided, skips internal data fetching. */
|
|
@@ -37,7 +72,21 @@ export interface ObjectCalendarComponentProps {
|
|
|
37
72
|
/** Loading state propagated from a parent. Respected only when `data` is also provided. */
|
|
38
73
|
loading?: boolean;
|
|
39
74
|
onEventClick?: (record: any) => void;
|
|
40
|
-
|
|
75
|
+
/**
|
|
76
|
+
* TWO parameters since objectui#9357, and the second is not decoration: this
|
|
77
|
+
* prop reaches `useNavigationOverlay` as its `onRowClick`, and `handleClick`
|
|
78
|
+
* invokes it as `onRowClick(record, event)` — the modifier payload a host
|
|
79
|
+
* needs to implement Cmd/Ctrl/middle-click for itself. Declaring one
|
|
80
|
+
* parameter hid the second on the ONE line a host reads. Spelled `any` and
|
|
81
|
+
* not `HandleClickModifiers` for the reason objectui#9341 measured on
|
|
82
|
+
* `ObjectKanbanSchema.onCardClick`: that interface lives in
|
|
83
|
+
* `@object-ui/react`, the published twins in `@object-ui/types` may not name
|
|
84
|
+
* it, and a host that discovered the payload from the implementation
|
|
85
|
+
* annotated it `React.MouseEvent` — which a narrower declaration refuses
|
|
86
|
+
* contravariantly. `BaseSchema`'s own `onClick` / `onChange` / `onSubmit`
|
|
87
|
+
* already use this spelling for exactly this situation.
|
|
88
|
+
*/
|
|
89
|
+
onRowClick?: (record: any, event?: any) => void;
|
|
41
90
|
onDateClick?: (date: Date) => void;
|
|
42
91
|
onEdit?: (record: any) => void;
|
|
43
92
|
onDelete?: (record: any) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectCalendar.d.ts","sourceRoot":"","sources":["../src/ObjectCalendar.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;GAcG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"ObjectCalendar.d.ts","sourceRoot":"","sources":["../src/ObjectCalendar.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAoD,MAAM,OAAO,CAAC;AACzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,UAAU,EAAkB,MAAM,kBAAkB,CAAC;AA0DzF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,oBAAoB,CAAC;IAC7B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6GAA6G;IAC7G,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACb,2FAA2F;IAC3F,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;IACrC;;;;;;;;;;;;;OAaG;IACH,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAChD,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACnC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;IACjC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAClC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,KAAK,KAAK,IAAI,CAAC;IACxD,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,IAAI,KAAK,IAAI,CAAC;IACnE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAqLD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,4BAA4B,CA0sCjE,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { ObjectCalendar, ObjectCalendarComponentProps } from './ObjectCalendar';
|
|
2
|
+
import { ObjectCalendar, ObjectCalendarComponentProps } from './ObjectCalendar.js';
|
|
3
3
|
export { ObjectCalendar };
|
|
4
4
|
export type { ObjectCalendarComponentProps };
|
|
5
5
|
/**
|
|
@@ -9,9 +9,9 @@ export type { ObjectCalendarComponentProps };
|
|
|
9
9
|
* this component's props. The alias denotes the SAME type and is kept only so
|
|
10
10
|
* existing importers keep compiling.
|
|
11
11
|
*/
|
|
12
|
-
export type { ObjectCalendarComponentProps as ObjectCalendarProps } from './ObjectCalendar';
|
|
13
|
-
export { CalendarView } from './CalendarView';
|
|
14
|
-
export type { CalendarViewProps, CalendarViewEvent } from './CalendarView';
|
|
12
|
+
export type { ObjectCalendarComponentProps as ObjectCalendarProps } from './ObjectCalendar.js';
|
|
13
|
+
export { CalendarView } from './CalendarView.js';
|
|
14
|
+
export type { CalendarViewProps, CalendarViewEvent } from './CalendarView.js';
|
|
15
15
|
/**
|
|
16
16
|
* @deprecated Use `CalendarViewEvent`. Renamed in objectui#5044 because
|
|
17
17
|
* `@object-ui/types` owns `CalendarEvent`, where it means the AUTHORING event
|
|
@@ -27,7 +27,7 @@ export type { CalendarViewProps, CalendarViewEvent } from './CalendarView';
|
|
|
27
27
|
* module specifier is judged as its own declaration by
|
|
28
28
|
* `scripts/check-spec-symbol-derivation.mjs`.
|
|
29
29
|
*/
|
|
30
|
-
export type { CalendarViewEvent as CalendarEvent } from './CalendarView';
|
|
30
|
+
export type { CalendarViewEvent as CalendarEvent } from './CalendarView.js';
|
|
31
31
|
export declare const ObjectCalendarRenderer: React.FC<{
|
|
32
32
|
schema: any;
|
|
33
33
|
[key: string]: any;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAGrE,OAAO,EAAE,cAAc,EAAE,CAAC;AAC1B,YAAY,EAAE,4BAA4B,EAAE,CAAC;AAE7C;;;;;;GAMG;AACH,YAAY,EAAE,4BAA4B,IAAI,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAG5F,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAE3E;;;;;;;;;;;;;;GAcG;AACH,YAAY,EAAE,iBAAiB,IAAI,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGzE,OAAO,0BAA0B,CAAC;AAyLlC,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,MAAM,EAAE,GAAG,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CA0D/E,CAAC"}
|