grep-components 2.10.0-gREPF-2708.2 → 2.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/41017f048e09b7d9.png +0 -0
- package/dist/assets/index.d.ts +2 -0
- package/dist/components/AppBar/stories/AppBarStory.stories.d.ts +2 -4
- package/dist/components/AppBarNavList/stories/AppBarNavList.stories.d.ts +2 -4
- package/dist/components/AppBarProfile/stories/AppBarProfile.stories.d.ts +2 -4
- package/dist/components/CircularLoading/stories/CircularLoading.stories.d.ts +4 -8
- package/dist/components/ConfirmationDialog/stories/dialog.stories.d.ts +4 -8
- package/dist/components/ContainedLinkList/stories/ContainedLinkList.stories.d.ts +2 -4
- package/dist/components/Footer/stories/Footer.stories.d.ts +4 -8
- package/dist/components/GDPR/stories/GDPR.stories.d.ts +2 -4
- package/dist/components/GrepCrumbs/stories/GrepCrumbs.stories.d.ts +4 -8
- package/dist/components/GrepDialog/stories/dialog.stories.d.ts +4 -8
- package/dist/components/GrepEditor/stories/GrepEditor.stories.d.ts +20 -40
- package/dist/components/GrepInput/stories/GrepInput.stories.d.ts +2 -4
- package/dist/components/GrepSelect/stories/GrepSelect.stories.d.ts +1 -1
- package/dist/components/GrepTable/stories/GrepTable.stories.d.ts +20 -40
- package/dist/components/GrepTableCard/stories/GrepTableCard.stories.d.ts +2 -4
- package/dist/components/GreyCover/stories/GreyCover.stories.d.ts +2 -4
- package/dist/components/InfoContainer/stories/infoContainer.stories.d.ts +4 -8
- package/dist/components/LinkList/stories/LinkList.stories.d.ts +2 -4
- package/dist/components/LoadingOverlay/stories/LoadingOverlay.stories.d.ts +5 -4
- package/dist/components/MainLayout/stories/MainLayout.stories.d.ts +2 -4
- package/dist/components/NavGuard/stories/NavGuard.stories.d.ts +6 -6
- package/dist/components/ProfileInfo/stories/ProfileInfo.stories.d.ts +2 -4
- package/dist/components/SearchBar/stories/SearchBar.stories.d.ts +2 -4
- package/dist/components/Sidebar/stories/Sidebar.stories.d.ts +4 -8
- package/dist/components/SortableTable/stories/SortableTable.stories.d.ts +2 -4
- package/dist/components/ToC/stories/ToC.stories.d.ts +2 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +166 -55
- package/dist/index.js.map +1 -1
- package/dist/stories/index.stories.d.ts +2 -4
- package/package.json +39 -15
- package/dist/assets/keycodeEnum.d.ts +0 -20
package/dist/index.js
CHANGED
|
@@ -133,32 +133,147 @@ const getTime = (datetime, options) => parseDate(datetime, options).format('[kl.
|
|
|
133
133
|
const getFullDate = (datetime, options) => parseDate(datetime, options).format('LLL');
|
|
134
134
|
const getExcelDateTime = (datetime, options) => parseDate(datetime, options).format('L HH:mm');
|
|
135
135
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
136
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
137
|
+
|
|
138
|
+
function getDefaultExportFromCjs (x) {
|
|
139
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
var Key_enum = {};
|
|
143
|
+
|
|
144
|
+
var hasRequiredKey_enum;
|
|
145
|
+
|
|
146
|
+
function requireKey_enum () {
|
|
147
|
+
if (hasRequiredKey_enum) return Key_enum;
|
|
148
|
+
hasRequiredKey_enum = 1;
|
|
149
|
+
(function (exports) {
|
|
150
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
151
|
+
(function (Key) {
|
|
152
|
+
Key[Key["Backspace"] = 8] = "Backspace";
|
|
153
|
+
Key[Key["Tab"] = 9] = "Tab";
|
|
154
|
+
Key[Key["Enter"] = 13] = "Enter";
|
|
155
|
+
Key[Key["Shift"] = 16] = "Shift";
|
|
156
|
+
Key[Key["Ctrl"] = 17] = "Ctrl";
|
|
157
|
+
Key[Key["Alt"] = 18] = "Alt";
|
|
158
|
+
Key[Key["PauseBreak"] = 19] = "PauseBreak";
|
|
159
|
+
Key[Key["CapsLock"] = 20] = "CapsLock";
|
|
160
|
+
Key[Key["Escape"] = 27] = "Escape";
|
|
161
|
+
Key[Key["Space"] = 32] = "Space";
|
|
162
|
+
Key[Key["PageUp"] = 33] = "PageUp";
|
|
163
|
+
Key[Key["PageDown"] = 34] = "PageDown";
|
|
164
|
+
Key[Key["End"] = 35] = "End";
|
|
165
|
+
Key[Key["Home"] = 36] = "Home";
|
|
166
|
+
Key[Key["LeftArrow"] = 37] = "LeftArrow";
|
|
167
|
+
Key[Key["UpArrow"] = 38] = "UpArrow";
|
|
168
|
+
Key[Key["RightArrow"] = 39] = "RightArrow";
|
|
169
|
+
Key[Key["DownArrow"] = 40] = "DownArrow";
|
|
170
|
+
Key[Key["Insert"] = 45] = "Insert";
|
|
171
|
+
Key[Key["Delete"] = 46] = "Delete";
|
|
172
|
+
Key[Key["Zero"] = 48] = "Zero";
|
|
173
|
+
Key[Key["ClosedParen"] = 48] = "ClosedParen";
|
|
174
|
+
Key[Key["One"] = 49] = "One";
|
|
175
|
+
Key[Key["ExclamationMark"] = 49] = "ExclamationMark";
|
|
176
|
+
Key[Key["Two"] = 50] = "Two";
|
|
177
|
+
Key[Key["AtSign"] = 50] = "AtSign";
|
|
178
|
+
Key[Key["Three"] = 51] = "Three";
|
|
179
|
+
Key[Key["PoundSign"] = 51] = "PoundSign";
|
|
180
|
+
Key[Key["Hash"] = 51] = "Hash";
|
|
181
|
+
Key[Key["Four"] = 52] = "Four";
|
|
182
|
+
Key[Key["DollarSign"] = 52] = "DollarSign";
|
|
183
|
+
Key[Key["Five"] = 53] = "Five";
|
|
184
|
+
Key[Key["PercentSign"] = 53] = "PercentSign";
|
|
185
|
+
Key[Key["Six"] = 54] = "Six";
|
|
186
|
+
Key[Key["Caret"] = 54] = "Caret";
|
|
187
|
+
Key[Key["Hat"] = 54] = "Hat";
|
|
188
|
+
Key[Key["Seven"] = 55] = "Seven";
|
|
189
|
+
Key[Key["Ampersand"] = 55] = "Ampersand";
|
|
190
|
+
Key[Key["Eight"] = 56] = "Eight";
|
|
191
|
+
Key[Key["Star"] = 56] = "Star";
|
|
192
|
+
Key[Key["Asterik"] = 56] = "Asterik";
|
|
193
|
+
Key[Key["Nine"] = 57] = "Nine";
|
|
194
|
+
Key[Key["OpenParen"] = 57] = "OpenParen";
|
|
195
|
+
Key[Key["A"] = 65] = "A";
|
|
196
|
+
Key[Key["B"] = 66] = "B";
|
|
197
|
+
Key[Key["C"] = 67] = "C";
|
|
198
|
+
Key[Key["D"] = 68] = "D";
|
|
199
|
+
Key[Key["E"] = 69] = "E";
|
|
200
|
+
Key[Key["F"] = 70] = "F";
|
|
201
|
+
Key[Key["G"] = 71] = "G";
|
|
202
|
+
Key[Key["H"] = 72] = "H";
|
|
203
|
+
Key[Key["I"] = 73] = "I";
|
|
204
|
+
Key[Key["J"] = 74] = "J";
|
|
205
|
+
Key[Key["K"] = 75] = "K";
|
|
206
|
+
Key[Key["L"] = 76] = "L";
|
|
207
|
+
Key[Key["M"] = 77] = "M";
|
|
208
|
+
Key[Key["N"] = 78] = "N";
|
|
209
|
+
Key[Key["O"] = 79] = "O";
|
|
210
|
+
Key[Key["P"] = 80] = "P";
|
|
211
|
+
Key[Key["Q"] = 81] = "Q";
|
|
212
|
+
Key[Key["R"] = 82] = "R";
|
|
213
|
+
Key[Key["S"] = 83] = "S";
|
|
214
|
+
Key[Key["T"] = 84] = "T";
|
|
215
|
+
Key[Key["U"] = 85] = "U";
|
|
216
|
+
Key[Key["V"] = 86] = "V";
|
|
217
|
+
Key[Key["W"] = 87] = "W";
|
|
218
|
+
Key[Key["X"] = 88] = "X";
|
|
219
|
+
Key[Key["Y"] = 89] = "Y";
|
|
220
|
+
Key[Key["Z"] = 90] = "Z";
|
|
221
|
+
Key[Key["LeftWindowKey"] = 91] = "LeftWindowKey";
|
|
222
|
+
Key[Key["RightWindowKey"] = 92] = "RightWindowKey";
|
|
223
|
+
Key[Key["SelectKey"] = 93] = "SelectKey";
|
|
224
|
+
Key[Key["Numpad0"] = 96] = "Numpad0";
|
|
225
|
+
Key[Key["Numpad1"] = 97] = "Numpad1";
|
|
226
|
+
Key[Key["Numpad2"] = 98] = "Numpad2";
|
|
227
|
+
Key[Key["Numpad3"] = 99] = "Numpad3";
|
|
228
|
+
Key[Key["Numpad4"] = 100] = "Numpad4";
|
|
229
|
+
Key[Key["Numpad5"] = 101] = "Numpad5";
|
|
230
|
+
Key[Key["Numpad6"] = 102] = "Numpad6";
|
|
231
|
+
Key[Key["Numpad7"] = 103] = "Numpad7";
|
|
232
|
+
Key[Key["Numpad8"] = 104] = "Numpad8";
|
|
233
|
+
Key[Key["Numpad9"] = 105] = "Numpad9";
|
|
234
|
+
Key[Key["Multiply"] = 106] = "Multiply";
|
|
235
|
+
Key[Key["Add"] = 107] = "Add";
|
|
236
|
+
Key[Key["Subtract"] = 109] = "Subtract";
|
|
237
|
+
Key[Key["DecimalPoint"] = 110] = "DecimalPoint";
|
|
238
|
+
Key[Key["Divide"] = 111] = "Divide";
|
|
239
|
+
Key[Key["F1"] = 112] = "F1";
|
|
240
|
+
Key[Key["F2"] = 113] = "F2";
|
|
241
|
+
Key[Key["F3"] = 114] = "F3";
|
|
242
|
+
Key[Key["F4"] = 115] = "F4";
|
|
243
|
+
Key[Key["F5"] = 116] = "F5";
|
|
244
|
+
Key[Key["F6"] = 117] = "F6";
|
|
245
|
+
Key[Key["F7"] = 118] = "F7";
|
|
246
|
+
Key[Key["F8"] = 119] = "F8";
|
|
247
|
+
Key[Key["F9"] = 120] = "F9";
|
|
248
|
+
Key[Key["F10"] = 121] = "F10";
|
|
249
|
+
Key[Key["F11"] = 122] = "F11";
|
|
250
|
+
Key[Key["F12"] = 123] = "F12";
|
|
251
|
+
Key[Key["NumLock"] = 144] = "NumLock";
|
|
252
|
+
Key[Key["ScrollLock"] = 145] = "ScrollLock";
|
|
253
|
+
Key[Key["SemiColon"] = 186] = "SemiColon";
|
|
254
|
+
Key[Key["Equals"] = 187] = "Equals";
|
|
255
|
+
Key[Key["Comma"] = 188] = "Comma";
|
|
256
|
+
Key[Key["Dash"] = 189] = "Dash";
|
|
257
|
+
Key[Key["Period"] = 190] = "Period";
|
|
258
|
+
Key[Key["UnderScore"] = 189] = "UnderScore";
|
|
259
|
+
Key[Key["PlusSign"] = 187] = "PlusSign";
|
|
260
|
+
Key[Key["ForwardSlash"] = 191] = "ForwardSlash";
|
|
261
|
+
Key[Key["Tilde"] = 192] = "Tilde";
|
|
262
|
+
Key[Key["GraveAccent"] = 192] = "GraveAccent";
|
|
263
|
+
Key[Key["OpenBracket"] = 219] = "OpenBracket";
|
|
264
|
+
Key[Key["ClosedBracket"] = 221] = "ClosedBracket";
|
|
265
|
+
Key[Key["Quote"] = 222] = "Quote";
|
|
266
|
+
})(exports.Key || (exports.Key = {}));
|
|
267
|
+
} (Key_enum));
|
|
268
|
+
return Key_enum;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
var Key_enumExports = requireKey_enum();
|
|
157
272
|
|
|
158
273
|
const onActivation = (cb) => (ev) => {
|
|
159
|
-
switch (ev.
|
|
160
|
-
case Key.Space:
|
|
161
|
-
case Key.Enter:
|
|
274
|
+
switch (ev.which) {
|
|
275
|
+
case Key_enumExports.Key.Space:
|
|
276
|
+
case Key_enumExports.Key.Enter:
|
|
162
277
|
cb(ev);
|
|
163
278
|
break;
|
|
164
279
|
}
|
|
@@ -1595,11 +1710,11 @@ const MainLayout = (props) => (React.createElement(Box, { display: "flex", flex:
|
|
|
1595
1710
|
|
|
1596
1711
|
const CollapsableMenu = ({ children, onMenuClose, ...collapseProps }) => {
|
|
1597
1712
|
const onKeyDown = (e) => {
|
|
1598
|
-
switch (e.
|
|
1599
|
-
case Key.Escape:
|
|
1713
|
+
switch (e.keyCode) {
|
|
1714
|
+
case Key_enumExports.Key.Escape:
|
|
1600
1715
|
onMenuClose && onMenuClose();
|
|
1601
1716
|
return;
|
|
1602
|
-
case Key.
|
|
1717
|
+
case Key_enumExports.Key.LeftArrow:
|
|
1603
1718
|
onMenuClose && onMenuClose();
|
|
1604
1719
|
}
|
|
1605
1720
|
e.stopPropagation();
|
|
@@ -1679,8 +1794,8 @@ const CollapsableMenuItem = ({ items, onClick, children, onClose: _onclose, tool
|
|
|
1679
1794
|
}, [onStatusChange, setOpen, listItemRef]);
|
|
1680
1795
|
const handleKey = (e) => {
|
|
1681
1796
|
if (items) {
|
|
1682
|
-
switch (e.
|
|
1683
|
-
case Key.
|
|
1797
|
+
switch (e.keyCode) {
|
|
1798
|
+
case Key_enumExports.Key.RightArrow:
|
|
1684
1799
|
if (expand()) {
|
|
1685
1800
|
e.preventDefault();
|
|
1686
1801
|
e.stopPropagation();
|
|
@@ -2200,8 +2315,8 @@ const GrepTable = ({ placeholderText, dropdownItems, isRowDisabled, pagination,
|
|
|
2200
2315
|
}, onClick: (e) => {
|
|
2201
2316
|
_openDropdown(e, row);
|
|
2202
2317
|
}, onKeyDown: (e) => {
|
|
2203
|
-
switch (e.
|
|
2204
|
-
case Key.Enter:
|
|
2318
|
+
switch (e.which) {
|
|
2319
|
+
case Key_enumExports.Key.Enter:
|
|
2205
2320
|
// dont show dropdown
|
|
2206
2321
|
e.preventDefault();
|
|
2207
2322
|
break;
|
|
@@ -2258,34 +2373,34 @@ const GrepTable = ({ placeholderText, dropdownItems, isRowDisabled, pagination,
|
|
|
2258
2373
|
setSelectedRowIndex(i);
|
|
2259
2374
|
}
|
|
2260
2375
|
};
|
|
2261
|
-
switch (e.
|
|
2262
|
-
case Key.
|
|
2376
|
+
switch (e.keyCode) {
|
|
2377
|
+
case Key_enumExports.Key.DownArrow:
|
|
2263
2378
|
moveSelectedRow(1);
|
|
2264
2379
|
break;
|
|
2265
|
-
case Key.
|
|
2380
|
+
case Key_enumExports.Key.UpArrow:
|
|
2266
2381
|
moveSelectedRow(-1);
|
|
2267
2382
|
break;
|
|
2268
|
-
case Key.
|
|
2269
|
-
case Key.PageUp:
|
|
2383
|
+
case Key_enumExports.Key.LeftArrow:
|
|
2384
|
+
case Key_enumExports.Key.PageUp:
|
|
2270
2385
|
moveSelectedRow(-rowsPerPage);
|
|
2271
2386
|
break;
|
|
2272
|
-
case Key.
|
|
2273
|
-
case Key.PageDown:
|
|
2387
|
+
case Key_enumExports.Key.RightArrow:
|
|
2388
|
+
case Key_enumExports.Key.PageDown:
|
|
2274
2389
|
moveSelectedRow(rowsPerPage);
|
|
2275
2390
|
break;
|
|
2276
|
-
case Key.Home:
|
|
2391
|
+
case Key_enumExports.Key.Home:
|
|
2277
2392
|
setSelectedRowIndex(0);
|
|
2278
2393
|
break;
|
|
2279
|
-
case Key.End:
|
|
2394
|
+
case Key_enumExports.Key.End:
|
|
2280
2395
|
setSelectedRowIndex(maxIndex);
|
|
2281
2396
|
break;
|
|
2282
|
-
case Key.Tab:
|
|
2397
|
+
case Key_enumExports.Key.Tab:
|
|
2283
2398
|
requestAnimationFrame(() => {
|
|
2284
2399
|
// check is any children still has focus
|
|
2285
2400
|
!containsFocus(tableRef.current) && setSelectedRowIndex(-1);
|
|
2286
2401
|
});
|
|
2287
2402
|
break;
|
|
2288
|
-
case Key.Enter:
|
|
2403
|
+
case Key_enumExports.Key.Enter:
|
|
2289
2404
|
selectedRow && _handleRowClick(selectedRow);
|
|
2290
2405
|
break;
|
|
2291
2406
|
}
|
|
@@ -2603,12 +2718,6 @@ const useDate = (value = null, options) => {
|
|
|
2603
2718
|
return [date, setDate];
|
|
2604
2719
|
};
|
|
2605
2720
|
|
|
2606
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
2607
|
-
|
|
2608
|
-
function getDefaultExportFromCjs (x) {
|
|
2609
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
2610
|
-
}
|
|
2611
|
-
|
|
2612
2721
|
/**
|
|
2613
2722
|
* lodash (Custom Build) <https://lodash.com/>
|
|
2614
2723
|
* Build: `lodash modularize exports="npm" -o ./`
|
|
@@ -13049,7 +13158,7 @@ const GrepTableOfContentNav = (props) => {
|
|
|
13049
13158
|
});
|
|
13050
13159
|
}, [ref]);
|
|
13051
13160
|
const onKeyDown = (e) => {
|
|
13052
|
-
if (selected && e.
|
|
13161
|
+
if (selected && e.which === Key_enumExports.Key.Tab && e.shiftKey === false) {
|
|
13053
13162
|
const tabindex = selected.getAttribute('tabindex');
|
|
13054
13163
|
selected.setAttribute('tabindex', '0');
|
|
13055
13164
|
selected.focus();
|
|
@@ -13059,12 +13168,12 @@ const GrepTableOfContentNav = (props) => {
|
|
|
13059
13168
|
: selected.setAttribute('tabindex', tabindex);
|
|
13060
13169
|
});
|
|
13061
13170
|
}
|
|
13062
|
-
if (
|
|
13171
|
+
if ([Key_enumExports.Key.UpArrow, Key_enumExports.Key.DownArrow].includes(e.which)) {
|
|
13063
13172
|
e.preventDefault();
|
|
13064
13173
|
e.stopPropagation();
|
|
13065
13174
|
const nodes = Object.values(elements);
|
|
13066
13175
|
const currentIndex = nodes.indexOf(selected);
|
|
13067
|
-
const moveIndex = e.
|
|
13176
|
+
const moveIndex = e.which === Key_enumExports.Key.UpArrow ? -1 : 1;
|
|
13068
13177
|
const next = nodes[currentIndex + moveIndex];
|
|
13069
13178
|
next && setSelected(next, true);
|
|
13070
13179
|
focusSelected();
|
|
@@ -13072,13 +13181,13 @@ const GrepTableOfContentNav = (props) => {
|
|
|
13072
13181
|
};
|
|
13073
13182
|
useEffect(() => {
|
|
13074
13183
|
const onKeyDown = (e) => {
|
|
13075
|
-
e.
|
|
13184
|
+
e.keyCode === Key_enumExports.Key.Alt && setShowKeyboardHint(true);
|
|
13076
13185
|
if (e.altKey) {
|
|
13077
|
-
e.
|
|
13186
|
+
e.keyCode === Key_enumExports.Key.I && focusSelected();
|
|
13078
13187
|
}
|
|
13079
13188
|
};
|
|
13080
13189
|
const onKeyUp = (e) => {
|
|
13081
|
-
e.
|
|
13190
|
+
e.keyCode === Key_enumExports.Key.Alt && setShowKeyboardHint(false);
|
|
13082
13191
|
};
|
|
13083
13192
|
window.addEventListener('keydown', onKeyDown);
|
|
13084
13193
|
window.addEventListener('keyup', onKeyUp);
|
|
@@ -13100,5 +13209,7 @@ const GrepTableOfContent = ({ style, className, setSelectedValue, percentageRend
|
|
|
13100
13209
|
};
|
|
13101
13210
|
GrepTableOfContent.displayName = 'Grep.ToC';
|
|
13102
13211
|
|
|
13103
|
-
|
|
13212
|
+
var utdanningsdirektoratetLogoRgbNeg = "41017f048e09b7d9.png";
|
|
13213
|
+
|
|
13214
|
+
export { AppBar, AppBarNavList, AppBarProfile, BodyLayout, CircularLoading, Colors, ConfirmationServiceProvider, ContainedLinkList, DatePicker, DropdownMenu, Footer, GDPR, GrepCrumbs, DatePicker as GrepDatePicker, GrepDateRange, GrepDialogServiceProvider, GrepEditor, GrepInput, GrepSelect, GrepTable, GrepTableCard, GrepTableOfContent, GrepTableRow, GreyCover, InfoContainer, LinkList, LoadingOverlay, MainLayout, NavGuard, OverflowTooltip, ProfileInfo, SearchBar, ServiceMessage, Sidebar, SortableTable, utdanningsdirektoratetLogoRgbNeg as UdirLogo, index as Utils, convertToRgba, filterElements as filterContentElements, hex2rgb, hex2rgba, makeStyles, useConfirmation, useContentElements, useDate, useDebounce, useGrepDialog, useStyles$d as useStyles, withStyles };
|
|
13104
13215
|
//# sourceMappingURL=index.js.map
|