@kineticdata/react 5.1.2 → 6.0.1
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 +121 -80
- package/lib/apis/http.test.js +137 -38
- package/lib/apis/index.js +506 -50
- package/lib/apis/system/index.js +363 -215
- package/lib/apis/task/index.js +294 -227
- package/lib/components/agent/bridge/BridgeForm.js +50 -50
- package/lib/components/agent/bridge/BridgeTable.js +16 -9
- package/lib/components/agent/filestore/FilestoreForm.js +49 -48
- package/lib/components/agent/filestore/FilestoreTable.js +16 -9
- package/lib/components/agent/handler/AgentHandlerForm.js +24 -27
- package/lib/components/agent/handler/AgentHandlerTable.js +17 -10
- 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/ToastContainer.js +170 -0
- 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/common/defaults/Toast.js +26 -0
- package/lib/components/common/defaults/index.js +13 -0
- 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 +25 -18
- package/lib/components/core/bridge_model/BridgeModelForm.js +27 -37
- package/lib/components/core/bridge_model/BridgeModelTable.js +17 -10
- 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 +28 -16
- 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 +26 -15
- 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 +47 -33
- package/lib/components/core/form_type/FormTypeForm.js +14 -13
- package/lib/components/core/form_type/FormTypeTable.js +15 -9
- 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 +31 -16
- 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 +34 -44
- package/lib/components/core/log/LogTable.js +42 -34
- 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 +27 -17
- 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 +64 -39
- package/lib/components/core/submission/KappSubmissionTable.js +67 -48
- 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 +27 -16
- 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 +42 -20
- package/lib/components/core/webapi/WebApiForm.js +87 -80
- package/lib/components/core/webapi/WebApiTable.js +28 -17
- package/lib/components/core/webhook/WebhookForm.js +33 -32
- package/lib/components/core/webhook/WebhookTable.js +41 -29
- package/lib/components/core/webhook_job/WebhookJobTable.js +58 -35
- package/lib/components/form/Form.helpers.js +182 -108
- package/lib/components/form/Form.js +467 -524
- package/lib/components/form/Form.models.js +39 -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 +1034 -135
- package/lib/components/system/SystemBackgroundTasksTable.js +14 -10
- package/lib/components/system/SystemCassandraForm.js +98 -0
- package/lib/components/system/SystemElasticSearchForm.js +98 -0
- package/lib/components/system/SystemFilestoreForm.js +36 -28
- package/lib/components/system/SystemForm.js +19 -16
- package/lib/components/system/SystemIngressForm.js +85 -36
- package/lib/components/system/SystemSecurityForm.js +17 -14
- package/lib/components/system/SystemSmtpForm.js +13 -13
- package/lib/components/system/SystemTaskAdapterForm.js +49 -21
- package/lib/components/system/SystemTrustedCertificateForm.js +40 -0
- package/lib/components/system/SystemTrustedCertificatesTable.js +74 -0
- package/lib/components/system/SystemUserForm.js +15 -14
- package/lib/components/system/helpers.js +281 -98
- 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 +112 -68
- package/lib/components/system/spaces/SystemTenantTable.js +12 -8
- package/lib/components/table/Table.js +295 -227
- package/lib/components/table/Table.redux.js +339 -355
- package/lib/components/table/Table.redux.test.js +49 -47
- package/lib/components/table/Table.test.js +146 -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/ColumnControl.js +26 -0
- 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 +43 -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 +50 -27
- 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 +35 -19
- 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 +45 -29
- 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 +29 -18
- package/lib/components/task/triggers/TriggerTable.js +71 -41
- package/lib/components/task/workflows/LinkedWorkflowForm.js +48 -54
- package/lib/components/task/workflows/LinkedWorkflowTable.js +46 -26
- 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 +47 -29
- 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 +87 -38
- package/lib/reducer.js +11 -3
- package/lib/saga.js +42 -38
- package/lib/store.js +59 -35
- package/package.json +17 -29
- package/proxyhelper.js +122 -57
- 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,19 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
"use strict";
|
|
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.sortColumns = exports.getToggleableColumns = exports.generateTable = exports.generateColumns = exports.extractColumnComponents = exports.buildTableHeaderRow = exports.buildTableHeaderCell = exports.buildTableHeader = exports.buildTableFooterRow = exports.buildTableFooterCells = exports.buildTableFooter = exports.buildTableBodyRows = exports.buildTableBodyCells = exports.buildTableBody = exports.buildTable = exports.Table = 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 _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
|
|
13
|
+
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createSuper"));
|
|
14
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
|
|
15
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
16
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
+
var _recompose = require("recompose");
|
|
18
|
+
var _immutable = require("immutable");
|
|
19
|
+
var _ComponentConfigContext = require("../common/ComponentConfigContext");
|
|
20
|
+
var _store = require("../../store");
|
|
21
|
+
var _Table = require("./Table.redux");
|
|
22
|
+
var _helpers = require("../../helpers");
|
|
23
|
+
var _Form = require("../form/Form");
|
|
24
|
+
var _excluded = ["components", "tableKey"];
|
|
17
25
|
var fromColumnSet = function fromColumnSet(columns, columnSet) {
|
|
18
26
|
return columnSet.map(function (cs) {
|
|
19
27
|
return columns.find(function (c) {
|
|
@@ -21,26 +29,27 @@ var fromColumnSet = function fromColumnSet(columns, columnSet) {
|
|
|
21
29
|
});
|
|
22
30
|
});
|
|
23
31
|
};
|
|
24
|
-
|
|
25
32
|
var KeyWrapper = function KeyWrapper(_ref) {
|
|
26
33
|
var children = _ref.children;
|
|
27
34
|
return children;
|
|
28
35
|
};
|
|
29
|
-
|
|
30
36
|
var TableComponent = function TableComponent(props) {
|
|
31
37
|
if (props.configured) {
|
|
32
38
|
var children = props.children,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
var
|
|
39
|
+
loading = props.loading,
|
|
40
|
+
initializing = props.initializing,
|
|
41
|
+
rows = props.rows,
|
|
42
|
+
error = props.error,
|
|
43
|
+
appliedFilters = props.appliedFilters,
|
|
44
|
+
components = props.components,
|
|
45
|
+
tableKey = props.tableKey,
|
|
46
|
+
_filterFormKey = props.filterFormKey,
|
|
47
|
+
count = props.count,
|
|
48
|
+
extraData = props.extraData;
|
|
49
|
+
var columnControl = buildColumnControl(props);
|
|
50
|
+
var table = buildTable((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props), {}, {
|
|
51
|
+
columnControl: columnControl
|
|
52
|
+
}));
|
|
44
53
|
var filter = components.FilterForm ? buildFilterForm(props) : buildFilterLayout(props);
|
|
45
54
|
var pagination = buildPaginationControl(props);
|
|
46
55
|
return children({
|
|
@@ -50,6 +59,7 @@ var TableComponent = function TableComponent(props) {
|
|
|
50
59
|
filter: filter,
|
|
51
60
|
appliedFilters: appliedFilters,
|
|
52
61
|
pagination: pagination,
|
|
62
|
+
columnControl: columnControl,
|
|
53
63
|
initializing: initializing,
|
|
54
64
|
loading: loading,
|
|
55
65
|
rows: rows,
|
|
@@ -58,41 +68,36 @@ var TableComponent = function TableComponent(props) {
|
|
|
58
68
|
extraData: extraData
|
|
59
69
|
});
|
|
60
70
|
}
|
|
61
|
-
|
|
62
71
|
return null;
|
|
63
72
|
};
|
|
64
|
-
|
|
65
73
|
var filterComponentByType = function filterComponentByType(components) {
|
|
66
74
|
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'text';
|
|
67
75
|
return type === 'boolean' ? components.BooleanFilter : components.TextFilter;
|
|
68
76
|
};
|
|
69
|
-
|
|
70
77
|
var buildField = function buildField(_ref2) {
|
|
71
78
|
var filter = _ref2.filter,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
filters = _ref2.filters,
|
|
80
|
+
components = _ref2.components,
|
|
81
|
+
columnComponents = _ref2.columnComponents,
|
|
82
|
+
tableKey = _ref2.tableKey,
|
|
83
|
+
tableOptions = _ref2.tableOptions,
|
|
84
|
+
renderOptions = _ref2.renderOptions;
|
|
78
85
|
var value = filter.get('value');
|
|
79
86
|
var name = filter.getIn(['column', 'value']);
|
|
80
87
|
var title = filter.getIn(['column', 'title']);
|
|
81
88
|
var options = filter.getIn(['column', 'options'], function () {
|
|
82
89
|
return [];
|
|
83
90
|
})(tableOptions, renderOptions);
|
|
84
|
-
|
|
85
91
|
var onChange = function onChange(value) {
|
|
86
92
|
var filterName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : name;
|
|
87
|
-
dispatch('SET_FILTER', {
|
|
93
|
+
(0, _store.dispatch)('SET_FILTER', {
|
|
88
94
|
tableKey: tableKey,
|
|
89
95
|
filter: filterName,
|
|
90
96
|
value: value
|
|
91
97
|
});
|
|
92
98
|
};
|
|
93
|
-
|
|
94
99
|
var Filter = columnComponents.getIn([name, 'Filter'], filterComponentByType(components, filter.getIn(['column', 'type'])));
|
|
95
|
-
return /*#__PURE__*/
|
|
100
|
+
return /*#__PURE__*/_react["default"].createElement(Filter, {
|
|
96
101
|
value: value,
|
|
97
102
|
name: name,
|
|
98
103
|
title: title,
|
|
@@ -103,15 +108,16 @@ var buildField = function buildField(_ref2) {
|
|
|
103
108
|
visible: true
|
|
104
109
|
});
|
|
105
110
|
};
|
|
106
|
-
|
|
107
111
|
var filtersToFields = function filtersToFields(components) {
|
|
108
|
-
return Map({
|
|
112
|
+
return (0, _immutable.Map)({
|
|
109
113
|
FormButtons: components.FilterFormButtons,
|
|
110
114
|
FormError: components.FilterFormError,
|
|
111
115
|
FormLayout: components.FilterFormLayout,
|
|
112
116
|
AttributesField: components.AttributesFilter,
|
|
113
117
|
CheckboxField: components.CheckboxFilter,
|
|
114
118
|
CodeField: components.CodeFilter,
|
|
119
|
+
DateField: components.DateFilter,
|
|
120
|
+
DatetimeField: components.DatetimeFilter,
|
|
115
121
|
FormField: components.FormFilter,
|
|
116
122
|
FormMultiField: components.FormMultiFilter,
|
|
117
123
|
PasswordField: components.PasswordFilter,
|
|
@@ -122,6 +128,7 @@ var filtersToFields = function filtersToFields(components) {
|
|
|
122
128
|
SelectMultiField: components.SelectMultiFilter,
|
|
123
129
|
TextField: components.TextFilter,
|
|
124
130
|
TextMultiField: components.TextMultiFilter,
|
|
131
|
+
TimeField: components.TimeFilter,
|
|
125
132
|
UserField: components.UserFilter,
|
|
126
133
|
UserMultiField: components.UserMultiFilter,
|
|
127
134
|
TableField: components.TableFilter
|
|
@@ -129,34 +136,33 @@ var filtersToFields = function filtersToFields(components) {
|
|
|
129
136
|
return !!c;
|
|
130
137
|
});
|
|
131
138
|
};
|
|
132
|
-
|
|
133
139
|
var buildFilterForm = function buildFilterForm(props) {
|
|
134
|
-
var FilterForm = props.components.FilterForm;
|
|
135
|
-
|
|
140
|
+
var FilterForm = props.components.FilterForm;
|
|
141
|
+
// Build the form filter components.
|
|
136
142
|
var components = filtersToFields(props.components);
|
|
137
|
-
return /*#__PURE__*/
|
|
143
|
+
return /*#__PURE__*/_react["default"].createElement(FilterForm, Object.assign({}, props.tableOptions, {
|
|
138
144
|
formKey: props.filterFormKey,
|
|
139
145
|
tableKey: props.tableKey,
|
|
140
146
|
components: components,
|
|
141
147
|
alterFields: props.alterFilters,
|
|
142
148
|
fieldSet: props.filterSet,
|
|
143
149
|
onSave: props.onSearch,
|
|
144
|
-
appliedFilters: props.appliedFilters
|
|
150
|
+
appliedFilters: props.appliedFilters,
|
|
151
|
+
autoFocus: props.filterAutoFocus
|
|
145
152
|
}));
|
|
146
153
|
};
|
|
147
|
-
|
|
148
154
|
var buildFilterLayout = function buildFilterLayout(_ref3) {
|
|
149
155
|
var components = _ref3.components,
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
156
|
+
columnComponents = _ref3.columnComponents,
|
|
157
|
+
filters = _ref3.filters,
|
|
158
|
+
appliedFilters = _ref3.appliedFilters,
|
|
159
|
+
validFilters = _ref3.validFilters,
|
|
160
|
+
tableKey = _ref3.tableKey,
|
|
161
|
+
columnSet = _ref3.columnSet,
|
|
162
|
+
loading = _ref3.loading,
|
|
163
|
+
initializing = _ref3.initializing,
|
|
164
|
+
tableOptions = _ref3.tableOptions,
|
|
165
|
+
renderOptions = _ref3.renderOptions;
|
|
160
166
|
// Add an onChange to each filter and convert it to a list for looping.
|
|
161
167
|
var f = filters.map(function (filter) {
|
|
162
168
|
return buildField({
|
|
@@ -170,44 +176,38 @@ var buildFilterLayout = function buildFilterLayout(_ref3) {
|
|
|
170
176
|
renderOptions: renderOptions
|
|
171
177
|
});
|
|
172
178
|
});
|
|
173
|
-
|
|
174
179
|
var onSearch = function onSearch(e) {
|
|
175
180
|
if (e) {
|
|
176
181
|
e.preventDefault();
|
|
177
182
|
}
|
|
178
|
-
|
|
179
|
-
dispatch('APPLY_FILTERS', {
|
|
183
|
+
(0, _store.dispatch)('APPLY_FILTERS', {
|
|
180
184
|
tableKey: tableKey
|
|
181
185
|
});
|
|
182
186
|
};
|
|
183
|
-
|
|
184
187
|
var onReset = function onReset(e) {
|
|
185
188
|
e.preventDefault();
|
|
186
|
-
dispatch('CLEAR_TABLE_FILTERS', {
|
|
189
|
+
(0, _store.dispatch)('CLEAR_TABLE_FILTERS', {
|
|
187
190
|
tableKey: tableKey
|
|
188
191
|
});
|
|
189
|
-
dispatch('APPLY_FILTERS', {
|
|
192
|
+
(0, _store.dispatch)('APPLY_FILTERS', {
|
|
190
193
|
tableKey: tableKey
|
|
191
194
|
});
|
|
192
195
|
};
|
|
193
|
-
|
|
194
196
|
var onClear = function onClear(e) {
|
|
195
197
|
e.preventDefault();
|
|
196
|
-
dispatch('CLEAR_SELECTED_FILTERS', {
|
|
198
|
+
(0, _store.dispatch)('CLEAR_SELECTED_FILTERS', {
|
|
197
199
|
tableKey: tableKey
|
|
198
200
|
});
|
|
199
201
|
};
|
|
200
|
-
|
|
201
202
|
var onChangeFilter = function onChangeFilter(value, filterName) {
|
|
202
|
-
dispatch('SET_FILTER', {
|
|
203
|
+
(0, _store.dispatch)('SET_FILTER', {
|
|
203
204
|
tableKey: tableKey,
|
|
204
205
|
filter: filterName,
|
|
205
206
|
value: value
|
|
206
207
|
});
|
|
207
208
|
};
|
|
208
|
-
|
|
209
209
|
var FilterLayout = components.FilterLayout;
|
|
210
|
-
return /*#__PURE__*/
|
|
210
|
+
return /*#__PURE__*/_react["default"].createElement(FilterLayout, {
|
|
211
211
|
filters: f,
|
|
212
212
|
appliedFilters: appliedFilters,
|
|
213
213
|
validFilters: validFilters,
|
|
@@ -223,25 +223,22 @@ var buildFilterLayout = function buildFilterLayout(_ref3) {
|
|
|
223
223
|
tableKey: tableKey
|
|
224
224
|
});
|
|
225
225
|
};
|
|
226
|
-
|
|
227
226
|
var hasPrevPage = function hasPrevPage(data, dataSource, tableOptions, pageTokens, pageOffset) {
|
|
228
|
-
return isClientSide(Map({
|
|
227
|
+
return (0, _Table.isClientSide)((0, _immutable.Map)({
|
|
229
228
|
data: data,
|
|
230
229
|
dataSource: dataSource,
|
|
231
230
|
tableOptions: tableOptions
|
|
232
231
|
})) ? pageOffset > 0 : pageTokens.size !== 0;
|
|
233
232
|
};
|
|
234
|
-
|
|
235
233
|
var hasNextPage = function hasNextPage(data, dataSource, tableOptions, pageOffset, pageSize, currentPageToken, rows) {
|
|
236
|
-
return isClientSide(Map({
|
|
234
|
+
return (0, _Table.isClientSide)((0, _immutable.Map)({
|
|
237
235
|
data: data,
|
|
238
236
|
dataSource: dataSource,
|
|
239
237
|
tableOptions: tableOptions
|
|
240
238
|
})) ? rows.size === pageSize ? data ? pageOffset + pageSize < data.size : false : !!currentPageToken : !!currentPageToken;
|
|
241
239
|
};
|
|
242
|
-
|
|
243
240
|
var getIndexes = function getIndexes(data, rows, dataSource, tableOptions, pageOffset, pageSize, pageTokens) {
|
|
244
|
-
return isClientSide(Map({
|
|
241
|
+
return (0, _Table.isClientSide)((0, _immutable.Map)({
|
|
245
242
|
data: data,
|
|
246
243
|
dataSource: dataSource,
|
|
247
244
|
tableOptions: tableOptions
|
|
@@ -253,32 +250,29 @@ var getIndexes = function getIndexes(data, rows, dataSource, tableOptions, pageO
|
|
|
253
250
|
endIndex: pageTokens.size * pageSize + rows.size
|
|
254
251
|
};
|
|
255
252
|
};
|
|
256
|
-
|
|
257
253
|
var buildPaginationControl = function buildPaginationControl(props) {
|
|
258
254
|
var tableKey = props.tableKey,
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
255
|
+
filterFormKey = props.filterFormKey,
|
|
256
|
+
data = props.data,
|
|
257
|
+
rows = props.rows,
|
|
258
|
+
dataSource = props.dataSource,
|
|
259
|
+
tableOptions = props.tableOptions,
|
|
260
|
+
pageTokens = props.pageTokens,
|
|
261
|
+
pageSize = props.pageSize,
|
|
262
|
+
pageOffset = props.pageOffset,
|
|
263
|
+
currentPageToken = props.currentPageToken,
|
|
264
|
+
count = props.count,
|
|
265
|
+
components = props.components,
|
|
266
|
+
loading = props.loading,
|
|
267
|
+
renderOptions = props.renderOptions,
|
|
268
|
+
extraData = props.extraData;
|
|
273
269
|
var PaginationControl = components.PaginationControl;
|
|
274
270
|
var prevPage = hasPrevPage(data, dataSource, tableOptions, pageTokens, pageOffset) ? onPrevPage(tableKey) : null;
|
|
275
271
|
var nextPage = hasNextPage(data, dataSource, tableOptions, pageOffset, pageSize, currentPageToken, rows) ? onNextPage(tableKey) : null;
|
|
276
|
-
|
|
277
272
|
var _getIndexes = getIndexes(data, rows, dataSource, tableOptions, pageOffset, pageSize, pageTokens),
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
return /*#__PURE__*/React.createElement(PaginationControl, {
|
|
273
|
+
startIndex = _getIndexes.startIndex,
|
|
274
|
+
endIndex = _getIndexes.endIndex;
|
|
275
|
+
return /*#__PURE__*/_react["default"].createElement(PaginationControl, {
|
|
282
276
|
tableKey: tableKey,
|
|
283
277
|
filterFormKey: filterFormKey,
|
|
284
278
|
prevPage: prevPage,
|
|
@@ -293,13 +287,50 @@ var buildPaginationControl = function buildPaginationControl(props) {
|
|
|
293
287
|
extraData: extraData
|
|
294
288
|
});
|
|
295
289
|
};
|
|
296
|
-
|
|
297
|
-
|
|
290
|
+
var getToggleableColumns = function getToggleableColumns(columns, columnSet, tableKey) {
|
|
291
|
+
return columns.reduce(function (list, column) {
|
|
292
|
+
var label = column.get('columnLabel') && column.get('columnLabel').trim() || column.get('title') && column.get('title').trim();
|
|
293
|
+
// Include all columns that have a columnLabel or title, and are toggleable
|
|
294
|
+
// or are in the initial columnSet
|
|
295
|
+
if (label && (column.get('toggleable') || columnSet.includes(column.get('value')))) {
|
|
296
|
+
return list.push((0, _immutable.Map)({
|
|
297
|
+
value: column.get('value'),
|
|
298
|
+
label: label,
|
|
299
|
+
checked: columnSet.includes(column.get('value')),
|
|
300
|
+
// Only enable the column toggle if it's toggleable, so that any
|
|
301
|
+
// non-toggleable columns that are in the initial column set will be
|
|
302
|
+
// shown but disabled in the control
|
|
303
|
+
enabled: !!column.get('toggleable'),
|
|
304
|
+
toggle: !!column.get('toggleable') ? onToggleColumn(tableKey, column.get('value')) : undefined
|
|
305
|
+
}));
|
|
306
|
+
}
|
|
307
|
+
return list;
|
|
308
|
+
}, (0, _immutable.List)());
|
|
309
|
+
};
|
|
310
|
+
exports.getToggleableColumns = getToggleableColumns;
|
|
311
|
+
var buildColumnControl = function buildColumnControl(props) {
|
|
312
|
+
var tableKey = props.tableKey,
|
|
313
|
+
columns = props.columns,
|
|
314
|
+
columnSet = props.columnSet,
|
|
315
|
+
components = props.components,
|
|
316
|
+
renderOptions = props.renderOptions,
|
|
317
|
+
tableOptions = props.tableOptions,
|
|
318
|
+
extraData = props.extraData;
|
|
319
|
+
var ColumnControl = components.ColumnControl;
|
|
320
|
+
return /*#__PURE__*/_react["default"].createElement(ColumnControl, {
|
|
321
|
+
tableKey: tableKey,
|
|
322
|
+
columns: getToggleableColumns(columns, columnSet, tableKey),
|
|
323
|
+
renderOptions: renderOptions,
|
|
324
|
+
tableOptions: tableOptions,
|
|
325
|
+
extraData: extraData
|
|
326
|
+
});
|
|
327
|
+
};
|
|
328
|
+
var buildTable = function buildTable(props) {
|
|
298
329
|
var TableLayout = props.components.TableLayout;
|
|
299
330
|
var header = buildTableHeader(props);
|
|
300
331
|
var body = buildTableBody(props);
|
|
301
332
|
var footer = buildTableFooter(props);
|
|
302
|
-
return /*#__PURE__*/
|
|
333
|
+
return /*#__PURE__*/_react["default"].createElement(TableLayout, {
|
|
303
334
|
tableKey: props.tableKey,
|
|
304
335
|
filterFormKey: props.filterFormKey,
|
|
305
336
|
header: header,
|
|
@@ -314,10 +345,11 @@ export var buildTable = function buildTable(props) {
|
|
|
314
345
|
extraData: props.extraData
|
|
315
346
|
});
|
|
316
347
|
};
|
|
317
|
-
|
|
348
|
+
exports.buildTable = buildTable;
|
|
349
|
+
var buildTableHeader = function buildTableHeader(props) {
|
|
318
350
|
var Header = props.components.Header;
|
|
319
351
|
var headerRow = buildTableHeaderRow(props);
|
|
320
|
-
return props.omitHeader ? null : /*#__PURE__*/
|
|
352
|
+
return props.omitHeader ? null : /*#__PURE__*/_react["default"].createElement(Header, {
|
|
321
353
|
sortable: props.sortable,
|
|
322
354
|
headerRow: headerRow,
|
|
323
355
|
renderOptions: props.renderOptions,
|
|
@@ -325,34 +357,38 @@ export var buildTableHeader = function buildTableHeader(props) {
|
|
|
325
357
|
tableOptions: props.tableOptions
|
|
326
358
|
});
|
|
327
359
|
};
|
|
328
|
-
|
|
360
|
+
exports.buildTableHeader = buildTableHeader;
|
|
361
|
+
var buildTableHeaderRow = function buildTableHeaderRow(props) {
|
|
329
362
|
var components = props.components,
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
363
|
+
rows = props.rows,
|
|
364
|
+
columns = props.columns,
|
|
365
|
+
columnSet = props.columnSet;
|
|
333
366
|
var HeaderRow = components.HeaderRow;
|
|
334
367
|
var columnHeaders = fromColumnSet(columns, columnSet).map(buildTableHeaderCell(props));
|
|
335
|
-
return /*#__PURE__*/
|
|
368
|
+
return /*#__PURE__*/_react["default"].createElement(HeaderRow, {
|
|
336
369
|
columnHeaders: columnHeaders,
|
|
337
370
|
renderOptions: props.renderOptions,
|
|
338
371
|
rows: rows,
|
|
339
372
|
tableOptions: props.tableOptions
|
|
340
373
|
});
|
|
341
374
|
};
|
|
342
|
-
|
|
375
|
+
exports.buildTableHeaderRow = buildTableHeaderRow;
|
|
376
|
+
var buildTableHeaderCell = function buildTableHeaderCell(props) {
|
|
343
377
|
return function (column, index) {
|
|
344
378
|
var tableKey = props.tableKey,
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
379
|
+
components = props.components,
|
|
380
|
+
columnComponents = props.columnComponents,
|
|
381
|
+
renderOptions = props.renderOptions,
|
|
382
|
+
tableOptions = props.tableOptions,
|
|
383
|
+
appliedFilters = props.appliedFilters,
|
|
384
|
+
columnControl = props.columnControl;
|
|
350
385
|
var HeaderCell = columnComponents.getIn([column.get('value'), 'HeaderCell'], components.HeaderCell);
|
|
351
386
|
var sorting = column === props.sortColumn && props.sortDirection;
|
|
352
387
|
var sortable = props.sortable && column.get('sortable');
|
|
353
|
-
return /*#__PURE__*/
|
|
388
|
+
return /*#__PURE__*/_react["default"].createElement(KeyWrapper, {
|
|
354
389
|
key: "column-".concat(index)
|
|
355
|
-
}, /*#__PURE__*/
|
|
390
|
+
}, /*#__PURE__*/_react["default"].createElement(HeaderCell, {
|
|
391
|
+
columnControl: columnControl,
|
|
356
392
|
onSortColumn: onSortColumn(tableKey, column),
|
|
357
393
|
title: column.get('title'),
|
|
358
394
|
renderOptions: renderOptions,
|
|
@@ -363,10 +399,11 @@ export var buildTableHeaderCell = function buildTableHeaderCell(props) {
|
|
|
363
399
|
}));
|
|
364
400
|
};
|
|
365
401
|
};
|
|
366
|
-
|
|
402
|
+
exports.buildTableHeaderCell = buildTableHeaderCell;
|
|
403
|
+
var buildTableBody = function buildTableBody(props) {
|
|
367
404
|
var Body = props.components.Body;
|
|
368
405
|
var tableRows = buildTableBodyRows(props);
|
|
369
|
-
return /*#__PURE__*/
|
|
406
|
+
return /*#__PURE__*/_react["default"].createElement(Body, {
|
|
370
407
|
loading: props.loading,
|
|
371
408
|
initializing: props.initializing,
|
|
372
409
|
renderOptions: props.renderOptions,
|
|
@@ -376,21 +413,22 @@ export var buildTableBody = function buildTableBody(props) {
|
|
|
376
413
|
empty: props.rows.isEmpty()
|
|
377
414
|
});
|
|
378
415
|
};
|
|
379
|
-
|
|
416
|
+
exports.buildTableBody = buildTableBody;
|
|
417
|
+
var buildTableBodyRows = function buildTableBodyRows(props) {
|
|
380
418
|
var components = props.components,
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
419
|
+
rows = props.rows,
|
|
420
|
+
columns = props.columns,
|
|
421
|
+
columnSet = props.columnSet,
|
|
422
|
+
appliedFilters = props.appliedFilters,
|
|
423
|
+
renderOptions = props.renderOptions,
|
|
424
|
+
tableOptions = props.tableOptions;
|
|
387
425
|
var BodyRow = components.BodyRow;
|
|
388
426
|
var EmptyBodyRow = components.EmptyBodyRow;
|
|
389
427
|
return rows.size > 0 ? rows.map(function (row, index) {
|
|
390
428
|
var cells = buildTableBodyCells(props, row, index);
|
|
391
|
-
return /*#__PURE__*/
|
|
429
|
+
return /*#__PURE__*/_react["default"].createElement(KeyWrapper, {
|
|
392
430
|
key: "row-".concat(index)
|
|
393
|
-
}, /*#__PURE__*/
|
|
431
|
+
}, /*#__PURE__*/_react["default"].createElement(BodyRow, {
|
|
394
432
|
cells: cells,
|
|
395
433
|
columns: columns,
|
|
396
434
|
row: row,
|
|
@@ -398,7 +436,7 @@ export var buildTableBodyRows = function buildTableBodyRows(props) {
|
|
|
398
436
|
renderOptions: renderOptions,
|
|
399
437
|
tableOptions: tableOptions
|
|
400
438
|
}));
|
|
401
|
-
}) : /*#__PURE__*/
|
|
439
|
+
}) : /*#__PURE__*/_react["default"].createElement(EmptyBodyRow, {
|
|
402
440
|
colSpan: columnSet.size,
|
|
403
441
|
initializing: props.initializing,
|
|
404
442
|
loading: props.loading,
|
|
@@ -408,23 +446,24 @@ export var buildTableBodyRows = function buildTableBodyRows(props) {
|
|
|
408
446
|
error: props.error
|
|
409
447
|
});
|
|
410
448
|
};
|
|
411
|
-
|
|
449
|
+
exports.buildTableBodyRows = buildTableBodyRows;
|
|
450
|
+
var buildTableBodyCells = function buildTableBodyCells(props, row, rowIndex) {
|
|
412
451
|
var tableKey = props.tableKey,
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
452
|
+
components = props.components,
|
|
453
|
+
rows = props.rows,
|
|
454
|
+
columns = props.columns,
|
|
455
|
+
columnSet = props.columnSet,
|
|
456
|
+
columnComponents = props.columnComponents,
|
|
457
|
+
appliedFilters = props.appliedFilters,
|
|
458
|
+
renderOptions = props.renderOptions,
|
|
459
|
+
tableOptions = props.tableOptions,
|
|
460
|
+
extraData = props.extraData;
|
|
422
461
|
return fromColumnSet(columns, columnSet).map(function (column, index) {
|
|
423
462
|
var BodyCell = columnComponents.getIn([column.get('value'), 'BodyCell'], components.BodyCell);
|
|
424
463
|
var value = row.get(column.get('value'));
|
|
425
|
-
return /*#__PURE__*/
|
|
464
|
+
return /*#__PURE__*/_react["default"].createElement(KeyWrapper, {
|
|
426
465
|
key: "column-".concat(index)
|
|
427
|
-
}, /*#__PURE__*/
|
|
466
|
+
}, /*#__PURE__*/_react["default"].createElement(BodyCell, {
|
|
428
467
|
tableKey: tableKey,
|
|
429
468
|
row: row,
|
|
430
469
|
rowIndex: rowIndex,
|
|
@@ -439,16 +478,17 @@ export var buildTableBodyCells = function buildTableBodyCells(props, row, rowInd
|
|
|
439
478
|
}));
|
|
440
479
|
});
|
|
441
480
|
};
|
|
442
|
-
|
|
481
|
+
exports.buildTableBodyCells = buildTableBodyCells;
|
|
482
|
+
var buildTableFooter = function buildTableFooter(props) {
|
|
443
483
|
var components = props.components,
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
484
|
+
columnSet = props.columnSet,
|
|
485
|
+
renderOptions = props.renderOptions,
|
|
486
|
+
rows = props.rows,
|
|
487
|
+
tableOptions = props.tableOptions,
|
|
488
|
+
includeFooter = props.includeFooter;
|
|
449
489
|
var footerRow = buildTableFooterRow(props);
|
|
450
490
|
var Footer = components.Footer;
|
|
451
|
-
return includeFooter ? /*#__PURE__*/
|
|
491
|
+
return includeFooter ? /*#__PURE__*/_react["default"].createElement(Footer, {
|
|
452
492
|
rows: rows,
|
|
453
493
|
footerRow: footerRow,
|
|
454
494
|
colSpan: columnSet.size,
|
|
@@ -456,139 +496,173 @@ export var buildTableFooter = function buildTableFooter(props) {
|
|
|
456
496
|
tableOptions: tableOptions
|
|
457
497
|
}) : null;
|
|
458
498
|
};
|
|
459
|
-
|
|
499
|
+
exports.buildTableFooter = buildTableFooter;
|
|
500
|
+
var buildTableFooterRow = function buildTableFooterRow(props) {
|
|
460
501
|
var components = props.components,
|
|
461
|
-
|
|
462
|
-
|
|
502
|
+
renderOptions = props.renderOptions,
|
|
503
|
+
tableOptions = props.tableOptions;
|
|
463
504
|
var cells = buildTableFooterCells(props);
|
|
464
505
|
var FooterRow = components.FooterRow;
|
|
465
|
-
return /*#__PURE__*/
|
|
506
|
+
return /*#__PURE__*/_react["default"].createElement(FooterRow, {
|
|
466
507
|
cells: cells,
|
|
467
508
|
renderOptions: renderOptions,
|
|
468
509
|
tableOptions: tableOptions
|
|
469
510
|
});
|
|
470
511
|
};
|
|
471
|
-
|
|
512
|
+
exports.buildTableFooterRow = buildTableFooterRow;
|
|
513
|
+
var buildTableFooterCells = function buildTableFooterCells(props) {
|
|
472
514
|
var components = props.components,
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
515
|
+
columns = props.columns,
|
|
516
|
+
columnSet = props.columnSet,
|
|
517
|
+
columnComponents = props.columnComponents,
|
|
518
|
+
renderOptions = props.renderOptions,
|
|
519
|
+
tableOptions = props.tableOptions;
|
|
478
520
|
return fromColumnSet(columns, columnSet).map(function (column, index) {
|
|
479
521
|
var FooterCell = columnComponents.getIn([column.get('value'), 'FooterCell'], components.FooterCell);
|
|
480
|
-
return /*#__PURE__*/
|
|
522
|
+
return /*#__PURE__*/_react["default"].createElement(KeyWrapper, {
|
|
481
523
|
key: "column-".concat(index)
|
|
482
|
-
}, /*#__PURE__*/
|
|
524
|
+
}, /*#__PURE__*/_react["default"].createElement(FooterCell, {
|
|
483
525
|
column: column,
|
|
484
526
|
renderOptions: renderOptions,
|
|
485
527
|
tableOptions: tableOptions
|
|
486
528
|
}));
|
|
487
529
|
});
|
|
488
530
|
};
|
|
489
|
-
|
|
531
|
+
exports.buildTableFooterCells = buildTableFooterCells;
|
|
490
532
|
var onNextPage = function onNextPage(tableKey) {
|
|
491
533
|
return function () {
|
|
492
|
-
return dispatch('NEXT_PAGE', {
|
|
534
|
+
return (0, _store.dispatch)('NEXT_PAGE', {
|
|
493
535
|
tableKey: tableKey
|
|
494
536
|
});
|
|
495
537
|
};
|
|
496
538
|
};
|
|
497
|
-
|
|
498
539
|
var onPrevPage = function onPrevPage(tableKey) {
|
|
499
540
|
return function () {
|
|
500
|
-
return dispatch('PREV_PAGE', {
|
|
541
|
+
return (0, _store.dispatch)('PREV_PAGE', {
|
|
501
542
|
tableKey: tableKey
|
|
502
543
|
});
|
|
503
544
|
};
|
|
504
545
|
};
|
|
505
|
-
|
|
506
546
|
var onGotoPage = function onGotoPage(tableKey) {
|
|
507
547
|
return function (pageNumber) {
|
|
508
548
|
return function () {
|
|
509
|
-
return dispatch('GOTO_PAGE', {
|
|
549
|
+
return (0, _store.dispatch)('GOTO_PAGE', {
|
|
510
550
|
tableKey: tableKey,
|
|
511
551
|
pageNumber: pageNumber
|
|
512
552
|
});
|
|
513
553
|
};
|
|
514
554
|
};
|
|
515
555
|
};
|
|
516
|
-
|
|
517
556
|
var onSortColumn = function onSortColumn(tableKey, column) {
|
|
518
557
|
return function () {
|
|
519
|
-
return dispatch('SORT_COLUMN', {
|
|
558
|
+
return (0, _store.dispatch)('SORT_COLUMN', {
|
|
559
|
+
tableKey: tableKey,
|
|
560
|
+
column: column
|
|
561
|
+
});
|
|
562
|
+
};
|
|
563
|
+
};
|
|
564
|
+
var onToggleColumn = function onToggleColumn(tableKey, column) {
|
|
565
|
+
return function () {
|
|
566
|
+
return (0, _store.dispatch)('TOGGLE_COLUMN', {
|
|
520
567
|
tableKey: tableKey,
|
|
521
568
|
column: column
|
|
522
569
|
});
|
|
523
570
|
};
|
|
524
571
|
};
|
|
525
|
-
|
|
526
572
|
var mapStateToProps = function mapStateToProps() {
|
|
527
573
|
return function (state, props) {
|
|
528
|
-
return state.getIn(['tables', props.tableKey], Map()).toObject();
|
|
574
|
+
return state.getIn(['tables', props.tableKey], (0, _immutable.Map)()).toObject();
|
|
529
575
|
};
|
|
530
576
|
};
|
|
577
|
+
|
|
531
578
|
/**
|
|
532
579
|
* @component
|
|
533
580
|
*/
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
var TableImpl = compose(connect(mapStateToProps), lifecycle({
|
|
581
|
+
var TableImpl = (0, _recompose.compose)((0, _store.connect)(mapStateToProps), (0, _recompose.lifecycle)({
|
|
537
582
|
componentDidMount: function componentDidMount() {
|
|
538
583
|
if (this.props.mounted && !this.props.configured) {
|
|
539
|
-
configureTable(this.props);
|
|
584
|
+
(0, _Table.configureTable)(this.props);
|
|
540
585
|
}
|
|
541
586
|
},
|
|
542
587
|
componentDidUpdate: function componentDidUpdate() {
|
|
543
588
|
if (this.props.mounted && !this.props.configured) {
|
|
544
|
-
configureTable(this.props);
|
|
589
|
+
(0, _Table.configureTable)(this.props);
|
|
545
590
|
}
|
|
546
591
|
}
|
|
547
592
|
}))(TableComponent);
|
|
548
|
-
|
|
593
|
+
var generateColumns = function generateColumns(columns) {
|
|
549
594
|
var addColumns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
550
595
|
var alterColumns = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
551
|
-
return List(
|
|
552
|
-
return Map(
|
|
596
|
+
return (0, _immutable.List)(columns).concat(addColumns).map(function (c) {
|
|
597
|
+
return (0, _immutable.Map)((0, _objectSpread2["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, c), alterColumns[c.value]), {}, {
|
|
553
598
|
value: c.value
|
|
554
599
|
}));
|
|
555
600
|
});
|
|
556
601
|
};
|
|
557
|
-
|
|
602
|
+
exports.generateColumns = generateColumns;
|
|
603
|
+
var sortColumns = function sortColumns(columns, columnSet) {
|
|
604
|
+
return columns
|
|
605
|
+
// First sort columns by the columnOrder value if provided
|
|
606
|
+
.sortBy(function (column) {
|
|
607
|
+
return column.get('columnOrder') === 'first' ? -1 : column.get('columnOrder') === 'last' ? 1 : 0;
|
|
608
|
+
})
|
|
609
|
+
// Next reduce the columns list into a list of groups, starting a new group
|
|
610
|
+
// each time we get to a column that's in the columnSet. This will result in
|
|
611
|
+
// each group having at most one columnSet column, and that column will be
|
|
612
|
+
// the first one in the group.
|
|
613
|
+
.reduce(function (list, column) {
|
|
614
|
+
return columnSet.includes(column.get('value')) ? list.push((0, _immutable.List)([column])) : list.update(-1, function (group) {
|
|
615
|
+
return group ? group.push(column) : (0, _immutable.List)([column]);
|
|
616
|
+
});
|
|
617
|
+
}, (0, _immutable.List)())
|
|
618
|
+
// Then sort the groups, taking the first column from each group, finding
|
|
619
|
+
// its index in the column set, and using that index as a sort value. Any
|
|
620
|
+
// groups without a columnSet column will be sorted to the end.
|
|
621
|
+
.sortBy(function (group) {
|
|
622
|
+
var columnSetIndex = columnSet.findIndex(function (c) {
|
|
623
|
+
return c === group.getIn([0, 'value']);
|
|
624
|
+
});
|
|
625
|
+
return columnSetIndex >= 0 ? columnSetIndex : columnSet.size + 1;
|
|
626
|
+
})
|
|
627
|
+
// Lastly flatten the groups back to a list of columns
|
|
628
|
+
.flatten(true);
|
|
629
|
+
};
|
|
630
|
+
exports.sortColumns = sortColumns;
|
|
631
|
+
var extractColumnComponents = function extractColumnComponents(columns) {
|
|
558
632
|
return columns.filter(function (c) {
|
|
559
633
|
return c.has('components');
|
|
560
634
|
}).reduce(function (result, current) {
|
|
561
635
|
return result.set(current.get('value'), current.get('components'));
|
|
562
|
-
}, Map());
|
|
636
|
+
}, (0, _immutable.Map)());
|
|
563
637
|
};
|
|
564
|
-
|
|
638
|
+
exports.extractColumnComponents = extractColumnComponents;
|
|
639
|
+
var generateTable = function generateTable(_ref4) {
|
|
565
640
|
var _ref4$tableOptions = _ref4.tableOptions,
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
641
|
+
tableOptions = _ref4$tableOptions === void 0 ? [] : _ref4$tableOptions,
|
|
642
|
+
_ref4$filterDataSourc = _ref4.filterDataSources,
|
|
643
|
+
filterDataSources = _ref4$filterDataSourc === void 0 ? function () {
|
|
644
|
+
return {};
|
|
645
|
+
} : _ref4$filterDataSourc,
|
|
646
|
+
filters = _ref4.filters,
|
|
647
|
+
columns = _ref4.columns,
|
|
648
|
+
dataSource = _ref4.dataSource,
|
|
649
|
+
sortable = _ref4.sortable,
|
|
650
|
+
onValidateFilters = _ref4.onValidateFilters;
|
|
576
651
|
return function (props) {
|
|
577
652
|
var tableOptionProps = tableOptions ? tableOptions.reduce(function (to, opt) {
|
|
578
653
|
to[opt] = props[opt];
|
|
579
654
|
return to;
|
|
580
655
|
}, {}) : {};
|
|
581
656
|
var FilterForm;
|
|
582
|
-
|
|
583
657
|
if (filters) {
|
|
584
|
-
FilterForm = generateForm({
|
|
658
|
+
FilterForm = (0, _Form.generateForm)({
|
|
585
659
|
dataSources: filterDataSources,
|
|
586
660
|
fields: filters,
|
|
587
|
-
formOptions: ['tableKey'].concat(
|
|
661
|
+
formOptions: ['tableKey'].concat((0, _toConsumableArray2["default"])(tableOptions)),
|
|
588
662
|
handleSubmit: function handleSubmit(_ref5) {
|
|
589
663
|
var tableKey = _ref5.tableKey;
|
|
590
664
|
return function (values) {
|
|
591
|
-
dispatch('APPLY_FILTER_FORM', {
|
|
665
|
+
(0, _store.dispatch)('APPLY_FILTER_FORM', {
|
|
592
666
|
tableKey: tableKey,
|
|
593
667
|
appliedFilters: values
|
|
594
668
|
});
|
|
@@ -599,32 +673,33 @@ export var generateTable = function generateTable(_ref4) {
|
|
|
599
673
|
}
|
|
600
674
|
});
|
|
601
675
|
}
|
|
602
|
-
|
|
603
676
|
var setProps = {
|
|
604
677
|
// Passed in to `generateTable`
|
|
605
678
|
columns: columns,
|
|
606
679
|
dataSource: dataSource,
|
|
607
680
|
onValidateFilters: onValidateFilters,
|
|
608
681
|
// Calculated from props and tableOptions.
|
|
609
|
-
tableOptions:
|
|
682
|
+
tableOptions: (0, _objectSpread2["default"])({}, tableOptionProps),
|
|
610
683
|
// Add FilterForm to the components that are passed.
|
|
611
|
-
components:
|
|
684
|
+
components: (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props.components), {}, {
|
|
612
685
|
FilterForm: FilterForm
|
|
613
686
|
}),
|
|
614
687
|
// Sortable can be enabled or disabled for an entire table.
|
|
615
688
|
sortable: typeof sortable !== 'undefined' ? sortable : props.sortable,
|
|
616
689
|
// Explicitly allowed props.
|
|
617
690
|
tableKey: props.tableKey,
|
|
618
|
-
filterFormKey: filterFormKey(props.tableKey),
|
|
691
|
+
filterFormKey: (0, _Table.filterFormKey)(props.tableKey),
|
|
619
692
|
addColumns: props.addColumns,
|
|
620
693
|
alterColumns: props.alterColumns,
|
|
621
|
-
alterFilters: mergeDeep(props.alterFilters || {}, Map(props.initialFilterValues).map(function (initialValue) {
|
|
694
|
+
alterFilters: (0, _immutable.mergeDeep)(props.alterFilters || {}, (0, _immutable.Map)(props.initialFilterValues).map(function (initialValue) {
|
|
622
695
|
return {
|
|
623
696
|
initialValue: initialValue
|
|
624
697
|
};
|
|
625
698
|
}).toObject()),
|
|
626
699
|
filterSet: props.filterSet,
|
|
700
|
+
filterAutoFocus: props.filterAutoFocus,
|
|
627
701
|
columnSet: props.columnSet,
|
|
702
|
+
columnSetOrder: props.columnSetOrder,
|
|
628
703
|
pageSize: props.pageSize,
|
|
629
704
|
defaultSortColumn: props.defaultSortColumn,
|
|
630
705
|
defaultSortDirection: props.defaultSortDirection,
|
|
@@ -640,79 +715,72 @@ export var generateTable = function generateTable(_ref4) {
|
|
|
640
715
|
onSearch: props.onSearch,
|
|
641
716
|
onFetch: props.onFetch
|
|
642
717
|
};
|
|
643
|
-
return /*#__PURE__*/
|
|
718
|
+
return /*#__PURE__*/_react["default"].createElement(Table, setProps, props.children);
|
|
644
719
|
};
|
|
645
720
|
};
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
var _super =
|
|
650
|
-
|
|
721
|
+
exports.generateTable = generateTable;
|
|
722
|
+
var Table = /*#__PURE__*/function (_Component) {
|
|
723
|
+
(0, _inherits2["default"])(Table, _Component);
|
|
724
|
+
var _super = (0, _createSuper2["default"])(Table);
|
|
651
725
|
function Table(props) {
|
|
652
726
|
var _this;
|
|
653
|
-
|
|
654
|
-
_classCallCheck(this, Table);
|
|
655
|
-
|
|
727
|
+
(0, _classCallCheck2["default"])(this, Table);
|
|
656
728
|
_this = _super.call(this, props);
|
|
657
|
-
|
|
658
729
|
var components = props.components,
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
730
|
+
tableKey = props.tableKey,
|
|
731
|
+
config = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
|
662
732
|
_this.components = components;
|
|
663
733
|
_this.config = config;
|
|
664
734
|
_this.auto = !tableKey || props.uncontrolled;
|
|
665
|
-
_this.tableKey = tableKey || generateKey();
|
|
735
|
+
_this.tableKey = tableKey || (0, _helpers.generateKey)();
|
|
666
736
|
return _this;
|
|
667
737
|
}
|
|
668
|
-
|
|
669
|
-
_createClass(Table, [{
|
|
738
|
+
(0, _createClass2["default"])(Table, [{
|
|
670
739
|
key: "componentDidMount",
|
|
671
740
|
value: function componentDidMount() {
|
|
672
741
|
if (this.auto) {
|
|
673
|
-
mountTable(this.tableKey);
|
|
742
|
+
(0, _Table.mountTable)(this.tableKey);
|
|
674
743
|
}
|
|
675
744
|
}
|
|
676
745
|
}, {
|
|
677
746
|
key: "componentWillUnmount",
|
|
678
747
|
value: function componentWillUnmount() {
|
|
679
748
|
if (this.auto) {
|
|
680
|
-
unmountTable(this.tableKey);
|
|
749
|
+
(0, _Table.unmountTable)(this.tableKey);
|
|
681
750
|
}
|
|
682
751
|
}
|
|
683
752
|
}, {
|
|
684
753
|
key: "render",
|
|
685
754
|
value: function render() {
|
|
686
755
|
var _this2 = this;
|
|
687
|
-
|
|
688
756
|
var columns = generateColumns(this.props.columns, this.props.addColumns, this.props.alterColumns);
|
|
689
757
|
var allColumns = columns.map(function (c) {
|
|
690
758
|
return c.get('value');
|
|
691
759
|
});
|
|
692
|
-
var
|
|
760
|
+
var initialColumnSet = (0, _immutable.List)(this.props.columnSet ? typeof this.props.columnSet === 'function' ? this.props.columnSet(allColumns) : this.props.columnSet : allColumns).filter(function (c) {
|
|
693
761
|
return columns.find(function (c2) {
|
|
694
762
|
return c2.get('value') === c;
|
|
695
763
|
});
|
|
696
764
|
});
|
|
697
765
|
var columnComponents = extractColumnComponents(columns);
|
|
698
|
-
return /*#__PURE__*/
|
|
699
|
-
return /*#__PURE__*/
|
|
766
|
+
return /*#__PURE__*/_react["default"].createElement(_ComponentConfigContext.ComponentConfigContext.Consumer, null, function (componentConfig) {
|
|
767
|
+
return /*#__PURE__*/_react["default"].createElement(TableImpl, Object.assign({}, _this2.props, {
|
|
700
768
|
components: componentConfig.merge(_this2.props.components).toJS(),
|
|
701
769
|
columnComponents: columnComponents,
|
|
702
|
-
columns: columns,
|
|
703
|
-
columnSet:
|
|
770
|
+
columns: sortColumns(columns, initialColumnSet),
|
|
771
|
+
columnSet: initialColumnSet,
|
|
704
772
|
tableKey: _this2.tableKey,
|
|
705
773
|
auto: _this2.auto
|
|
706
774
|
}), _this2.props.children);
|
|
707
775
|
});
|
|
708
776
|
}
|
|
709
777
|
}]);
|
|
710
|
-
|
|
711
778
|
return Table;
|
|
712
|
-
}(Component);
|
|
779
|
+
}(_react.Component);
|
|
780
|
+
exports.Table = Table;
|
|
713
781
|
var defaultProps = {
|
|
714
782
|
components: {},
|
|
715
|
-
rows: List([]),
|
|
783
|
+
rows: (0, _immutable.List)([]),
|
|
716
784
|
columns: [],
|
|
717
785
|
addColumns: [],
|
|
718
786
|
alterColumns: {},
|
|
@@ -722,4 +790,4 @@ var defaultProps = {
|
|
|
722
790
|
includeFooter: false
|
|
723
791
|
};
|
|
724
792
|
Table.defaultProps = defaultProps;
|
|
725
|
-
Table.configure = configureTable;
|
|
793
|
+
Table.configure = _Table.configureTable;
|