@crewlethq/ui 0.17.1 → 0.18.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/README.md +36 -1
- package/dist/AccessDeniedCard/AccessDeniedCard.d.ts +39 -0
- package/dist/AccessDeniedCard/index.d.ts +3 -0
- package/dist/AccessDeniedCard/index.js +8 -0
- package/dist/AccessDeniedCard-WXM5DBDZ.css +8 -0
- package/dist/ArtifactCard/ArtifactCard.d.ts +61 -0
- package/dist/ArtifactCard/index.d.ts +3 -0
- package/dist/ArtifactCard/index.js +12 -0
- package/dist/ArtifactCard-EXVAEBV6.css +109 -0
- package/dist/AvatarPicker/index.js +4 -4
- package/dist/ChangeMark/ChangeMark.d.ts +26 -0
- package/dist/ChangeMark/index.d.ts +3 -0
- package/dist/ChangeMark/index.js +8 -0
- package/dist/ChangeMark-3VMTW7MT.css +22 -0
- package/dist/Combobox/index.js +1 -1
- package/dist/CommandPalette/index.js +3 -3
- package/dist/CursorFlag/CursorFlag.d.ts +34 -0
- package/dist/CursorFlag/index.d.ts +3 -0
- package/dist/CursorFlag/index.js +3 -0
- package/dist/CursorFlag-AJQJBUGY.css +61 -0
- package/dist/DataTable/index.js +6 -6
- package/dist/DataView/index.js +12 -12
- package/dist/DateTimePicker/index.js +2 -2
- package/dist/FollowBanner/FollowBanner.d.ts +35 -0
- package/dist/FollowBanner/index.d.ts +2 -0
- package/dist/FollowBanner/index.js +7 -0
- package/dist/FrameProtocol/index.d.ts +2 -0
- package/dist/FrameProtocol/index.js +2 -0
- package/dist/FrameProtocol/protocol.d.ts +164 -0
- package/dist/HuePicker/index.js +2 -2
- package/dist/LinkInterstitial/LinkInterstitial.d.ts +41 -0
- package/dist/LinkInterstitial/index.d.ts +3 -0
- package/dist/LinkInterstitial/index.js +11 -0
- package/dist/LinkInterstitial-ET4MSVSV.css +34 -0
- package/dist/ListInput/index.js +1 -1
- package/dist/LiveCursor/LiveCursor.d.ts +34 -0
- package/dist/LiveCursor/index.d.ts +3 -0
- package/dist/LiveCursor/index.js +4 -0
- package/dist/LiveCursor-DZHGIYWE.css +47 -0
- package/dist/MarkdownEditor/index.js +2 -2
- package/dist/Modal/index.js +2 -2
- package/dist/OrgTable/index.js +2 -2
- package/dist/PresenceModel/index.d.ts +2 -0
- package/dist/PresenceModel/index.js +3 -0
- package/dist/PresenceModel/presence.d.ts +80 -0
- package/dist/PresenceRing/PresenceRing.d.ts +31 -0
- package/dist/PresenceRing/index.d.ts +3 -0
- package/dist/PresenceRing/index.js +2 -0
- package/dist/PresenceRing-M4C22Q6U.css +68 -0
- package/dist/PresenceStack/PresenceStack.d.ts +36 -0
- package/dist/PresenceStack/index.d.ts +3 -0
- package/dist/PresenceStack/index.js +9 -0
- package/dist/PresenceStack-QSXQJND5.css +59 -0
- package/dist/PricingCard/index.js +2 -2
- package/dist/Principal/Principal.d.ts +35 -0
- package/dist/Principal/index.d.ts +2 -0
- package/dist/Principal/index.js +4 -0
- package/dist/PrincipalPicker/PrincipalPicker.d.ts +45 -0
- package/dist/PrincipalPicker/index.d.ts +3 -0
- package/dist/PrincipalPicker/index.js +12 -0
- package/dist/PrincipalPicker-7NNZTGUP.css +41 -0
- package/dist/SandboxedFrame/SandboxedFrame.d.ts +142 -0
- package/dist/SandboxedFrame/index.d.ts +3 -0
- package/dist/SandboxedFrame/index.js +8 -0
- package/dist/SandboxedFrame-L6HBQZCD.css +50 -0
- package/dist/ShareDialog/ShareDialog.d.ts +101 -0
- package/dist/ShareDialog/index.d.ts +5 -0
- package/dist/ShareDialog/index.js +19 -0
- package/dist/ShareDialog/roles.d.ts +10 -0
- package/dist/ShareDialog-YZ4F37MW.css +146 -0
- package/dist/SheetGrid/SheetGrid.d.ts +78 -0
- package/dist/SheetGrid/cells.d.ts +117 -0
- package/dist/SheetGrid/index.d.ts +5 -0
- package/dist/SheetGrid/index.js +18 -0
- package/dist/SheetGrid-4HOXDVIB.css +595 -0
- package/dist/SheetModel/clipboard.d.ts +37 -0
- package/dist/SheetModel/edits.d.ts +68 -0
- package/dist/SheetModel/index.d.ts +14 -0
- package/dist/SheetModel/index.js +3 -0
- package/dist/SheetModel/labels.d.ts +71 -0
- package/dist/SheetModel/navigation.d.ts +79 -0
- package/dist/SheetModel/options.d.ts +28 -0
- package/dist/SheetModel/types.d.ts +126 -0
- package/dist/SheetModel/values.d.ts +76 -0
- package/dist/SheetModel/view.d.ts +32 -0
- package/dist/Switcher/index.js +5 -5
- package/dist/Tag/Tag.d.ts +13 -0
- package/dist/Tag/index.js +1 -1
- package/dist/{Tag-4BRQS6GN.css → Tag-SRGTK5KI.css} +42 -0
- package/dist/TagsInput/index.js +2 -2
- package/dist/ThemeSwitcher/apply.d.ts +43 -0
- package/dist/ThemeSwitcher/index.d.ts +4 -2
- package/dist/ThemeSwitcher/index.js +3 -2
- package/dist/ThemeSwitcher/preferences.d.ts +2 -19
- package/dist/ThemeToggle/index.js +3 -2
- package/dist/TimeWindowPicker/index.js +3 -3
- package/dist/Timeline/Timeline.d.ts +7 -2
- package/dist/Timeline/index.js +1 -1
- package/dist/VersionTimeline/VersionTimeline.d.ts +76 -0
- package/dist/VersionTimeline/index.d.ts +3 -0
- package/dist/VersionTimeline/index.js +10 -0
- package/dist/VersionTimeline-EBJ6MIPJ.css +108 -0
- package/dist/{chunk-SBRE7IML.js → chunk-2ONWEDQT.js} +1 -1
- package/dist/chunk-2YR5ZPQ3.js +216 -0
- package/dist/chunk-3BYIWOTV.js +29 -0
- package/dist/chunk-3UAA4IWJ.js +98 -0
- package/dist/chunk-4KP4RC3O.js +25 -0
- package/dist/chunk-4U3GQ7D2.js +99 -0
- package/dist/chunk-5XACKNYR.js +53 -0
- package/dist/{chunk-FSKTOIYC.js → chunk-76FXDZAZ.js} +2 -2
- package/dist/chunk-A7EBCHEG.js +49 -0
- package/dist/{chunk-JCO3SIST.js → chunk-AQCV62K6.js} +1 -1
- package/dist/{chunk-O67VF5MS.js → chunk-AUQPBL4O.js} +2 -2
- package/dist/{chunk-HENOTGUV.js → chunk-BOW2VUCH.js} +2 -2
- package/dist/{chunk-UCYIRDND.js → chunk-DQSXWQMJ.js} +1 -1
- package/dist/chunk-ESKP3TXM.js +1 -0
- package/dist/chunk-F6V2PTN6.js +142 -0
- package/dist/chunk-FW7HN6AP.js +40 -0
- package/dist/chunk-FYXRWBJJ.js +1235 -0
- package/dist/{chunk-LOECRMHA.js → chunk-GFV4LJHH.js} +4 -3
- package/dist/chunk-I6POAB4V.js +20 -0
- package/dist/{chunk-PQ63NLFC.js → chunk-IFKBDRNJ.js} +1 -1
- package/dist/{chunk-6NN2F7GM.js → chunk-KVT3TJVG.js} +4 -4
- package/dist/chunk-LFZ45HV2.js +46 -0
- package/dist/{chunk-6TSZCBID.js → chunk-NP2C4Y4E.js} +1 -1
- package/dist/{chunk-FA2V2VT6.js → chunk-NZY77ZDU.js} +3 -3
- package/dist/chunk-PPAQFGS2.js +12 -0
- package/dist/chunk-S35G6PNC.js +80 -0
- package/dist/chunk-VYDFB6PJ.js +243 -0
- package/dist/chunk-WXAULPBH.js +135 -0
- package/dist/chunk-YM3GJHGW.js +69 -0
- package/dist/chunk-YYZRLLLY.js +822 -0
- package/dist/{chunk-K3OWD7BJ.js → chunk-Z24ZUSTX.js} +4 -19
- package/dist/chunk-ZXXDZJQN.js +36 -0
- package/dist/generated/index.d.ts +18 -0
- package/dist/generated/index.js +82 -62
- package/dist/index.js +82 -62
- package/dist/styles.css +1578 -149
- package/dist/utils/index.js +1 -1
- package/package.json +3 -3
- package/dist/{chunk-DEEVA6TV.js → chunk-2TZATTIU.js} +1 -1
- package/dist/{chunk-2UU5IGZI.js → chunk-5NVKTB6E.js} +1 -1
- package/dist/{chunk-CRVETI5L.js → chunk-CENOOTAV.js} +0 -0
- package/dist/{chunk-JF7X673Z.js → chunk-ERV5BUS3.js} +1 -1
- package/dist/{chunk-NXDEPUVG.js → chunk-PA4CYTBY.js} +1 -1
- package/dist/{chunk-77IEHFY4.js → chunk-QQGWES46.js} +1 -1
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Three blocks under the title: who to add and at what role, who has access,
|
|
3
|
+
* and what the whole company may do. Each row of the audience is the badge,
|
|
4
|
+
* the name over its second line, and the controls at the inline end; the note
|
|
5
|
+
* and a refusal run the full width under it, so a long sentence never pushes
|
|
6
|
+
* the controls out of line with the rows above and below.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
.crewlet-share-dialog__add {
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: flex-start;
|
|
12
|
+
gap: var(--spacing-2);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.crewlet-share-dialog__section {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
gap: var(--spacing-2);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.crewlet-share-dialog__heading {
|
|
22
|
+
margin: 0;
|
|
23
|
+
color: var(--color-text-secondary);
|
|
24
|
+
font-size: var(--font-size-sm);
|
|
25
|
+
font-weight: var(--font-weight-semibold);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.crewlet-share-dialog__audience {
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
gap: var(--spacing-1);
|
|
32
|
+
margin: 0;
|
|
33
|
+
padding: 0;
|
|
34
|
+
list-style: none;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.crewlet-share-dialog__row {
|
|
38
|
+
display: grid;
|
|
39
|
+
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
40
|
+
align-items: center;
|
|
41
|
+
column-gap: var(--spacing-3);
|
|
42
|
+
padding: var(--spacing-2) 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.crewlet-share-dialog__who {
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
min-width: 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.crewlet-share-dialog__name {
|
|
52
|
+
overflow: hidden;
|
|
53
|
+
color: var(--color-text-primary);
|
|
54
|
+
font-weight: var(--font-weight-medium);
|
|
55
|
+
text-overflow: ellipsis;
|
|
56
|
+
white-space: nowrap;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.crewlet-share-dialog__you,
|
|
60
|
+
.crewlet-share-dialog__detail {
|
|
61
|
+
color: var(--color-text-tertiary);
|
|
62
|
+
font-weight: var(--font-weight-regular);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.crewlet-share-dialog__detail {
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
font-size: var(--font-size-xs);
|
|
68
|
+
text-overflow: ellipsis;
|
|
69
|
+
white-space: nowrap;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.crewlet-share-dialog__controls {
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: flex-end;
|
|
76
|
+
gap: var(--spacing-1);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.crewlet-share-dialog__role,
|
|
80
|
+
.crewlet-share-dialog__saving {
|
|
81
|
+
color: var(--color-text-secondary);
|
|
82
|
+
font-size: var(--font-size-sm);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.crewlet-share-dialog__saving {
|
|
86
|
+
color: var(--color-text-tertiary);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.crewlet-share-dialog__note,
|
|
90
|
+
.crewlet-share-dialog__refusal {
|
|
91
|
+
grid-column: 2 / -1;
|
|
92
|
+
font-size: var(--font-size-xs);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.crewlet-share-dialog__note {
|
|
96
|
+
color: var(--color-text-tertiary);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.crewlet-share-dialog__refusal {
|
|
100
|
+
color: var(--color-feedback-danger-ink);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.crewlet-share-dialog__refusal:empty {
|
|
104
|
+
display: none;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.crewlet-share-dialog__company {
|
|
108
|
+
display: flex;
|
|
109
|
+
align-items: center;
|
|
110
|
+
gap: var(--spacing-2);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.crewlet-share-dialog__company-text {
|
|
114
|
+
margin: 0;
|
|
115
|
+
color: var(--color-text-primary);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.crewlet-share-dialog__link {
|
|
119
|
+
display: flex;
|
|
120
|
+
flex-wrap: wrap;
|
|
121
|
+
align-items: center;
|
|
122
|
+
gap: var(--spacing-2);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.crewlet-share-dialog__link-note {
|
|
126
|
+
color: var(--color-text-tertiary);
|
|
127
|
+
font-size: var(--font-size-xs);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* Under the phone breakpoint the row's controls go under the name, so a
|
|
131
|
+
role select and a remove control never squeeze the name to an ellipsis. */
|
|
132
|
+
@media (width < 640px) {
|
|
133
|
+
.crewlet-share-dialog__row {
|
|
134
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.crewlet-share-dialog__controls {
|
|
138
|
+
grid-column: 2 / -1;
|
|
139
|
+
justify-content: flex-start;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.crewlet-share-dialog__add {
|
|
143
|
+
flex-direction: column;
|
|
144
|
+
align-items: stretch;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An editable, virtualised data grid: the native sheet of a `sheet` artifact,
|
|
3
|
+
* and the grid the artifact kit draws for a page's `<crewlet-sheet>`.
|
|
4
|
+
*
|
|
5
|
+
* KEYBOARD FIRST, with a spreadsheet's keys: the arrows move, Enter or F2
|
|
6
|
+
* edits, Escape cancels, Tab and Shift+Tab move across, Space toggles a
|
|
7
|
+
* checkbox, typing on a cell starts an edit with that character, Mod+C and
|
|
8
|
+
* Mod+V copy and paste ranges as tab-separated values, Delete clears, Mod+Z
|
|
9
|
+
* and Mod+Shift+Z ask the host to undo and redo the reader's own edits, and
|
|
10
|
+
* Mod+Alt+H opens a cell's history. The grid is ONE TAB STOP (the ARIA grid
|
|
11
|
+
* pattern): Tab at a row's edge leaves it rather than wrapping.
|
|
12
|
+
*
|
|
13
|
+
* HONEST INSTANT EDITS (D23). The reader's value is the host's to draw: the
|
|
14
|
+
* grid asks for an edit through `onEdit`, the host draws the value at once and
|
|
15
|
+
* lists the field in the row's `pending` until the engine confirms it, which
|
|
16
|
+
* the grid draws as Saving (a dashed underline, and the word in the cell's
|
|
17
|
+
* description and the sync strip). A refusal reverts the value in the host's
|
|
18
|
+
* data and arrives in the row's `refused`, said on the cell. What is drawn
|
|
19
|
+
* solid is what the engine holds.
|
|
20
|
+
*
|
|
21
|
+
* CONFLICTS ARE SAID, NEVER LOCKED. A remote write that lands on the cell
|
|
22
|
+
* being edited keeps the editor open and names the writer: "Maya changed this
|
|
23
|
+
* to 6.8 while you were editing. Keep yours or use Maya's." No cell is ever
|
|
24
|
+
* locked; presence makes contention visible instead.
|
|
25
|
+
*
|
|
26
|
+
* VIRTUALISED: only the rows in view (and the active one) are in the
|
|
27
|
+
* document, so ten thousand rows cost what forty do. `aria-rowcount` and each
|
|
28
|
+
* row's `aria-rowindex` tell assistive technology how many there are and
|
|
29
|
+
* where it is.
|
|
30
|
+
*/
|
|
31
|
+
import { type PresenceLabels } from '../PresenceModel/index.js';
|
|
32
|
+
import { type SheetCellPresence, type SheetColumn, type SheetEdit, type SheetLabels, type SheetPerson, type SheetRow, type SheetSort, type SheetSyncState } from '../SheetModel/index.js';
|
|
33
|
+
/** `edit` takes edits; `read` draws the same grid with every cell read only. */
|
|
34
|
+
export type SheetGridMode = 'edit' | 'read';
|
|
35
|
+
/** The cell a reader is on, by row id and field: what a host publishes as presence focus. */
|
|
36
|
+
export interface SheetCellRef {
|
|
37
|
+
rowId: string;
|
|
38
|
+
field: string;
|
|
39
|
+
}
|
|
40
|
+
export interface SheetGridProps {
|
|
41
|
+
/** The grid's accessible name: the sheet's title. */
|
|
42
|
+
label: string;
|
|
43
|
+
columns: readonly SheetColumn[];
|
|
44
|
+
rows: readonly SheetRow[];
|
|
45
|
+
/** The people person cells name and offer. */
|
|
46
|
+
people?: readonly SheetPerson[] | undefined;
|
|
47
|
+
mode?: SheetGridMode | undefined;
|
|
48
|
+
/** Every edit the reader makes: one cell, a paste, a cleared range. The host writes them as one batch. */
|
|
49
|
+
onEdit?: ((edits: readonly SheetEdit[]) => void) | undefined;
|
|
50
|
+
/** Shows the Add row control. */
|
|
51
|
+
onAddRow?: (() => void) | undefined;
|
|
52
|
+
/** Shows the per-cell history control on the active cell, and takes Mod+Alt+H. */
|
|
53
|
+
onShowHistory?: ((cell: SheetCellRef) => void) | undefined;
|
|
54
|
+
/** The cell the reader is on, or null when the grid has no active data cell: a host's presence focus. */
|
|
55
|
+
onActiveCellChange?: ((cell: SheetCellRef | null) => void) | undefined;
|
|
56
|
+
/** The cell the reader is editing, or null: a host's presence `editing`. */
|
|
57
|
+
onEditingChange?: ((cell: SheetCellRef | null) => void) | undefined;
|
|
58
|
+
onUndo?: (() => void) | undefined;
|
|
59
|
+
onRedo?: (() => void) | undefined;
|
|
60
|
+
/** Opens a URL cell's link, for a host that routes links through an interstitial. */
|
|
61
|
+
onOpenLink?: ((url: string) => void) | undefined;
|
|
62
|
+
/** Collaborators on cells (D22). */
|
|
63
|
+
presence?: readonly SheetCellPresence[] | undefined;
|
|
64
|
+
/** The order drawn. With `onSortChange` the headers sort. */
|
|
65
|
+
sort?: SheetSort | null | undefined;
|
|
66
|
+
onSortChange?: ((sort: SheetSort | null) => void) | undefined;
|
|
67
|
+
/** Where the host's writes stand, for the sync strip. No strip without it. */
|
|
68
|
+
sync?: SheetSyncState | undefined;
|
|
69
|
+
onRetry?: (() => void) | undefined;
|
|
70
|
+
/** The scroller's height in px. Without it the grid takes the height its container gives it. */
|
|
71
|
+
height?: number | undefined;
|
|
72
|
+
/** A BCP 47 tag for numbers and dates; the reader's own locale when absent. */
|
|
73
|
+
locale?: string | undefined;
|
|
74
|
+
className?: string | undefined;
|
|
75
|
+
labels?: Partial<SheetLabels> | undefined;
|
|
76
|
+
presenceLabels?: Partial<PresenceLabels> | undefined;
|
|
77
|
+
}
|
|
78
|
+
export declare function SheetGrid({ label, columns: declared, rows: given, people, mode, onEdit, onAddRow, onShowHistory, onActiveCellChange, onEditingChange, onUndo, onRedo, onOpenLink, presence, sort, onSortChange, sync, onRetry, height, locale, className, labels: labelOverrides, presenceLabels: presenceOverrides, }: SheetGridProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The display and editor halves of every column type.
|
|
3
|
+
*
|
|
4
|
+
* `CellDisplay` draws a value; `CellEditor` edits one and hands the result
|
|
5
|
+
* back with the way the editing ended (Enter moves down, Tab across). The grid
|
|
6
|
+
* draws both inside its cells and keeps the keyboard; `SheetCell` and the
|
|
7
|
+
* named cells below draw them alone, as a field in a form.
|
|
8
|
+
*
|
|
9
|
+
* Every rule about a value (how it is written, what it parses to, why it is
|
|
10
|
+
* refused) is the sheet model's, so the grid, a form and the artifact kit
|
|
11
|
+
* agree on every one of them.
|
|
12
|
+
*/
|
|
13
|
+
import { type SheetColumn, type SheetColumnType, type SheetLabels, type SheetOption, type SheetPerson, type SheetValue, type SheetValueContext } from '../SheetModel/index.js';
|
|
14
|
+
export interface CellDisplayProps {
|
|
15
|
+
column: SheetColumn;
|
|
16
|
+
value: SheetValue;
|
|
17
|
+
context: SheetValueContext;
|
|
18
|
+
/** Opens a URL cell's link; the anchor's own navigation when absent. */
|
|
19
|
+
onOpenLink?: ((url: string) => void) | undefined;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A value as a reader sees it. What the eye reads and what a screen reader
|
|
23
|
+
* reads are the same words: a checkbox and a rating, which draw no words,
|
|
24
|
+
* carry them hidden.
|
|
25
|
+
*/
|
|
26
|
+
export declare function CellDisplay({ column, value, context, onOpenLink }: CellDisplayProps): import("react").JSX.Element;
|
|
27
|
+
/** How an edit ended: where the active cell goes next, or nowhere. */
|
|
28
|
+
export type CellMove = 'down' | 'up' | 'right' | 'left' | null;
|
|
29
|
+
/** A remote write that landed on the cell being edited. */
|
|
30
|
+
export interface CellConflict {
|
|
31
|
+
writer: string;
|
|
32
|
+
/** The remote value, written for a reader. */
|
|
33
|
+
value: string;
|
|
34
|
+
onKeepMine: () => void;
|
|
35
|
+
onUseTheirs: () => void;
|
|
36
|
+
}
|
|
37
|
+
export interface CellEditorProps {
|
|
38
|
+
column: SheetColumn;
|
|
39
|
+
value: SheetValue;
|
|
40
|
+
context: SheetValueContext;
|
|
41
|
+
/** The character that started the edit, which replaces the value (a text) or filters the list (an option). */
|
|
42
|
+
seed?: string | undefined;
|
|
43
|
+
/** The editor's accessible name: the column, and the row when there is one. */
|
|
44
|
+
label: string;
|
|
45
|
+
/** Hands back a value the model accepted, and where to go next. */
|
|
46
|
+
onCommit: (value: SheetValue, move: CellMove) => void;
|
|
47
|
+
onCancel: () => void;
|
|
48
|
+
/** Which way the list or the long text panel opens from the cell. */
|
|
49
|
+
side?: 'below' | 'above' | undefined;
|
|
50
|
+
conflict?: CellConflict | null | undefined;
|
|
51
|
+
}
|
|
52
|
+
/** Whether a type is edited through `CellEditor` at all: a checkbox is toggled instead. */
|
|
53
|
+
export declare const hasEditor: (type: SheetColumnType) => boolean;
|
|
54
|
+
/** Whether a typed character starts an edit of this type: a line or a list takes it, a checkbox ignores it. */
|
|
55
|
+
export declare const takesTyping: (type: SheetColumnType) => boolean;
|
|
56
|
+
/**
|
|
57
|
+
* The editor for one cell. It owns its draft and its own keys (Enter, Tab,
|
|
58
|
+
* Escape, the arrows inside a list) and nothing else: where the active cell
|
|
59
|
+
* goes after an edit is the grid's.
|
|
60
|
+
*/
|
|
61
|
+
export declare function CellEditor(props: CellEditorProps): import("react").JSX.Element;
|
|
62
|
+
export interface SheetCellProps {
|
|
63
|
+
/** The column's name, and the cell's accessible name. */
|
|
64
|
+
label: string;
|
|
65
|
+
type: SheetColumnType;
|
|
66
|
+
/** The value as the datastore holds it; normalised to the type. */
|
|
67
|
+
value: unknown;
|
|
68
|
+
/** Makes the cell editable. Called with each accepted value. */
|
|
69
|
+
onChange?: ((value: SheetValue) => void) | undefined;
|
|
70
|
+
readOnly?: boolean | undefined;
|
|
71
|
+
/** Select, multi-select and status choices. */
|
|
72
|
+
options?: readonly SheetOption[] | undefined;
|
|
73
|
+
/** The people a person cell may name, and how a stored value is drawn. */
|
|
74
|
+
people?: readonly SheetPerson[] | undefined;
|
|
75
|
+
/** Every other column setting: precision, bounds, number style, time, length. */
|
|
76
|
+
column?: Partial<Omit<SheetColumn, 'type' | 'label' | 'field' | 'options'>> | undefined;
|
|
77
|
+
/** Drawn as Saving until the host confirms (D23). */
|
|
78
|
+
pending?: boolean | undefined;
|
|
79
|
+
/** Why the host refused the last edit, said on the cell. */
|
|
80
|
+
refused?: string | undefined;
|
|
81
|
+
locale?: string | undefined;
|
|
82
|
+
className?: string | undefined;
|
|
83
|
+
labels?: Partial<SheetLabels> | undefined;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* One cell outside a grid: a field in a form, a row opened as a card on a
|
|
87
|
+
* phone. It draws the same display and the same editor a grid cell does.
|
|
88
|
+
*
|
|
89
|
+
* A checkbox is a real checkbox control, toggled by a press or Space. Every
|
|
90
|
+
* other type is a button that names its column and says its value, and opens
|
|
91
|
+
* the editor in place; Enter or Tab in the editor saves, Escape puts it back.
|
|
92
|
+
*/
|
|
93
|
+
export declare function SheetCell({ label, type, value: raw, onChange, readOnly, options, people, column: settings, pending, refused, locale, className, labels: overrides, }: SheetCellProps): import("react").JSX.Element;
|
|
94
|
+
type NamedCellProps = Omit<SheetCellProps, 'type'>;
|
|
95
|
+
/** A checkbox cell on its own. */
|
|
96
|
+
export declare const CheckboxCell: (props: NamedCellProps) => import("react").JSX.Element;
|
|
97
|
+
/** A single-line text cell on its own. */
|
|
98
|
+
export declare const TextCell: (props: NamedCellProps) => import("react").JSX.Element;
|
|
99
|
+
/** A long text cell on its own: its editor is a panel with a text area. */
|
|
100
|
+
export declare const LongTextCell: (props: NamedCellProps) => import("react").JSX.Element;
|
|
101
|
+
/** A number cell on its own. */
|
|
102
|
+
export declare const NumberCell: (props: NamedCellProps) => import("react").JSX.Element;
|
|
103
|
+
/** A select cell on its own: one option, drawn as a chip. */
|
|
104
|
+
export declare const SelectCell: (props: NamedCellProps) => import("react").JSX.Element;
|
|
105
|
+
/** A multi-select cell on its own: options drawn as chips. */
|
|
106
|
+
export declare const MultiSelectCell: (props: NamedCellProps) => import("react").JSX.Element;
|
|
107
|
+
/** A person cell on its own: a person or an agent, drawn with their badge. */
|
|
108
|
+
export declare const PersonCell: (props: NamedCellProps) => import("react").JSX.Element;
|
|
109
|
+
/** A status cell on its own: an option drawn as a state word with its dot. */
|
|
110
|
+
export declare const StatusCell: (props: NamedCellProps) => import("react").JSX.Element;
|
|
111
|
+
/** A date cell on its own. */
|
|
112
|
+
export declare const DateCell: (props: NamedCellProps) => import("react").JSX.Element;
|
|
113
|
+
/** A URL cell on its own. */
|
|
114
|
+
export declare const UrlCell: (props: NamedCellProps) => import("react").JSX.Element;
|
|
115
|
+
/** A rating cell on its own: stars from one to the column's maximum. */
|
|
116
|
+
export declare const RatingCell: (props: NamedCellProps) => import("react").JSX.Element;
|
|
117
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import './SheetGrid.css';
|
|
2
|
+
export { SheetGrid } from './SheetGrid.js';
|
|
3
|
+
export type { SheetCellRef, SheetGridMode, SheetGridProps } from './SheetGrid.js';
|
|
4
|
+
export { CellDisplay, CellEditor, CheckboxCell, DateCell, LongTextCell, MultiSelectCell, NumberCell, PersonCell, RatingCell, SelectCell, SheetCell, StatusCell, TextCell, UrlCell, } from './cells.js';
|
|
5
|
+
export type { CellConflict, CellDisplayProps, CellEditorProps, CellMove, SheetCellProps } from './cells.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { CellDisplay, CellEditor, CheckboxCell, DateCell, LongTextCell, MultiSelectCell, NumberCell, PersonCell, RatingCell, SelectCell, SheetCell, SheetGrid, StatusCell, TextCell, UrlCell } from '../chunk-FYXRWBJJ.js';
|
|
2
|
+
import '../chunk-GFV4LJHH.js';
|
|
3
|
+
import '../chunk-WIATRXEJ.js';
|
|
4
|
+
import '../chunk-CENOOTAV.js';
|
|
5
|
+
import '../chunk-3BYIWOTV.js';
|
|
6
|
+
import '../chunk-I6POAB4V.js';
|
|
7
|
+
import '../chunk-PPAQFGS2.js';
|
|
8
|
+
import '../chunk-YYZRLLLY.js';
|
|
9
|
+
import '../chunk-S35G6PNC.js';
|
|
10
|
+
import '../chunk-QWOPX2MN.js';
|
|
11
|
+
import '../chunk-AYKXMIOR.js';
|
|
12
|
+
import '../chunk-OG6CL3EB.js';
|
|
13
|
+
import '../chunk-HMPFGIWM.js';
|
|
14
|
+
import '../chunk-R25RGPUB.js';
|
|
15
|
+
import '../chunk-UAN5NE7M.js';
|
|
16
|
+
import '../chunk-5OM447RW.js';
|
|
17
|
+
import '../chunk-BZFWDIV6.js';
|
|
18
|
+
import '../chunk-ODEQTPFM.js';
|