@kineticdata/react 6.0.1 → 6.0.2
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/lib/apis/agent/adapters.js +2 -3
- package/lib/apis/agent/bridges.js +7 -13
- package/lib/apis/agent/handlers.js +7 -13
- package/lib/apis/core/activity.js +2 -3
- package/lib/apis/core/attributeDefinitions.js +6 -11
- package/lib/apis/core/attributeDefinitions.test.js +201 -213
- package/lib/apis/core/authentication.js +74 -84
- package/lib/apis/core/backgroundJobs.js +5 -9
- package/lib/apis/core/bridgeModelAttributeMappings.js +5 -10
- package/lib/apis/core/bridgeModelAttributes.js +6 -11
- package/lib/apis/core/bridgeModelMappings.js +5 -10
- package/lib/apis/core/bridgeModelQualificationMappings.js +5 -10
- package/lib/apis/core/bridgeModelQualifications.js +5 -10
- package/lib/apis/core/bridgeModels.js +7 -13
- package/lib/apis/core/bridgeModels.test.js +313 -333
- package/lib/apis/core/bridgedresources.js +7 -13
- package/lib/apis/core/categories.js +6 -11
- package/lib/apis/core/fileResources.js +5 -10
- package/lib/apis/core/filestores.js +5 -10
- package/lib/apis/core/formTypes.js +6 -11
- package/lib/apis/core/forms.js +6 -11
- package/lib/apis/core/forms.test.js +201 -213
- package/lib/apis/core/kapps.js +6 -11
- package/lib/apis/core/kapps.test.js +122 -130
- package/lib/apis/core/logs.js +3 -5
- package/lib/apis/core/memberships.js +3 -5
- package/lib/apis/core/meta.js +6 -11
- package/lib/apis/core/notices.js +2 -3
- package/lib/apis/core/oauthClients.js +6 -11
- package/lib/apis/core/platformComponents.js +10 -19
- package/lib/apis/core/platformItems.js +2 -3
- package/lib/apis/core/profile.js +3 -5
- package/lib/apis/core/securityPolicyDefinitions.js +6 -11
- package/lib/apis/core/securityPolicyDefinitions.test.js +254 -268
- package/lib/apis/core/space.js +3 -5
- package/lib/apis/core/space.test.js +106 -114
- package/lib/apis/core/submissions.js +17 -33
- package/lib/apis/core/teams.js +6 -11
- package/lib/apis/core/translations.js +18 -35
- package/lib/apis/core/translations.test.js +1343 -1437
- package/lib/apis/core/users.js +6 -11
- package/lib/apis/core/version.js +2 -3
- package/lib/apis/core/webApis.js +5 -10
- package/lib/apis/core/webhooks.js +6 -11
- package/lib/apis/core/webhooks.test.js +243 -257
- package/lib/apis/core/webhooksJobs.js +3 -5
- package/lib/apis/core/workflows.js +7 -13
- package/lib/apis/http.js +16 -31
- package/lib/apis/system/index.js +46 -91
- package/lib/apis/task/index.js +60 -119
- package/lib/components/agent/bridge/BridgeForm.js +1 -2
- package/lib/components/agent/bridge/BridgeTable.js +1 -2
- package/lib/components/agent/filestore/FilestoreForm.js +1 -2
- package/lib/components/agent/filestore/FilestoreTable.js +1 -2
- package/lib/components/agent/handler/AgentHandlerForm.js +1 -2
- package/lib/components/agent/handler/AgentHandlerTable.js +1 -2
- package/lib/components/common/AttributeSelect.js +2 -3
- package/lib/components/common/BridgeSelect.js +16 -17
- package/lib/components/common/ComponentConfigContext.js +1 -2
- package/lib/components/common/ContentEditable.js +23 -3
- package/lib/components/common/FormSelect.js +16 -17
- package/lib/components/common/NodeSelect.js +2 -3
- package/lib/components/common/Scroller.js +2 -3
- package/lib/components/common/StaticSelect.js +14 -15
- package/lib/components/common/TableInput.js +276 -63
- package/lib/components/common/TeamSelect.js +16 -17
- package/lib/components/common/ToastContainer.js +7 -12
- package/lib/components/common/Typeahead.js +15 -2
- package/lib/components/common/UserSelect.js +16 -17
- package/lib/components/common/authentication/AuthInterceptor.js +2 -3
- package/lib/components/common/authentication/AuthInterceptor.test.js +141 -153
- package/lib/components/common/authentication/AuthenticationContainer.js +332 -343
- package/lib/components/common/authentication/RequestInterceptor.js +2 -10
- package/lib/components/common/code_input/CodeInput.js +4 -9
- package/lib/components/common/code_input/draftHelpers.js +20 -37
- package/lib/components/common/code_input/languageHelpers.js +6 -12
- package/lib/components/common/code_input/languageHelpers.test.js +10 -8
- package/lib/components/common/defaults/Toast.js +1 -2
- package/lib/components/common/defaults/index.js +2 -3
- package/lib/components/core/attribute_definition/AttributeDefinitionForm.js +1 -2
- package/lib/components/core/attribute_definition/AttributeDefinitionTable.js +1 -2
- package/lib/components/core/bridge_model/BridgeModelForm.js +52 -55
- package/lib/components/core/bridge_model/BridgeModelTable.js +1 -2
- package/lib/components/core/bridge_model_attribute/BridgeModelAttributeForm.js +1 -2
- package/lib/components/core/bridge_model_attribute/BridgeModelAttributeTable.js +1 -2
- package/lib/components/core/bridge_model_qualification/BridgeModelQualificationForm.js +1 -2
- package/lib/components/core/bridge_model_qualification/BridgeModelQualificationTable.js +1 -2
- package/lib/components/core/category/CategoryForm.js +1 -2
- package/lib/components/core/category/CategoryTable.js +1 -2
- package/lib/components/core/core_form/CoreForm.js +11 -22
- package/lib/components/core/core_form/defaults/index.js +11 -19
- package/lib/components/core/core_form/globals.js +3 -5
- package/lib/components/core/field_definition/FieldDefinitionForm.js +1 -2
- package/lib/components/core/field_definition/FieldDefinitionTable.js +2 -4
- package/lib/components/core/file_resource/FileResourceForm.js +1 -2
- package/lib/components/core/file_resource/FileResourceTable.js +1 -2
- package/lib/components/core/form/FormForm.js +1 -2
- package/lib/components/core/form/FormTable.js +1 -2
- package/lib/components/core/form_type/FormTypeForm.js +1 -2
- package/lib/components/core/form_type/FormTypeTable.js +1 -2
- package/lib/components/core/i18n/I18n.js +2 -4
- package/lib/components/core/i18n/I18nContext.js +1 -2
- package/lib/components/core/i18n/I18nProvider.js +2 -3
- package/lib/components/core/i18n/Moment.js +10 -9
- package/lib/components/core/index_definition/IndexDefinitionForm.js +1 -2
- package/lib/components/core/index_definition/IndexDefinitionTable.js +1 -2
- package/lib/components/core/index_job/IndexJobTable.js +1 -2
- package/lib/components/core/kapp/KappForm.js +1 -2
- package/lib/components/core/kapp/KappTable.js +1 -2
- package/lib/components/core/log/LogTable.js +2 -4
- package/lib/components/core/oauth_client/OAuthClientForm.js +1 -2
- package/lib/components/core/oauth_client/OAuthClientTable.js +1 -2
- package/lib/components/core/platform_component/AgentComponentForm.js +1 -2
- package/lib/components/core/platform_component/AgentComponentTable.js +1 -2
- package/lib/components/core/platform_component/TaskComponentForm.js +1 -2
- package/lib/components/core/profile/ProfileForm.js +1 -2
- package/lib/components/core/security_definition/SecurityDefinitionForm.js +3 -6
- package/lib/components/core/security_definition/SecurityDefinitionTable.js +1 -2
- package/lib/components/core/space/SpaceForm.js +1 -2
- package/lib/components/core/submission/DatastoreSubmissionFilters.js +3 -5
- package/lib/components/core/submission/DatastoreSubmissionTable.js +2 -4
- package/lib/components/core/submission/FormSubmissionFilters.js +4 -7
- package/lib/components/core/submission/FormSubmissionTable.js +2 -4
- package/lib/components/core/submission/KappSubmissionTable.js +2 -4
- package/lib/components/core/submission/SubmissionForm.js +1 -2
- package/lib/components/core/submission/SubmissionTable.js +2 -3
- package/lib/components/core/submission/helpers.js +4 -7
- package/lib/components/core/team/TeamForm.js +1 -2
- package/lib/components/core/team/TeamTable.js +1 -2
- package/lib/components/core/translation/ContextForm.js +1 -2
- package/lib/components/core/translation/ContextTable.js +1 -2
- package/lib/components/core/translation/EntryForm.js +1 -2
- package/lib/components/core/translation/EntryTable.js +1 -2
- package/lib/components/core/translation/LocaleForm.js +1 -2
- package/lib/components/core/translation/LocaleTable.js +1 -2
- package/lib/components/core/user/UserForm.js +1 -2
- package/lib/components/core/user/UserTable.js +1 -2
- package/lib/components/core/webapi/WebApiForm.js +97 -101
- package/lib/components/core/webapi/WebApiTable.js +1 -2
- package/lib/components/core/webhook/WebhookForm.js +1 -2
- package/lib/components/core/webhook/WebhookTable.js +1 -2
- package/lib/components/core/webhook_job/WebhookJobTable.js +1 -2
- package/lib/components/form/Form.helpers.js +10 -19
- package/lib/components/form/Form.js +312 -355
- package/lib/components/form/Form.models.js +6 -11
- package/lib/components/form/FormState.js +1 -2
- package/lib/components/form/KitchenSinkForm.js +23 -3
- package/lib/components/form/SimpleForm.helpers.js +262 -0
- package/lib/components/form/SimpleForm.js +462 -0
- package/lib/components/form/SimpleForm.models.js +62 -0
- package/lib/components/form/defaults/AttributesField.js +3 -4
- package/lib/components/form/defaults/CheckboxField.js +2 -3
- package/lib/components/form/defaults/CodeField.js +2 -3
- package/lib/components/form/defaults/FormButtons.js +2 -3
- package/lib/components/form/defaults/FormError.js +2 -3
- package/lib/components/form/defaults/FormField.js +2 -3
- package/lib/components/form/defaults/FormLayout.js +2 -3
- package/lib/components/form/defaults/FormMultiField.js +2 -3
- package/lib/components/form/defaults/PasswordField.js +2 -3
- package/lib/components/form/defaults/RadioField.js +2 -3
- package/lib/components/form/defaults/SampleTeamsRolesFIeld.js +2 -3
- package/lib/components/form/defaults/SelectField.js +2 -3
- package/lib/components/form/defaults/SelectMultiField.js +2 -3
- package/lib/components/form/defaults/TableField.js +2 -3
- package/lib/components/form/defaults/TeamField.js +2 -3
- package/lib/components/form/defaults/TeamMultiField.js +2 -3
- package/lib/components/form/defaults/TextField.js +2 -3
- package/lib/components/form/defaults/TextMultiField.js +2 -3
- package/lib/components/form/defaults/UserField.js +2 -3
- package/lib/components/form/defaults/UserMultiField.js +2 -3
- package/lib/components/form/defaults/index.js +2 -3
- package/lib/components/form/tests/Form.test.js +3865 -4257
- package/lib/components/form/tests/components.js +2 -3
- package/lib/components/index.js +7 -0
- package/lib/components/system/SystemBackgroundTasksTable.js +1 -2
- package/lib/components/system/SystemCassandraForm.js +1 -2
- package/lib/components/system/SystemElasticSearchForm.js +1 -2
- package/lib/components/system/SystemFilestoreForm.js +2 -3
- package/lib/components/system/SystemForm.js +1 -2
- package/lib/components/system/SystemIngressForm.js +1 -2
- package/lib/components/system/SystemSecurityForm.js +1 -2
- package/lib/components/system/SystemSmtpForm.js +1 -2
- package/lib/components/system/SystemTaskAdapterForm.js +1 -2
- package/lib/components/system/SystemTrustedCertificateForm.js +1 -2
- package/lib/components/system/SystemTrustedCertificatesTable.js +1 -2
- package/lib/components/system/SystemUserForm.js +1 -2
- package/lib/components/system/helpers.js +11 -21
- package/lib/components/system/spaces/SystemSpaceForm.js +2 -3
- package/lib/components/system/spaces/SystemTenantForm.js +2 -3
- package/lib/components/system/spaces/SystemTenantTable.js +1 -2
- package/lib/components/table/Table.js +48 -51
- package/lib/components/table/Table.redux.js +161 -188
- package/lib/components/table/Table.test.js +115 -123
- package/lib/components/table/defaults/BodyCell.js +1 -2
- package/lib/components/table/defaults/BodyRow.js +1 -2
- package/lib/components/table/defaults/BooleanFilter.js +1 -2
- package/lib/components/table/defaults/ColumnControl.js +1 -2
- package/lib/components/table/defaults/EmptyBodyRow.js +1 -2
- package/lib/components/table/defaults/FilterLayout.js +1 -2
- package/lib/components/table/defaults/Footer.js +1 -2
- package/lib/components/table/defaults/FooterCell.js +1 -2
- package/lib/components/table/defaults/FooterRow.js +1 -2
- package/lib/components/table/defaults/Header.js +1 -2
- package/lib/components/table/defaults/HeaderCell.js +1 -2
- package/lib/components/table/defaults/HeaderRow.js +1 -2
- package/lib/components/table/defaults/PaginationControl.js +2 -4
- package/lib/components/table/defaults/TableBody.js +1 -2
- package/lib/components/table/defaults/TableLayout.js +1 -2
- package/lib/components/table/defaults/TextFilter.js +1 -2
- package/lib/components/table/defaults/index.js +2 -3
- package/lib/components/task/builder/Connector.js +26 -11
- package/lib/components/task/builder/ConnectorForm.js +1 -2
- package/lib/components/task/builder/Node.js +18 -9
- package/lib/components/task/builder/NodeForm.js +1 -2
- package/lib/components/task/builder/NodeParametersForm.js +1 -2
- package/lib/components/task/builder/SvgCanvas.js +2 -3
- package/lib/components/task/builder/SvgText.js +2 -3
- package/lib/components/task/builder/TaskDefinitionConfigForm.js +3 -6
- package/lib/components/task/builder/TreeBuilder.js +10 -4
- package/lib/components/task/builder/builder.redux.js +171 -182
- package/lib/components/task/builder/constants.js +38 -76
- package/lib/components/task/builder/helpers.js +23 -40
- package/lib/components/task/builder/models.js +19 -35
- package/lib/components/task/category/TaskCategoryForm.js +2 -3
- package/lib/components/task/category/TaskCategoryTable.js +1 -2
- package/lib/components/task/common/UsageTable.js +1 -2
- package/lib/components/task/engine/EngineSettingsForm.js +2 -3
- package/lib/components/task/errors/RunErrorTable.js +2 -3
- package/lib/components/task/errors/SystemErrorsTable.js +1 -2
- package/lib/components/task/handlers/HandlerForm.js +2 -3
- package/lib/components/task/handlers/HandlerTable.js +1 -2
- package/lib/components/task/handlers/MissingHandlerTable.js +1 -2
- package/lib/components/task/policy_rule/PolicyRuleForm.js +2 -3
- package/lib/components/task/policy_rule/PolicyRuleTable.js +1 -2
- package/lib/components/task/runs/CreateManualTriggerForm.js +1 -2
- package/lib/components/task/runs/RunTable.js +2 -3
- package/lib/components/task/runs/RunTaskTable.js +1 -2
- package/lib/components/task/sources/SourceForm.js +1 -2
- package/lib/components/task/sources/SourceTable.js +1 -2
- package/lib/components/task/triggers/TriggerTable.js +2 -3
- package/lib/components/task/workflows/LinkedWorkflowForm.js +3 -5
- package/lib/components/task/workflows/LinkedWorkflowTable.js +1 -2
- package/lib/components/task/workflows/MissingRoutineTable.js +1 -2
- package/lib/components/task/workflows/WorkflowForm.js +2 -3
- package/lib/components/task/workflows/WorkflowTable.js +1 -2
- package/lib/helpers/SearchBuilder.js +2 -4
- package/lib/helpers/index.js +13 -26
- package/lib/index.js +3 -6
- package/lib/reducer.js +3 -5
- package/lib/saga.js +32 -48
- package/lib/store.js +32 -42
- package/package.json +12 -15
- package/lib/components/core/CoreFormModal.js +0 -64
- package/lib/components/core/CoreModal.js +0 -114
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kineticdata/react",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.2",
|
|
4
4
|
"description": "A React library for the Kinetic Platform",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"files": [
|
|
@@ -19,35 +19,32 @@
|
|
|
19
19
|
"prepublishOnly": "yarn build"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"axios": "^
|
|
22
|
+
"axios": "^1.6.0",
|
|
23
23
|
"classnames": "^2.2.6",
|
|
24
24
|
"deepequal": "^0.0.1",
|
|
25
|
-
"draft-js": "^0.11.
|
|
25
|
+
"draft-js": "^0.11.7",
|
|
26
26
|
"history": "^4.9.0",
|
|
27
27
|
"immutable": "4.0.0-rc.9",
|
|
28
28
|
"kld-intersections": "^0.7.0",
|
|
29
|
-
"lodash": "^4.17.
|
|
30
|
-
"lodash-es": "^4.17.15",
|
|
29
|
+
"lodash-es": "^4.17.21",
|
|
31
30
|
"lodash.isplainobject": "^4.0.6",
|
|
32
31
|
"lodash.isstring": "^4.0.1",
|
|
33
32
|
"modularscale-sass": "^3.0.8",
|
|
34
33
|
"moment": "^2.29.4",
|
|
35
|
-
"prismjs": "1.
|
|
36
|
-
"prop-types": "^15.
|
|
34
|
+
"prismjs": "1.29.0",
|
|
35
|
+
"prop-types": "^15.8.1",
|
|
37
36
|
"react-autosuggest": "^9.4.3",
|
|
38
|
-
"react-markdown": "^4.0.6",
|
|
39
37
|
"react-popper": "^1.3.4",
|
|
40
|
-
"react-redux": "^
|
|
41
|
-
"reactstrap": "^
|
|
42
|
-
"
|
|
43
|
-
"redux": "^
|
|
44
|
-
"redux-saga": "^1.0.1"
|
|
38
|
+
"react-redux": "^8.1.3",
|
|
39
|
+
"reactstrap": "^9.2.0",
|
|
40
|
+
"redux": "^4.2.1",
|
|
41
|
+
"redux-saga": "^1.2.3"
|
|
45
42
|
},
|
|
46
43
|
"devDependencies": {
|
|
47
44
|
"jest-junit": "^12.0.0"
|
|
48
45
|
},
|
|
49
46
|
"peerDependencies": {
|
|
50
|
-
"react": "
|
|
47
|
+
"react": ">=17.0.2"
|
|
51
48
|
},
|
|
52
49
|
"author": "Kinetic Data, Inc",
|
|
53
50
|
"homepage": "https://kineticdata.github.io/react-kinetic-lib",
|
|
@@ -80,5 +77,5 @@
|
|
|
80
77
|
"classNameTemplate": "{classname}",
|
|
81
78
|
"titleTemplate": "{title}"
|
|
82
79
|
},
|
|
83
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "68e895f9bb49d039a9c79da64b39a6bbc2243cb2"
|
|
84
81
|
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.CoreFormModal = void 0;
|
|
9
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
|
|
10
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
|
|
11
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/assertThisInitialized"));
|
|
12
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
|
|
13
|
-
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createSuper"));
|
|
14
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
-
var _CoreForm = require("./CoreForm");
|
|
16
|
-
var _CoreModal = require("./CoreModal");
|
|
17
|
-
var MODAL_PROPS = ['dismissed', 'size'];
|
|
18
|
-
var FORM_PROPS = ['created', 'updated', 'completed', 'form', 'kapp', 'submission', 'review', 'error', 'unauthorized', 'forbidden', 'notFound'];
|
|
19
|
-
var CoreFormModal = /*#__PURE__*/function (_Component) {
|
|
20
|
-
(0, _inherits2["default"])(CoreFormModal, _Component);
|
|
21
|
-
var _super = (0, _createSuper2["default"])(CoreFormModal);
|
|
22
|
-
function CoreFormModal(props) {
|
|
23
|
-
var _this;
|
|
24
|
-
(0, _classCallCheck2["default"])(this, CoreFormModal);
|
|
25
|
-
_this = _super.call(this, props);
|
|
26
|
-
_this.state = {
|
|
27
|
-
visible: false,
|
|
28
|
-
title: ''
|
|
29
|
-
};
|
|
30
|
-
_this.modalProps = {};
|
|
31
|
-
MODAL_PROPS.forEach(function (prop) {
|
|
32
|
-
_this.modalProps[prop] = _this.props[prop];
|
|
33
|
-
});
|
|
34
|
-
_this.formProps = {};
|
|
35
|
-
FORM_PROPS.forEach(function (prop) {
|
|
36
|
-
_this.formProps[prop] = _this.props[prop];
|
|
37
|
-
});
|
|
38
|
-
_this.onFormLoaded = _this.onFormLoaded.bind((0, _assertThisInitialized2["default"])(_this));
|
|
39
|
-
return _this;
|
|
40
|
-
}
|
|
41
|
-
(0, _createClass2["default"])(CoreFormModal, [{
|
|
42
|
-
key: "onFormLoaded",
|
|
43
|
-
value: function onFormLoaded(form) {
|
|
44
|
-
this.setState({
|
|
45
|
-
visible: true,
|
|
46
|
-
title: form.name()
|
|
47
|
-
});
|
|
48
|
-
if (typeof this.props.loaded === 'function') {
|
|
49
|
-
this.props.loaded(form);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}, {
|
|
53
|
-
key: "render",
|
|
54
|
-
value: function render() {
|
|
55
|
-
return /*#__PURE__*/_react["default"].createElement(_CoreModal.CoreModal, Object.assign({}, this.modalProps, {
|
|
56
|
-
visible: this.state.visible
|
|
57
|
-
}), /*#__PURE__*/_react["default"].createElement(_CoreModal.CoreModalHeader, null, /*#__PURE__*/_react["default"].createElement("h1", null, this.state.title)), /*#__PURE__*/_react["default"].createElement(_CoreModal.CoreModalBody, null, /*#__PURE__*/_react["default"].createElement(_CoreForm.CoreForm, Object.assign({}, this.formProps, {
|
|
58
|
-
loaded: this.onFormLoaded
|
|
59
|
-
}))));
|
|
60
|
-
}
|
|
61
|
-
}]);
|
|
62
|
-
return CoreFormModal;
|
|
63
|
-
}(_react.Component);
|
|
64
|
-
exports.CoreFormModal = CoreFormModal;
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
4
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.CoreModalHeader = exports.CoreModalFooter = exports.CoreModalBody = exports.CoreModal = void 0;
|
|
9
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/classCallCheck"));
|
|
10
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createClass"));
|
|
11
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/assertThisInitialized"));
|
|
12
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/inherits"));
|
|
13
|
-
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/createSuper"));
|
|
14
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
-
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
16
|
-
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
17
|
-
|
|
18
|
-
var CoreModalHeader = function CoreModalHeader(props) {
|
|
19
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
20
|
-
className: "kd-modal-header"
|
|
21
|
-
}, props.children);
|
|
22
|
-
};
|
|
23
|
-
exports.CoreModalHeader = CoreModalHeader;
|
|
24
|
-
var CoreModalBody = function CoreModalBody(props) {
|
|
25
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
26
|
-
className: "kd-modal-body"
|
|
27
|
-
}, props.children);
|
|
28
|
-
};
|
|
29
|
-
exports.CoreModalBody = CoreModalBody;
|
|
30
|
-
var CoreModalFooter = function CoreModalFooter(props) {
|
|
31
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
32
|
-
className: "kd-modal-footer"
|
|
33
|
-
}, props.children);
|
|
34
|
-
};
|
|
35
|
-
exports.CoreModalFooter = CoreModalFooter;
|
|
36
|
-
var sizes = {
|
|
37
|
-
sm: '30%',
|
|
38
|
-
md: '50%',
|
|
39
|
-
lg: '80%'
|
|
40
|
-
};
|
|
41
|
-
var CoreModal = /*#__PURE__*/function (_Component) {
|
|
42
|
-
(0, _inherits2["default"])(CoreModal, _Component);
|
|
43
|
-
var _super = (0, _createSuper2["default"])(CoreModal);
|
|
44
|
-
function CoreModal(props) {
|
|
45
|
-
var _this;
|
|
46
|
-
(0, _classCallCheck2["default"])(this, CoreModal);
|
|
47
|
-
_this = _super.call(this, props);
|
|
48
|
-
_this.dismiss = _this.dismiss.bind((0, _assertThisInitialized2["default"])(_this));
|
|
49
|
-
_this.keyupHandler = _this.keyupHandler.bind((0, _assertThisInitialized2["default"])(_this));
|
|
50
|
-
return _this;
|
|
51
|
-
}
|
|
52
|
-
(0, _createClass2["default"])(CoreModal, [{
|
|
53
|
-
key: "componentDidMount",
|
|
54
|
-
value: function componentDidMount() {
|
|
55
|
-
this.modalTarget = document.createElement('div');
|
|
56
|
-
document.body.appendChild(this.modalTarget);
|
|
57
|
-
document.addEventListener('keyup', this.keyupHandler);
|
|
58
|
-
this.myRender();
|
|
59
|
-
}
|
|
60
|
-
}, {
|
|
61
|
-
key: "componentDidUpdate",
|
|
62
|
-
value: function componentDidUpdate() {
|
|
63
|
-
this.myRender();
|
|
64
|
-
}
|
|
65
|
-
}, {
|
|
66
|
-
key: "componentWillUnmount",
|
|
67
|
-
value: function componentWillUnmount() {
|
|
68
|
-
_reactDom["default"].unmountComponentAtNode(this.modalTarget);
|
|
69
|
-
document.body.removeChild(this.modalTarget);
|
|
70
|
-
document.removeEventListener('keyup', this.keyupHandler);
|
|
71
|
-
}
|
|
72
|
-
}, {
|
|
73
|
-
key: "dismiss",
|
|
74
|
-
value: function dismiss() {
|
|
75
|
-
if (typeof this.props.dismissed === 'function' && this.props.visible) {
|
|
76
|
-
this.props.dismissed();
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}, {
|
|
80
|
-
key: "keyupHandler",
|
|
81
|
-
value: function keyupHandler(event) {
|
|
82
|
-
// Call dismiss if the escape key was pressed.
|
|
83
|
-
if (event.keyCode === 27) {
|
|
84
|
-
this.dismiss();
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}, {
|
|
88
|
-
key: "myRender",
|
|
89
|
-
value: function myRender() {
|
|
90
|
-
_reactDom["default"].render( /*#__PURE__*/_react["default"].createElement("div", {
|
|
91
|
-
className: "kd-modal-backdrop",
|
|
92
|
-
onClick: this.dismiss,
|
|
93
|
-
style: this.props.visible ? {} : {
|
|
94
|
-
display: 'none'
|
|
95
|
-
}
|
|
96
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
97
|
-
className: "kd-modal-content",
|
|
98
|
-
onClick: function onClick(event) {
|
|
99
|
-
return event.stopPropagation();
|
|
100
|
-
},
|
|
101
|
-
style: {
|
|
102
|
-
width: sizes[this.props.size] || '80%'
|
|
103
|
-
}
|
|
104
|
-
}, this.props.children)), this.modalTarget);
|
|
105
|
-
}
|
|
106
|
-
}, {
|
|
107
|
-
key: "render",
|
|
108
|
-
value: function render() {
|
|
109
|
-
return /*#__PURE__*/_react["default"].createElement("noscript", null);
|
|
110
|
-
}
|
|
111
|
-
}]);
|
|
112
|
-
return CoreModal;
|
|
113
|
-
}(_react.Component);
|
|
114
|
-
exports.CoreModal = CoreModal;
|