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