@kineticdata/react 5.1.1 → 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 +61 -45
- package/lib/apis/core/bridgeModels.test.js +64 -80
- package/lib/apis/core/bridgedresources.js +64 -71
- package/lib/apis/core/bridgedresources.test.js +34 -31
- 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 -48
- 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 +30 -0
- 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 +220 -172
- package/lib/apis/core/submissions.test.js +81 -51
- 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 +64 -0
- package/lib/apis/http.js +89 -80
- package/lib/apis/http.test.js +37 -38
- package/lib/apis/index.js +506 -48
- package/lib/apis/system/index.js +228 -211
- package/lib/apis/task/index.js +283 -226
- 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 -133
- 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 +219 -225
- package/lib/components/table/Table.redux.js +298 -327
- 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 +28 -23
- package/lib/components/task/builder/TreeBuilder.js +140 -115
- package/lib/components/task/builder/builder.redux.js +322 -300
- 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 +133 -91
- 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 +249 -0
- package/lib/components/task/workflows/LinkedWorkflowTable.js +137 -0
- package/lib/components/task/workflows/MissingRoutineTable.js +12 -8
- package/lib/components/task/workflows/WorkflowForm.js +61 -46
- 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 +4 -29
- package/proxyhelper.js +105 -47
- 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,6 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
import { Typeahead } from './Typeahead';
|
|
1
|
+
"use strict";
|
|
3
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.AttributeSelect = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _Typeahead = require("./Typeahead");
|
|
4
10
|
var searchOptions = function searchOptions(_ref) {
|
|
5
11
|
var options = _ref.options;
|
|
6
12
|
return function (field, value, callback) {
|
|
@@ -11,20 +17,17 @@ var searchOptions = function searchOptions(_ref) {
|
|
|
11
17
|
});
|
|
12
18
|
};
|
|
13
19
|
};
|
|
14
|
-
|
|
15
20
|
var optionToValue = function optionToValue(option) {
|
|
16
21
|
return option && option.get('name') || '';
|
|
17
22
|
};
|
|
18
|
-
|
|
19
23
|
var getStatusProps = function getStatusProps(props) {
|
|
20
24
|
return {
|
|
21
25
|
info: props["short"] ? 'Type to find an attribute.' : props.pending ? 'Searching…' : null,
|
|
22
26
|
warning: props.error || props.empty || props.more ? props.error ? props.error : props.more ? 'Too many results, first 50 shown. Please refine your search.' : props.empty ? 'No matches found.' : null : null
|
|
23
27
|
};
|
|
24
28
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return /*#__PURE__*/React.createElement(Typeahead, {
|
|
29
|
+
var AttributeSelect = function AttributeSelect(props) {
|
|
30
|
+
return /*#__PURE__*/_react["default"].createElement(_Typeahead.Typeahead, {
|
|
28
31
|
components: props.components || {},
|
|
29
32
|
disabled: props.disabled,
|
|
30
33
|
search: searchOptions(props),
|
|
@@ -34,6 +37,9 @@ export var AttributeSelect = function AttributeSelect(props) {
|
|
|
34
37
|
onChange: props.onChange,
|
|
35
38
|
onFocus: props.onFocus,
|
|
36
39
|
onBlur: props.onBlur,
|
|
37
|
-
placeholder: props.placeholder
|
|
40
|
+
placeholder: props.placeholder,
|
|
41
|
+
id: props.id,
|
|
42
|
+
form: props.form
|
|
38
43
|
});
|
|
39
|
-
};
|
|
44
|
+
};
|
|
45
|
+
exports.AttributeSelect = AttributeSelect;
|
|
@@ -1,30 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { Typeahead } from './Typeahead';
|
|
5
|
-
import { fetchBridgedResource } from '../../apis';
|
|
6
|
-
import { Map } from 'immutable';
|
|
1
|
+
"use strict";
|
|
7
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.BridgeSelect = 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 _apis = require("../../apis");
|
|
13
|
+
var _immutable = require("immutable");
|
|
8
14
|
var searchOptions = function searchOptions(_ref) {
|
|
9
15
|
var _ref$search = _ref.search,
|
|
10
|
-
|
|
16
|
+
search = _ref$search === void 0 ? (0, _immutable.Map)() : _ref$search;
|
|
11
17
|
return function (field, value, callback) {
|
|
12
|
-
var searchFields = Map.isMap(search) && search.has('fields') && !search.get('fields').isEmpty() ? search.get('fields').toJS() : [];
|
|
18
|
+
var searchFields = _immutable.Map.isMap(search) && search.has('fields') && !search.get('fields').isEmpty() ? search.get('fields').toJS() : [];
|
|
13
19
|
var limit = search.get('limit') || 25;
|
|
14
|
-
return fetchBridgedResource({
|
|
20
|
+
return (0, _apis.fetchBridgedResource)({
|
|
15
21
|
datastore: search.get('datastore'),
|
|
16
22
|
kappSlug: search.get('kappSlug'),
|
|
17
23
|
formSlug: search.get('formSlug'),
|
|
18
24
|
bridgedResourceName: search.get('bridgedResourceName'),
|
|
19
25
|
values: searchFields.reduce(function (values, _ref2) {
|
|
20
26
|
var name = _ref2.name,
|
|
21
|
-
|
|
22
|
-
return
|
|
27
|
+
staticValue = _ref2.value;
|
|
28
|
+
return (0, _objectSpread3["default"])((0, _objectSpread3["default"])({}, values), {}, (0, _defineProperty2["default"])({}, name, staticValue || value));
|
|
23
29
|
}, {}),
|
|
24
30
|
"public": !!search.get('public')
|
|
25
31
|
}).then(function (_ref3) {
|
|
26
32
|
var records = _ref3.records,
|
|
27
|
-
|
|
33
|
+
error = _ref3.error;
|
|
28
34
|
return {
|
|
29
35
|
suggestions: records ? records.slice(0, limit) : [],
|
|
30
36
|
error: error,
|
|
@@ -32,48 +38,45 @@ var searchOptions = function searchOptions(_ref) {
|
|
|
32
38
|
};
|
|
33
39
|
}).then(callback);
|
|
34
40
|
};
|
|
35
|
-
};
|
|
36
|
-
// and filtering out already selected values for multi selects.
|
|
37
|
-
|
|
41
|
+
};
|
|
38
42
|
|
|
43
|
+
// Converts an option object to a single unique value. Used for comparing values
|
|
44
|
+
// and filtering out already selected values for multi selects.
|
|
39
45
|
var optionToValue = function optionToValue(_ref4) {
|
|
40
46
|
var _ref4$valueProp = _ref4.valueProp,
|
|
41
|
-
|
|
47
|
+
valueProp = _ref4$valueProp === void 0 ? 'value' : _ref4$valueProp;
|
|
42
48
|
return function (option) {
|
|
43
49
|
return option && option.get(valueProp) || '';
|
|
44
50
|
};
|
|
45
|
-
};
|
|
46
|
-
// when allowNew is true.
|
|
47
|
-
|
|
51
|
+
};
|
|
48
52
|
|
|
53
|
+
// Converts a typed in value to an option object. Used when adding custom values
|
|
54
|
+
// when allowNew is true.
|
|
49
55
|
var valueToCustomOption = function valueToCustomOption(_ref5) {
|
|
50
56
|
var _ref5$valueProp = _ref5.valueProp,
|
|
51
|
-
|
|
52
|
-
|
|
57
|
+
valueProp = _ref5$valueProp === void 0 ? 'value' : _ref5$valueProp,
|
|
58
|
+
allowNew = _ref5.allowNew;
|
|
53
59
|
return function (value) {
|
|
54
|
-
return value.length > 0 ? typeof allowNew !== 'function' || allowNew(value) ?
|
|
60
|
+
return value.length > 0 ? typeof allowNew !== 'function' || allowNew(value) ? (0, _defineProperty2["default"])({}, valueProp, value) : null : null;
|
|
55
61
|
};
|
|
56
62
|
};
|
|
57
|
-
|
|
58
63
|
var getStatusProps = function getStatusProps(_ref7) {
|
|
59
64
|
var _ref7$search = _ref7.search,
|
|
60
|
-
|
|
61
|
-
|
|
65
|
+
search = _ref7$search === void 0 ? (0, _immutable.Map)() : _ref7$search,
|
|
66
|
+
_ref7$messages = _ref7.messages;
|
|
62
67
|
_ref7$messages = _ref7$messages === void 0 ? {} : _ref7$messages;
|
|
63
|
-
|
|
64
68
|
var _ref7$messages$short = _ref7$messages["short"],
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
69
|
+
_short = _ref7$messages$short === void 0 ? 'Type to find an option.' : _ref7$messages$short,
|
|
70
|
+
_ref7$messages$empty = _ref7$messages.empty,
|
|
71
|
+
empty = _ref7$messages$empty === void 0 ? 'No matches found.' : _ref7$messages$empty,
|
|
72
|
+
_ref7$messages$custom = _ref7$messages.custom,
|
|
73
|
+
custom = _ref7$messages$custom === void 0 ? 'No matches found. Type to enter a custom option.' : _ref7$messages$custom,
|
|
74
|
+
_ref7$messages$pendin = _ref7$messages.pending,
|
|
75
|
+
pending = _ref7$messages$pendin === void 0 ? 'Searching...' : _ref7$messages$pendin,
|
|
76
|
+
_ref7$messages$more = _ref7$messages.more,
|
|
77
|
+
more = _ref7$messages$more === void 0 ? "Too many results, first ".concat(search.get('limit') || 25, " shown. Please refine your search.") : _ref7$messages$more,
|
|
78
|
+
_ref7$messages$error = _ref7$messages.error,
|
|
79
|
+
error = _ref7$messages$error === void 0 ? 'There was an error fetching data.' : _ref7$messages$error;
|
|
77
80
|
return function (props) {
|
|
78
81
|
return {
|
|
79
82
|
info: props["short"] ? _short : props.pending ? pending : null,
|
|
@@ -81,9 +84,8 @@ var getStatusProps = function getStatusProps(_ref7) {
|
|
|
81
84
|
};
|
|
82
85
|
};
|
|
83
86
|
};
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
return /*#__PURE__*/React.createElement(Typeahead, {
|
|
87
|
+
var BridgeSelect = function BridgeSelect(props) {
|
|
88
|
+
return /*#__PURE__*/_react["default"].createElement(_Typeahead.Typeahead, {
|
|
87
89
|
components: props.components || {},
|
|
88
90
|
disabled: props.disabled,
|
|
89
91
|
multiple: props.multiple,
|
|
@@ -96,6 +98,9 @@ export var BridgeSelect = function BridgeSelect(props) {
|
|
|
96
98
|
onChange: props.onChange,
|
|
97
99
|
onFocus: props.onFocus,
|
|
98
100
|
onBlur: props.onBlur,
|
|
99
|
-
placeholder: props.placeholder
|
|
101
|
+
placeholder: props.placeholder,
|
|
102
|
+
id: props.id,
|
|
103
|
+
form: props.form
|
|
100
104
|
});
|
|
101
|
-
};
|
|
105
|
+
};
|
|
106
|
+
exports.BridgeSelect = BridgeSelect;
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ComponentConfigContext = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var ComponentConfigContext = /*#__PURE__*/(0, _react.createContext)();
|
|
9
|
+
exports.ComponentConfigContext = ComponentConfigContext;
|
|
@@ -1,63 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
-
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
5
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
7
|
-
// https://github.com/raphasilvac/react-simple-contenteditable
|
|
8
|
-
// The MIT License (MIT)
|
|
9
|
-
//
|
|
10
|
-
// Copyright (c) 2018 Raphael Cavalcanti, contributors.
|
|
11
|
-
//
|
|
12
|
-
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
-
// of this software and associated documentation files (the "Software"), to deal
|
|
14
|
-
// in the Software without restriction, including without limitation the rights
|
|
15
|
-
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
-
// copies of the Software, and to permit persons to whom the Software is
|
|
17
|
-
// furnished to do so, subject to the following conditions:
|
|
18
|
-
//
|
|
19
|
-
// The above copyright notice and this permission notice shall be included in
|
|
20
|
-
// all copies or substantial portions of the Software.
|
|
21
|
-
//
|
|
22
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
-
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
-
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
-
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
-
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
-
// SOFTWARE.
|
|
29
|
-
import React, { Component } from 'react';
|
|
30
|
-
export var ContentEditable = /*#__PURE__*/function (_Component) {
|
|
31
|
-
_inherits(ContentEditable, _Component);
|
|
32
|
-
|
|
33
|
-
var _super = _createSuper(ContentEditable);
|
|
1
|
+
"use strict";
|
|
34
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.ContentEditable = void 0;
|
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
|
|
11
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
|
|
12
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/assertThisInitialized"));
|
|
13
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
|
|
14
|
+
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createSuper"));
|
|
15
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
16
|
+
var _excluded = ["tagName", "html", "contentEditable"];
|
|
17
|
+
var ContentEditable = /*#__PURE__*/function (_Component) {
|
|
18
|
+
(0, _inherits2["default"])(ContentEditable, _Component);
|
|
19
|
+
var _super = (0, _createSuper2["default"])(ContentEditable);
|
|
35
20
|
function ContentEditable(props) {
|
|
36
21
|
var _this;
|
|
37
|
-
|
|
38
|
-
_classCallCheck(this, ContentEditable);
|
|
39
|
-
|
|
22
|
+
(0, _classCallCheck2["default"])(this, ContentEditable);
|
|
40
23
|
_this = _super.call(this, props);
|
|
41
|
-
|
|
42
24
|
_this._onFocus = function (ev) {
|
|
43
25
|
if (typeof _this.props.onFocus === 'function') {
|
|
44
26
|
_this.props.onFocus(ev);
|
|
45
27
|
}
|
|
46
28
|
};
|
|
47
|
-
|
|
48
29
|
_this._onBlur = function (ev) {
|
|
49
30
|
if (typeof _this.props.onBlur === 'function') {
|
|
50
31
|
_this.props.onBlur(ev);
|
|
51
32
|
}
|
|
52
33
|
};
|
|
53
|
-
|
|
54
|
-
_this.
|
|
55
|
-
_this.
|
|
56
|
-
_this._onKeyPress = _this._onKeyPress.bind(_assertThisInitialized(_this));
|
|
34
|
+
_this._onChange = _this._onChange.bind((0, _assertThisInitialized2["default"])(_this));
|
|
35
|
+
_this._onPaste = _this._onPaste.bind((0, _assertThisInitialized2["default"])(_this));
|
|
36
|
+
_this._onKeyPress = _this._onKeyPress.bind((0, _assertThisInitialized2["default"])(_this));
|
|
57
37
|
return _this;
|
|
58
38
|
}
|
|
59
|
-
|
|
60
|
-
_createClass(ContentEditable, [{
|
|
39
|
+
(0, _createClass2["default"])(ContentEditable, [{
|
|
61
40
|
key: "_onChange",
|
|
62
41
|
value: function _onChange(ev) {
|
|
63
42
|
var method = this.getInnerMethod();
|
|
@@ -68,20 +47,18 @@ export var ContentEditable = /*#__PURE__*/function (_Component) {
|
|
|
68
47
|
key: "_onPaste",
|
|
69
48
|
value: function _onPaste(ev) {
|
|
70
49
|
var _this$props = this.props,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
50
|
+
onPaste = _this$props.onPaste,
|
|
51
|
+
contentEditable = _this$props.contentEditable;
|
|
74
52
|
if (contentEditable === 'plaintext-only') {
|
|
75
53
|
var text = ev.clipboardData.getData('text');
|
|
76
|
-
var commandExecuted = document.execCommand('insertText', false, text);
|
|
54
|
+
var commandExecuted = document.execCommand('insertText', false, text);
|
|
55
|
+
// The command above does not work in IE11 so in that case we do not want
|
|
77
56
|
// to prevent the default pasting, which fortunately seems to paste as
|
|
78
57
|
// plaintext only anyways.
|
|
79
|
-
|
|
80
58
|
if (commandExecuted) {
|
|
81
59
|
ev.preventDefault();
|
|
82
60
|
}
|
|
83
61
|
}
|
|
84
|
-
|
|
85
62
|
if (onPaste) {
|
|
86
63
|
onPaste(ev);
|
|
87
64
|
}
|
|
@@ -128,15 +105,13 @@ export var ContentEditable = /*#__PURE__*/function (_Component) {
|
|
|
128
105
|
key: "render",
|
|
129
106
|
value: function render() {
|
|
130
107
|
var _this2 = this;
|
|
131
|
-
|
|
132
108
|
var _this$props2 = this.props,
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
109
|
+
tagName = _this$props2.tagName,
|
|
110
|
+
html = _this$props2.html,
|
|
111
|
+
contentEditable = _this$props2.contentEditable,
|
|
112
|
+
props = (0, _objectWithoutProperties2["default"])(_this$props2, _excluded);
|
|
138
113
|
var Element = tagName || 'div';
|
|
139
|
-
return /*#__PURE__*/
|
|
114
|
+
return /*#__PURE__*/_react["default"].createElement(Element, Object.assign({}, props, {
|
|
140
115
|
ref: function ref(elem) {
|
|
141
116
|
_this2.elem = elem;
|
|
142
117
|
},
|
|
@@ -148,7 +123,8 @@ export var ContentEditable = /*#__PURE__*/function (_Component) {
|
|
|
148
123
|
onPaste: this._onPaste,
|
|
149
124
|
onKeyPress: this._onKeyPress,
|
|
150
125
|
onFocus: this._onFocus,
|
|
151
|
-
onBlur: this._onBlur
|
|
126
|
+
onBlur: this._onBlur
|
|
127
|
+
// New key each render forces react to re-create this element, see the
|
|
152
128
|
// stackoverflow issue for more details.
|
|
153
129
|
// https://stackoverflow.com/questions/30242530/dangerouslysetinnerhtml-doesnt-update-during-render
|
|
154
130
|
,
|
|
@@ -156,9 +132,9 @@ export var ContentEditable = /*#__PURE__*/function (_Component) {
|
|
|
156
132
|
}));
|
|
157
133
|
}
|
|
158
134
|
}]);
|
|
159
|
-
|
|
160
135
|
return ContentEditable;
|
|
161
|
-
}(Component);
|
|
136
|
+
}(_react.Component);
|
|
137
|
+
exports.ContentEditable = ContentEditable;
|
|
162
138
|
ContentEditable.defaultProps = {
|
|
163
139
|
tagName: 'div'
|
|
164
140
|
};
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.FormSelect = 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 _apis = require("../../apis");
|
|
13
|
+
var _immutable = require("immutable");
|
|
14
|
+
var _react2 = require("@kineticdata/react");
|
|
9
15
|
var fields = function fields(isDatastore) {
|
|
10
16
|
return isDatastore ? [{
|
|
11
17
|
name: 'name'
|
|
@@ -18,59 +24,67 @@ var fields = function fields(isDatastore) {
|
|
|
18
24
|
}, {
|
|
19
25
|
name: 'category'
|
|
20
26
|
}];
|
|
21
|
-
};
|
|
22
|
-
|
|
27
|
+
};
|
|
23
28
|
|
|
29
|
+
// If dynamic is true, only use operators that can support a single string value
|
|
24
30
|
var OPERATORS = function OPERATORS(dynamic) {
|
|
25
|
-
return Map(
|
|
31
|
+
return (0, _immutable.Map)((0, _objectSpread3["default"])({
|
|
26
32
|
equals: 'equals',
|
|
27
33
|
matches: 'matches',
|
|
28
34
|
startsWith: 'startsWith'
|
|
29
35
|
}, dynamic ? {} : {
|
|
30
36
|
"in": 'in'
|
|
31
37
|
}));
|
|
32
|
-
};
|
|
33
|
-
|
|
38
|
+
};
|
|
34
39
|
|
|
40
|
+
// Dynamically build query using correct operators
|
|
35
41
|
var buildQuery = function buildQuery(searchFields, value) {
|
|
36
42
|
// Start building a KQL query using any provided static values
|
|
37
|
-
var fixedQueryBuilder = searchFields
|
|
43
|
+
var fixedQueryBuilder = searchFields
|
|
44
|
+
// Filter to fields that provided a value
|
|
38
45
|
.filter(function (field) {
|
|
39
46
|
return field.name && field.value;
|
|
40
|
-
})
|
|
47
|
+
})
|
|
48
|
+
// For each field, apply the appropriate operator function
|
|
41
49
|
.reduce(function (filter, _ref) {
|
|
42
50
|
var name = _ref.name,
|
|
43
|
-
|
|
44
|
-
|
|
51
|
+
operator = _ref.operator,
|
|
52
|
+
strict = _ref.strict;
|
|
45
53
|
return filter[OPERATORS(false).get(operator, 'startsWith')](name, name, strict);
|
|
46
|
-
}, defineKqlQuery());
|
|
54
|
+
}, (0, _react2.defineKqlQuery)());
|
|
47
55
|
|
|
48
|
-
|
|
56
|
+
// Add any fields using the typed in dynamic value to the KQL query
|
|
57
|
+
var queryBuilder = searchFields
|
|
58
|
+
// Filter to fields that didn't provide a value
|
|
49
59
|
.filter(function (field) {
|
|
50
60
|
return field.name && !field.value;
|
|
51
|
-
})
|
|
61
|
+
})
|
|
62
|
+
// For each field, apply the appropriate operator function
|
|
52
63
|
.reduce(function (filter, _ref2) {
|
|
53
64
|
var name = _ref2.name,
|
|
54
|
-
|
|
55
|
-
|
|
65
|
+
operator = _ref2.operator,
|
|
66
|
+
strict = _ref2.strict;
|
|
56
67
|
return filter[OPERATORS(true).get(operator, 'startsWith')](name, name, strict);
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
.
|
|
68
|
+
},
|
|
69
|
+
// Start with the above KQL query and start an OR block
|
|
70
|
+
fixedQueryBuilder.or())
|
|
71
|
+
// End once for the OR block and once to build the query
|
|
72
|
+
.end().end();
|
|
60
73
|
|
|
74
|
+
// Build values object using by query builder
|
|
61
75
|
var values = searchFields.reduce(function (values, field) {
|
|
62
|
-
return
|
|
63
|
-
}, {});
|
|
76
|
+
return (0, _objectSpread3["default"])((0, _objectSpread3["default"])({}, values), {}, (0, _defineProperty2["default"])({}, field.name, field.value || value));
|
|
77
|
+
}, {});
|
|
64
78
|
|
|
79
|
+
// Build the query
|
|
65
80
|
return queryBuilder(values);
|
|
66
81
|
};
|
|
67
|
-
|
|
68
82
|
var searchForms = function searchForms(_ref3) {
|
|
69
83
|
var _ref3$search = _ref3.search,
|
|
70
|
-
|
|
84
|
+
search = _ref3$search === void 0 ? (0, _immutable.Map)() : _ref3$search;
|
|
71
85
|
return function (field, value, callback) {
|
|
72
|
-
var searchFields = Map.isMap(search) && search.has('fields') && !search.get('fields').isEmpty() ? search.get('fields').toJS() : fields(search.get('datastore'));
|
|
73
|
-
return fetchForms({
|
|
86
|
+
var searchFields = _immutable.Map.isMap(search) && search.has('fields') && !search.get('fields').isEmpty() ? search.get('fields').toJS() : fields(search.get('datastore'));
|
|
87
|
+
return (0, _apis.fetchForms)({
|
|
74
88
|
datastore: search.get('datastore'),
|
|
75
89
|
kappSlug: search.get('kappSlug'),
|
|
76
90
|
q: buildQuery(searchFields, value),
|
|
@@ -79,8 +93,8 @@ var searchForms = function searchForms(_ref3) {
|
|
|
79
93
|
"public": !!search.get('public')
|
|
80
94
|
}).then(function (_ref4) {
|
|
81
95
|
var forms = _ref4.forms,
|
|
82
|
-
|
|
83
|
-
|
|
96
|
+
error = _ref4.error,
|
|
97
|
+
nextPageToken = _ref4.nextPageToken;
|
|
84
98
|
return {
|
|
85
99
|
suggestions: forms || [],
|
|
86
100
|
error: error,
|
|
@@ -89,13 +103,12 @@ var searchForms = function searchForms(_ref3) {
|
|
|
89
103
|
}).then(callback);
|
|
90
104
|
};
|
|
91
105
|
};
|
|
92
|
-
|
|
93
106
|
var formToValue = function formToValue(form) {
|
|
94
107
|
return form && form.get('slug') || '';
|
|
95
|
-
};
|
|
96
|
-
// when allowNew is true.
|
|
97
|
-
|
|
108
|
+
};
|
|
98
109
|
|
|
110
|
+
// Converts a typed in value to an option object. Used when adding custom values
|
|
111
|
+
// when allowNew is true.
|
|
99
112
|
var valueToCustomForm = function valueToCustomForm(_ref5) {
|
|
100
113
|
var allowNew = _ref5.allowNew;
|
|
101
114
|
return function (value) {
|
|
@@ -104,26 +117,23 @@ var valueToCustomForm = function valueToCustomForm(_ref5) {
|
|
|
104
117
|
} : null : null;
|
|
105
118
|
};
|
|
106
119
|
};
|
|
107
|
-
|
|
108
120
|
var getStatusProps = function getStatusProps(_ref6) {
|
|
109
121
|
var _ref6$search = _ref6.search,
|
|
110
|
-
|
|
111
|
-
|
|
122
|
+
search = _ref6$search === void 0 ? (0, _immutable.Map)() : _ref6$search,
|
|
123
|
+
_ref6$messages = _ref6.messages;
|
|
112
124
|
_ref6$messages = _ref6$messages === void 0 ? {} : _ref6$messages;
|
|
113
|
-
|
|
114
125
|
var _ref6$messages$short = _ref6$messages["short"],
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
126
|
+
_short = _ref6$messages$short === void 0 ? 'Type to find a form.' : _ref6$messages$short,
|
|
127
|
+
_ref6$messages$empty = _ref6$messages.empty,
|
|
128
|
+
empty = _ref6$messages$empty === void 0 ? 'No matching forms.' : _ref6$messages$empty,
|
|
129
|
+
_ref6$messages$custom = _ref6$messages.custom,
|
|
130
|
+
custom = _ref6$messages$custom === void 0 ? 'No matching forms. Type to enter a custom option.' : _ref6$messages$custom,
|
|
131
|
+
_ref6$messages$pendin = _ref6$messages.pending,
|
|
132
|
+
pending = _ref6$messages$pendin === void 0 ? 'Searching...' : _ref6$messages$pendin,
|
|
133
|
+
_ref6$messages$more = _ref6$messages.more,
|
|
134
|
+
more = _ref6$messages$more === void 0 ? "Too many forms, first ".concat(search.get('limit') || 25, " shown. Please refine your search.") : _ref6$messages$more,
|
|
135
|
+
_ref6$messages$error = _ref6$messages.error,
|
|
136
|
+
error = _ref6$messages$error === void 0 ? 'There was an error fetching forms.' : _ref6$messages$error;
|
|
127
137
|
return function (props) {
|
|
128
138
|
return {
|
|
129
139
|
info: props["short"] ? _short : props.pending ? pending : null,
|
|
@@ -131,9 +141,8 @@ var getStatusProps = function getStatusProps(_ref6) {
|
|
|
131
141
|
};
|
|
132
142
|
};
|
|
133
143
|
};
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
return /*#__PURE__*/React.createElement(Typeahead, {
|
|
144
|
+
var FormSelect = function FormSelect(props) {
|
|
145
|
+
return /*#__PURE__*/_react["default"].createElement(_Typeahead.Typeahead, {
|
|
137
146
|
components: props.components || {},
|
|
138
147
|
disabled: props.disabled,
|
|
139
148
|
multiple: props.multiple,
|
|
@@ -146,6 +155,9 @@ export var FormSelect = function FormSelect(props) {
|
|
|
146
155
|
onChange: props.onChange,
|
|
147
156
|
onFocus: props.onFocus,
|
|
148
157
|
onBlur: props.onBlur,
|
|
149
|
-
placeholder: props.placeholder
|
|
158
|
+
placeholder: props.placeholder,
|
|
159
|
+
id: props.id,
|
|
160
|
+
form: props.form
|
|
150
161
|
});
|
|
151
|
-
};
|
|
162
|
+
};
|
|
163
|
+
exports.FormSelect = FormSelect;
|
|
@@ -1,43 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Typeahead } from './Typeahead';
|
|
1
|
+
"use strict";
|
|
4
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.NodeSelect = void 0;
|
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _Typeahead = require("./Typeahead");
|
|
5
11
|
var searchNodes = function searchNodes(_ref) {
|
|
6
12
|
var nodes = _ref.nodes,
|
|
7
|
-
|
|
13
|
+
tasks = _ref.tasks;
|
|
8
14
|
return function (field, value, callback) {
|
|
9
15
|
return callback({
|
|
10
16
|
suggestions: nodes.toList().map(function (node) {
|
|
11
17
|
return [node, tasks.get(node.definitionId)];
|
|
12
18
|
}).filter(function (_ref2) {
|
|
13
|
-
var _ref3 =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
var _ref3 = (0, _slicedToArray2["default"])(_ref2, 2),
|
|
20
|
+
node = _ref3[0],
|
|
21
|
+
task = _ref3[1];
|
|
17
22
|
return node.name.toLowerCase().includes(value.toLowerCase()) || task && task.name.toLowerCase().includes(value.toLowerCase());
|
|
18
23
|
}).toArray()
|
|
19
24
|
});
|
|
20
25
|
};
|
|
21
26
|
};
|
|
22
|
-
|
|
23
27
|
var pairToValue = function pairToValue() {
|
|
24
28
|
var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [],
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
_ref5 = (0, _slicedToArray2["default"])(_ref4, 2),
|
|
30
|
+
node = _ref5[0],
|
|
31
|
+
task = _ref5[1];
|
|
29
32
|
return node && node.name || '';
|
|
30
33
|
};
|
|
31
|
-
|
|
32
34
|
var getStatusProps = function getStatusProps(props) {
|
|
33
35
|
return {
|
|
34
36
|
info: props["short"] ? 'Type to find a node.' : props.pending ? 'Searching…' : null,
|
|
35
37
|
warning: props.error ? 'There was an error searching nodes.' : props.empty ? 'No matching nodes.' : null
|
|
36
38
|
};
|
|
37
39
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
return /*#__PURE__*/React.createElement(Typeahead, {
|
|
40
|
+
var NodeSelect = function NodeSelect(props) {
|
|
41
|
+
return /*#__PURE__*/_react["default"].createElement(_Typeahead.Typeahead, {
|
|
41
42
|
components: props.components || {},
|
|
42
43
|
disabled: props.disabled,
|
|
43
44
|
multiple: props.multiple,
|
|
@@ -55,6 +56,9 @@ export var NodeSelect = function NodeSelect(props) {
|
|
|
55
56
|
return props.onHighlight(pair && pair.first());
|
|
56
57
|
},
|
|
57
58
|
onBlur: props.onBlur,
|
|
58
|
-
placeholder: props.placeholder
|
|
59
|
+
placeholder: props.placeholder,
|
|
60
|
+
id: props.id,
|
|
61
|
+
form: props.form
|
|
59
62
|
});
|
|
60
|
-
};
|
|
63
|
+
};
|
|
64
|
+
exports.NodeSelect = NodeSelect;
|