@prt-ts/fluent-react-table-v2 9.41.0-build.2.0 → 9.41.0-build.4.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/index.js +1231 -164
- package/package.json +2 -3
- package/src/lib/components/filters/FilterDrawer.d.ts +4 -3
- package/src/lib/components/grid-header/GridHeader.d.ts +3 -4
- package/src/lib/components/reducer.d.ts +17 -0
- package/src/lib/components/table/useTableStaticStyles.d.ts +1 -1
- package/src/lib/components/tbody/TableBody.d.ts +11 -0
- package/src/lib/components/tbody/TableCell.d.ts +7 -0
- package/src/lib/components/tbody/TableRow.d.ts +8 -0
- package/src/lib/components/tbody/index.d.ts +3 -0
- package/src/lib/components/tbody/useTableBodyStyles.d.ts +1 -0
- package/src/lib/components/thead/HeaderCell.d.ts +4 -5
- package/src/lib/components/thead/HeaderRow.d.ts +10 -0
- package/src/lib/components/thead/TableHeader.d.ts +9 -0
- package/src/lib/components/thead/index.d.ts +2 -0
- package/src/lib/components/thead/useTableHeaderStyles.d.ts +1 -0
- package/src/lib/components/views/ViewsDrawer.d.ts +3 -2
- package/src/lib/index.d.ts +6 -1
package/index.js
CHANGED
|
@@ -3,8 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
4
|
import { useDrop, useDrag, DndProvider } from 'react-dnd';
|
|
5
5
|
import { HTML5Backend } from 'react-dnd-html5-backend';
|
|
6
|
-
import { makeStaticStyles, makeStyles, shorthands, tokens, useId, Dropdown, Option, Input, Button, Divider, Popover, PopoverTrigger, Tooltip, PopoverSurface, MenuGroupHeader, Checkbox, RadioGroup, Radio, Field, InlineDrawer, DrawerHeader, DrawerHeaderTitle, DrawerBody, Caption1Stronger, Menu, MenuTrigger, MenuButton, MenuPopover, MenuList, MenuGroup, MenuItem, MenuDivider,
|
|
7
|
-
import { PreviousRegular, ArrowPreviousFilled, ArrowNextFilled, NextRegular, bundleIcon, SaveFilled, SaveRegular, TableSimpleCheckmarkFilled, TableSimpleCheckmarkRegular, SearchFilled, SearchRegular, FilterFilled, FilterRegular, CodeTextOff16Filled, CodeTextOff16Regular, ColumnEditFilled, ColumnEditRegular, GroupFilled, GroupRegular, ChevronRightFilled, ChevronRightRegular, ChevronDownRegular, ChevronDownFilled, DragFilled, DragRegular, Album24Regular, Search24Regular, FilterDismissFilled, Dismiss24Regular, ArrowSortDown20Filled, ArrowSortDown20Regular, ArrowSortUp20Filled, ArrowSortUp20Regular, GroupListRegular, PinRegular, TextSortAscendingFilled, TextSortDescendingFilled, GroupDismissFilled, ArrowStepInLeftRegular, ArrowStepInRightRegular, PinOffRegular, DocumentSearch24Regular, Save20Filled, ViewDesktop20Filled, ViewDesktop20Regular } from '@fluentui/react-icons';
|
|
6
|
+
import { makeStaticStyles, makeStyles, shorthands, tokens, useId, Dropdown, Option, Input, Button, Divider, Popover, PopoverTrigger, Tooltip, PopoverSurface, MenuGroupHeader, Checkbox, RadioGroup, Radio, Field, InlineDrawer, DrawerHeader, DrawerHeaderTitle, DrawerBody, Caption1Stronger, DrawerFooter, mergeClasses as mergeClasses$1, Menu, MenuTrigger, MenuButton, MenuPopover, MenuList, MenuGroup, MenuItem, MenuDivider, Skeleton, SkeletonItem, Subtitle2Stronger, MenuItemRadio } from '@fluentui/react-components';
|
|
8
7
|
import { useReactTable, getCoreRowModel, getPaginationRowModel, getSortedRowModel, getFilteredRowModel, getGroupedRowModel, getExpandedRowModel, getFacetedUniqueValues, getFacetedMinMaxValues, flexRender } from '@tanstack/react-table';
|
|
9
8
|
export { createColumnHelper } from '@tanstack/react-table';
|
|
10
9
|
import { useVirtual } from 'react-virtual';
|
|
@@ -35,19 +34,6 @@ const useTableStaticStyles = makeStyles({
|
|
|
35
34
|
width: "100%",
|
|
36
35
|
borderCollapse: "collapse",
|
|
37
36
|
},
|
|
38
|
-
tHead: Object.assign(Object.assign({}, shorthands.padding("0px", "0px", "0px", "0px")), { zIndex: 1, backgroundColor: tokens.colorPaletteAnchorBackground2, color: tokens.colorNeutralForeground1, position: "sticky", top: 0, width: "100%", boxShadow: tokens.shadow2 }),
|
|
39
|
-
tHeadRow: Object.assign(Object.assign({}, shorthands.padding("0px", "0px", "0px", "0px")), shorthands.borderBottom(tokens.strokeWidthThickest, "solid", tokens.colorNeutralStroke1)),
|
|
40
|
-
tBody: Object.assign(Object.assign({}, shorthands.padding("0px", "0px", "0px", "0px")), { zIndex: 0 }),
|
|
41
|
-
tBodyRow: Object.assign(Object.assign(Object.assign({}, shorthands.padding("0px", "0px", "0px", "0px")), shorthands.borderBottom(tokens.strokeWidthThin, "solid", tokens.colorNeutralStroke1)), { ":nth-child(even)": {
|
|
42
|
-
backgroundColor: tokens.colorNeutralBackground2,
|
|
43
|
-
}, ":hover": {
|
|
44
|
-
backgroundColor: tokens.colorNeutralBackground2Hover,
|
|
45
|
-
} }),
|
|
46
|
-
tBodySelectedRow: Object.assign(Object.assign({ backgroundColor: tokens.colorBrandBackground2 }, shorthands.borderBottom(tokens.strokeWidthThin, "solid", tokens.colorNeutralStroke1)), { ":hover": {
|
|
47
|
-
backgroundColor: tokens.colorBrandBackground2Hover,
|
|
48
|
-
} }),
|
|
49
|
-
tBodyGroupedRow: Object.assign({ backgroundColor: tokens.colorNeutralBackground2 }, shorthands.borderBottom(tokens.strokeWidthThin, "solid", tokens.colorNeutralStroke1)),
|
|
50
|
-
tBodyCell: Object.assign(Object.assign({ backgroundColor: "transparent" }, shorthands.padding("2px", "4px")), { minHeight: "35px", height: "35px" }),
|
|
51
37
|
tFoot: {
|
|
52
38
|
backgroundColor: tokens.colorNeutralBackground1,
|
|
53
39
|
color: tokens.colorNeutralForeground1,
|
|
@@ -94,6 +80,999 @@ const usePaginationStyle = makeStyles({
|
|
|
94
80
|
},
|
|
95
81
|
});
|
|
96
82
|
|
|
83
|
+
const IconDirectionContext = React.createContext(undefined);
|
|
84
|
+
const IconDirectionContextDefaultValue = {};
|
|
85
|
+
IconDirectionContext.Provider;
|
|
86
|
+
const useIconContext = () => React.useContext(IconDirectionContext) ? React.useContext(IconDirectionContext) : IconDirectionContextDefaultValue;
|
|
87
|
+
|
|
88
|
+
// ----
|
|
89
|
+
// Heads up!
|
|
90
|
+
// These constants are global and will be shared between Griffel instances.
|
|
91
|
+
// Any change in them should happen only in a MAJOR version. If it happens,
|
|
92
|
+
// please change "__NAMESPACE_PREFIX__" to include a version.
|
|
93
|
+
const __GLOBAL__ = typeof window === 'undefined' ? global : window;
|
|
94
|
+
const __NAMESPACE_PREFIX__ = '@griffel/';
|
|
95
|
+
function getGlobalVar(name, defaultValue) {
|
|
96
|
+
if (!__GLOBAL__[Symbol.for(__NAMESPACE_PREFIX__ + name)]) {
|
|
97
|
+
__GLOBAL__[Symbol.for(__NAMESPACE_PREFIX__ + name)] = defaultValue;
|
|
98
|
+
}
|
|
99
|
+
return __GLOBAL__[Symbol.for(__NAMESPACE_PREFIX__ + name)];
|
|
100
|
+
}
|
|
101
|
+
/** @internal */
|
|
102
|
+
const DEBUG_RESET_CLASSES = /*#__PURE__*/getGlobalVar('DEBUG_RESET_CLASSES', {});
|
|
103
|
+
/** @internal */
|
|
104
|
+
const DEFINITION_LOOKUP_TABLE = /*#__PURE__*/getGlobalVar('DEFINITION_LOOKUP_TABLE', {});
|
|
105
|
+
// ----
|
|
106
|
+
/** @internal */
|
|
107
|
+
const DATA_BUCKET_ATTR = 'data-make-styles-bucket';
|
|
108
|
+
/** @internal */
|
|
109
|
+
const RESET_HASH_PREFIX = 'r';
|
|
110
|
+
/** @internal */
|
|
111
|
+
const SEQUENCE_HASH_LENGTH = 7;
|
|
112
|
+
/** @internal */
|
|
113
|
+
const SEQUENCE_PREFIX = '___';
|
|
114
|
+
/** @internal */
|
|
115
|
+
const DEBUG_SEQUENCE_SEPARATOR = '_';
|
|
116
|
+
/** @internal */
|
|
117
|
+
const SEQUENCE_SIZE = process.env.NODE_ENV === 'production' ? SEQUENCE_PREFIX.length + SEQUENCE_HASH_LENGTH : SEQUENCE_PREFIX.length + SEQUENCE_HASH_LENGTH + DEBUG_SEQUENCE_SEPARATOR.length + SEQUENCE_HASH_LENGTH;
|
|
118
|
+
// indexes for values in LookupItem tuple
|
|
119
|
+
/** @internal */
|
|
120
|
+
const LOOKUP_DEFINITIONS_INDEX = 0;
|
|
121
|
+
/** @internal */
|
|
122
|
+
const LOOKUP_DIR_INDEX = 1;
|
|
123
|
+
|
|
124
|
+
/* eslint-disable */
|
|
125
|
+
// Inspired by https://github.com/garycourt/murmurhash-js
|
|
126
|
+
// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86
|
|
127
|
+
function murmur2(str) {
|
|
128
|
+
// 'm' and 'r' are mixing constants generated offline.
|
|
129
|
+
// They're not really 'magic', they just happen to work well.
|
|
130
|
+
// const m = 0x5bd1e995;
|
|
131
|
+
// const r = 24;
|
|
132
|
+
// Initialize the hash
|
|
133
|
+
var h = 0; // Mix 4 bytes at a time into the hash
|
|
134
|
+
|
|
135
|
+
var k,
|
|
136
|
+
i = 0,
|
|
137
|
+
len = str.length;
|
|
138
|
+
|
|
139
|
+
for (; len >= 4; ++i, len -= 4) {
|
|
140
|
+
k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
|
|
141
|
+
k =
|
|
142
|
+
/* Math.imul(k, m): */
|
|
143
|
+
(k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);
|
|
144
|
+
k ^=
|
|
145
|
+
/* k >>> r: */
|
|
146
|
+
k >>> 24;
|
|
147
|
+
h =
|
|
148
|
+
/* Math.imul(k, m): */
|
|
149
|
+
(k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^
|
|
150
|
+
/* Math.imul(h, m): */
|
|
151
|
+
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
|
|
152
|
+
} // Handle the last few bytes of the input array
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
switch (len) {
|
|
156
|
+
case 3:
|
|
157
|
+
h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
|
|
158
|
+
|
|
159
|
+
case 2:
|
|
160
|
+
h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
|
|
161
|
+
|
|
162
|
+
case 1:
|
|
163
|
+
h ^= str.charCodeAt(i) & 0xff;
|
|
164
|
+
h =
|
|
165
|
+
/* Math.imul(h, m): */
|
|
166
|
+
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
|
|
167
|
+
} // Do a few final mixes of the hash to ensure the last few
|
|
168
|
+
// bytes are well-incorporated.
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
h ^= h >>> 13;
|
|
172
|
+
h =
|
|
173
|
+
/* Math.imul(h, m): */
|
|
174
|
+
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
|
|
175
|
+
return ((h ^ h >>> 15) >>> 0).toString(36);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function padEndHash(value) {
|
|
179
|
+
const hashLength = value.length;
|
|
180
|
+
if (hashLength === SEQUENCE_HASH_LENGTH) {
|
|
181
|
+
return value;
|
|
182
|
+
}
|
|
183
|
+
for (let i = hashLength; i < SEQUENCE_HASH_LENGTH; i++) {
|
|
184
|
+
value += '0';
|
|
185
|
+
}
|
|
186
|
+
return value;
|
|
187
|
+
}
|
|
188
|
+
function hashSequence(classes, dir, sequenceIds = []) {
|
|
189
|
+
if (process.env.NODE_ENV === 'production') {
|
|
190
|
+
return SEQUENCE_PREFIX + padEndHash(murmur2(classes + dir));
|
|
191
|
+
}
|
|
192
|
+
return SEQUENCE_PREFIX + padEndHash(murmur2(classes + dir)) + DEBUG_SEQUENCE_SEPARATOR + padEndHash(murmur2(sequenceIds.join('')));
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Reduces a classname map for slot to a classname string. Uses classnames according to text directions.
|
|
197
|
+
*
|
|
198
|
+
* @private
|
|
199
|
+
*/
|
|
200
|
+
function reduceToClassName(classMap, dir) {
|
|
201
|
+
let className = '';
|
|
202
|
+
// eslint-disable-next-line guard-for-in
|
|
203
|
+
for (const propertyHash in classMap) {
|
|
204
|
+
const classNameMapping = classMap[propertyHash];
|
|
205
|
+
if (classNameMapping) {
|
|
206
|
+
const hasRTLClassName = Array.isArray(classNameMapping);
|
|
207
|
+
if (dir === 'rtl') {
|
|
208
|
+
className += (hasRTLClassName ? classNameMapping[1] : classNameMapping) + ' ';
|
|
209
|
+
} else {
|
|
210
|
+
className += (hasRTLClassName ? classNameMapping[0] : classNameMapping) + ' ';
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
return className.slice(0, -1);
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Reduces classname maps for slots to classname strings. Registers them in a definition cache to be used by
|
|
218
|
+
* `mergeClasses()`.
|
|
219
|
+
*
|
|
220
|
+
* @internal
|
|
221
|
+
*/
|
|
222
|
+
function reduceToClassNameForSlots(classesMapBySlot, dir) {
|
|
223
|
+
const classNamesForSlots = {};
|
|
224
|
+
// eslint-disable-next-line guard-for-in
|
|
225
|
+
for (const slotName in classesMapBySlot) {
|
|
226
|
+
const slotClasses = reduceToClassName(classesMapBySlot[slotName], dir);
|
|
227
|
+
// Handles a case when there are no classes in a set i.e. "makeStyles({ root: {} })"
|
|
228
|
+
if (slotClasses === '') {
|
|
229
|
+
classNamesForSlots[slotName] = '';
|
|
230
|
+
continue;
|
|
231
|
+
}
|
|
232
|
+
const sequenceHash = hashSequence(slotClasses, dir);
|
|
233
|
+
const resultSlotClasses = sequenceHash + ' ' + slotClasses;
|
|
234
|
+
DEFINITION_LOOKUP_TABLE[sequenceHash] = [classesMapBySlot[slotName], dir];
|
|
235
|
+
classNamesForSlots[slotName] = resultSlotClasses;
|
|
236
|
+
}
|
|
237
|
+
return classNamesForSlots;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// Contains a mapping of previously resolved sequences of atomic classnames
|
|
241
|
+
const mergeClassesCachedResults = {};
|
|
242
|
+
function mergeClasses() {
|
|
243
|
+
// arguments are parsed manually to avoid double loops as TS & Babel transforms rest via an additional loop
|
|
244
|
+
// @see https://babeljs.io/docs/en/babel-plugin-transform-parameters
|
|
245
|
+
/* eslint-disable prefer-rest-params */
|
|
246
|
+
let dir = null;
|
|
247
|
+
let resultClassName = '';
|
|
248
|
+
// Is used as a cache key to avoid object merging
|
|
249
|
+
let sequenceMatch = '';
|
|
250
|
+
const sequencesIds = new Array(arguments.length);
|
|
251
|
+
let containsResetClassName = '';
|
|
252
|
+
for (let i = 0; i < arguments.length; i++) {
|
|
253
|
+
const className = arguments[i];
|
|
254
|
+
if (typeof className === 'string' && className !== '') {
|
|
255
|
+
// All classes generated by `makeStyles()` are prefixed by a sequence hash, this allows to identify class sets
|
|
256
|
+
// without parsing each className in a string
|
|
257
|
+
const sequenceIndex = className.indexOf(SEQUENCE_PREFIX);
|
|
258
|
+
if (sequenceIndex === -1) {
|
|
259
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
260
|
+
className.split(' ').forEach(entry => {
|
|
261
|
+
if (entry.startsWith(RESET_HASH_PREFIX) && DEBUG_RESET_CLASSES[entry]) {
|
|
262
|
+
if (containsResetClassName) {
|
|
263
|
+
// eslint-disable-next-line no-console
|
|
264
|
+
console.error('mergeClasses(): a passed string contains multiple classes produced by makeResetStyles (' + `${className} & ${resultClassName}, this will lead to non-deterministic behavior. Learn more:` + 'https://griffel.js.org/react/api/make-reset-styles#limitations' + '\n' + `Source string: ${className}`);
|
|
265
|
+
} else {
|
|
266
|
+
containsResetClassName = entry;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
resultClassName += className + ' ';
|
|
272
|
+
} else {
|
|
273
|
+
const sequenceId = className.substr(sequenceIndex, SEQUENCE_SIZE);
|
|
274
|
+
// Handles a case with mixed classnames, i.e. "ui-button ATOMIC_CLASSES"
|
|
275
|
+
if (sequenceIndex > 0) {
|
|
276
|
+
resultClassName += className.slice(0, sequenceIndex);
|
|
277
|
+
}
|
|
278
|
+
sequenceMatch += sequenceId;
|
|
279
|
+
sequencesIds[i] = sequenceId;
|
|
280
|
+
}
|
|
281
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
282
|
+
if (className.indexOf(SEQUENCE_PREFIX, sequenceIndex + 1) !== -1) {
|
|
283
|
+
// eslint-disable-next-line no-console
|
|
284
|
+
console.error('mergeClasses(): a passed string contains multiple identifiers of atomic classes (classes that start ' + `with "${SEQUENCE_PREFIX}"), it's possible that passed classes were concatenated in a wrong way. ` + `Source string: ${className}`);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
// .slice() there allows to avoid trailing space for non-atomic classes
|
|
290
|
+
// "ui-button ui-flex " => "ui-button ui-flex"
|
|
291
|
+
if (sequenceMatch === '') {
|
|
292
|
+
return resultClassName.slice(0, -1);
|
|
293
|
+
}
|
|
294
|
+
// It's safe to reuse results to avoid continuous merging as results are stable
|
|
295
|
+
// "__seq1 ... __seq2 ..." => "__seq12 ..."
|
|
296
|
+
const mergeClassesResult = mergeClassesCachedResults[sequenceMatch];
|
|
297
|
+
if (mergeClassesResult !== undefined) {
|
|
298
|
+
return resultClassName + mergeClassesResult;
|
|
299
|
+
}
|
|
300
|
+
const sequenceMappings = [];
|
|
301
|
+
for (let i = 0; i < arguments.length; i++) {
|
|
302
|
+
const sequenceId = sequencesIds[i];
|
|
303
|
+
if (sequenceId) {
|
|
304
|
+
const sequenceMapping = DEFINITION_LOOKUP_TABLE[sequenceId];
|
|
305
|
+
if (sequenceMapping) {
|
|
306
|
+
sequenceMappings.push(sequenceMapping[LOOKUP_DEFINITIONS_INDEX]);
|
|
307
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
308
|
+
if (dir !== null && dir !== sequenceMapping[LOOKUP_DIR_INDEX]) {
|
|
309
|
+
// eslint-disable-next-line no-console
|
|
310
|
+
console.error(`mergeClasses(): a passed string contains an identifier (${sequenceId}) that has different direction ` + `(dir="${sequenceMapping[1] ? 'rtl' : 'ltr'}") setting than other classes. This is not supported. ` + `Source string: ${arguments[i]}`);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
dir = sequenceMapping[LOOKUP_DIR_INDEX];
|
|
314
|
+
} else {
|
|
315
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
316
|
+
// eslint-disable-next-line no-console
|
|
317
|
+
console.error(`mergeClasses(): a passed string contains an identifier (${sequenceId}) that does not match any entry ` + `in cache. Source string: ${arguments[i]}`);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
// eslint-disable-next-line prefer-spread
|
|
323
|
+
const resultDefinitions = Object.assign.apply(Object,
|
|
324
|
+
// .assign() mutates the first object, we can't mutate mappings as it will produce invalid results later
|
|
325
|
+
[{}].concat(sequenceMappings));
|
|
326
|
+
let atomicClassNames = reduceToClassName(resultDefinitions, dir);
|
|
327
|
+
// Each merge of classes generates a new sequence of atomic classes that needs to be registered
|
|
328
|
+
const newSequenceHash = hashSequence(atomicClassNames, dir, sequencesIds);
|
|
329
|
+
atomicClassNames = newSequenceHash + ' ' + atomicClassNames;
|
|
330
|
+
mergeClassesCachedResults[sequenceMatch] = atomicClassNames;
|
|
331
|
+
DEFINITION_LOOKUP_TABLE[newSequenceHash] = [resultDefinitions, dir];
|
|
332
|
+
return resultClassName + atomicClassNames;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
const sequenceDetails = {};
|
|
336
|
+
const cssRules = /*#__PURE__*/new Set();
|
|
337
|
+
const debugData = {
|
|
338
|
+
getChildrenSequences: debugSequenceHash => {
|
|
339
|
+
const key = Object.keys(mergeClassesCachedResults).find(key => mergeClassesCachedResults[key].startsWith(debugSequenceHash));
|
|
340
|
+
if (key) {
|
|
341
|
+
// key of the mergeClasses cache contains merge order
|
|
342
|
+
return key.split(SEQUENCE_PREFIX).filter(sequence => sequence.length).map(sequence => SEQUENCE_PREFIX + sequence);
|
|
343
|
+
}
|
|
344
|
+
return [];
|
|
345
|
+
},
|
|
346
|
+
addCSSRule: rule => {
|
|
347
|
+
cssRules.add(rule);
|
|
348
|
+
},
|
|
349
|
+
addSequenceDetails: (classNamesForSlots, sourceURL) => {
|
|
350
|
+
Object.entries(classNamesForSlots).forEach(([slotName, sequenceHash]) => {
|
|
351
|
+
sequenceDetails[sequenceHash.substring(0, SEQUENCE_SIZE)] = {
|
|
352
|
+
slotName,
|
|
353
|
+
sourceURL
|
|
354
|
+
};
|
|
355
|
+
});
|
|
356
|
+
},
|
|
357
|
+
getCSSRules: () => {
|
|
358
|
+
return Array.from(cssRules);
|
|
359
|
+
},
|
|
360
|
+
getSequenceDetails: sequenceHash => {
|
|
361
|
+
return sequenceDetails[sequenceHash];
|
|
362
|
+
}
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
function getDirectionalClassName(classes, direction) {
|
|
366
|
+
return Array.isArray(classes) ? direction === 'rtl' ? classes[1] : classes[0] : classes;
|
|
367
|
+
}
|
|
368
|
+
function getDebugClassNames(lookupItem, parentLookupItem, parentDebugClassNames, overridingSiblings) {
|
|
369
|
+
const classesMapping = lookupItem[0];
|
|
370
|
+
const direction = lookupItem[1];
|
|
371
|
+
return Object.entries(classesMapping).map(([propertyHash, classes]) => {
|
|
372
|
+
const className = getDirectionalClassName(classes, direction);
|
|
373
|
+
let overriddenBy;
|
|
374
|
+
if (parentDebugClassNames && parentLookupItem) {
|
|
375
|
+
const matching = parentDebugClassNames.find(({
|
|
376
|
+
className: parentClassName
|
|
377
|
+
}) => parentClassName === className);
|
|
378
|
+
if (!matching && parentLookupItem[0][propertyHash]) {
|
|
379
|
+
// parent node does not have current className (style), but has current selector:
|
|
380
|
+
// style is overriden in current merging by another rule in sibling node
|
|
381
|
+
overriddenBy = getDirectionalClassName(parentLookupItem[0][propertyHash], parentLookupItem[1]);
|
|
382
|
+
} else if (matching && parentLookupItem[0][propertyHash]) {
|
|
383
|
+
// parent node has current className (style), and has current selector:
|
|
384
|
+
// case 1. style is not overriden during current merging; it may be overriden in higher level of merging
|
|
385
|
+
// case 2. style is overriden in current merging by exactly the same rule in sibling nodes
|
|
386
|
+
const siblingHasSameRule = overridingSiblings ? overridingSiblings.filter(({
|
|
387
|
+
debugClassNames
|
|
388
|
+
}) => debugClassNames.filter(({
|
|
389
|
+
className: siblingClassName
|
|
390
|
+
}) => siblingClassName === className).length > 0).length > 0 : false;
|
|
391
|
+
overriddenBy = siblingHasSameRule ? matching.className // case 2
|
|
392
|
+
: matching.overriddenBy; // case 1
|
|
393
|
+
} else if (!matching && !parentLookupItem[0][propertyHash]) {
|
|
394
|
+
// parent node does not have current className (style), and does not have current selector:
|
|
395
|
+
// this case is not possible
|
|
396
|
+
overriddenBy = undefined;
|
|
397
|
+
} else if (matching && !parentLookupItem[0][propertyHash]) {
|
|
398
|
+
// parent node has current className (style), but does not have current selector:
|
|
399
|
+
// this case is not possible
|
|
400
|
+
overriddenBy = undefined;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
return {
|
|
404
|
+
className,
|
|
405
|
+
overriddenBy
|
|
406
|
+
};
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
function getDebugTree(debugSequenceHash, parentNode) {
|
|
411
|
+
const lookupItem = DEFINITION_LOOKUP_TABLE[debugSequenceHash];
|
|
412
|
+
if (lookupItem === undefined) {
|
|
413
|
+
return undefined;
|
|
414
|
+
}
|
|
415
|
+
const parentLookupItem = parentNode ? DEFINITION_LOOKUP_TABLE[parentNode.sequenceHash] : undefined;
|
|
416
|
+
const debugClassNames = getDebugClassNames(lookupItem, parentLookupItem, parentNode === null || parentNode === void 0 ? void 0 : parentNode.debugClassNames, parentNode === null || parentNode === void 0 ? void 0 : parentNode.children);
|
|
417
|
+
const node = {
|
|
418
|
+
sequenceHash: debugSequenceHash,
|
|
419
|
+
direction: lookupItem[1],
|
|
420
|
+
children: [],
|
|
421
|
+
debugClassNames
|
|
422
|
+
};
|
|
423
|
+
const childrenSequences = debugData.getChildrenSequences(node.sequenceHash);
|
|
424
|
+
childrenSequences.reverse() // first process the overriding children that are merged last
|
|
425
|
+
.forEach(sequence => {
|
|
426
|
+
const child = getDebugTree(sequence, node);
|
|
427
|
+
if (child) {
|
|
428
|
+
node.children.push(child);
|
|
429
|
+
}
|
|
430
|
+
});
|
|
431
|
+
// if it's leaf (makeStyle node), get css rules
|
|
432
|
+
if (!node.children.length) {
|
|
433
|
+
node.rules = {};
|
|
434
|
+
node.debugClassNames.forEach(({
|
|
435
|
+
className
|
|
436
|
+
}) => {
|
|
437
|
+
const mapData = debugData.getSequenceDetails(debugSequenceHash);
|
|
438
|
+
if (mapData) {
|
|
439
|
+
node.slot = mapData.slotName;
|
|
440
|
+
node.sourceURL = mapData.sourceURL;
|
|
441
|
+
}
|
|
442
|
+
const cssRule = debugData.getCSSRules().find(cssRule => {
|
|
443
|
+
return cssRule.includes(className);
|
|
444
|
+
});
|
|
445
|
+
node.rules[className] = cssRule;
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
return node;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
function injectDevTools(document) {
|
|
452
|
+
const window = document.defaultView;
|
|
453
|
+
if (!window || window.__GRIFFEL_DEVTOOLS__) {
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
const devtools = {
|
|
457
|
+
getInfo: element => {
|
|
458
|
+
const rootDebugSequenceHash = Array.from(element.classList).find(className => className.startsWith(SEQUENCE_PREFIX));
|
|
459
|
+
if (rootDebugSequenceHash === undefined) {
|
|
460
|
+
return undefined;
|
|
461
|
+
}
|
|
462
|
+
return getDebugTree(rootDebugSequenceHash);
|
|
463
|
+
}
|
|
464
|
+
};
|
|
465
|
+
Object.defineProperty(window, '__GRIFFEL_DEVTOOLS__', {
|
|
466
|
+
configurable: false,
|
|
467
|
+
enumerable: false,
|
|
468
|
+
get() {
|
|
469
|
+
return devtools;
|
|
470
|
+
}
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
const isDevToolsEnabled = /*#__PURE__*/(() => {
|
|
475
|
+
var _a;
|
|
476
|
+
// Accessing "window.sessionStorage" causes an exception when third party cookies are blocked
|
|
477
|
+
// https://stackoverflow.com/questions/30481516/iframe-in-chrome-error-failed-to-read-localstorage-from-window-access-deni
|
|
478
|
+
try {
|
|
479
|
+
return Boolean(typeof window !== 'undefined' && ((_a = window.sessionStorage) === null || _a === void 0 ? void 0 : _a.getItem('__GRIFFEL_DEVTOOLS__')));
|
|
480
|
+
} catch (e) {
|
|
481
|
+
return false;
|
|
482
|
+
}
|
|
483
|
+
})();
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* @internal
|
|
487
|
+
*
|
|
488
|
+
* @param entry - CSS bucket entry that can be either a string or an array
|
|
489
|
+
* @returns An array where the first element is the CSS rule
|
|
490
|
+
*/
|
|
491
|
+
function normalizeCSSBucketEntry(entry) {
|
|
492
|
+
if (!Array.isArray(entry)) {
|
|
493
|
+
return [entry];
|
|
494
|
+
}
|
|
495
|
+
if (process.env.NODE_ENV !== 'production' && entry.length > 2) {
|
|
496
|
+
throw new Error('CSS Bucket contains an entry with greater than 2 items, please report this to https://github.com/microsoft/griffel/issues');
|
|
497
|
+
}
|
|
498
|
+
return entry;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
function createIsomorphicStyleSheet(styleElement, bucketName, elementAttributes) {
|
|
502
|
+
// no CSSStyleSheet in SSR, just append rules here for server render
|
|
503
|
+
const __cssRulesForSSR = [];
|
|
504
|
+
elementAttributes[DATA_BUCKET_ATTR] = bucketName;
|
|
505
|
+
if (styleElement) {
|
|
506
|
+
for (const attrName in elementAttributes) {
|
|
507
|
+
styleElement.setAttribute(attrName, elementAttributes[attrName]);
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
function insertRule(rule) {
|
|
511
|
+
if (styleElement === null || styleElement === void 0 ? void 0 : styleElement.sheet) {
|
|
512
|
+
return styleElement.sheet.insertRule(rule, styleElement.sheet.cssRules.length);
|
|
513
|
+
}
|
|
514
|
+
return __cssRulesForSSR.push(rule);
|
|
515
|
+
}
|
|
516
|
+
return {
|
|
517
|
+
elementAttributes,
|
|
518
|
+
insertRule,
|
|
519
|
+
element: styleElement,
|
|
520
|
+
bucketName,
|
|
521
|
+
cssRules() {
|
|
522
|
+
if (styleElement === null || styleElement === void 0 ? void 0 : styleElement.sheet) {
|
|
523
|
+
return Array.from(styleElement.sheet.cssRules).map(cssRule => cssRule.cssText);
|
|
524
|
+
}
|
|
525
|
+
return __cssRulesForSSR;
|
|
526
|
+
}
|
|
527
|
+
};
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* Ordered style buckets using their short pseudo name.
|
|
532
|
+
*
|
|
533
|
+
* @internal
|
|
534
|
+
*/
|
|
535
|
+
const styleBucketOrdering = [
|
|
536
|
+
// reset styles
|
|
537
|
+
'r',
|
|
538
|
+
// catch-all
|
|
539
|
+
'd',
|
|
540
|
+
// link
|
|
541
|
+
'l',
|
|
542
|
+
// visited
|
|
543
|
+
'v',
|
|
544
|
+
// focus-within
|
|
545
|
+
'w',
|
|
546
|
+
// focus
|
|
547
|
+
'f',
|
|
548
|
+
// focus-visible
|
|
549
|
+
'i',
|
|
550
|
+
// hover
|
|
551
|
+
'h',
|
|
552
|
+
// active
|
|
553
|
+
'a',
|
|
554
|
+
// at rules for reset styles
|
|
555
|
+
's',
|
|
556
|
+
// keyframes
|
|
557
|
+
'k',
|
|
558
|
+
// at-rules
|
|
559
|
+
't',
|
|
560
|
+
// @media rules
|
|
561
|
+
'm',
|
|
562
|
+
// @container rules
|
|
563
|
+
'c'];
|
|
564
|
+
// avoid repeatedly calling `indexOf`to determine order during new insertions
|
|
565
|
+
const styleBucketOrderingMap = /*#__PURE__*/styleBucketOrdering.reduce((acc, cur, j) => {
|
|
566
|
+
acc[cur] = j;
|
|
567
|
+
return acc;
|
|
568
|
+
}, {});
|
|
569
|
+
/**
|
|
570
|
+
* Lazily adds a `<style>` bucket to the `<head>`. This will ensure that the style buckets are ordered.
|
|
571
|
+
*/
|
|
572
|
+
function getStyleSheetForBucket(bucketName, targetDocument, insertionPoint, renderer, metadata = {}) {
|
|
573
|
+
const isMediaBucket = bucketName === 'm';
|
|
574
|
+
const stylesheetKey = isMediaBucket ? bucketName + metadata['m'] : bucketName;
|
|
575
|
+
if (!renderer.stylesheets[stylesheetKey]) {
|
|
576
|
+
const tag = targetDocument && targetDocument.createElement('style');
|
|
577
|
+
const stylesheet = createIsomorphicStyleSheet(tag, bucketName, {
|
|
578
|
+
...renderer.styleElementAttributes,
|
|
579
|
+
...(isMediaBucket && {
|
|
580
|
+
media: metadata['m']
|
|
581
|
+
})
|
|
582
|
+
});
|
|
583
|
+
renderer.stylesheets[stylesheetKey] = stylesheet;
|
|
584
|
+
if (targetDocument && tag) {
|
|
585
|
+
targetDocument.head.insertBefore(tag, findInsertionPoint(targetDocument, insertionPoint, bucketName, renderer, metadata));
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
return renderer.stylesheets[stylesheetKey];
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* Finds an element before which the new bucket style element should be inserted following the bucket sort order.
|
|
592
|
+
*
|
|
593
|
+
* @param targetDocument - A document
|
|
594
|
+
* @param insertionPoint - An element that will be used as an initial insertion point
|
|
595
|
+
* @param targetBucket - The bucket that should be inserted to DOM
|
|
596
|
+
* @param renderer - Griffel renderer
|
|
597
|
+
* @param metadata - metadata for CSS rule
|
|
598
|
+
* @returns - Smallest style element with greater sort order than the current bucket
|
|
599
|
+
*/
|
|
600
|
+
function findInsertionPoint(targetDocument, insertionPoint, targetBucket, renderer, metadata) {
|
|
601
|
+
const targetOrder = styleBucketOrderingMap[targetBucket];
|
|
602
|
+
// Similar to javascript sort comparators where
|
|
603
|
+
// a positive value is increasing sort order
|
|
604
|
+
// a negative value is decreasing sort order
|
|
605
|
+
let comparer = el => targetOrder - styleBucketOrderingMap[el.getAttribute(DATA_BUCKET_ATTR)];
|
|
606
|
+
let styleElements = targetDocument.head.querySelectorAll(`[${DATA_BUCKET_ATTR}]`);
|
|
607
|
+
if (targetBucket === 'm' && metadata) {
|
|
608
|
+
const mediaElements = targetDocument.head.querySelectorAll(`[${DATA_BUCKET_ATTR}="${targetBucket}"]`);
|
|
609
|
+
// only reduce the scope of the search and change comparer
|
|
610
|
+
// if there are other media buckets already on the page
|
|
611
|
+
if (mediaElements.length) {
|
|
612
|
+
styleElements = mediaElements;
|
|
613
|
+
comparer = el => renderer.compareMediaQueries(metadata['m'], el.media);
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
const length = styleElements.length;
|
|
617
|
+
let index = length - 1;
|
|
618
|
+
while (index >= 0) {
|
|
619
|
+
const styleElement = styleElements.item(index);
|
|
620
|
+
if (comparer(styleElement) > 0) {
|
|
621
|
+
return styleElement.nextSibling;
|
|
622
|
+
}
|
|
623
|
+
index--;
|
|
624
|
+
}
|
|
625
|
+
if (length > 0) {
|
|
626
|
+
return styleElements.item(0);
|
|
627
|
+
}
|
|
628
|
+
return insertionPoint ? insertionPoint.nextSibling : null;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
/**
|
|
632
|
+
* Suffixes to be ignored in case of error
|
|
633
|
+
*/
|
|
634
|
+
const ignoreSuffixes = /*#__PURE__*/['-moz-placeholder', '-moz-focus-inner', '-moz-focusring', '-ms-input-placeholder', '-moz-read-write', '-moz-read-only'].join('|');
|
|
635
|
+
const ignoreSuffixesRegex = /*#__PURE__*/new RegExp(`:(${ignoreSuffixes})`);
|
|
636
|
+
/**
|
|
637
|
+
* @internal
|
|
638
|
+
*
|
|
639
|
+
* Calls `sheet.insertRule` and catches errors related to browser prefixes.
|
|
640
|
+
*/
|
|
641
|
+
function safeInsertRule(sheet, ruleCSS) {
|
|
642
|
+
try {
|
|
643
|
+
sheet.insertRule(ruleCSS);
|
|
644
|
+
} catch (e) {
|
|
645
|
+
// We've disabled these warnings due to false-positive errors with browser prefixes
|
|
646
|
+
if (process.env.NODE_ENV !== 'production' && !ignoreSuffixesRegex.test(ruleCSS)) {
|
|
647
|
+
// eslint-disable-next-line no-console
|
|
648
|
+
console.error(`There was a problem inserting the following rule: "${ruleCSS}"`, e);
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
let lastIndex = 0;
|
|
654
|
+
/** @internal */
|
|
655
|
+
const defaultCompareMediaQueries = (a, b) => a < b ? -1 : a > b ? 1 : 0;
|
|
656
|
+
/**
|
|
657
|
+
* Creates a new instances of a renderer.
|
|
658
|
+
*
|
|
659
|
+
* @public
|
|
660
|
+
*/
|
|
661
|
+
function createDOMRenderer(targetDocument = typeof document === 'undefined' ? undefined : document, options = {}) {
|
|
662
|
+
const {
|
|
663
|
+
unstable_filterCSSRule,
|
|
664
|
+
insertionPoint,
|
|
665
|
+
styleElementAttributes,
|
|
666
|
+
compareMediaQueries = defaultCompareMediaQueries
|
|
667
|
+
} = options;
|
|
668
|
+
const renderer = {
|
|
669
|
+
insertionCache: {},
|
|
670
|
+
stylesheets: {},
|
|
671
|
+
styleElementAttributes: Object.freeze(styleElementAttributes),
|
|
672
|
+
compareMediaQueries,
|
|
673
|
+
id: `d${lastIndex++}`,
|
|
674
|
+
insertCSSRules(cssRules) {
|
|
675
|
+
// eslint-disable-next-line guard-for-in
|
|
676
|
+
for (const styleBucketName in cssRules) {
|
|
677
|
+
const cssRulesForBucket = cssRules[styleBucketName];
|
|
678
|
+
// This is a hot path in rendering styles: ".length" is cached in "l" var to avoid accesses the property
|
|
679
|
+
for (let i = 0, l = cssRulesForBucket.length; i < l; i++) {
|
|
680
|
+
const [ruleCSS, metadata] = normalizeCSSBucketEntry(cssRulesForBucket[i]);
|
|
681
|
+
const sheet = getStyleSheetForBucket(styleBucketName, targetDocument, insertionPoint || null, renderer, metadata);
|
|
682
|
+
if (renderer.insertionCache[ruleCSS]) {
|
|
683
|
+
continue;
|
|
684
|
+
}
|
|
685
|
+
renderer.insertionCache[ruleCSS] = styleBucketName;
|
|
686
|
+
if (process.env.NODE_ENV !== 'production' && isDevToolsEnabled) {
|
|
687
|
+
debugData.addCSSRule(ruleCSS);
|
|
688
|
+
}
|
|
689
|
+
if (unstable_filterCSSRule) {
|
|
690
|
+
if (unstable_filterCSSRule(ruleCSS)) {
|
|
691
|
+
safeInsertRule(sheet, ruleCSS);
|
|
692
|
+
}
|
|
693
|
+
} else {
|
|
694
|
+
safeInsertRule(sheet, ruleCSS);
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
};
|
|
700
|
+
if (targetDocument && process.env.NODE_ENV !== 'production' && isDevToolsEnabled) {
|
|
701
|
+
injectDevTools(targetDocument);
|
|
702
|
+
}
|
|
703
|
+
return renderer;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
// TODO: duplicated from https://github.com/lahmatiy/react-render-tracker/blob/main/src/publisher/react-integration/utils/stackTrace.ts
|
|
707
|
+
// once it is published as a standalone npm package, remove this file
|
|
708
|
+
// Adopted version of StackTrace-Parser
|
|
709
|
+
// https://github.com/errwischt/stacktrace-parser/blob/master/src/stack-trace-parser.js
|
|
710
|
+
const UNKNOWN_FUNCTION = '<unknown>';
|
|
711
|
+
function parseStackTraceLine(line) {
|
|
712
|
+
return parseChrome(line) || parseGecko(line) || parseJSC(line);
|
|
713
|
+
}
|
|
714
|
+
const chromeRe = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/|[a-z]:\\|\\\\).*?)?\)?\s*$/i;
|
|
715
|
+
const chromeRe2 = /^\s*at ()((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/|[a-z]:\\|\\\\).*?)\s*$/i;
|
|
716
|
+
const chromeEvalRe = /\((\S*)\)/;
|
|
717
|
+
function parseChrome(line) {
|
|
718
|
+
const parts = chromeRe.exec(line) || chromeRe2.exec(line);
|
|
719
|
+
if (!parts) {
|
|
720
|
+
return null;
|
|
721
|
+
}
|
|
722
|
+
let loc = parts[2];
|
|
723
|
+
const isNative = loc && loc.indexOf('native') === 0; // start of line
|
|
724
|
+
const isEval = loc && loc.indexOf('eval') === 0; // start of line
|
|
725
|
+
const submatch = chromeEvalRe.exec(loc);
|
|
726
|
+
if (isEval && submatch != null) {
|
|
727
|
+
// throw out eval line/column and use top-most line/column number
|
|
728
|
+
loc = submatch[1]; // url
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
return {
|
|
732
|
+
loc: !isNative ? parts[2] : null,
|
|
733
|
+
name: parts[1] || UNKNOWN_FUNCTION
|
|
734
|
+
};
|
|
735
|
+
}
|
|
736
|
+
const geckoRe = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)\s*$/i;
|
|
737
|
+
const geckoEvalRe = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i;
|
|
738
|
+
function parseGecko(line) {
|
|
739
|
+
const parts = geckoRe.exec(line);
|
|
740
|
+
if (!parts) {
|
|
741
|
+
return null;
|
|
742
|
+
}
|
|
743
|
+
let loc = parts[3];
|
|
744
|
+
const isEval = loc && loc.indexOf(' > eval') > -1;
|
|
745
|
+
const submatch = geckoEvalRe.exec(loc);
|
|
746
|
+
if (isEval && submatch != null) {
|
|
747
|
+
// throw out eval line/column and use top-most line number
|
|
748
|
+
loc = submatch[1];
|
|
749
|
+
}
|
|
750
|
+
return {
|
|
751
|
+
loc: parts[3],
|
|
752
|
+
name: parts[1] || UNKNOWN_FUNCTION
|
|
753
|
+
};
|
|
754
|
+
}
|
|
755
|
+
const javaScriptCoreRe = /^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?)\s*$/i;
|
|
756
|
+
function parseJSC(line) {
|
|
757
|
+
const parts = javaScriptCoreRe.exec(line);
|
|
758
|
+
if (!parts) {
|
|
759
|
+
return null;
|
|
760
|
+
}
|
|
761
|
+
return {
|
|
762
|
+
loc: parts[3],
|
|
763
|
+
name: parts[1] || UNKNOWN_FUNCTION
|
|
764
|
+
};
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
function getSourceURLfromError() {
|
|
768
|
+
const stacks = String(new Error().stack).split('\n');
|
|
769
|
+
const userMakeStyleCallLine = findUserMakeStyleCallInStacks(stacks);
|
|
770
|
+
if (userMakeStyleCallLine === undefined) {
|
|
771
|
+
return undefined;
|
|
772
|
+
}
|
|
773
|
+
const result = parseStackTraceLine(userMakeStyleCallLine);
|
|
774
|
+
return result === null || result === void 0 ? void 0 : result.loc;
|
|
775
|
+
}
|
|
776
|
+
function findUserMakeStyleCallInStacks(stacks) {
|
|
777
|
+
for (let i = stacks.length - 1; i >= 0; --i) {
|
|
778
|
+
if (stacks[i].includes('at getSourceURLfromError')) {
|
|
779
|
+
// The error stacks look like:
|
|
780
|
+
// getSourceURLfromError
|
|
781
|
+
// makeStyles/__styles in griffel core
|
|
782
|
+
// makeStyles/__styles in griffel react
|
|
783
|
+
// user makeStyles call
|
|
784
|
+
return stacks[i + 3];
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
return undefined;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
/**
|
|
791
|
+
* Default implementation of insertion factory. Inserts styles only once per renderer and performs
|
|
792
|
+
* insertion immediately after styles computation.
|
|
793
|
+
*
|
|
794
|
+
* @internal
|
|
795
|
+
*/
|
|
796
|
+
const insertionFactory$1 = () => {
|
|
797
|
+
const insertionCache = {};
|
|
798
|
+
return function insertStyles(renderer, cssRules) {
|
|
799
|
+
if (insertionCache[renderer.id] === undefined) {
|
|
800
|
+
renderer.insertCSSRules(cssRules);
|
|
801
|
+
insertionCache[renderer.id] = true;
|
|
802
|
+
}
|
|
803
|
+
};
|
|
804
|
+
};
|
|
805
|
+
|
|
806
|
+
/**
|
|
807
|
+
* A version of makeStyles() that accepts build output as an input and skips all runtime transforms.
|
|
808
|
+
*
|
|
809
|
+
* @internal
|
|
810
|
+
*/
|
|
811
|
+
function __styles$1(classesMapBySlot, cssRules, factory = insertionFactory$1) {
|
|
812
|
+
const insertStyles = factory();
|
|
813
|
+
let ltrClassNamesForSlots = null;
|
|
814
|
+
let rtlClassNamesForSlots = null;
|
|
815
|
+
let sourceURL;
|
|
816
|
+
if (process.env.NODE_ENV !== 'production' && isDevToolsEnabled) {
|
|
817
|
+
sourceURL = getSourceURLfromError();
|
|
818
|
+
}
|
|
819
|
+
function computeClasses(options) {
|
|
820
|
+
const {
|
|
821
|
+
dir,
|
|
822
|
+
renderer
|
|
823
|
+
} = options;
|
|
824
|
+
const isLTR = dir === 'ltr';
|
|
825
|
+
if (isLTR) {
|
|
826
|
+
if (ltrClassNamesForSlots === null) {
|
|
827
|
+
ltrClassNamesForSlots = reduceToClassNameForSlots(classesMapBySlot, dir);
|
|
828
|
+
}
|
|
829
|
+
} else {
|
|
830
|
+
if (rtlClassNamesForSlots === null) {
|
|
831
|
+
rtlClassNamesForSlots = reduceToClassNameForSlots(classesMapBySlot, dir);
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
insertStyles(renderer, cssRules);
|
|
835
|
+
const classNamesForSlots = isLTR ? ltrClassNamesForSlots : rtlClassNamesForSlots;
|
|
836
|
+
if (process.env.NODE_ENV !== 'production' && isDevToolsEnabled) {
|
|
837
|
+
debugData.addSequenceDetails(classNamesForSlots, sourceURL);
|
|
838
|
+
}
|
|
839
|
+
return classNamesForSlots;
|
|
840
|
+
}
|
|
841
|
+
return computeClasses;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
/**
|
|
845
|
+
* Verifies if an application can use DOM.
|
|
846
|
+
*/
|
|
847
|
+
function canUseDOM() {
|
|
848
|
+
return typeof window !== 'undefined' && !!(window.document && window.document.createElement);
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
const useInsertionEffect =
|
|
852
|
+
// @ts-expect-error Hack to make sure that `useInsertionEffect` will not cause bundling issues in older React versions
|
|
853
|
+
// eslint-disable-next-line no-useless-concat
|
|
854
|
+
React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : undefined;
|
|
855
|
+
|
|
856
|
+
const insertionFactory = () => {
|
|
857
|
+
const insertionCache = {};
|
|
858
|
+
return function insert(renderer, cssRules) {
|
|
859
|
+
// Even if `useInsertionEffect` is available, we can use it on a client only as it will not be executed in SSR
|
|
860
|
+
if (useInsertionEffect && canUseDOM()) {
|
|
861
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
862
|
+
useInsertionEffect(() => {
|
|
863
|
+
renderer.insertCSSRules(cssRules);
|
|
864
|
+
}, [renderer, cssRules]);
|
|
865
|
+
return;
|
|
866
|
+
}
|
|
867
|
+
if (insertionCache[renderer.id] === undefined) {
|
|
868
|
+
renderer.insertCSSRules(cssRules);
|
|
869
|
+
insertionCache[renderer.id] = true;
|
|
870
|
+
}
|
|
871
|
+
};
|
|
872
|
+
};
|
|
873
|
+
|
|
874
|
+
/**
|
|
875
|
+
* @private
|
|
876
|
+
*/
|
|
877
|
+
const RendererContext = /*#__PURE__*/React.createContext( /*#__PURE__*/createDOMRenderer());
|
|
878
|
+
/**
|
|
879
|
+
* Returns an instance of current makeStyles() renderer.
|
|
880
|
+
*
|
|
881
|
+
* @private Exported as "useRenderer_unstable" use it on own risk. Can be changed or removed without a notice.
|
|
882
|
+
*/
|
|
883
|
+
function useRenderer() {
|
|
884
|
+
return React.useContext(RendererContext);
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
/**
|
|
888
|
+
* @private
|
|
889
|
+
*/
|
|
890
|
+
const TextDirectionContext = /*#__PURE__*/React.createContext('ltr');
|
|
891
|
+
/**
|
|
892
|
+
* Returns current directionality of the element's text.
|
|
893
|
+
*
|
|
894
|
+
* @private
|
|
895
|
+
*/
|
|
896
|
+
function useTextDirection() {
|
|
897
|
+
return React.useContext(TextDirectionContext);
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
/**
|
|
901
|
+
* A version of makeStyles() that accepts build output as an input and skips all runtime transforms.
|
|
902
|
+
*
|
|
903
|
+
* @internal
|
|
904
|
+
*/
|
|
905
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
906
|
+
function __styles(classesMapBySlot, cssRules) {
|
|
907
|
+
const getStyles = __styles$1(classesMapBySlot, cssRules, insertionFactory);
|
|
908
|
+
return function useClasses() {
|
|
909
|
+
const dir = useTextDirection();
|
|
910
|
+
const renderer = useRenderer();
|
|
911
|
+
return getStyles({
|
|
912
|
+
dir,
|
|
913
|
+
renderer
|
|
914
|
+
});
|
|
915
|
+
};
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
const useRootStyles = __styles({
|
|
919
|
+
"root": {
|
|
920
|
+
"mc9l5x": "f1w7gpdv",
|
|
921
|
+
"Bg96gwp": "fez10in",
|
|
922
|
+
"ycbfsm": "fg4l7m0"
|
|
923
|
+
},
|
|
924
|
+
"rtl": {
|
|
925
|
+
"Bz10aip": "f13rod7r"
|
|
926
|
+
}
|
|
927
|
+
}, {
|
|
928
|
+
"d": [".f1w7gpdv{display:inline;}", ".fez10in{line-height:0;}", ".f13rod7r{-webkit-transform:scaleX(-1);-moz-transform:scaleX(-1);-ms-transform:scaleX(-1);transform:scaleX(-1);}"],
|
|
929
|
+
"t": ["@media (forced-colors: active){.fg4l7m0{forced-color-adjust:auto;}}"]
|
|
930
|
+
});
|
|
931
|
+
const useIconState = (props, options) => {
|
|
932
|
+
const {
|
|
933
|
+
title,
|
|
934
|
+
primaryFill = "currentColor",
|
|
935
|
+
...rest
|
|
936
|
+
} = props;
|
|
937
|
+
const state = {
|
|
938
|
+
...rest,
|
|
939
|
+
title: undefined,
|
|
940
|
+
fill: primaryFill
|
|
941
|
+
};
|
|
942
|
+
const styles = useRootStyles();
|
|
943
|
+
const iconContext = useIconContext();
|
|
944
|
+
state.className = mergeClasses(styles.root, (options === null || options === void 0 ? void 0 : options.flipInRtl) && (iconContext === null || iconContext === void 0 ? void 0 : iconContext.textDirection) === 'rtl' && styles.rtl, state.className);
|
|
945
|
+
if (title) {
|
|
946
|
+
state['aria-label'] = title;
|
|
947
|
+
}
|
|
948
|
+
if (!state['aria-label'] && !state['aria-labelledby']) {
|
|
949
|
+
state['aria-hidden'] = true;
|
|
950
|
+
} else {
|
|
951
|
+
state['role'] = 'img';
|
|
952
|
+
}
|
|
953
|
+
return state;
|
|
954
|
+
};
|
|
955
|
+
|
|
956
|
+
const createFluentIcon = (displayName, width, paths, options) => {
|
|
957
|
+
const viewBoxWidth = width === "1em" ? "20" : width;
|
|
958
|
+
const Icon = React.forwardRef((props, ref) => {
|
|
959
|
+
const state = {
|
|
960
|
+
...useIconState(props, {
|
|
961
|
+
flipInRtl: options === null || options === void 0 ? void 0 : options.flipInRtl
|
|
962
|
+
}),
|
|
963
|
+
ref,
|
|
964
|
+
width,
|
|
965
|
+
height: width,
|
|
966
|
+
viewBox: `0 0 ${viewBoxWidth} ${viewBoxWidth}`,
|
|
967
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
968
|
+
};
|
|
969
|
+
return React.createElement("svg", state, ...paths.map(d => React.createElement("path", {
|
|
970
|
+
d,
|
|
971
|
+
fill: state.fill
|
|
972
|
+
})));
|
|
973
|
+
});
|
|
974
|
+
Icon.displayName = displayName;
|
|
975
|
+
return Icon;
|
|
976
|
+
};
|
|
977
|
+
|
|
978
|
+
const ArrowNextFilled = /*#__PURE__*/createFluentIcon('ArrowNextFilled', "1em", ["M13.75 4.75c.38 0 .7.28.74.65l.01.1v9a.75.75 0 0 1-1.5.1V5.5c0-.41.34-.75.75-.75Zm-8.28.22a.75.75 0 0 1 .98-.07l.08.07 4.5 4.5c.27.27.3.68.07.98l-.07.08-4.5 4.5a.75.75 0 0 1-1.13-.98l.07-.08L9.44 10 5.47 6.03a.75.75 0 0 1 0-1.06Z"], {
|
|
979
|
+
flipInRtl: true
|
|
980
|
+
});
|
|
981
|
+
const ArrowPreviousFilled = /*#__PURE__*/createFluentIcon('ArrowPreviousFilled', "1em", ["M6 4.75c-.38 0-.7.28-.74.65l-.01.1v9a.75.75 0 0 0 1.5.1V5.5A.75.75 0 0 0 6 4.75Zm8.28.22a.75.75 0 0 0-.98-.07l-.08.07-4.5 4.5a.75.75 0 0 0-.07.98l.07.08 4.5 4.5a.75.75 0 0 0 1.13-.98l-.07-.08L10.31 10l3.97-3.97c.3-.3.3-.77 0-1.06Z"], {
|
|
982
|
+
flipInRtl: true
|
|
983
|
+
});
|
|
984
|
+
const ArrowStepInLeftRegular = /*#__PURE__*/createFluentIcon('ArrowStepInLeftRegular', "1em", ["M5 10a1 1 0 1 0-2 0 1 1 0 0 0 2 0ZM4 8a2 2 0 1 1 0 4 2 2 0 0 1 0-4Zm14 2a.5.5 0 0 1-.5.5H9.7l3.15 3.15a.5.5 0 0 1-.7.7l-4-4a.5.5 0 0 1 0-.7l4-4a.5.5 0 0 1 .7.7L9.71 9.5h7.79c.28 0 .5.22.5.5Z"]);
|
|
985
|
+
const ArrowStepInRightRegular = /*#__PURE__*/createFluentIcon('ArrowStepInRightRegular', "1em", ["M15 10a1 1 0 1 0 2 0 1 1 0 0 0-2 0Zm1 2a2 2 0 1 1 0-4 2 2 0 0 1 0 4ZM2 10c0-.28.22-.5.5-.5h7.8L7.14 6.35a.5.5 0 1 1 .7-.7l4 4c.2.2.2.5 0 .7l-4 4a.5.5 0 0 1-.7-.7l3.14-3.15H2.5A.5.5 0 0 1 2 10Z"]);
|
|
986
|
+
|
|
987
|
+
const ChevronDownFilled = /*#__PURE__*/createFluentIcon('ChevronDownFilled', "1em", ["M15.8 7.73c.28.3.27.78-.03 1.06l-5.25 5a.75.75 0 0 1-1.04 0l-5.25-5a.75.75 0 0 1 1.04-1.08L10 12.2l4.73-4.5a.75.75 0 0 1 1.06.02Z"]);
|
|
988
|
+
const ChevronDownRegular = /*#__PURE__*/createFluentIcon('ChevronDownRegular', "1em", ["M15.85 7.65c.2.2.2.5 0 .7l-5.46 5.49a.55.55 0 0 1-.78 0L4.15 8.35a.5.5 0 1 1 .7-.7L10 12.8l5.15-5.16c.2-.2.5-.2.7 0Z"]);
|
|
989
|
+
const ChevronRightFilled = /*#__PURE__*/createFluentIcon('ChevronRightFilled', "1em", ["M7.73 4.2a.75.75 0 0 1 1.06.03l5 5.25c.28.3.28.75 0 1.04l-5 5.25a.75.75 0 1 1-1.08-1.04L12.2 10l-4.5-4.73a.75.75 0 0 1 .02-1.06Z"]);
|
|
990
|
+
const ChevronRightRegular = /*#__PURE__*/createFluentIcon('ChevronRightRegular', "1em", ["M7.65 4.15c.2-.2.5-.2.7 0l5.49 5.46c.21.22.21.57 0 .78l-5.49 5.46a.5.5 0 0 1-.7-.7L12.8 10 7.65 4.85a.5.5 0 0 1 0-.7Z"]);
|
|
991
|
+
const ColumnEditFilled = /*#__PURE__*/createFluentIcon('ColumnEditFilled', "1em", ["M3 3.5c0-.28.22-.5.5-.5H4a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-.5a.5.5 0 0 1 0-1H4a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1h-.5a.5.5 0 0 1-.5-.5ZM9 3a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h.22l.21-.84a3.2 3.2 0 0 1 .84-1.49L13 11.94V5a2 2 0 0 0-2-2H9Zm6 2v4.94l-1 1V5c0-1.1.9-2 2-2h.5a.5.5 0 0 1 0 1H16a1 1 0 0 0-1 1Zm-4.02 10.38 4.83-4.83a1.87 1.87 0 1 1 2.64 2.64l-4.83 4.83a2.2 2.2 0 0 1-1.02.58l-1.5.37a.89.89 0 0 1-1.07-1.07l.37-1.5c.1-.39.3-.74.58-1.02Z"]);
|
|
992
|
+
const ColumnEditRegular = /*#__PURE__*/createFluentIcon('ColumnEditRegular', "1em", ["M3 3.5c0-.28.22-.5.5-.5H4a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-.5a.5.5 0 0 1 0-1H4a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1h-.5a.5.5 0 0 1-.5-.5ZM9 4a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h.47l-.04.16-.21.84H9a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h2a2 2 0 0 1 2 2v6.94l-1 1V5a1 1 0 0 0-1-1H9Zm6 1v4.94l-1 1V5c0-1.1.9-2 2-2h.5a.5.5 0 0 1 0 1H16a1 1 0 0 0-1 1Zm-4.02 10.38 4.83-4.83a1.87 1.87 0 1 1 2.64 2.64l-4.83 4.83a2.2 2.2 0 0 1-1.02.58l-1.5.37a.89.89 0 0 1-1.07-1.07l.37-1.5c.1-.39.3-.74.58-1.02Z"]);
|
|
993
|
+
const DragFilled = /*#__PURE__*/createFluentIcon('DragFilled', "1em", ["M10 2c.2 0 .39.08.53.22l1.5 1.5a.75.75 0 0 1-1.06 1.06l-.22-.22v1.69a.75.75 0 0 1-1.5 0V4.56l-.22.22a.75.75 0 0 1-1.06-1.06l1.5-1.5A.75.75 0 0 1 10 2Zm2 8a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm-9.78-.53a.75.75 0 0 0 0 1.06l1.5 1.5a.75.75 0 0 0 1.06-1.06l-.22-.22h1.69a.75.75 0 0 0 0-1.5H4.56l.22-.22a.75.75 0 0 0-1.06-1.06l-1.5 1.5ZM10 18c.2 0 .39-.08.53-.22l1.5-1.5a.75.75 0 1 0-1.06-1.06l-.22.22v-1.69a.75.75 0 0 0-1.5 0v1.69l-.22-.22a.75.75 0 0 0-1.06 1.06l1.5 1.5c.14.14.33.22.53.22Zm7.78-8.53a.75.75 0 0 1 0 1.06l-1.5 1.5a.75.75 0 1 1-1.06-1.06l.22-.22h-1.69a.75.75 0 0 1 0-1.5h1.69l-.22-.22a.75.75 0 0 1 1.06-1.06l1.5 1.5Z"]);
|
|
994
|
+
const DragRegular = /*#__PURE__*/createFluentIcon('DragRegular', "1em", ["M9.65 2.15c.2-.2.5-.2.7 0l2 2a.5.5 0 0 1-.7.7L10.5 3.71V6.5a.5.5 0 0 1-1 0V3.7L8.35 4.86a.5.5 0 1 1-.7-.7l2-2ZM10 12a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0-1a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm5.85 1.35 2-2a.5.5 0 0 0 0-.7l-2-2a.5.5 0 0 0-.7.7l1.14 1.15H13.5a.5.5 0 0 0 0 1h2.8l-1.15 1.15a.5.5 0 0 0 .7.7Zm-5.5 5.5 2-2a.5.5 0 0 0-.7-.7l-1.15 1.14V13.5a.5.5 0 0 0-1 0v2.8l-1.15-1.15a.5.5 0 0 0-.7.7l2 2c.2.2.5.2.7 0Zm-8.2-7.5a.5.5 0 0 1 0-.7l2-2a.5.5 0 1 1 .7.7L3.71 9.5H6.5a.5.5 0 0 1 0 1H3.7l1.15 1.15a.5.5 0 0 1-.7.7l-2-2Z"]);
|
|
995
|
+
const FilterFilled = /*#__PURE__*/createFluentIcon('FilterFilled', "1em", ["M12.25 13.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5h4.5Zm2-4.25a.75.75 0 0 1 0 1.5h-8.5a.75.75 0 0 1 0-1.5h8.5Zm2-4.25a.75.75 0 0 1 0 1.5H3.75a.75.75 0 0 1 0-1.5h12.5Z"]);
|
|
996
|
+
const FilterRegular = /*#__PURE__*/createFluentIcon('FilterRegular', "1em", ["M7.5 13h5a.5.5 0 0 1 .09 1H7.5a.5.5 0 0 1-.09-1h5.09-5Zm-2-4h9a.5.5 0 0 1 .09 1H5.5a.5.5 0 0 1-.09-1h9.09-9Zm-2-4h13a.5.5 0 0 1 .09 1H3.5a.5.5 0 0 1-.09-1H16.5h-13Z"]);
|
|
997
|
+
const FilterDismissFilled = /*#__PURE__*/createFluentIcon('FilterDismissFilled', "1em", ["M11.73 10.25A5.46 5.46 0 0 0 14 11c0 .41-.34.75-.75.75h-8.5a.75.75 0 0 1 0-1.5h6.98ZM9.03 6c.04.52.16 1.03.34 1.5H2.75a.75.75 0 0 1 0-1.5h6.27ZM12 15.25a.75.75 0 0 0-.75-.75h-4.5a.75.75 0 0 0 0 1.5h4.5c.41 0 .75-.34.75-.75ZM14.5 10a4.5 4.5 0 1 0 0-9 4.5 4.5 0 0 0 0 9Zm1.85-6.35c.2.2.2.5 0 .7L15.21 5.5l1.14 1.15a.5.5 0 0 1-.7.7L14.5 6.21l-1.15 1.14a.5.5 0 0 1-.7-.7l1.14-1.15-1.14-1.15a.5.5 0 0 1 .7-.7l1.15 1.14 1.15-1.14c.2-.2.5-.2.7 0Z"]);
|
|
998
|
+
|
|
999
|
+
const GroupFilled = /*#__PURE__*/createFluentIcon('GroupFilled', "1em", ["M7 4.5c0 .36-.07.7-.2 1H10c.28 0 .5.22.5.5v2H10a2 2 0 0 0-2 2v.5H6a.5.5 0 0 1-.5-.5V6.8a2.5 2.5 0 0 1-1.5.15V10c0 1.1.9 2 2 2h2v2c0 1.1.9 2 2 2h3.05a2.51 2.51 0 0 1 .16-1.5H10a.5.5 0 0 1-.5-.5v-2h.5a2 2 0 0 0 2-2v-.5h2c.28 0 .5.22.5.5v3.2a2.5 2.5 0 0 1 1.5-.15V10a2 2 0 0 0-2-2h-2V6a2 2 0 0 0-2-2H6.95c.03.16.05.33.05.5Zm3.5 5v.5a.5.5 0 0 1-.5.5h-.5V10c0-.28.22-.5.5-.5h.5ZM6 4.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm11 11a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm0-11a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm-11 11a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"]);
|
|
1000
|
+
const GroupRegular = /*#__PURE__*/createFluentIcon('GroupRegular', "1em", ["M7 4.5c0 .17-.02.34-.05.5H10a1 1 0 0 1 1 1v2h-1a2 2 0 0 0-2 2v1H6a1 1 0 0 1-1-1V6.95a2.51 2.51 0 0 1-1 0V10c0 1.1.9 2 2 2h2v2c0 1.1.9 2 2 2h3.05a2.51 2.51 0 0 1 0-1H10a1 1 0 0 1-1-1v-2h1a2 2 0 0 0 2-2V9h2a1 1 0 0 1 1 1v3.05a2.51 2.51 0 0 1 1 0V10a2 2 0 0 0-2-2h-2V6a2 2 0 0 0-2-2H6.95c.03.16.05.33.05.5ZM11 9v1a1 1 0 0 1-1 1H9v-1a1 1 0 0 1 1-1h1ZM6 4.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm11 11a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm0-11a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm-11 11a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"]);
|
|
1001
|
+
const GroupDismissFilled = /*#__PURE__*/createFluentIcon('GroupDismissFilled', "1em", ["M7 4.5c0 .36-.07.7-.2 1H10c.28 0 .5.22.5.5v2H10a2 2 0 0 0-2 2v.5H6a.5.5 0 0 1-.5-.5V6.8a2.5 2.5 0 0 1-1.5.15V10c0 1.1.9 2 2 2h2v2a2 2 0 0 0 1.16 1.81 5.51 5.51 0 0 1 .34-3.6V10c0-.28.22-.5.5-.5h2.2a5.48 5.48 0 0 1 3.61-.34A2 2 0 0 0 14 8h-2V6a2 2 0 0 0-2-2H6.95c.03.16.05.33.05.5Zm-1 0a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm11 0a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm-11 11a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm13-1a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Zm-2.65-1.15a.5.5 0 0 0-.7-.7l-1.15 1.14-1.15-1.14a.5.5 0 0 0-.7.7l1.14 1.15-1.14 1.15a.5.5 0 0 0 .7.7l1.15-1.14 1.15 1.14a.5.5 0 0 0 .7-.7l-1.14-1.15 1.14-1.15Z"]);
|
|
1002
|
+
const GroupListRegular = /*#__PURE__*/createFluentIcon('GroupListRegular', "1em", ["M2.5 3a.5.5 0 0 0-.5.5v5c0 .28.22.5.5.5h2a.5.5 0 0 0 0-1H3V4h1.5a.5.5 0 0 0 0-1h-2Zm0 8a.5.5 0 0 0-.5.5v5c0 .28.22.5.5.5h2a.5.5 0 0 0 0-1H3v-4h1.5a.5.5 0 0 0 0-1h-2ZM6 4.5c0-.28.22-.5.5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5Zm.5 7.5a.5.5 0 0 0 0 1h11a.5.5 0 0 0 0-1h-11ZM6 7.5c0-.28.22-.5.5-.5h11a.5.5 0 0 1 0 1h-11a.5.5 0 0 1-.5-.5Zm.5 7.5a.5.5 0 0 0 0 1h11a.5.5 0 0 0 0-1h-11Z"]);
|
|
1003
|
+
const NextRegular = /*#__PURE__*/createFluentIcon('NextRegular', "1em", ["M17 3.5a.5.5 0 0 0-1 0v13a.5.5 0 1 0 1 0v-13ZM3 4.25c0-1 1.12-1.6 1.95-1.04l8.5 5.71c.73.5.73 1.57 0 2.07l-8.5 5.8A1.25 1.25 0 0 1 3 15.75V4.25Zm1.39-.2a.25.25 0 0 0-.39.2v11.5c0 .2.23.32.4.2l8.49-5.78a.25.25 0 0 0 0-.42l-8.5-5.7Z"]);
|
|
1004
|
+
|
|
1005
|
+
const PinRegular = /*#__PURE__*/createFluentIcon('PinRegular', "1em", ["M10.12 3.14a2 2 0 0 1 3.2-.52l4.06 4.05a2 2 0 0 1-.52 3.2l-3.46 1.74a1.5 1.5 0 0 0-.72.78L11.25 16a1 1 0 0 1-1.64.33L7 13.7 3.7 17H3v-.7L6.3 13l-2.62-2.61a1 1 0 0 1 .34-1.64L7.6 7.32c.34-.14.62-.4.78-.72l1.73-3.46Zm2.5.18a1 1 0 0 0-1.6.26L9.29 7.04a2.5 2.5 0 0 1-1.31 1.2L4.39 9.69l5.93 5.93 1.43-3.59a2.5 2.5 0 0 1 1.2-1.3l3.46-1.74a1 1 0 0 0 .26-1.6l-4.05-4.06Z"]);
|
|
1006
|
+
const PinOffRegular = /*#__PURE__*/createFluentIcon('PinOffRegular', "1em", ["M2.85 2.15a.5.5 0 1 0-.7.7L6.9 7.6 4.02 8.75a1 1 0 0 0-.34 1.64L6.3 13 3 16.3v.7h.7L7 13.7l2.61 2.62a1 1 0 0 0 1.64-.34l1.15-2.88 4.75 4.75a.5.5 0 0 0 .7-.7l-15-15Zm8.78 10.18-1.31 3.28-5.93-5.93 3.28-1.3 3.96 3.95Zm1.33-1.62-.08.04.74.75 3.24-1.62a2 2 0 0 0 .52-3.2l-4.05-4.06a2 2 0 0 0-3.2.52L8.5 6.38l.75.74.04-.08 1.73-3.45a1 1 0 0 1 1.6-.26l4.05 4.05a1 1 0 0 1-.26 1.6l-3.45 1.73Z"]);
|
|
1007
|
+
const PreviousRegular = /*#__PURE__*/createFluentIcon('PreviousRegular', "1em", ["M3 3.5a.5.5 0 0 1 1 0v13a.5.5 0 0 1-1 0v-13Zm14 .75c0-1-1.12-1.6-1.95-1.04l-8.5 5.71c-.73.5-.73 1.57 0 2.07l8.5 5.8c.83.56 1.95-.03 1.95-1.04V4.25Zm-1.39-.2c.17-.12.39 0 .39.2v11.5c0 .2-.22.32-.4.2l-8.49-5.78a.25.25 0 0 1 0-.42l8.5-5.7Z"]);
|
|
1008
|
+
const SaveFilled = /*#__PURE__*/createFluentIcon('SaveFilled', "1em", ["M3 5c0-1.1.9-2 2-2h1v3.5C6 7.33 6.67 8 7.5 8h4c.83 0 1.5-.67 1.5-1.5V3h.38a2 2 0 0 1 1.41.59l1.62 1.62A2 2 0 0 1 17 6.62V15a2 2 0 0 1-2 2v-5.5c0-.83-.67-1.5-1.5-1.5h-7c-.83 0-1.5.67-1.5 1.5V17a2 2 0 0 1-2-2V5Zm9-2H7v3.5c0 .28.22.5.5.5h4a.5.5 0 0 0 .5-.5V3Zm2 8.5V17H6v-5.5c0-.28.22-.5.5-.5h7c.28 0 .5.22.5.5Z"]);
|
|
1009
|
+
const SaveRegular = /*#__PURE__*/createFluentIcon('SaveRegular', "1em", ["M3 5c0-1.1.9-2 2-2h8.38a2 2 0 0 1 1.41.59l1.62 1.62A2 2 0 0 1 17 6.62V15a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm2-1a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1v-4.5c0-.83.67-1.5 1.5-1.5h7c.83 0 1.5.67 1.5 1.5V16a1 1 0 0 0 1-1V6.62a1 1 0 0 0-.3-.7L14.1 4.28a1 1 0 0 0-.71-.29H13v2.5c0 .83-.67 1.5-1.5 1.5h-4A1.5 1.5 0 0 1 6 6.5V4H5Zm2 0v2.5c0 .28.22.5.5.5h4a.5.5 0 0 0 .5-.5V4H7Zm7 12v-4.5a.5.5 0 0 0-.5-.5h-7a.5.5 0 0 0-.5.5V16h8Z"]);
|
|
1010
|
+
const SearchFilled = /*#__PURE__*/createFluentIcon('SearchFilled', "1em", ["M8.5 3a5.5 5.5 0 0 1 4.38 8.82l4.15 4.15a.75.75 0 0 1-.98 1.13l-.08-.07-4.15-4.15A5.5 5.5 0 1 1 8.5 3Zm0 1.5a4 4 0 1 0 0 8 4 4 0 0 0 0-8Z"]);
|
|
1011
|
+
const SearchRegular = /*#__PURE__*/createFluentIcon('SearchRegular', "1em", ["M8.5 3a5.5 5.5 0 0 1 4.23 9.02l4.12 4.13a.5.5 0 0 1-.63.76l-.07-.06-4.13-4.12A5.5 5.5 0 1 1 8.5 3Zm0 1a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9Z"]);
|
|
1012
|
+
const TableSimpleCheckmarkFilled = /*#__PURE__*/createFluentIcon('TableSimpleCheckmarkFilled', "1em", ["M14 17h-3.5v-6.5H17V14a3 3 0 0 1-3 3Zm3-7.5h-6.5V3H14a3 3 0 0 1 3 3v3.5Zm-7.5 0V3H6a3 3 0 0 0-3 3v3.5h6.5Zm0 7.5v-6.5H3V14a3 3 0 0 0 3 3h3.5Zm5.85-3.9a.5.5 0 0 0-.7-.7l-1.4 1.4-.4-.4a.5.5 0 0 0-.7.7l.75.75c.2.2.5.2.7 0l1.75-1.75Z"]);
|
|
1013
|
+
const TableSimpleCheckmarkRegular = /*#__PURE__*/createFluentIcon('TableSimpleCheckmarkRegular', "1em", ["M6 3a3 3 0 0 0-3 3v8a3 3 0 0 0 3 3h8a3 3 0 0 0 3-3V6a3 3 0 0 0-3-3H6ZM4 6c0-1.1.9-2 2-2h3.5v5.5H4V6Zm6.5 3.5V4H14a2 2 0 0 1 2 2v3.5h-5.5Zm-6.5 1h5.5V16H6a2 2 0 0 1-2-2v-3.5Zm10.86 1.4c.2.2.2.5 0 .7l-1.75 1.75a.5.5 0 0 1-.71 0l-.75-.75a.5.5 0 0 1 .7-.7l.4.4 1.4-1.4c.2-.2.51-.2.7 0Z"]);
|
|
1014
|
+
|
|
1015
|
+
const TextSortAscendingFilled = /*#__PURE__*/createFluentIcon('TextSortAscendingFilled', "1em", ["M6.7 2.5a.75.75 0 0 0-1.4 0L3.03 9a.75.75 0 0 0 1.42.5l.34-1h2.4l.34 1A.75.75 0 0 0 8.96 9L6.7 2.5ZM6 5.04 6.68 7H5.32L6 5.04ZM4 11a.75.75 0 0 0 0 1.5h2.53l-3.14 4.3A.75.75 0 0 0 4 18h4a.75.75 0 0 0 0-1.5H5.47l3.14-4.3A.75.75 0 0 0 8 11H4Zm10.25-9c.41 0 .75.34.75.75v12.57l1.45-1.58a.75.75 0 0 1 1.1 1.02l-2.75 3a.75.75 0 0 1-1.1 0l-2.75-3a.75.75 0 0 1 1.1-1.02l1.45 1.58V2.75c0-.41.34-.75.75-.75Z"]);
|
|
1016
|
+
const TextSortDescendingFilled = /*#__PURE__*/createFluentIcon('TextSortDescendingFilled', "1em", ["M4 2a.75.75 0 1 0 0 1.5h2.53L3.39 7.8A.75.75 0 0 0 4 9h4a.75.75 0 0 0 0-1.5H5.47l3.14-4.3A.75.75 0 0 0 8 2H4Zm2.7 8.5a.75.75 0 0 0-1.4 0L3.03 17a.75.75 0 1 0 1.42.5l.34-1h2.4l.34 1a.75.75 0 1 0 1.42-.5L6.7 10.5ZM6 13.04 6.68 15H5.32L6 13.04ZM14.25 2c.41 0 .75.34.75.75v12.57l1.45-1.58a.75.75 0 0 1 1.1 1.02l-2.75 3a.75.75 0 0 1-1.1 0l-2.75-3a.75.75 0 0 1 1.1-1.02l1.45 1.58V2.75c0-.41.34-.75.75-.75Z"]);
|
|
1017
|
+
|
|
1018
|
+
const Album24Regular = /*#__PURE__*/createFluentIcon('Album24Regular', "24", ["M10 9c0-1.1.9-2 2-2h4a2 2 0 0 1 2 2v1a2 2 0 0 1-2 2h-4a2 2 0 0 1-2-2V9Zm2-.5a.5.5 0 0 0-.5.5v1c0 .28.22.5.5.5h4a.5.5 0 0 0 .5-.5V9a.5.5 0 0 0-.5-.5h-4ZM4 4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2H4Zm16 1.5c.28 0 .5.22.5.5v12a.5.5 0 0 1-.5.5H7.5v-13H20Zm-16 0h2v13H4a.5.5 0 0 1-.5-.5V6c0-.28.22-.5.5-.5Z"], {
|
|
1019
|
+
flipInRtl: true
|
|
1020
|
+
});
|
|
1021
|
+
|
|
1022
|
+
const ArrowSortDown20Filled = /*#__PURE__*/createFluentIcon('ArrowSortDown20Filled', "20", ["M9.75 17c.23 0 .45-.1.59-.28l2.94-2.94a.75.75 0 0 0-1.06-1.06l-1.72 1.71V3.75a.75.75 0 0 0-1.5 0v10.7L7.28 12.7a.75.75 0 1 0-1.06 1.06l3 3.01c.15.15.34.22.53.22Z"]);
|
|
1023
|
+
const ArrowSortDown20Regular = /*#__PURE__*/createFluentIcon('ArrowSortDown20Regular', "20", ["m10 15.29 2.65-2.64a.5.5 0 0 1 .7.7L9.9 16.82a.5.5 0 0 1-.74.03h-.01l-3.5-3.5a.5.5 0 1 1 .71-.7L9 15.29V3.5a.5.5 0 0 1 1 0v11.79Z"]);
|
|
1024
|
+
const ArrowSortUp20Filled = /*#__PURE__*/createFluentIcon('ArrowSortUp20Filled', "20", ["M9.75 3c.23 0 .45.1.59.28l2.94 2.94a.75.75 0 0 1-1.06 1.06L10.5 5.57v10.68a.75.75 0 0 1-1.5 0V5.55L7.28 7.3a.75.75 0 1 1-1.06-1.06l3-3.01A.73.73 0 0 1 9.75 3Z"]);
|
|
1025
|
+
const ArrowSortUp20Regular = /*#__PURE__*/createFluentIcon('ArrowSortUp20Regular', "20", ["M9 4.71 6.35 7.35a.5.5 0 1 1-.7-.7L9.1 3.18a.5.5 0 0 1 .74-.03h.01l3.5 3.5a.5.5 0 1 1-.71.7L10 4.71V16.5a.5.5 0 0 1-1 0V4.71Z"]);
|
|
1026
|
+
|
|
1027
|
+
const CodeTextOff16Filled = /*#__PURE__*/createFluentIcon('CodeTextOff16Filled', "16", ["M13.25 7h-3a.75.75 0 0 1 0-1.5h3a.75.75 0 0 1 0 1.5Zm-3.5-3h4.5a.75.75 0 0 0 0-1.5h-4.5a.75.75 0 0 0 0 1.5Zm-1 7.5h-7a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5Zm-2-7.5a.75.75 0 0 0 0-1.5H4.62L6.12 4h.63Zm8.1 10.15-13-13a.5.5 0 0 0-.7.7l.64.65h-.04a.75.75 0 0 0 0 1.5h1.54l1.5 1.5h-.04a.75.75 0 0 0 0 1.5h1.54l1.5 1.5H3.75a.75.75 0 0 0 0 1.5h5.54l4.86 4.85a.5.5 0 0 0 .7 0 .5.5 0 0 0 0-.7Z"]);
|
|
1028
|
+
const CodeTextOff16Regular = /*#__PURE__*/createFluentIcon('CodeTextOff16Regular', "16", ["m6.12 4-1-1H7a.5.5 0 0 1 0 1h-.88ZM9.5 4h5a.5.5 0 0 0 0-1h-5a.5.5 0 0 0 0 1Zm.5 2a.5.5 0 0 0 0 1h3.5a.5.5 0 0 0 0-1H10Zm-1 6H1.5a.5.5 0 0 0 0 1H9a.5.5 0 0 0 0-1Zm5.85 2.15-13-13a.5.5 0 0 0-.7.7L2.29 3H1.5a.5.5 0 0 0 0 1h1.8l2 2h-.8a.5.5 0 0 0 0 1h1.8l2 2H3.5a.5.5 0 0 0 0 1h5.8l4.85 4.85a.5.5 0 0 0 .7 0 .5.5 0 0 0 0-.7Z"]);
|
|
1029
|
+
|
|
1030
|
+
const Dismiss24Regular = /*#__PURE__*/createFluentIcon('Dismiss24Regular', "24", ["m4.4 4.55.07-.08a.75.75 0 0 1 .98-.07l.08.07L12 10.94l6.47-6.47a.75.75 0 1 1 1.06 1.06L13.06 12l6.47 6.47c.27.27.3.68.07.98l-.07.08a.75.75 0 0 1-.98.07l-.08-.07L12 13.06l-6.47 6.47a.75.75 0 0 1-1.06-1.06L10.94 12 4.47 5.53a.75.75 0 0 1-.07-.98l.07-.08-.07.08Z"]);
|
|
1031
|
+
|
|
1032
|
+
const DocumentSearch24Regular = /*#__PURE__*/createFluentIcon('DocumentSearch24Regular', "24", ["M11.4 10.95a4.93 4.93 0 0 1 .55 6.32l-.14.2 4.22 4.21.07.09a.77.77 0 0 1-1.08 1.08l-.09-.08-4.25-4.25a4.93 4.93 0 1 1 .73-7.57ZM13.14 2c.6 0 1.17.24 1.59.66l2.81 2.8 2.8 2.82c.43.42.67 1 .67 1.6v9.87c0 1.24-1.01 2.25-2.25 2.25h-1.51c-.04-.3-.15-.58-.34-.83l-.12-.14-.52-.53h2.49c.41 0 .75-.34.75-.75V10h-4.25c-1.2 0-2.17-.92-2.24-2.1L13 7.76V3.5H7.25a.75.75 0 0 0-.75.75v4.42a5.9 5.9 0 0 0-1.5.58v-5C5 3.01 6 2 7.25 2h5.88Zm-7.6 10.04a3.38 3.38 0 1 0 4.79 4.78 3.38 3.38 0 0 0-4.78-4.78Zm8.97-7.48v3.2c0 .37.28.69.65.74H18.45L14.5 4.56Z"]);
|
|
1033
|
+
|
|
1034
|
+
const Save20Filled = /*#__PURE__*/createFluentIcon('Save20Filled', "20", ["M3 5c0-1.1.9-2 2-2h1v3.5C6 7.33 6.67 8 7.5 8h4c.83 0 1.5-.67 1.5-1.5V3h.38a2 2 0 0 1 1.41.59l1.62 1.62A2 2 0 0 1 17 6.62V15a2 2 0 0 1-2 2v-5.5c0-.83-.67-1.5-1.5-1.5h-7c-.83 0-1.5.67-1.5 1.5V17a2 2 0 0 1-2-2V5Zm9-2H7v3.5c0 .28.22.5.5.5h4a.5.5 0 0 0 .5-.5V3Zm2 8.5V17H6v-5.5c0-.28.22-.5.5-.5h7c.28 0 .5.22.5.5Z"]);
|
|
1035
|
+
|
|
1036
|
+
const Search24Regular = /*#__PURE__*/createFluentIcon('Search24Regular', "24", ["M10 2.75a7.25 7.25 0 0 1 5.63 11.82l4.9 4.9a.75.75 0 0 1-.98 1.13l-.08-.07-4.9-4.9A7.25 7.25 0 1 1 10 2.75Zm0 1.5a5.75 5.75 0 1 0 0 11.5 5.75 5.75 0 0 0 0-11.5Z"]);
|
|
1037
|
+
|
|
1038
|
+
const ViewDesktop20Filled = /*#__PURE__*/createFluentIcon('ViewDesktop20Filled', "20", ["M1.96 4.5c0-.83.67-1.5 1.5-1.5H16.4c.83 0 1.5.67 1.5 1.5v8c0 .83-.67 1.5-1.5 1.5H12v2.01h1.5a.5.5 0 0 1 0 1h-7a.5.5 0 1 1 0-1H8V14H3.46a1.5 1.5 0 0 1-1.5-1.5v-8ZM9 14v2.01h2V14H9ZM4 5.5v6c0 .28.22.5.5.5h1a.5.5 0 0 0 .5-.5v-6a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5Zm3 0v6c0 .28.22.5.5.5h8a.5.5 0 0 0 .5-.5v-6a.5.5 0 0 0-.5-.5h-8a.5.5 0 0 0-.5.5Z"]);
|
|
1039
|
+
const ViewDesktop20Regular = /*#__PURE__*/createFluentIcon('ViewDesktop20Regular', "20", ["M4 5.5c0-.28.22-.5.5-.5h1c.27 0 .5.22.5.5v6a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5v-6ZM7.5 5a.5.5 0 0 0-.5.5v6c0 .28.22.5.5.5h8a.5.5 0 0 0 .5-.5v-6a.5.5 0 0 0-.5-.5h-8Zm-5.54-.5c0-.83.67-1.5 1.5-1.5H16.4c.83 0 1.5.67 1.5 1.5v8c0 .83-.67 1.5-1.5 1.5H12v2.01h1.5a.5.5 0 0 1 0 1h-7a.5.5 0 1 1 0-1H8V14H3.46a1.5 1.5 0 0 1-1.5-1.5v-8ZM9 14v2.01h2V14H9ZM3.46 4a.5.5 0 0 0-.5.5v8c0 .28.23.5.5.5H16.4a.5.5 0 0 0 .5-.5v-8a.5.5 0 0 0-.5-.5H3.46Z"]);
|
|
1040
|
+
|
|
1041
|
+
const iconFilledClassName = "fui-Icon-filled";
|
|
1042
|
+
const iconRegularClassName = "fui-Icon-regular";
|
|
1043
|
+
|
|
1044
|
+
const useBundledIconStyles = __styles({
|
|
1045
|
+
"root": {
|
|
1046
|
+
"mc9l5x": "fjseox"
|
|
1047
|
+
},
|
|
1048
|
+
"visible": {
|
|
1049
|
+
"mc9l5x": "f1w7gpdv"
|
|
1050
|
+
}
|
|
1051
|
+
}, {
|
|
1052
|
+
"d": [".fjseox{display:none;}", ".f1w7gpdv{display:inline;}"]
|
|
1053
|
+
});
|
|
1054
|
+
const bundleIcon = (FilledIcon, RegularIcon) => {
|
|
1055
|
+
const Component = props => {
|
|
1056
|
+
const {
|
|
1057
|
+
className,
|
|
1058
|
+
primaryFill = 'currentColor',
|
|
1059
|
+
filled,
|
|
1060
|
+
...rest
|
|
1061
|
+
} = props;
|
|
1062
|
+
const styles = useBundledIconStyles();
|
|
1063
|
+
return React.createElement(React.Fragment, null, React.createElement(FilledIcon, Object.assign({}, rest, {
|
|
1064
|
+
className: mergeClasses(styles.root, filled && styles.visible, iconFilledClassName, className),
|
|
1065
|
+
fill: primaryFill
|
|
1066
|
+
})), React.createElement(RegularIcon, Object.assign({}, rest, {
|
|
1067
|
+
className: mergeClasses(styles.root, !filled && styles.visible, iconRegularClassName, className),
|
|
1068
|
+
fill: primaryFill
|
|
1069
|
+
})));
|
|
1070
|
+
};
|
|
1071
|
+
Component.displayName = "CompoundIcon";
|
|
1072
|
+
return Component;
|
|
1073
|
+
};
|
|
1074
|
+
var bundleIcon$1 = bundleIcon;
|
|
1075
|
+
|
|
97
1076
|
const range = (from, to, step = 1) => {
|
|
98
1077
|
var _a;
|
|
99
1078
|
return (_a = [...Array(Math.floor((to - from) / step) + 1)]) === null || _a === void 0 ? void 0 : _a.map((_, i) => from + i * step);
|
|
@@ -132,16 +1111,16 @@ const Pagination = (props) => {
|
|
|
132
1111
|
}, className: styles.pageSizeInput, "aria-label": "Page Number", autoComplete: "off", autoCorrect: "off" })] })] }), jsx(Button, { size: "small", className: styles.pageBtn, shape: "circular", onClick: () => table.setPageIndex(0), disabled: !table.getCanPreviousPage(), icon: jsx(PreviousRegular, {}), "aria-label": "Go to first page" }), jsx(Button, { size: "small", className: styles.pageBtn, shape: "circular", onClick: () => table.previousPage(), disabled: !table.getCanPreviousPage(), icon: jsx(ArrowPreviousFilled, {}), "aria-label": "Go to previous page" }), pageSelectionOptions === null || pageSelectionOptions === void 0 ? void 0 : pageSelectionOptions.map((option, index) => (jsx(Button, Object.assign({ shape: "circular", appearance: option - 1 === currentPage ? "primary" : undefined, onClick: () => table.setPageIndex(option - 1), "aria-label": `Show Page ${option}`, size: "small", className: styles.pageBtn }, { children: option }), index))), jsx(Button, { size: "small", className: styles.pageBtn, shape: "circular", onClick: () => table.nextPage(), disabled: !table.getCanNextPage(), icon: jsx(ArrowNextFilled, {}), "aria-label": "Go to next page" }), jsx(Button, { size: "small", shape: "circular", className: styles.pageBtn, onClick: () => table.setPageIndex(table.getPageCount() - 1), disabled: !table.getCanNextPage(), icon: jsx(NextRegular, {}), "aria-label": "Go to last page" })] }))] })) })));
|
|
133
1112
|
};
|
|
134
1113
|
|
|
135
|
-
bundleIcon(SaveFilled, SaveRegular);
|
|
136
|
-
bundleIcon(TableSimpleCheckmarkFilled, TableSimpleCheckmarkRegular);
|
|
137
|
-
bundleIcon(SearchFilled, SearchRegular);
|
|
138
|
-
bundleIcon(FilterFilled, FilterRegular);
|
|
139
|
-
const ClearFilterIcon = bundleIcon(CodeTextOff16Filled, CodeTextOff16Regular);
|
|
140
|
-
const ToggleSelectColumnIcon = bundleIcon(ColumnEditFilled, ColumnEditRegular);
|
|
141
|
-
const ToggleGroupColumnIcon = bundleIcon(GroupFilled, GroupRegular);
|
|
142
|
-
const GroupCollapsedIcon = bundleIcon(ChevronRightFilled, ChevronRightRegular);
|
|
143
|
-
const GroupExpandedIcon = bundleIcon(ChevronDownRegular, ChevronDownFilled);
|
|
144
|
-
bundleIcon(DragFilled, DragRegular);
|
|
1114
|
+
bundleIcon$1(SaveFilled, SaveRegular);
|
|
1115
|
+
bundleIcon$1(TableSimpleCheckmarkFilled, TableSimpleCheckmarkRegular);
|
|
1116
|
+
bundleIcon$1(SearchFilled, SearchRegular);
|
|
1117
|
+
bundleIcon$1(FilterFilled, FilterRegular);
|
|
1118
|
+
const ClearFilterIcon = bundleIcon$1(CodeTextOff16Filled, CodeTextOff16Regular);
|
|
1119
|
+
const ToggleSelectColumnIcon = bundleIcon$1(ColumnEditFilled, ColumnEditRegular);
|
|
1120
|
+
const ToggleGroupColumnIcon = bundleIcon$1(GroupFilled, GroupRegular);
|
|
1121
|
+
const GroupCollapsedIcon = bundleIcon$1(ChevronRightFilled, ChevronRightRegular);
|
|
1122
|
+
const GroupExpandedIcon = bundleIcon$1(ChevronDownRegular, ChevronDownFilled);
|
|
1123
|
+
bundleIcon$1(DragFilled, DragRegular);
|
|
145
1124
|
|
|
146
1125
|
const useGridHeaderStyles = makeStyles({
|
|
147
1126
|
tableTopHeaderContainer: Object.assign({ display: "flex", justifyContent: "space-between", alignItems: "flex-end", width: "100%", backgroundColor: tokens.colorBrandBackground2Hover }, shorthands.padding("5px")),
|
|
@@ -161,7 +1140,7 @@ const useGridHeaderStyles = makeStyles({
|
|
|
161
1140
|
});
|
|
162
1141
|
|
|
163
1142
|
const GridHeader = (props) => {
|
|
164
|
-
const { table, gridTitle, globalFilter, setGlobalFilter } = props;
|
|
1143
|
+
const { table, gridTitle, globalFilter, setGlobalFilter, dispatch, drawerState } = props;
|
|
165
1144
|
const styles = useGridHeaderStyles();
|
|
166
1145
|
return (jsxs("div", Object.assign({ className: styles.tableTopHeaderContainer }, { children: [jsx("div", Object.assign({ className: styles.tableTopHeaderLeft }, { children: gridTitle })), jsxs("div", Object.assign({ className: styles.tableTopHeaderRight }, { children: [props.headerMenu, props.headerMenu && jsx(Divider, { vertical: true }), jsxs(Popover, Object.assign({ withArrow: true }, { children: [jsx(PopoverTrigger, Object.assign({ disableButtonEnhancement: true }, { children: jsx(Tooltip, Object.assign({ content: 'Toggle Group Column', relationship: "label" }, { children: jsx(Button, { icon: jsx(ToggleGroupColumnIcon, {}), "aria-label": "Toggle Group Column" }) })) })), jsx(PopoverSurface, { children: jsxs("div", Object.assign({ className: styles.tableTopHeaderColumnTogglePopover }, { children: [jsx(MenuGroupHeader, { children: "Group Columns" }), table.getAllLeafColumns().map((column) => {
|
|
167
1146
|
if (column.id === 'select')
|
|
@@ -173,14 +1152,12 @@ const GridHeader = (props) => {
|
|
|
173
1152
|
if (column.id === 'select')
|
|
174
1153
|
return null;
|
|
175
1154
|
return (jsx(Checkbox, { checked: column.getIsVisible(), onChange: column.getToggleVisibilityHandler(), label: column.id, disabled: !column.getCanHide() }, column.id));
|
|
176
|
-
})] })) })] })), jsx(Tooltip, Object.assign({ content: 'Table Views Management', relationship: "label" }, { children: jsx(Button
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
// appearance="subtle"
|
|
180
|
-
onClick: () => props.setViewsDrawerOpen((value) => !value), icon: jsx(Album24Regular, {}), "aria-label": "View Menu" }) })), jsx(DebouncedInput, { value: globalFilter !== null && globalFilter !== void 0 ? globalFilter : '', onChange: (value) => setGlobalFilter(String(value)), className: "p-2 font-lg shadow border border-block", placeholder: "Search all columns...", openFilterDrawer: props.openFilterDrawer, setFilterDrawerOpen: props.setFilterDrawerOpen })] }))] })));
|
|
1155
|
+
})] })) })] })), jsx(Tooltip, Object.assign({ content: 'Table Views Management', relationship: "label" }, { children: jsx(Button, { onClick: () => {
|
|
1156
|
+
dispatch({ type: "TOGGLE_VIEW_DRAWER" });
|
|
1157
|
+
}, icon: jsx(Album24Regular, {}), "aria-label": "View Menu" }) })), jsx(DebouncedInput, { value: globalFilter !== null && globalFilter !== void 0 ? globalFilter : '', onChange: (value) => setGlobalFilter(String(value)), className: "p-2 font-lg shadow border border-block", placeholder: "Search all columns...", drawerState: drawerState, dispatch: dispatch })] }))] })));
|
|
181
1158
|
};
|
|
182
1159
|
// A debounced input react component
|
|
183
|
-
function DebouncedInput({ value: initialValue, onChange, debounce = 500,
|
|
1160
|
+
function DebouncedInput({ value: initialValue, onChange, debounce = 500, drawerState, dispatch, }) {
|
|
184
1161
|
const [value, setValue] = React.useState('');
|
|
185
1162
|
React.useEffect(() => {
|
|
186
1163
|
setValue(initialValue);
|
|
@@ -191,8 +1168,8 @@ function DebouncedInput({ value: initialValue, onChange, debounce = 500, openFil
|
|
|
191
1168
|
}, debounce);
|
|
192
1169
|
return () => clearTimeout(timeout);
|
|
193
1170
|
}, [value, onChange, debounce]);
|
|
194
|
-
return (jsx(Input, { placeholder: "Search Keyword", value: value, onChange: (_, data) => setValue(data.value), type: "search", autoComplete: "off", contentBefore: jsx(Search24Regular, {}), style: { width: '300px' }, contentAfter: jsx(Tooltip, Object.assign({ content:
|
|
195
|
-
|
|
1171
|
+
return (jsx(Input, { placeholder: "Search Keyword", value: value, onChange: (_, data) => setValue(data.value), type: "search", autoComplete: "off", contentBefore: jsx(Search24Regular, {}), style: { width: '300px' }, contentAfter: jsx(Tooltip, Object.assign({ content: drawerState.isFilterDrawerOpen ? 'Close Filter Window' : 'Open Advance Filter', relationship: "label" }, { children: jsx(Button, { appearance: "subtle", icon: drawerState.isFilterDrawerOpen ? jsx(FilterDismissFilled, {}) : jsx(FilterFilled, {}), "aria-label": "View Menu", onClick: () => {
|
|
1172
|
+
dispatch({ type: "TOGGLE_FILTER_DRAWER" });
|
|
196
1173
|
} }) })) }));
|
|
197
1174
|
}
|
|
198
1175
|
|
|
@@ -275,7 +1252,6 @@ const useGridContainer = (props, ref) => {
|
|
|
275
1252
|
const [expanded, setExpanded] = React.useState((_g = props.expandedState) !== null && _g !== void 0 ? _g : {});
|
|
276
1253
|
const [columnPinning, setColumnPinning] = React.useState((_h = props.columnPinningState) !== null && _h !== void 0 ? _h : {});
|
|
277
1254
|
const [columnSizing, setColumnSizing] = React.useState({});
|
|
278
|
-
const tableViews = React.useMemo(() => { var _a; return (_a = props.views) !== null && _a !== void 0 ? _a : []; }, [props.views]);
|
|
279
1255
|
const table = useReactTable({
|
|
280
1256
|
columns: columns,
|
|
281
1257
|
data,
|
|
@@ -328,6 +1304,7 @@ const useGridContainer = (props, ref) => {
|
|
|
328
1304
|
getFacetedUniqueValues: getFacetedUniqueValues(),
|
|
329
1305
|
getFacetedMinMaxValues: getFacetedMinMaxValues(),
|
|
330
1306
|
});
|
|
1307
|
+
const tableViews = React.useMemo(() => { var _a; return (_a = props.views) !== null && _a !== void 0 ? _a : []; }, [props.views]);
|
|
331
1308
|
const getTableState = React.useCallback(() => {
|
|
332
1309
|
return {
|
|
333
1310
|
pagination,
|
|
@@ -342,19 +1319,7 @@ const useGridContainer = (props, ref) => {
|
|
|
342
1319
|
columnPinning,
|
|
343
1320
|
columnSizing
|
|
344
1321
|
};
|
|
345
|
-
}, [
|
|
346
|
-
pagination,
|
|
347
|
-
sorting,
|
|
348
|
-
columnFilters,
|
|
349
|
-
globalFilter,
|
|
350
|
-
grouping,
|
|
351
|
-
expanded,
|
|
352
|
-
rowSelection,
|
|
353
|
-
columnOrder,
|
|
354
|
-
columnVisibility,
|
|
355
|
-
columnPinning,
|
|
356
|
-
columnSizing
|
|
357
|
-
]);
|
|
1322
|
+
}, [pagination, sorting, columnFilters, globalFilter, grouping, expanded, rowSelection, columnOrder, columnVisibility, columnPinning, columnSizing]);
|
|
358
1323
|
const resetToDefaultView = () => {
|
|
359
1324
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
360
1325
|
const defaultTableState = {
|
|
@@ -455,6 +1420,44 @@ const useGridContainer = (props, ref) => {
|
|
|
455
1420
|
};
|
|
456
1421
|
};
|
|
457
1422
|
|
|
1423
|
+
const useTableHeaderStyles = makeStyles({
|
|
1424
|
+
tHead: {
|
|
1425
|
+
zIndex: 1,
|
|
1426
|
+
backgroundColor: tokens.colorNeutralStroke2,
|
|
1427
|
+
color: tokens.colorNeutralForeground1,
|
|
1428
|
+
position: "sticky",
|
|
1429
|
+
top: 0,
|
|
1430
|
+
width: "100%",
|
|
1431
|
+
boxShadow: tokens.shadow2,
|
|
1432
|
+
},
|
|
1433
|
+
tHeadRow: {
|
|
1434
|
+
backgroundColor: tokens.colorNeutralStroke2,
|
|
1435
|
+
},
|
|
1436
|
+
tHeadCell: Object.assign({ zIndex: 99, position: 'relative', fontSize: tokens.fontSizeBase300, fontWeight: tokens.fontWeightBold, minWidth: '1rem' }, shorthands.padding('2px', '4px')),
|
|
1437
|
+
tHeadNonLeafCell: Object.assign({}, shorthands.borderBottom('1px', 'solid', tokens.colorNeutralBackground1)),
|
|
1438
|
+
tHeadCellDraggable: {
|
|
1439
|
+
height: '100%',
|
|
1440
|
+
cursor: 'grab',
|
|
1441
|
+
},
|
|
1442
|
+
tHeadCellDragging: {
|
|
1443
|
+
opacity: 0.5,
|
|
1444
|
+
cursor: 'grabbing',
|
|
1445
|
+
},
|
|
1446
|
+
tHeadCellOver: Object.assign({ backgroundColor: tokens.colorNeutralStroke1 }, shorthands.border(tokens.strokeWidthThin, 'dashed', tokens.colorBrandBackground2Pressed)),
|
|
1447
|
+
tLeafHeadCellContent: Object.assign({ display: 'flex', alignContent: 'space-between', alignItems: 'center', justifyContent: 'space-between', cursor: 'pointer', width: '100%', height: '100%', minWidth: '1rem' }, shorthands.padding('3px', '4px')),
|
|
1448
|
+
tNonLeafHeadCellContent: Object.assign({ display: 'flex', alignContent: 'center', alignItems: 'center', justifyContent: 'center', cursor: 'pointer', width: '100%', minWidth: '1rem' }, shorthands.padding('3px', '4px')),
|
|
1449
|
+
tHeadContentBtn: Object.assign(Object.assign(Object.assign(Object.assign({}, shorthands.padding('0px', '0px', '0px', '0px')), { display: 'flex' }), shorthands.gap('5px')), { alignContent: 'space-between', alignItems: 'center', justifyContent: 'space-between', cursor: 'pointer', width: '100%', height: '100%', minWidth: '1rem' }),
|
|
1450
|
+
tHeadMenuPopover: Object.assign(Object.assign({}, shorthands.padding('0px', '0px', '0px', '0px')), { width: '300px' }),
|
|
1451
|
+
resizer: Object.assign(Object.assign({}, shorthands.borderRight('1px', 'solid', tokens.colorNeutralBackground1)), { width: '8px', position: 'absolute', top: 0, right: 0, bottom: 0, cursor: 'col-resize', resize: 'horizontal', ':hover': {
|
|
1452
|
+
borderRightWidth: '4px',
|
|
1453
|
+
borderRightColor: tokens.colorNeutralBackground2Pressed,
|
|
1454
|
+
} }),
|
|
1455
|
+
resizerActive: {
|
|
1456
|
+
borderRightWidth: '4px',
|
|
1457
|
+
borderRightColor: tokens.colorNeutralBackground2Pressed,
|
|
1458
|
+
},
|
|
1459
|
+
});
|
|
1460
|
+
|
|
458
1461
|
const useCheckboxFilterStyles = makeStyles({
|
|
459
1462
|
searchInput: {
|
|
460
1463
|
width: '90%',
|
|
@@ -462,7 +1465,7 @@ const useCheckboxFilterStyles = makeStyles({
|
|
|
462
1465
|
marginLeft: '10px',
|
|
463
1466
|
marginRight: '10px',
|
|
464
1467
|
},
|
|
465
|
-
searchContainer: Object.assign(Object.assign({ display: 'flex', flexDirection: 'column', maxHeight: '300px', width: '100%' }, shorthands.overflow('auto', 'auto')), { '::-webkit-scrollbar': Object.assign({ width: '6px', height: '4px' }, shorthands.borderRadius('50%')),
|
|
1468
|
+
searchContainer: Object.assign(Object.assign(Object.assign({ display: 'flex', flexDirection: 'column', maxHeight: '300px', width: '100%' }, shorthands.overflow('auto', 'auto')), shorthands.padding('0px', "0px", "2px", '0px')), { '::-webkit-scrollbar': Object.assign({ width: '6px', height: '4px' }, shorthands.borderRadius('50%')),
|
|
466
1469
|
/* Track */
|
|
467
1470
|
'::-webkit-scrollbar-track': {
|
|
468
1471
|
'background-color': '#f1f1f1',
|
|
@@ -788,10 +1791,14 @@ const useFilterDrawerStyles$1 = makeStyles({
|
|
|
788
1791
|
'background-color': '#555',
|
|
789
1792
|
} }),
|
|
790
1793
|
});
|
|
791
|
-
const FilterDrawer = ({
|
|
1794
|
+
const FilterDrawer = ({ drawerState, dispatch, table }) => {
|
|
792
1795
|
const headerGroups = table.getHeaderGroups();
|
|
793
1796
|
const styles = useFilterDrawerStyles$1();
|
|
794
|
-
|
|
1797
|
+
const resetAllFilters = React.useCallback(() => {
|
|
1798
|
+
table.setGlobalFilter('');
|
|
1799
|
+
table.resetColumnFilters();
|
|
1800
|
+
}, [table]);
|
|
1801
|
+
return (jsxs(InlineDrawer, Object.assign({ position: "end", open: drawerState.isFilterDrawerOpen, separator: true }, { children: [jsx(DrawerHeader, { children: jsx(DrawerHeaderTitle, Object.assign({ action: jsx(Button, { appearance: "subtle", "aria-label": "Close", icon: jsx(Dismiss24Regular, {}), onClick: () => dispatch({ type: "CLOSE_FILTER_DRAWER" }) }) }, { children: "Advanced Filters" })) }), jsx(DrawerBody, Object.assign({ className: styles.drawerBody }, { children: headerGroups.map((headerGroup) => {
|
|
795
1802
|
const canApplyFilter = headerGroup.depth === (headerGroups === null || headerGroups === void 0 ? void 0 : headerGroups.length) - 1;
|
|
796
1803
|
if (!canApplyFilter)
|
|
797
1804
|
return null;
|
|
@@ -799,32 +1806,20 @@ const FilterDrawer = ({ open, setOpen, table }) => {
|
|
|
799
1806
|
const canFilter = header.column.getCanFilter();
|
|
800
1807
|
if (!canFilter)
|
|
801
1808
|
return null;
|
|
802
|
-
return (jsx("div", { children: header.column.getCanFilter() && (jsxs("div",
|
|
1809
|
+
return (jsx("div", { children: header.column.getCanFilter() && (jsxs("div", Object.assign({ style: {
|
|
1810
|
+
marginTop: "20px",
|
|
1811
|
+
} }, { children: [jsxs(Caption1Stronger, { children: ["Filter by", ' ', flexRender(header.column.columnDef.header, header.getContext())] }), jsx(Filter, { column: header.column, table: table })] }), 'filter-group')) }, header.column.id));
|
|
803
1812
|
});
|
|
804
|
-
}) }))] })));
|
|
1813
|
+
}) })), jsx(DrawerFooter, { children: jsx(Button, Object.assign({ icon: jsx(ClearFilterIcon, {}), onClick: resetAllFilters, style: { width: "100%" } }, { children: "Clear All Filters" })) })] })));
|
|
805
1814
|
};
|
|
806
1815
|
|
|
807
|
-
const SortAscIcon = bundleIcon(ArrowSortDown20Filled, ArrowSortDown20Regular);
|
|
808
|
-
const SortDescIcon = bundleIcon(ArrowSortUp20Filled, ArrowSortUp20Regular);
|
|
1816
|
+
const SortAscIcon = bundleIcon$1(ArrowSortDown20Filled, ArrowSortDown20Regular);
|
|
1817
|
+
const SortDescIcon = bundleIcon$1(ArrowSortUp20Filled, ArrowSortUp20Regular);
|
|
809
1818
|
const reorderColumn = (draggedColumnId, targetColumnId, columnOrder) => {
|
|
810
1819
|
columnOrder.splice(columnOrder.indexOf(targetColumnId), 0, columnOrder.splice(columnOrder.indexOf(draggedColumnId), 1)[0]);
|
|
811
1820
|
return [...columnOrder];
|
|
812
1821
|
};
|
|
813
|
-
|
|
814
|
-
tHeadCell: Object.assign(Object.assign(Object.assign(Object.assign({ position: "relative", fontSize: tokens.fontSizeBase300, fontWeight: tokens.fontWeightBold, minWidth: "1rem" }, shorthands.padding("2px", "4px")), shorthands.borderLeft("1px", "solid", tokens.colorNeutralStroke1)), shorthands.borderRight("1px", "solid", tokens.colorNeutralStroke1)), shorthands.borderBottom("1px", "solid", tokens.colorNeutralStroke1)),
|
|
815
|
-
tHeadCellContent: Object.assign({ display: "flex", alignContent: "space-between", alignItems: "center", justifyContent: "space-between", cursor: "pointer", width: "100%", minWidth: "1rem" }, shorthands.padding("3px", "4px")),
|
|
816
|
-
tHeadContentBtn: Object.assign(Object.assign(Object.assign(Object.assign({}, shorthands.padding("0px", "0px", "0px", "0px")), { display: "flex" }), shorthands.gap("5px")), { alignContent: "space-between", alignItems: "center", justifyContent: "space-between", cursor: "pointer", width: "100%", height: "100%", minWidth: "1rem" }),
|
|
817
|
-
tHeadMenuPopover: Object.assign(Object.assign({}, shorthands.padding("0px", "0px", "0px", "0px")), { width: "300px" }),
|
|
818
|
-
resizer: Object.assign(Object.assign({}, shorthands.borderRight("1px", "solid", tokens.colorNeutralBackground5)), { width: "8px", position: "absolute", top: 0, right: 0, bottom: 0, cursor: "col-resize", resize: "horizontal", ":hover": {
|
|
819
|
-
borderRightWidth: "4px",
|
|
820
|
-
borderRightColor: tokens.colorNeutralBackground2Pressed,
|
|
821
|
-
} }),
|
|
822
|
-
resizerActive: {
|
|
823
|
-
borderRightWidth: "4px",
|
|
824
|
-
borderRightColor: tokens.colorNeutralBackground2Pressed,
|
|
825
|
-
},
|
|
826
|
-
});
|
|
827
|
-
const HeaderCell = ({ header, table, hideMenu, headerDepth, totalNumberOfHeaderDepth, }) => {
|
|
1822
|
+
function HeaderCell({ header, table, hideMenu, headerDepth, totalNumberOfHeaderDepth, }) {
|
|
828
1823
|
var _a;
|
|
829
1824
|
const { getState, setColumnOrder } = table;
|
|
830
1825
|
const { columnOrder } = getState();
|
|
@@ -846,15 +1841,16 @@ const HeaderCell = ({ header, table, hideMenu, headerDepth, totalNumberOfHeaderD
|
|
|
846
1841
|
item: () => column,
|
|
847
1842
|
type: "column",
|
|
848
1843
|
});
|
|
849
|
-
const styles =
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
1844
|
+
const styles = useTableHeaderStyles();
|
|
1845
|
+
const canDragDrop = headerDepth === totalNumberOfHeaderDepth && !header.isPlaceholder;
|
|
1846
|
+
const isLeafHeaders = headerDepth === totalNumberOfHeaderDepth;
|
|
1847
|
+
if (header.isPlaceholder) {
|
|
1848
|
+
return (jsx("th", Object.assign({ colSpan: header.colSpan, className: styles.tHeadCell }, { children: header.column.getCanResize() && (jsx("div", { onMouseDown: header.getResizeHandler(), onTouchStart: header.getResizeHandler(), className: mergeClasses$1(styles.resizer, column.getIsResizing() && styles.resizerActive) })) })));
|
|
1849
|
+
}
|
|
1850
|
+
return (jsxs("th", Object.assign({ colSpan: header.colSpan, className: mergeClasses$1(styles.tHeadCell, isLeafHeaders || header.isPlaceholder ? undefined
|
|
1851
|
+
: styles.tHeadNonLeafCell, isDragging && styles.tHeadCellDragging, isOver && isLeafHeaders && styles.tHeadCellOver) }, { children: [jsx("div", Object.assign({ className: styles.tHeadCellDraggable, ref: canDragDrop ? dropRef : undefined }, { children: jsxs("div", Object.assign({ className: isLeafHeaders
|
|
1852
|
+
? styles.tLeafHeadCellContent
|
|
1853
|
+
: styles.tNonLeafHeadCellContent, ref: canDragDrop ? dragRef : undefined }, { children: [jsx("div", Object.assign({ ref: canDragDrop ? previewRef : undefined }, { children: header.isPlaceholder ? null : (jsxs(Button, Object.assign({ style: {
|
|
858
1854
|
display: 'flex',
|
|
859
1855
|
alignItems: 'center',
|
|
860
1856
|
justifyContent: 'left',
|
|
@@ -870,29 +1866,53 @@ const HeaderCell = ({ header, table, hideMenu, headerDepth, totalNumberOfHeaderD
|
|
|
870
1866
|
}, appearance: "transparent", className: styles.tHeadContentBtn, icon: (_a = {
|
|
871
1867
|
asc: (jsx("strong", { children: jsx(SortAscIcon, {}) })),
|
|
872
1868
|
desc: (jsx("strong", { children: jsx(SortDescIcon, {}) })),
|
|
873
|
-
}[header.column.getIsSorted()]) !== null && _a !== void 0 ? _a : undefined, iconPosition: "after" }, { children: [jsx("strong", { children: flexRender(header.column.columnDef.header, header.getContext()) }), header.column.getIsGrouped() && jsx(GroupListRegular, {}), header.column.getIsFiltered() && (jsx("strong", { children: jsx(FilterFilled, {}) })), header.column.getIsPinned() && jsx(PinRegular, {})] }))) })),
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
1869
|
+
}[header.column.getIsSorted()]) !== null && _a !== void 0 ? _a : undefined, iconPosition: "after" }, { children: [jsx("strong", { children: flexRender(header.column.columnDef.header, header.getContext()) }), header.column.getIsGrouped() && jsx(GroupListRegular, {}), header.column.getIsFiltered() && (jsx("strong", { children: jsx(FilterFilled, {}) })), header.column.getIsPinned() && jsx(PinRegular, {})] }))) })), jsx(HeaderMenu, { header: header, table: table, hideMenu: hideMenu })] })) })), header.column.getCanResize() && (jsx("div", { onMouseDown: header.getResizeHandler(), onTouchStart: header.getResizeHandler(), className: mergeClasses$1(styles.resizer, column.getIsResizing() && styles.resizerActive) }))] })));
|
|
1870
|
+
}
|
|
1871
|
+
function HeaderMenu(props) {
|
|
1872
|
+
const { header, table, hideMenu } = props;
|
|
1873
|
+
const styles = useTableHeaderStyles();
|
|
1874
|
+
if (hideMenu || header.isPlaceholder)
|
|
1875
|
+
return (jsx(Fragment, { children: " " }));
|
|
1876
|
+
const canHavePopOver = header.column.getCanSort() ||
|
|
1877
|
+
header.column.getCanGroup() ||
|
|
1878
|
+
header.column.getCanFilter();
|
|
1879
|
+
if (!canHavePopOver)
|
|
1880
|
+
return (jsx(Fragment, { children: " " }));
|
|
1881
|
+
return (jsxs(Menu, { children: [jsx(MenuTrigger, Object.assign({ disableButtonEnhancement: true }, { children: jsx(MenuButton, { appearance: "transparent", "aria-label": "View Column Actions" }) })), jsx(MenuPopover, Object.assign({ className: styles.tHeadMenuPopover }, { children: jsxs(MenuList, { children: [header.column.getCanSort() && (jsxs(MenuGroup, { children: [jsxs(MenuGroupHeader, { children: ["Sort by", ' ', flexRender(header.column.columnDef.header, header.getContext())] }), jsx(MenuItem, Object.assign({ onClick: (e) => {
|
|
1882
|
+
var _a;
|
|
1883
|
+
const isControlKeySelected = e.ctrlKey;
|
|
1884
|
+
(_a = header.column) === null || _a === void 0 ? void 0 : _a.toggleSorting(false, isControlKeySelected);
|
|
1885
|
+
}, icon: jsx(TextSortAscendingFilled, {}), disabled: header.column.getIsSorted() === 'asc' }, { children: "Sort A to Z" })), jsx(MenuItem, Object.assign({ onClick: (e) => {
|
|
1886
|
+
var _a;
|
|
1887
|
+
const isControlKeySelected = e.ctrlKey;
|
|
1888
|
+
(_a = header.column) === null || _a === void 0 ? void 0 : _a.toggleSorting(true, isControlKeySelected);
|
|
1889
|
+
}, icon: jsx(TextSortDescendingFilled, {}), disabled: header.column.getIsSorted() === 'desc' }, { children: "Sort Z to A" })), jsx(MenuDivider, {})] }, 'sort-group')), header.column.getCanGroup() && (jsxs(MenuGroup, { children: [jsxs(MenuGroupHeader, { children: ["Group by", ' ', flexRender(header.column.columnDef.header, header.getContext())] }), !header.column.getIsGrouped() && (jsxs(MenuItem, Object.assign({ onClick: () => header.column.getToggleGroupingHandler()(), icon: jsx(GroupFilled, {}) }, { children: ["Group by", ' ', flexRender(header.column.columnDef.header, header.getContext())] }))), header.column.getIsGrouped() && (jsxs(MenuItem, Object.assign({ onClick: () => header.column.getToggleGroupingHandler()(), icon: jsx(GroupDismissFilled, {}) }, { children: ["Remove Grouping on", ' ', flexRender(header.column.columnDef.header, header.getContext())] }))), jsx(MenuDivider, {})] }, 'grouping-group')), header.column.getCanSort() && (jsxs(MenuGroup, { children: [jsxs(MenuGroupHeader, { children: ["Pin Column", ' ', flexRender(header.column.columnDef.header, header.getContext())] }), jsx(MenuItem, Object.assign({ onClick: () => {
|
|
1890
|
+
var _a;
|
|
1891
|
+
(_a = header.column) === null || _a === void 0 ? void 0 : _a.pin('left');
|
|
1892
|
+
}, icon: jsx(ArrowStepInLeftRegular, {}), disabled: header.column.getIsPinned() === 'left' }, { children: "To Left" })), jsx(MenuItem, Object.assign({ onClick: () => {
|
|
1893
|
+
var _a;
|
|
1894
|
+
(_a = header.column) === null || _a === void 0 ? void 0 : _a.pin('right');
|
|
1895
|
+
}, icon: jsx(ArrowStepInRightRegular, {}), disabled: header.column.getIsPinned() === 'right' }, { children: "To Right" })), ['left', 'right'].includes(header.column.getIsPinned()) && (jsx(MenuItem, Object.assign({ onClick: () => {
|
|
1896
|
+
var _a;
|
|
1897
|
+
(_a = header.column) === null || _a === void 0 ? void 0 : _a.pin(false);
|
|
1898
|
+
}, icon: jsx(PinOffRegular, {}) }, { children: "Unpin Column" }))), jsx(MenuDivider, {})] }, 'pin columns')), header.column.getCanFilter() && (jsxs(MenuGroup, { children: [jsxs(MenuGroupHeader, { children: ["Filter by", ' ', flexRender(header.column.columnDef.header, header.getContext())] }), jsx(Filter, { column: header.column, table: table })] }, 'filter-group'))] }) }))] }));
|
|
1899
|
+
}
|
|
1900
|
+
|
|
1901
|
+
function HeaderRow(props) {
|
|
1902
|
+
const styles = useTableHeaderStyles();
|
|
1903
|
+
const { table, headerGroup, rowSelectionMode, headerGroupsLength } = props;
|
|
1904
|
+
return (jsxs("tr", Object.assign({ className: styles.tHeadRow }, { children: [rowSelectionMode === 'multiple' && (jsx("th", Object.assign({ style: { width: '1rem' }, "aria-label": "Select All Row Column" }, { children: headerGroup.depth === headerGroupsLength - 1 && (jsx(Checkbox, { checked: table.getIsSomeRowsSelected()
|
|
1905
|
+
? 'mixed'
|
|
1906
|
+
: table.getIsAllRowsSelected(), onChange: table.getToggleAllRowsSelectedHandler(), "aria-label": "Select All Rows", title: 'Select All Rows' })) }))), rowSelectionMode === 'single' && (jsx("th", Object.assign({ style: { width: '1rem' }, "aria-label": "Select All Row Column" }, { children: ' ' }))), headerGroup.headers.map((header) => {
|
|
1907
|
+
return (jsx(HeaderCell, { header: header, table: table, hideMenu: headerGroup.depth !== headerGroupsLength - 1, headerDepth: headerGroup.depth, totalNumberOfHeaderDepth: headerGroupsLength - 1 }, header.id));
|
|
1908
|
+
})] }), headerGroup.id));
|
|
1909
|
+
}
|
|
1910
|
+
|
|
1911
|
+
function TableHeader(props) {
|
|
1912
|
+
const styles = useTableHeaderStyles();
|
|
1913
|
+
const { table, headerGroups, rowSelectionMode } = props;
|
|
1914
|
+
return (jsx("thead", Object.assign({ className: styles.tHead }, { children: headerGroups === null || headerGroups === void 0 ? void 0 : headerGroups.map((headerGroup) => (jsx(HeaderRow, { table: table, rowSelectionMode: rowSelectionMode, headerGroup: headerGroup, headerGroupsLength: headerGroups.length }, headerGroup.id))) })));
|
|
1915
|
+
}
|
|
896
1916
|
|
|
897
1917
|
const useLoadingStyles = makeStyles({
|
|
898
1918
|
invertedWrapper: {
|
|
@@ -951,8 +1971,67 @@ const NoSearchResult = ({ message }) => {
|
|
|
951
1971
|
return (jsxs("div", Object.assign({ className: styles.wrapper }, { children: [jsx("div", Object.assign({ className: styles.iconWrapper }, { children: jsx(DocumentSearch24Regular, {}) })), jsx("div", { children: message ? message : jsx(Subtitle2Stronger, { children: "No item found that matches your search term." }) })] })));
|
|
952
1972
|
};
|
|
953
1973
|
|
|
1974
|
+
const useTableBodyStyles = makeStyles({
|
|
1975
|
+
tBody: Object.assign(Object.assign({}, shorthands.padding("0px", "0px", "0px", "0px")), { zIndex: 0 }),
|
|
1976
|
+
tBodyRow: Object.assign(Object.assign(Object.assign({}, shorthands.padding("0px", "0px", "0px", "0px")), shorthands.borderBottom(tokens.strokeWidthThin, "solid", tokens.colorNeutralStroke1)), {
|
|
1977
|
+
// ":nth-child(even)": {
|
|
1978
|
+
// backgroundColor: tokens.colorNeutralBackground2,
|
|
1979
|
+
// },
|
|
1980
|
+
":hover": {
|
|
1981
|
+
backgroundColor: tokens.colorNeutralBackground2Hover,
|
|
1982
|
+
} }),
|
|
1983
|
+
tBodySelectedRow: Object.assign(Object.assign({ backgroundColor: tokens.colorBrandBackground2 }, shorthands.borderBottom(tokens.strokeWidthThin, "solid", tokens.colorNeutralStroke1)), { ":hover": {
|
|
1984
|
+
backgroundColor: tokens.colorBrandBackground2Hover,
|
|
1985
|
+
} }),
|
|
1986
|
+
tBodyCell: Object.assign(Object.assign({ backgroundColor: "transparent" }, shorthands.padding("2px", "4px")), { minHeight: "35px", height: "35px" }),
|
|
1987
|
+
});
|
|
1988
|
+
|
|
1989
|
+
function TableCell({ cell, row }) {
|
|
1990
|
+
var _a;
|
|
1991
|
+
const styles = useTableBodyStyles();
|
|
1992
|
+
const tdStyle = {
|
|
1993
|
+
width: cell.column.getSize(),
|
|
1994
|
+
};
|
|
1995
|
+
if (cell.getIsPlaceholder()) {
|
|
1996
|
+
return jsx("td", { style: tdStyle, className: styles.tBodyCell }, cell.id);
|
|
1997
|
+
}
|
|
1998
|
+
if (cell.getIsGrouped()) {
|
|
1999
|
+
return (jsx("td", Object.assign({ style: tdStyle, className: styles.tBodyCell }, { children: jsx(Button, Object.assign({ onClick: row.getToggleExpandedHandler(), style: {
|
|
2000
|
+
cursor: row.getCanExpand() ? 'pointer' : 'normal',
|
|
2001
|
+
textAlign: 'left',
|
|
2002
|
+
}, appearance: "transparent", icon: row.getIsExpanded() ? jsx(GroupExpandedIcon, {}) : jsx(GroupCollapsedIcon, {}) }, { children: jsxs("strong", { children: [flexRender(cell.column.columnDef.cell, cell.getContext()), " (", row.subRows.length, ")"] }) })) }), cell.id));
|
|
2003
|
+
}
|
|
2004
|
+
if (cell.getIsAggregated()) {
|
|
2005
|
+
return (jsx("td", Object.assign({ style: tdStyle, className: styles.tBodyCell }, { children: jsx("strong", { children: flexRender((_a = cell.column.columnDef.aggregatedCell) !== null && _a !== void 0 ? _a : cell.column.columnDef.cell, cell.getContext()) }) }), cell.id));
|
|
2006
|
+
}
|
|
2007
|
+
return (jsx("td", Object.assign({ style: tdStyle, className: styles.tBodyCell }, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }), cell.id));
|
|
2008
|
+
}
|
|
2009
|
+
|
|
2010
|
+
function TableRow({ row, rowSelectionMode }) {
|
|
2011
|
+
const styles = useTableBodyStyles();
|
|
2012
|
+
return (jsxs("tr", Object.assign({ className: row.getIsSelected() || row.getIsAllSubRowsSelected()
|
|
2013
|
+
? styles.tBodySelectedRow
|
|
2014
|
+
: styles.tBodyRow }, { children: [rowSelectionMode === 'multiple' && (jsx("td", Object.assign({ className: styles.tBodyCell, "aria-label": "Select Row Column" }, { children: jsx(Checkbox, { checked: row.getIsSomeSelected()
|
|
2015
|
+
? 'mixed'
|
|
2016
|
+
: row.getIsSelected() || row.getIsAllSubRowsSelected(), disabled: !row.getCanSelect(), onChange: row.getToggleSelectedHandler(), "aria-label": "Select Row" }) }))), rowSelectionMode === 'single' && (jsx("td", Object.assign({ className: styles.tBodyCell, "aria-label": "Select Row Column" }, { children: jsx(Radio, { checked: row.getIsSelected(), disabled: !row.getCanSelect(), onChange: row.getToggleSelectedHandler(), "aria-label": "Select Row" }) }))), row.getVisibleCells().map((cell) => (jsx(TableCell, { cell: cell, row: row }, cell.id)))] }), row.id));
|
|
2017
|
+
}
|
|
2018
|
+
|
|
2019
|
+
function TableBody(props) {
|
|
2020
|
+
var _a, _b;
|
|
2021
|
+
const styles = useTableBodyStyles();
|
|
2022
|
+
const { rows, rowSelectionMode, virtualRows, totalSize } = props;
|
|
2023
|
+
const paddingTop = virtualRows.length > 0 ? ((_a = virtualRows === null || virtualRows === void 0 ? void 0 : virtualRows[0]) === null || _a === void 0 ? void 0 : _a.start) || 0 : 0;
|
|
2024
|
+
const paddingBottom = virtualRows.length > 0
|
|
2025
|
+
? totalSize - (((_b = virtualRows === null || virtualRows === void 0 ? void 0 : virtualRows[virtualRows.length - 1]) === null || _b === void 0 ? void 0 : _b.end) || 0)
|
|
2026
|
+
: 0;
|
|
2027
|
+
return (jsxs("tbody", Object.assign({ className: styles.tBody }, { children: [paddingTop > 0 && (jsx("tr", Object.assign({ className: styles.tBodyRow, "aria-hidden": true }, { children: jsx("td", { style: { height: `${paddingTop}px` } }) }))), virtualRows.map((virtualRow) => {
|
|
2028
|
+
const row = rows[virtualRow.index];
|
|
2029
|
+
return (jsx(TableRow, { row: row, rowSelectionMode: rowSelectionMode }, row.id));
|
|
2030
|
+
}), paddingBottom > 0 && (jsx("tr", Object.assign({ className: styles.tBodyRow, "aria-hidden": true }, { children: jsx("td", { style: { height: `${paddingBottom}px` } }) })))] })));
|
|
2031
|
+
}
|
|
2032
|
+
|
|
954
2033
|
const TableContainer = (props) => {
|
|
955
|
-
var _a, _b
|
|
2034
|
+
var _a, _b;
|
|
956
2035
|
const styles = useTableStaticStyles();
|
|
957
2036
|
const { table, rowSelectionMode } = props;
|
|
958
2037
|
const tableContainerRef = React.useRef(null);
|
|
@@ -963,54 +2042,12 @@ const TableContainer = (props) => {
|
|
|
963
2042
|
overscan: 10,
|
|
964
2043
|
});
|
|
965
2044
|
const { virtualItems: virtualRows, totalSize } = rowVirtualizer;
|
|
966
|
-
const paddingTop = virtualRows.length > 0 ? ((_a = virtualRows === null || virtualRows === void 0 ? void 0 : virtualRows[0]) === null || _a === void 0 ? void 0 : _a.start) || 0 : 0;
|
|
967
|
-
const paddingBottom = virtualRows.length > 0
|
|
968
|
-
? totalSize - (((_b = virtualRows === null || virtualRows === void 0 ? void 0 : virtualRows[virtualRows.length - 1]) === null || _b === void 0 ? void 0 : _b.end) || 0)
|
|
969
|
-
: 0;
|
|
970
2045
|
const headerGroups = table.getHeaderGroups();
|
|
971
2046
|
// utilities
|
|
972
2047
|
const isLoading = props.isLoading && virtualRows.length === 0;
|
|
973
|
-
const noItems = !isLoading && ((
|
|
974
|
-
const noSearchResult = !isLoading && ((
|
|
975
|
-
return (jsxs("div", Object.assign({ ref: tableContainerRef, className: styles.tableContainer }, { children: [jsxs("table", Object.assign({ className: styles.table, "aria-label": "Data Grid" }, { children: [jsx(
|
|
976
|
-
? 'mixed'
|
|
977
|
-
: table.getIsAllRowsSelected(), onChange: table.getToggleAllRowsSelectedHandler(), "aria-label": "Select All Rows", title: 'Select All Rows' })) }))), rowSelectionMode === 'single' && (jsx("th", Object.assign({ style: { width: '1rem' }, "aria-label": "Select All Row Column" }, { children: ' ' }))), headerGroup.headers.map((header) => {
|
|
978
|
-
return (jsx(HeaderCell, { header: header, table: table, hideMenu: headerGroup.depth !== (headerGroups === null || headerGroups === void 0 ? void 0 : headerGroups.length) - 1, headerDepth: headerGroup.depth, totalNumberOfHeaderDepth: (headerGroups === null || headerGroups === void 0 ? void 0 : headerGroups.length) - 1 }, header.id));
|
|
979
|
-
})] }, headerGroup.id))) })), jsxs("tbody", Object.assign({ className: styles.tBody }, { children: [paddingTop > 0 && (jsx("tr", Object.assign({ className: styles.tBodyRow, "aria-hidden": true }, { children: jsx("td", { style: { height: `${paddingTop}px` } }) }))), virtualRows.map((virtualRow) => {
|
|
980
|
-
const row = rows[virtualRow.index];
|
|
981
|
-
return (jsxs("tr", Object.assign({ className: row.getIsSelected() || row.getIsAllSubRowsSelected()
|
|
982
|
-
? styles.tBodySelectedRow
|
|
983
|
-
: styles.tBodyRow }, { children: [rowSelectionMode === 'multiple' && (jsx("td", Object.assign({ className: styles.tBodyCell, "aria-label": "Select Row Column" }, { children: jsx(Checkbox, { checked: row.getIsSomeSelected()
|
|
984
|
-
? 'mixed'
|
|
985
|
-
: row.getIsSelected() || row.getIsAllSubRowsSelected(), disabled: !row.getCanSelect(), onChange: row.getToggleSelectedHandler(), "aria-label": "Select Row" }) }))), rowSelectionMode === 'single' && (jsx("td", Object.assign({ className: styles.tBodyCell, "aria-label": "Select Row Column" }, { children: jsx(Radio, { checked: row.getIsSelected(), disabled: !row.getCanSelect(), onChange: row.getToggleSelectedHandler(), "aria-label": "Select Row" }) }))), row.getVisibleCells().map((cell) => {
|
|
986
|
-
var _a;
|
|
987
|
-
return (jsx("td", Object.assign({}, {
|
|
988
|
-
key: cell.id,
|
|
989
|
-
style: {
|
|
990
|
-
// background: cell.getIsGrouped()
|
|
991
|
-
// ? "#0aff0082"
|
|
992
|
-
// : cell.getIsAggregated()
|
|
993
|
-
// ? "#ffa50078"
|
|
994
|
-
// : cell.getIsPlaceholder()
|
|
995
|
-
// ? "#ff000042"
|
|
996
|
-
// : "white",
|
|
997
|
-
width: cell.column.getSize(),
|
|
998
|
-
},
|
|
999
|
-
}, { className: styles.tBodyCell }, { children: cell.getIsGrouped() ? (
|
|
1000
|
-
// If it's a grouped cell, add an expander and row count
|
|
1001
|
-
jsx(Button, Object.assign({}, {
|
|
1002
|
-
onClick: row.getToggleExpandedHandler(),
|
|
1003
|
-
style: {
|
|
1004
|
-
cursor: row.getCanExpand() ? 'pointer' : 'normal',
|
|
1005
|
-
},
|
|
1006
|
-
}, { appearance: "transparent", icon: row.getIsExpanded() ? (jsx(GroupExpandedIcon, {})) : (jsx(GroupCollapsedIcon, {})) }, { children: jsxs("strong", { children: [flexRender(cell.column.columnDef.cell, cell.getContext()), ' ', "(", row.subRows.length, ")"] }) }))) : cell.getIsAggregated() ? (
|
|
1007
|
-
// If the cell is aggregated, use the Aggregated
|
|
1008
|
-
// renderer for cell
|
|
1009
|
-
jsx("strong", { children: flexRender((_a = cell.column.columnDef.aggregatedCell) !== null && _a !== void 0 ? _a : cell.column.columnDef.cell, cell.getContext()) })) : cell.getIsPlaceholder() ? null : ( // For cells with repeated values, render null
|
|
1010
|
-
// Otherwise, just render the regular cell
|
|
1011
|
-
flexRender(cell.column.columnDef.cell, cell.getContext())) })));
|
|
1012
|
-
})] }), row.id));
|
|
1013
|
-
}), paddingBottom > 0 && (jsx("tr", Object.assign({ className: styles.tBodyRow, "aria-hidden": true }, { children: jsx("td", { style: { height: `${paddingBottom}px` } }) })))] })), rowSelectionMode === 'multiple' &&
|
|
2048
|
+
const noItems = !isLoading && ((_a = props.data) === null || _a === void 0 ? void 0 : _a.length) === 0;
|
|
2049
|
+
const noSearchResult = !isLoading && ((_b = props === null || props === void 0 ? void 0 : props.data) === null || _b === void 0 ? void 0 : _b.length) > 0 && virtualRows.length === 0;
|
|
2050
|
+
return (jsxs("div", Object.assign({ ref: tableContainerRef, className: styles.tableContainer }, { children: [jsxs("table", Object.assign({ className: styles.table, "aria-label": "Data Grid" }, { children: [jsx(TableHeader, { table: table, rowSelectionMode: rowSelectionMode, headerGroups: headerGroups }), jsx(TableBody, { rows: rows, virtualRows: virtualRows, rowSelectionMode: rowSelectionMode, totalSize: totalSize }), rowSelectionMode === 'multiple' &&
|
|
1014
2051
|
!isLoading &&
|
|
1015
2052
|
!noItems &&
|
|
1016
2053
|
!noSearchResult && (jsx("tfoot", Object.assign({ className: styles.tFoot }, { children: jsxs("tr", { children: [jsx("td", Object.assign({ className: "p-1" }, { children: jsx(Checkbox, { checked: table.getIsSomePageRowsSelected()
|
|
@@ -1077,38 +2114,68 @@ const useFilterDrawerStyles = makeStyles({
|
|
|
1077
2114
|
} }),
|
|
1078
2115
|
});
|
|
1079
2116
|
const ViewsDrawer = (props) => {
|
|
1080
|
-
const {
|
|
2117
|
+
const { drawerState, dispatch, tableViews, applyTableState, resetToGridDefaultView, getTableState, onTableViewSave } = props;
|
|
1081
2118
|
const styles = useFilterDrawerStyles();
|
|
1082
2119
|
const [checkedValues, setCheckedValues] = React.useState({ font: ["calibri"] });
|
|
1083
2120
|
const onChange = (e, { name, checkedItems }) => {
|
|
1084
2121
|
setCheckedValues((s) => (Object.assign(Object.assign({}, s), { [name]: checkedItems })));
|
|
1085
2122
|
};
|
|
1086
|
-
const resetAllFilters = React.useCallback(() => {
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
}, [table]);
|
|
1090
|
-
const resetAllGrouping = React.useCallback(() => {
|
|
1091
|
-
|
|
1092
|
-
}, [table]);
|
|
1093
|
-
const clearAllSelection = React.useCallback(() => {
|
|
1094
|
-
|
|
1095
|
-
}, [table]);
|
|
1096
|
-
return (jsxs(InlineDrawer, Object.assign({ position: "end", open:
|
|
2123
|
+
// const resetAllFilters = React.useCallback(() => {
|
|
2124
|
+
// table.setGlobalFilter('');
|
|
2125
|
+
// table.resetColumnFilters();
|
|
2126
|
+
// }, [table]);
|
|
2127
|
+
// const resetAllGrouping = React.useCallback(() => {
|
|
2128
|
+
// table.resetGrouping();
|
|
2129
|
+
// }, [table]);
|
|
2130
|
+
// const clearAllSelection = React.useCallback(() => {
|
|
2131
|
+
// table.toggleAllRowsSelected(false);
|
|
2132
|
+
// }, [table]);
|
|
2133
|
+
return (jsxs(InlineDrawer, Object.assign({ position: "end", open: drawerState.isViewsDrawerOpen, separator: true }, { children: [jsx(DrawerHeader, { children: jsx(DrawerHeaderTitle, Object.assign({ action: jsx(Button, { appearance: "subtle", "aria-label": "Close", icon: jsx(Dismiss24Regular, {}), onClick: () => dispatch({ type: "CLOSE_VIEW_DRAWER" }) }) }, { children: "Table Views" })) }), jsxs(DrawerBody, Object.assign({ className: styles.drawerBody }, { children: [onTableViewSave && jsx(ViewSaveForm, { mode: 'create', getTableState: getTableState, onSave: onTableViewSave }), jsxs(MenuList, Object.assign({ checkedValues: checkedValues, onCheckedValueChange: onChange }, { children: [jsx(MenuItemRadio, Object.assign({ name: 'table-views', value: 'Default View', icon: jsx(ViewDesktop20Filled, {}), onClick: resetToGridDefaultView }, { children: "Default View" })), tableViews.length > 0 && jsx(MenuDivider, { children: "Additional Views" }), tableViews.map((view) => {
|
|
1097
2134
|
return (jsxs("div", Object.assign({ style: {
|
|
1098
2135
|
display: 'flex',
|
|
1099
2136
|
justifyContent: 'space-between',
|
|
1100
2137
|
alignItems: 'center',
|
|
1101
2138
|
width: '100%',
|
|
1102
2139
|
} }, { children: [jsx(MenuItemRadio, Object.assign({ name: "table-views", value: view.viewName, onClick: () => applyTableState(view.tableState), icon: jsx(ViewDesktop20Regular, {}) }, { children: view.viewName })), props.onTableViewDelete && (view === null || view === void 0 ? void 0 : view.isViewOwner) && (jsx(Button, { appearance: "subtle", "aria-label": "Close", icon: jsx(Dismiss24Regular, {}), onClick: () => { var _a; return (_a = props.onTableViewDelete) === null || _a === void 0 ? void 0 : _a.call(props, view); } }))] }), view.id + view.viewName));
|
|
1103
|
-
})] }))] })), jsx(DrawerFooter, { children: jsxs(MenuList, { children: [jsx(MenuDivider, {}), jsx(MenuItem, Object.assign({ icon: jsx(ClearFilterIcon, {}), onClick:
|
|
2140
|
+
})] }))] })), jsx(DrawerFooter, { children: jsxs(MenuList, { children: [jsx(MenuDivider, {}), jsx(MenuItem, Object.assign({ icon: jsx(ClearFilterIcon, {}), onClick: resetToGridDefaultView }, { children: "Reset to Default View" }))] }) })] })));
|
|
2141
|
+
};
|
|
2142
|
+
|
|
2143
|
+
const TableActions = {
|
|
2144
|
+
TOGGLE_FILTER_DRAWER: 'TOGGLE_FILTER_DRAWER',
|
|
2145
|
+
TOGGLE_VIEW_DRAWER: 'TOGGLE_VIEW_DRAWER',
|
|
2146
|
+
OPEN_FILTER_DRAWER: 'OPEN_FILTER_DRAWER',
|
|
2147
|
+
OPEN_VIEW_DRAWER: 'OPEN_VIEW_DRAWER',
|
|
2148
|
+
CLOSE_FILTER_DRAWER: 'CLOSE_FILTER_DRAWER',
|
|
2149
|
+
CLOSE_VIEW_DRAWER: 'CLOSE_VIEW_DRAWER',
|
|
1104
2150
|
};
|
|
2151
|
+
// write a reducer function to handle the state of the table
|
|
2152
|
+
function tableReducer(state, action) {
|
|
2153
|
+
switch (action.type) {
|
|
2154
|
+
case TableActions.TOGGLE_FILTER_DRAWER:
|
|
2155
|
+
return Object.assign(Object.assign({}, state), { isFilterDrawerOpen: !state.isFilterDrawerOpen });
|
|
2156
|
+
case TableActions.TOGGLE_VIEW_DRAWER:
|
|
2157
|
+
return Object.assign(Object.assign({}, state), { isViewsDrawerOpen: !state.isViewsDrawerOpen });
|
|
2158
|
+
case TableActions.OPEN_FILTER_DRAWER:
|
|
2159
|
+
return Object.assign(Object.assign({}, state), { isFilterDrawerOpen: true });
|
|
2160
|
+
case TableActions.OPEN_VIEW_DRAWER:
|
|
2161
|
+
return Object.assign(Object.assign({}, state), { isViewsDrawerOpen: true });
|
|
2162
|
+
case TableActions.CLOSE_FILTER_DRAWER:
|
|
2163
|
+
return Object.assign(Object.assign({}, state), { isFilterDrawerOpen: false });
|
|
2164
|
+
case TableActions.CLOSE_VIEW_DRAWER:
|
|
2165
|
+
return Object.assign(Object.assign({}, state), { isViewsDrawerOpen: false });
|
|
2166
|
+
default:
|
|
2167
|
+
return state;
|
|
2168
|
+
}
|
|
2169
|
+
}
|
|
1105
2170
|
|
|
1106
2171
|
function AdvancedTable(props, ref) {
|
|
1107
2172
|
useStaticStyles();
|
|
1108
2173
|
const { table, globalFilter, headerMenu, tableViews, setGlobalFilter, resetToDefaultView, applyTableState, getTableState } = useGridContainer(props, ref);
|
|
1109
|
-
const [
|
|
1110
|
-
|
|
1111
|
-
|
|
2174
|
+
const [drawerState, dispatch] = React.useReducer(tableReducer, {
|
|
2175
|
+
isFilterDrawerOpen: false,
|
|
2176
|
+
isViewsDrawerOpen: false
|
|
2177
|
+
});
|
|
2178
|
+
return (jsxs(DndProvider, Object.assign({ backend: HTML5Backend }, { children: [jsx(GridHeader, { table: table, gridTitle: props.gridTitle, headerMenu: headerMenu, globalFilter: globalFilter, setGlobalFilter: setGlobalFilter, applyTableState: applyTableState, drawerState: drawerState, dispatch: dispatch }), jsxs("div", Object.assign({ style: { display: 'flex' } }, { children: [jsx(TableContainer, { table: table, data: props.data, isLoading: props.isLoading || false, rowSelectionMode: props.rowSelectionMode, noFilterMatchPage: props.noFilterMatchPage, noItemPage: props.noItemPage }), jsx(FilterDrawer, { drawerState: drawerState, dispatch: dispatch, table: table }), jsx(ViewsDrawer, { table: table, drawerState: drawerState, dispatch: dispatch, tableViews: tableViews, applyTableState: applyTableState, resetToGridDefaultView: resetToDefaultView, getTableState: getTableState, onTableViewSave: props.onTableViewSave, onTableViewDelete: props.onTableViewDelete })] })), jsx(Pagination, { table: table, pageSizeOptions: props.pageSizeOptions })] })));
|
|
1112
2179
|
}
|
|
1113
2180
|
const ForwardedAdvancedTable = React.forwardRef(AdvancedTable);
|
|
1114
2181
|
|