versacall-core-library-react 2.0.65 → 2.0.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CoreAlert/CoreAlert.js +43 -107
- package/dist/components/CoreAlert/index.js +2 -4
- package/dist/components/CoreAppBar/CoreAppBar.js +275 -418
- package/dist/components/CoreAppBar/CoreAppBarDrawer.js +88 -171
- package/dist/components/CoreAppBar/index.js +2 -4
- package/dist/components/CoreAppSelector/AppLink.js +36 -60
- package/dist/components/CoreAppSelector/CoreAppSelector.js +109 -200
- package/dist/components/CoreAppSelector/index.js +2 -4
- package/dist/components/CoreDialogueToolBar/CoreDialogueToolBar.js +43 -69
- package/dist/components/CoreDialogueToolBar/index.js +2 -4
- package/dist/components/CoreDrawer/CoreDrawer.js +168 -286
- package/dist/components/CoreDrawer/index.js +2 -4
- package/dist/components/CoreDropDownTextfield/CoreDropDownTextfield.js +57 -121
- package/dist/components/CoreDropDownTextfield/index.js +2 -4
- package/dist/components/CoreElapsedTime/CoreElapsedTime.js +38 -97
- package/dist/components/CoreElapsedTime/index.js +2 -4
- package/dist/components/CoreFrame/CoreFrame.js +17 -28
- package/dist/components/CoreFrame/index.js +2 -4
- package/dist/components/CoreImportDialog/CoreImportDialog.js +87 -189
- package/dist/components/CoreImportDialog/index.js +2 -4
- package/dist/components/CoreImportResultsDialog/CoreImportResultsDialog.js +19 -45
- package/dist/components/CoreImportResultsDialog/index.js +2 -4
- package/dist/components/CoreImporting/CoreImporting.js +23 -39
- package/dist/components/CoreImporting/index.js +2 -4
- package/dist/components/CorePlugin/CorePlugin.js +83 -160
- package/dist/components/CorePlugin/OldCorePlugin.js +73 -149
- package/dist/components/CorePlugin/index.js +2 -4
- package/dist/components/CoreSaveChangesDialog/CoreSaveChangesDialog.js +10 -32
- package/dist/components/CoreSaveChangesDialog/index.js +2 -4
- package/dist/components/CoreShiftTagFilter/CoreShiftTagFilter.js +288 -408
- package/dist/components/CoreShiftTagFilter/OldCoreShiftTagFilter.js +161 -257
- package/dist/components/CoreShiftTagFilter/index.js +2 -4
- package/dist/components/CoreSideBar/CoreSideBar.js +578 -737
- package/dist/components/CoreSideBar/CoreSideBarDrawer.js +122 -212
- package/dist/components/CoreSideBar/index.js +2 -4
- package/dist/components/CoreSnackBar/CoreSnackBar.js +76 -143
- package/dist/components/CoreSnackBar/index.js +2 -4
- package/dist/components/CoreTable/CoreTable.js +219 -337
- package/dist/components/CoreTable/CoreTableChips.js +11 -19
- package/dist/components/CoreTable/CoreTableHead.js +125 -205
- package/dist/components/CoreTable/CoreTableToolbar.js +34 -56
- package/dist/components/CoreTable/index.js +2 -4
- package/dist/components/CoreTagFilter/CoreTagFilter.js +212 -319
- package/dist/components/CoreTagFilter/OldCoreTagFilter.js +270 -402
- package/dist/components/CoreTagFilter/OldTagChip.js +10 -20
- package/dist/components/CoreTagFilter/OldTagFilterSelector.js +77 -148
- package/dist/components/CoreTagFilter/OldTagOption.js +21 -47
- package/dist/components/CoreTagFilter/TagFilterBuilder.js +114 -274
- package/dist/components/CoreTagFilter/index.js +2 -4
- package/dist/components/CoreTextField/CoreTextField.js +69 -132
- package/dist/components/CoreTextField/index.js +2 -4
- package/dist/components/CoreTheme/CoreTheme.js +13 -27
- package/dist/components/CoreTheme/index.js +2 -4
- package/dist/components/CoreTile/CoreTile.js +21 -34
- package/dist/components/CoreTile/CoreTileToolbar.js +21 -36
- package/dist/components/CoreTile/index.js +2 -4
- package/dist/components/CoreTimerInput/CoreTimerInput.js +36 -60
- package/dist/components/CoreTimerInput/CoreTimerInputOld.js +29 -47
- package/dist/components/CoreTimerInput/index.js +2 -4
- package/dist/components/CoreToolbar/CoreToolbar.js +65 -95
- package/dist/components/CoreToolbar/index.js +2 -4
- package/dist/components/CoreTracker/CoreTracker.js +32 -91
- package/dist/components/CoreTracker/index.js +2 -4
- package/dist/components/CoreTranslate/CoreTranslate.js +17 -48
- package/dist/components/CoreTranslate/index.js +2 -4
- package/dist/components/CoreTranslateWrapper/CoreTranslateWrapper.js +7 -15
- package/dist/components/CoreTranslateWrapper/index.js +2 -4
- package/dist/components/CoreWidget/CoreWidget.js +81 -149
- package/dist/components/CoreWidget/index.js +2 -4
- package/dist/components/CoreWrapper/CoreWrapper.js +8 -16
- package/dist/components/CoreWrapper/index.js +2 -4
- package/dist/components/index.js +29 -58
- package/dist/constants/index.js +3 -6
- package/dist/constants/testOrganization.js +2 -3
- package/dist/constants/testToken.js +2 -3
- package/dist/context/Authentication/AuthenticationContext.js +3 -8
- package/dist/context/Authentication/AuthenticationProvider.js +156 -257
- package/dist/context/Authentication/index.js +4 -8
- package/dist/context/Authentication/withAuthentication.js +5 -14
- package/dist/context/Channels/ChannelsConsumer.js +14 -70
- package/dist/context/Channels/ChannelsContext.js +3 -8
- package/dist/context/Channels/ChannelsProvider.js +132 -278
- package/dist/context/Channels/DataChannel.js +39 -103
- package/dist/context/Channels/EntityChannel.js +40 -104
- package/dist/context/Channels/EveryoneChannel.js +32 -92
- package/dist/context/Channels/OrganizationChannel.js +40 -104
- package/dist/context/Channels/UserChannel.js +37 -99
- package/dist/context/Channels/index.js +10 -20
- package/dist/context/Channels/withChannels.js +5 -14
- package/dist/context/Core/CoreContext.js +3 -8
- package/dist/context/Core/CoreProvider.js +68 -132
- package/dist/context/Core/index.js +4 -8
- package/dist/context/Core/withCore.js +5 -14
- package/dist/context/Organization/OrganizationContext.js +3 -8
- package/dist/context/Organization/OrganizationProvider.js +48 -120
- package/dist/context/Organization/index.js +4 -8
- package/dist/context/Organization/withOrganization.js +5 -14
- package/dist/context/Plugin/PluginContext.js +3 -8
- package/dist/context/Plugin/PluginProvider.js +55 -112
- package/dist/context/Plugin/index.js +4 -8
- package/dist/context/Plugin/withPlugin.js +5 -14
- package/dist/context/index.js +5 -15
- package/dist/css/index.js +3 -6
- package/dist/functions/TagEvaluator.js +107 -156
- package/dist/functions/compareObjects.js +0 -7
- package/dist/functions/formatElapsedTime.js +5 -6
- package/dist/functions/formatNameFileSafe.js +3 -4
- package/dist/functions/getIconUrl.js +0 -3
- package/dist/functions/getParameterByName.js +9 -12
- package/dist/functions/getProperty.js +4 -8
- package/dist/functions/getUrl.js +0 -3
- package/dist/functions/index.js +9 -18
- package/dist/icons/CopyIcon.js +11 -22
- package/dist/icons/DeleteIcon.js +11 -22
- package/dist/icons/DuplicateIcon.js +11 -22
- package/dist/icons/EditIcon.js +11 -22
- package/dist/icons/FabAddIcon.js +19 -35
- package/dist/icons/PasteIcon.js +11 -22
- package/dist/icons/index.js +7 -14
- package/dist/index.js +6 -18
- package/package.json +89 -79
|
@@ -4,29 +4,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _Chip = _interopRequireDefault(require("@material-ui/core/Chip"));
|
|
11
|
-
|
|
12
9
|
var _reactIntl = require("react-intl");
|
|
13
|
-
|
|
14
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
-
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
12
|
function OldTagChip(props) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
13
|
+
const {
|
|
14
|
+
tag,
|
|
15
|
+
deleteTag,
|
|
16
|
+
icon,
|
|
17
|
+
color,
|
|
18
|
+
showDelete
|
|
19
|
+
} = props;
|
|
24
20
|
return /*#__PURE__*/_react.default.createElement(_Chip.default, {
|
|
25
21
|
label: tag,
|
|
26
22
|
avatar: icon,
|
|
27
|
-
onDelete: showDelete ?
|
|
28
|
-
return deleteTag();
|
|
29
|
-
} : function () {},
|
|
23
|
+
onDelete: showDelete ? () => deleteTag() : () => {},
|
|
30
24
|
deleteIcon: showDelete ? null : /*#__PURE__*/_react.default.createElement("span", {
|
|
31
25
|
style: {
|
|
32
26
|
width: '1px'
|
|
@@ -40,7 +34,6 @@ function OldTagChip(props) {
|
|
|
40
34
|
}
|
|
41
35
|
});
|
|
42
36
|
}
|
|
43
|
-
|
|
44
37
|
OldTagChip.propTypes = {
|
|
45
38
|
tag: _propTypes.default.string.isRequired,
|
|
46
39
|
icon: _propTypes.default.element.isRequired,
|
|
@@ -48,7 +41,4 @@ OldTagChip.propTypes = {
|
|
|
48
41
|
deleteTag: _propTypes.default.func.isRequired,
|
|
49
42
|
showDelete: _propTypes.default.bool.isRequired
|
|
50
43
|
};
|
|
51
|
-
|
|
52
|
-
var _default = (0, _reactIntl.injectIntl)(OldTagChip);
|
|
53
|
-
|
|
54
|
-
exports.default = _default;
|
|
44
|
+
var _default = exports.default = (0, _reactIntl.injectIntl)(OldTagChip);
|
|
@@ -1,168 +1,100 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.default = void 0;
|
|
9
|
-
|
|
10
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
8
|
var _TextField = _interopRequireDefault(require("@material-ui/core/TextField"));
|
|
13
|
-
|
|
14
9
|
var _List = _interopRequireDefault(require("@material-ui/core/List"));
|
|
15
|
-
|
|
16
10
|
var _Tabs = _interopRequireDefault(require("@material-ui/core/Tabs"));
|
|
17
|
-
|
|
18
11
|
var _Tab = _interopRequireDefault(require("@material-ui/core/Tab"));
|
|
19
|
-
|
|
20
12
|
var _reactIntl = require("react-intl");
|
|
21
|
-
|
|
22
13
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
|
-
|
|
24
14
|
var _CoreDialogueToolBar = _interopRequireDefault(require("../CoreDialogueToolBar"));
|
|
25
|
-
|
|
26
15
|
var _OldTagOption = _interopRequireDefault(require("./OldTagOption"));
|
|
27
|
-
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
35
|
-
|
|
36
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
37
|
-
|
|
38
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
39
|
-
|
|
40
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
41
|
-
|
|
42
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
43
|
-
|
|
44
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
45
|
-
|
|
46
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
47
|
-
|
|
48
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
49
|
-
|
|
50
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
51
|
-
|
|
52
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
53
|
-
|
|
54
|
-
var OldTagFilterSelector = /*#__PURE__*/function (_Component) {
|
|
55
|
-
_inherits(OldTagFilterSelector, _Component);
|
|
56
|
-
|
|
57
|
-
var _super = _createSuper(OldTagFilterSelector);
|
|
58
|
-
|
|
59
|
-
function OldTagFilterSelector() {
|
|
60
|
-
var _this;
|
|
61
|
-
|
|
62
|
-
_classCallCheck(this, OldTagFilterSelector);
|
|
63
|
-
|
|
64
|
-
_this = _super.call(this);
|
|
65
|
-
_this.state = {
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
18
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
|
+
class OldTagFilterSelector extends _react.Component {
|
|
20
|
+
constructor() {
|
|
21
|
+
super();
|
|
22
|
+
this.state = {
|
|
66
23
|
tab: 0,
|
|
67
24
|
search: ''
|
|
68
25
|
};
|
|
69
|
-
return _this;
|
|
70
26
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
27
|
+
getTabTitle(title, index) {
|
|
28
|
+
const {
|
|
29
|
+
intl,
|
|
30
|
+
tagOptions,
|
|
31
|
+
filter
|
|
32
|
+
} = this.props;
|
|
33
|
+
let titleString = intl.formatMessage({
|
|
34
|
+
id: title
|
|
35
|
+
});
|
|
36
|
+
if (filter[tagOptions[index].filterArrayName].length > 0) {
|
|
37
|
+
titleString = "".concat(titleString, "(").concat(filter[tagOptions[index].filterArrayName].length, ")");
|
|
38
|
+
}
|
|
39
|
+
return titleString;
|
|
40
|
+
}
|
|
41
|
+
render() {
|
|
42
|
+
const {
|
|
43
|
+
intl,
|
|
44
|
+
title,
|
|
45
|
+
tagOptions,
|
|
46
|
+
updateFilter,
|
|
47
|
+
filter,
|
|
48
|
+
onClose
|
|
49
|
+
} = this.props;
|
|
50
|
+
const {
|
|
51
|
+
tab,
|
|
52
|
+
search
|
|
53
|
+
} = this.state;
|
|
54
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_CoreDialogueToolBar.default, {
|
|
55
|
+
title: intl.formatMessage({
|
|
80
56
|
id: title
|
|
81
|
-
})
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
57
|
+
}),
|
|
58
|
+
handleClose: () => onClose()
|
|
59
|
+
}), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Tabs.default, {
|
|
60
|
+
value: tab,
|
|
61
|
+
onChange: (event, value) => this.setState({
|
|
62
|
+
tab: value,
|
|
63
|
+
search: ''
|
|
64
|
+
})
|
|
65
|
+
}, tagOptions.map((option, index) => /*#__PURE__*/_react.default.createElement(_Tab.default, {
|
|
66
|
+
label: this.getTabTitle(option.title, index),
|
|
67
|
+
key: String(index)
|
|
68
|
+
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
69
|
+
style: {
|
|
70
|
+
width: '80%',
|
|
71
|
+
margin: '0 10%'
|
|
85
72
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Tabs.default, {
|
|
112
|
-
value: tab,
|
|
113
|
-
onChange: function onChange(event, value) {
|
|
114
|
-
return _this2.setState({
|
|
115
|
-
tab: value,
|
|
116
|
-
search: ''
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
}, tagOptions.map(function (option, index) {
|
|
120
|
-
return /*#__PURE__*/_react.default.createElement(_Tab.default, {
|
|
121
|
-
label: _this2.getTabTitle(option.title, index),
|
|
122
|
-
key: String(index)
|
|
123
|
-
});
|
|
124
|
-
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
125
|
-
style: {
|
|
126
|
-
width: '80%',
|
|
127
|
-
margin: '0 10%'
|
|
128
|
-
}
|
|
129
|
-
}, /*#__PURE__*/_react.default.createElement(_TextField.default, {
|
|
130
|
-
margin: "dense",
|
|
131
|
-
value: search,
|
|
132
|
-
label: intl.formatMessage({
|
|
133
|
-
id: '__search_tags'
|
|
134
|
-
}),
|
|
135
|
-
onChange: function onChange(event) {
|
|
136
|
-
return _this2.setState({
|
|
137
|
-
search: event.target.value
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
})), /*#__PURE__*/_react.default.createElement("div", null, tagOptions.length > 0 && /*#__PURE__*/_react.default.createElement(_List.default, {
|
|
141
|
-
style: {
|
|
142
|
-
padding: '2%',
|
|
143
|
-
overflow: 'auto',
|
|
144
|
-
height: '25vh'
|
|
145
|
-
}
|
|
146
|
-
}, tagOptions[tab].options.filter(function (tag) {
|
|
147
|
-
return tag.tag.includes(search);
|
|
148
|
-
}).map(function (tag, index) {
|
|
149
|
-
return /*#__PURE__*/_react.default.createElement(_OldTagOption.default, {
|
|
150
|
-
tag: tag,
|
|
151
|
-
key: String(index),
|
|
152
|
-
filterArrayName: tagOptions[tab].filterArrayName,
|
|
153
|
-
activeTags: filter[tagOptions[tab].filterArrayName],
|
|
154
|
-
showCount: tagOptions[tab].optionName !== 'locationTags',
|
|
155
|
-
updateFilter: function updateFilter(newFilterProperties) {
|
|
156
|
-
return _updateFilter(newFilterProperties);
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
})))));
|
|
160
|
-
}
|
|
161
|
-
}]);
|
|
162
|
-
|
|
163
|
-
return OldTagFilterSelector;
|
|
164
|
-
}(_react.Component);
|
|
165
|
-
|
|
73
|
+
}, /*#__PURE__*/_react.default.createElement(_TextField.default, {
|
|
74
|
+
margin: "dense",
|
|
75
|
+
value: search,
|
|
76
|
+
label: intl.formatMessage({
|
|
77
|
+
id: '__search_tags'
|
|
78
|
+
}),
|
|
79
|
+
onChange: event => this.setState({
|
|
80
|
+
search: event.target.value
|
|
81
|
+
})
|
|
82
|
+
})), /*#__PURE__*/_react.default.createElement("div", null, tagOptions.length > 0 && /*#__PURE__*/_react.default.createElement(_List.default, {
|
|
83
|
+
style: {
|
|
84
|
+
padding: '2%',
|
|
85
|
+
overflow: 'auto',
|
|
86
|
+
height: '25vh'
|
|
87
|
+
}
|
|
88
|
+
}, tagOptions[tab].options.filter(tag => tag.tag.includes(search)).map((tag, index) => /*#__PURE__*/_react.default.createElement(_OldTagOption.default, {
|
|
89
|
+
tag: tag,
|
|
90
|
+
key: String(index),
|
|
91
|
+
filterArrayName: tagOptions[tab].filterArrayName,
|
|
92
|
+
activeTags: filter[tagOptions[tab].filterArrayName],
|
|
93
|
+
showCount: tagOptions[tab].optionName !== 'locationTags',
|
|
94
|
+
updateFilter: newFilterProperties => updateFilter(newFilterProperties)
|
|
95
|
+
}))))));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
166
98
|
OldTagFilterSelector.propTypes = {
|
|
167
99
|
title: _propTypes.default.string.isRequired,
|
|
168
100
|
intl: _propTypes.default.shape().isRequired,
|
|
@@ -171,7 +103,4 @@ OldTagFilterSelector.propTypes = {
|
|
|
171
103
|
updateFilter: _propTypes.default.func.isRequired,
|
|
172
104
|
tagOptions: _propTypes.default.arrayOf(_propTypes.default.shape()).isRequired
|
|
173
105
|
};
|
|
174
|
-
|
|
175
|
-
var _default = (0, _reactIntl.injectIntl)(OldTagFilterSelector);
|
|
176
|
-
|
|
177
|
-
exports.default = _default;
|
|
106
|
+
var _default = exports.default = (0, _reactIntl.injectIntl)(OldTagFilterSelector);
|
|
@@ -4,68 +4,45 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _ListItemText = _interopRequireDefault(require("@material-ui/core/ListItemText"));
|
|
11
|
-
|
|
12
9
|
var _ListItem = _interopRequireDefault(require("@material-ui/core/ListItem"));
|
|
13
|
-
|
|
14
10
|
var _reactIntl = require("react-intl");
|
|
15
|
-
|
|
16
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
17
|
-
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
21
|
-
|
|
22
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
23
|
-
|
|
24
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
25
|
-
|
|
26
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
27
|
-
|
|
28
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
29
|
-
|
|
30
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
31
|
-
|
|
32
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
33
|
-
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
34
13
|
function OldTagOption(props) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
14
|
+
const {
|
|
15
|
+
tag,
|
|
16
|
+
showCount,
|
|
17
|
+
activeTags,
|
|
18
|
+
updateFilter,
|
|
19
|
+
filterArrayName
|
|
20
|
+
} = props;
|
|
21
|
+
const listItemStyle = {
|
|
41
22
|
borderRadius: '8%',
|
|
42
23
|
border: '2px solid #005A96',
|
|
43
24
|
backgroundColor: activeTags.includes(tag.tag) ? 'rgba(0, 90, 150, 0.33)' : 'white'
|
|
44
25
|
};
|
|
45
|
-
|
|
46
|
-
var addTag = function addTag() {
|
|
26
|
+
const addTag = () => {
|
|
47
27
|
if (activeTags.includes(tag.tag)) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
newTags.splice(activeTags.findIndex(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
28
|
+
const newTags = activeTags;
|
|
29
|
+
// remove tag if it already exists in the array
|
|
30
|
+
newTags.splice(activeTags.findIndex(_tag => _tag === tag.tag), 1);
|
|
31
|
+
return updateFilter({
|
|
32
|
+
[filterArrayName]: newTags
|
|
33
|
+
});
|
|
54
34
|
}
|
|
55
|
-
|
|
56
|
-
|
|
35
|
+
return updateFilter({
|
|
36
|
+
[filterArrayName]: [...activeTags, tag.tag]
|
|
37
|
+
});
|
|
57
38
|
};
|
|
58
|
-
|
|
59
39
|
return /*#__PURE__*/_react.default.createElement(_ListItem.default, {
|
|
60
40
|
style: listItemStyle,
|
|
61
|
-
onClick:
|
|
62
|
-
return addTag();
|
|
63
|
-
}
|
|
41
|
+
onClick: () => addTag()
|
|
64
42
|
}, /*#__PURE__*/_react.default.createElement(_ListItemText.default, {
|
|
65
43
|
primary: showCount ? "".concat(tag.tag, " (").concat(tag.count, ")") : "".concat(tag.tag)
|
|
66
44
|
}));
|
|
67
45
|
}
|
|
68
|
-
|
|
69
46
|
OldTagOption.propTypes = {
|
|
70
47
|
tag: _propTypes.default.shape().isRequired,
|
|
71
48
|
showCount: _propTypes.default.bool.isRequired,
|
|
@@ -73,7 +50,4 @@ OldTagOption.propTypes = {
|
|
|
73
50
|
filterArrayName: _propTypes.default.string.isRequired,
|
|
74
51
|
activeTags: _propTypes.default.arrayOf(_propTypes.default.string).isRequired
|
|
75
52
|
};
|
|
76
|
-
|
|
77
|
-
var _default = (0, _reactIntl.injectIntl)(OldTagOption);
|
|
78
|
-
|
|
79
|
-
exports.default = _default;
|
|
53
|
+
var _default = exports.default = (0, _reactIntl.injectIntl)(OldTagOption);
|