@instructure/quiz-core 20.1.0 → 20.1.1-rc.1
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/es/banks/components/BankEntry/presenter.js +43 -56
- package/es/banks/components/BankEntry/styles.js +65 -0
- package/es/banks/components/BankEntry/theme.js +4 -2
- package/es/banks/components/BankEntryRow/presenter.js +55 -65
- package/es/banks/components/BankEntryRow/styles.js +50 -0
- package/es/banks/components/BankEntryRow/theme.js +4 -2
- package/es/banks/components/BankSearch/presenter.js +29 -34
- package/es/banks/components/BankSearch/styles.js +17 -0
- package/es/banks/components/BankSearch/theme.js +5 -5
- package/es/banks/components/Banks/presenter.js +46 -57
- package/es/banks/components/Banks/styles.js +32 -0
- package/es/banks/components/Banks/theme.js +4 -2
- package/es/banks/components/BanksList/presenter.js +80 -90
- package/es/banks/components/BanksList/styles.js +45 -0
- package/es/banks/components/BanksList/theme.js +4 -2
- package/lib/banks/components/BankEntry/presenter.js +41 -57
- package/lib/banks/components/BankEntry/styles.js +75 -0
- package/lib/banks/components/BankEntry/theme.js +6 -3
- package/lib/banks/components/BankEntryRow/presenter.js +54 -69
- package/lib/banks/components/BankEntryRow/styles.js +58 -0
- package/lib/banks/components/BankEntryRow/theme.js +6 -3
- package/lib/banks/components/BankSearch/presenter.js +28 -37
- package/lib/banks/components/BankSearch/styles.js +25 -0
- package/lib/banks/components/BankSearch/theme.js +7 -6
- package/lib/banks/components/Banks/presenter.js +45 -61
- package/lib/banks/components/Banks/styles.js +40 -0
- package/lib/banks/components/Banks/theme.js +6 -3
- package/lib/banks/components/BanksList/presenter.js +73 -88
- package/lib/banks/components/BanksList/styles.js +53 -0
- package/lib/banks/components/BanksList/theme.js +6 -3
- package/package.json +10 -10
|
@@ -9,8 +9,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
});
|
|
10
10
|
exports.default = exports.Banks = void 0;
|
|
11
11
|
|
|
12
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
-
|
|
14
12
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
15
13
|
|
|
16
14
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
@@ -41,12 +39,10 @@ var _uiTextInput = require("@instructure/ui-text-input");
|
|
|
41
39
|
|
|
42
40
|
var _uiSimpleSelect = require("@instructure/ui-simple-select");
|
|
43
41
|
|
|
44
|
-
var
|
|
42
|
+
var _emotion = require("@instructure/emotion");
|
|
45
43
|
|
|
46
44
|
var _debounce = _interopRequireDefault(require("lodash/fp/debounce"));
|
|
47
45
|
|
|
48
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
49
|
-
|
|
50
46
|
var _index = _interopRequireDefault(require("../../../common/components/layout/Page/index.js"));
|
|
51
47
|
|
|
52
48
|
var _index2 = _interopRequireDefault(require("../../../common/components/shared/PaginatedCollection/index.js"));
|
|
@@ -63,32 +59,22 @@ var _index5 = _interopRequireDefault(require("../NavWrapper/index.js"));
|
|
|
63
59
|
|
|
64
60
|
var _noResults = _interopRequireDefault(require("../noResults.svg"));
|
|
65
61
|
|
|
62
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
63
|
+
|
|
66
64
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
67
65
|
|
|
68
66
|
var _dec, _class, _class2, _temp;
|
|
69
67
|
|
|
70
|
-
var styles = {
|
|
71
|
-
componentId: 'cYUUC',
|
|
72
|
-
template: function template(theme) {
|
|
73
|
-
return "\n\n.cYUUC_caGd{background-color:".concat(theme.contentBackgroundColor || 'inherit', ";padding:").concat(theme.contentPaddingTopBottom || 'inherit', " ").concat(theme.contentPaddingLeftRight || 'inherit', "}\n\n.cYUUC_fsuY{display:flex;flex-direction:row;justify-content:space-between;padding-bottom:").concat(theme.headerPadding || 'inherit', "}\n\n.cYUUC_cyFt{border-bottom:").concat(theme.headerBorderWidth || 'inherit', " solid ").concat(theme.headerBorderColor || 'inherit', "}\n\n.cYUUC_ECfi{padding-bottom:2rem}\n\n.cYUUC_djgO{display:flex;flex-direction:row;margin-top:1.5rem}\n\n.cYUUC_bYSL{flex-grow:0.25;padding:0 1rem}");
|
|
74
|
-
},
|
|
75
|
-
'content': 'cYUUC_caGd',
|
|
76
|
-
'header': 'cYUUC_fsuY',
|
|
77
|
-
'borderedBottom': 'cYUUC_cyFt',
|
|
78
|
-
'filters': 'cYUUC_ECfi',
|
|
79
|
-
'filtersRow': 'cYUUC_djgO',
|
|
80
|
-
'searchBarContainer': 'cYUUC_bYSL'
|
|
81
|
-
};
|
|
82
68
|
var sortOrderIcons = {
|
|
83
69
|
ascending: _uiIcons.IconArrowUpLine,
|
|
84
70
|
descending: _uiIcons.IconArrowDownLine
|
|
85
71
|
};
|
|
86
72
|
|
|
87
|
-
var _ref4 =
|
|
73
|
+
var _ref4 = (0, _emotion.jsx)(_uiImg.Img, {
|
|
88
74
|
src: _noResults.default
|
|
89
75
|
});
|
|
90
76
|
|
|
91
|
-
var Banks = (_dec = (0,
|
|
77
|
+
var Banks = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
92
78
|
(0, _inherits2.default)(Banks, _Component);
|
|
93
79
|
|
|
94
80
|
var _super = (0, _createSuper2.default)(Banks);
|
|
@@ -216,7 +202,7 @@ var Banks = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_c
|
|
|
216
202
|
};
|
|
217
203
|
|
|
218
204
|
_this.renderRecords = function (recordIds) {
|
|
219
|
-
return
|
|
205
|
+
return (0, _emotion.jsx)(_index3.default, {
|
|
220
206
|
createBankButton: _this.createBankButton,
|
|
221
207
|
currentUser: _this.props.currentUser,
|
|
222
208
|
focusCreateBankButton: _this.focusCreateBankButton,
|
|
@@ -246,7 +232,7 @@ var Banks = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_c
|
|
|
246
232
|
message = (0, _formatMessage.default)("Your filter is set to \"Institution\" which will narrow what you can search for.\n Try adjusting the filter to \"All My Banks\"");
|
|
247
233
|
}
|
|
248
234
|
|
|
249
|
-
return
|
|
235
|
+
return (0, _emotion.jsx)(_uiBillboard.Billboard, {
|
|
250
236
|
size: "medium",
|
|
251
237
|
heading: (0, _formatMessage.default)('No Results Found'),
|
|
252
238
|
message: message,
|
|
@@ -316,98 +302,94 @@ var Banks = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_c
|
|
|
316
302
|
display: false
|
|
317
303
|
}];
|
|
318
304
|
var searchFiltersSelectOptionIdPrefix = 'banks-search-filters-select-option-';
|
|
319
|
-
|
|
320
|
-
var searchFilters = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
305
|
+
var searchFilters = (0, _emotion.jsx)(_react.default.Fragment, null, (0, _emotion.jsx)("div", {
|
|
321
306
|
display: "inline-block"
|
|
322
|
-
},
|
|
307
|
+
}, (0, _emotion.jsx)(_uiSimpleSelect.SimpleSelect, {
|
|
323
308
|
onChange: this.handleBanksParentChange,
|
|
324
309
|
value: this.props.scopeType,
|
|
325
|
-
renderLabel:
|
|
310
|
+
renderLabel: (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, (0, _formatMessage.default)('Bank scope')),
|
|
326
311
|
width: "13rem"
|
|
327
312
|
}, scopeOptions.map(function (option) {
|
|
328
|
-
return
|
|
313
|
+
return (0, _emotion.jsx)(_uiSimpleSelect.SimpleSelect.Option, {
|
|
329
314
|
id: searchFiltersSelectOptionIdPrefix + option.slug,
|
|
330
315
|
key: option.slug,
|
|
331
316
|
value: option.slug
|
|
332
317
|
}, option.translation);
|
|
333
|
-
}))),
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
renderLabel: /*#__PURE__*/_react.default.createElement(_uiA11yContent.ScreenReaderContent, null, (0, _formatMessage.default)('Search...')),
|
|
318
|
+
}))), (0, _emotion.jsx)("div", {
|
|
319
|
+
css: this.props.styles.searchBarContainer
|
|
320
|
+
}, (0, _emotion.jsx)(_uiTextInput.TextInput, {
|
|
321
|
+
renderLabel: (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, (0, _formatMessage.default)('Search...')),
|
|
338
322
|
type: "search",
|
|
339
323
|
value: this.state.searchTerms,
|
|
340
324
|
onChange: this.handleSearchInputChange,
|
|
341
325
|
placeholder: (0, _formatMessage.default)('Search...'),
|
|
342
326
|
"data-automation": "sdk-search-bank-textinput"
|
|
343
327
|
})));
|
|
344
|
-
|
|
345
328
|
var sortingFiltersSelectOptionIdPrefix = 'banks-sorting-filters-select-option-';
|
|
346
|
-
|
|
347
|
-
var sortingFilters = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
329
|
+
var sortingFilters = (0, _emotion.jsx)(_react.default.Fragment, null, (0, _emotion.jsx)("div", {
|
|
348
330
|
display: "inline-block",
|
|
349
331
|
style: {
|
|
350
332
|
margin: 'auto 0px auto auto'
|
|
351
333
|
}
|
|
352
|
-
},
|
|
353
|
-
renderLabel:
|
|
334
|
+
}, (0, _emotion.jsx)(_uiSimpleSelect.SimpleSelect, {
|
|
335
|
+
renderLabel: (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, (0, _formatMessage.default)('Sort by')),
|
|
354
336
|
value: this.props.sortBy,
|
|
355
337
|
width: "10rem",
|
|
356
338
|
onChange: this.handleSortByChange
|
|
357
339
|
}, sortingCriteriaOptions.filter(function (option) {
|
|
358
340
|
return option.display === true;
|
|
359
341
|
}).map(function (option) {
|
|
360
|
-
return
|
|
342
|
+
return (0, _emotion.jsx)(_uiSimpleSelect.SimpleSelect.Option, {
|
|
361
343
|
id: sortingFiltersSelectOptionIdPrefix + option.slug,
|
|
362
344
|
key: option.slug,
|
|
363
345
|
value: option.slug
|
|
364
346
|
}, option.translation);
|
|
365
|
-
}))),
|
|
347
|
+
}))), (0, _emotion.jsx)("div", {
|
|
366
348
|
display: "inline-block",
|
|
367
349
|
style: {
|
|
368
350
|
marginLeft: '1rem'
|
|
369
351
|
}
|
|
370
|
-
},
|
|
352
|
+
}, (0, _emotion.jsx)(_uiButtons.Button, {
|
|
371
353
|
type: "button",
|
|
372
354
|
onClick: this.handleSortingButtonClick,
|
|
373
355
|
"data-automation": "sdk-sort-banks-button",
|
|
374
356
|
renderIcon: this.getSortingOrderIcon()
|
|
375
|
-
},
|
|
357
|
+
}, (0, _emotion.jsx)(_uiA11yContent.AccessibleContent, {
|
|
376
358
|
alt: this.getSortAssistiveText()
|
|
377
359
|
}, (0, _formatMessage.default)('Sort')))));
|
|
378
360
|
|
|
379
361
|
if (this.props.closeTray) {
|
|
380
|
-
return
|
|
381
|
-
|
|
382
|
-
},
|
|
383
|
-
|
|
384
|
-
}, searchFilters), !this.props.itemBankSearchTableEnabled &&
|
|
385
|
-
|
|
362
|
+
return (0, _emotion.jsx)("div", {
|
|
363
|
+
css: [this.props.styles.filters, this.props.styles.borderedBottom]
|
|
364
|
+
}, (0, _emotion.jsx)("div", {
|
|
365
|
+
css: this.props.styles.filtersRow
|
|
366
|
+
}, searchFilters), !this.props.itemBankSearchTableEnabled && (0, _emotion.jsx)("div", {
|
|
367
|
+
css: this.props.styles.filtersRow
|
|
386
368
|
}, sortingFilters));
|
|
387
369
|
} else {
|
|
388
|
-
return
|
|
389
|
-
|
|
390
|
-
},
|
|
391
|
-
|
|
370
|
+
return (0, _emotion.jsx)("div", {
|
|
371
|
+
css: [this.props.styles.filters, this.props.styles.borderedBottom]
|
|
372
|
+
}, (0, _emotion.jsx)("div", {
|
|
373
|
+
css: this.props.styles.filtersRow
|
|
392
374
|
}, searchFilters, !this.props.itemBankSearchTableEnabled && sortingFilters));
|
|
393
375
|
}
|
|
394
376
|
}
|
|
395
377
|
}, {
|
|
396
378
|
key: "renderHeader",
|
|
397
379
|
value: function renderHeader() {
|
|
398
|
-
return
|
|
399
|
-
|
|
400
|
-
},
|
|
380
|
+
return (0, _emotion.jsx)("div", {
|
|
381
|
+
css: [this.props.styles.filters, !this.props.filtersEnabled ? this.props.styles.borderedBottom : {}]
|
|
382
|
+
}, (0, _emotion.jsx)(_uiHeading.Heading, {
|
|
401
383
|
as: this.props.isCompact ? 'h2' : 'h1',
|
|
402
384
|
level: "h1"
|
|
403
|
-
}, (0, _formatMessage.default)('Banks')),
|
|
385
|
+
}, (0, _formatMessage.default)('Banks')), (0, _emotion.jsx)(_uiButtons.Button, {
|
|
404
386
|
ref: this.handleCreateBankButtonRef,
|
|
405
387
|
type: "button",
|
|
406
388
|
color: "primary",
|
|
407
389
|
onClick: this.onCreateBank,
|
|
408
390
|
"data-automation": "sdk-create-new-bank-button",
|
|
409
391
|
renderIcon: _uiIcons.IconPlusLine
|
|
410
|
-
},
|
|
392
|
+
}, (0, _emotion.jsx)(_uiA11yContent.AccessibleContent, {
|
|
411
393
|
alt: (0, _formatMessage.default)('Create Bank')
|
|
412
394
|
}, (0, _formatMessage.default)('Bank'))));
|
|
413
395
|
}
|
|
@@ -420,7 +402,7 @@ var Banks = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_c
|
|
|
420
402
|
navigateToBuild = _this$props.navigateToBuild,
|
|
421
403
|
returnToUrl = _this$props.returnToUrl;
|
|
422
404
|
var isScopeEmpty = !Object.keys(scope).length;
|
|
423
|
-
return
|
|
405
|
+
return (0, _emotion.jsx)(_index5.default, {
|
|
424
406
|
closeTray: closeTray,
|
|
425
407
|
navigateToBuild: navigateToBuild,
|
|
426
408
|
returnToUrl: isScopeEmpty ? null : returnToUrl,
|
|
@@ -430,7 +412,7 @@ var Banks = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_c
|
|
|
430
412
|
}, {
|
|
431
413
|
key: "renderBanksSearchResults",
|
|
432
414
|
value: function renderBanksSearchResults() {
|
|
433
|
-
return
|
|
415
|
+
return (0, _emotion.jsx)(_index2.default, {
|
|
434
416
|
empty: this.emptyPage(),
|
|
435
417
|
getPage: this.getPage,
|
|
436
418
|
renderRecords: this.renderRecords,
|
|
@@ -440,9 +422,9 @@ var Banks = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_c
|
|
|
440
422
|
}, {
|
|
441
423
|
key: "render",
|
|
442
424
|
value: function render() {
|
|
443
|
-
return
|
|
444
|
-
|
|
445
|
-
}, this.renderHeader(), this.props.filtersEnabled && this.renderFilters(), this.renderBanksSearchResults(),
|
|
425
|
+
return (0, _emotion.jsx)(_index.default, null, this.renderNav(), (0, _emotion.jsx)("div", {
|
|
426
|
+
css: this.props.styles.content
|
|
427
|
+
}, this.renderHeader(), this.props.filtersEnabled && this.renderFilters(), this.renderBanksSearchResults(), (0, _emotion.jsx)(_index4.default, {
|
|
446
428
|
itemBanksScope: this.props.scope
|
|
447
429
|
})));
|
|
448
430
|
}
|
|
@@ -497,7 +479,9 @@ var Banks = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_c
|
|
|
497
479
|
sortBy: _propTypes.default.string,
|
|
498
480
|
sortOrder: _propTypes.default.string,
|
|
499
481
|
usedByCourseEnabled: _propTypes.default.bool,
|
|
500
|
-
itemBankSearchTableEnabled: _propTypes.default.bool
|
|
482
|
+
itemBankSearchTableEnabled: _propTypes.default.bool,
|
|
483
|
+
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
484
|
+
styles: _propTypes.default.object
|
|
501
485
|
}, _class2.defaultProps = {
|
|
502
486
|
closeTray: null,
|
|
503
487
|
currentUser: null,
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
9
|
+
return {
|
|
10
|
+
content: {
|
|
11
|
+
padding: "".concat(componentTheme.contentPaddingTopBottom, " ").concat(componentTheme.contentPaddingLeftRight),
|
|
12
|
+
backgroundColor: componentTheme.contentBackgroundColor
|
|
13
|
+
},
|
|
14
|
+
header: {
|
|
15
|
+
display: 'flex',
|
|
16
|
+
flexDirection: 'row',
|
|
17
|
+
paddingBottom: componentTheme.headerPadding,
|
|
18
|
+
justifyContent: 'space-between'
|
|
19
|
+
},
|
|
20
|
+
borderedBottom: {
|
|
21
|
+
borderBottom: "".concat(componentTheme.headerBorderWidth, " solid ").concat(componentTheme.headerBorderColor)
|
|
22
|
+
},
|
|
23
|
+
filters: {
|
|
24
|
+
paddingBottom: '2rem'
|
|
25
|
+
},
|
|
26
|
+
filtersRow: {
|
|
27
|
+
marginTop: '1.5rem',
|
|
28
|
+
display: 'flex',
|
|
29
|
+
flexDirection: 'row'
|
|
30
|
+
},
|
|
31
|
+
searchBarContainer: {
|
|
32
|
+
flexGrow: 0.25,
|
|
33
|
+
padding: '0 1rem',
|
|
34
|
+
display: 'inline-block'
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
var _default = generateStyle;
|
|
40
|
+
exports.default = _default;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
function
|
|
8
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
9
9
|
var colors = _ref.colors,
|
|
10
10
|
spacing = _ref.spacing,
|
|
11
11
|
borders = _ref.borders;
|
|
@@ -17,4 +17,7 @@ function generator(_ref) {
|
|
|
17
17
|
headerBorderWidth: borders.widthSmall,
|
|
18
18
|
headerBorderColor: colors.tiara
|
|
19
19
|
};
|
|
20
|
-
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
var _default = generateComponentTheme;
|
|
23
|
+
exports.default = _default;
|