@instructure/quiz-core 20.10.1-rc.2 → 20.10.1-rc.4
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/common/components/layout/sidebar/Stimulus/Collection/presenter.js +46 -53
- package/es/common/components/layout/sidebar/Stimulus/Collection/styles.js +48 -0
- package/es/common/components/layout/sidebar/Stimulus/Collection/theme.js +4 -2
- package/es/common/components/layout/sidebar/Stimulus/Title/index.js +12 -17
- package/es/common/components/layout/sidebar/Stimulus/Title/styles.js +12 -0
- package/es/common/components/shared/TagDisplay/index.js +13 -18
- package/es/common/components/shared/TagDisplay/styles.js +9 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/CategorizationType.js +3 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsTableWrapper/presenter.js +8 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +2 -6
- package/lib/common/components/layout/sidebar/Stimulus/Collection/presenter.js +45 -56
- package/lib/common/components/layout/sidebar/Stimulus/Collection/styles.js +59 -0
- package/lib/common/components/layout/sidebar/Stimulus/Collection/theme.js +6 -3
- package/lib/common/components/layout/sidebar/Stimulus/Title/index.js +11 -19
- package/lib/common/components/layout/sidebar/Stimulus/Title/styles.js +20 -0
- package/lib/common/components/shared/TagDisplay/index.js +12 -20
- package/lib/common/components/shared/TagDisplay/styles.js +17 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/CategorizationType.js +3 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsTableWrapper/presenter.js +10 -2
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +2 -8
- package/package.json +9 -9
- package/es/common/components/layout/sidebar/Stimulus/Title/theme.js +0 -3
- package/es/common/components/shared/TagDisplay/theme.js +0 -3
- package/lib/common/components/layout/sidebar/Stimulus/Title/theme.js +0 -10
- package/lib/common/components/shared/TagDisplay/theme.js +0 -10
- /package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/{AggregationTable → AfsTableWrapper}/popoverContent.js +0 -0
- /package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/{AggregationTable → AfsTableWrapper}/popoverContent.js +0 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
1
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
@@ -6,31 +5,20 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
6
5
|
|
|
7
6
|
var _dec, _class, _class2, _temp;
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
/** @jsx jsx */
|
|
9
|
+
import { Component } from 'react';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
12
|
-
import classNames from 'classnames';
|
|
13
12
|
import { IconArrowOpenDownLine, IconArrowOpenUpLine } from '@instructure/ui-icons';
|
|
14
13
|
import { Transition } from '@instructure/ui-motion';
|
|
15
14
|
import { IconButton } from '@instructure/ui-buttons';
|
|
16
|
-
import {
|
|
15
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
17
16
|
import PositionSummary from "../../PositionSummary/index.js";
|
|
18
17
|
import { DISPLAY_AS_SUMMARY_LIMIT } from "../presenter.js";
|
|
19
18
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return "\n\n.fiHJX_bZNM{align-items:center;display:flex;flex-flow:column;padding:".concat(theme.columnPadding || 'inherit', ";padding-bottom:0}\n\n.fiHJX_dMbU{display:none}\n\n.fiHJX_fYKY{display:flex}\n\n.fiHJX_cnRi{display:none}\n\n.fiHJX_eNNp .fiHJX_ebwZ{border-top-color:").concat(theme.sidebarIsOpenBottomBorderColor || 'inherit', ";border-top-style:dashed;border-top-width:").concat(theme.sidebarIsOpenBottomBorderWidth || 'inherit', ";padding-left:0}\n\n.fiHJX_eNNp .fiHJX_dMbU{display:block}");
|
|
24
|
-
},
|
|
25
|
-
'column': 'fiHJX_bZNM',
|
|
26
|
-
'itemsContainer': 'fiHJX_dMbU',
|
|
27
|
-
'sidebarIsClosed': 'fiHJX_fYKY',
|
|
28
|
-
'hideAll': 'fiHJX_cnRi',
|
|
29
|
-
'sidebarIsOpen': 'fiHJX_eNNp',
|
|
30
|
-
'topBorder': 'fiHJX_ebwZ'
|
|
31
|
-
};
|
|
32
|
-
import theme from "./theme.js";
|
|
33
|
-
export var Collection = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
19
|
+
import generateStyle from "./styles.js";
|
|
20
|
+
import generateComponentTheme from "./theme.js";
|
|
21
|
+
export var Collection = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
34
22
|
_inherits(Collection, _Component);
|
|
35
23
|
|
|
36
24
|
var _super = _createSuper(Collection);
|
|
@@ -58,6 +46,16 @@ export var Collection = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
58
46
|
}
|
|
59
47
|
|
|
60
48
|
_createClass(Collection, [{
|
|
49
|
+
key: "componentDidMount",
|
|
50
|
+
value: function componentDidMount() {
|
|
51
|
+
this.props.makeStyles();
|
|
52
|
+
}
|
|
53
|
+
}, {
|
|
54
|
+
key: "componentDidUpdate",
|
|
55
|
+
value: function componentDidUpdate() {
|
|
56
|
+
this.props.makeStyles();
|
|
57
|
+
}
|
|
58
|
+
}, {
|
|
61
59
|
key: "shouldDisplayAllItems",
|
|
62
60
|
value: function shouldDisplayAllItems() {
|
|
63
61
|
return this.props.itemCollection.size <= DISPLAY_AS_SUMMARY_LIMIT;
|
|
@@ -68,60 +66,54 @@ export var Collection = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
68
66
|
// RENDERING
|
|
69
67
|
// =============
|
|
70
68
|
value: function renderItems() {
|
|
71
|
-
var
|
|
72
|
-
_this2 = this,
|
|
73
|
-
_classNames2;
|
|
69
|
+
var _this2 = this;
|
|
74
70
|
|
|
75
71
|
var _this$props = this.props,
|
|
76
72
|
firstPosition = _this$props.firstPosition,
|
|
77
|
-
isOver = _this$props.isOver,
|
|
78
73
|
isShowingItems = _this$props.isShowingItems,
|
|
79
74
|
itemCollection = _this$props.itemCollection,
|
|
80
75
|
sidebarOpen = _this$props.sidebarOpen;
|
|
81
|
-
var borderStyle = classNames((_classNames = {}, _defineProperty(_classNames, styles.itemsContainer, true), _defineProperty(_classNames, styles.sidebarIsClosed, !sidebarOpen), _defineProperty(_classNames, styles.topBorder, !isOver || !sidebarOpen), _classNames));
|
|
82
76
|
var nextDisplayPosition = firstPosition;
|
|
83
77
|
var itemComponents = itemCollection.toArray().map(function (item, i) {
|
|
84
78
|
var displayPosition = nextDisplayPosition;
|
|
85
79
|
nextDisplayPosition += item.displayPositionSlots;
|
|
86
|
-
return
|
|
80
|
+
return jsx("div", {
|
|
87
81
|
key: item.id,
|
|
88
|
-
|
|
82
|
+
css: _this2.props.styles.sidebarItemContainer
|
|
89
83
|
}, _this2.props.renderSidebarItem(item, displayPosition, sidebarOpen));
|
|
90
84
|
});
|
|
91
|
-
var sidebarItemsStyles = classNames((_classNames2 = {}, _defineProperty(_classNames2, styles.column, isShowingItems && !this.shouldDisplayAllItems() && !sidebarOpen), _defineProperty(_classNames2, styles.hideAll, isShowingItems && sidebarOpen || this.shouldDisplayAllItems() || sidebarOpen), _classNames2));
|
|
92
85
|
var transitionType = isShowingItems ? 'slide-down' : 'slide-up';
|
|
93
|
-
return
|
|
86
|
+
return jsx(Transition, {
|
|
94
87
|
in: isShowingItems || this.shouldDisplayAllItems(),
|
|
95
88
|
type: transitionType
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
89
|
+
}, jsx("div", null, jsx("div", {
|
|
90
|
+
css: this.props.styles.sidebarItem,
|
|
91
|
+
"data-testid": "sidebar-item"
|
|
92
|
+
}, jsx(IconButton, {
|
|
101
93
|
onClick: this.handleSidebarHideItems,
|
|
102
94
|
withBackground: false,
|
|
103
95
|
withBorder: false,
|
|
104
96
|
renderIcon: IconArrowOpenUpLine,
|
|
105
97
|
screenReaderLabel: t('Collapse stimulus questions')
|
|
106
|
-
})),
|
|
98
|
+
})), jsx("div", null, itemComponents)));
|
|
107
99
|
}
|
|
108
100
|
}, {
|
|
109
|
-
key: "
|
|
110
|
-
value: function
|
|
101
|
+
key: "renderItemSummaryOnClosedSidebar",
|
|
102
|
+
value: function renderItemSummaryOnClosedSidebar() {
|
|
111
103
|
var _this$props2 = this.props,
|
|
112
104
|
firstPosition = _this$props2.firstPosition,
|
|
113
105
|
itemCollection = _this$props2.itemCollection,
|
|
114
106
|
isShowingItems = _this$props2.isShowingItems;
|
|
115
107
|
var transitionType = !isShowingItems ? 'slide-up' : 'slide-down';
|
|
116
|
-
return
|
|
108
|
+
return jsx(Transition, {
|
|
117
109
|
in: !isShowingItems,
|
|
118
110
|
type: transitionType
|
|
119
|
-
},
|
|
120
|
-
|
|
121
|
-
},
|
|
111
|
+
}, jsx("div", {
|
|
112
|
+
css: this.props.styles.column
|
|
113
|
+
}, jsx(PositionSummary, {
|
|
122
114
|
firstPosition: firstPosition,
|
|
123
115
|
lastPosition: firstPosition + itemCollection.size - 1
|
|
124
|
-
}),
|
|
116
|
+
}), jsx(IconButton, {
|
|
125
117
|
onClick: this.handleSidebarShowItems,
|
|
126
118
|
withBackground: false,
|
|
127
119
|
withBorder: false,
|
|
@@ -132,18 +124,15 @@ export var Collection = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
132
124
|
}, {
|
|
133
125
|
key: "render",
|
|
134
126
|
value: function render() {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
className: hideItemsClass
|
|
145
|
-
}, this.renderItemSummaryOnClosedSidear()), /*#__PURE__*/React.createElement("div", {
|
|
146
|
-
className: hideSummaryClass
|
|
127
|
+
return jsx("div", {
|
|
128
|
+
css: this.props.styles.container,
|
|
129
|
+
"data-testid": "container"
|
|
130
|
+
}, jsx("div", {
|
|
131
|
+
css: this.props.styles.items,
|
|
132
|
+
"data-testid": "items"
|
|
133
|
+
}, this.renderItemSummaryOnClosedSidebar()), jsx("div", {
|
|
134
|
+
css: this.props.styles.summary,
|
|
135
|
+
"data-testid": "summary"
|
|
147
136
|
}, this.renderItems()));
|
|
148
137
|
}
|
|
149
138
|
}]);
|
|
@@ -153,6 +142,8 @@ export var Collection = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
153
142
|
}(Component), _class2.propTypes = {
|
|
154
143
|
// Passed in by Sidebar
|
|
155
144
|
firstPosition: PropTypes.number.isRequired,
|
|
145
|
+
|
|
146
|
+
/* eslint-disable-next-line react/no-unused-prop-types */
|
|
156
147
|
isOver: PropTypes.bool.isRequired,
|
|
157
148
|
|
|
158
149
|
/* This is used for when the stimulus is being dragged in build */
|
|
@@ -162,7 +153,9 @@ export var Collection = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
162
153
|
isShowingItems: PropTypes.bool,
|
|
163
154
|
stimulusId: PropTypes.string.isRequired,
|
|
164
155
|
// set in connect
|
|
165
|
-
setSidebarStimulusIsShowing: PropTypes.func.isRequired
|
|
156
|
+
setSidebarStimulusIsShowing: PropTypes.func.isRequired,
|
|
157
|
+
styles: PropTypes.object,
|
|
158
|
+
makeStyles: PropTypes.func
|
|
166
159
|
}, _class2.defaultProps = {
|
|
167
160
|
isShowingItems: false
|
|
168
161
|
}, _temp)) || _class);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import { DISPLAY_AS_SUMMARY_LIMIT } from "../presenter.js";
|
|
3
|
+
|
|
4
|
+
var generateStyle = function generateStyle(componentTheme, props) {
|
|
5
|
+
var shouldDisplayAllItems = props.itemCollection.size <= DISPLAY_AS_SUMMARY_LIMIT;
|
|
6
|
+
var shouldDisplayAsColumn = props.isShowingItems && !shouldDisplayAllItems && !props.sidebarOpen;
|
|
7
|
+
var isSideBarItemHidden = props.isShowingItems && props.sidebarOpen || shouldDisplayAllItems || props.sidebarOpen;
|
|
8
|
+
var isContainerHidden = props.sidebarOpen && !props.isShowingItems && !shouldDisplayAllItems;
|
|
9
|
+
var areItemsHidden = shouldDisplayAllItems || props.isShowingItems;
|
|
10
|
+
var isSummaryHidden = !shouldDisplayAllItems && !props.isShowingItems && !props.sidebarOpen;
|
|
11
|
+
var columnStyles = {
|
|
12
|
+
display: 'flex',
|
|
13
|
+
flexFlow: 'column',
|
|
14
|
+
padding: componentTheme.columnPadding,
|
|
15
|
+
paddingBottom: '0',
|
|
16
|
+
alignItems: 'center'
|
|
17
|
+
};
|
|
18
|
+
var hiddenStyles = {
|
|
19
|
+
display: 'none'
|
|
20
|
+
};
|
|
21
|
+
return {
|
|
22
|
+
column: columnStyles,
|
|
23
|
+
sidebarItemContainer: _objectSpread(_objectSpread({
|
|
24
|
+
display: 'none'
|
|
25
|
+
}, props.sidebarOpen && {
|
|
26
|
+
display: 'block'
|
|
27
|
+
}), (!props.isOver || !props.sidebarOpen) && {
|
|
28
|
+
borderTopStyle: 'dashed',
|
|
29
|
+
borderTopWidth: componentTheme.sidebarIsOpenBottomBorderWidth,
|
|
30
|
+
borderTopColor: componentTheme.sidebarIsOpenBottomBorderColor,
|
|
31
|
+
paddingLeft: '0'
|
|
32
|
+
}),
|
|
33
|
+
sidebarItem: _objectSpread(_objectSpread({
|
|
34
|
+
display: 'block'
|
|
35
|
+
}, shouldDisplayAsColumn && columnStyles), isSideBarItemHidden && hiddenStyles),
|
|
36
|
+
container: _objectSpread({
|
|
37
|
+
display: 'block'
|
|
38
|
+
}, isContainerHidden && hiddenStyles),
|
|
39
|
+
items: _objectSpread({
|
|
40
|
+
display: 'block'
|
|
41
|
+
}, areItemsHidden && hiddenStyles),
|
|
42
|
+
summary: _objectSpread({
|
|
43
|
+
display: 'block'
|
|
44
|
+
}, isSummaryHidden && hiddenStyles)
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export default generateStyle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
2
|
var colors = _ref.colors,
|
|
3
3
|
spacing = _ref.spacing,
|
|
4
4
|
borders = _ref.borders;
|
|
@@ -7,4 +7,6 @@ export default function generator(_ref) {
|
|
|
7
7
|
sidebarIsOpenBottomBorderColor: colors.slate,
|
|
8
8
|
sidebarIsOpenBottomBorderWidth: borders.widthSmall
|
|
9
9
|
};
|
|
10
|
-
}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default generateComponentTheme;
|
|
@@ -5,22 +5,16 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
5
5
|
|
|
6
6
|
var _dec, _class, _class2, _temp;
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
/** @jsx jsx */
|
|
9
|
+
import { Component } from 'react';
|
|
9
10
|
import PropTypes from 'prop-types';
|
|
10
11
|
import { AccessibleContent } from '@instructure/ui-a11y-content';
|
|
11
12
|
import { Tooltip } from '@instructure/ui-tooltip';
|
|
12
13
|
import { Text } from '@instructure/ui-text';
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
componentId: 'NwzGY',
|
|
16
|
-
template: function template(theme) {
|
|
17
|
-
return "\n\n.NwzGY_esVF{cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:pre-wrap}";
|
|
18
|
-
},
|
|
19
|
-
'itemBody': 'NwzGY_esVF'
|
|
20
|
-
};
|
|
21
|
-
import theme from "./theme.js";
|
|
14
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
15
|
+
import generateStyle from "./styles.js";
|
|
22
16
|
var DISPLAY_TOOLTIP_LIMIT = 80;
|
|
23
|
-
export var Title = (_dec =
|
|
17
|
+
export var Title = (_dec = withStyle(generateStyle, null), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
24
18
|
_inherits(Title, _Component);
|
|
25
19
|
|
|
26
20
|
var _super = _createSuper(Title);
|
|
@@ -35,9 +29,9 @@ export var Title = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cla
|
|
|
35
29
|
key: "renderTitle",
|
|
36
30
|
value: function renderTitle() {
|
|
37
31
|
var title = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.props.title;
|
|
38
|
-
return
|
|
39
|
-
|
|
40
|
-
},
|
|
32
|
+
return jsx("div", {
|
|
33
|
+
css: this.props.styles.itemBody
|
|
34
|
+
}, jsx(Text, {
|
|
41
35
|
color: "primary"
|
|
42
36
|
}, title));
|
|
43
37
|
}
|
|
@@ -48,9 +42,9 @@ export var Title = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cla
|
|
|
48
42
|
|
|
49
43
|
if (title.length > DISPLAY_TOOLTIP_LIMIT) {
|
|
50
44
|
var truncatedTitle = "".concat(title.substring(0, DISPLAY_TOOLTIP_LIMIT), "...");
|
|
51
|
-
return
|
|
45
|
+
return jsx(AccessibleContent, {
|
|
52
46
|
alt: title
|
|
53
|
-
},
|
|
47
|
+
}, jsx(Tooltip, {
|
|
54
48
|
renderTip: title,
|
|
55
49
|
color: "primary"
|
|
56
50
|
}, this.renderTitle(truncatedTitle)));
|
|
@@ -63,6 +57,7 @@ export var Title = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cla
|
|
|
63
57
|
Title.displayName = "Title";
|
|
64
58
|
return Title;
|
|
65
59
|
}(Component), _class2.propTypes = {
|
|
66
|
-
title: PropTypes.string.isRequired
|
|
60
|
+
title: PropTypes.string.isRequired,
|
|
61
|
+
styles: PropTypes.object
|
|
67
62
|
}, _temp)) || _class);
|
|
68
63
|
export default Title;
|
|
@@ -5,23 +5,17 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
5
5
|
|
|
6
6
|
var _dec, _class, _class2, _temp;
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
/** @jsx jsx */
|
|
9
|
+
import { Component } from 'react';
|
|
9
10
|
import PropTypes from 'prop-types';
|
|
10
11
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
11
12
|
import { AccessibleContent } from '@instructure/ui-a11y-content';
|
|
12
13
|
import { Text } from '@instructure/ui-text';
|
|
13
14
|
import { Tag } from '@instructure/ui-tag';
|
|
14
|
-
import {
|
|
15
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
15
16
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
template: function template(theme) {
|
|
19
|
-
return "\n\n.fYbSI_estS,[dir=ltr] .fYbSI_estS,[dir=rtl] .fYbSI_estS{float:right}";
|
|
20
|
-
},
|
|
21
|
-
'tags': 'fYbSI_estS'
|
|
22
|
-
};
|
|
23
|
-
import theme from "./theme.js";
|
|
24
|
-
export var TagDisplay = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
17
|
+
import generateStyle from "./styles.js";
|
|
18
|
+
export var TagDisplay = (_dec = withStyle(generateStyle, null), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
25
19
|
_inherits(TagDisplay, _Component);
|
|
26
20
|
|
|
27
21
|
var _super = _createSuper(TagDisplay);
|
|
@@ -43,25 +37,25 @@ export var TagDisplay = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
43
37
|
var count = this.props.tagAssociations.size;
|
|
44
38
|
var extra = count - display;
|
|
45
39
|
var visible = this.props.tagAssociations.take(display).map(function (t) {
|
|
46
|
-
return
|
|
40
|
+
return jsx(Tag, {
|
|
47
41
|
margin: "0 xx-small 0 0",
|
|
48
42
|
key: t.get('id'),
|
|
49
43
|
text: t.get('tag_value')
|
|
50
44
|
});
|
|
51
45
|
});
|
|
52
|
-
return
|
|
46
|
+
return jsx("div", {
|
|
53
47
|
role: "group",
|
|
54
|
-
|
|
48
|
+
css: this.props.styles.tags,
|
|
55
49
|
"aria-label": t('question tags')
|
|
56
|
-
}, visible, extra > 0 &&
|
|
50
|
+
}, visible, extra > 0 && jsx(Tag, {
|
|
57
51
|
themeOverride: {
|
|
58
52
|
defaultBackground: '#FFFFFF'
|
|
59
53
|
},
|
|
60
|
-
text:
|
|
54
|
+
text: jsx(AccessibleContent, {
|
|
61
55
|
alt: t('{n} other tags not shown', {
|
|
62
56
|
n: extra
|
|
63
57
|
})
|
|
64
|
-
},
|
|
58
|
+
}, jsx(Text, {
|
|
65
59
|
size: "small"
|
|
66
60
|
}, t('+{n}', {
|
|
67
61
|
n: extra
|
|
@@ -74,7 +68,8 @@ export var TagDisplay = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
74
68
|
return TagDisplay;
|
|
75
69
|
}(Component), _class2.propTypes = {
|
|
76
70
|
display: PropTypes.number,
|
|
77
|
-
tagAssociations: ImmutablePropTypes.listOf(ImmutablePropTypes.map)
|
|
71
|
+
tagAssociations: ImmutablePropTypes.listOf(ImmutablePropTypes.map),
|
|
72
|
+
styles: PropTypes.object
|
|
78
73
|
}, _class2.defaultProps = {
|
|
79
74
|
display: 2,
|
|
80
75
|
tagAssociations: null
|
|
@@ -50,7 +50,9 @@ export var CategorizationType = /*#__PURE__*/function (_Component) {
|
|
|
50
50
|
|
|
51
51
|
var updatedAnswerSummary = _this.updateAnswerBody(answerSummary);
|
|
52
52
|
|
|
53
|
-
return /*#__PURE__*/React.createElement(AfsTableWrapper,
|
|
53
|
+
return /*#__PURE__*/React.createElement(AfsTableWrapper, {
|
|
54
|
+
noAnswerMissingPopover: true
|
|
55
|
+
}, /*#__PURE__*/React.createElement(AfsPartsContainer, {
|
|
54
56
|
afsTable: /*#__PURE__*/React.createElement(MatchingTypeTable, {
|
|
55
57
|
itemId: itemId,
|
|
56
58
|
answerSummary: updatedAnswerSummary,
|
|
@@ -12,6 +12,8 @@ import { Heading } from '@instructure/ui-heading';
|
|
|
12
12
|
import { withStyle, jsx } from '@instructure/emotion';
|
|
13
13
|
import generateStyle from "./styles.js";
|
|
14
14
|
import PropTypes from 'prop-types';
|
|
15
|
+
import { noAnswerMissing } from "./popoverContent.js";
|
|
16
|
+
import MetricPopover from "../../../MetricPopover/index.js";
|
|
15
17
|
export var AfsTableWrapper = (_dec = withStyle(generateStyle, null), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
16
18
|
_inherits(AfsTableWrapper, _Component);
|
|
17
19
|
|
|
@@ -34,6 +36,7 @@ export var AfsTableWrapper = (_dec = withStyle(generateStyle, null), _dec(_class
|
|
|
34
36
|
};
|
|
35
37
|
|
|
36
38
|
_this.render = function () {
|
|
39
|
+
var noAnswerMissingPopover = _this.props.noAnswerMissingPopover;
|
|
37
40
|
return jsx(Flex, {
|
|
38
41
|
direction: "row",
|
|
39
42
|
"data-testid": "AfsTableWrapper"
|
|
@@ -46,7 +49,9 @@ export var AfsTableWrapper = (_dec = withStyle(generateStyle, null), _dec(_class
|
|
|
46
49
|
level: "h3",
|
|
47
50
|
weight: "bold",
|
|
48
51
|
color: "primary"
|
|
49
|
-
},
|
|
52
|
+
}, jsx(Flex, {
|
|
53
|
+
gap: "x-small"
|
|
54
|
+
}, jsx(Flex.Item, null, _this.getHeader()), jsx(Flex.Item, null, noAnswerMissingPopover && jsx(MetricPopover, noAnswerMissing)))), _this.props.children)));
|
|
50
55
|
};
|
|
51
56
|
|
|
52
57
|
return _this;
|
|
@@ -56,5 +61,6 @@ export var AfsTableWrapper = (_dec = withStyle(generateStyle, null), _dec(_class
|
|
|
56
61
|
}(Component), _class2.propTypes = {
|
|
57
62
|
children: PropTypes.node.isRequired,
|
|
58
63
|
styles: PropTypes.object,
|
|
59
|
-
tableHeader: PropTypes.string
|
|
64
|
+
tableHeader: PropTypes.string,
|
|
65
|
+
noAnswerMissingPopover: PropTypes.bool
|
|
60
66
|
}, _temp)) || _class);
|
|
@@ -35,8 +35,6 @@ var styles = {
|
|
|
35
35
|
import { Flex } from '@instructure/ui-flex';
|
|
36
36
|
import classNames from 'classnames';
|
|
37
37
|
import { Text } from '@instructure/ui-text';
|
|
38
|
-
import MetricPopover from "../../../MetricPopover/index.js";
|
|
39
|
-
import { noAnswerMissing } from "./popoverContent.js";
|
|
40
38
|
var noAnswerKey = 'noAnswer';
|
|
41
39
|
var incorrectKey = 'incorrect';
|
|
42
40
|
var correctKey = 'correct';
|
|
@@ -74,11 +72,9 @@ export var AggregationTable = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
74
72
|
var percentageHeaderId = "answer-frequency-summary-aggregate-percentage-".concat(itemId);
|
|
75
73
|
return /*#__PURE__*/React.createElement(Table.Head, null, /*#__PURE__*/React.createElement(Table.Row, null, /*#__PURE__*/React.createElement(Table.ColHeader, {
|
|
76
74
|
id: answerHeaderId
|
|
77
|
-
}, /*#__PURE__*/React.createElement(
|
|
78
|
-
gap: "x-small"
|
|
79
|
-
}, /*#__PURE__*/React.createElement(Flex.Item, null, /*#__PURE__*/React.createElement("span", {
|
|
75
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
80
76
|
className: classNames(styles.firstHeaderCell)
|
|
81
|
-
}, t('Result'))), /*#__PURE__*/React.createElement(
|
|
77
|
+
}, t('Result'))), /*#__PURE__*/React.createElement(Table.ColHeader, {
|
|
82
78
|
id: respondentsHeaderId,
|
|
83
79
|
textAlign: "center"
|
|
84
80
|
}, t('Respondents')), /*#__PURE__*/React.createElement(Table.ColHeader, {
|
|
@@ -2,15 +2,11 @@
|
|
|
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
|
});
|
|
10
8
|
exports.default = exports.Collection = void 0;
|
|
11
9
|
|
|
12
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
-
|
|
14
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
11
|
|
|
16
12
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -19,21 +15,19 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
19
15
|
|
|
20
16
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
21
17
|
|
|
22
|
-
var _react =
|
|
18
|
+
var _react = require("react");
|
|
23
19
|
|
|
24
20
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
25
21
|
|
|
26
22
|
var _reactImmutableProptypes = _interopRequireDefault(require("react-immutable-proptypes"));
|
|
27
23
|
|
|
28
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
29
|
-
|
|
30
24
|
var _uiIcons = require("@instructure/ui-icons");
|
|
31
25
|
|
|
32
26
|
var _uiMotion = require("@instructure/ui-motion");
|
|
33
27
|
|
|
34
28
|
var _uiButtons = require("@instructure/ui-buttons");
|
|
35
29
|
|
|
36
|
-
var
|
|
30
|
+
var _emotion = require("@instructure/emotion");
|
|
37
31
|
|
|
38
32
|
var _index = _interopRequireDefault(require("../../PositionSummary/index.js"));
|
|
39
33
|
|
|
@@ -41,23 +35,13 @@ var _presenter = require("../presenter.js");
|
|
|
41
35
|
|
|
42
36
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
43
37
|
|
|
38
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
39
|
+
|
|
44
40
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
45
41
|
|
|
46
42
|
var _dec, _class, _class2, _temp;
|
|
47
43
|
|
|
48
|
-
var
|
|
49
|
-
componentId: 'fiHJX',
|
|
50
|
-
template: function template(theme) {
|
|
51
|
-
return "\n\n.fiHJX_bZNM{align-items:center;display:flex;flex-flow:column;padding:".concat(theme.columnPadding || 'inherit', ";padding-bottom:0}\n\n.fiHJX_dMbU{display:none}\n\n.fiHJX_fYKY{display:flex}\n\n.fiHJX_cnRi{display:none}\n\n.fiHJX_eNNp .fiHJX_ebwZ{border-top-color:").concat(theme.sidebarIsOpenBottomBorderColor || 'inherit', ";border-top-style:dashed;border-top-width:").concat(theme.sidebarIsOpenBottomBorderWidth || 'inherit', ";padding-left:0}\n\n.fiHJX_eNNp .fiHJX_dMbU{display:block}");
|
|
52
|
-
},
|
|
53
|
-
'column': 'fiHJX_bZNM',
|
|
54
|
-
'itemsContainer': 'fiHJX_dMbU',
|
|
55
|
-
'sidebarIsClosed': 'fiHJX_fYKY',
|
|
56
|
-
'hideAll': 'fiHJX_cnRi',
|
|
57
|
-
'sidebarIsOpen': 'fiHJX_eNNp',
|
|
58
|
-
'topBorder': 'fiHJX_ebwZ'
|
|
59
|
-
};
|
|
60
|
-
var Collection = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
44
|
+
var Collection = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
61
45
|
(0, _inherits2.default)(Collection, _Component);
|
|
62
46
|
|
|
63
47
|
var _super = (0, _createSuper2.default)(Collection);
|
|
@@ -85,6 +69,16 @@ var Collection = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _d
|
|
|
85
69
|
}
|
|
86
70
|
|
|
87
71
|
(0, _createClass2.default)(Collection, [{
|
|
72
|
+
key: "componentDidMount",
|
|
73
|
+
value: function componentDidMount() {
|
|
74
|
+
this.props.makeStyles();
|
|
75
|
+
}
|
|
76
|
+
}, {
|
|
77
|
+
key: "componentDidUpdate",
|
|
78
|
+
value: function componentDidUpdate() {
|
|
79
|
+
this.props.makeStyles();
|
|
80
|
+
}
|
|
81
|
+
}, {
|
|
88
82
|
key: "shouldDisplayAllItems",
|
|
89
83
|
value: function shouldDisplayAllItems() {
|
|
90
84
|
return this.props.itemCollection.size <= _presenter.DISPLAY_AS_SUMMARY_LIMIT;
|
|
@@ -95,60 +89,54 @@ var Collection = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _d
|
|
|
95
89
|
// RENDERING
|
|
96
90
|
// =============
|
|
97
91
|
value: function renderItems() {
|
|
98
|
-
var
|
|
99
|
-
_this2 = this,
|
|
100
|
-
_classNames2;
|
|
92
|
+
var _this2 = this;
|
|
101
93
|
|
|
102
94
|
var _this$props = this.props,
|
|
103
95
|
firstPosition = _this$props.firstPosition,
|
|
104
|
-
isOver = _this$props.isOver,
|
|
105
96
|
isShowingItems = _this$props.isShowingItems,
|
|
106
97
|
itemCollection = _this$props.itemCollection,
|
|
107
98
|
sidebarOpen = _this$props.sidebarOpen;
|
|
108
|
-
var borderStyle = (0, _classnames.default)((_classNames = {}, (0, _defineProperty2.default)(_classNames, styles.itemsContainer, true), (0, _defineProperty2.default)(_classNames, styles.sidebarIsClosed, !sidebarOpen), (0, _defineProperty2.default)(_classNames, styles.topBorder, !isOver || !sidebarOpen), _classNames));
|
|
109
99
|
var nextDisplayPosition = firstPosition;
|
|
110
100
|
var itemComponents = itemCollection.toArray().map(function (item, i) {
|
|
111
101
|
var displayPosition = nextDisplayPosition;
|
|
112
102
|
nextDisplayPosition += item.displayPositionSlots;
|
|
113
|
-
return
|
|
103
|
+
return (0, _emotion.jsx)("div", {
|
|
114
104
|
key: item.id,
|
|
115
|
-
|
|
105
|
+
css: _this2.props.styles.sidebarItemContainer
|
|
116
106
|
}, _this2.props.renderSidebarItem(item, displayPosition, sidebarOpen));
|
|
117
107
|
});
|
|
118
|
-
var sidebarItemsStyles = (0, _classnames.default)((_classNames2 = {}, (0, _defineProperty2.default)(_classNames2, styles.column, isShowingItems && !this.shouldDisplayAllItems() && !sidebarOpen), (0, _defineProperty2.default)(_classNames2, styles.hideAll, isShowingItems && sidebarOpen || this.shouldDisplayAllItems() || sidebarOpen), _classNames2));
|
|
119
108
|
var transitionType = isShowingItems ? 'slide-down' : 'slide-up';
|
|
120
|
-
return
|
|
109
|
+
return (0, _emotion.jsx)(_uiMotion.Transition, {
|
|
121
110
|
in: isShowingItems || this.shouldDisplayAllItems(),
|
|
122
111
|
type: transitionType
|
|
123
|
-
},
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}, /*#__PURE__*/_react.default.createElement(_uiButtons.IconButton, {
|
|
112
|
+
}, (0, _emotion.jsx)("div", null, (0, _emotion.jsx)("div", {
|
|
113
|
+
css: this.props.styles.sidebarItem,
|
|
114
|
+
"data-testid": "sidebar-item"
|
|
115
|
+
}, (0, _emotion.jsx)(_uiButtons.IconButton, {
|
|
128
116
|
onClick: this.handleSidebarHideItems,
|
|
129
117
|
withBackground: false,
|
|
130
118
|
withBorder: false,
|
|
131
119
|
renderIcon: _uiIcons.IconArrowOpenUpLine,
|
|
132
120
|
screenReaderLabel: (0, _formatMessage.default)('Collapse stimulus questions')
|
|
133
|
-
})),
|
|
121
|
+
})), (0, _emotion.jsx)("div", null, itemComponents)));
|
|
134
122
|
}
|
|
135
123
|
}, {
|
|
136
|
-
key: "
|
|
137
|
-
value: function
|
|
124
|
+
key: "renderItemSummaryOnClosedSidebar",
|
|
125
|
+
value: function renderItemSummaryOnClosedSidebar() {
|
|
138
126
|
var _this$props2 = this.props,
|
|
139
127
|
firstPosition = _this$props2.firstPosition,
|
|
140
128
|
itemCollection = _this$props2.itemCollection,
|
|
141
129
|
isShowingItems = _this$props2.isShowingItems;
|
|
142
130
|
var transitionType = !isShowingItems ? 'slide-up' : 'slide-down';
|
|
143
|
-
return
|
|
131
|
+
return (0, _emotion.jsx)(_uiMotion.Transition, {
|
|
144
132
|
in: !isShowingItems,
|
|
145
133
|
type: transitionType
|
|
146
|
-
},
|
|
147
|
-
|
|
148
|
-
},
|
|
134
|
+
}, (0, _emotion.jsx)("div", {
|
|
135
|
+
css: this.props.styles.column
|
|
136
|
+
}, (0, _emotion.jsx)(_index.default, {
|
|
149
137
|
firstPosition: firstPosition,
|
|
150
138
|
lastPosition: firstPosition + itemCollection.size - 1
|
|
151
|
-
}),
|
|
139
|
+
}), (0, _emotion.jsx)(_uiButtons.IconButton, {
|
|
152
140
|
onClick: this.handleSidebarShowItems,
|
|
153
141
|
withBackground: false,
|
|
154
142
|
withBorder: false,
|
|
@@ -159,18 +147,15 @@ var Collection = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _d
|
|
|
159
147
|
}, {
|
|
160
148
|
key: "render",
|
|
161
149
|
value: function render() {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
className: hideItemsClass
|
|
172
|
-
}, this.renderItemSummaryOnClosedSidear()), /*#__PURE__*/_react.default.createElement("div", {
|
|
173
|
-
className: hideSummaryClass
|
|
150
|
+
return (0, _emotion.jsx)("div", {
|
|
151
|
+
css: this.props.styles.container,
|
|
152
|
+
"data-testid": "container"
|
|
153
|
+
}, (0, _emotion.jsx)("div", {
|
|
154
|
+
css: this.props.styles.items,
|
|
155
|
+
"data-testid": "items"
|
|
156
|
+
}, this.renderItemSummaryOnClosedSidebar()), (0, _emotion.jsx)("div", {
|
|
157
|
+
css: this.props.styles.summary,
|
|
158
|
+
"data-testid": "summary"
|
|
174
159
|
}, this.renderItems()));
|
|
175
160
|
}
|
|
176
161
|
}]);
|
|
@@ -179,6 +164,8 @@ var Collection = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _d
|
|
|
179
164
|
}(_react.Component), _class2.propTypes = {
|
|
180
165
|
// Passed in by Sidebar
|
|
181
166
|
firstPosition: _propTypes.default.number.isRequired,
|
|
167
|
+
|
|
168
|
+
/* eslint-disable-next-line react/no-unused-prop-types */
|
|
182
169
|
isOver: _propTypes.default.bool.isRequired,
|
|
183
170
|
|
|
184
171
|
/* This is used for when the stimulus is being dragged in build */
|
|
@@ -188,7 +175,9 @@ var Collection = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _d
|
|
|
188
175
|
isShowingItems: _propTypes.default.bool,
|
|
189
176
|
stimulusId: _propTypes.default.string.isRequired,
|
|
190
177
|
// set in connect
|
|
191
|
-
setSidebarStimulusIsShowing: _propTypes.default.func.isRequired
|
|
178
|
+
setSidebarStimulusIsShowing: _propTypes.default.func.isRequired,
|
|
179
|
+
styles: _propTypes.default.object,
|
|
180
|
+
makeStyles: _propTypes.default.func
|
|
192
181
|
}, _class2.defaultProps = {
|
|
193
182
|
isShowingItems: false
|
|
194
183
|
}, _temp)) || _class);
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _presenter = require("../presenter.js");
|
|
13
|
+
|
|
14
|
+
var generateStyle = function generateStyle(componentTheme, props) {
|
|
15
|
+
var shouldDisplayAllItems = props.itemCollection.size <= _presenter.DISPLAY_AS_SUMMARY_LIMIT;
|
|
16
|
+
var shouldDisplayAsColumn = props.isShowingItems && !shouldDisplayAllItems && !props.sidebarOpen;
|
|
17
|
+
var isSideBarItemHidden = props.isShowingItems && props.sidebarOpen || shouldDisplayAllItems || props.sidebarOpen;
|
|
18
|
+
var isContainerHidden = props.sidebarOpen && !props.isShowingItems && !shouldDisplayAllItems;
|
|
19
|
+
var areItemsHidden = shouldDisplayAllItems || props.isShowingItems;
|
|
20
|
+
var isSummaryHidden = !shouldDisplayAllItems && !props.isShowingItems && !props.sidebarOpen;
|
|
21
|
+
var columnStyles = {
|
|
22
|
+
display: 'flex',
|
|
23
|
+
flexFlow: 'column',
|
|
24
|
+
padding: componentTheme.columnPadding,
|
|
25
|
+
paddingBottom: '0',
|
|
26
|
+
alignItems: 'center'
|
|
27
|
+
};
|
|
28
|
+
var hiddenStyles = {
|
|
29
|
+
display: 'none'
|
|
30
|
+
};
|
|
31
|
+
return {
|
|
32
|
+
column: columnStyles,
|
|
33
|
+
sidebarItemContainer: (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
34
|
+
display: 'none'
|
|
35
|
+
}, props.sidebarOpen && {
|
|
36
|
+
display: 'block'
|
|
37
|
+
}), (!props.isOver || !props.sidebarOpen) && {
|
|
38
|
+
borderTopStyle: 'dashed',
|
|
39
|
+
borderTopWidth: componentTheme.sidebarIsOpenBottomBorderWidth,
|
|
40
|
+
borderTopColor: componentTheme.sidebarIsOpenBottomBorderColor,
|
|
41
|
+
paddingLeft: '0'
|
|
42
|
+
}),
|
|
43
|
+
sidebarItem: (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
44
|
+
display: 'block'
|
|
45
|
+
}, shouldDisplayAsColumn && columnStyles), isSideBarItemHidden && hiddenStyles),
|
|
46
|
+
container: (0, _objectSpread2.default)({
|
|
47
|
+
display: 'block'
|
|
48
|
+
}, isContainerHidden && hiddenStyles),
|
|
49
|
+
items: (0, _objectSpread2.default)({
|
|
50
|
+
display: 'block'
|
|
51
|
+
}, areItemsHidden && hiddenStyles),
|
|
52
|
+
summary: (0, _objectSpread2.default)({
|
|
53
|
+
display: 'block'
|
|
54
|
+
}, isSummaryHidden && hiddenStyles)
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
var _default = generateStyle;
|
|
59
|
+
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;
|
|
@@ -14,4 +14,7 @@ function generator(_ref) {
|
|
|
14
14
|
sidebarIsOpenBottomBorderColor: colors.slate,
|
|
15
15
|
sidebarIsOpenBottomBorderWidth: borders.widthSmall
|
|
16
16
|
};
|
|
17
|
-
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
var _default = generateComponentTheme;
|
|
20
|
+
exports.default = _default;
|
|
@@ -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 _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
21
|
|
|
@@ -27,21 +25,14 @@ var _uiTooltip = require("@instructure/ui-tooltip");
|
|
|
27
25
|
|
|
28
26
|
var _uiText = require("@instructure/ui-text");
|
|
29
27
|
|
|
30
|
-
var
|
|
28
|
+
var _emotion = require("@instructure/emotion");
|
|
31
29
|
|
|
32
|
-
var
|
|
30
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
33
31
|
|
|
34
32
|
var _dec, _class, _class2, _temp;
|
|
35
33
|
|
|
36
|
-
var styles = {
|
|
37
|
-
componentId: 'NwzGY',
|
|
38
|
-
template: function template(theme) {
|
|
39
|
-
return "\n\n.NwzGY_esVF{cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:pre-wrap}";
|
|
40
|
-
},
|
|
41
|
-
'itemBody': 'NwzGY_esVF'
|
|
42
|
-
};
|
|
43
34
|
var DISPLAY_TOOLTIP_LIMIT = 80;
|
|
44
|
-
var Title = (_dec = (0,
|
|
35
|
+
var Title = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
45
36
|
(0, _inherits2.default)(Title, _Component);
|
|
46
37
|
|
|
47
38
|
var _super = (0, _createSuper2.default)(Title);
|
|
@@ -55,9 +46,9 @@ var Title = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_c
|
|
|
55
46
|
key: "renderTitle",
|
|
56
47
|
value: function renderTitle() {
|
|
57
48
|
var title = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.props.title;
|
|
58
|
-
return
|
|
59
|
-
|
|
60
|
-
},
|
|
49
|
+
return (0, _emotion.jsx)("div", {
|
|
50
|
+
css: this.props.styles.itemBody
|
|
51
|
+
}, (0, _emotion.jsx)(_uiText.Text, {
|
|
61
52
|
color: "primary"
|
|
62
53
|
}, title));
|
|
63
54
|
}
|
|
@@ -68,9 +59,9 @@ var Title = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_c
|
|
|
68
59
|
|
|
69
60
|
if (title.length > DISPLAY_TOOLTIP_LIMIT) {
|
|
70
61
|
var truncatedTitle = "".concat(title.substring(0, DISPLAY_TOOLTIP_LIMIT), "...");
|
|
71
|
-
return
|
|
62
|
+
return (0, _emotion.jsx)(_uiA11yContent.AccessibleContent, {
|
|
72
63
|
alt: title
|
|
73
|
-
},
|
|
64
|
+
}, (0, _emotion.jsx)(_uiTooltip.Tooltip, {
|
|
74
65
|
renderTip: title,
|
|
75
66
|
color: "primary"
|
|
76
67
|
}, this.renderTitle(truncatedTitle)));
|
|
@@ -82,7 +73,8 @@ var Title = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_c
|
|
|
82
73
|
Title.displayName = "Title";
|
|
83
74
|
return Title;
|
|
84
75
|
}(_react.Component), _class2.propTypes = {
|
|
85
|
-
title: _propTypes.default.string.isRequired
|
|
76
|
+
title: _propTypes.default.string.isRequired,
|
|
77
|
+
styles: _propTypes.default.object
|
|
86
78
|
}, _temp)) || _class);
|
|
87
79
|
exports.Title = Title;
|
|
88
80
|
var _default = Title;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var generateStyle = function generateStyle() {
|
|
9
|
+
return {
|
|
10
|
+
itemBody: {
|
|
11
|
+
cursor: 'pointer',
|
|
12
|
+
overflow: 'hidden',
|
|
13
|
+
textOverflow: 'ellipsis',
|
|
14
|
+
whiteSpace: 'pre-wrap'
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
var _default = generateStyle;
|
|
20
|
+
exports.default = _default;
|
|
@@ -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 _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
21
|
|
|
@@ -29,22 +27,15 @@ var _uiText = require("@instructure/ui-text");
|
|
|
29
27
|
|
|
30
28
|
var _uiTag = require("@instructure/ui-tag");
|
|
31
29
|
|
|
32
|
-
var
|
|
30
|
+
var _emotion = require("@instructure/emotion");
|
|
33
31
|
|
|
34
32
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
35
33
|
|
|
36
|
-
var
|
|
34
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
37
35
|
|
|
38
36
|
var _dec, _class, _class2, _temp;
|
|
39
37
|
|
|
40
|
-
var
|
|
41
|
-
componentId: 'fYbSI',
|
|
42
|
-
template: function template(theme) {
|
|
43
|
-
return "\n\n.fYbSI_estS,[dir=ltr] .fYbSI_estS,[dir=rtl] .fYbSI_estS{float:right}";
|
|
44
|
-
},
|
|
45
|
-
'tags': 'fYbSI_estS'
|
|
46
|
-
};
|
|
47
|
-
var TagDisplay = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
38
|
+
var TagDisplay = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
48
39
|
(0, _inherits2.default)(TagDisplay, _Component);
|
|
49
40
|
|
|
50
41
|
var _super = (0, _createSuper2.default)(TagDisplay);
|
|
@@ -65,25 +56,25 @@ var TagDisplay = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _d
|
|
|
65
56
|
var count = this.props.tagAssociations.size;
|
|
66
57
|
var extra = count - display;
|
|
67
58
|
var visible = this.props.tagAssociations.take(display).map(function (t) {
|
|
68
|
-
return
|
|
59
|
+
return (0, _emotion.jsx)(_uiTag.Tag, {
|
|
69
60
|
margin: "0 xx-small 0 0",
|
|
70
61
|
key: t.get('id'),
|
|
71
62
|
text: t.get('tag_value')
|
|
72
63
|
});
|
|
73
64
|
});
|
|
74
|
-
return
|
|
65
|
+
return (0, _emotion.jsx)("div", {
|
|
75
66
|
role: "group",
|
|
76
|
-
|
|
67
|
+
css: this.props.styles.tags,
|
|
77
68
|
"aria-label": (0, _formatMessage.default)('question tags')
|
|
78
|
-
}, visible, extra > 0 &&
|
|
69
|
+
}, visible, extra > 0 && (0, _emotion.jsx)(_uiTag.Tag, {
|
|
79
70
|
themeOverride: {
|
|
80
71
|
defaultBackground: '#FFFFFF'
|
|
81
72
|
},
|
|
82
|
-
text:
|
|
73
|
+
text: (0, _emotion.jsx)(_uiA11yContent.AccessibleContent, {
|
|
83
74
|
alt: (0, _formatMessage.default)('{n} other tags not shown', {
|
|
84
75
|
n: extra
|
|
85
76
|
})
|
|
86
|
-
},
|
|
77
|
+
}, (0, _emotion.jsx)(_uiText.Text, {
|
|
87
78
|
size: "small"
|
|
88
79
|
}, (0, _formatMessage.default)('+{n}', {
|
|
89
80
|
n: extra
|
|
@@ -95,7 +86,8 @@ var TagDisplay = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _d
|
|
|
95
86
|
return TagDisplay;
|
|
96
87
|
}(_react.Component), _class2.propTypes = {
|
|
97
88
|
display: _propTypes.default.number,
|
|
98
|
-
tagAssociations: _reactImmutableProptypes.default.listOf(_reactImmutableProptypes.default.map)
|
|
89
|
+
tagAssociations: _reactImmutableProptypes.default.listOf(_reactImmutableProptypes.default.map),
|
|
90
|
+
styles: _propTypes.default.object
|
|
99
91
|
}, _class2.defaultProps = {
|
|
100
92
|
display: 2,
|
|
101
93
|
tagAssociations: null
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var generateStyle = function generateStyle() {
|
|
9
|
+
return {
|
|
10
|
+
tags: {
|
|
11
|
+
float: 'right'
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
var _default = generateStyle;
|
|
17
|
+
exports.default = _default;
|
|
@@ -73,7 +73,9 @@ var CategorizationType = /*#__PURE__*/function (_Component) {
|
|
|
73
73
|
|
|
74
74
|
var updatedAnswerSummary = _this.updateAnswerBody(answerSummary);
|
|
75
75
|
|
|
76
|
-
return /*#__PURE__*/_react.default.createElement(_index.default,
|
|
76
|
+
return /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
77
|
+
noAnswerMissingPopover: true
|
|
78
|
+
}, /*#__PURE__*/_react.default.createElement(_presenter.AfsPartsContainer, {
|
|
77
79
|
afsTable: /*#__PURE__*/_react.default.createElement(_index2.default, {
|
|
78
80
|
itemId: itemId,
|
|
79
81
|
answerSummary: updatedAnswerSummary,
|
|
@@ -27,6 +27,10 @@ var _styles = _interopRequireDefault(require("./styles.js"));
|
|
|
27
27
|
|
|
28
28
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
29
29
|
|
|
30
|
+
var _popoverContent = require("./popoverContent.js");
|
|
31
|
+
|
|
32
|
+
var _index = _interopRequireDefault(require("../../../MetricPopover/index.js"));
|
|
33
|
+
|
|
30
34
|
var _dec, _class, _class2, _temp;
|
|
31
35
|
|
|
32
36
|
var AfsTableWrapper = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
@@ -51,6 +55,7 @@ var AfsTableWrapper = (_dec = (0, _emotion.withStyle)(_styles.default, null), _d
|
|
|
51
55
|
};
|
|
52
56
|
|
|
53
57
|
_this.render = function () {
|
|
58
|
+
var noAnswerMissingPopover = _this.props.noAnswerMissingPopover;
|
|
54
59
|
return (0, _emotion.jsx)(_uiFlex.Flex, {
|
|
55
60
|
direction: "row",
|
|
56
61
|
"data-testid": "AfsTableWrapper"
|
|
@@ -63,7 +68,9 @@ var AfsTableWrapper = (_dec = (0, _emotion.withStyle)(_styles.default, null), _d
|
|
|
63
68
|
level: "h3",
|
|
64
69
|
weight: "bold",
|
|
65
70
|
color: "primary"
|
|
66
|
-
},
|
|
71
|
+
}, (0, _emotion.jsx)(_uiFlex.Flex, {
|
|
72
|
+
gap: "x-small"
|
|
73
|
+
}, (0, _emotion.jsx)(_uiFlex.Flex.Item, null, _this.getHeader()), (0, _emotion.jsx)(_uiFlex.Flex.Item, null, noAnswerMissingPopover && (0, _emotion.jsx)(_index.default, _popoverContent.noAnswerMissing)))), _this.props.children)));
|
|
67
74
|
};
|
|
68
75
|
|
|
69
76
|
return _this;
|
|
@@ -73,6 +80,7 @@ var AfsTableWrapper = (_dec = (0, _emotion.withStyle)(_styles.default, null), _d
|
|
|
73
80
|
}(_react.Component), _class2.propTypes = {
|
|
74
81
|
children: _propTypes.default.node.isRequired,
|
|
75
82
|
styles: _propTypes.default.object,
|
|
76
|
-
tableHeader: _propTypes.default.string
|
|
83
|
+
tableHeader: _propTypes.default.string,
|
|
84
|
+
noAnswerMissingPopover: _propTypes.default.bool
|
|
77
85
|
}, _temp)) || _class);
|
|
78
86
|
exports.AfsTableWrapper = AfsTableWrapper;
|
|
@@ -37,10 +37,6 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
37
37
|
|
|
38
38
|
var _uiText = require("@instructure/ui-text");
|
|
39
39
|
|
|
40
|
-
var _index = _interopRequireDefault(require("../../../MetricPopover/index.js"));
|
|
41
|
-
|
|
42
|
-
var _popoverContent = require("./popoverContent.js");
|
|
43
|
-
|
|
44
40
|
var _dec, _class, _class2, _temp;
|
|
45
41
|
|
|
46
42
|
var styles = {
|
|
@@ -100,11 +96,9 @@ var AggregationTable = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
100
96
|
var percentageHeaderId = "answer-frequency-summary-aggregate-percentage-".concat(itemId);
|
|
101
97
|
return /*#__PURE__*/_react.default.createElement(_uiTable.Table.Head, null, /*#__PURE__*/_react.default.createElement(_uiTable.Table.Row, null, /*#__PURE__*/_react.default.createElement(_uiTable.Table.ColHeader, {
|
|
102
98
|
id: answerHeaderId
|
|
103
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
104
|
-
gap: "x-small"
|
|
105
|
-
}, /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, null, /*#__PURE__*/_react.default.createElement("span", {
|
|
99
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
106
100
|
className: (0, _classnames.default)(styles.firstHeaderCell)
|
|
107
|
-
}, (0, _formatMessage.default)('Result'))), /*#__PURE__*/_react.default.createElement(
|
|
101
|
+
}, (0, _formatMessage.default)('Result'))), /*#__PURE__*/_react.default.createElement(_uiTable.Table.ColHeader, {
|
|
108
102
|
id: respondentsHeaderId,
|
|
109
103
|
textAlign: "center"
|
|
110
104
|
}, (0, _formatMessage.default)('Respondents')), /*#__PURE__*/_react.default.createElement(_uiTable.Table.ColHeader, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/quiz-core",
|
|
3
|
-
"version": "20.10.1-rc.
|
|
3
|
+
"version": "20.10.1-rc.4+9acb43863",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The Quiz React SDK by Instructure Inc.",
|
|
6
6
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"@instructure/emotion": "^8.51.0",
|
|
45
45
|
"@instructure/grading-utils": "^1.0.0",
|
|
46
46
|
"@instructure/outcomes-ui": "^3.1.0",
|
|
47
|
-
"@instructure/quiz-common": "20.10.1-rc.
|
|
48
|
-
"@instructure/quiz-i18n": "20.10.1-rc.
|
|
49
|
-
"@instructure/quiz-interactions": "20.10.1-rc.
|
|
50
|
-
"@instructure/quiz-number-input": "20.10.1-rc.
|
|
51
|
-
"@instructure/quiz-rce": "20.10.1-rc.
|
|
47
|
+
"@instructure/quiz-common": "20.10.1-rc.4+9acb43863",
|
|
48
|
+
"@instructure/quiz-i18n": "20.10.1-rc.4+9acb43863",
|
|
49
|
+
"@instructure/quiz-interactions": "20.10.1-rc.4+9acb43863",
|
|
50
|
+
"@instructure/quiz-number-input": "20.10.1-rc.4+9acb43863",
|
|
51
|
+
"@instructure/quiz-rce": "20.10.1-rc.4+9acb43863",
|
|
52
52
|
"@instructure/ui-a11y-content": "^8.51.0",
|
|
53
53
|
"@instructure/ui-alerts": "^8.51.0",
|
|
54
54
|
"@instructure/ui-avatar": "^8.51.0",
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"file-saver": "~2.0.5",
|
|
113
113
|
"humps": "^2.0.0",
|
|
114
114
|
"immutable": "^3.8.1",
|
|
115
|
-
"instructure-validations": "20.10.1-rc.
|
|
115
|
+
"instructure-validations": "20.10.1-rc.4+9acb43863",
|
|
116
116
|
"ipaddr.js": "^1.5.4",
|
|
117
117
|
"isomorphic-fetch": "^2.2.0",
|
|
118
118
|
"isuuid": "^0.1.0",
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
"intl": "^1.2.4",
|
|
164
164
|
"jquery": "^2.2.3",
|
|
165
165
|
"most-subject": "^5.3.0",
|
|
166
|
-
"quiz-presets": "20.10.1-rc.
|
|
166
|
+
"quiz-presets": "20.10.1-rc.4+9acb43863",
|
|
167
167
|
"react": "^16.8.6",
|
|
168
168
|
"react-addons-test-utils": "^15.6.2",
|
|
169
169
|
"react-dom": "^16.8.6",
|
|
@@ -179,5 +179,5 @@
|
|
|
179
179
|
"publishConfig": {
|
|
180
180
|
"access": "public"
|
|
181
181
|
},
|
|
182
|
-
"gitHead": "
|
|
182
|
+
"gitHead": "9acb4386324ea4b9b5a7d896782821bbacc44778"
|
|
183
183
|
}
|
|
File without changes
|