@kineticdata/react 5.1.2 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/task/icons/drag-handle.svg +3 -0
- package/assets/task/icons/plus_small.svg +2 -4
- package/lib/apis/agent/adapters.js +16 -12
- package/lib/apis/agent/bridges.js +54 -41
- package/lib/apis/agent/handlers.js +51 -38
- package/lib/apis/core/activity.js +19 -11
- package/lib/apis/core/attributeDefinitions.js +54 -46
- package/lib/apis/core/attributeDefinitions.test.js +47 -55
- package/lib/apis/core/authentication.js +58 -63
- package/lib/apis/core/backgroundJobs.js +38 -30
- package/lib/apis/core/bridgeModelAttributeMappings.js +42 -34
- package/lib/apis/core/bridgeModelAttributes.js +47 -37
- package/lib/apis/core/bridgeModelMappings.js +42 -34
- package/lib/apis/core/bridgeModelQualificationMappings.js +42 -34
- package/lib/apis/core/bridgeModelQualifications.js +42 -34
- package/lib/apis/core/bridgeModels.js +56 -46
- package/lib/apis/core/bridgeModels.test.js +64 -80
- package/lib/apis/core/bridgedresources.js +64 -72
- package/lib/apis/core/bridgedresources.test.js +33 -30
- package/lib/apis/core/categories.js +59 -52
- package/lib/apis/core/categories.test.js +36 -33
- package/lib/apis/core/fileResources.js +41 -33
- package/lib/apis/core/filestores.js +42 -34
- package/lib/apis/core/formTypes.js +50 -44
- package/lib/apis/core/forms.js +53 -49
- package/lib/apis/core/forms.test.js +60 -74
- package/lib/apis/core/kapps.js +45 -39
- package/lib/apis/core/kapps.test.js +45 -52
- package/lib/apis/core/logs.js +20 -16
- package/lib/apis/core/memberships.js +23 -20
- package/lib/apis/core/meta.js +31 -19
- package/lib/apis/core/notices.js +17 -9
- package/lib/apis/core/oauthClients.js +49 -45
- package/lib/apis/core/platformComponents.js +73 -57
- package/lib/apis/core/platformItems.js +22 -13
- package/lib/apis/core/profile.js +28 -21
- package/lib/apis/core/profile.test.js +20 -17
- package/lib/apis/core/securityPolicyDefinitions.js +48 -41
- package/lib/apis/core/securityPolicyDefinitions.test.js +50 -60
- package/lib/apis/core/space.js +23 -16
- package/lib/apis/core/space.test.js +31 -38
- package/lib/apis/core/submissions.js +213 -186
- package/lib/apis/core/submissions.test.js +39 -36
- package/lib/apis/core/teams.js +51 -44
- package/lib/apis/core/teams.test.js +42 -39
- package/lib/apis/core/translations.js +123 -130
- package/lib/apis/core/translations.test.js +278 -368
- package/lib/apis/core/users.js +56 -49
- package/lib/apis/core/users.test.js +42 -39
- package/lib/apis/core/version.js +20 -11
- package/lib/apis/core/webApis.js +42 -34
- package/lib/apis/core/webhooks.js +48 -41
- package/lib/apis/core/webhooks.test.js +50 -60
- package/lib/apis/core/webhooksJobs.js +30 -26
- package/lib/apis/core/workflows.js +52 -44
- package/lib/apis/http.js +89 -80
- package/lib/apis/http.test.js +37 -38
- package/lib/apis/index.js +506 -50
- package/lib/apis/system/index.js +228 -211
- package/lib/apis/task/index.js +280 -227
- package/lib/components/agent/bridge/BridgeForm.js +50 -50
- package/lib/components/agent/bridge/BridgeTable.js +12 -8
- package/lib/components/agent/filestore/FilestoreForm.js +49 -48
- package/lib/components/agent/filestore/FilestoreTable.js +12 -8
- package/lib/components/agent/handler/AgentHandlerForm.js +24 -27
- package/lib/components/agent/handler/AgentHandlerTable.js +12 -8
- package/lib/components/common/AttributeSelect.js +15 -9
- package/lib/components/common/BridgeSelect.js +48 -43
- package/lib/components/common/ComponentConfigContext.js +9 -2
- package/lib/components/common/ContentEditable.js +36 -60
- package/lib/components/common/FormSelect.js +70 -58
- package/lib/components/common/NodeSelect.js +23 -19
- package/lib/components/common/Scroller.js +24 -23
- package/lib/components/common/StaticSelect.js +57 -50
- package/lib/components/common/TableInput.js +54 -57
- package/lib/components/common/TeamSelect.js +42 -39
- package/lib/components/common/Typeahead.js +121 -138
- package/lib/components/common/UserSelect.js +42 -41
- package/lib/components/common/authentication/AuthInterceptor.js +15 -19
- package/lib/components/common/authentication/AuthInterceptor.test.js +46 -64
- package/lib/components/common/authentication/AuthenticationContainer.js +350 -454
- package/lib/components/common/authentication/RequestInterceptor.js +16 -19
- package/lib/components/common/code_input/CodeInput.js +92 -122
- package/lib/components/common/code_input/draftHelpers.js +96 -90
- package/lib/components/common/code_input/languageHelpers.js +49 -47
- package/lib/components/common/code_input/languageHelpers.test.js +21 -16
- package/lib/components/core/CoreFormModal.js +26 -24
- package/lib/components/core/CoreModal.js +37 -31
- package/lib/components/core/attribute_definition/AttributeDefinitionForm.js +24 -23
- package/lib/components/core/attribute_definition/AttributeDefinitionTable.js +18 -15
- package/lib/components/core/bridge_model/BridgeModelForm.js +27 -37
- package/lib/components/core/bridge_model/BridgeModelTable.js +12 -8
- package/lib/components/core/bridge_model_attribute/BridgeModelAttributeForm.js +17 -16
- package/lib/components/core/bridge_model_attribute/BridgeModelAttributeTable.js +25 -21
- package/lib/components/core/bridge_model_qualification/BridgeModelQualificationForm.js +20 -20
- package/lib/components/core/bridge_model_qualification/BridgeModelQualificationTable.js +27 -22
- package/lib/components/core/category/CategoryForm.js +22 -22
- package/lib/components/core/category/CategoryTable.js +15 -10
- package/lib/components/core/core_form/CoreForm.js +209 -285
- package/lib/components/core/core_form/CoreForm.test.js +12 -10
- package/lib/components/core/core_form/defaults/index.js +52 -44
- package/lib/components/core/core_form/globals.js +14 -5
- package/lib/components/core/field_definition/FieldDefinitionForm.js +23 -21
- package/lib/components/core/field_definition/FieldDefinitionTable.js +15 -10
- package/lib/components/core/file_resource/FileResourceForm.js +38 -37
- package/lib/components/core/file_resource/FileResourceTable.js +16 -12
- package/lib/components/core/form/FormForm.js +56 -61
- package/lib/components/core/form/FormTable.js +25 -22
- package/lib/components/core/form_type/FormTypeForm.js +14 -13
- package/lib/components/core/form_type/FormTypeTable.js +12 -8
- package/lib/components/core/i18n/I18n.js +54 -61
- package/lib/components/core/i18n/I18nContext.js +9 -2
- package/lib/components/core/i18n/I18nProvider.js +40 -43
- package/lib/components/core/i18n/Moment.js +40 -50
- package/lib/components/core/index_definition/IndexDefinitionForm.js +23 -24
- package/lib/components/core/index_definition/IndexDefinitionTable.js +19 -11
- package/lib/components/core/index_job/IndexJobTable.js +20 -15
- package/lib/components/core/kapp/KappForm.js +57 -58
- package/lib/components/core/kapp/KappTable.js +17 -12
- package/lib/components/core/log/LogTable.js +35 -33
- package/lib/components/core/oauth_client/OAuthClientForm.js +17 -17
- package/lib/components/core/oauth_client/OAuthClientTable.js +12 -8
- package/lib/components/core/platform_component/AgentComponentForm.js +15 -15
- package/lib/components/core/platform_component/AgentComponentTable.js +10 -5
- package/lib/components/core/platform_component/TaskComponentForm.js +14 -14
- package/lib/components/core/profile/ProfileForm.js +40 -39
- package/lib/components/core/security_definition/SecurityDefinitionForm.js +28 -25
- package/lib/components/core/security_definition/SecurityDefinitionTable.js +18 -13
- package/lib/components/core/space/SpaceForm.js +79 -90
- package/lib/components/core/submission/DatastoreSubmissionFilters.js +39 -40
- package/lib/components/core/submission/DatastoreSubmissionTable.js +37 -34
- package/lib/components/core/submission/FormSubmissionFilters.js +79 -75
- package/lib/components/core/submission/FormSubmissionTable.js +27 -20
- package/lib/components/core/submission/KappSubmissionTable.js +30 -29
- package/lib/components/core/submission/SubmissionForm.js +126 -55
- package/lib/components/core/submission/SubmissionTable.js +24 -20
- package/lib/components/core/submission/helpers.js +37 -33
- package/lib/components/core/submission/helpers.test.js +69 -20
- package/lib/components/core/team/TeamForm.js +24 -21
- package/lib/components/core/team/TeamTable.js +16 -11
- package/lib/components/core/translation/ContextForm.js +13 -10
- package/lib/components/core/translation/ContextTable.js +13 -10
- package/lib/components/core/translation/EntryForm.js +27 -24
- package/lib/components/core/translation/EntryTable.js +19 -16
- package/lib/components/core/translation/LocaleForm.js +16 -13
- package/lib/components/core/translation/LocaleTable.js +12 -8
- package/lib/components/core/user/UserForm.js +38 -37
- package/lib/components/core/user/UserTable.js +19 -15
- package/lib/components/core/webapi/WebApiForm.js +49 -61
- package/lib/components/core/webapi/WebApiTable.js +14 -10
- package/lib/components/core/webhook/WebhookForm.js +33 -32
- package/lib/components/core/webhook/WebhookTable.js +22 -20
- package/lib/components/core/webhook_job/WebhookJobTable.js +19 -16
- package/lib/components/form/Form.helpers.js +102 -90
- package/lib/components/form/Form.js +467 -524
- package/lib/components/form/Form.models.js +38 -24
- package/lib/components/form/FormState.js +8 -5
- package/lib/components/form/KitchenSinkForm.js +135 -4
- package/lib/components/form/defaults/AttributesField.js +48 -59
- package/lib/components/form/defaults/CheckboxField.js +14 -6
- package/lib/components/form/defaults/CodeField.js +15 -7
- package/lib/components/form/defaults/FormButtons.js +12 -4
- package/lib/components/form/defaults/FormError.js +12 -4
- package/lib/components/form/defaults/FormField.js +15 -7
- package/lib/components/form/defaults/FormLayout.js +12 -4
- package/lib/components/form/defaults/FormMultiField.js +15 -7
- package/lib/components/form/defaults/PasswordField.js +14 -6
- package/lib/components/form/defaults/RadioField.js +15 -7
- package/lib/components/form/defaults/SampleTeamsRolesFIeld.js +17 -9
- package/lib/components/form/defaults/SelectField.js +16 -8
- package/lib/components/form/defaults/SelectMultiField.js +15 -7
- package/lib/components/form/defaults/TableField.js +14 -6
- package/lib/components/form/defaults/TeamField.js +15 -7
- package/lib/components/form/defaults/TeamMultiField.js +15 -7
- package/lib/components/form/defaults/TextField.js +14 -6
- package/lib/components/form/defaults/TextMultiField.js +26 -28
- package/lib/components/form/defaults/UserField.js +15 -7
- package/lib/components/form/defaults/UserMultiField.js +15 -7
- package/lib/components/form/defaults/index.js +48 -41
- package/lib/components/form/tests/Form.test.js +568 -864
- package/lib/components/form/tests/components.js +15 -25
- package/lib/components/form/tests/helpers.test.js +35 -33
- package/lib/components/index.js +981 -135
- package/lib/components/system/SystemBackgroundTasksTable.js +14 -10
- package/lib/components/system/SystemFilestoreForm.js +28 -25
- package/lib/components/system/SystemForm.js +19 -16
- package/lib/components/system/SystemIngressForm.js +10 -9
- package/lib/components/system/SystemSecurityForm.js +17 -14
- package/lib/components/system/SystemSmtpForm.js +13 -13
- package/lib/components/system/SystemTaskAdapterForm.js +21 -17
- package/lib/components/system/SystemUserForm.js +15 -14
- package/lib/components/system/helpers.js +62 -60
- package/lib/components/system/helpers.test.js +16 -12
- package/lib/components/system/spaces/SystemSpaceForm.js +25 -24
- package/lib/components/system/spaces/SystemTenantForm.js +43 -40
- package/lib/components/system/spaces/SystemTenantTable.js +12 -8
- package/lib/components/table/Table.js +211 -224
- package/lib/components/table/Table.redux.js +292 -329
- package/lib/components/table/Table.redux.test.js +49 -47
- package/lib/components/table/Table.test.js +107 -132
- package/lib/components/table/defaults/BodyCell.js +12 -6
- package/lib/components/table/defaults/BodyRow.js +10 -4
- package/lib/components/table/defaults/BooleanFilter.js +17 -11
- package/lib/components/table/defaults/EmptyBodyRow.js +12 -6
- package/lib/components/table/defaults/FilterLayout.js +17 -11
- package/lib/components/table/defaults/Footer.js +11 -5
- package/lib/components/table/defaults/FooterCell.js +10 -4
- package/lib/components/table/defaults/FooterRow.js +10 -4
- package/lib/components/table/defaults/Header.js +10 -4
- package/lib/components/table/defaults/HeaderCell.js +16 -10
- package/lib/components/table/defaults/HeaderRow.js +10 -4
- package/lib/components/table/defaults/PaginationControl.js +18 -9
- package/lib/components/table/defaults/TableBody.js +10 -4
- package/lib/components/table/defaults/TableLayout.js +12 -6
- package/lib/components/table/defaults/TextFilter.js +16 -10
- package/lib/components/table/defaults/index.js +41 -33
- package/lib/components/task/builder/Connector.js +100 -111
- package/lib/components/task/builder/ConnectorForm.js +17 -11
- package/lib/components/task/builder/Node.js +101 -83
- package/lib/components/task/builder/NodeForm.js +30 -27
- package/lib/components/task/builder/NodeParametersForm.js +27 -24
- package/lib/components/task/builder/SvgCanvas.js +67 -96
- package/lib/components/task/builder/SvgText.js +19 -134
- package/lib/components/task/builder/TaskDefinitionConfigForm.js +27 -22
- package/lib/components/task/builder/TreeBuilder.js +140 -115
- package/lib/components/task/builder/builder.redux.js +311 -326
- package/lib/components/task/builder/constants.js +94 -45
- package/lib/components/task/builder/helpers.js +184 -173
- package/lib/components/task/builder/helpers.test.js +20 -18
- package/lib/components/task/builder/models.js +121 -98
- package/lib/components/task/category/TaskCategoryForm.js +31 -29
- package/lib/components/task/category/TaskCategoryTable.js +12 -8
- package/lib/components/task/common/UsageTable.js +16 -12
- package/lib/components/task/engine/EngineSettingsForm.js +13 -11
- package/lib/components/task/errors/RunErrorTable.js +17 -13
- package/lib/components/task/errors/SystemErrorsTable.js +13 -9
- package/lib/components/task/handlers/HandlerForm.js +55 -55
- package/lib/components/task/handlers/HandlerTable.js +12 -8
- package/lib/components/task/handlers/MissingHandlerTable.js +12 -8
- package/lib/components/task/policy_rule/PolicyRuleForm.js +33 -32
- package/lib/components/task/policy_rule/PolicyRuleTable.js +12 -8
- package/lib/components/task/runs/CreateManualTriggerForm.js +17 -15
- package/lib/components/task/runs/RunTable.js +23 -20
- package/lib/components/task/runs/RunTaskTable.js +10 -6
- package/lib/components/task/sources/SourceForm.js +47 -47
- package/lib/components/task/sources/SourceTable.js +14 -11
- package/lib/components/task/triggers/TriggerTable.js +21 -18
- package/lib/components/task/workflows/LinkedWorkflowForm.js +48 -54
- package/lib/components/task/workflows/LinkedWorkflowTable.js +14 -10
- package/lib/components/task/workflows/MissingRoutineTable.js +12 -8
- package/lib/components/task/workflows/WorkflowForm.js +49 -44
- package/lib/components/task/workflows/WorkflowTable.js +17 -14
- package/lib/helpers/SearchBuilder.js +73 -127
- package/lib/helpers/SearchBuilder.test.js +184 -175
- package/lib/helpers/index.js +116 -74
- package/lib/index.js +86 -38
- package/lib/reducer.js +11 -3
- package/lib/saga.js +42 -38
- package/lib/store.js +59 -35
- package/package.json +3 -28
- package/proxyhelper.js +105 -46
- package/assets/discussions/images/avi_128.png +0 -0
- package/assets/discussions/images/excel_128.png +0 -0
- package/assets/discussions/images/html_128.png +0 -0
- package/assets/discussions/images/illustrator_128.png +0 -0
- package/assets/discussions/images/indesign_128.png +0 -0
- package/assets/discussions/images/movie_128.png +0 -0
- package/assets/discussions/images/mpeg_128.png +0 -0
- package/assets/discussions/images/pdf_128.png +0 -0
- package/assets/discussions/images/photoshop_128.png +0 -0
- package/assets/discussions/images/powerpoint_128.png +0 -0
- package/assets/discussions/images/txt_128.png +0 -0
- package/assets/discussions/images/unknown_128.png +0 -0
- package/assets/discussions/images/word_128.png +0 -0
- package/assets/discussions/styles/_discussion.scss +0 -506
- package/lib/apis/discussions/index.js +0 -395
- package/lib/apis/socket/index.js +0 -77
- package/lib/apis/socket/socket.js +0 -350
- package/lib/apis/socket/socket.test.js +0 -90
- package/lib/apis/socket/timer.js +0 -45
- package/lib/apis/socket/timer.test.js +0 -51
- package/lib/apis/socket/topic.js +0 -185
- package/lib/apis/topics/index.js +0 -19
- package/lib/components/discussions/ChatInputForm.js +0 -424
- package/lib/components/discussions/DateBanner.js +0 -10
- package/lib/components/discussions/Discussion.js +0 -202
- package/lib/components/discussions/DiscussionForm.js +0 -227
- package/lib/components/discussions/InvitationForm.js +0 -107
- package/lib/components/discussions/MessageHistory.js +0 -110
- package/lib/components/discussions/MessagesByDate.js +0 -40
- package/lib/components/discussions/MessagesList.js +0 -30
- package/lib/components/discussions/MoreMessagesBanner.js +0 -26
- package/lib/components/discussions/ScrollHelper.js +0 -84
- package/lib/components/discussions/SystemMessage.js +0 -88
- package/lib/components/discussions/SystemMessageGroup.js +0 -15
- package/lib/components/discussions/UserMessage.js +0 -163
- package/lib/components/discussions/UserMessageGroup.js +0 -34
- package/lib/components/discussions/redux.js +0 -178
- package/lib/components/discussions/sagas.js +0 -500
- package/lib/helpers/discussions/canManage.js +0 -30
- package/lib/helpers/discussions/canManage.test.js +0 -69
- package/lib/helpers/discussions/generateSystemMessageContent.js +0 -131
- package/lib/helpers/discussions/generateSystemMessageContent.test.js +0 -450
- package/lib/models/discussions.js +0 -76
- package/lib/models/index.js +0 -1
|
@@ -1,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.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,25 +29,23 @@ 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
|
-
|
|
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;
|
|
43
49
|
var table = buildTable(props);
|
|
44
50
|
var filter = components.FilterForm ? buildFilterForm(props) : buildFilterLayout(props);
|
|
45
51
|
var pagination = buildPaginationControl(props);
|
|
@@ -58,41 +64,36 @@ var TableComponent = function TableComponent(props) {
|
|
|
58
64
|
extraData: extraData
|
|
59
65
|
});
|
|
60
66
|
}
|
|
61
|
-
|
|
62
67
|
return null;
|
|
63
68
|
};
|
|
64
|
-
|
|
65
69
|
var filterComponentByType = function filterComponentByType(components) {
|
|
66
70
|
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'text';
|
|
67
71
|
return type === 'boolean' ? components.BooleanFilter : components.TextFilter;
|
|
68
72
|
};
|
|
69
|
-
|
|
70
73
|
var buildField = function buildField(_ref2) {
|
|
71
74
|
var filter = _ref2.filter,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
filters = _ref2.filters,
|
|
76
|
+
components = _ref2.components,
|
|
77
|
+
columnComponents = _ref2.columnComponents,
|
|
78
|
+
tableKey = _ref2.tableKey,
|
|
79
|
+
tableOptions = _ref2.tableOptions,
|
|
80
|
+
renderOptions = _ref2.renderOptions;
|
|
78
81
|
var value = filter.get('value');
|
|
79
82
|
var name = filter.getIn(['column', 'value']);
|
|
80
83
|
var title = filter.getIn(['column', 'title']);
|
|
81
84
|
var options = filter.getIn(['column', 'options'], function () {
|
|
82
85
|
return [];
|
|
83
86
|
})(tableOptions, renderOptions);
|
|
84
|
-
|
|
85
87
|
var onChange = function onChange(value) {
|
|
86
88
|
var filterName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : name;
|
|
87
|
-
dispatch('SET_FILTER', {
|
|
89
|
+
(0, _store.dispatch)('SET_FILTER', {
|
|
88
90
|
tableKey: tableKey,
|
|
89
91
|
filter: filterName,
|
|
90
92
|
value: value
|
|
91
93
|
});
|
|
92
94
|
};
|
|
93
|
-
|
|
94
95
|
var Filter = columnComponents.getIn([name, 'Filter'], filterComponentByType(components, filter.getIn(['column', 'type'])));
|
|
95
|
-
return /*#__PURE__*/
|
|
96
|
+
return /*#__PURE__*/_react["default"].createElement(Filter, {
|
|
96
97
|
value: value,
|
|
97
98
|
name: name,
|
|
98
99
|
title: title,
|
|
@@ -103,15 +104,16 @@ var buildField = function buildField(_ref2) {
|
|
|
103
104
|
visible: true
|
|
104
105
|
});
|
|
105
106
|
};
|
|
106
|
-
|
|
107
107
|
var filtersToFields = function filtersToFields(components) {
|
|
108
|
-
return Map({
|
|
108
|
+
return (0, _immutable.Map)({
|
|
109
109
|
FormButtons: components.FilterFormButtons,
|
|
110
110
|
FormError: components.FilterFormError,
|
|
111
111
|
FormLayout: components.FilterFormLayout,
|
|
112
112
|
AttributesField: components.AttributesFilter,
|
|
113
113
|
CheckboxField: components.CheckboxFilter,
|
|
114
114
|
CodeField: components.CodeFilter,
|
|
115
|
+
DateField: components.DateFilter,
|
|
116
|
+
DatetimeField: components.DatetimeFilter,
|
|
115
117
|
FormField: components.FormFilter,
|
|
116
118
|
FormMultiField: components.FormMultiFilter,
|
|
117
119
|
PasswordField: components.PasswordFilter,
|
|
@@ -122,6 +124,7 @@ var filtersToFields = function filtersToFields(components) {
|
|
|
122
124
|
SelectMultiField: components.SelectMultiFilter,
|
|
123
125
|
TextField: components.TextFilter,
|
|
124
126
|
TextMultiField: components.TextMultiFilter,
|
|
127
|
+
TimeField: components.TimeFilter,
|
|
125
128
|
UserField: components.UserFilter,
|
|
126
129
|
UserMultiField: components.UserMultiFilter,
|
|
127
130
|
TableField: components.TableFilter
|
|
@@ -129,34 +132,33 @@ var filtersToFields = function filtersToFields(components) {
|
|
|
129
132
|
return !!c;
|
|
130
133
|
});
|
|
131
134
|
};
|
|
132
|
-
|
|
133
135
|
var buildFilterForm = function buildFilterForm(props) {
|
|
134
|
-
var FilterForm = props.components.FilterForm;
|
|
135
|
-
|
|
136
|
+
var FilterForm = props.components.FilterForm;
|
|
137
|
+
// Build the form filter components.
|
|
136
138
|
var components = filtersToFields(props.components);
|
|
137
|
-
return /*#__PURE__*/
|
|
139
|
+
return /*#__PURE__*/_react["default"].createElement(FilterForm, Object.assign({}, props.tableOptions, {
|
|
138
140
|
formKey: props.filterFormKey,
|
|
139
141
|
tableKey: props.tableKey,
|
|
140
142
|
components: components,
|
|
141
143
|
alterFields: props.alterFilters,
|
|
142
144
|
fieldSet: props.filterSet,
|
|
143
145
|
onSave: props.onSearch,
|
|
144
|
-
appliedFilters: props.appliedFilters
|
|
146
|
+
appliedFilters: props.appliedFilters,
|
|
147
|
+
autoFocus: props.filterAutoFocus
|
|
145
148
|
}));
|
|
146
149
|
};
|
|
147
|
-
|
|
148
150
|
var buildFilterLayout = function buildFilterLayout(_ref3) {
|
|
149
151
|
var components = _ref3.components,
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
152
|
+
columnComponents = _ref3.columnComponents,
|
|
153
|
+
filters = _ref3.filters,
|
|
154
|
+
appliedFilters = _ref3.appliedFilters,
|
|
155
|
+
validFilters = _ref3.validFilters,
|
|
156
|
+
tableKey = _ref3.tableKey,
|
|
157
|
+
columnSet = _ref3.columnSet,
|
|
158
|
+
loading = _ref3.loading,
|
|
159
|
+
initializing = _ref3.initializing,
|
|
160
|
+
tableOptions = _ref3.tableOptions,
|
|
161
|
+
renderOptions = _ref3.renderOptions;
|
|
160
162
|
// Add an onChange to each filter and convert it to a list for looping.
|
|
161
163
|
var f = filters.map(function (filter) {
|
|
162
164
|
return buildField({
|
|
@@ -170,44 +172,38 @@ var buildFilterLayout = function buildFilterLayout(_ref3) {
|
|
|
170
172
|
renderOptions: renderOptions
|
|
171
173
|
});
|
|
172
174
|
});
|
|
173
|
-
|
|
174
175
|
var onSearch = function onSearch(e) {
|
|
175
176
|
if (e) {
|
|
176
177
|
e.preventDefault();
|
|
177
178
|
}
|
|
178
|
-
|
|
179
|
-
dispatch('APPLY_FILTERS', {
|
|
179
|
+
(0, _store.dispatch)('APPLY_FILTERS', {
|
|
180
180
|
tableKey: tableKey
|
|
181
181
|
});
|
|
182
182
|
};
|
|
183
|
-
|
|
184
183
|
var onReset = function onReset(e) {
|
|
185
184
|
e.preventDefault();
|
|
186
|
-
dispatch('CLEAR_TABLE_FILTERS', {
|
|
185
|
+
(0, _store.dispatch)('CLEAR_TABLE_FILTERS', {
|
|
187
186
|
tableKey: tableKey
|
|
188
187
|
});
|
|
189
|
-
dispatch('APPLY_FILTERS', {
|
|
188
|
+
(0, _store.dispatch)('APPLY_FILTERS', {
|
|
190
189
|
tableKey: tableKey
|
|
191
190
|
});
|
|
192
191
|
};
|
|
193
|
-
|
|
194
192
|
var onClear = function onClear(e) {
|
|
195
193
|
e.preventDefault();
|
|
196
|
-
dispatch('CLEAR_SELECTED_FILTERS', {
|
|
194
|
+
(0, _store.dispatch)('CLEAR_SELECTED_FILTERS', {
|
|
197
195
|
tableKey: tableKey
|
|
198
196
|
});
|
|
199
197
|
};
|
|
200
|
-
|
|
201
198
|
var onChangeFilter = function onChangeFilter(value, filterName) {
|
|
202
|
-
dispatch('SET_FILTER', {
|
|
199
|
+
(0, _store.dispatch)('SET_FILTER', {
|
|
203
200
|
tableKey: tableKey,
|
|
204
201
|
filter: filterName,
|
|
205
202
|
value: value
|
|
206
203
|
});
|
|
207
204
|
};
|
|
208
|
-
|
|
209
205
|
var FilterLayout = components.FilterLayout;
|
|
210
|
-
return /*#__PURE__*/
|
|
206
|
+
return /*#__PURE__*/_react["default"].createElement(FilterLayout, {
|
|
211
207
|
filters: f,
|
|
212
208
|
appliedFilters: appliedFilters,
|
|
213
209
|
validFilters: validFilters,
|
|
@@ -223,25 +219,22 @@ var buildFilterLayout = function buildFilterLayout(_ref3) {
|
|
|
223
219
|
tableKey: tableKey
|
|
224
220
|
});
|
|
225
221
|
};
|
|
226
|
-
|
|
227
222
|
var hasPrevPage = function hasPrevPage(data, dataSource, tableOptions, pageTokens, pageOffset) {
|
|
228
|
-
return isClientSide(Map({
|
|
223
|
+
return (0, _Table.isClientSide)((0, _immutable.Map)({
|
|
229
224
|
data: data,
|
|
230
225
|
dataSource: dataSource,
|
|
231
226
|
tableOptions: tableOptions
|
|
232
227
|
})) ? pageOffset > 0 : pageTokens.size !== 0;
|
|
233
228
|
};
|
|
234
|
-
|
|
235
229
|
var hasNextPage = function hasNextPage(data, dataSource, tableOptions, pageOffset, pageSize, currentPageToken, rows) {
|
|
236
|
-
return isClientSide(Map({
|
|
230
|
+
return (0, _Table.isClientSide)((0, _immutable.Map)({
|
|
237
231
|
data: data,
|
|
238
232
|
dataSource: dataSource,
|
|
239
233
|
tableOptions: tableOptions
|
|
240
234
|
})) ? rows.size === pageSize ? data ? pageOffset + pageSize < data.size : false : !!currentPageToken : !!currentPageToken;
|
|
241
235
|
};
|
|
242
|
-
|
|
243
236
|
var getIndexes = function getIndexes(data, rows, dataSource, tableOptions, pageOffset, pageSize, pageTokens) {
|
|
244
|
-
return isClientSide(Map({
|
|
237
|
+
return (0, _Table.isClientSide)((0, _immutable.Map)({
|
|
245
238
|
data: data,
|
|
246
239
|
dataSource: dataSource,
|
|
247
240
|
tableOptions: tableOptions
|
|
@@ -253,32 +246,29 @@ var getIndexes = function getIndexes(data, rows, dataSource, tableOptions, pageO
|
|
|
253
246
|
endIndex: pageTokens.size * pageSize + rows.size
|
|
254
247
|
};
|
|
255
248
|
};
|
|
256
|
-
|
|
257
249
|
var buildPaginationControl = function buildPaginationControl(props) {
|
|
258
250
|
var tableKey = props.tableKey,
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
251
|
+
filterFormKey = props.filterFormKey,
|
|
252
|
+
data = props.data,
|
|
253
|
+
rows = props.rows,
|
|
254
|
+
dataSource = props.dataSource,
|
|
255
|
+
tableOptions = props.tableOptions,
|
|
256
|
+
pageTokens = props.pageTokens,
|
|
257
|
+
pageSize = props.pageSize,
|
|
258
|
+
pageOffset = props.pageOffset,
|
|
259
|
+
currentPageToken = props.currentPageToken,
|
|
260
|
+
count = props.count,
|
|
261
|
+
components = props.components,
|
|
262
|
+
loading = props.loading,
|
|
263
|
+
renderOptions = props.renderOptions,
|
|
264
|
+
extraData = props.extraData;
|
|
273
265
|
var PaginationControl = components.PaginationControl;
|
|
274
266
|
var prevPage = hasPrevPage(data, dataSource, tableOptions, pageTokens, pageOffset) ? onPrevPage(tableKey) : null;
|
|
275
267
|
var nextPage = hasNextPage(data, dataSource, tableOptions, pageOffset, pageSize, currentPageToken, rows) ? onNextPage(tableKey) : null;
|
|
276
|
-
|
|
277
268
|
var _getIndexes = getIndexes(data, rows, dataSource, tableOptions, pageOffset, pageSize, pageTokens),
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
return /*#__PURE__*/React.createElement(PaginationControl, {
|
|
269
|
+
startIndex = _getIndexes.startIndex,
|
|
270
|
+
endIndex = _getIndexes.endIndex;
|
|
271
|
+
return /*#__PURE__*/_react["default"].createElement(PaginationControl, {
|
|
282
272
|
tableKey: tableKey,
|
|
283
273
|
filterFormKey: filterFormKey,
|
|
284
274
|
prevPage: prevPage,
|
|
@@ -293,13 +283,12 @@ var buildPaginationControl = function buildPaginationControl(props) {
|
|
|
293
283
|
extraData: extraData
|
|
294
284
|
});
|
|
295
285
|
};
|
|
296
|
-
|
|
297
|
-
export var buildTable = function buildTable(props) {
|
|
286
|
+
var buildTable = function buildTable(props) {
|
|
298
287
|
var TableLayout = props.components.TableLayout;
|
|
299
288
|
var header = buildTableHeader(props);
|
|
300
289
|
var body = buildTableBody(props);
|
|
301
290
|
var footer = buildTableFooter(props);
|
|
302
|
-
return /*#__PURE__*/
|
|
291
|
+
return /*#__PURE__*/_react["default"].createElement(TableLayout, {
|
|
303
292
|
tableKey: props.tableKey,
|
|
304
293
|
filterFormKey: props.filterFormKey,
|
|
305
294
|
header: header,
|
|
@@ -314,10 +303,11 @@ export var buildTable = function buildTable(props) {
|
|
|
314
303
|
extraData: props.extraData
|
|
315
304
|
});
|
|
316
305
|
};
|
|
317
|
-
|
|
306
|
+
exports.buildTable = buildTable;
|
|
307
|
+
var buildTableHeader = function buildTableHeader(props) {
|
|
318
308
|
var Header = props.components.Header;
|
|
319
309
|
var headerRow = buildTableHeaderRow(props);
|
|
320
|
-
return props.omitHeader ? null : /*#__PURE__*/
|
|
310
|
+
return props.omitHeader ? null : /*#__PURE__*/_react["default"].createElement(Header, {
|
|
321
311
|
sortable: props.sortable,
|
|
322
312
|
headerRow: headerRow,
|
|
323
313
|
renderOptions: props.renderOptions,
|
|
@@ -325,34 +315,36 @@ export var buildTableHeader = function buildTableHeader(props) {
|
|
|
325
315
|
tableOptions: props.tableOptions
|
|
326
316
|
});
|
|
327
317
|
};
|
|
328
|
-
|
|
318
|
+
exports.buildTableHeader = buildTableHeader;
|
|
319
|
+
var buildTableHeaderRow = function buildTableHeaderRow(props) {
|
|
329
320
|
var components = props.components,
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
321
|
+
rows = props.rows,
|
|
322
|
+
columns = props.columns,
|
|
323
|
+
columnSet = props.columnSet;
|
|
333
324
|
var HeaderRow = components.HeaderRow;
|
|
334
325
|
var columnHeaders = fromColumnSet(columns, columnSet).map(buildTableHeaderCell(props));
|
|
335
|
-
return /*#__PURE__*/
|
|
326
|
+
return /*#__PURE__*/_react["default"].createElement(HeaderRow, {
|
|
336
327
|
columnHeaders: columnHeaders,
|
|
337
328
|
renderOptions: props.renderOptions,
|
|
338
329
|
rows: rows,
|
|
339
330
|
tableOptions: props.tableOptions
|
|
340
331
|
});
|
|
341
332
|
};
|
|
342
|
-
|
|
333
|
+
exports.buildTableHeaderRow = buildTableHeaderRow;
|
|
334
|
+
var buildTableHeaderCell = function buildTableHeaderCell(props) {
|
|
343
335
|
return function (column, index) {
|
|
344
336
|
var tableKey = props.tableKey,
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
337
|
+
components = props.components,
|
|
338
|
+
columnComponents = props.columnComponents,
|
|
339
|
+
renderOptions = props.renderOptions,
|
|
340
|
+
tableOptions = props.tableOptions,
|
|
341
|
+
appliedFilters = props.appliedFilters;
|
|
350
342
|
var HeaderCell = columnComponents.getIn([column.get('value'), 'HeaderCell'], components.HeaderCell);
|
|
351
343
|
var sorting = column === props.sortColumn && props.sortDirection;
|
|
352
344
|
var sortable = props.sortable && column.get('sortable');
|
|
353
|
-
return /*#__PURE__*/
|
|
345
|
+
return /*#__PURE__*/_react["default"].createElement(KeyWrapper, {
|
|
354
346
|
key: "column-".concat(index)
|
|
355
|
-
}, /*#__PURE__*/
|
|
347
|
+
}, /*#__PURE__*/_react["default"].createElement(HeaderCell, {
|
|
356
348
|
onSortColumn: onSortColumn(tableKey, column),
|
|
357
349
|
title: column.get('title'),
|
|
358
350
|
renderOptions: renderOptions,
|
|
@@ -363,10 +355,11 @@ export var buildTableHeaderCell = function buildTableHeaderCell(props) {
|
|
|
363
355
|
}));
|
|
364
356
|
};
|
|
365
357
|
};
|
|
366
|
-
|
|
358
|
+
exports.buildTableHeaderCell = buildTableHeaderCell;
|
|
359
|
+
var buildTableBody = function buildTableBody(props) {
|
|
367
360
|
var Body = props.components.Body;
|
|
368
361
|
var tableRows = buildTableBodyRows(props);
|
|
369
|
-
return /*#__PURE__*/
|
|
362
|
+
return /*#__PURE__*/_react["default"].createElement(Body, {
|
|
370
363
|
loading: props.loading,
|
|
371
364
|
initializing: props.initializing,
|
|
372
365
|
renderOptions: props.renderOptions,
|
|
@@ -376,21 +369,22 @@ export var buildTableBody = function buildTableBody(props) {
|
|
|
376
369
|
empty: props.rows.isEmpty()
|
|
377
370
|
});
|
|
378
371
|
};
|
|
379
|
-
|
|
372
|
+
exports.buildTableBody = buildTableBody;
|
|
373
|
+
var buildTableBodyRows = function buildTableBodyRows(props) {
|
|
380
374
|
var components = props.components,
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
375
|
+
rows = props.rows,
|
|
376
|
+
columns = props.columns,
|
|
377
|
+
columnSet = props.columnSet,
|
|
378
|
+
appliedFilters = props.appliedFilters,
|
|
379
|
+
renderOptions = props.renderOptions,
|
|
380
|
+
tableOptions = props.tableOptions;
|
|
387
381
|
var BodyRow = components.BodyRow;
|
|
388
382
|
var EmptyBodyRow = components.EmptyBodyRow;
|
|
389
383
|
return rows.size > 0 ? rows.map(function (row, index) {
|
|
390
384
|
var cells = buildTableBodyCells(props, row, index);
|
|
391
|
-
return /*#__PURE__*/
|
|
385
|
+
return /*#__PURE__*/_react["default"].createElement(KeyWrapper, {
|
|
392
386
|
key: "row-".concat(index)
|
|
393
|
-
}, /*#__PURE__*/
|
|
387
|
+
}, /*#__PURE__*/_react["default"].createElement(BodyRow, {
|
|
394
388
|
cells: cells,
|
|
395
389
|
columns: columns,
|
|
396
390
|
row: row,
|
|
@@ -398,7 +392,7 @@ export var buildTableBodyRows = function buildTableBodyRows(props) {
|
|
|
398
392
|
renderOptions: renderOptions,
|
|
399
393
|
tableOptions: tableOptions
|
|
400
394
|
}));
|
|
401
|
-
}) : /*#__PURE__*/
|
|
395
|
+
}) : /*#__PURE__*/_react["default"].createElement(EmptyBodyRow, {
|
|
402
396
|
colSpan: columnSet.size,
|
|
403
397
|
initializing: props.initializing,
|
|
404
398
|
loading: props.loading,
|
|
@@ -408,23 +402,24 @@ export var buildTableBodyRows = function buildTableBodyRows(props) {
|
|
|
408
402
|
error: props.error
|
|
409
403
|
});
|
|
410
404
|
};
|
|
411
|
-
|
|
405
|
+
exports.buildTableBodyRows = buildTableBodyRows;
|
|
406
|
+
var buildTableBodyCells = function buildTableBodyCells(props, row, rowIndex) {
|
|
412
407
|
var tableKey = props.tableKey,
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
408
|
+
components = props.components,
|
|
409
|
+
rows = props.rows,
|
|
410
|
+
columns = props.columns,
|
|
411
|
+
columnSet = props.columnSet,
|
|
412
|
+
columnComponents = props.columnComponents,
|
|
413
|
+
appliedFilters = props.appliedFilters,
|
|
414
|
+
renderOptions = props.renderOptions,
|
|
415
|
+
tableOptions = props.tableOptions,
|
|
416
|
+
extraData = props.extraData;
|
|
422
417
|
return fromColumnSet(columns, columnSet).map(function (column, index) {
|
|
423
418
|
var BodyCell = columnComponents.getIn([column.get('value'), 'BodyCell'], components.BodyCell);
|
|
424
419
|
var value = row.get(column.get('value'));
|
|
425
|
-
return /*#__PURE__*/
|
|
420
|
+
return /*#__PURE__*/_react["default"].createElement(KeyWrapper, {
|
|
426
421
|
key: "column-".concat(index)
|
|
427
|
-
}, /*#__PURE__*/
|
|
422
|
+
}, /*#__PURE__*/_react["default"].createElement(BodyCell, {
|
|
428
423
|
tableKey: tableKey,
|
|
429
424
|
row: row,
|
|
430
425
|
rowIndex: rowIndex,
|
|
@@ -439,16 +434,17 @@ export var buildTableBodyCells = function buildTableBodyCells(props, row, rowInd
|
|
|
439
434
|
}));
|
|
440
435
|
});
|
|
441
436
|
};
|
|
442
|
-
|
|
437
|
+
exports.buildTableBodyCells = buildTableBodyCells;
|
|
438
|
+
var buildTableFooter = function buildTableFooter(props) {
|
|
443
439
|
var components = props.components,
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
440
|
+
columnSet = props.columnSet,
|
|
441
|
+
renderOptions = props.renderOptions,
|
|
442
|
+
rows = props.rows,
|
|
443
|
+
tableOptions = props.tableOptions,
|
|
444
|
+
includeFooter = props.includeFooter;
|
|
449
445
|
var footerRow = buildTableFooterRow(props);
|
|
450
446
|
var Footer = components.Footer;
|
|
451
|
-
return includeFooter ? /*#__PURE__*/
|
|
447
|
+
return includeFooter ? /*#__PURE__*/_react["default"].createElement(Footer, {
|
|
452
448
|
rows: rows,
|
|
453
449
|
footerRow: footerRow,
|
|
454
450
|
colSpan: columnSet.size,
|
|
@@ -456,139 +452,137 @@ export var buildTableFooter = function buildTableFooter(props) {
|
|
|
456
452
|
tableOptions: tableOptions
|
|
457
453
|
}) : null;
|
|
458
454
|
};
|
|
459
|
-
|
|
455
|
+
exports.buildTableFooter = buildTableFooter;
|
|
456
|
+
var buildTableFooterRow = function buildTableFooterRow(props) {
|
|
460
457
|
var components = props.components,
|
|
461
|
-
|
|
462
|
-
|
|
458
|
+
renderOptions = props.renderOptions,
|
|
459
|
+
tableOptions = props.tableOptions;
|
|
463
460
|
var cells = buildTableFooterCells(props);
|
|
464
461
|
var FooterRow = components.FooterRow;
|
|
465
|
-
return /*#__PURE__*/
|
|
462
|
+
return /*#__PURE__*/_react["default"].createElement(FooterRow, {
|
|
466
463
|
cells: cells,
|
|
467
464
|
renderOptions: renderOptions,
|
|
468
465
|
tableOptions: tableOptions
|
|
469
466
|
});
|
|
470
467
|
};
|
|
471
|
-
|
|
468
|
+
exports.buildTableFooterRow = buildTableFooterRow;
|
|
469
|
+
var buildTableFooterCells = function buildTableFooterCells(props) {
|
|
472
470
|
var components = props.components,
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
471
|
+
columns = props.columns,
|
|
472
|
+
columnSet = props.columnSet,
|
|
473
|
+
columnComponents = props.columnComponents,
|
|
474
|
+
renderOptions = props.renderOptions,
|
|
475
|
+
tableOptions = props.tableOptions;
|
|
478
476
|
return fromColumnSet(columns, columnSet).map(function (column, index) {
|
|
479
477
|
var FooterCell = columnComponents.getIn([column.get('value'), 'FooterCell'], components.FooterCell);
|
|
480
|
-
return /*#__PURE__*/
|
|
478
|
+
return /*#__PURE__*/_react["default"].createElement(KeyWrapper, {
|
|
481
479
|
key: "column-".concat(index)
|
|
482
|
-
}, /*#__PURE__*/
|
|
480
|
+
}, /*#__PURE__*/_react["default"].createElement(FooterCell, {
|
|
483
481
|
column: column,
|
|
484
482
|
renderOptions: renderOptions,
|
|
485
483
|
tableOptions: tableOptions
|
|
486
484
|
}));
|
|
487
485
|
});
|
|
488
486
|
};
|
|
489
|
-
|
|
487
|
+
exports.buildTableFooterCells = buildTableFooterCells;
|
|
490
488
|
var onNextPage = function onNextPage(tableKey) {
|
|
491
489
|
return function () {
|
|
492
|
-
return dispatch('NEXT_PAGE', {
|
|
490
|
+
return (0, _store.dispatch)('NEXT_PAGE', {
|
|
493
491
|
tableKey: tableKey
|
|
494
492
|
});
|
|
495
493
|
};
|
|
496
494
|
};
|
|
497
|
-
|
|
498
495
|
var onPrevPage = function onPrevPage(tableKey) {
|
|
499
496
|
return function () {
|
|
500
|
-
return dispatch('PREV_PAGE', {
|
|
497
|
+
return (0, _store.dispatch)('PREV_PAGE', {
|
|
501
498
|
tableKey: tableKey
|
|
502
499
|
});
|
|
503
500
|
};
|
|
504
501
|
};
|
|
505
|
-
|
|
506
502
|
var onGotoPage = function onGotoPage(tableKey) {
|
|
507
503
|
return function (pageNumber) {
|
|
508
504
|
return function () {
|
|
509
|
-
return dispatch('GOTO_PAGE', {
|
|
505
|
+
return (0, _store.dispatch)('GOTO_PAGE', {
|
|
510
506
|
tableKey: tableKey,
|
|
511
507
|
pageNumber: pageNumber
|
|
512
508
|
});
|
|
513
509
|
};
|
|
514
510
|
};
|
|
515
511
|
};
|
|
516
|
-
|
|
517
512
|
var onSortColumn = function onSortColumn(tableKey, column) {
|
|
518
513
|
return function () {
|
|
519
|
-
return dispatch('SORT_COLUMN', {
|
|
514
|
+
return (0, _store.dispatch)('SORT_COLUMN', {
|
|
520
515
|
tableKey: tableKey,
|
|
521
516
|
column: column
|
|
522
517
|
});
|
|
523
518
|
};
|
|
524
519
|
};
|
|
525
|
-
|
|
526
520
|
var mapStateToProps = function mapStateToProps() {
|
|
527
521
|
return function (state, props) {
|
|
528
|
-
return state.getIn(['tables', props.tableKey], Map()).toObject();
|
|
522
|
+
return state.getIn(['tables', props.tableKey], (0, _immutable.Map)()).toObject();
|
|
529
523
|
};
|
|
530
524
|
};
|
|
525
|
+
|
|
531
526
|
/**
|
|
532
527
|
* @component
|
|
533
528
|
*/
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
var TableImpl = compose(connect(mapStateToProps), lifecycle({
|
|
529
|
+
var TableImpl = (0, _recompose.compose)((0, _store.connect)(mapStateToProps), (0, _recompose.lifecycle)({
|
|
537
530
|
componentDidMount: function componentDidMount() {
|
|
538
531
|
if (this.props.mounted && !this.props.configured) {
|
|
539
|
-
configureTable(this.props);
|
|
532
|
+
(0, _Table.configureTable)(this.props);
|
|
540
533
|
}
|
|
541
534
|
},
|
|
542
535
|
componentDidUpdate: function componentDidUpdate() {
|
|
543
536
|
if (this.props.mounted && !this.props.configured) {
|
|
544
|
-
configureTable(this.props);
|
|
537
|
+
(0, _Table.configureTable)(this.props);
|
|
545
538
|
}
|
|
546
539
|
}
|
|
547
540
|
}))(TableComponent);
|
|
548
|
-
|
|
541
|
+
var generateColumns = function generateColumns(columns) {
|
|
549
542
|
var addColumns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
550
543
|
var alterColumns = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
551
|
-
return List(addColumns).concat(columns).map(function (c) {
|
|
552
|
-
return Map(
|
|
544
|
+
return (0, _immutable.List)(addColumns).concat(columns).map(function (c) {
|
|
545
|
+
return (0, _immutable.Map)((0, _objectSpread2["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, c), alterColumns[c.value]), {}, {
|
|
553
546
|
value: c.value
|
|
554
547
|
}));
|
|
555
548
|
});
|
|
556
549
|
};
|
|
557
|
-
|
|
550
|
+
exports.generateColumns = generateColumns;
|
|
551
|
+
var extractColumnComponents = function extractColumnComponents(columns) {
|
|
558
552
|
return columns.filter(function (c) {
|
|
559
553
|
return c.has('components');
|
|
560
554
|
}).reduce(function (result, current) {
|
|
561
555
|
return result.set(current.get('value'), current.get('components'));
|
|
562
|
-
}, Map());
|
|
556
|
+
}, (0, _immutable.Map)());
|
|
563
557
|
};
|
|
564
|
-
|
|
558
|
+
exports.extractColumnComponents = extractColumnComponents;
|
|
559
|
+
var generateTable = function generateTable(_ref4) {
|
|
565
560
|
var _ref4$tableOptions = _ref4.tableOptions,
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
561
|
+
tableOptions = _ref4$tableOptions === void 0 ? [] : _ref4$tableOptions,
|
|
562
|
+
_ref4$filterDataSourc = _ref4.filterDataSources,
|
|
563
|
+
filterDataSources = _ref4$filterDataSourc === void 0 ? function () {
|
|
564
|
+
return {};
|
|
565
|
+
} : _ref4$filterDataSourc,
|
|
566
|
+
filters = _ref4.filters,
|
|
567
|
+
columns = _ref4.columns,
|
|
568
|
+
dataSource = _ref4.dataSource,
|
|
569
|
+
sortable = _ref4.sortable,
|
|
570
|
+
onValidateFilters = _ref4.onValidateFilters;
|
|
576
571
|
return function (props) {
|
|
577
572
|
var tableOptionProps = tableOptions ? tableOptions.reduce(function (to, opt) {
|
|
578
573
|
to[opt] = props[opt];
|
|
579
574
|
return to;
|
|
580
575
|
}, {}) : {};
|
|
581
576
|
var FilterForm;
|
|
582
|
-
|
|
583
577
|
if (filters) {
|
|
584
|
-
FilterForm = generateForm({
|
|
578
|
+
FilterForm = (0, _Form.generateForm)({
|
|
585
579
|
dataSources: filterDataSources,
|
|
586
580
|
fields: filters,
|
|
587
|
-
formOptions: ['tableKey'].concat(
|
|
581
|
+
formOptions: ['tableKey'].concat((0, _toConsumableArray2["default"])(tableOptions)),
|
|
588
582
|
handleSubmit: function handleSubmit(_ref5) {
|
|
589
583
|
var tableKey = _ref5.tableKey;
|
|
590
584
|
return function (values) {
|
|
591
|
-
dispatch('APPLY_FILTER_FORM', {
|
|
585
|
+
(0, _store.dispatch)('APPLY_FILTER_FORM', {
|
|
592
586
|
tableKey: tableKey,
|
|
593
587
|
appliedFilters: values
|
|
594
588
|
});
|
|
@@ -599,31 +593,31 @@ export var generateTable = function generateTable(_ref4) {
|
|
|
599
593
|
}
|
|
600
594
|
});
|
|
601
595
|
}
|
|
602
|
-
|
|
603
596
|
var setProps = {
|
|
604
597
|
// Passed in to `generateTable`
|
|
605
598
|
columns: columns,
|
|
606
599
|
dataSource: dataSource,
|
|
607
600
|
onValidateFilters: onValidateFilters,
|
|
608
601
|
// Calculated from props and tableOptions.
|
|
609
|
-
tableOptions:
|
|
602
|
+
tableOptions: (0, _objectSpread2["default"])({}, tableOptionProps),
|
|
610
603
|
// Add FilterForm to the components that are passed.
|
|
611
|
-
components:
|
|
604
|
+
components: (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, props.components), {}, {
|
|
612
605
|
FilterForm: FilterForm
|
|
613
606
|
}),
|
|
614
607
|
// Sortable can be enabled or disabled for an entire table.
|
|
615
608
|
sortable: typeof sortable !== 'undefined' ? sortable : props.sortable,
|
|
616
609
|
// Explicitly allowed props.
|
|
617
610
|
tableKey: props.tableKey,
|
|
618
|
-
filterFormKey: filterFormKey(props.tableKey),
|
|
611
|
+
filterFormKey: (0, _Table.filterFormKey)(props.tableKey),
|
|
619
612
|
addColumns: props.addColumns,
|
|
620
613
|
alterColumns: props.alterColumns,
|
|
621
|
-
alterFilters: mergeDeep(props.alterFilters || {}, Map(props.initialFilterValues).map(function (initialValue) {
|
|
614
|
+
alterFilters: (0, _immutable.mergeDeep)(props.alterFilters || {}, (0, _immutable.Map)(props.initialFilterValues).map(function (initialValue) {
|
|
622
615
|
return {
|
|
623
616
|
initialValue: initialValue
|
|
624
617
|
};
|
|
625
618
|
}).toObject()),
|
|
626
619
|
filterSet: props.filterSet,
|
|
620
|
+
filterAutoFocus: props.filterAutoFocus,
|
|
627
621
|
columnSet: props.columnSet,
|
|
628
622
|
pageSize: props.pageSize,
|
|
629
623
|
defaultSortColumn: props.defaultSortColumn,
|
|
@@ -640,63 +634,56 @@ export var generateTable = function generateTable(_ref4) {
|
|
|
640
634
|
onSearch: props.onSearch,
|
|
641
635
|
onFetch: props.onFetch
|
|
642
636
|
};
|
|
643
|
-
return /*#__PURE__*/
|
|
637
|
+
return /*#__PURE__*/_react["default"].createElement(Table, setProps, props.children);
|
|
644
638
|
};
|
|
645
639
|
};
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
var _super =
|
|
650
|
-
|
|
640
|
+
exports.generateTable = generateTable;
|
|
641
|
+
var Table = /*#__PURE__*/function (_Component) {
|
|
642
|
+
(0, _inherits2["default"])(Table, _Component);
|
|
643
|
+
var _super = (0, _createSuper2["default"])(Table);
|
|
651
644
|
function Table(props) {
|
|
652
645
|
var _this;
|
|
653
|
-
|
|
654
|
-
_classCallCheck(this, Table);
|
|
655
|
-
|
|
646
|
+
(0, _classCallCheck2["default"])(this, Table);
|
|
656
647
|
_this = _super.call(this, props);
|
|
657
|
-
|
|
658
648
|
var components = props.components,
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
649
|
+
tableKey = props.tableKey,
|
|
650
|
+
config = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
|
662
651
|
_this.components = components;
|
|
663
652
|
_this.config = config;
|
|
664
653
|
_this.auto = !tableKey || props.uncontrolled;
|
|
665
|
-
_this.tableKey = tableKey || generateKey();
|
|
654
|
+
_this.tableKey = tableKey || (0, _helpers.generateKey)();
|
|
666
655
|
return _this;
|
|
667
656
|
}
|
|
668
|
-
|
|
669
|
-
_createClass(Table, [{
|
|
657
|
+
(0, _createClass2["default"])(Table, [{
|
|
670
658
|
key: "componentDidMount",
|
|
671
659
|
value: function componentDidMount() {
|
|
672
660
|
if (this.auto) {
|
|
673
|
-
mountTable(this.tableKey);
|
|
661
|
+
(0, _Table.mountTable)(this.tableKey);
|
|
674
662
|
}
|
|
675
663
|
}
|
|
676
664
|
}, {
|
|
677
665
|
key: "componentWillUnmount",
|
|
678
666
|
value: function componentWillUnmount() {
|
|
679
667
|
if (this.auto) {
|
|
680
|
-
unmountTable(this.tableKey);
|
|
668
|
+
(0, _Table.unmountTable)(this.tableKey);
|
|
681
669
|
}
|
|
682
670
|
}
|
|
683
671
|
}, {
|
|
684
672
|
key: "render",
|
|
685
673
|
value: function render() {
|
|
686
674
|
var _this2 = this;
|
|
687
|
-
|
|
688
675
|
var columns = generateColumns(this.props.columns, this.props.addColumns, this.props.alterColumns);
|
|
689
676
|
var allColumns = columns.map(function (c) {
|
|
690
677
|
return c.get('value');
|
|
691
678
|
});
|
|
692
|
-
var columnSet = List(this.props.columnSet ? typeof this.props.columnSet === 'function' ? this.props.columnSet(allColumns) : this.props.columnSet : allColumns).filter(function (c) {
|
|
679
|
+
var columnSet = (0, _immutable.List)(this.props.columnSet ? typeof this.props.columnSet === 'function' ? this.props.columnSet(allColumns) : this.props.columnSet : allColumns).filter(function (c) {
|
|
693
680
|
return columns.find(function (c2) {
|
|
694
681
|
return c2.get('value') === c;
|
|
695
682
|
});
|
|
696
683
|
});
|
|
697
684
|
var columnComponents = extractColumnComponents(columns);
|
|
698
|
-
return /*#__PURE__*/
|
|
699
|
-
return /*#__PURE__*/
|
|
685
|
+
return /*#__PURE__*/_react["default"].createElement(_ComponentConfigContext.ComponentConfigContext.Consumer, null, function (componentConfig) {
|
|
686
|
+
return /*#__PURE__*/_react["default"].createElement(TableImpl, Object.assign({}, _this2.props, {
|
|
700
687
|
components: componentConfig.merge(_this2.props.components).toJS(),
|
|
701
688
|
columnComponents: columnComponents,
|
|
702
689
|
columns: columns,
|
|
@@ -707,12 +694,12 @@ export var Table = /*#__PURE__*/function (_Component) {
|
|
|
707
694
|
});
|
|
708
695
|
}
|
|
709
696
|
}]);
|
|
710
|
-
|
|
711
697
|
return Table;
|
|
712
|
-
}(Component);
|
|
698
|
+
}(_react.Component);
|
|
699
|
+
exports.Table = Table;
|
|
713
700
|
var defaultProps = {
|
|
714
701
|
components: {},
|
|
715
|
-
rows: List([]),
|
|
702
|
+
rows: (0, _immutable.List)([]),
|
|
716
703
|
columns: [],
|
|
717
704
|
addColumns: [],
|
|
718
705
|
alterColumns: {},
|
|
@@ -722,4 +709,4 @@ var defaultProps = {
|
|
|
722
709
|
includeFooter: false
|
|
723
710
|
};
|
|
724
711
|
Table.defaultProps = defaultProps;
|
|
725
|
-
Table.configure = configureTable;
|
|
712
|
+
Table.configure = _Table.configureTable;
|