@instructure/quiz-core 20.1.1-rc.0 → 20.1.1-rc.2
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/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/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 +9 -9
|
@@ -7,6 +7,8 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
7
7
|
|
|
8
8
|
var _dec, _class, _class2, _temp;
|
|
9
9
|
|
|
10
|
+
/** @jsx jsx */
|
|
11
|
+
|
|
10
12
|
/* eslint "react/jsx-no-bind": "warn" */
|
|
11
13
|
import React, { Component } from 'react';
|
|
12
14
|
import PropTypes from 'prop-types';
|
|
@@ -22,39 +24,25 @@ import { IconEditLine, IconTrashLine, IconShareSolid, IconCopyLine } from '@inst
|
|
|
22
24
|
import { Alert } from '@instructure/ui-alerts';
|
|
23
25
|
import { Spinner } from '@instructure/ui-spinner';
|
|
24
26
|
import { Table } from '@instructure/ui-table';
|
|
25
|
-
import {
|
|
27
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
26
28
|
import { EDIT_BANK_MODAL, withI18nSupport } from '@instructure/quiz-common';
|
|
27
29
|
import CustomPropTypes from "../../../common/util/CustomPropTypes.js";
|
|
28
30
|
import IfFeature from "../../../common/components/shared/IfFeature/index.js";
|
|
29
31
|
import EditBankModal from "../EditBankModal/index.js";
|
|
30
32
|
import SharingModal from "../SharingModal/index.js";
|
|
31
33
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
'deletePreface': 'DyOOn_eTBd',
|
|
45
|
-
'rowHeader': 'DyOOn_fXqC'
|
|
46
|
-
};
|
|
47
|
-
import theme from "./theme.js";
|
|
48
|
-
|
|
49
|
-
var _ref4 = /*#__PURE__*/React.createElement(Table.Cell, null);
|
|
50
|
-
|
|
51
|
-
var _ref5 = /*#__PURE__*/React.createElement(Table.Cell, null);
|
|
52
|
-
|
|
53
|
-
var _ref6 = /*#__PURE__*/React.createElement(Table.Cell, null);
|
|
54
|
-
|
|
55
|
-
var _ref7 = /*#__PURE__*/React.createElement(Table.Cell, null);
|
|
56
|
-
|
|
57
|
-
export var BanksList = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_withI18nSupport) {
|
|
34
|
+
import generateStyle from "./styles.js";
|
|
35
|
+
import generateComponentTheme from "./theme.js";
|
|
36
|
+
|
|
37
|
+
var _ref4 = jsx(Table.Cell, null);
|
|
38
|
+
|
|
39
|
+
var _ref5 = jsx(Table.Cell, null);
|
|
40
|
+
|
|
41
|
+
var _ref6 = jsx(Table.Cell, null);
|
|
42
|
+
|
|
43
|
+
var _ref7 = jsx(Table.Cell, null);
|
|
44
|
+
|
|
45
|
+
export var BanksList = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_withI18nSupport) {
|
|
58
46
|
_inherits(BanksList, _withI18nSupport);
|
|
59
47
|
|
|
60
48
|
var _super = _createSuper(BanksList);
|
|
@@ -113,22 +101,22 @@ export var BanksList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
113
101
|
creatorFullName = resp && resp[0] && resp[0].fullName;
|
|
114
102
|
|
|
115
103
|
case 7:
|
|
116
|
-
confirmBody =
|
|
104
|
+
confirmBody = jsx("div", null, !deletingOwnBank && (creatorFullName ? t('You are about to delete an Item Bank that you did not create. This Item Bank was created by {creator}, proceed with caution.', {
|
|
117
105
|
creator: creatorFullName
|
|
118
|
-
}) : t('You are about to delete an Item Bank that you did not create. Proceed with caution.')),
|
|
106
|
+
}) : t('You are about to delete an Item Bank that you did not create. Proceed with caution.')), jsx(Alert, {
|
|
119
107
|
variant: "error",
|
|
120
108
|
padding: "0"
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
},
|
|
124
|
-
|
|
125
|
-
}, t('Once deleted, items from this bank:')),
|
|
109
|
+
}, jsx("div", {
|
|
110
|
+
css: _this.props.styles.deleteAlert
|
|
111
|
+
}, jsx("div", {
|
|
112
|
+
css: _this.props.styles.deletePreface
|
|
113
|
+
}, t('Once deleted, items from this bank:')), jsx(List, null, jsx(List.Item, null, t('will no longer be accessible to others who currently have shared access')), jsx(List.Item, null, t.rich('will <0>NOT</0> be removed from any assessments', [function (_ref2) {
|
|
126
114
|
var children = _ref2.children;
|
|
127
|
-
return
|
|
115
|
+
return jsx(Text, {
|
|
128
116
|
weight: "bold",
|
|
129
117
|
key: "0"
|
|
130
118
|
}, children);
|
|
131
|
-
}])),
|
|
119
|
+
}])), jsx(List.Item, null, t('will lose their statistical link in reporting (if they were part of an assessment)')), jsx(List.Item, null, t('will no longer be available to any assessments attempting a random/batch pull of items (removing the pull will resolve the issue)'))))));
|
|
132
120
|
|
|
133
121
|
_this.props.withConfirm(partial(_this.deleteBank, bank.id), {
|
|
134
122
|
text: confirmBody,
|
|
@@ -243,35 +231,35 @@ export var BanksList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
243
231
|
};
|
|
244
232
|
|
|
245
233
|
if (bank.status === 'copying') {
|
|
246
|
-
return
|
|
247
|
-
|
|
234
|
+
return jsx("div", {
|
|
235
|
+
css: _this.props.styles.bankInfo,
|
|
248
236
|
"data-automation": "sdk-bank-info",
|
|
249
237
|
tabIndex: "-1"
|
|
250
|
-
},
|
|
251
|
-
|
|
252
|
-
},
|
|
238
|
+
}, jsx("div", {
|
|
239
|
+
css: _this.props.styles.bankTitle
|
|
240
|
+
}, jsx(Heading, {
|
|
253
241
|
as: "h2",
|
|
254
242
|
level: "reset",
|
|
255
243
|
"data-automation": "sdk-banks-list-bank-title-heading"
|
|
256
|
-
}, bank.title)),
|
|
257
|
-
|
|
244
|
+
}, bank.title)), jsx("div", {
|
|
245
|
+
css: _this.props.styles.bankDetails,
|
|
258
246
|
"data-automation": "sdk-banks-list-bank-details"
|
|
259
247
|
}, t('Currently duplicating')));
|
|
260
248
|
} else {
|
|
261
|
-
return
|
|
262
|
-
|
|
249
|
+
return jsx("div", {
|
|
250
|
+
css: _this.props.styles.bankInfo,
|
|
263
251
|
"data-automation": "sdk-bank-info",
|
|
264
252
|
tabIndex: "-1"
|
|
265
|
-
},
|
|
266
|
-
|
|
267
|
-
},
|
|
253
|
+
}, jsx("div", {
|
|
254
|
+
css: _this.props.styles.bankTitle
|
|
255
|
+
}, jsx(Link, {
|
|
268
256
|
onClick: navigateToBank(bank.id),
|
|
269
257
|
themeOverride: {
|
|
270
|
-
color: _this.
|
|
271
|
-
hoverColor: _this.
|
|
258
|
+
color: _this.props.styles.bankTitleLinkColor,
|
|
259
|
+
hoverColor: _this.props.styles.bankTitleLinkHoverColor
|
|
272
260
|
},
|
|
273
261
|
"data-automation": "sdk-banks-list-bank-title-link"
|
|
274
|
-
},
|
|
262
|
+
}, jsx(Heading, {
|
|
275
263
|
as: "h2",
|
|
276
264
|
level: "reset",
|
|
277
265
|
"data-automation": "sdk-banks-list-bank-title-heading"
|
|
@@ -280,7 +268,7 @@ export var BanksList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
280
268
|
};
|
|
281
269
|
|
|
282
270
|
_this.renderBankOptions = function (bank) {
|
|
283
|
-
var bankEditOptions =
|
|
271
|
+
var bankEditOptions = jsx(React.Fragment, null, jsx(IconButton, {
|
|
284
272
|
onClick: _this.openModal(bank),
|
|
285
273
|
name: "Edit",
|
|
286
274
|
size: "small",
|
|
@@ -294,7 +282,7 @@ export var BanksList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
294
282
|
screenReaderLabel: t('Edit bank {name}', {
|
|
295
283
|
name: bank.title
|
|
296
284
|
})
|
|
297
|
-
}),
|
|
285
|
+
}), jsx(IconButton, {
|
|
298
286
|
onClick: _this.openDeleteBankModal(bank),
|
|
299
287
|
name: "Delete",
|
|
300
288
|
size: "small",
|
|
@@ -309,7 +297,7 @@ export var BanksList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
309
297
|
name: bank.title
|
|
310
298
|
})
|
|
311
299
|
}));
|
|
312
|
-
var duplicateBankOption =
|
|
300
|
+
var duplicateBankOption = jsx(IconButton, {
|
|
313
301
|
onClick: _this.openDuplicateBankModal(bank),
|
|
314
302
|
name: "Duplicate",
|
|
315
303
|
size: "small",
|
|
@@ -325,19 +313,19 @@ export var BanksList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
325
313
|
});
|
|
326
314
|
|
|
327
315
|
if (bank.status === 'copying') {
|
|
328
|
-
return
|
|
329
|
-
|
|
330
|
-
}, t('Duplicating'),
|
|
316
|
+
return jsx("div", {
|
|
317
|
+
css: _this.props.styles.bankOptions
|
|
318
|
+
}, t('Duplicating'), jsx(Spinner, {
|
|
331
319
|
renderTitle: t('Loading'),
|
|
332
320
|
size: "x-small",
|
|
333
321
|
margin: "0 0 0 small"
|
|
334
322
|
}));
|
|
335
323
|
} else {
|
|
336
|
-
return
|
|
337
|
-
|
|
338
|
-
}, _this.props.duplicateItemBanks ? duplicateBankOption : null,
|
|
324
|
+
return jsx("div", {
|
|
325
|
+
css: _this.props.styles.bankOptions
|
|
326
|
+
}, _this.props.duplicateItemBanks ? duplicateBankOption : null, jsx(IfFeature, {
|
|
339
327
|
name: "item_bank_sharing"
|
|
340
|
-
},
|
|
328
|
+
}, jsx(IconButton, {
|
|
341
329
|
onClick: _this.openSharingModal(bank),
|
|
342
330
|
name: "Share",
|
|
343
331
|
size: "small",
|
|
@@ -356,11 +344,11 @@ export var BanksList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
356
344
|
};
|
|
357
345
|
|
|
358
346
|
_this.renderBank = function (bank) {
|
|
359
|
-
return
|
|
347
|
+
return jsx("div", {
|
|
360
348
|
key: bank.id,
|
|
361
|
-
|
|
349
|
+
css: _this.props.styles.bankRow,
|
|
362
350
|
"data-automation": "sdk-banks-list-bank-row"
|
|
363
|
-
},
|
|
351
|
+
}, jsx(EditBankModal, {
|
|
364
352
|
workingBank: bank.getWorkingInstance()
|
|
365
353
|
}), _this.renderBankInfo(bank), _this.renderBankOptions(bank));
|
|
366
354
|
};
|
|
@@ -389,22 +377,22 @@ export var BanksList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
389
377
|
key: "renderDetails",
|
|
390
378
|
value: function renderDetails(bank) {
|
|
391
379
|
var separator = ' | ';
|
|
392
|
-
var lastUsedInfo = bank.lastUsed() &&
|
|
380
|
+
var lastUsedInfo = bank.lastUsed() && jsx(React.Fragment, null, jsx(PresentationContent, null, separator), t('Last used { lastUsedDate }', {
|
|
393
381
|
lastUsedDate: this.formatDateMedium(bank.lastUsed())
|
|
394
382
|
}));
|
|
395
|
-
return
|
|
396
|
-
|
|
383
|
+
return jsx("div", {
|
|
384
|
+
css: this.props.styles.bankDetails,
|
|
397
385
|
"data-automation": "sdk-banks-list-bank-details"
|
|
398
|
-
},
|
|
386
|
+
}, jsx("div", null, t('Updated { updatedDate }', {
|
|
399
387
|
updatedDate: this.formatDateMedium(bank.updatedAt())
|
|
400
|
-
}),
|
|
388
|
+
}), jsx(PresentationContent, null, separator), t("{\n count, plural,\n one {# Question Total}\n other {# Questions Total}\n }", {
|
|
401
389
|
count: bank.itemEntryCount
|
|
402
390
|
}), lastUsedInfo));
|
|
403
391
|
}
|
|
404
392
|
}, {
|
|
405
393
|
key: "renderSharingModal",
|
|
406
394
|
value: function renderSharingModal() {
|
|
407
|
-
return
|
|
395
|
+
return jsx(SharingModal, {
|
|
408
396
|
appContainer: this.props.appContainer,
|
|
409
397
|
bank: this.state.sharingModalBank,
|
|
410
398
|
currentUser: this.props.currentUser,
|
|
@@ -427,9 +415,9 @@ export var BanksList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
427
415
|
var _this3 = this;
|
|
428
416
|
|
|
429
417
|
if (bank.status === 'copying') {
|
|
430
|
-
return
|
|
431
|
-
|
|
432
|
-
},
|
|
418
|
+
return jsx(Table.RowHeader, null, jsx("div", {
|
|
419
|
+
css: this.props.styles.rowHeader
|
|
420
|
+
}, jsx(Heading, {
|
|
433
421
|
as: "h2",
|
|
434
422
|
level: "reset",
|
|
435
423
|
"data-automation": "sdk-banks-list-bank-title-heading"
|
|
@@ -441,15 +429,15 @@ export var BanksList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
441
429
|
};
|
|
442
430
|
};
|
|
443
431
|
|
|
444
|
-
return
|
|
445
|
-
|
|
446
|
-
},
|
|
432
|
+
return jsx(Table.RowHeader, null, jsx("div", {
|
|
433
|
+
css: this.props.styles.rowHeader
|
|
434
|
+
}, jsx(EditBankModal, {
|
|
447
435
|
workingBank: bank.getWorkingInstance()
|
|
448
|
-
}),
|
|
436
|
+
}), jsx(Link, {
|
|
449
437
|
isWithinText: false,
|
|
450
438
|
onClick: navigateToBank(bank.id),
|
|
451
439
|
"data-automation": "sdk-banks-list-bank-title-link"
|
|
452
|
-
},
|
|
440
|
+
}, jsx(Heading, {
|
|
453
441
|
as: "h2",
|
|
454
442
|
level: "reset",
|
|
455
443
|
"data-automation": "sdk-banks-list-bank-title-heading"
|
|
@@ -460,15 +448,15 @@ export var BanksList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
460
448
|
key: "renderTableRow",
|
|
461
449
|
value: function renderTableRow(bank) {
|
|
462
450
|
if (bank.status === 'copying') {
|
|
463
|
-
return
|
|
451
|
+
return jsx(Table.Row, {
|
|
464
452
|
key: bank.id
|
|
465
|
-
}, this.renderTableRowHeader(bank), _ref4, _ref5, _ref6, _ref7, !this.props.isCompact &&
|
|
453
|
+
}, this.renderTableRowHeader(bank), _ref4, _ref5, _ref6, _ref7, !this.props.isCompact && jsx(Table.Cell, {
|
|
466
454
|
textAlign: "end"
|
|
467
455
|
}, this.renderBankOptions(bank)));
|
|
468
456
|
} else {
|
|
469
|
-
return
|
|
457
|
+
return jsx(Table.Row, {
|
|
470
458
|
key: bank.id
|
|
471
|
-
}, this.renderTableRowHeader(bank),
|
|
459
|
+
}, this.renderTableRowHeader(bank), jsx(Table.Cell, null, this.formatDateMedium(bank.updatedAt())), jsx(Table.Cell, null, bank.itemEntryCount), jsx(Table.Cell, null, bank.lastUsed() ? this.formatDateMedium(bank.lastUsed()) : ''), jsx(Table.Cell, null, this.formatDateMedium(bank.createdAt())), !this.props.isCompact && jsx(Table.Cell, {
|
|
472
460
|
textAlign: "end"
|
|
473
461
|
}, this.renderBankOptions(bank)));
|
|
474
462
|
}
|
|
@@ -476,7 +464,7 @@ export var BanksList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
476
464
|
}, {
|
|
477
465
|
key: "renderTableSortHeader",
|
|
478
466
|
value: function renderTableSortHeader(headerId, headerText) {
|
|
479
|
-
return
|
|
467
|
+
return jsx(Table.ColHeader, {
|
|
480
468
|
id: headerId,
|
|
481
469
|
key: headerId,
|
|
482
470
|
onRequestSort: this.props.onChangeSort(headerId, this.props.order),
|
|
@@ -488,26 +476,26 @@ export var BanksList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
488
476
|
value: function renderTable() {
|
|
489
477
|
var _this4 = this;
|
|
490
478
|
|
|
491
|
-
return
|
|
479
|
+
return jsx(Table, {
|
|
492
480
|
margin: "small 0",
|
|
493
481
|
caption: t('Banks'),
|
|
494
482
|
layout: this.props.isCompact ? 'stacked' : 'auto'
|
|
495
|
-
},
|
|
483
|
+
}, jsx(Table.Head, {
|
|
496
484
|
renderSortLabel: t('Sort By')
|
|
497
|
-
},
|
|
485
|
+
}, jsx(Table.Row, null, this.renderTableSortHeader('name', t('Bank')), this.renderTableSortHeader('updated_at', t('Updated')), jsx(Table.ColHeader, {
|
|
498
486
|
id: "header-num-questions",
|
|
499
487
|
width: "1"
|
|
500
|
-
}, t('Questions')), this.renderTableSortHeader('last_used', t('Last Used')), this.renderTableSortHeader('created_at', t('Created')), !this.props.isCompact &&
|
|
488
|
+
}, t('Questions')), this.renderTableSortHeader('last_used', t('Last Used')), this.renderTableSortHeader('created_at', t('Created')), !this.props.isCompact && jsx(Table.ColHeader, {
|
|
501
489
|
id: "header-option-links",
|
|
502
490
|
width: "1"
|
|
503
|
-
},
|
|
491
|
+
}, jsx(ScreenReaderContent, null, t('Bank option links'))))), jsx(Table.Body, null, (this.props.banks.toArray() || []).map(function (bank) {
|
|
504
492
|
return _this4.renderTableRow(bank);
|
|
505
493
|
})));
|
|
506
494
|
}
|
|
507
495
|
}, {
|
|
508
496
|
key: "render",
|
|
509
497
|
value: function render() {
|
|
510
|
-
return
|
|
498
|
+
return jsx("div", null, this.state.sharingModalBank && this.renderSharingModal(), this.props.itemBankSearchTableEnabled ? this.renderTable() : this.props.banks.toArray().map(this.renderBank));
|
|
511
499
|
}
|
|
512
500
|
}]);
|
|
513
501
|
|
|
@@ -540,7 +528,9 @@ export var BanksList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
540
528
|
openModal: PropTypes.func.isRequired,
|
|
541
529
|
withConfirm: PropTypes.func.isRequired,
|
|
542
530
|
locale: PropTypes.string,
|
|
543
|
-
timezone: PropTypes.string
|
|
531
|
+
timezone: PropTypes.string,
|
|
532
|
+
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
533
|
+
styles: PropTypes.object
|
|
544
534
|
}, _class2.defaultProps = {
|
|
545
535
|
currentUser: null,
|
|
546
536
|
getCourseInfo: null,
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
2
|
+
return {
|
|
3
|
+
bankRow: {
|
|
4
|
+
display: 'flex',
|
|
5
|
+
flexDirection: 'row',
|
|
6
|
+
borderBottom: "".concat(componentTheme.bankRowBorderWidth, " solid ").concat(componentTheme.bankRowBorderColor)
|
|
7
|
+
},
|
|
8
|
+
bankInfo: {
|
|
9
|
+
margin: "".concat(componentTheme.bankInfoMargin, " 0"),
|
|
10
|
+
flex: 1
|
|
11
|
+
},
|
|
12
|
+
bankTitle: {
|
|
13
|
+
fontSize: componentTheme.bankTitleFontSize,
|
|
14
|
+
paddingBottom: componentTheme.bankTitlePadding
|
|
15
|
+
},
|
|
16
|
+
bankDetails: {
|
|
17
|
+
color: componentTheme.bankDetailsColor,
|
|
18
|
+
fontSize: componentTheme.bankDetailsFontSize
|
|
19
|
+
},
|
|
20
|
+
bankOptions: {
|
|
21
|
+
display: 'flex',
|
|
22
|
+
flexDirection: 'row',
|
|
23
|
+
alignItems: 'center'
|
|
24
|
+
},
|
|
25
|
+
bankOptionIcon: {
|
|
26
|
+
verticalAlign: 'middle',
|
|
27
|
+
marginRight: componentTheme.BankOptionIconMargin,
|
|
28
|
+
fontSize: componentTheme.BankOptionIconFontSize
|
|
29
|
+
},
|
|
30
|
+
bankTitleLinkColor: componentTheme.bankTitleLinkColor,
|
|
31
|
+
bankTitleLinkHoverColor: componentTheme.bankTitleLinkHoverColor,
|
|
32
|
+
deleteAlert: {
|
|
33
|
+
display: 'block'
|
|
34
|
+
},
|
|
35
|
+
deletePreface: {
|
|
36
|
+
marginBottom: componentTheme.deletePrefaceMargin
|
|
37
|
+
},
|
|
38
|
+
rowHeader: {
|
|
39
|
+
display: 'flex',
|
|
40
|
+
justifyContent: 'space-between'
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export default generateStyle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
2
|
var borders = _ref.borders,
|
|
3
3
|
colors = _ref.colors,
|
|
4
4
|
typography = _ref.typography,
|
|
@@ -18,4 +18,6 @@ export default function generator(_ref) {
|
|
|
18
18
|
BankOptionIconFontSize: typography.fontSizeMedium,
|
|
19
19
|
deletePrefaceMargin: spacing.xxSmall
|
|
20
20
|
};
|
|
21
|
-
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default generateComponentTheme;
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
@@ -17,7 +15,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
17
15
|
|
|
18
16
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
19
17
|
|
|
20
|
-
var _react =
|
|
18
|
+
var _react = require("react");
|
|
21
19
|
|
|
22
20
|
var _memoize = _interopRequireDefault(require("lodash/memoize"));
|
|
23
21
|
|
|
@@ -41,7 +39,7 @@ var _uiText = require("@instructure/ui-text");
|
|
|
41
39
|
|
|
42
40
|
var _uiA11yContent = require("@instructure/ui-a11y-content");
|
|
43
41
|
|
|
44
|
-
var
|
|
42
|
+
var _emotion = require("@instructure/emotion");
|
|
45
43
|
|
|
46
44
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
47
45
|
|
|
@@ -49,20 +47,12 @@ var _index = _interopRequireDefault(require("../../../common/components/shared/T
|
|
|
49
47
|
|
|
50
48
|
var _interactionTypeMetadata = require("../../../common/util/interactionTypeMetadata.js");
|
|
51
49
|
|
|
50
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
51
|
+
|
|
52
52
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
53
53
|
|
|
54
54
|
var _dec, _class, _class2, _temp;
|
|
55
55
|
|
|
56
|
-
var styles = {
|
|
57
|
-
componentId: 'eyMTa',
|
|
58
|
-
template: function template(theme) {
|
|
59
|
-
return "\n\n.eyMTa_ecuB{padding:".concat(theme.searchInteractionsPaddingTopBottom || 'inherit', " ").concat(theme.searchInteractionsPaddingLeftRight || 'inherit', "}\n\n.eyMTa_eYuC{display:flex;margin-top:1rem}\n\n.eyMTa_czeD{flex:1;margin-right:2rem}");
|
|
60
|
-
},
|
|
61
|
-
'interactionType': 'eyMTa_ecuB',
|
|
62
|
-
'filterContainer': 'eyMTa_eYuC',
|
|
63
|
-
'filterColumn': 'eyMTa_czeD'
|
|
64
|
-
};
|
|
65
|
-
|
|
66
56
|
var tagShape = _propTypes.default.shape({
|
|
67
57
|
tag: _propTypes.default.shape({
|
|
68
58
|
id: _propTypes.default.string,
|
|
@@ -71,7 +61,7 @@ var tagShape = _propTypes.default.shape({
|
|
|
71
61
|
count: _propTypes.default.number.isRequired
|
|
72
62
|
});
|
|
73
63
|
|
|
74
|
-
var BankSearch = (_dec = (0,
|
|
64
|
+
var BankSearch = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
75
65
|
(0, _inherits2.default)(BankSearch, _Component);
|
|
76
66
|
|
|
77
67
|
var _super = (0, _createSuper2.default)(BankSearch);
|
|
@@ -125,10 +115,10 @@ var BankSearch = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _d
|
|
|
125
115
|
it = _ref2.interaction_type;
|
|
126
116
|
var interactionName = (0, _interactionTypeMetadata.interactionTypesNameDictionary)(it);
|
|
127
117
|
var label = "".concat(interactionName, " (").concat(count, ")");
|
|
128
|
-
return
|
|
118
|
+
return (0, _emotion.jsx)("div", {
|
|
129
119
|
key: it.id,
|
|
130
|
-
|
|
131
|
-
},
|
|
120
|
+
css: _this2.props.styles.interactionType
|
|
121
|
+
}, (0, _emotion.jsx)(_uiCheckbox.Checkbox, {
|
|
132
122
|
checked: active.has(it.id),
|
|
133
123
|
label: label,
|
|
134
124
|
onChange: _this2.toggleInteraction(it.id),
|
|
@@ -140,8 +130,7 @@ var BankSearch = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _d
|
|
|
140
130
|
return tag;
|
|
141
131
|
});
|
|
142
132
|
var activeTags = this.props.search.get('tags');
|
|
143
|
-
|
|
144
|
-
var tagSelect = /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
133
|
+
var tagSelect = (0, _emotion.jsx)(_index.default, {
|
|
145
134
|
noMatchText: (0, _formatMessage.default)('No matching tags found'),
|
|
146
135
|
parentType: "Bank",
|
|
147
136
|
parentId: "0",
|
|
@@ -161,24 +150,24 @@ var BankSearch = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _d
|
|
|
161
150
|
};
|
|
162
151
|
|
|
163
152
|
var text = allInteractions ? hide() : show();
|
|
164
|
-
return
|
|
153
|
+
return (0, _emotion.jsx)(_uiButtons.CondensedButton, {
|
|
165
154
|
onClick: toggleAllInteractions,
|
|
166
155
|
margin: "none small"
|
|
167
|
-
},
|
|
156
|
+
}, (0, _emotion.jsx)(_uiA11yContent.AccessibleContent, {
|
|
168
157
|
alt: text
|
|
169
158
|
}, text));
|
|
170
159
|
}
|
|
171
160
|
};
|
|
172
161
|
|
|
173
|
-
return
|
|
174
|
-
|
|
175
|
-
},
|
|
176
|
-
|
|
177
|
-
}, tagSelect),
|
|
178
|
-
|
|
179
|
-
},
|
|
162
|
+
return (0, _emotion.jsx)("div", {
|
|
163
|
+
css: this.props.styles.filterContainer
|
|
164
|
+
}, (0, _emotion.jsx)("div", {
|
|
165
|
+
css: this.props.styles.filterColumn
|
|
166
|
+
}, tagSelect), (0, _emotion.jsx)("div", {
|
|
167
|
+
css: this.props.styles.filterColumn
|
|
168
|
+
}, (0, _emotion.jsx)(_uiView.View, {
|
|
180
169
|
margin: "none small"
|
|
181
|
-
},
|
|
170
|
+
}, (0, _emotion.jsx)(_uiText.Text, {
|
|
182
171
|
weight: "bold",
|
|
183
172
|
color: "primary"
|
|
184
173
|
}, (0, _formatMessage.default)('Question Type'))), interactionFilters, toggleButton()));
|
|
@@ -190,23 +179,23 @@ var BankSearch = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _d
|
|
|
190
179
|
var _this$props2 = this.props,
|
|
191
180
|
showFilters = _this$props2.showFilters,
|
|
192
181
|
toggleFilters = _this$props2.toggleFilters;
|
|
193
|
-
return
|
|
182
|
+
return (0, _emotion.jsx)("div", null, (0, _emotion.jsx)(_uiFlex.Flex, {
|
|
194
183
|
as: "div"
|
|
195
|
-
},
|
|
184
|
+
}, (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
196
185
|
shouldGrow: true,
|
|
197
186
|
shouldShrink: true
|
|
198
|
-
},
|
|
199
|
-
renderLabel:
|
|
187
|
+
}, (0, _emotion.jsx)(_uiTextInput.TextInput, {
|
|
188
|
+
renderLabel: (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, (0, _formatMessage.default)('Search')),
|
|
200
189
|
type: "search",
|
|
201
190
|
placeholder: (0, _formatMessage.default)('Search'),
|
|
202
191
|
onChange: this.updateSearch,
|
|
203
192
|
value: this.props.search.get('text', '') || ''
|
|
204
|
-
})),
|
|
193
|
+
})), (0, _emotion.jsx)(_uiFlex.Flex.Item, null, (0, _emotion.jsx)(_uiButtons.Button, {
|
|
205
194
|
onClick: toggleFilters,
|
|
206
195
|
margin: "none none none small",
|
|
207
196
|
renderIcon: _uiIcons.IconPlusLine,
|
|
208
197
|
"data-automation": "sdk-search-filter-button"
|
|
209
|
-
},
|
|
198
|
+
}, (0, _emotion.jsx)(_uiA11yContent.AccessibleContent, {
|
|
210
199
|
alt: showFilters ? (0, _formatMessage.default)('Hide search filters') : (0, _formatMessage.default)('Show search filters')
|
|
211
200
|
}, (0, _formatMessage.default)('Filters'))))), this.renderFilters());
|
|
212
201
|
}
|
|
@@ -230,7 +219,9 @@ var BankSearch = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _d
|
|
|
230
219
|
search: _reactImmutableProptypes.default.map.isRequired,
|
|
231
220
|
toggle: _propTypes.default.func.isRequired,
|
|
232
221
|
setFilter: _propTypes.default.func.isRequired,
|
|
233
|
-
update: _propTypes.default.func.isRequired
|
|
222
|
+
update: _propTypes.default.func.isRequired,
|
|
223
|
+
// eslint-disable-next-line react/require-default-props,react/forbid-prop-types
|
|
224
|
+
styles: _propTypes.default.object
|
|
234
225
|
}, _class2.defaultProps = {
|
|
235
226
|
allInteractions: false,
|
|
236
227
|
interactionTypes: [],
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
interactionType: {
|
|
11
|
+
padding: "".concat(componentTheme.searchInteractionsPaddingTopBottom, " ").concat(componentTheme.searchInteractionsPaddingLeftRight)
|
|
12
|
+
},
|
|
13
|
+
filterContainer: {
|
|
14
|
+
display: 'flex',
|
|
15
|
+
marginTop: '1rem'
|
|
16
|
+
},
|
|
17
|
+
filterColumn: {
|
|
18
|
+
flex: 1,
|
|
19
|
+
marginRight: '2rem'
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
var _default = generateStyle;
|
|
25
|
+
exports.default = _default;
|
|
@@ -3,14 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
function
|
|
9
|
-
var spacing = _ref.spacing
|
|
10
|
-
colors = _ref.colors,
|
|
11
|
-
breakpoints = _ref.breakpoints;
|
|
8
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
9
|
+
var spacing = _ref.spacing;
|
|
12
10
|
return {
|
|
13
11
|
searchInteractionsPaddingTopBottom: spacing.xSmall,
|
|
14
12
|
searchInteractionsPaddingLeftRight: spacing.small
|
|
15
13
|
};
|
|
16
|
-
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
var _default = generateComponentTheme;
|
|
17
|
+
exports.default = _default;
|