@linn-it/linn-form-components-library 13.0.0-alpha.3 → 13.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linn-it/linn-form-components-library",
3
- "version": "13.0.0-alpha.3",
3
+ "version": "13.4.0",
4
4
  "private": false,
5
5
  "jest": {
6
6
  "testEnvironment": "jsdom"
@@ -32,7 +32,7 @@
32
32
  "@emotion/react": "^11.6.0",
33
33
  "@emotion/styled": "^11.6.0",
34
34
  "@mui/icons-material": "^5.2.0",
35
- "@mui/lab": "^5.0.0-alpha.56",
35
+ "@mui/lab": "5.0.0-alpha.64",
36
36
  "@mui/material": "^5.2.2",
37
37
  "@mui/styles": "^5.2.0",
38
38
  "notistack": "^2.0.3",
package/CHANGELOG.md DELETED
@@ -1,612 +0,0 @@
1
- # Changelog
2
- ## [13.0.0] - 2021-12-08
3
- ### Changes (Breaking)
4
- - MUI 5
5
- - Integrate application state into Fetch and Update actions
6
-
7
- ## [12.7.0] - 2021-11-26
8
- ### Changes
9
- - Flip processStore working flag to false if the process request errors unexpectedly.
10
-
11
- ## [12.5.0] - 2021-11-10
12
- ### Changes
13
- - Upped react version in dependencies (peer dependencies already was) to react 17
14
- - rewrote tests to get rid of enzyme in order to allow this & removed enzyme from npm and everywhere used
15
- - upgrade other npm packages
16
- - Add wee change to Typeahead to offer built in clear button
17
-
18
-
19
- ## [12.5.0] - 2021-11-10
20
- ### Added
21
- - Added replaceRow method to useGroupEditTable hook to allow update of multiple fields at once. Use when changing a field requires dependent fields to also be updated.
22
-
23
- ## [12.4.0] - 2021-11-09
24
- ### Changes
25
- - Add openModalOnClick bool prop to Typeahead when in modal mode to set whether the modal opens as soon as the user interacts with the InputField, or only when they click the magnifying glass Icon. If you want to use it in this configuration you also need to pass a handleFieldChange function that takes the usual (propertyName, newValue) args.
26
-
27
- Defaults to true so current behaviour is maintained, i.e. modal opens as soon as user touches field. This basically facilitates optional Typeahead behaviour so a user who doesn't need to search can just enter a value straight in.
28
-
29
- ## [12.3.0] - 2021-11-03
30
- ### Changes
31
- - Add action to clear data to generic FetchApiActions action creators. Process these new actions in the collectionStore reducers.
32
-
33
- ## [12.2.0] - 2021-10-18
34
- ### Changes
35
- - Add functionality to limit and order search results in the Typeahead via passing optional number and function props respectively.
36
-
37
- ## [12.1.0] - 2021-09-20
38
- ### Changes
39
- - Dropdowns's TextField and InputLabel are now linked via the propertyName prop.
40
-
41
- ## [12.0.1] - 2021-09-15
42
- ### Changes
43
- - Update React to v17 and Material UI components.
44
-
45
- ## [11.8.0] - 2021-09-14
46
- ### Changes
47
- - Add fetchByPath to fetch and update actions to allow GETting of uri/id/path
48
-
49
- ## [11.7.2] - 2021-09-09
50
- ### Changes
51
- - Pass propertyName to InputField's that are wrapped in other components.
52
-
53
- ## [11.7.0] - 2021-09-03
54
- ### Changes
55
- - InputField's TextField and InputLabel are now linked via the propertyName prop, which is now required. This is an accesibility best practise as it allows screen readers etc. to correctly associate labels with input fields, but the benefit to us is that testing library's getByLabelText() document query now works.
56
-
57
-
58
- ## [11.6.0] - 2021-08-31
59
- ### Added
60
- - Added componentViewDisplay to editable table column options
61
- - Default option is 'value' which shows value in view mode as before.
62
- - Other option is 'nothing' which shows nothing in view mode but component when editing.
63
-
64
- ## [11.5.1] - 2021-04-26
65
- ### Added
66
- - Added clearItem to update actions
67
-
68
- ## [11.5.0] - 2021-04-19
69
- ### Added
70
- - Option to add custom style to editable table columns
71
-
72
- ## [11.4.1] - 2021-03-24
73
- ### Added
74
- - Added fetchById to FetchApiActions
75
-
76
- ## [11.4.0] - 2021-03-24
77
- ### Added
78
- - Added optional accept parameter to FetchApiActions and UpdateApiActions to allow request of different media types
79
-
80
- ## [11.3.6] - 2021-03-23
81
- ### Changed
82
- - Fixed mixed up Breadcrumbs defaultProps/PropTypes
83
-
84
- ## [11.3.5] - 2021-03-23
85
- ### Changed
86
- - Change breadcrumbs 'HOME' crumb to redirect to a specified home url. Defaults to app.linn.co.uk
87
- - Page component can optionally not render Breadcrumbs with a showBreadcrumbs bool prop. Defaults to true.
88
-
89
- ## [11.3.4] - 2021-03-19
90
- ### Changed
91
- - Added searchButtonOnly to TypeAhead to show search icon button only in modal mode
92
-
93
- ## [11.3.3] - 2021-03-11
94
- ### Changed
95
- - Added clear data action
96
-
97
- ## [11.3.2] - 2021-03-11
98
- ### Changed
99
- - Added clear data option to processes
100
-
101
- ## [11.3.1] - 2021-03-02
102
- ### Changed
103
- - Removed !important from display none on display only when printing
104
-
105
- ## [11.3.0] - 2021-02-24
106
- ### Added
107
- - Added getData option to process selectors
108
-
109
- ## [11.2.1] - 2021-02-16
110
- ### Added
111
- - Added wee style to hide something then show only when printing
112
-
113
- ## [11.2.0] - 2021-02-03
114
- ### Changed
115
- - Allow SingleEditTable to have multiline textfields. Allow newRow to be specified to render at top or bottom via new 'newRowPosition' prop. Deafults to "bottom" so no breaking/altering exsiting usages.
116
- - Allow modal version of the TypeaheadTable. Allow custon onSelect behaviour alongside default links behaviour.
117
-
118
- ## [11.1.8] - 2021-02-03
119
- ### Changed
120
- - Just needed to redeploy after trying to without logging into npm
121
-
122
- ## [11.1.7] - 2021-02-03
123
- ### Changed
124
- - Added optional "print-landscape" class to set page to print landscape
125
-
126
- ## [11.1.5] - 2021-01-29
127
- ### Changed
128
- - Allow custom debounce timer to be passed into Typeaheads. Higher debounce times mitigate against cases where searches take longer than the current debounce timer (500ms), which in turn can allow those searches late set of searchResults to arrive later than more recent searches results, and as such override the more recent and correct searchResults in redux state. This is really just a workaround but used in conjucntion with speeding up slow searches, e.g. by limiting their results sizes in the backend, it seems to solve issues in many cases.
129
-
130
- ## [11.1.4] - 2021-01-28
131
- ### Changed
132
- - Optionally limit searchItems returned from the collectionSelectors getSearchItems() function. This is to avoid huge searchResults lists freezing up UI components like Typeaheads
133
-
134
- ## [11.1.3] - 2021-01-28
135
- ### Fixed
136
- - TypeAheadDialog now auto focuses on search input field
137
- - Updated column and row documentation in single and group edit table stories
138
-
139
- ## [11.1.2] - 2021-01-27
140
- ### Changed
141
- - Pass in optional setEditStatus function to useGroupEditTable hook. This allows the table to set editStatus state in a parent component or redux state store.
142
-
143
- ## [11.1.1] - 2021-01-26
144
- ### Changed
145
- - Export useGroupEditTable hook
146
-
147
- ## [11.1.0] - 2021-01-26
148
- ### Changed
149
- - Support for limiting Typeahead to only fire off search after a set number of searchTerm characters. Also added support for the above in the table component.
150
-
151
- ## [11.0.0] - 2020-12-22
152
- ### Changed
153
- - Updated to Storybook 6 and updated story files
154
-
155
- ### Added
156
- - Components
157
- - SingleEditTable
158
- - GroupEditTable
159
- - Hooks
160
- - useGroupEditTable
161
-
162
- ### Removed
163
- - EditableTable
164
-
165
- ## [10.13.4] - 2020-01-07
166
- ### Fixed
167
- - `EditableTable` delete button logic and remove click listener which was always setting edit state to true after clicking cancel button
168
-
169
- ## [10.13.3] - 2020-01-07
170
- ### Fixed
171
- - Issue where not passing optional `isTableValid` to `EditableTable` would crash
172
-
173
- ## [10.13.2] - 2020-12-21
174
- ### Changed
175
- ## EditableTable
176
- - Fixed a weird bug where inputs were losing focus for no apparent reason
177
- - Added a groupEdit storybook example.
178
-
179
- ## [10.13.1] - 2020-12-17
180
- ### Changed
181
- ## EditableTable
182
- - Minor ui improvements for the Editable table. Rows open and optionally close on click and clickaway. Tooltips for buttons.
183
- - Delete button stays shown when row is closed if a deleteRow function is supplied.
184
- - Added optional tooltips for table cells. You pass this in as part of the columns array, in the form of a function that takes a row and derives a tooltip string from data in the row. You could return false from this function for some rows if they don't have any tooltips for that column. Storybook example updated to show how this works.
185
-
186
- ## [10.13.0] - 2020-12-16
187
- ### Added
188
- - groupEdit mode for EditableTable. This allows for editing, adding and saving of multiple rows at once in the component
189
- - added validator function to validate the complete table (e.g. for external save buttons)
190
-
191
- ## [10.12.5] - 2020-12-09
192
- ### Added
193
- - Added allowNewRowCreation option to EditableTable to stop user seeing the new row button
194
- ### Changed
195
- - Changed EditableTableRow to not show edit button when table is not editable
196
-
197
- ## [10.12.4] - 2020-12-09
198
- ### Added
199
- - Added closeEditingOnSave option to editableTable to allow editor to remain open if validation is failed
200
- - Added process data to process reducer
201
-
202
- ## [10.12.3] - 2020-12-07
203
- ### Fixed
204
- - Pass itemName into process action payload
205
- ## [10.12.2] - 2020-12-07
206
- ### Changed
207
- - Allow process action to have a payload
208
-
209
- ## [10.12.1] - 2020-11-20
210
- ### Fixed
211
-
212
- - Editable Table hides new row when it is saved and is no longer a 'new' row.
213
-
214
- ## [10.12.0] - 2020-11-20
215
- ### Fixed
216
-
217
- - Editable Table closes row on save click
218
-
219
- ## [10.11.0] - 2020-11-05
220
-
221
- ### Added
222
- - SelectedItemList optional maxHeight parameter to allow scrolling on long lists
223
-
224
- ## [10.10.3] - 2020-10-09
225
- - Updated material-ui packages
226
-
227
- ## [10.10.2] - 2020-09-16
228
-
229
- ### Fixed
230
-
231
- - Correctly set content type of delete body
232
-
233
- ## [10.10.1] - 2020-09-09
234
-
235
- ### Fixed
236
-
237
- - Can set body of delete action
238
-
239
- ## [10.10.0] - 2020-09-09
240
-
241
- ### Added
242
- - EditableTable
243
- - Delete row functionality
244
- - Optional custom update row function
245
- - Optional validate row function
246
- - Fields that are required but not editable can now be changed when creating a new row and will be read only when editing
247
- - Update styling of Save, Cancel and Delete buttons on table rows
248
- - UpdateApiActions.delete - id can be null
249
-
250
- ## [10.9.0] - 2020-09-02
251
- - Added: LinkButton component that can link to components inside the current (React Router) app via a Link component, or hrefs outside the current app with an html anchor. Optionally takes tooltip text as a prop if you want to display a tooltip, e.g. to inform the user why the button might be disabled.
252
-
253
- ## [10.8.0] - 2020-03-11
254
- - Added: smartGoBack function that can hop over the annoying oidc page to take a user to wherever they came from, whether that's inside the current app or not
255
- - Added: previousPathsSelector - selects a list of paths the user has been to inside this app from the store.
256
-
257
- ## [10.7.2] - 2020-02-25
258
- - Autofocus inputs on TableWithInlineEditing
259
- - Can now search the menu by href, e.g. you could type 'pcbwo' to find pcb works orders
260
-
261
- ## [10.7.1] - 2020-02-25
262
- - Added date utilities to index
263
-
264
- ## [10.7.0] - 2020-02-24
265
- - Added a search to the Navigation component
266
-
267
- ## [10.6.12] - 2020-02-21
268
- - Added: Updating a cell in a row in the TableWithInlineEditing can now optionally trigger updates for other cells in that row. This is useful if the result of input to one cell should auto update the other cells, e.g. if you enter a partNumber you could make the description autofill.
269
-
270
- ## [10.6.11] - 2020-02-19
271
- - Add printStyles to the build. Importing any component from this library now gives you the print styles (which will now be centrally maintained here) for free.
272
-
273
- ## [10.6.7] - 2020-02-17
274
- - Updated redux-api-middleware to v3.2.0
275
-
276
- ## [10.6.5] - 2020-02-12
277
- - Made report table 'avoid page break' style the default, but is now optional in report table and multi report table
278
-
279
- ## [10.6.4] - 2020-02-12
280
- - Added CI. All commits now run the tests and build scripts. All commits (which should only be merge commits!) to master run build -> test -> publish -> deploy. Updated the readme, replacing the old manual change integraton manual with this new process.
281
-
282
- ## [10.6.3] - 2020-02-05
283
- - pass column widths to ReportData in three sizes small/medium/large
284
-
285
- ## [10.6.1] - 2020-02-06
286
-
287
- ## Changed
288
- - Remove new row from EditableTable on clicking cancel button
289
-
290
- ## [10.6.0] - 2020-02-04
291
-
292
- ## Changed
293
- - Allow alternative text than 'Back' on the BackButton. This is really so that you can be more specified, e.g. 'Back to Menu'.
294
- - Allow a custom debounce (time in ms) to be passed into useSearch. Example of usage in TypeaheadTable.
295
- - Allow a minimum search term length before the search gets fired off. This is useful in cases like board parts lookups, where the first 4 characters are pretty meaningless (i.e. PCAS or PCSM). Defaults to one to avoid any breakage.
296
-
297
- ## [10.5.0] - 2020-01-30
298
-
299
- ## Added
300
- - UpdateApiActions: add id parameter can take null value
301
-
302
- ## [10.4.1] - 2020-01-15
303
-
304
- ## Added
305
- - TableWithInlineEditing: allow disabled and required columns
306
-
307
- ## [10.4.0] - 2020-01-14
308
-
309
- ## Added
310
- - added delete into item factory and updateApiActions & makeactions
311
-
312
- ## [10.3.8] - 2020-01-14
313
-
314
- ## Fixed
315
- - EditableTable component factory will show null dates
316
- - Added missing newRow prop to EditableTable
317
-
318
- ## [10.3.7] - 2020-01-14
319
-
320
- ## Added
321
- - Disabled option for Typeahead, defaults to false.
322
-
323
- ## [10.3.6] - 2020-01-10
324
-
325
- ## Fixed
326
- - EditableTable now correctly renders null dates in display mode
327
-
328
- ## [10.3.5] - 2020-01-10
329
-
330
- ## Changed
331
- - Default rowTitle to noWrap class in ReportTable.
332
-
333
- ## [10.3.4] - 2020-01-10
334
-
335
- ## Added
336
- - Unbreak navigation styles already applied
337
-
338
- ## [10.3.3] - 2020-01-09
339
-
340
- ## Added
341
- - Classes to be used to hide Navigation and Breadcrumbs when printing
342
-
343
- ## [10.3.2] - 2020-01-09
344
-
345
- ## Added
346
- - Editable Table stories
347
-
348
- ## Changed
349
- - Export Editable Table component
350
-
351
- ## [10.3.1] - 2020-01-09
352
-
353
- ## Changed
354
- - Highlight total columns in ReportTable
355
-
356
- ## [10.3.0] - 2020-01-07
357
-
358
- ## Added
359
- - Editable Table component
360
- - Keyboard input to Linn Week Picker
361
-
362
- ## Changed
363
- - Linn Week Picker component label prop is no longer required
364
- - Dropdown label prop is no longer required
365
-
366
- ## [10.2.5] - 2020-01-06
367
-
368
- ## Changed
369
- - Reverted theme provider back to old import using MuiThemeProvider
370
-
371
- ## [10.2.4] - 2020-01-06
372
-
373
- ## Changed
374
- - Fixed forgotten tests for loading inside application state + updated how we used MuiThemeProvider to most current way to get rid of warnings
375
-
376
- ## [10.2.3] - 2019-12-0
377
-
378
- ## Changed
379
- - Add loading inside application state in item & collection factory reducers and selectors
380
-
381
- ## [10.2.1] - 2019-12-0
382
-
383
- ## Changed
384
- - Pass placeholder text prop to the InputField in the modal as well as the main one.
385
-
386
- ## [10.2.0] - 2019-12-06
387
-
388
- ## Changed
389
-
390
- - Extended the Typeahead to be more flexible than a search that just links you to other pages. It now takes an onSelect action as an optional prop such that you can define custom behaviour, and a links boolean which you can set to false to override the default behaviour of navigating to a new page onSelect. You should provide an onSelect function and a links={false} configuration if custom behaviour is required ( and conversely should not provide an onSelect and a links={true} config, since any onSelect() bheaviour is ignored if links is true anyway).
391
-
392
- Now also takes an optional modal boolean prop which lets you display search results in a modal as opposed to below the search which is useful for using this in a form where there isn't space to displau search results in the same plane as the field.
393
-
394
- The two new props have default values such that original use cases are respected - i.e. links={true} and modal={false} - hence no breaking changes in this version.
395
-
396
- ## [10.1.0] - 2019-12-04
397
- ### Added
398
- - StateApiActions
399
- ### Changed
400
- - added application state to actions, reducers and selectors
401
-
402
- ## [10.0.4] - 2019-11-21
403
-
404
- ### Changed
405
-
406
- - added css for printing tables and used within page
407
-
408
- ## [10.0.3] - 2019-11-20
409
-
410
- ### Changed
411
-
412
- - added fix for side scrolling issue
413
-
414
- ## [10.0.1] - 2019-11-18
415
-
416
- ### Changed
417
-
418
- - Reverted formatTitle to previous version with drilldown and formatting.
419
-
420
- ## [10.0.0] - 2019-11-18
421
-
422
- ### Changed
423
-
424
- - Declared notistack and react router as peer and dev dependencies as opposed to production dependencies. This means this package will expect to find them in your consuming project at the same version as declared here.
425
-
426
- ## [9.0.3] - 2019-11-15
427
-
428
- ### Changed
429
-
430
- - Update table with inline editing to include add and delete icons, extra props for these permissions + tests
431
-
432
- ## [9.0.2] - 2019-11-13
433
-
434
- ### Fixed
435
-
436
- - ```LinnWeekPicker``` now takes strings or date objects
437
-
438
- ### Added
439
-
440
- - ```dateUtilities``` for Linn Weeks
441
- - Tests for ```LinnWeekPicker```
442
-
443
- ## [9.0.2] - 2019-11-12
444
-
445
- ### Changed
446
-
447
- - Declare @material-ui/pickers as a peer dependency and a dev dependency. This is so that the tests pass in Production without there being two instances of the package AND so that the @material-ui/pickers package is available to the storybook too. I can't think of any other way to solve this problem...
448
-
449
- ## [9.0.1] - 2019-11-12
450
-
451
- ### Changed
452
-
453
- - Use same version of react-redux as consuming projects.
454
-
455
- ## [9.0.0] - 2019-11-12
456
-
457
- ### Removed
458
-
459
- - clearSearch() and clearErrors() actionCreators from UpdateApiActions.js. We don't use these.
460
-
461
- ### Fixed
462
-
463
- - Various errors that resulted in unwanted debug warnings across numerous components.
464
-
465
- - Dropdown - Now handles an allowNoValue as well as an optionsLoading state, both passed in as props (bool).
466
-
467
- ## [8.1.0] - 2019-11-06
468
-
469
- ### Added
470
-
471
- - New Component - LinnWeekPicker
472
-
473
- ## [8.0.1] - 2019-10-31
474
-
475
- ### Fixed
476
-
477
- - Added TableWithInlineEditing to the index. I had accidentally removed it.
478
-
479
- ## [8.0.0] - 2019-10-29
480
-
481
- ### Added
482
-
483
- - TypeheadTable - a typeahead with tabulated results
484
-
485
- ### Removed
486
-
487
- - InfiniteTable
488
-
489
- ## [7.5.0] - 2019-10-29
490
-
491
- ### Added
492
-
493
- - Table with inline editing
494
-
495
- ## [7.4.2] - 2019-10-28
496
-
497
- ### Changed
498
-
499
- - Support nowrap option on report cells
500
-
501
- ## [7.4.1]
502
-
503
- ### Changed
504
-
505
- - Added missing process action type
506
-
507
- ## [7.4.0] - 2019-10-10
508
-
509
- ### Added
510
-
511
- - Added clear error method to process actions.
512
-
513
- ## [7.3.0] - 2019-10-10
514
-
515
- ### Changed
516
-
517
- - Changed initialiseOnMount to pass props into initialise when itemId not provided.
518
- Fixed broken reportOptionsFactory.
519
-
520
- ## [7.2.1] - 2019-10-10
521
-
522
- ### Added
523
-
524
- - Added makeProcessActionTypes and new rsaaType for process
525
-
526
- ## [7.2.0] - 2019-10-08
527
-
528
- ### Added
529
-
530
- - New Component - ValidatedInputDialog
531
-
532
- ### Changed
533
-
534
- - Fixed broken stories.
535
-
536
- ## [7.1.1] - 2019-10-07
537
-
538
- ### Added
539
-
540
- - ProcessActions, ProcessSelectors and processStoreFactory
541
-
542
- ## [7.1.0] - 2019-10-04
543
-
544
- ### Added
545
-
546
- - CHANGELOG.md
547
-
548
- ## [7.0.2] - 2019-10-03
549
-
550
- ### Added
551
-
552
- - Export error details message selector
553
-
554
- ## [7.0.1] - 2019-10-02
555
-
556
- ### Added
557
-
558
- - Fetch error details message selector
559
-
560
- ## [7.0.0] - 2019-09-26
561
-
562
- ### Added
563
-
564
- - Report errors
565
- - Report actions must add their item type as the first prop
566
- ```
567
- export default new ReportActions(
568
- reportTypes.whoBuiltWhat.item,
569
- reportTypes.whoBuiltWhatDetails.actionType,
570
- reportTypes.whoBuiltWhatDetails.uri,
571
- actionTypes,
572
- config.appRoot
573
- );
574
- ```
575
-
576
- ## [6.0.0] - 2019-09-23
577
-
578
- ### Added
579
-
580
- - New error style
581
- - Actions must add their item type as the first prop
582
- ```
583
- export default new FetchApiActions(
584
- itemTypes.cits.item,
585
- itemTypes.cits.actionType,
586
- itemTypes.cits.uri,
587
- actionTypes,
588
- config.appRoot
589
- );
590
- ```
591
-
592
- ### Changed
593
-
594
- - action types to shared rsaa types
595
-
596
- ## [5.0.0] - 2019-16-08
597
-
598
- ### Added
599
-
600
- - Date time picker
601
-
602
- ### Changed
603
-
604
- - Utilites functions exported from utilites file
605
- - All imports must be updated
606
- `import { getHref } from '@linn/react-components-library'`
607
- should now be
608
- `import { utilites } from '@linn/react-components-library'`
609
- and used as
610
- `utilities.getHref(item)`
611
- - Rollup config
612
- - Bundle splitting
@@ -1 +0,0 @@
1
- "use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var e=require("react"),r=_interopDefault(e),l=_interopDefault(require("@mui/styles/makeStyles")),a=_interopDefault(require("@mui/material/Button")),t=_interopDefault(require("prop-types")),n=require("./_rollupPluginBabelHelpers-79c12e22.js"),o=_interopDefault(require("@mui/material/Typography")),s=_interopDefault(require("@mui/material/Link")),i=_interopDefault(require("@mui/material/Table")),u=_interopDefault(require("@mui/material/TableBody")),c=_interopDefault(require("@mui/material/TableCell")),m=_interopDefault(require("@mui/material/TableHead")),p=_interopDefault(require("@mui/material/TableRow")),d=_interopDefault(require("@mui/material/Paper")),h=_interopDefault(require("numeral")),f=_interopDefault(require("@mui/material/Modal")),w=require("react-router-dom"),y=require("./Title.js"),g=require("./ErrorCard.js"),E=l((function(e){return{link:{textDecoration:"none",color:e.palette.primary.main,padding:0,"&:hover":{cursor:"pointer",textDecoration:"underline",background:"transparent"}}}}));function LinkOrAnchor(e){var l=e.hasExternalLinks,t=e.text,n=e.href,o=E();return l?r.createElement("a",{style:{textDecoration:"none"},href:n},r.createElement(a,{size:"small",className:o.link},t)):r.createElement(s,{className:o.link,component:w.Link,to:n}," ",t," ")}var k=function format(e,r,l,a){var t;return t=a&&"0"!==a?".".concat(Array(a+1).join("0")):"",e||0===e?(r||"")+h(e).format("0,0".concat(t))+(l||""):null},b=function setDrilldown(e,r){var l,a;return e&&e.hasOwnProperty("displayString")?(l=e.displayString,e.drillDowns.length>0&&(a=e.drillDowns[0].href)):l=e,a?LinkOrAnchor({hasExternalLinks:r,text:l,href:a}):l},x=function formatTitle(l,a,t,n,s){return n?r.createElement("strong",null,"Error"):a?(i=l&&l.displayString?l.displayString:l,t?r.createElement(o,{variant:"subtitle1"},"".concat(i," (loading)")):r.createElement(e.Fragment,null,r.createElement("div",null,r.createElement(o,{variant:"subtitle1"},b(l))),s?r.createElement("div",null,r.createElement(f,{"aria-labelledby":"simple-modal-title","aria-describedby":"simple-modal-description"},s)):"")):"";var i},T=function setValueDrilldown(e,r){var l;if(e&&(e.displayValue||0===e.displayValue))if(e.drillDowns&&e.drillDowns.length>0){var a=k(e.displayValue,e.prefix,e.suffix,e.decimalPlaces);l=LinkOrAnchor({hasExternalLinks:r,href:e.drillDowns[0].href,text:a})}else l=k(e.displayValue,e.prefix,e.suffix,e.decimalPlaces);else l=null;return l},D=t.shape({rowHeader:t.string.isRequired,columnHeaders:t.arrayOf(t.string).isRequired,varianceColumns:t.arrayOf(t.number).isRequired}),C=t.shape({rowTitle:t.object.isRequired,rowSortOrder:t.number,values:t.arrayOf(t.object).isRequired}),v=t.shape({title:t.object,resultType:t.string,reportValueType:t.string,headers:D,results:t.arrayOf(C).isRequired,totals:C}),q=l((function(){return{subTotal:{fontWeight:"bolder"},root:{width:"100%",overflow:"auto",textAlign:"center",pageBreakInside:"avoid"},rootAllowsPageBreaks:{width:"100%",overflow:"auto",textAlign:"center"},numberField:{textAlign:"right"},noWrap:{whiteSpace:"nowrap"},smallCol:{width:"100px",overflow:"auto"},mediumCol:{width:"200px",overflow:"auto"},largeCol:{width:"300px",overflow:"auto"}}})),R=function setCellClasses(e,r,l,a,t,n,o,s,i){var u="";return("Subtotal"===a||o)&&(u+="".concat(e.subTotal," ")),n||l||(u+="".concat(e.numberField," ")),s||(u+="".concat(e.noWrap," ")),i&&(u+="".concat(i," ")),u},_=function setHeaderCellClasses(e,r,l,a,t,n){var o="";return l||(o+="".concat(e.numberField," ")),"small"===t&&(o+="".concat(e.smallCol," ")),"medium"===t&&(o+="".concat(e.mediumCol," ")),"large"===t&&(o+="".concat(e.largeCol," ")),n&&(o+="".concat(n," ")),o},L=function Results(e){var l=e.reportData,a=e.classes,t=e.title,n=e.showTitle,o=e.showTotals,s=e.hasExternalLinks,h=e.showRowTitles,f=e.columnClasses,w=e.allowPageBreakInside;return r.createElement(d,{className:w?a.rootAllowsPageBreaks:a.root},r.createElement(y,{text:x(t,n,!l,l&&l.error,l?l.reportHelpText:"")}),r.createElement("div",{style:{backgroundColor:"white"}},r.createElement(i,{size:"small"},r.createElement(m,{key:"headers"},r.createElement(p,null,h?r.createElement(c,null," ",l.headers.rowHeader," "):null,l.headers.columnHeaders.map((function(e,t){return r.createElement(c,{className:_(a,l.headers.varianceColumns.includes(t),l.headers.textColumns.includes(t),l.headers.totalColumns.includes(t),f?f[t]:null),key:e},e)})))),r.createElement(u,null,l.results.map((function(e,t){return r.createElement(p,{key:t},h?r.createElement(c,{className:a.noWrap},b(e.rowTitle,s)):null,e.values.map((function(t,n){return r.createElement(c,{className:R(a,t&&t.displayValue,t?t.textDisplayValue:null,e.rowType,l.headers.varianceColumns.includes(n),l.headers.textColumns.includes(n),l.headers.totalColumns.includes(n),!t||t.allowWrap),key:n},T(t,s),function setTextValueDrilldown(e,r){var l;e&&e.textDisplayValue?l=e.drillDowns&&e.drillDowns.length>0?LinkOrAnchor({hasExternalLinks:r,text:e.textDisplayValue,href:e.drillDowns[0].href}):e.textDisplayValue:l=null;return l}(t,s))})))})),!!o&&r.createElement(p,{key:"totals"},h?r.createElement(c,null,l.totals.rowTitle.displayString):null,l.totals.values.map((function(e,t){return r.createElement(c,{className:R(a,e&&e.displayValue,e?e.textDisplayValue:null,"Total",l.headers.varianceColumns.includes(t),l.headers.textColumns.includes(t),l.headers.totalColumns.includes(t),!e||e.allowWrap),key:t},T(e,s))})))))))};function ReportTable(e){var l=e.placeholderRows,a=e.placeholderColumns,t=e.reportData,o=e.hasExternalLinks,s=e.title,m=e.showTitle,h=e.showTotals,f=e.showRowTitles,w=e.columnClasses,y=e.allowPageBreakInside,E=q();return t?t.message?r.createElement(g,{errorMessage:t.message}):L({reportData:t,hasExternalLinks:o,classes:E,title:s,showRowTitles:f,showTitle:m,showTotals:h,columnClasses:w,allowPageBreakInside:y}):r.createElement(d,{className:y?E.rootAllowsPageBreaks:E.root},r.createElement(i,null,r.createElement(u,null,n._toConsumableArray(Array(l).keys()).map((function(e){return r.createElement(p,{key:e},n._toConsumableArray(Array(a).keys()).map((function(e){return r.createElement(c,{key:e})})))})))))}L.propTypes={hasExternalLinks:t.bool,reportData:v,classes:t.shape({root:t.shape({}),noWrap:t.shape({}),rootAllowsPageBreaks:t.shape({})}).isRequired,title:t.oneOfType([t.string,t.shape({})]),showTitle:t.bool,showTotals:t.bool,showRowTitles:t.bool,columnClasses:t.arrayOf(t.string),allowPageBreakInside:t.bool.isRequired},L.defaultProps={reportData:null,title:null,showTitle:!0,showTotals:!0,showRowTitles:!0,hasExternalLinks:!1,columnClasses:null},ReportTable.propTypes={hasExternalLinks:t.bool,placeholderRows:t.number.isRequired,placeholderColumns:t.number.isRequired,reportData:t.shape({}),columnClasses:t.arrayOf(t.string),allowPageBreakInside:t.bool},ReportTable.defaultProps={reportData:null,placeholderRows:5,placeholderColumns:6,hasExternalLinks:!1,columnClasses:null,allowPageBreakInside:!1},exports.ReportTable=ReportTable,exports.displayError=function displayError(e){return r.createElement("h5",{className:"error-message"},e)},exports.formatHeading=function formatHeading(e,l,a,t){return!!l&&(t?r.createElement("strong",null,"Error"):(n=e&&e.displayString?e.displayString:e,a?r.createElement("h5",null,"".concat(n," (loading)")):r.createElement("strong",null,n)));var n},exports.formatTitle=x;
@@ -1 +0,0 @@
1
- "use strict";function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function asyncGeneratorStep(e,r,t,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void t(e)}u.done?r(c):Promise.resolve(c).then(n,o)}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _defineProperty(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _extends(){return(_extends=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _setPrototypeOf(e,r){return(_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,r){return e.__proto__=r,e})(e,r)}function _possibleConstructorReturn(e,r){if(r&&("object"==typeof r||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function _unsupportedIterableToArray(e,r){if(e){if("string"==typeof e)return _arrayLikeToArray(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(e,r):void 0}}function _arrayLikeToArray(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}exports._asyncToGenerator=function _asyncToGenerator(e){return function(){var r=this,t=arguments;return new Promise((function(n,o){var i=e.apply(r,t);function _next(e){asyncGeneratorStep(i,n,o,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(i,n,o,_next,_throw,"throw",e)}_next(void 0)}))}},exports._classCallCheck=function _classCallCheck(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")},exports._createClass=function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),e},exports._createSuper=function _createSuper(e){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function _createSuperInternal(){var t,n=_getPrototypeOf(e);if(r){var o=_getPrototypeOf(this).constructor;t=Reflect.construct(n,arguments,o)}else t=n.apply(this,arguments);return _possibleConstructorReturn(this,t)}},exports._defineProperty=_defineProperty,exports._extends=_extends,exports._inherits=function _inherits(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&_setPrototypeOf(e,r)},exports._objectSpread2=function _objectSpread2(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach((function(r){_defineProperty(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e},exports._objectWithoutProperties=function _objectWithoutProperties(e,r){if(null==e)return{};var t,n,o=function _objectWithoutPropertiesLoose(e,r){if(null==e)return{};var t,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o},exports._slicedToArray=function _slicedToArray(e,r){return function _arrayWithHoles(e){if(Array.isArray(e))return e}(e)||function _iterableToArrayLimit(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var n,o,i=[],a=!0,u=!1;try{for(t=t.call(e);!(a=(n=t.next()).done)&&(i.push(n.value),!r||i.length!==r);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==t.return||t.return()}finally{if(u)throw o}}return i}(e,r)||_unsupportedIterableToArray(e,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},exports._toConsumableArray=function _toConsumableArray(e){return function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}(e)||function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||_unsupportedIterableToArray(e)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()};