blixify-ui-web 1.2.249 → 1.2.250
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/lib/components/data/dataTemplate/index.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/index.js +14 -4
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/display/newTable/index.d.ts +2 -1
- package/lib/components/display/newTable/index.d.ts.map +1 -1
- package/lib/components/display/newTable/index.js +396 -108
- package/lib/components/display/newTable/index.js.map +1 -1
- package/lib/components/display/newTable/rowRendering.d.ts +66 -0
- package/lib/components/display/newTable/rowRendering.d.ts.map +1 -0
- package/lib/components/display/newTable/rowRendering.js +219 -0
- package/lib/components/display/newTable/rowRendering.js.map +1 -0
- package/lib/components/display/recordActions/index.d.ts +2 -0
- package/lib/components/display/recordActions/index.d.ts.map +1 -1
- package/lib/components/display/recordActions/index.js +8 -2
- package/lib/components/display/recordActions/index.js.map +1 -1
- package/lib/tail.css +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface NewTableHoverCellProps {
|
|
3
|
+
editing: boolean;
|
|
4
|
+
renderRead: () => React.ReactElement<any>;
|
|
5
|
+
renderLive: () => React.ReactElement<any>;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* An editable cell that turns into its input while the pointer is over it.
|
|
9
|
+
* The hover is kept here rather than on the table, so moving the pointer
|
|
10
|
+
* redraws this one cell instead of every loaded row.
|
|
11
|
+
*/
|
|
12
|
+
export declare const NewTableHoverCell: (props: NewTableHoverCellProps) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
13
|
+
interface NewTableMemoRowProps {
|
|
14
|
+
row: any;
|
|
15
|
+
spaceRow: any;
|
|
16
|
+
index: number;
|
|
17
|
+
groupAccent?: string;
|
|
18
|
+
dropGroupId?: string;
|
|
19
|
+
isSelected: boolean;
|
|
20
|
+
editValue?: any;
|
|
21
|
+
tableVersion: number;
|
|
22
|
+
render: () => React.ReactElement;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* One table row, drawn again only when its own record, selection or edit
|
|
26
|
+
* value changes, or when the table version does. Loading the next page or
|
|
27
|
+
* typing elsewhere on the page leaves rows already on screen alone.
|
|
28
|
+
*/
|
|
29
|
+
export declare const NewTableMemoRow: React.MemoExoticComponent<(props: NewTableMemoRowProps) => React.ReactElement<unknown, string | React.JSXElementConstructor<any>>>;
|
|
30
|
+
export declare const handleGetIdentity: (value: unknown) => string;
|
|
31
|
+
/**
|
|
32
|
+
* A string that changes when the value's content changes. A parent rebuilds
|
|
33
|
+
* its column list and settings on every redraw, so comparing them by identity
|
|
34
|
+
* would redraw every row each time; their content is compared instead.
|
|
35
|
+
* Functions are left out — the table reads its props through the latest
|
|
36
|
+
* render, so a row never calls an old one. React elements count as one value,
|
|
37
|
+
* and anything that is not a plain object or array is compared by identity.
|
|
38
|
+
*/
|
|
39
|
+
export declare const handleFingerprint: (value: unknown, depth?: number) => string;
|
|
40
|
+
export declare const VIRTUAL_MIN_ROWS = 120;
|
|
41
|
+
export declare const VIRTUAL_OVERSCAN_PX = 800;
|
|
42
|
+
export declare const VIRTUAL_CHUNK = 20;
|
|
43
|
+
export declare const VIRTUAL_INITIAL_ROWS = 40;
|
|
44
|
+
export declare const VIRTUAL_DEFAULT_ROW_HEIGHT = 41;
|
|
45
|
+
/**
|
|
46
|
+
* Each row's top, counted from the group's first row, plus the total height
|
|
47
|
+
* as the last entry. A row not measured yet takes the estimate.
|
|
48
|
+
*/
|
|
49
|
+
export declare const handleBuildRowOffsets: (rowIds: string[], heights: Map<string, number>, estimate: number) => number[];
|
|
50
|
+
/**
|
|
51
|
+
* The rows [start, end) a group draws, given where its first row would sit
|
|
52
|
+
* on screen and the screen's top and bottom, both widened by the overscan.
|
|
53
|
+
* Rounded out to whole chunks.
|
|
54
|
+
*/
|
|
55
|
+
export declare const handleGetVisibleRange: (offsets: number[], groupTop: number, viewTop: number, viewBottom: number) => [number, number];
|
|
56
|
+
/**
|
|
57
|
+
* The drawn rows of a group as runs, with the gaps between them as heights —
|
|
58
|
+
* the visible range plus any row that must stay drawn (the one being edited).
|
|
59
|
+
*/
|
|
60
|
+
export declare const handleBuildRowSegments: (offsets: number[], range: [number, number], keepIndexes: number[]) => ({
|
|
61
|
+
gap: number;
|
|
62
|
+
} | {
|
|
63
|
+
rows: number[];
|
|
64
|
+
})[];
|
|
65
|
+
export {};
|
|
66
|
+
//# sourceMappingURL=rowRendering.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rowRendering.d.ts","sourceRoot":"","sources":["../../../../src/components/display/newTable/rowRendering.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAMxC,UAAU,sBAAsB;IAG9B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAC1C,UAAU,EAAE,MAAM,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;CAC3C;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,UAAW,sBAAsB,uEAQ9D,CAAC;AAMF,UAAU,oBAAoB;IAC5B,GAAG,EAAE,GAAG,CAAC;IACT,QAAQ,EAAE,GAAG,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IAEpB,SAAS,CAAC,EAAE,GAAG,CAAC;IAGhB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,KAAK,CAAC,YAAY,CAAC;CAClC;AASD;;;;GAIG;AACH,eAAO,MAAM,eAAe,oCAClB,oBAAoB,4EAa7B,CAAC;AAUF,eAAO,MAAM,iBAAiB,UAAW,OAAO,KAAG,MAUlD,CAAC;AAKF;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,UAAW,OAAO,qBAAc,MAsB7D,CAAC;AAQF,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAGpC,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAGvC,eAAO,MAAM,aAAa,KAAK,CAAC;AAEhC,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAE7C;;;GAGG;AACH,eAAO,MAAM,qBAAqB,WACxB,MAAM,EAAE,WACP,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,YAClB,MAAM,KACf,MAAM,EAOR,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,YACvB,MAAM,EAAE,YACP,MAAM,WACP,MAAM,cACH,MAAM,KACjB,CAAC,MAAM,EAAE,MAAM,CAoBjB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,YACxB,MAAM,EAAE,SACV,CAAC,MAAM,EAAE,MAAM,CAAC,eACV,MAAM,EAAE,KACpB,CAAC;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,EAwBxC,CAAC"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.handleBuildRowSegments = exports.handleGetVisibleRange = exports.handleBuildRowOffsets = exports.VIRTUAL_DEFAULT_ROW_HEIGHT = exports.VIRTUAL_INITIAL_ROWS = exports.VIRTUAL_CHUNK = exports.VIRTUAL_OVERSCAN_PX = exports.VIRTUAL_MIN_ROWS = exports.handleFingerprint = exports.handleGetIdentity = exports.NewTableMemoRow = exports.NewTableHoverCell = void 0;
|
|
27
|
+
var react_1 = __importStar(require("react"));
|
|
28
|
+
/**
|
|
29
|
+
* An editable cell that turns into its input while the pointer is over it.
|
|
30
|
+
* The hover is kept here rather than on the table, so moving the pointer
|
|
31
|
+
* redraws this one cell instead of every loaded row.
|
|
32
|
+
*/
|
|
33
|
+
var NewTableHoverCell = function (props) {
|
|
34
|
+
var _a = (0, react_1.useState)(false), hovered = _a[0], setHovered = _a[1];
|
|
35
|
+
var cell = hovered || props.editing ? props.renderLive() : props.renderRead();
|
|
36
|
+
return react_1.default.cloneElement(cell, {
|
|
37
|
+
onMouseEnter: function () { return setHovered(true); },
|
|
38
|
+
onMouseLeave: function () { return setHovered(false); },
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
exports.NewTableHoverCell = NewTableHoverCell;
|
|
42
|
+
// INFO: e2e and stories count row draws through this global when they set it
|
|
43
|
+
var handleCountRowDraw = function () {
|
|
44
|
+
if (typeof window === "undefined")
|
|
45
|
+
return;
|
|
46
|
+
var counter = window.__newTableRowDraws;
|
|
47
|
+
if (counter && typeof counter.count === "number")
|
|
48
|
+
counter.count += 1;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* One table row, drawn again only when its own record, selection or edit
|
|
52
|
+
* value changes, or when the table version does. Loading the next page or
|
|
53
|
+
* typing elsewhere on the page leaves rows already on screen alone.
|
|
54
|
+
*/
|
|
55
|
+
exports.NewTableMemoRow = react_1.default.memo(function (props) {
|
|
56
|
+
handleCountRowDraw();
|
|
57
|
+
return props.render();
|
|
58
|
+
}, function (previous, next) {
|
|
59
|
+
return previous.row === next.row &&
|
|
60
|
+
previous.spaceRow === next.spaceRow &&
|
|
61
|
+
previous.index === next.index &&
|
|
62
|
+
previous.groupAccent === next.groupAccent &&
|
|
63
|
+
previous.dropGroupId === next.dropGroupId &&
|
|
64
|
+
previous.isSelected === next.isSelected &&
|
|
65
|
+
previous.editValue === next.editValue &&
|
|
66
|
+
previous.tableVersion === next.tableVersion;
|
|
67
|
+
});
|
|
68
|
+
//=====================================================================================
|
|
69
|
+
// SECTION: Table version
|
|
70
|
+
//=====================================================================================
|
|
71
|
+
var identityIds = new WeakMap();
|
|
72
|
+
var nextIdentityId = 1;
|
|
73
|
+
// INFO: a stable number per object, for values compared by identity
|
|
74
|
+
var handleGetIdentity = function (value) {
|
|
75
|
+
if (value === null || value === undefined)
|
|
76
|
+
return String(value);
|
|
77
|
+
if (typeof value !== "object" && typeof value !== "function")
|
|
78
|
+
return String(value);
|
|
79
|
+
var id = identityIds.get(value);
|
|
80
|
+
if (!id) {
|
|
81
|
+
id = nextIdentityId++;
|
|
82
|
+
identityIds.set(value, id);
|
|
83
|
+
}
|
|
84
|
+
return "#".concat(id);
|
|
85
|
+
};
|
|
86
|
+
exports.handleGetIdentity = handleGetIdentity;
|
|
87
|
+
var MAX_FINGERPRINT_DEPTH = 4;
|
|
88
|
+
var MAX_FINGERPRINT_ITEMS = 200;
|
|
89
|
+
/**
|
|
90
|
+
* A string that changes when the value's content changes. A parent rebuilds
|
|
91
|
+
* its column list and settings on every redraw, so comparing them by identity
|
|
92
|
+
* would redraw every row each time; their content is compared instead.
|
|
93
|
+
* Functions are left out — the table reads its props through the latest
|
|
94
|
+
* render, so a row never calls an old one. React elements count as one value,
|
|
95
|
+
* and anything that is not a plain object or array is compared by identity.
|
|
96
|
+
*/
|
|
97
|
+
var handleFingerprint = function (value, depth) {
|
|
98
|
+
if (depth === void 0) { depth = 0; }
|
|
99
|
+
if (value === null || value === undefined)
|
|
100
|
+
return String(value);
|
|
101
|
+
var type = typeof value;
|
|
102
|
+
if (type === "function")
|
|
103
|
+
return "fn";
|
|
104
|
+
if (type !== "object")
|
|
105
|
+
return "".concat(type, ":").concat(String(value));
|
|
106
|
+
if (value instanceof Date)
|
|
107
|
+
return "date:".concat(value.getTime());
|
|
108
|
+
if (react_1.default.isValidElement(value))
|
|
109
|
+
return "el";
|
|
110
|
+
if (depth >= MAX_FINGERPRINT_DEPTH)
|
|
111
|
+
return (0, exports.handleGetIdentity)(value);
|
|
112
|
+
if (Array.isArray(value)) {
|
|
113
|
+
if (value.length > MAX_FINGERPRINT_ITEMS)
|
|
114
|
+
return (0, exports.handleGetIdentity)(value);
|
|
115
|
+
return "[".concat(value.map(function (each) { return (0, exports.handleFingerprint)(each, depth + 1); }).join(","), "]");
|
|
116
|
+
}
|
|
117
|
+
var prototype = Object.getPrototypeOf(value);
|
|
118
|
+
if (prototype !== Object.prototype && prototype !== null)
|
|
119
|
+
return (0, exports.handleGetIdentity)(value);
|
|
120
|
+
var keys = Object.keys(value).sort();
|
|
121
|
+
if (keys.length > MAX_FINGERPRINT_ITEMS)
|
|
122
|
+
return (0, exports.handleGetIdentity)(value);
|
|
123
|
+
return "{".concat(keys
|
|
124
|
+
.map(function (key) { return "".concat(key, ":").concat((0, exports.handleFingerprint)(value[key], depth + 1)); })
|
|
125
|
+
.join(","), "}");
|
|
126
|
+
};
|
|
127
|
+
exports.handleFingerprint = handleFingerprint;
|
|
128
|
+
//=====================================================================================
|
|
129
|
+
// SECTION: Row virtualisation
|
|
130
|
+
//=====================================================================================
|
|
131
|
+
// INFO: a group with fewer loaded rows than this draws them all — small
|
|
132
|
+
// tables behave exactly as before
|
|
133
|
+
exports.VIRTUAL_MIN_ROWS = 120;
|
|
134
|
+
// INFO: rows drawn beyond the screen's edge, so a quick scroll shows rows
|
|
135
|
+
// rather than blank space
|
|
136
|
+
exports.VIRTUAL_OVERSCAN_PX = 800;
|
|
137
|
+
// INFO: the drawn range moves in steps of this many rows, so a scroll of a
|
|
138
|
+
// few pixels does not redraw
|
|
139
|
+
exports.VIRTUAL_CHUNK = 20;
|
|
140
|
+
// INFO: rows drawn before the first measure
|
|
141
|
+
exports.VIRTUAL_INITIAL_ROWS = 40;
|
|
142
|
+
exports.VIRTUAL_DEFAULT_ROW_HEIGHT = 41;
|
|
143
|
+
/**
|
|
144
|
+
* Each row's top, counted from the group's first row, plus the total height
|
|
145
|
+
* as the last entry. A row not measured yet takes the estimate.
|
|
146
|
+
*/
|
|
147
|
+
var handleBuildRowOffsets = function (rowIds, heights, estimate) {
|
|
148
|
+
var _a;
|
|
149
|
+
var offsets = new Array(rowIds.length + 1);
|
|
150
|
+
offsets[0] = 0;
|
|
151
|
+
for (var index = 0; index < rowIds.length; index++)
|
|
152
|
+
offsets[index + 1] =
|
|
153
|
+
offsets[index] + ((_a = heights.get(rowIds[index])) !== null && _a !== void 0 ? _a : estimate);
|
|
154
|
+
return offsets;
|
|
155
|
+
};
|
|
156
|
+
exports.handleBuildRowOffsets = handleBuildRowOffsets;
|
|
157
|
+
/**
|
|
158
|
+
* The rows [start, end) a group draws, given where its first row would sit
|
|
159
|
+
* on screen and the screen's top and bottom, both widened by the overscan.
|
|
160
|
+
* Rounded out to whole chunks.
|
|
161
|
+
*/
|
|
162
|
+
var handleGetVisibleRange = function (offsets, groupTop, viewTop, viewBottom) {
|
|
163
|
+
var count = offsets.length - 1;
|
|
164
|
+
if (count <= 0)
|
|
165
|
+
return [0, 0];
|
|
166
|
+
var top = viewTop - groupTop;
|
|
167
|
+
var bottom = viewBottom - groupTop;
|
|
168
|
+
if (bottom <= 0)
|
|
169
|
+
return [0, Math.min(count, exports.VIRTUAL_CHUNK)];
|
|
170
|
+
if (top >= offsets[count]) {
|
|
171
|
+
var start_1 = Math.max(0, Math.floor((count - exports.VIRTUAL_CHUNK) / exports.VIRTUAL_CHUNK) * exports.VIRTUAL_CHUNK);
|
|
172
|
+
return [start_1, count];
|
|
173
|
+
}
|
|
174
|
+
var start = 0;
|
|
175
|
+
while (start < count && offsets[start + 1] <= top)
|
|
176
|
+
start++;
|
|
177
|
+
var end = start;
|
|
178
|
+
while (end < count && offsets[end] < bottom)
|
|
179
|
+
end++;
|
|
180
|
+
start = Math.floor(start / exports.VIRTUAL_CHUNK) * exports.VIRTUAL_CHUNK;
|
|
181
|
+
end = Math.min(count, Math.ceil(end / exports.VIRTUAL_CHUNK) * exports.VIRTUAL_CHUNK);
|
|
182
|
+
return [start, Math.max(end, start + 1)];
|
|
183
|
+
};
|
|
184
|
+
exports.handleGetVisibleRange = handleGetVisibleRange;
|
|
185
|
+
/**
|
|
186
|
+
* The drawn rows of a group as runs, with the gaps between them as heights —
|
|
187
|
+
* the visible range plus any row that must stay drawn (the one being edited).
|
|
188
|
+
*/
|
|
189
|
+
var handleBuildRowSegments = function (offsets, range, keepIndexes) {
|
|
190
|
+
var count = offsets.length - 1;
|
|
191
|
+
var drawn = new Set();
|
|
192
|
+
for (var index = range[0]; index < Math.min(range[1], count); index++)
|
|
193
|
+
drawn.add(index);
|
|
194
|
+
keepIndexes.forEach(function (index) {
|
|
195
|
+
if (index >= 0 && index < count)
|
|
196
|
+
drawn.add(index);
|
|
197
|
+
});
|
|
198
|
+
var sorted = Array.from(drawn).sort(function (a, b) { return a - b; });
|
|
199
|
+
var segments = [];
|
|
200
|
+
var cursor = 0;
|
|
201
|
+
var run = [];
|
|
202
|
+
sorted.forEach(function (index) {
|
|
203
|
+
if (index !== cursor) {
|
|
204
|
+
if (run.length)
|
|
205
|
+
segments.push({ rows: run });
|
|
206
|
+
run = [];
|
|
207
|
+
segments.push({ gap: offsets[index] - offsets[cursor] });
|
|
208
|
+
}
|
|
209
|
+
run.push(index);
|
|
210
|
+
cursor = index + 1;
|
|
211
|
+
});
|
|
212
|
+
if (run.length)
|
|
213
|
+
segments.push({ rows: run });
|
|
214
|
+
if (cursor < count)
|
|
215
|
+
segments.push({ gap: offsets[count] - offsets[cursor] });
|
|
216
|
+
return segments;
|
|
217
|
+
};
|
|
218
|
+
exports.handleBuildRowSegments = handleBuildRowSegments;
|
|
219
|
+
//# sourceMappingURL=rowRendering.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rowRendering.js","sourceRoot":"","sources":["../../../../src/components/display/newTable/rowRendering.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAwC;AAcxC;;;;GAIG;AACI,IAAM,iBAAiB,GAAG,UAAC,KAA6B;IACvD,IAAA,KAAwB,IAAA,gBAAQ,EAAC,KAAK,CAAC,EAAtC,OAAO,QAAA,EAAE,UAAU,QAAmB,CAAC;IAC9C,IAAM,IAAI,GACR,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;IACrE,OAAO,eAAK,CAAC,YAAY,CAAC,IAAI,EAAE;QAC9B,YAAY,EAAE,cAAM,OAAA,UAAU,CAAC,IAAI,CAAC,EAAhB,CAAgB;QACpC,YAAY,EAAE,cAAM,OAAA,UAAU,CAAC,KAAK,CAAC,EAAjB,CAAiB;KACtC,CAAC,CAAC;AACL,CAAC,CAAC;AARW,QAAA,iBAAiB,qBAQ5B;AAqBF,6EAA6E;AAC7E,IAAM,kBAAkB,GAAG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A,CAAC,GAAG,CAAC,EAAL,CAAK,CAAC,CAAC;IACvD,IAAM,QAAQ,GAA6C,EAAE,CAAC;IAC9D,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,IAAI,GAAG,GAAa,EAAE,CAAC;IACvB,MAAM,CAAC,OAAO,CAAC,UAAC,KAAK;QACnB,IAAI,KAAK,KAAK,MAAM,EAAE,CAAC;YACrB,IAAI,GAAG,CAAC,MAAM;gBAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;YAC7C,GAAG,GAAG,EAAE,CAAC;YACT,QAAQ,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC3D,CAAC;QACD,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAChB,MAAM,GAAG,KAAK,GAAG,CAAC,CAAC;IACrB,CAAC,CAAC,CAAC;IACH,IAAI,GAAG,CAAC,MAAM;QAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;IAC7C,IAAI,MAAM,GAAG,KAAK;QAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC7E,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AA5BW,QAAA,sBAAsB,0BA4BjC"}
|
|
@@ -2,9 +2,11 @@ import React from "react";
|
|
|
2
2
|
export interface RecordActionsProps {
|
|
3
3
|
id: string;
|
|
4
4
|
onEdit?: (id: string) => void;
|
|
5
|
+
onOpen?: (id: string) => void;
|
|
5
6
|
onActivity?: (id: string) => void;
|
|
6
7
|
commentCount?: number;
|
|
7
8
|
className?: string;
|
|
9
|
+
style?: React.CSSProperties;
|
|
8
10
|
}
|
|
9
11
|
export declare const RecordActions: (props: RecordActionsProps) => React.JSX.Element | null;
|
|
10
12
|
export default RecordActions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/display/recordActions/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/display/recordActions/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IAEX,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAG9B,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAE9B,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAElC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAQD,eAAO,MAAM,aAAa,UAAW,kBAAkB,6BA8EtD,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -12,7 +12,7 @@ var buttonClassName = "relative inline-flex h-9 w-9 shrink-0 items-center justif
|
|
|
12
12
|
// the row taller.
|
|
13
13
|
var RecordActions = function (props) {
|
|
14
14
|
var _a;
|
|
15
|
-
if (!props.onEdit && !props.onActivity)
|
|
15
|
+
if (!props.onEdit && !props.onOpen && !props.onActivity)
|
|
16
16
|
return null;
|
|
17
17
|
// INFO: the actions sit inside a row link and a draggable card, so a press
|
|
18
18
|
// must neither follow the link, open the record nor start a drag
|
|
@@ -20,13 +20,19 @@ var RecordActions = function (props) {
|
|
|
20
20
|
event.preventDefault();
|
|
21
21
|
event.stopPropagation();
|
|
22
22
|
};
|
|
23
|
-
return (react_1.default.createElement("span", { "data-testid": "record-actions", className: "inline-flex shrink-0 items-center ".concat((_a = props.className) !== null && _a !== void 0 ? _a : ""), onPointerDown: function (event) { return event.stopPropagation(); }, onMouseDown: function (event) { return event.stopPropagation(); } },
|
|
23
|
+
return (react_1.default.createElement("span", { "data-testid": "record-actions", className: "inline-flex shrink-0 items-center ".concat((_a = props.className) !== null && _a !== void 0 ? _a : ""), style: props.style, onPointerDown: function (event) { return event.stopPropagation(); }, onMouseDown: function (event) { return event.stopPropagation(); } },
|
|
24
24
|
props.onEdit && (react_1.default.createElement("button", { type: "button", "aria-label": "Edit ".concat(props.id), "data-testid": "record-edit-btn", className: buttonClassName, onClick: function (event) {
|
|
25
25
|
var _a;
|
|
26
26
|
handleStop(event);
|
|
27
27
|
(_a = props.onEdit) === null || _a === void 0 ? void 0 : _a.call(props, props.id);
|
|
28
28
|
} },
|
|
29
29
|
react_1.default.createElement(outline_1.PencilSquareIcon, { className: "h-5 w-5", "aria-hidden": "true" }))),
|
|
30
|
+
props.onOpen && (react_1.default.createElement("button", { type: "button", "aria-label": "Open ".concat(props.id), "data-testid": "record-open-btn", className: buttonClassName, onClick: function (event) {
|
|
31
|
+
var _a;
|
|
32
|
+
handleStop(event);
|
|
33
|
+
(_a = props.onOpen) === null || _a === void 0 ? void 0 : _a.call(props, props.id);
|
|
34
|
+
} },
|
|
35
|
+
react_1.default.createElement(outline_1.ChevronRightIcon, { className: "h-5 w-5", "aria-hidden": "true" }))),
|
|
30
36
|
props.onActivity && (react_1.default.createElement("button", { type: "button", "aria-label": props.commentCount
|
|
31
37
|
? "Open activity for ".concat(props.id, ", ").concat(props.commentCount, " comments")
|
|
32
38
|
: "Open activity for ".concat(props.id), "data-testid": "record-activity-btn", className: buttonClassName, onClick: function (event) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/display/recordActions/index.tsx"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/display/recordAct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