@kineticdata/react 5.1.2 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/task/icons/drag-handle.svg +3 -0
- package/assets/task/icons/plus_small.svg +2 -4
- package/lib/apis/agent/adapters.js +16 -12
- package/lib/apis/agent/bridges.js +54 -41
- package/lib/apis/agent/handlers.js +51 -38
- package/lib/apis/core/activity.js +19 -11
- package/lib/apis/core/attributeDefinitions.js +54 -46
- package/lib/apis/core/attributeDefinitions.test.js +47 -55
- package/lib/apis/core/authentication.js +58 -63
- package/lib/apis/core/backgroundJobs.js +38 -30
- package/lib/apis/core/bridgeModelAttributeMappings.js +42 -34
- package/lib/apis/core/bridgeModelAttributes.js +47 -37
- package/lib/apis/core/bridgeModelMappings.js +42 -34
- package/lib/apis/core/bridgeModelQualificationMappings.js +42 -34
- package/lib/apis/core/bridgeModelQualifications.js +42 -34
- package/lib/apis/core/bridgeModels.js +56 -46
- package/lib/apis/core/bridgeModels.test.js +64 -80
- package/lib/apis/core/bridgedresources.js +64 -72
- package/lib/apis/core/bridgedresources.test.js +33 -30
- package/lib/apis/core/categories.js +59 -52
- package/lib/apis/core/categories.test.js +36 -33
- package/lib/apis/core/fileResources.js +41 -33
- package/lib/apis/core/filestores.js +42 -34
- package/lib/apis/core/formTypes.js +50 -44
- package/lib/apis/core/forms.js +53 -49
- package/lib/apis/core/forms.test.js +60 -74
- package/lib/apis/core/kapps.js +45 -39
- package/lib/apis/core/kapps.test.js +45 -52
- package/lib/apis/core/logs.js +20 -16
- package/lib/apis/core/memberships.js +23 -20
- package/lib/apis/core/meta.js +31 -19
- package/lib/apis/core/notices.js +17 -9
- package/lib/apis/core/oauthClients.js +49 -45
- package/lib/apis/core/platformComponents.js +73 -57
- package/lib/apis/core/platformItems.js +22 -13
- package/lib/apis/core/profile.js +28 -21
- package/lib/apis/core/profile.test.js +20 -17
- package/lib/apis/core/securityPolicyDefinitions.js +48 -41
- package/lib/apis/core/securityPolicyDefinitions.test.js +50 -60
- package/lib/apis/core/space.js +23 -16
- package/lib/apis/core/space.test.js +31 -38
- package/lib/apis/core/submissions.js +213 -186
- package/lib/apis/core/submissions.test.js +39 -36
- package/lib/apis/core/teams.js +51 -44
- package/lib/apis/core/teams.test.js +42 -39
- package/lib/apis/core/translations.js +123 -130
- package/lib/apis/core/translations.test.js +278 -368
- package/lib/apis/core/users.js +56 -49
- package/lib/apis/core/users.test.js +42 -39
- package/lib/apis/core/version.js +20 -11
- package/lib/apis/core/webApis.js +42 -34
- package/lib/apis/core/webhooks.js +48 -41
- package/lib/apis/core/webhooks.test.js +50 -60
- package/lib/apis/core/webhooksJobs.js +30 -26
- package/lib/apis/core/workflows.js +52 -44
- package/lib/apis/http.js +89 -80
- package/lib/apis/http.test.js +37 -38
- package/lib/apis/index.js +506 -50
- package/lib/apis/system/index.js +228 -211
- package/lib/apis/task/index.js +280 -227
- package/lib/components/agent/bridge/BridgeForm.js +50 -50
- package/lib/components/agent/bridge/BridgeTable.js +12 -8
- package/lib/components/agent/filestore/FilestoreForm.js +49 -48
- package/lib/components/agent/filestore/FilestoreTable.js +12 -8
- package/lib/components/agent/handler/AgentHandlerForm.js +24 -27
- package/lib/components/agent/handler/AgentHandlerTable.js +12 -8
- package/lib/components/common/AttributeSelect.js +15 -9
- package/lib/components/common/BridgeSelect.js +48 -43
- package/lib/components/common/ComponentConfigContext.js +9 -2
- package/lib/components/common/ContentEditable.js +36 -60
- package/lib/components/common/FormSelect.js +70 -58
- package/lib/components/common/NodeSelect.js +23 -19
- package/lib/components/common/Scroller.js +24 -23
- package/lib/components/common/StaticSelect.js +57 -50
- package/lib/components/common/TableInput.js +54 -57
- package/lib/components/common/TeamSelect.js +42 -39
- package/lib/components/common/Typeahead.js +121 -138
- package/lib/components/common/UserSelect.js +42 -41
- package/lib/components/common/authentication/AuthInterceptor.js +15 -19
- package/lib/components/common/authentication/AuthInterceptor.test.js +46 -64
- package/lib/components/common/authentication/AuthenticationContainer.js +350 -454
- package/lib/components/common/authentication/RequestInterceptor.js +16 -19
- package/lib/components/common/code_input/CodeInput.js +92 -122
- package/lib/components/common/code_input/draftHelpers.js +96 -90
- package/lib/components/common/code_input/languageHelpers.js +49 -47
- package/lib/components/common/code_input/languageHelpers.test.js +21 -16
- package/lib/components/core/CoreFormModal.js +26 -24
- package/lib/components/core/CoreModal.js +37 -31
- package/lib/components/core/attribute_definition/AttributeDefinitionForm.js +24 -23
- package/lib/components/core/attribute_definition/AttributeDefinitionTable.js +18 -15
- package/lib/components/core/bridge_model/BridgeModelForm.js +27 -37
- package/lib/components/core/bridge_model/BridgeModelTable.js +12 -8
- package/lib/components/core/bridge_model_attribute/BridgeModelAttributeForm.js +17 -16
- package/lib/components/core/bridge_model_attribute/BridgeModelAttributeTable.js +25 -21
- package/lib/components/core/bridge_model_qualification/BridgeModelQualificationForm.js +20 -20
- package/lib/components/core/bridge_model_qualification/BridgeModelQualificationTable.js +27 -22
- package/lib/components/core/category/CategoryForm.js +22 -22
- package/lib/components/core/category/CategoryTable.js +15 -10
- package/lib/components/core/core_form/CoreForm.js +209 -285
- package/lib/components/core/core_form/CoreForm.test.js +12 -10
- package/lib/components/core/core_form/defaults/index.js +52 -44
- package/lib/components/core/core_form/globals.js +14 -5
- package/lib/components/core/field_definition/FieldDefinitionForm.js +23 -21
- package/lib/components/core/field_definition/FieldDefinitionTable.js +15 -10
- package/lib/components/core/file_resource/FileResourceForm.js +38 -37
- package/lib/components/core/file_resource/FileResourceTable.js +16 -12
- package/lib/components/core/form/FormForm.js +56 -61
- package/lib/components/core/form/FormTable.js +25 -22
- package/lib/components/core/form_type/FormTypeForm.js +14 -13
- package/lib/components/core/form_type/FormTypeTable.js +12 -8
- package/lib/components/core/i18n/I18n.js +54 -61
- package/lib/components/core/i18n/I18nContext.js +9 -2
- package/lib/components/core/i18n/I18nProvider.js +40 -43
- package/lib/components/core/i18n/Moment.js +40 -50
- package/lib/components/core/index_definition/IndexDefinitionForm.js +23 -24
- package/lib/components/core/index_definition/IndexDefinitionTable.js +19 -11
- package/lib/components/core/index_job/IndexJobTable.js +20 -15
- package/lib/components/core/kapp/KappForm.js +57 -58
- package/lib/components/core/kapp/KappTable.js +17 -12
- package/lib/components/core/log/LogTable.js +35 -33
- package/lib/components/core/oauth_client/OAuthClientForm.js +17 -17
- package/lib/components/core/oauth_client/OAuthClientTable.js +12 -8
- package/lib/components/core/platform_component/AgentComponentForm.js +15 -15
- package/lib/components/core/platform_component/AgentComponentTable.js +10 -5
- package/lib/components/core/platform_component/TaskComponentForm.js +14 -14
- package/lib/components/core/profile/ProfileForm.js +40 -39
- package/lib/components/core/security_definition/SecurityDefinitionForm.js +28 -25
- package/lib/components/core/security_definition/SecurityDefinitionTable.js +18 -13
- package/lib/components/core/space/SpaceForm.js +79 -90
- package/lib/components/core/submission/DatastoreSubmissionFilters.js +39 -40
- package/lib/components/core/submission/DatastoreSubmissionTable.js +37 -34
- package/lib/components/core/submission/FormSubmissionFilters.js +79 -75
- package/lib/components/core/submission/FormSubmissionTable.js +27 -20
- package/lib/components/core/submission/KappSubmissionTable.js +30 -29
- package/lib/components/core/submission/SubmissionForm.js +126 -55
- package/lib/components/core/submission/SubmissionTable.js +24 -20
- package/lib/components/core/submission/helpers.js +37 -33
- package/lib/components/core/submission/helpers.test.js +69 -20
- package/lib/components/core/team/TeamForm.js +24 -21
- package/lib/components/core/team/TeamTable.js +16 -11
- package/lib/components/core/translation/ContextForm.js +13 -10
- package/lib/components/core/translation/ContextTable.js +13 -10
- package/lib/components/core/translation/EntryForm.js +27 -24
- package/lib/components/core/translation/EntryTable.js +19 -16
- package/lib/components/core/translation/LocaleForm.js +16 -13
- package/lib/components/core/translation/LocaleTable.js +12 -8
- package/lib/components/core/user/UserForm.js +38 -37
- package/lib/components/core/user/UserTable.js +19 -15
- package/lib/components/core/webapi/WebApiForm.js +49 -61
- package/lib/components/core/webapi/WebApiTable.js +14 -10
- package/lib/components/core/webhook/WebhookForm.js +33 -32
- package/lib/components/core/webhook/WebhookTable.js +22 -20
- package/lib/components/core/webhook_job/WebhookJobTable.js +19 -16
- package/lib/components/form/Form.helpers.js +102 -90
- package/lib/components/form/Form.js +467 -524
- package/lib/components/form/Form.models.js +38 -24
- package/lib/components/form/FormState.js +8 -5
- package/lib/components/form/KitchenSinkForm.js +135 -4
- package/lib/components/form/defaults/AttributesField.js +48 -59
- package/lib/components/form/defaults/CheckboxField.js +14 -6
- package/lib/components/form/defaults/CodeField.js +15 -7
- package/lib/components/form/defaults/FormButtons.js +12 -4
- package/lib/components/form/defaults/FormError.js +12 -4
- package/lib/components/form/defaults/FormField.js +15 -7
- package/lib/components/form/defaults/FormLayout.js +12 -4
- package/lib/components/form/defaults/FormMultiField.js +15 -7
- package/lib/components/form/defaults/PasswordField.js +14 -6
- package/lib/components/form/defaults/RadioField.js +15 -7
- package/lib/components/form/defaults/SampleTeamsRolesFIeld.js +17 -9
- package/lib/components/form/defaults/SelectField.js +16 -8
- package/lib/components/form/defaults/SelectMultiField.js +15 -7
- package/lib/components/form/defaults/TableField.js +14 -6
- package/lib/components/form/defaults/TeamField.js +15 -7
- package/lib/components/form/defaults/TeamMultiField.js +15 -7
- package/lib/components/form/defaults/TextField.js +14 -6
- package/lib/components/form/defaults/TextMultiField.js +26 -28
- package/lib/components/form/defaults/UserField.js +15 -7
- package/lib/components/form/defaults/UserMultiField.js +15 -7
- package/lib/components/form/defaults/index.js +48 -41
- package/lib/components/form/tests/Form.test.js +568 -864
- package/lib/components/form/tests/components.js +15 -25
- package/lib/components/form/tests/helpers.test.js +35 -33
- package/lib/components/index.js +981 -135
- package/lib/components/system/SystemBackgroundTasksTable.js +14 -10
- package/lib/components/system/SystemFilestoreForm.js +28 -25
- package/lib/components/system/SystemForm.js +19 -16
- package/lib/components/system/SystemIngressForm.js +10 -9
- package/lib/components/system/SystemSecurityForm.js +17 -14
- package/lib/components/system/SystemSmtpForm.js +13 -13
- package/lib/components/system/SystemTaskAdapterForm.js +21 -17
- package/lib/components/system/SystemUserForm.js +15 -14
- package/lib/components/system/helpers.js +62 -60
- package/lib/components/system/helpers.test.js +16 -12
- package/lib/components/system/spaces/SystemSpaceForm.js +25 -24
- package/lib/components/system/spaces/SystemTenantForm.js +43 -40
- package/lib/components/system/spaces/SystemTenantTable.js +12 -8
- package/lib/components/table/Table.js +211 -224
- package/lib/components/table/Table.redux.js +292 -329
- package/lib/components/table/Table.redux.test.js +49 -47
- package/lib/components/table/Table.test.js +107 -132
- package/lib/components/table/defaults/BodyCell.js +12 -6
- package/lib/components/table/defaults/BodyRow.js +10 -4
- package/lib/components/table/defaults/BooleanFilter.js +17 -11
- package/lib/components/table/defaults/EmptyBodyRow.js +12 -6
- package/lib/components/table/defaults/FilterLayout.js +17 -11
- package/lib/components/table/defaults/Footer.js +11 -5
- package/lib/components/table/defaults/FooterCell.js +10 -4
- package/lib/components/table/defaults/FooterRow.js +10 -4
- package/lib/components/table/defaults/Header.js +10 -4
- package/lib/components/table/defaults/HeaderCell.js +16 -10
- package/lib/components/table/defaults/HeaderRow.js +10 -4
- package/lib/components/table/defaults/PaginationControl.js +18 -9
- package/lib/components/table/defaults/TableBody.js +10 -4
- package/lib/components/table/defaults/TableLayout.js +12 -6
- package/lib/components/table/defaults/TextFilter.js +16 -10
- package/lib/components/table/defaults/index.js +41 -33
- package/lib/components/task/builder/Connector.js +100 -111
- package/lib/components/task/builder/ConnectorForm.js +17 -11
- package/lib/components/task/builder/Node.js +101 -83
- package/lib/components/task/builder/NodeForm.js +30 -27
- package/lib/components/task/builder/NodeParametersForm.js +27 -24
- package/lib/components/task/builder/SvgCanvas.js +67 -96
- package/lib/components/task/builder/SvgText.js +19 -134
- package/lib/components/task/builder/TaskDefinitionConfigForm.js +27 -22
- package/lib/components/task/builder/TreeBuilder.js +140 -115
- package/lib/components/task/builder/builder.redux.js +311 -326
- package/lib/components/task/builder/constants.js +94 -45
- package/lib/components/task/builder/helpers.js +184 -173
- package/lib/components/task/builder/helpers.test.js +20 -18
- package/lib/components/task/builder/models.js +121 -98
- package/lib/components/task/category/TaskCategoryForm.js +31 -29
- package/lib/components/task/category/TaskCategoryTable.js +12 -8
- package/lib/components/task/common/UsageTable.js +16 -12
- package/lib/components/task/engine/EngineSettingsForm.js +13 -11
- package/lib/components/task/errors/RunErrorTable.js +17 -13
- package/lib/components/task/errors/SystemErrorsTable.js +13 -9
- package/lib/components/task/handlers/HandlerForm.js +55 -55
- package/lib/components/task/handlers/HandlerTable.js +12 -8
- package/lib/components/task/handlers/MissingHandlerTable.js +12 -8
- package/lib/components/task/policy_rule/PolicyRuleForm.js +33 -32
- package/lib/components/task/policy_rule/PolicyRuleTable.js +12 -8
- package/lib/components/task/runs/CreateManualTriggerForm.js +17 -15
- package/lib/components/task/runs/RunTable.js +23 -20
- package/lib/components/task/runs/RunTaskTable.js +10 -6
- package/lib/components/task/sources/SourceForm.js +47 -47
- package/lib/components/task/sources/SourceTable.js +14 -11
- package/lib/components/task/triggers/TriggerTable.js +21 -18
- package/lib/components/task/workflows/LinkedWorkflowForm.js +48 -54
- package/lib/components/task/workflows/LinkedWorkflowTable.js +14 -10
- package/lib/components/task/workflows/MissingRoutineTable.js +12 -8
- package/lib/components/task/workflows/WorkflowForm.js +49 -44
- package/lib/components/task/workflows/WorkflowTable.js +17 -14
- package/lib/helpers/SearchBuilder.js +73 -127
- package/lib/helpers/SearchBuilder.test.js +184 -175
- package/lib/helpers/index.js +116 -74
- package/lib/index.js +86 -38
- package/lib/reducer.js +11 -3
- package/lib/saga.js +42 -38
- package/lib/store.js +59 -35
- package/package.json +3 -28
- package/proxyhelper.js +105 -46
- package/assets/discussions/images/avi_128.png +0 -0
- package/assets/discussions/images/excel_128.png +0 -0
- package/assets/discussions/images/html_128.png +0 -0
- package/assets/discussions/images/illustrator_128.png +0 -0
- package/assets/discussions/images/indesign_128.png +0 -0
- package/assets/discussions/images/movie_128.png +0 -0
- package/assets/discussions/images/mpeg_128.png +0 -0
- package/assets/discussions/images/pdf_128.png +0 -0
- package/assets/discussions/images/photoshop_128.png +0 -0
- package/assets/discussions/images/powerpoint_128.png +0 -0
- package/assets/discussions/images/txt_128.png +0 -0
- package/assets/discussions/images/unknown_128.png +0 -0
- package/assets/discussions/images/word_128.png +0 -0
- package/assets/discussions/styles/_discussion.scss +0 -506
- package/lib/apis/discussions/index.js +0 -395
- package/lib/apis/socket/index.js +0 -77
- package/lib/apis/socket/socket.js +0 -350
- package/lib/apis/socket/socket.test.js +0 -90
- package/lib/apis/socket/timer.js +0 -45
- package/lib/apis/socket/timer.test.js +0 -51
- package/lib/apis/socket/topic.js +0 -185
- package/lib/apis/topics/index.js +0 -19
- package/lib/components/discussions/ChatInputForm.js +0 -424
- package/lib/components/discussions/DateBanner.js +0 -10
- package/lib/components/discussions/Discussion.js +0 -202
- package/lib/components/discussions/DiscussionForm.js +0 -227
- package/lib/components/discussions/InvitationForm.js +0 -107
- package/lib/components/discussions/MessageHistory.js +0 -110
- package/lib/components/discussions/MessagesByDate.js +0 -40
- package/lib/components/discussions/MessagesList.js +0 -30
- package/lib/components/discussions/MoreMessagesBanner.js +0 -26
- package/lib/components/discussions/ScrollHelper.js +0 -84
- package/lib/components/discussions/SystemMessage.js +0 -88
- package/lib/components/discussions/SystemMessageGroup.js +0 -15
- package/lib/components/discussions/UserMessage.js +0 -163
- package/lib/components/discussions/UserMessageGroup.js +0 -34
- package/lib/components/discussions/redux.js +0 -178
- package/lib/components/discussions/sagas.js +0 -500
- package/lib/helpers/discussions/canManage.js +0 -30
- package/lib/helpers/discussions/canManage.test.js +0 -69
- package/lib/helpers/discussions/generateSystemMessageContent.js +0 -131
- package/lib/helpers/discussions/generateSystemMessageContent.test.js +0 -450
- package/lib/models/discussions.js +0 -76
- package/lib/models/index.js +0 -1
|
@@ -1,26 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
import { Component, createRef } from 'react';
|
|
6
|
-
export var Scroller = /*#__PURE__*/function (_Component) {
|
|
7
|
-
_inherits(Scroller, _Component);
|
|
8
|
-
|
|
9
|
-
var _super = _createSuper(Scroller);
|
|
1
|
+
"use strict";
|
|
10
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.Scroller = void 0;
|
|
8
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
|
|
9
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
|
|
10
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
|
|
11
|
+
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createSuper"));
|
|
12
|
+
var _react = require("react");
|
|
13
|
+
var Scroller = /*#__PURE__*/function (_Component) {
|
|
14
|
+
(0, _inherits2["default"])(Scroller, _Component);
|
|
15
|
+
var _super = (0, _createSuper2["default"])(Scroller);
|
|
11
16
|
function Scroller(props) {
|
|
12
17
|
var _this;
|
|
13
|
-
|
|
14
|
-
_classCallCheck(this, Scroller);
|
|
15
|
-
|
|
18
|
+
(0, _classCallCheck2["default"])(this, Scroller);
|
|
16
19
|
_this = _super.call(this, props);
|
|
17
|
-
_this.parent = createRef();
|
|
18
|
-
_this.child = createRef();
|
|
20
|
+
_this.parent = /*#__PURE__*/(0, _react.createRef)();
|
|
21
|
+
_this.child = /*#__PURE__*/(0, _react.createRef)();
|
|
19
22
|
_this.lastTop = 0;
|
|
20
23
|
return _this;
|
|
21
24
|
}
|
|
22
|
-
|
|
23
|
-
_createClass(Scroller, [{
|
|
25
|
+
(0, _createClass2["default"])(Scroller, [{
|
|
24
26
|
key: "componentDidMount",
|
|
25
27
|
value: function componentDidMount() {
|
|
26
28
|
this.scroll();
|
|
@@ -35,12 +37,11 @@ export var Scroller = /*#__PURE__*/function (_Component) {
|
|
|
35
37
|
value: function scroll() {
|
|
36
38
|
var parent = this.parent.current;
|
|
37
39
|
var child = this.child.current;
|
|
38
|
-
|
|
39
40
|
if (child) {
|
|
40
41
|
// in case the parent has an offsetTop we need to subtract that from the
|
|
41
42
|
// child's for the calculations below
|
|
42
|
-
var childTop = child.offsetTop - parent.offsetTop;
|
|
43
|
-
|
|
43
|
+
var childTop = child.offsetTop - parent.offsetTop;
|
|
44
|
+
// when scrolling down...
|
|
44
45
|
if (childTop > this.lastTop) {
|
|
45
46
|
// check to see if the bottom of the child element is below the bottom
|
|
46
47
|
// of the scrollable parent
|
|
@@ -48,7 +49,8 @@ export var Scroller = /*#__PURE__*/function (_Component) {
|
|
|
48
49
|
// scroll the child into view (passing false which aligns by bottom)
|
|
49
50
|
child.scrollIntoView(false);
|
|
50
51
|
}
|
|
51
|
-
}
|
|
52
|
+
}
|
|
53
|
+
// when scrolling up...
|
|
52
54
|
else if (childTop < this.lastTop) {
|
|
53
55
|
// check to see if the top of the child element is above the top of the
|
|
54
56
|
// scrollable parent
|
|
@@ -57,7 +59,6 @@ export var Scroller = /*#__PURE__*/function (_Component) {
|
|
|
57
59
|
child.scrollIntoView(true);
|
|
58
60
|
}
|
|
59
61
|
}
|
|
60
|
-
|
|
61
62
|
this.lastTop = child.offsetTop;
|
|
62
63
|
}
|
|
63
64
|
}
|
|
@@ -70,6 +71,6 @@ export var Scroller = /*#__PURE__*/function (_Component) {
|
|
|
70
71
|
});
|
|
71
72
|
}
|
|
72
73
|
}]);
|
|
73
|
-
|
|
74
74
|
return Scroller;
|
|
75
|
-
}(Component);
|
|
75
|
+
}(_react.Component);
|
|
76
|
+
exports.Scroller = Scroller;
|
|
@@ -1,54 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.StaticSelect = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/defineProperty"));
|
|
9
|
+
var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _Typeahead = require("./Typeahead");
|
|
12
|
+
var _immutable = require("immutable");
|
|
13
|
+
var _react2 = require("@kineticdata/react");
|
|
7
14
|
var fields = [{
|
|
8
15
|
name: 'label'
|
|
9
16
|
}, {
|
|
10
17
|
name: 'value'
|
|
11
18
|
}];
|
|
12
|
-
var OPERATORS = Map({
|
|
19
|
+
var OPERATORS = (0, _immutable.Map)({
|
|
13
20
|
equals: 'equals',
|
|
14
21
|
matches: 'matches',
|
|
15
22
|
startsWith: 'startsWith'
|
|
16
|
-
});
|
|
23
|
+
});
|
|
17
24
|
|
|
25
|
+
// Dynamically build filter function with correct operators
|
|
18
26
|
var buildFilter = function buildFilter(searchFields) {
|
|
19
27
|
var filter = searchFields.reduce(function (filter, _ref) {
|
|
20
28
|
var name = _ref.name,
|
|
21
|
-
|
|
29
|
+
operator = _ref.operator;
|
|
22
30
|
return filter[OPERATORS.get(operator, 'startsWith')](name, name);
|
|
23
|
-
}, defineFilter(true, 'or')).end();
|
|
24
|
-
|
|
31
|
+
}, (0, _react2.defineFilter)(true, 'or')).end();
|
|
32
|
+
// Build values object to pass into above filter option
|
|
25
33
|
return function (options, value) {
|
|
26
34
|
var values = searchFields.reduce(function (values, _ref2) {
|
|
27
35
|
var name = _ref2.name;
|
|
28
|
-
return
|
|
36
|
+
return (0, _objectSpread3["default"])((0, _objectSpread3["default"])({}, values), {}, (0, _defineProperty2["default"])({}, name, value));
|
|
29
37
|
}, {});
|
|
30
38
|
return options.filter(function (option) {
|
|
31
39
|
return filter(option, values);
|
|
32
40
|
});
|
|
33
41
|
};
|
|
34
42
|
};
|
|
35
|
-
|
|
36
43
|
var searchOptions = function searchOptions(_ref3) {
|
|
37
44
|
var allowNew = _ref3.allowNew,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
45
|
+
options = _ref3.options,
|
|
46
|
+
_ref3$search = _ref3.search,
|
|
47
|
+
search = _ref3$search === void 0 ? (0, _immutable.Map)() : _ref3$search;
|
|
41
48
|
return function (field, value, callback) {
|
|
42
49
|
// Determine the fields config
|
|
43
|
-
var searchFields = Map.isMap(search) && search.has('fields') && !search.get('fields').isEmpty() ? search.get('fields').toJS() : fields;
|
|
44
|
-
|
|
45
|
-
if (List.isList(options) && (allowNew || !options.isEmpty())) {
|
|
50
|
+
var searchFields = _immutable.Map.isMap(search) && search.has('fields') && !search.get('fields').isEmpty() ? search.get('fields').toJS() : fields;
|
|
51
|
+
if (_immutable.List.isList(options) && (allowNew || !options.isEmpty())) {
|
|
46
52
|
// Get or build the filter function
|
|
47
|
-
var filter = typeof search.get('fn') === 'function' ? search.get('fn') : buildFilter(searchFields);
|
|
53
|
+
var filter = typeof search.get('fn') === 'function' ? search.get('fn') : buildFilter(searchFields);
|
|
48
54
|
|
|
55
|
+
// Filter the options
|
|
49
56
|
var suggestions = filter(options.toJS(), value);
|
|
50
|
-
var limit = search.get('limit') || 25;
|
|
57
|
+
var limit = search.get('limit') || 25;
|
|
51
58
|
|
|
59
|
+
// Return the matching suggestions
|
|
52
60
|
return callback({
|
|
53
61
|
suggestions: suggestions.slice(0, limit),
|
|
54
62
|
nextPageToken: suggestions.length > limit
|
|
@@ -61,46 +69,43 @@ var searchOptions = function searchOptions(_ref3) {
|
|
|
61
69
|
});
|
|
62
70
|
}
|
|
63
71
|
};
|
|
64
|
-
};
|
|
65
|
-
// and filtering out already selected values for multi selects.
|
|
66
|
-
|
|
72
|
+
};
|
|
67
73
|
|
|
74
|
+
// Converts an option object to a single unique value. Used for comparing values
|
|
75
|
+
// and filtering out already selected values for multi selects.
|
|
68
76
|
var optionToValue = function optionToValue(_ref4) {
|
|
69
77
|
var _ref4$valueProp = _ref4.valueProp,
|
|
70
|
-
|
|
78
|
+
valueProp = _ref4$valueProp === void 0 ? 'value' : _ref4$valueProp;
|
|
71
79
|
return function (option) {
|
|
72
80
|
return option && option.get(valueProp) || '';
|
|
73
81
|
};
|
|
74
|
-
};
|
|
75
|
-
// when allowNew is true.
|
|
76
|
-
|
|
82
|
+
};
|
|
77
83
|
|
|
84
|
+
// Converts a typed in value to an option object. Used when adding custom values
|
|
85
|
+
// when allowNew is true.
|
|
78
86
|
var valueToCustomOption = function valueToCustomOption(_ref5) {
|
|
79
87
|
var _ref5$valueProp = _ref5.valueProp,
|
|
80
|
-
|
|
81
|
-
|
|
88
|
+
valueProp = _ref5$valueProp === void 0 ? 'value' : _ref5$valueProp,
|
|
89
|
+
allowNew = _ref5.allowNew;
|
|
82
90
|
return function (value) {
|
|
83
|
-
return value.length > 0 ? typeof allowNew !== 'function' || allowNew(value) ?
|
|
91
|
+
return value.length > 0 ? typeof allowNew !== 'function' || allowNew(value) ? (0, _defineProperty2["default"])({}, valueProp, value) : null : null;
|
|
84
92
|
};
|
|
85
93
|
};
|
|
86
|
-
|
|
87
94
|
var getStatusProps = function getStatusProps(_ref7) {
|
|
88
95
|
var _ref7$search = _ref7.search,
|
|
89
|
-
|
|
90
|
-
|
|
96
|
+
search = _ref7$search === void 0 ? (0, _immutable.Map)() : _ref7$search,
|
|
97
|
+
_ref7$messages = _ref7.messages;
|
|
91
98
|
_ref7$messages = _ref7$messages === void 0 ? {} : _ref7$messages;
|
|
92
|
-
|
|
93
99
|
var _ref7$messages$short = _ref7$messages["short"],
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
_short = _ref7$messages$short === void 0 ? 'Type to find an option.' : _ref7$messages$short,
|
|
101
|
+
_ref7$messages$empty = _ref7$messages.empty,
|
|
102
|
+
empty = _ref7$messages$empty === void 0 ? 'No matches found.' : _ref7$messages$empty,
|
|
103
|
+
_ref7$messages$custom = _ref7$messages.custom,
|
|
104
|
+
custom = _ref7$messages$custom === void 0 ? 'No matches found. Type to enter a custom option.' : _ref7$messages$custom,
|
|
105
|
+
_ref7$messages$pendin = _ref7$messages.pending,
|
|
106
|
+
pending = _ref7$messages$pendin === void 0 ? 'Searching...' : _ref7$messages$pendin,
|
|
107
|
+
_ref7$messages$more = _ref7$messages.more,
|
|
108
|
+
more = _ref7$messages$more === void 0 ? "Too many results, first ".concat(search.get('limit') || 25, " shown. Please refine your search.") : _ref7$messages$more;
|
|
104
109
|
return function (props) {
|
|
105
110
|
return {
|
|
106
111
|
info: props["short"] ? _short : props.pending ? pending : null,
|
|
@@ -108,9 +113,8 @@ var getStatusProps = function getStatusProps(_ref7) {
|
|
|
108
113
|
};
|
|
109
114
|
};
|
|
110
115
|
};
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
return /*#__PURE__*/React.createElement(Typeahead, {
|
|
116
|
+
var StaticSelect = function StaticSelect(props) {
|
|
117
|
+
return /*#__PURE__*/_react["default"].createElement(_Typeahead.Typeahead, {
|
|
114
118
|
components: props.components || {},
|
|
115
119
|
disabled: props.disabled,
|
|
116
120
|
multiple: props.multiple,
|
|
@@ -123,6 +127,9 @@ export var StaticSelect = function StaticSelect(props) {
|
|
|
123
127
|
onChange: props.onChange,
|
|
124
128
|
onFocus: props.onFocus,
|
|
125
129
|
onBlur: props.onBlur,
|
|
126
|
-
placeholder: props.placeholder
|
|
130
|
+
placeholder: props.placeholder,
|
|
131
|
+
id: props.id,
|
|
132
|
+
form: props.form
|
|
127
133
|
});
|
|
128
|
-
};
|
|
134
|
+
};
|
|
135
|
+
exports.StaticSelect = StaticSelect;
|
|
@@ -1,63 +1,68 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.TableLayout = exports.TableInput = void 0;
|
|
9
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _immutable = require("immutable");
|
|
12
|
+
var _reactBeautifulDnd = require("react-beautiful-dnd");
|
|
6
13
|
var TextInput = function TextInput(props) {
|
|
7
|
-
return /*#__PURE__*/
|
|
14
|
+
return /*#__PURE__*/_react["default"].createElement("input", {
|
|
8
15
|
type: "text",
|
|
9
16
|
id: props.id || props.name,
|
|
10
17
|
name: props.name,
|
|
11
18
|
value: props.value || '',
|
|
12
19
|
onBlur: props.onBlur,
|
|
13
20
|
onChange: props.onChange,
|
|
14
|
-
onFocus: props.onFocus
|
|
21
|
+
onFocus: props.onFocus,
|
|
22
|
+
form: props.form
|
|
15
23
|
});
|
|
16
24
|
};
|
|
17
|
-
|
|
18
25
|
var CheckboxInput = function CheckboxInput(props) {
|
|
19
|
-
return /*#__PURE__*/
|
|
26
|
+
return /*#__PURE__*/_react["default"].createElement("input", {
|
|
20
27
|
type: "checkbox",
|
|
21
28
|
id: props.id || props.name,
|
|
22
29
|
name: props.name,
|
|
23
30
|
checked: props.value || false,
|
|
24
31
|
onBlur: props.onBlur,
|
|
25
32
|
onChange: props.onChange,
|
|
26
|
-
onFocus: props.onFocus
|
|
33
|
+
onFocus: props.onFocus,
|
|
34
|
+
form: props.form
|
|
27
35
|
});
|
|
28
36
|
};
|
|
29
|
-
|
|
30
37
|
var DragHandle = function DragHandle(props) {
|
|
31
|
-
return /*#__PURE__*/
|
|
38
|
+
return /*#__PURE__*/_react["default"].createElement("span", props, "\u2195");
|
|
32
39
|
};
|
|
33
|
-
|
|
34
|
-
export var TableLayout = function TableLayout(_ref) {
|
|
40
|
+
var TableLayout = function TableLayout(_ref) {
|
|
35
41
|
var rows = _ref.rows,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return /*#__PURE__*/
|
|
39
|
-
return /*#__PURE__*/
|
|
42
|
+
onAdd = _ref.onAdd,
|
|
43
|
+
options = _ref.options;
|
|
44
|
+
return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement("table", null, /*#__PURE__*/_react["default"].createElement("thead", null, /*#__PURE__*/_react["default"].createElement("tr", null, options.toIndexedSeq().toList().map(function (config) {
|
|
45
|
+
return /*#__PURE__*/_react["default"].createElement("th", {
|
|
40
46
|
key: config.get('name')
|
|
41
47
|
}, config.get('label'));
|
|
42
|
-
}), /*#__PURE__*/
|
|
48
|
+
}), /*#__PURE__*/_react["default"].createElement("th", null, "\xA0"))), /*#__PURE__*/_react["default"].createElement("tbody", null, rows)), /*#__PURE__*/_react["default"].createElement("button", {
|
|
43
49
|
type: "button",
|
|
44
50
|
onClick: onAdd
|
|
45
51
|
}, "Add"));
|
|
46
52
|
};
|
|
47
|
-
|
|
53
|
+
exports.TableLayout = TableLayout;
|
|
48
54
|
var RowLayout = function RowLayout(_ref2) {
|
|
49
55
|
var fields = _ref2.fields,
|
|
50
|
-
|
|
51
|
-
return /*#__PURE__*/
|
|
52
|
-
return /*#__PURE__*/
|
|
56
|
+
onDelete = _ref2.onDelete;
|
|
57
|
+
return /*#__PURE__*/_react["default"].createElement("tr", null, fields.map(function (field, name) {
|
|
58
|
+
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
53
59
|
key: name
|
|
54
60
|
}, field);
|
|
55
|
-
}).toList(), /*#__PURE__*/
|
|
61
|
+
}).toList(), /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("button", {
|
|
56
62
|
type: "button",
|
|
57
63
|
onClick: onDelete
|
|
58
64
|
}, "Delete")));
|
|
59
65
|
};
|
|
60
|
-
|
|
61
66
|
var typeToComponent = {
|
|
62
67
|
drag: 'DragHandle',
|
|
63
68
|
text: 'TextInput',
|
|
@@ -70,42 +75,36 @@ var defaultComponents = {
|
|
|
70
75
|
CheckboxInput: CheckboxInput,
|
|
71
76
|
DragHandle: DragHandle
|
|
72
77
|
};
|
|
73
|
-
|
|
74
78
|
var fieldFromConfig = function fieldFromConfig(config) {
|
|
75
79
|
var components = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
76
80
|
return components[typeToComponent[config.get('type')]] || components['TextInput'];
|
|
77
81
|
};
|
|
78
|
-
|
|
79
|
-
export var TableInput = function TableInput(props) {
|
|
82
|
+
var TableInput = function TableInput(props) {
|
|
80
83
|
var _props$components = props.components,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
var appliedComponents =
|
|
89
|
-
|
|
84
|
+
components = _props$components === void 0 ? {} : _props$components,
|
|
85
|
+
options = props.options,
|
|
86
|
+
rows = props.rows,
|
|
87
|
+
onChange = props.onChange,
|
|
88
|
+
onBlur = props.onBlur,
|
|
89
|
+
onFocus = props.onFocus,
|
|
90
|
+
form = props.form;
|
|
91
|
+
var appliedComponents = (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, defaultComponents), components);
|
|
90
92
|
var RowLayout = appliedComponents.RowLayout,
|
|
91
|
-
|
|
92
|
-
|
|
93
|
+
TableLayout = appliedComponents.TableLayout;
|
|
93
94
|
var handleAddRow = function handleAddRow(e) {
|
|
94
95
|
e.preventDefault();
|
|
95
96
|
var newRow = options.filter(function (config) {
|
|
96
97
|
return config.get('type') !== 'drag';
|
|
97
98
|
}).reduce(function (row, config) {
|
|
98
99
|
return row.set(config.get('name'), config.get('type') === 'checkbox' ? false : '');
|
|
99
|
-
}, Map());
|
|
100
|
+
}, (0, _immutable.Map)());
|
|
100
101
|
onChange(rows.push(newRow));
|
|
101
102
|
};
|
|
102
|
-
|
|
103
103
|
var onDragEnd = function onDragEnd(e) {
|
|
104
104
|
if (e.source && e.destination) {
|
|
105
105
|
onChange(rows["delete"](e.source.index).insert(e.destination.index, rows.get(e.source.index)));
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
|
-
|
|
109
108
|
var isDragDisabled = !options.some(function (option) {
|
|
110
109
|
return option.get('type') === 'drag';
|
|
111
110
|
});
|
|
@@ -114,8 +113,7 @@ export var TableInput = function TableInput(props) {
|
|
|
114
113
|
e.preventDefault();
|
|
115
114
|
onChange(rows["delete"](index));
|
|
116
115
|
};
|
|
117
|
-
|
|
118
|
-
return /*#__PURE__*/React.createElement(Draggable, {
|
|
116
|
+
return /*#__PURE__*/_react["default"].createElement(_reactBeautifulDnd.Draggable, {
|
|
119
117
|
draggableId: "draggable".concat(index),
|
|
120
118
|
index: index,
|
|
121
119
|
key: index,
|
|
@@ -128,27 +126,25 @@ export var TableInput = function TableInput(props) {
|
|
|
128
126
|
return config.get('name');
|
|
129
127
|
}).map(function (config) {
|
|
130
128
|
var Field = fieldFromConfig(config, appliedComponents);
|
|
131
|
-
|
|
132
129
|
var _config$toObject = config.toObject(),
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
130
|
+
label = _config$toObject.label,
|
|
131
|
+
name = _config$toObject.name,
|
|
132
|
+
type = _config$toObject.type;
|
|
137
133
|
var fieldOnChange = function fieldOnChange(e) {
|
|
138
134
|
return onChange(rows.setIn([index, name], type === 'checkbox' ? e.target.checked : e.target.value));
|
|
139
135
|
};
|
|
140
|
-
|
|
141
136
|
var value = row.get(name);
|
|
142
137
|
var props = type === 'drag' ? provided.dragHandleProps : {
|
|
143
138
|
label: label,
|
|
144
139
|
onBlur: onBlur,
|
|
145
140
|
onChange: fieldOnChange,
|
|
146
141
|
onFocus: onFocus,
|
|
147
|
-
value: value
|
|
142
|
+
value: value,
|
|
143
|
+
form: form
|
|
148
144
|
};
|
|
149
|
-
return /*#__PURE__*/
|
|
145
|
+
return /*#__PURE__*/_react["default"].createElement(Field, props);
|
|
150
146
|
});
|
|
151
|
-
return /*#__PURE__*/
|
|
147
|
+
return /*#__PURE__*/_react["default"].createElement(RowLayout, {
|
|
152
148
|
draggableRef: provided.innerRef,
|
|
153
149
|
draggableProps: provided.draggableProps,
|
|
154
150
|
dragging: snapshot.isDragging,
|
|
@@ -158,12 +154,12 @@ export var TableInput = function TableInput(props) {
|
|
|
158
154
|
});
|
|
159
155
|
});
|
|
160
156
|
});
|
|
161
|
-
return /*#__PURE__*/
|
|
157
|
+
return /*#__PURE__*/_react["default"].createElement(_reactBeautifulDnd.DragDropContext, {
|
|
162
158
|
onDragEnd: onDragEnd
|
|
163
|
-
}, /*#__PURE__*/
|
|
159
|
+
}, /*#__PURE__*/_react["default"].createElement(_reactBeautifulDnd.Droppable, {
|
|
164
160
|
droppableId: "droppable"
|
|
165
161
|
}, function (provided) {
|
|
166
|
-
return /*#__PURE__*/
|
|
162
|
+
return /*#__PURE__*/_react["default"].createElement(TableLayout, {
|
|
167
163
|
droppableRef: provided.innerRef,
|
|
168
164
|
rows: fieldRows,
|
|
169
165
|
onAdd: handleAddRow,
|
|
@@ -171,4 +167,5 @@ export var TableInput = function TableInput(props) {
|
|
|
171
167
|
placeholder: provided.placeholder
|
|
172
168
|
});
|
|
173
169
|
}));
|
|
174
|
-
};
|
|
170
|
+
};
|
|
171
|
+
exports.TableInput = TableInput;
|
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.TeamSelect = void 0;
|
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _Typeahead = require("./Typeahead");
|
|
11
|
+
var _apis = require("../../apis");
|
|
12
|
+
var _immutable = require("immutable");
|
|
6
13
|
var fields = {
|
|
7
14
|
name: 'Full Name',
|
|
8
15
|
localName: 'Local Name'
|
|
9
16
|
};
|
|
10
|
-
|
|
11
17
|
var searchTeams = function searchTeams(_ref) {
|
|
12
18
|
var _ref$search = _ref.search,
|
|
13
|
-
|
|
19
|
+
search = _ref$search === void 0 ? (0, _immutable.Map)() : _ref$search;
|
|
14
20
|
return function (field, value, callback) {
|
|
15
|
-
return fetchTeams({
|
|
21
|
+
return (0, _apis.fetchTeams)({
|
|
16
22
|
q: Object.keys(fields).filter(function (searchField) {
|
|
17
23
|
return !field || searchField === field;
|
|
18
24
|
}).map(function (field) {
|
|
@@ -23,8 +29,8 @@ var searchTeams = function searchTeams(_ref) {
|
|
|
23
29
|
"public": !!search.get('public')
|
|
24
30
|
}).then(function (_ref2) {
|
|
25
31
|
var teams = _ref2.teams,
|
|
26
|
-
|
|
27
|
-
|
|
32
|
+
error = _ref2.error,
|
|
33
|
+
nextPageToken = _ref2.nextPageToken;
|
|
28
34
|
return {
|
|
29
35
|
suggestions: teams || [],
|
|
30
36
|
error: error,
|
|
@@ -33,13 +39,12 @@ var searchTeams = function searchTeams(_ref) {
|
|
|
33
39
|
}).then(callback);
|
|
34
40
|
};
|
|
35
41
|
};
|
|
36
|
-
|
|
37
42
|
var teamToValue = function teamToValue(team) {
|
|
38
43
|
return team && team.get('name') || '';
|
|
39
|
-
};
|
|
40
|
-
// when allowNew is true.
|
|
41
|
-
|
|
44
|
+
};
|
|
42
45
|
|
|
46
|
+
// Converts a typed in value to an option object. Used when adding custom values
|
|
47
|
+
// when allowNew is true.
|
|
43
48
|
var valueToCustomTeam = function valueToCustomTeam(_ref3) {
|
|
44
49
|
var allowNew = _ref3.allowNew;
|
|
45
50
|
return function (value) {
|
|
@@ -48,26 +53,23 @@ var valueToCustomTeam = function valueToCustomTeam(_ref3) {
|
|
|
48
53
|
} : null : null;
|
|
49
54
|
};
|
|
50
55
|
};
|
|
51
|
-
|
|
52
56
|
var getStatusProps = function getStatusProps(_ref4) {
|
|
53
57
|
var _ref4$search = _ref4.search,
|
|
54
|
-
|
|
55
|
-
|
|
58
|
+
search = _ref4$search === void 0 ? (0, _immutable.Map)() : _ref4$search,
|
|
59
|
+
_ref4$messages = _ref4.messages;
|
|
56
60
|
_ref4$messages = _ref4$messages === void 0 ? {} : _ref4$messages;
|
|
57
|
-
|
|
58
61
|
var _ref4$messages$short = _ref4$messages["short"],
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
62
|
+
_short = _ref4$messages$short === void 0 ? 'Type to find a team.' : _ref4$messages$short,
|
|
63
|
+
_ref4$messages$empty = _ref4$messages.empty,
|
|
64
|
+
empty = _ref4$messages$empty === void 0 ? 'No matching teams.' : _ref4$messages$empty,
|
|
65
|
+
_ref4$messages$custom = _ref4$messages.custom,
|
|
66
|
+
custom = _ref4$messages$custom === void 0 ? 'No matching teams. Type to enter a custom option.' : _ref4$messages$custom,
|
|
67
|
+
_ref4$messages$pendin = _ref4$messages.pending,
|
|
68
|
+
pending = _ref4$messages$pendin === void 0 ? 'Searching...' : _ref4$messages$pendin,
|
|
69
|
+
_ref4$messages$more = _ref4$messages.more,
|
|
70
|
+
more = _ref4$messages$more === void 0 ? "Too many teams, first ".concat(search.get('limit') || 25, " shown. Please refine your search.") : _ref4$messages$more,
|
|
71
|
+
_ref4$messages$error = _ref4$messages.error,
|
|
72
|
+
error = _ref4$messages$error === void 0 ? 'There was an error fetching teams.' : _ref4$messages$error;
|
|
71
73
|
return function (props) {
|
|
72
74
|
return {
|
|
73
75
|
meta: props.searchField ? "Find Teams by ".concat(fields[props.searchField]) : null,
|
|
@@ -75,10 +77,9 @@ var getStatusProps = function getStatusProps(_ref4) {
|
|
|
75
77
|
warning: props.error || props.more || props.empty ? props.error && props.error.key === 'too_many_matches' ? 'Too many teams to display. Please refine your search below.' : props.more ? more : props.empty && !props.custom ? empty : props.empty && props.custom ? custom : error : null,
|
|
76
78
|
clearFilterField: props.searchField ? props.setSearchField(null) : null,
|
|
77
79
|
filterFieldOptions: props.error && props.error.key === 'too_many_matches' ? Object.entries(props.error.errorData.matches).map(function (_ref5) {
|
|
78
|
-
var _ref6 =
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
var _ref6 = (0, _slicedToArray2["default"])(_ref5, 2),
|
|
81
|
+
field = _ref6[0],
|
|
82
|
+
count = _ref6[1];
|
|
82
83
|
return {
|
|
83
84
|
field: field,
|
|
84
85
|
count: count,
|
|
@@ -90,9 +91,8 @@ var getStatusProps = function getStatusProps(_ref4) {
|
|
|
90
91
|
};
|
|
91
92
|
};
|
|
92
93
|
};
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
return /*#__PURE__*/React.createElement(Typeahead, {
|
|
94
|
+
var TeamSelect = function TeamSelect(props) {
|
|
95
|
+
return /*#__PURE__*/_react["default"].createElement(_Typeahead.Typeahead, {
|
|
96
96
|
components: props.components || {},
|
|
97
97
|
disabled: props.disabled,
|
|
98
98
|
multiple: props.multiple,
|
|
@@ -105,6 +105,9 @@ export var TeamSelect = function TeamSelect(props) {
|
|
|
105
105
|
onChange: props.onChange,
|
|
106
106
|
onFocus: props.onFocus,
|
|
107
107
|
onBlur: props.onBlur,
|
|
108
|
-
placeholder: props.placeholder
|
|
108
|
+
placeholder: props.placeholder,
|
|
109
|
+
id: props.id,
|
|
110
|
+
form: props.form
|
|
109
111
|
});
|
|
110
|
-
};
|
|
112
|
+
};
|
|
113
|
+
exports.TeamSelect = TeamSelect;
|