@genesislcap/ai-assistant 15.37.0 → 15.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/custom-elements.json +638 -0
- package/dist/dts/genesis/calendar.d.ts +25 -0
- package/dist/dts/genesis/calendar.d.ts.map +1 -0
- package/dist/dts/genesis/config.d.ts +16 -0
- package/dist/dts/genesis/config.d.ts.map +1 -1
- package/dist/dts/genesis/criteria.d.ts +24 -2
- package/dist/dts/genesis/criteria.d.ts.map +1 -1
- package/dist/dts/genesis/event-fields.d.ts +84 -0
- package/dist/dts/genesis/event-fields.d.ts.map +1 -0
- package/dist/dts/genesis/filter-fields.d.ts +69 -5
- package/dist/dts/genesis/filter-fields.d.ts.map +1 -1
- package/dist/dts/genesis/index.d.ts +3 -0
- package/dist/dts/genesis/index.d.ts.map +1 -1
- package/dist/dts/genesis/register-genesis-assistant.d.ts +13 -0
- package/dist/dts/genesis/register-genesis-assistant.d.ts.map +1 -1
- package/dist/dts/genesis/resource-tools.d.ts.map +1 -1
- package/dist/dts/genesis/review-model.d.ts +202 -0
- package/dist/dts/genesis/review-model.d.ts.map +1 -0
- package/dist/dts/genesis/row-source.d.ts +102 -0
- package/dist/dts/genesis/row-source.d.ts.map +1 -0
- package/dist/dts/genesis/serialisable.d.ts +25 -0
- package/dist/dts/genesis/serialisable.d.ts.map +1 -0
- package/dist/dts/genesis/server-text.d.ts +63 -0
- package/dist/dts/genesis/server-text.d.ts.map +1 -0
- package/dist/dts/genesis/type-name.d.ts +18 -0
- package/dist/dts/genesis/type-name.d.ts.map +1 -0
- package/dist/dts/genesis/types.d.ts +7 -0
- package/dist/dts/genesis/types.d.ts.map +1 -1
- package/dist/dts/genesis/value-compare.d.ts +19 -0
- package/dist/dts/genesis/value-compare.d.ts.map +1 -0
- package/dist/dts/genesis/write-commit.d.ts +53 -0
- package/dist/dts/genesis/write-commit.d.ts.map +1 -0
- package/dist/dts/genesis/write-outcome.d.ts +133 -0
- package/dist/dts/genesis/write-outcome.d.ts.map +1 -0
- package/dist/dts/genesis/write-payload.d.ts +129 -0
- package/dist/dts/genesis/write-payload.d.ts.map +1 -0
- package/dist/dts/genesis/write-plan.d.ts +109 -0
- package/dist/dts/genesis/write-plan.d.ts.map +1 -0
- package/dist/dts/genesis/write-review/write-review.d.ts +127 -0
- package/dist/dts/genesis/write-review/write-review.d.ts.map +1 -0
- package/dist/dts/genesis/write-review/write-review.styles.d.ts +2 -0
- package/dist/dts/genesis/write-review/write-review.styles.d.ts.map +1 -0
- package/dist/dts/genesis/write-review/write-review.template.d.ts +4 -0
- package/dist/dts/genesis/write-review/write-review.template.d.ts.map +1 -0
- package/dist/dts/genesis/write-tools.d.ts +99 -0
- package/dist/dts/genesis/write-tools.d.ts.map +1 -0
- package/dist/dts/react.d.ts +10 -0
- package/dist/esm/genesis/calendar.js +38 -0
- package/dist/esm/genesis/config.js +36 -1
- package/dist/esm/genesis/criteria.js +59 -55
- package/dist/esm/genesis/event-fields.js +158 -0
- package/dist/esm/genesis/filter-fields.js +111 -20
- package/dist/esm/genesis/index.js +2 -0
- package/dist/esm/genesis/register-genesis-assistant.js +76 -4
- package/dist/esm/genesis/resource-tools.js +21 -103
- package/dist/esm/genesis/review-model.js +248 -0
- package/dist/esm/genesis/row-source.js +127 -0
- package/dist/esm/genesis/serialisable.js +38 -0
- package/dist/esm/genesis/server-text.js +186 -0
- package/dist/esm/genesis/type-name.js +20 -0
- package/dist/esm/genesis/value-compare.js +87 -0
- package/dist/esm/genesis/write-commit.js +78 -0
- package/dist/esm/genesis/write-outcome.js +299 -0
- package/dist/esm/genesis/write-payload.js +632 -0
- package/dist/esm/genesis/write-plan.js +275 -0
- package/dist/esm/genesis/write-review/write-review.js +252 -0
- package/dist/esm/genesis/write-review/write-review.styles.js +214 -0
- package/dist/esm/genesis/write-review/write-review.template.js +182 -0
- package/dist/esm/genesis/write-tools.js +660 -0
- package/dist/react.cjs +7 -0
- package/dist/react.mjs +6 -0
- package/docs/genesis.md +152 -10
- package/package.json +18 -18
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { css } from '@genesislcap/web-core';
|
|
2
|
+
export const WriteReviewStyles = css `
|
|
3
|
+
:host {
|
|
4
|
+
display: block;
|
|
5
|
+
font: inherit;
|
|
6
|
+
|
|
7
|
+
/* The diff tints — see the diff rules below for why they are backgrounds only. */
|
|
8
|
+
--write-review-added: color-mix(in srgb, var(--success-fill-rest, #2da44e) 18%, transparent);
|
|
9
|
+
--write-review-removed: color-mix(in srgb, var(--error-fill-rest, #cf222e) 18%, transparent);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
* The review mounts inside the chat bubble's dialog content, which is overflow: hidden — so a
|
|
14
|
+
* wide event's columns were CLIPPED rather than pushed off screen, with no scrollbar to say
|
|
15
|
+
* anything was missing. A user approving values they cannot see is the failure this whole
|
|
16
|
+
* component exists to prevent, so the table scrolls within itself.
|
|
17
|
+
*/
|
|
18
|
+
.scroller {
|
|
19
|
+
overflow-x: auto;
|
|
20
|
+
max-width: 100%;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
table {
|
|
24
|
+
border-collapse: collapse;
|
|
25
|
+
width: 100%;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
th,
|
|
29
|
+
td {
|
|
30
|
+
border-bottom: calc(var(--stroke-width, 1) * 1px) solid var(--neutral-stroke-rest);
|
|
31
|
+
padding: calc(var(--design-unit, 4) * 1px) calc(var(--design-unit, 4) * 2px);
|
|
32
|
+
text-align: left;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* A heading is a column name: kept on one line. */
|
|
36
|
+
th {
|
|
37
|
+
white-space: nowrap;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/*
|
|
41
|
+
* A value is never clipped. Every character stays on screen.
|
|
42
|
+
*
|
|
43
|
+
* Clipping was the first bound, and the wrong one: 24ch with an ellipsis cut the END of every
|
|
44
|
+
* cell, which in a changed cell is the NEW value, so the user approved a value they never saw.
|
|
45
|
+
* No cell is safe to clip either. An insert has no pre-image, so none of its cells is
|
|
46
|
+
* "changed", and every one of them is a value being written; a delete's cells are the record
|
|
47
|
+
* being removed; and a title attribute holding the full text reaches nobody on a keyboard or a
|
|
48
|
+
* touch screen.
|
|
49
|
+
*
|
|
50
|
+
* A SHORT value stays whole on one line, and the table scrolls. Wrapping every cell broke a
|
|
51
|
+
* short value mid-token in a squeezed table — "101." over "2345" — and the first line could
|
|
52
|
+
* pass for the whole value.
|
|
53
|
+
*
|
|
54
|
+
* A LONG value (review-model marks it) wraps within a bound. With no bound at all, one long
|
|
55
|
+
* value (a NOTE another user wrote) widened its column until the changed one sat out of view,
|
|
56
|
+
* behind a scrollbar an overlay-scrollbar platform does not draw until you scroll.
|
|
57
|
+
*/
|
|
58
|
+
td {
|
|
59
|
+
white-space: nowrap;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
td.long {
|
|
63
|
+
white-space: normal;
|
|
64
|
+
overflow-wrap: anywhere;
|
|
65
|
+
|
|
66
|
+
/*
|
|
67
|
+
* A floor as well as a ceiling. With only the ceiling, a squeezed table shrank a long value's
|
|
68
|
+
* column to a sliver (a 100-character note became 22 lines of a few characters each) while
|
|
69
|
+
* the one-line cells kept their width. The table scrolls instead.
|
|
70
|
+
*/
|
|
71
|
+
min-width: 20ch;
|
|
72
|
+
max-width: 40ch;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/*
|
|
76
|
+
* The two marks this table carries — "this field is changing" and "this field decides which
|
|
77
|
+
* record disappears" — were weight, colour and a strike-through only. None of that reaches
|
|
78
|
+
* somebody using a screen reader, who is the one approver with no other way to tell, so each
|
|
79
|
+
* mark has words as well.
|
|
80
|
+
*/
|
|
81
|
+
.sr-only {
|
|
82
|
+
position: absolute;
|
|
83
|
+
width: 1px;
|
|
84
|
+
height: 1px;
|
|
85
|
+
overflow: hidden;
|
|
86
|
+
clip-path: inset(50%);
|
|
87
|
+
white-space: nowrap;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/*
|
|
91
|
+
* A delete shows the whole record and sends its key alone, so the fields that actually decide
|
|
92
|
+
* which record disappears are marked. Not colour alone — an underline carries to a user who
|
|
93
|
+
* cannot distinguish it.
|
|
94
|
+
*/
|
|
95
|
+
td.identifying {
|
|
96
|
+
font-weight: 600;
|
|
97
|
+
text-decoration: underline;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/*
|
|
101
|
+
* The diff, the way a code review shows one: what goes is tinted as removed and struck through,
|
|
102
|
+
* what comes in is tinted as added and bold. Only the BACKGROUND is tinted, at low alpha, from
|
|
103
|
+
* the theme's own success and error tokens (with fallbacks, as foundation-forms does), and the
|
|
104
|
+
* text keeps the normal foreground colour: coloured text on a coloured ground is where contrast
|
|
105
|
+
* fails, dark mode first. The tint is never the only signal. Strike-through, weight, the visible
|
|
106
|
+
* + and − marks and the spoken "was" and "now" all carry the same thing without colour.
|
|
107
|
+
*/
|
|
108
|
+
|
|
109
|
+
/* The mark a user's eye needs: this field is being changed. */
|
|
110
|
+
td.changed {
|
|
111
|
+
font-weight: 600;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* On its own line above the new value, so neither can push the other out of view. */
|
|
115
|
+
td.changed .was {
|
|
116
|
+
display: block;
|
|
117
|
+
font-weight: 400;
|
|
118
|
+
text-decoration: line-through;
|
|
119
|
+
background: var(--write-review-removed);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
td.changed .now {
|
|
123
|
+
display: block;
|
|
124
|
+
background: var(--write-review-added);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/* Room inside the tint, so the − and + do not sit on its edge. */
|
|
128
|
+
td.changed .was,
|
|
129
|
+
td.changed .now {
|
|
130
|
+
padding-inline: calc(var(--design-unit, 4) * 1px);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/*
|
|
134
|
+
* A row that will not be written is never tinted, not even inside a cell. For a refused row
|
|
135
|
+
* review-model already gives it no changed cells, and this is the second guard. For a row the
|
|
136
|
+
* resolved review did not approve, the − and + stay as the record of what was proposed, but
|
|
137
|
+
* without the tint that says it will happen.
|
|
138
|
+
*/
|
|
139
|
+
tr.refused td.changed .was,
|
|
140
|
+
tr.refused td.changed .now,
|
|
141
|
+
tr.unwritten td.changed .was,
|
|
142
|
+
tr.unwritten td.changed .now {
|
|
143
|
+
background: none;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/* A whole row coming in, or going. A refused row is neither, and keeps its muted look. */
|
|
147
|
+
tr.added td {
|
|
148
|
+
background: var(--write-review-added);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
tr.removed td {
|
|
152
|
+
background: var(--write-review-removed);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/*
|
|
156
|
+
* A closed review's row that was not approved says so in words — without them, a denied modify
|
|
157
|
+
* read in greyscale or by a screen reader exactly like an approved one.
|
|
158
|
+
*/
|
|
159
|
+
.not-written {
|
|
160
|
+
margin-inline-start: calc(var(--design-unit, 4) * 1.5px);
|
|
161
|
+
font-size: var(--type-ramp-minus-1-font-size, 0.875em);
|
|
162
|
+
color: var(--neutral-foreground-hint);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/* The empty placeholder: a style no row text can take, so a literal "(blank)" cannot pass for it. */
|
|
166
|
+
.blank {
|
|
167
|
+
font-style: italic;
|
|
168
|
+
font-weight: 400;
|
|
169
|
+
color: var(--neutral-foreground-hint);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.mark {
|
|
173
|
+
font-weight: 600;
|
|
174
|
+
padding-inline-end: calc(var(--design-unit, 4) * 1px);
|
|
175
|
+
user-select: none;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/* The row's + or − sits beside its checkbox, not on the baseline under it (where − reads as _). */
|
|
179
|
+
td.select {
|
|
180
|
+
white-space: nowrap;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
td.select rapid-checkbox,
|
|
184
|
+
td.select .mark {
|
|
185
|
+
vertical-align: middle;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/* A gap from the checkbox, so the mark reads as the row's sign rather than part of the box. */
|
|
189
|
+
td.select .mark {
|
|
190
|
+
margin-inline-start: calc(var(--design-unit, 4) * 1.5px);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/* The strike-through belongs to the value, not to its − mark. */
|
|
194
|
+
td.changed .was .mark {
|
|
195
|
+
display: inline-block;
|
|
196
|
+
text-decoration: none;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
tr.refused {
|
|
200
|
+
color: var(--neutral-foreground-hint);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/* A refusal is a sentence, and it spans the table: it wraps rather than running off it. */
|
|
204
|
+
.problems {
|
|
205
|
+
color: var(--error-fill-rest, #c00);
|
|
206
|
+
white-space: normal;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.actions {
|
|
210
|
+
display: flex;
|
|
211
|
+
gap: calc(var(--design-unit, 4) * 2px);
|
|
212
|
+
margin-top: calc(var(--design-unit, 4) * 2px);
|
|
213
|
+
}
|
|
214
|
+
`;
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { html, repeat, when } from '@genesislcap/web-core';
|
|
2
|
+
import { isBlankText } from '../write-payload';
|
|
3
|
+
/**
|
|
4
|
+
* What a checkbox says NOW, read from the event rather than inferred from the state.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* `@change`, not `@click`: FAST's checkbox toggles on Space in its own keypress handler, without
|
|
8
|
+
* a click, so a click handler would leave keyboard users unable to select a row.
|
|
9
|
+
*/
|
|
10
|
+
const checkedOf = (event) => event.target.checked === true;
|
|
11
|
+
/**
|
|
12
|
+
* The visible diff marker: `+` for what comes in, `−` for what goes.
|
|
13
|
+
*
|
|
14
|
+
* @remarks
|
|
15
|
+
* Real text rather than CSS `content`, so it survives greyscale and a high-contrast theme — red
|
|
16
|
+
* and green are the pair the commonest colour-vision deficiency cannot tell apart, so the tint
|
|
17
|
+
* must never be the only signal. Hidden from assistive technology because the spoken "was" and
|
|
18
|
+
* "now" already say it in words, and not selectable (`user-select: none`), so copying a value
|
|
19
|
+
* from the review copies the value and not its sign.
|
|
20
|
+
*/
|
|
21
|
+
const mark = (sign) => html `
|
|
22
|
+
<span class="mark" aria-hidden="true">${sign}</span>
|
|
23
|
+
`;
|
|
24
|
+
/**
|
|
25
|
+
* A row's place in the diff: an insert's rows are all coming in, a delete's are all going.
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* A REFUSED row gets neither, and nor does a row the resolved review did not approve. Neither will
|
|
29
|
+
* be written, and a row tinted as "added" would be the screen whose job is to show what will happen
|
|
30
|
+
* showing something that will not.
|
|
31
|
+
* A modify's rows are marked cell by cell instead, where the change actually is.
|
|
32
|
+
*/
|
|
33
|
+
const rowClass = (row, review) => {
|
|
34
|
+
var _a, _b, _c;
|
|
35
|
+
if ((_a = row.problems) === null || _a === void 0 ? void 0 : _a.length)
|
|
36
|
+
return 'refused';
|
|
37
|
+
// Once the review has resolved, only the rows the user APPROVED were going to be written. A row
|
|
38
|
+
// left unticked, or every row of a denial, kept its "added" or "removed" tint and so went on
|
|
39
|
+
// saying it would happen after it had been decided it would not.
|
|
40
|
+
if (review.resolved && !review.approved.includes(row.index))
|
|
41
|
+
return 'unwritten';
|
|
42
|
+
if (((_b = review.model) === null || _b === void 0 ? void 0 : _b.op) === 'insert')
|
|
43
|
+
return 'added';
|
|
44
|
+
if (((_c = review.model) === null || _c === void 0 ? void 0 : _c.op) === 'delete')
|
|
45
|
+
return 'removed';
|
|
46
|
+
return '';
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* A diff value, with an empty one SAID — as an element of its own, never as text.
|
|
50
|
+
*
|
|
51
|
+
* @remarks
|
|
52
|
+
* A field going from empty to set, or the other way, rendered a bare − or + on its tint, which
|
|
53
|
+
* reads as a rendering fault. The first fix wrote the TEXT "(blank)" there, and a value can be
|
|
54
|
+
* that text: a model told it cannot clear a column may write the literal `(blank)`, the review
|
|
55
|
+
* showed "being emptied", the user approved, and the column held the word. So the placeholder is
|
|
56
|
+
* its own element, styled as no row text can be (italic, in the hint colour), and spoken as
|
|
57
|
+
* "empty". A literal "(blank)" renders as the ordinary text it is.
|
|
58
|
+
*/
|
|
59
|
+
const valueOrBlank = (pick) => html `
|
|
60
|
+
${when((x) => { var _a; return !isBlankText((_a = pick(x)) !== null && _a !== void 0 ? _a : ''); }, html `
|
|
61
|
+
${(x) => pick(x)}
|
|
62
|
+
`)}${when(
|
|
63
|
+
// The payload builder's own test: text that shows nothing — a zero-width space included — is
|
|
64
|
+
// the placeholder, never a bare mark with nothing after it.
|
|
65
|
+
(x) => { var _a; return isBlankText((_a = pick(x)) !== null && _a !== void 0 ? _a : ''); }, html `
|
|
66
|
+
<span class="blank">
|
|
67
|
+
<span aria-hidden="true">(blank)</span>
|
|
68
|
+
<span class="sr-only">empty</span>
|
|
69
|
+
</span>
|
|
70
|
+
`)}
|
|
71
|
+
`;
|
|
72
|
+
/** A cell shows what the field becomes, and — when it is changing — what it is now. */
|
|
73
|
+
const cell = html `
|
|
74
|
+
<td
|
|
75
|
+
class="${(x) => [x.changed ? 'changed' : '', x.identifying ? 'identifying' : '', x.long ? 'long' : '']
|
|
76
|
+
.join(' ')
|
|
77
|
+
.trim()}"
|
|
78
|
+
title="${(x) => (x.identifying ? 'This field identifies the row being removed' : '')}"
|
|
79
|
+
>
|
|
80
|
+
${when((x) => x.identifying, html `
|
|
81
|
+
<span class="sr-only">identifies this row:</span>
|
|
82
|
+
`)}
|
|
83
|
+
${when((x) => x.changed && x.previousDisplay !== undefined, html `
|
|
84
|
+
<span class="sr-only">was</span>
|
|
85
|
+
<span class="was">${mark('−')}${valueOrBlank((x) => x.previousDisplay)}</span>
|
|
86
|
+
<span class="sr-only">now</span>
|
|
87
|
+
<span class="now">${mark('+')}${valueOrBlank((x) => x.display)}</span>
|
|
88
|
+
`)}
|
|
89
|
+
${when((x) => !(x.changed && x.previousDisplay !== undefined), html `
|
|
90
|
+
${(x) => x.display}
|
|
91
|
+
`)}
|
|
92
|
+
</td>
|
|
93
|
+
`;
|
|
94
|
+
const row = html `
|
|
95
|
+
<tr class="${(x, c) => rowClass(x, c.parent)}">
|
|
96
|
+
<td class="select">
|
|
97
|
+
<rapid-checkbox
|
|
98
|
+
aria-label="Select ${(x) => x.label}"
|
|
99
|
+
aria-describedby="${(x) => { var _a; return (((_a = x.problems) === null || _a === void 0 ? void 0 : _a.length) ? `problems-${x.index}` : ''); }}"
|
|
100
|
+
:checked="${(x, c) => c.parent.isSelected(x.index)}"
|
|
101
|
+
?disabled="${(x, c) => { var _a; return !!((_a = x.problems) === null || _a === void 0 ? void 0 : _a.length) || c.parent.resolved; }}"
|
|
102
|
+
@change="${(x, c) => c.parent.setSelected(x.index, checkedOf(c.event))}"
|
|
103
|
+
></rapid-checkbox>
|
|
104
|
+
${when((x, c) => rowClass(x, c.parent) === 'added', html `
|
|
105
|
+
${mark('+')}
|
|
106
|
+
`)}
|
|
107
|
+
${when((x, c) => rowClass(x, c.parent) === 'removed', html `
|
|
108
|
+
${mark('−')}
|
|
109
|
+
`)}
|
|
110
|
+
${when((x, c) => rowClass(x, c.parent) === 'unwritten', html `
|
|
111
|
+
<span class="not-written">not written</span>
|
|
112
|
+
`)}
|
|
113
|
+
</td>
|
|
114
|
+
${repeat((x) => x.cells, cell)}
|
|
115
|
+
</tr>
|
|
116
|
+
${when((x) => { var _a; return !!((_a = x.problems) === null || _a === void 0 ? void 0 : _a.length); }, html `
|
|
117
|
+
<tr class="refused">
|
|
118
|
+
<td></td>
|
|
119
|
+
<td class="problems" colspan="99" id="problems-${(x) => String(x.index)}">
|
|
120
|
+
${(x) => { var _a; return (_a = x.problems) === null || _a === void 0 ? void 0 : _a.join('; '); }}
|
|
121
|
+
</td>
|
|
122
|
+
</tr>
|
|
123
|
+
`)}
|
|
124
|
+
`;
|
|
125
|
+
export const WriteReviewTemplate = html `
|
|
126
|
+
${when((x) => !!x.model, html `
|
|
127
|
+
<p>
|
|
128
|
+
${(x) => { var _a; return (_a = x.model) === null || _a === void 0 ? void 0 : _a.op; }} ${(x) => { var _a; return (_a = x.model) === null || _a === void 0 ? void 0 : _a.rows.length; }} row(s) in ${(x) => { var _a; return (_a = x.model) === null || _a === void 0 ? void 0 : _a.resource; }}.
|
|
129
|
+
Nothing is written until you choose rows and select Write.
|
|
130
|
+
</p>
|
|
131
|
+
<div class="scroller">
|
|
132
|
+
<table aria-label="Rows to be written to ${(x) => { var _a; return (_a = x.model) === null || _a === void 0 ? void 0 : _a.resource; }}">
|
|
133
|
+
<thead>
|
|
134
|
+
<tr>
|
|
135
|
+
<th>
|
|
136
|
+
<rapid-checkbox
|
|
137
|
+
aria-label="Select all rows"
|
|
138
|
+
:checked="${(x) => x.allSelected}"
|
|
139
|
+
?disabled="${(x) => { var _a; return x.resolved || !((_a = x.model) === null || _a === void 0 ? void 0 : _a.selectable.length); }}"
|
|
140
|
+
@change="${(x, c) => x.setAll(checkedOf(c.event))}"
|
|
141
|
+
></rapid-checkbox>
|
|
142
|
+
</th>
|
|
143
|
+
${repeat((x) => { var _a, _b; return (_b = (_a = x.model) === null || _a === void 0 ? void 0 : _a.columns) !== null && _b !== void 0 ? _b : []; }, html `
|
|
144
|
+
<th>${(c) => c.label}</th>
|
|
145
|
+
`)}
|
|
146
|
+
</tr>
|
|
147
|
+
</thead>
|
|
148
|
+
<tbody>${repeat((x) => { var _a, _b; return (_b = (_a = x.model) === null || _a === void 0 ? void 0 : _a.rows) !== null && _b !== void 0 ? _b : []; }, row)}</tbody>
|
|
149
|
+
</table>
|
|
150
|
+
</div>
|
|
151
|
+
<div class="actions">
|
|
152
|
+
<rapid-button
|
|
153
|
+
appearance="accent"
|
|
154
|
+
?disabled="${(x) => !x.writable}"
|
|
155
|
+
@click="${(x) => x.write()}"
|
|
156
|
+
>
|
|
157
|
+
Write ${(x) => (x.rowsSelected ? `${x.rowsSelected} row(s)` : '')}
|
|
158
|
+
</rapid-button>
|
|
159
|
+
${when((x) => !x.denying, html `
|
|
160
|
+
<rapid-button ?disabled="${(x) => x.resolved}" @click="${(x) => x.startDeny()}">
|
|
161
|
+
Deny
|
|
162
|
+
</rapid-button>
|
|
163
|
+
`)}
|
|
164
|
+
${when((x) => x.denying, html `
|
|
165
|
+
<rapid-text-field
|
|
166
|
+
placeholder="Why not? (optional)"
|
|
167
|
+
:value="${(x) => x.denyReason}"
|
|
168
|
+
@input="${(x, c) => {
|
|
169
|
+
x.setDenyReason(c.event.target.value);
|
|
170
|
+
return true;
|
|
171
|
+
}}"
|
|
172
|
+
></rapid-text-field>
|
|
173
|
+
<rapid-button ?disabled="${(x) => x.resolved}" @click="${(x) => x.confirmDeny()}">
|
|
174
|
+
Confirm deny
|
|
175
|
+
</rapid-button>
|
|
176
|
+
`)}
|
|
177
|
+
</div>
|
|
178
|
+
`)}
|
|
179
|
+
${when((x) => x.resolved, html `
|
|
180
|
+
<p class="closed">${(x) => x.closedSummary}</p>
|
|
181
|
+
`)}
|
|
182
|
+
`;
|