@k-int/stripes-kint-components 2.2.0 → 2.3.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/CHANGELOG.md +29 -0
- package/es/index.js +125 -9
- package/es/lib/ActionList/ActionList.js +8 -33
- package/es/lib/ActionList/ActionListFieldArray.js +50 -49
- package/es/lib/ActionList/index.js +1 -5
- package/es/lib/CustomProperties/Config/CustomPropertiesLookup.js +1 -35
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +3 -39
- package/es/lib/CustomProperties/Config/CustomPropertyForm.js +1 -34
- package/es/lib/CustomProperties/Config/{CustomPropertiesView.js → CustomPropertyView.js} +4 -33
- package/es/lib/CustomProperties/Config/index.js +7 -9
- package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.js +43 -0
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +100 -0
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +243 -0
- package/es/lib/CustomProperties/Edit/CustomPropertyField.js +337 -0
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.js +127 -0
- package/es/lib/CustomProperties/Edit/index.js +47 -0
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +183 -0
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +204 -0
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +126 -0
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +90 -0
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +139 -0
- package/es/lib/CustomProperties/Filter/index.js +55 -0
- package/es/lib/CustomProperties/Filter/useOperators.js +100 -0
- package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +64 -0
- package/es/lib/CustomProperties/Filter/useValueProps.js +67 -0
- package/es/lib/CustomProperties/View/CustomPropertiesView.js +44 -0
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +155 -0
- package/es/lib/CustomProperties/View/CustomPropertyCard.js +175 -0
- package/es/lib/CustomProperties/View/index.js +31 -0
- package/es/lib/CustomProperties/index.js +121 -0
- package/es/lib/EditableRefdataList/EditableRefdataList.js +13 -51
- package/es/lib/EditableRefdataList/index.js +1 -5
- package/es/lib/EditableSettingsList/EditableSettingsList.js +1 -30
- package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.js +1 -30
- package/es/lib/EditableSettingsList/EditableSettingsListFieldArray.test.js +1 -30
- package/es/lib/EditableSettingsList/SettingField/EditSettingValue.js +1 -34
- package/es/lib/EditableSettingsList/SettingField/EditSettingValue.test.js +1 -34
- package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.js +1 -34
- package/es/lib/EditableSettingsList/SettingField/RenderSettingValue.test.js +1 -41
- package/es/lib/EditableSettingsList/SettingField/SettingField.js +1 -34
- package/es/lib/EditableSettingsList/SettingField/SettingField.test.js +1 -30
- package/es/lib/EditableSettingsList/SettingField/index.js +1 -5
- package/es/lib/EditableSettingsList/index.js +1 -5
- package/es/lib/FormModal/FormModal.js +21 -34
- package/es/lib/FormModal/index.js +1 -5
- package/es/lib/NoResultsMessage/NoResultsMessage.js +1 -30
- package/es/lib/NoResultsMessage/index.js +1 -5
- package/es/lib/QueryTypedown/QueryTypedown.js +9 -37
- package/es/lib/QueryTypedown/index.js +1 -5
- package/es/lib/RefdataButtons/RefdataButtons.js +1 -34
- package/es/lib/RefdataButtons/index.js +1 -5
- package/es/lib/SASQLookupComponent/SASQLookupComponent.js +1 -34
- package/es/lib/SASQLookupComponent/index.js +1 -5
- package/es/lib/SASQRoute/SASQRoute.js +1 -30
- package/es/lib/SASQRoute/index.js +1 -5
- package/es/lib/SASQViewComponent/SASQViewComponent.js +1 -34
- package/es/lib/SASQViewComponent/index.js +1 -5
- package/es/lib/SearchField/SearchField.js +1 -31
- package/es/lib/SearchField/index.js +1 -5
- package/es/lib/SettingPage/SettingPage.js +1 -34
- package/es/lib/SettingPage/SettingPagePane.js +1 -32
- package/es/lib/SettingPage/index.js +1 -5
- package/es/lib/Typedown/Typedown.js +1 -34
- package/es/lib/Typedown/index.js +1 -5
- package/es/lib/constants/customProperties.js +3 -37
- package/es/lib/constants/eventCodes.js +1 -31
- package/es/lib/contexts/SettingsContext.js +1 -30
- package/es/lib/contexts/index.js +1 -5
- package/es/lib/hooks/index.js +16 -4
- package/es/lib/hooks/settingsHooks/index.js +1 -5
- package/es/lib/hooks/settingsHooks/useSettingSection.js +1 -34
- package/es/lib/hooks/settingsHooks/useSettings.js +1 -36
- package/es/lib/hooks/typedownHooks/index.js +1 -5
- package/es/lib/hooks/typedownHooks/useTypedown.js +1 -34
- package/es/lib/hooks/typedownHooks/useTypedownData.js +9 -35
- package/es/lib/hooks/typedownHooks/useTypedownToggle.js +1 -34
- package/es/lib/hooks/useActiveElement.js +1 -32
- package/es/lib/hooks/useAvailableCustomProperties.js +73 -0
- package/es/lib/hooks/useCustomProperties.js +1 -34
- package/es/lib/hooks/useHelperApp.js +1 -34
- package/es/lib/hooks/useInvalidateRefdata.js +20 -0
- package/es/lib/hooks/useKiwtFieldArray.js +1 -34
- package/es/lib/hooks/useKiwtSASQuery.js +1 -35
- package/es/lib/hooks/useLocalStorageState.js +1 -34
- package/es/lib/hooks/useMutateCustomProperties.js +1 -34
- package/es/lib/hooks/useMutateRefdataValue.js +10 -38
- package/es/lib/hooks/useQIndex.js +1 -34
- package/es/lib/hooks/useRefdata.js +2 -37
- package/es/lib/hooks/useTemplates.js +1 -34
- package/es/lib/utils/buildUrl.js +2 -31
- package/es/lib/utils/generateKiwtQuery.js +1 -30
- package/es/lib/utils/generateKiwtQueryParams.js +1 -30
- package/es/lib/utils/groupCustomPropertiesByCtx.js +41 -0
- package/es/lib/utils/index.js +25 -5
- package/es/lib/utils/refdataOptions.js +1 -30
- package/es/lib/utils/refdataQueryKey.js +19 -0
- package/es/lib/utils/renderHelpText.js +1 -30
- package/es/lib/utils/selectorSafe.js +1 -30
- package/es/lib/utils/sortByLabel.js +1 -30
- package/es/lib/utils/toCamelCase.js +1 -30
- package/es/lib/utils/typedownQueryKey.js +19 -0
- package/es/lib/utils/validators.js +59 -31
- package/git_translate.sh +8 -0
- package/package.json +1 -1
- package/src/index.js +27 -3
- package/src/lib/ActionList/ActionList.js +5 -2
- package/src/lib/ActionList/ActionListFieldArray.js +31 -9
- package/src/lib/ActionList/README.md +23 -20
- package/src/lib/CustomProperties/Config/CustomPropertiesSettings.js +2 -2
- package/src/lib/CustomProperties/Config/{CustomPropertiesView.js → CustomPropertyView.js} +3 -3
- package/src/lib/CustomProperties/Config/index.js +1 -1
- package/src/lib/CustomProperties/Edit/CustomPropertiesEdit.js +35 -0
- package/src/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +85 -0
- package/src/lib/CustomProperties/Edit/CustomPropertiesListField.js +194 -0
- package/src/lib/CustomProperties/Edit/CustomPropertyField.js +299 -0
- package/src/lib/CustomProperties/Edit/CustomPropertyFormCard.js +131 -0
- package/src/lib/CustomProperties/Edit/index.js +5 -0
- package/src/lib/CustomProperties/Filter/CustomPropertiesFilter.js +125 -0
- package/src/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +148 -0
- package/src/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +113 -0
- package/src/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +74 -0
- package/src/lib/CustomProperties/Filter/CustomPropertiesRule.js +122 -0
- package/src/lib/CustomProperties/Filter/index.js +6 -0
- package/src/lib/CustomProperties/Filter/useOperators.js +55 -0
- package/src/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +35 -0
- package/src/lib/CustomProperties/Filter/useValueProps.js +45 -0
- package/src/lib/CustomProperties/View/CustomPropertiesView.js +36 -0
- package/src/lib/CustomProperties/View/CustomPropertiesViewCtx.js +112 -0
- package/src/lib/CustomProperties/View/CustomPropertyCard.js +177 -0
- package/src/lib/CustomProperties/View/index.js +3 -0
- package/src/lib/CustomProperties/index.js +30 -0
- package/src/lib/EditableRefdataList/EditableRefdataList.js +13 -10
- package/src/lib/FormModal/FormModal.js +39 -17
- package/src/lib/QueryTypedown/QueryTypedown.js +3 -1
- package/src/lib/constants/customProperties.js +1 -0
- package/src/lib/hooks/index.js +2 -0
- package/src/lib/hooks/typedownHooks/useTypedownData.js +9 -3
- package/src/lib/hooks/useAvailableCustomProperties.js +40 -0
- package/src/lib/hooks/useInvalidateRefdata.js +11 -0
- package/src/lib/hooks/useMutateRefdataValue.js +7 -3
- package/src/lib/hooks/useRefdata.js +2 -3
- package/src/lib/utils/groupCustomPropertiesByCtx.js +13 -0
- package/src/lib/utils/index.js +5 -0
- package/src/lib/utils/refdataQueryKey.js +9 -0
- package/src/lib/utils/typedownQueryKey.js +9 -0
- package/src/lib/utils/validators.js +40 -0
- package/translate.sh +63 -0
- package/translations/stripes-kint-components/ar.json +105 -0
- package/translations/stripes-kint-components/ca.json +1 -0
- package/translations/stripes-kint-components/cs_CZ.json +105 -0
- package/translations/stripes-kint-components/da.json +1 -0
- package/translations/stripes-kint-components/de.json +105 -0
- package/translations/stripes-kint-components/en.json +54 -2
- package/translations/stripes-kint-components/es.json +105 -0
- package/translations/stripes-kint-components/fr.json +105 -0
- package/translations/stripes-kint-components/he.json +1 -0
- package/translations/stripes-kint-components/hi_IN.json +105 -0
- package/translations/stripes-kint-components/hu.json +105 -0
- package/translations/stripes-kint-components/it_IT.json +105 -0
- package/translations/stripes-kint-components/ja.json +105 -0
- package/translations/stripes-kint-components/ko.json +105 -0
- package/translations/stripes-kint-components/nb.json +1 -0
- package/translations/stripes-kint-components/nn.json +1 -0
- package/translations/stripes-kint-components/pl.json +105 -0
- package/translations/stripes-kint-components/pt_PT.json +105 -0
- package/translations/stripes-kint-components/ru.json +105 -0
- package/translations/stripes-kint-components/sv.json +105 -0
- package/translations/stripes-kint-components/ur.json +1 -0
- package/translations/stripes-kint-components/zh_CN.json +105 -0
- package/es/artifacts/coverage-jest/lcov-report/block-navigation.js +0 -109
- package/es/artifacts/coverage-jest/lcov-report/prettify.js +0 -998
- package/es/artifacts/coverage-jest/lcov-report/sorter.js +0 -238
- package/junit.xml +0 -79
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionList.js.html +0 -286
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionListFieldArray.js.html +0 -925
- package/src/artifacts/coverage-jest/lcov-report/ActionList/index.html +0 -146
- package/src/artifacts/coverage-jest/lcov-report/ActionList/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesLookup.js.html +0 -418
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesSettings.js.html +0 -808
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesView.js.html +0 -601
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyForm.js.html +0 -1135
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.html +0 -176
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.js.html +0 -97
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/EditableRefdataList.js.html +0 -373
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsList.js.html +0 -223
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsListFieldArray.js.html +0 -211
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/EditSettingValue.js.html +0 -376
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/RenderSettingValue.js.html +0 -262
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/SettingField.js.html +0 -436
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.html +0 -161
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.js.html +0 -94
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.html +0 -146
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.js.html +0 -94
- package/src/artifacts/coverage-jest/lcov-report/FormModal/FormModal.js.html +0 -283
- package/src/artifacts/coverage-jest/lcov-report/FormModal/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/FormModal/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/NoResultsMessage.js.html +0 -319
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/QueryTypedown.js.html +0 -184
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/RefdataButtons.js.html +0 -370
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/SASQLookupComponent.js.html +0 -949
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/SASQRoute.js.html +0 -301
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/SASQViewComponent.js.html +0 -253
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/SearchField/SearchField.js.html +0 -214
- package/src/artifacts/coverage-jest/lcov-report/SearchField/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/SearchField/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPage.js.html +0 -211
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPagePane.js.html +0 -178
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.html +0 -146
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.js.html +0 -91
- package/src/artifacts/coverage-jest/lcov-report/Typedown/Typedown.js.html +0 -919
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.js.html +0 -88
- package/src/artifacts/coverage-jest/lcov-report/base.css +0 -224
- package/src/artifacts/coverage-jest/lcov-report/block-navigation.js +0 -87
- package/src/artifacts/coverage-jest/lcov-report/constants/customProperties.js.html +0 -112
- package/src/artifacts/coverage-jest/lcov-report/constants/eventCodes.js.html +0 -94
- package/src/artifacts/coverage-jest/lcov-report/constants/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/contexts/SettingsContext.js.html +0 -97
- package/src/artifacts/coverage-jest/lcov-report/contexts/index.html +0 -131
- package/src/artifacts/coverage-jest/lcov-report/contexts/index.js.html +0 -91
- package/src/artifacts/coverage-jest/lcov-report/favicon.png +0 -0
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.html +0 -281
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.js.html +0 -121
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.html +0 -146
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.js.html +0 -91
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettingSection.js.html +0 -163
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettings.js.html +0 -403
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.html +0 -161
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.js.html +0 -94
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedown.js.html +0 -520
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownData.js.html +0 -163
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownToggle.js.html +0 -163
- package/src/artifacts/coverage-jest/lcov-report/hooks/useActiveElement.js.html +0 -157
- package/src/artifacts/coverage-jest/lcov-report/hooks/useCustomProperties.js.html +0 -313
- package/src/artifacts/coverage-jest/lcov-report/hooks/useHelperApp.js.html +0 -283
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtFieldArray.js.html +0 -274
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtSASQuery.js.html +0 -178
- package/src/artifacts/coverage-jest/lcov-report/hooks/useLocalStorageState.js.html +0 -136
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateCustomProperties.js.html +0 -271
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataValue.js.html +0 -301
- package/src/artifacts/coverage-jest/lcov-report/hooks/useQIndex.js.html +0 -208
- package/src/artifacts/coverage-jest/lcov-report/hooks/useRefdata.js.html +0 -268
- package/src/artifacts/coverage-jest/lcov-report/hooks/useTemplates.js.html +0 -166
- package/src/artifacts/coverage-jest/lcov-report/index.html +0 -416
- package/src/artifacts/coverage-jest/lcov-report/prettify.css +0 -1
- package/src/artifacts/coverage-jest/lcov-report/prettify.js +0 -2
- package/src/artifacts/coverage-jest/lcov-report/sort-arrow-sprite.png +0 -0
- package/src/artifacts/coverage-jest/lcov-report/sorter.js +0 -196
- package/src/artifacts/coverage-jest/lcov-report/utils/buildUrl.js.html +0 -193
- package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQuery.js.html +0 -109
- package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQueryParams.js.html +0 -454
- package/src/artifacts/coverage-jest/lcov-report/utils/index.html +0 -251
- package/src/artifacts/coverage-jest/lcov-report/utils/index.js.html +0 -121
- package/src/artifacts/coverage-jest/lcov-report/utils/refdataOptions.js.html +0 -106
- package/src/artifacts/coverage-jest/lcov-report/utils/renderHelpText.js.html +0 -166
- package/src/artifacts/coverage-jest/lcov-report/utils/selectorSafe.js.html +0 -103
- package/src/artifacts/coverage-jest/lcov-report/utils/sortByLabel.js.html +0 -130
- package/src/artifacts/coverage-jest/lcov-report/utils/toCamelCase.js.html +0 -127
- package/src/artifacts/coverage-jest/lcov-report/utils/validators.js.html +0 -202
- package/src/artifacts/coverage-jest/lcov.info +0 -2562
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _reactIntl = require("react-intl");
|
|
13
|
+
|
|
14
|
+
var _reactFinalForm = require("react-final-form");
|
|
15
|
+
|
|
16
|
+
var _components = require("@folio/stripes/components");
|
|
17
|
+
|
|
18
|
+
var CUSTOM_PROPERTY_TYPES = _interopRequireWildcard(require("../../constants/customProperties"));
|
|
19
|
+
|
|
20
|
+
var _validators = require("../../utils/validators");
|
|
21
|
+
|
|
22
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
|
+
|
|
24
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
|
+
|
|
26
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
|
+
|
|
28
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
+
|
|
30
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
31
|
+
|
|
32
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
33
|
+
|
|
34
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
35
|
+
|
|
36
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
37
|
+
|
|
38
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
39
|
+
|
|
40
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
41
|
+
|
|
42
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
43
|
+
|
|
44
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
45
|
+
|
|
46
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
47
|
+
|
|
48
|
+
var CustomPropertyField = function CustomPropertyField(_ref) {
|
|
49
|
+
var availableCustomProperties = _ref.availableCustomProperties,
|
|
50
|
+
customProperty = _ref.customProperty,
|
|
51
|
+
customPropertyType = _ref.customPropertyType,
|
|
52
|
+
customProperties = _ref.customProperties,
|
|
53
|
+
index = _ref.index,
|
|
54
|
+
labelOverrides = _ref.labelOverrides,
|
|
55
|
+
name = _ref.name,
|
|
56
|
+
_onChange = _ref.onChange,
|
|
57
|
+
value = _ref.value,
|
|
58
|
+
setCustomProperties = _ref.setCustomProperties;
|
|
59
|
+
var intl = (0, _reactIntl.useIntl)();
|
|
60
|
+
|
|
61
|
+
var getCustomProperty = function getCustomProperty(customPropertyValue) {
|
|
62
|
+
return availableCustomProperties.find(function (cp) {
|
|
63
|
+
return cp.value === customPropertyValue;
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
var renderCustomPropertyName = function renderCustomPropertyName() {
|
|
68
|
+
var _customPropertyValue$, _labelOverrides$name;
|
|
69
|
+
|
|
70
|
+
var unsetCustomProperties = availableCustomProperties.filter(function (t) {
|
|
71
|
+
var _custPropValue$;
|
|
72
|
+
|
|
73
|
+
// Only optional properties can be set
|
|
74
|
+
if (t.primary) return false;
|
|
75
|
+
var custPropValue = value[t.value]; // The customProperty is unset and has no value.
|
|
76
|
+
|
|
77
|
+
if (custPropValue === undefined) return true; // The customProperty is set but is marked for deletion. Allow reuse.
|
|
78
|
+
|
|
79
|
+
if ((_custPropValue$ = custPropValue[0]) !== null && _custPropValue$ !== void 0 && _custPropValue$._delete) return true;
|
|
80
|
+
return false;
|
|
81
|
+
});
|
|
82
|
+
var customPropertyValue = value[customProperty.value];
|
|
83
|
+
var id = customPropertyValue === null || customPropertyValue === void 0 ? void 0 : (_customPropertyValue$ = customPropertyValue[0]) === null || _customPropertyValue$ === void 0 ? void 0 : _customPropertyValue$.id;
|
|
84
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Select, {
|
|
85
|
+
autoFocus: !id,
|
|
86
|
+
dataOptions: [customProperty].concat(_toConsumableArray(unsetCustomProperties)) // The selected customProperty, and the available unset customProperties
|
|
87
|
+
,
|
|
88
|
+
id: "edit-customproperty-".concat(index, "-name"),
|
|
89
|
+
label: (_labelOverrides$name = labelOverrides.name) !== null && _labelOverrides$name !== void 0 ? _labelOverrides$name : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
90
|
+
id: "stripes-kint-components.customProperty.name"
|
|
91
|
+
}),
|
|
92
|
+
onChange: function onChange(e) {
|
|
93
|
+
var _objectSpread2;
|
|
94
|
+
|
|
95
|
+
var newValue = e.target.value; // Update `state.customProperties` which controls what customProperties are being edited.
|
|
96
|
+
|
|
97
|
+
var newCustomProperties = _toConsumableArray(customProperties);
|
|
98
|
+
|
|
99
|
+
newCustomProperties[index] = getCustomProperty(newValue);
|
|
100
|
+
setCustomProperties(newCustomProperties); // Update final-form (which tracks what the values for a given customProperty are) because
|
|
101
|
+
// in essence we're deleting a customProperty and creating a new customProperty.
|
|
102
|
+
// We do this by 1) marking the current customProperty for deletion and 2) initing
|
|
103
|
+
// the new customProperty to an empty object.
|
|
104
|
+
|
|
105
|
+
var currentValue = value[customProperty.value] ? value[customProperty.value][0] : {};
|
|
106
|
+
|
|
107
|
+
_onChange(_objectSpread(_objectSpread({}, value), {}, (_objectSpread2 = {}, _defineProperty(_objectSpread2, customProperty.value, [{
|
|
108
|
+
id: currentValue.id,
|
|
109
|
+
_delete: true
|
|
110
|
+
}]), _defineProperty(_objectSpread2, newValue, [{}]), _objectSpread2)));
|
|
111
|
+
},
|
|
112
|
+
required: true,
|
|
113
|
+
value: customProperty.value
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
var renderCustomPropertyValue = function renderCustomPropertyValue() {
|
|
118
|
+
var _labelOverrides$value;
|
|
119
|
+
|
|
120
|
+
var currentValue = value[customProperty.value] ? value[customProperty.value][0] : {};
|
|
121
|
+
var min = Number.MIN_SAFE_INTEGER;
|
|
122
|
+
var max = Number.MAX_SAFE_INTEGER;
|
|
123
|
+
|
|
124
|
+
var handleChange = function handleChange(e) {
|
|
125
|
+
_onChange(_objectSpread(_objectSpread({}, value), {}, _defineProperty({}, customProperty.value, [_objectSpread(_objectSpread({}, currentValue), {}, {
|
|
126
|
+
_delete: e.target.value === '' ? true : undefined,
|
|
127
|
+
// Delete customProperty if removing the value.
|
|
128
|
+
value: customProperty.type === CUSTOM_PROPERTY_TYPES.INTEGER_CLASS_NAME || customProperty.type === CUSTOM_PROPERTY_TYPES.DECIMAL_CLASS_NAME ? parseFloat(e.target.value) : e.target.value // send down the number for integers and decimal types
|
|
129
|
+
|
|
130
|
+
})])));
|
|
131
|
+
}; // Figure out which component we're rendering and specify its unique props.
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
var fieldProps;
|
|
135
|
+
|
|
136
|
+
switch (customProperty.type) {
|
|
137
|
+
case CUSTOM_PROPERTY_TYPES.REFDATA_CLASS_NAME:
|
|
138
|
+
fieldProps = {
|
|
139
|
+
component: _components.Select,
|
|
140
|
+
dataOptions: customProperty.options,
|
|
141
|
+
format: function format(v) {
|
|
142
|
+
return v === null || v === void 0 ? void 0 : v.value;
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
break;
|
|
146
|
+
|
|
147
|
+
case CUSTOM_PROPERTY_TYPES.INTEGER_CLASS_NAME:
|
|
148
|
+
case CUSTOM_PROPERTY_TYPES.DECIMAL_CLASS_NAME:
|
|
149
|
+
fieldProps = {
|
|
150
|
+
badInput: intl.formatMessage({
|
|
151
|
+
id: 'stripes-kint-components.errors.customPropertyInvalidNumber'
|
|
152
|
+
}),
|
|
153
|
+
component: _components.TextField,
|
|
154
|
+
max: max,
|
|
155
|
+
min: min,
|
|
156
|
+
rangeOverflow: intl.formatMessage({
|
|
157
|
+
id: 'stripes-kint-components.errors.customPropertyDecimalValueNotInRange'
|
|
158
|
+
}, {
|
|
159
|
+
min: min,
|
|
160
|
+
max: max
|
|
161
|
+
}),
|
|
162
|
+
rangeUnderflow: intl.formatMessage({
|
|
163
|
+
id: 'stripes-kint-components.errors.customPropertyDecimalValueNotInRange'
|
|
164
|
+
}, {
|
|
165
|
+
min: min,
|
|
166
|
+
max: max
|
|
167
|
+
}),
|
|
168
|
+
step: 'any',
|
|
169
|
+
type: 'number'
|
|
170
|
+
};
|
|
171
|
+
break;
|
|
172
|
+
|
|
173
|
+
case CUSTOM_PROPERTY_TYPES.TEXT_CLASS_NAME:
|
|
174
|
+
fieldProps = {
|
|
175
|
+
component: _components.TextArea,
|
|
176
|
+
parse: function parse(v) {
|
|
177
|
+
return v;
|
|
178
|
+
} // Lets us send an empty string instead of `undefined`
|
|
179
|
+
|
|
180
|
+
};
|
|
181
|
+
break;
|
|
182
|
+
|
|
183
|
+
case CUSTOM_PROPERTY_TYPES.DATE_CLASS_NAME:
|
|
184
|
+
fieldProps = {
|
|
185
|
+
component: _components.Datepicker,
|
|
186
|
+
backendDateStandard: 'YYYY-MM-DD',
|
|
187
|
+
timeZone: 'UTC',
|
|
188
|
+
usePortal: true
|
|
189
|
+
};
|
|
190
|
+
break;
|
|
191
|
+
|
|
192
|
+
default:
|
|
193
|
+
fieldProps = {
|
|
194
|
+
component: _components.TextField
|
|
195
|
+
};
|
|
196
|
+
break;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, _objectSpread({
|
|
200
|
+
"data-test-customproperty-value": true,
|
|
201
|
+
id: "edit-customproperty-".concat(index, "-value"),
|
|
202
|
+
label: (_labelOverrides$value = labelOverrides.value) !== null && _labelOverrides$value !== void 0 ? _labelOverrides$value : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
203
|
+
id: "stripes-kint-components.customProperty.value"
|
|
204
|
+
}),
|
|
205
|
+
name: "".concat(name, ".").concat(customProperty.value, "[0].value"),
|
|
206
|
+
onChange: handleChange,
|
|
207
|
+
required: !customProperty.primary,
|
|
208
|
+
validate: function validate(fieldValue, allValues) {
|
|
209
|
+
return (0, _validators.customPropertyValidator)(fieldValue, allValues, customProperty);
|
|
210
|
+
},
|
|
211
|
+
valueMissing: intl.formatMessage({
|
|
212
|
+
id: 'stripes-core.label.missingRequiredField'
|
|
213
|
+
})
|
|
214
|
+
}, fieldProps));
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
var renderCustomPropertyVisibility = function renderCustomPropertyVisibility() {
|
|
218
|
+
var _value$customProperty, _value$customProperty2, _labelOverrides$visib, _customPropertyObject;
|
|
219
|
+
|
|
220
|
+
var customPropertyObject = (_value$customProperty = (_value$customProperty2 = value[customProperty.value]) === null || _value$customProperty2 === void 0 ? void 0 : _value$customProperty2[0]) !== null && _value$customProperty !== void 0 ? _value$customProperty : {};
|
|
221
|
+
|
|
222
|
+
var handleChange = function handleChange(e) {
|
|
223
|
+
_onChange(_objectSpread(_objectSpread({}, value), {}, _defineProperty({}, customProperty.value, [_objectSpread(_objectSpread({}, customPropertyObject), {}, {
|
|
224
|
+
internal: e.target.value
|
|
225
|
+
})])));
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Select, {
|
|
229
|
+
"data-test-customproperty-visibility": true,
|
|
230
|
+
dataOptions: [{
|
|
231
|
+
value: true,
|
|
232
|
+
label: intl.formatMessage({
|
|
233
|
+
id: 'stripes-kint-components.customProperty.internalTrue'
|
|
234
|
+
})
|
|
235
|
+
}, {
|
|
236
|
+
value: false,
|
|
237
|
+
label: intl.formatMessage({
|
|
238
|
+
id: 'stripes-kint-components.customProperty.internalFalse'
|
|
239
|
+
})
|
|
240
|
+
}],
|
|
241
|
+
id: "edit-customproperty-".concat(index, "-visibility"),
|
|
242
|
+
label: (_labelOverrides$visib = labelOverrides.visibility) !== null && _labelOverrides$visib !== void 0 ? _labelOverrides$visib : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
243
|
+
id: "stripes-kint-components.customProperty.visibility"
|
|
244
|
+
}),
|
|
245
|
+
onChange: handleChange,
|
|
246
|
+
value: (_customPropertyObject = customPropertyObject === null || customPropertyObject === void 0 ? void 0 : customPropertyObject.internal) !== null && _customPropertyObject !== void 0 ? _customPropertyObject : customProperty.defaultInternal
|
|
247
|
+
});
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
var renderCustomPropertyNoteInternal = function renderCustomPropertyNoteInternal() {
|
|
251
|
+
var _value$customProperty3, _value$customProperty4, _labelOverrides$inter;
|
|
252
|
+
|
|
253
|
+
var customPropertyObject = (_value$customProperty3 = (_value$customProperty4 = value[customProperty.value]) === null || _value$customProperty4 === void 0 ? void 0 : _value$customProperty4[0]) !== null && _value$customProperty3 !== void 0 ? _value$customProperty3 : {};
|
|
254
|
+
|
|
255
|
+
var handleChange = function handleChange(e) {
|
|
256
|
+
_onChange(_objectSpread(_objectSpread({}, value), {}, _defineProperty({}, customProperty.value, [_objectSpread(_objectSpread({}, customPropertyObject), {}, {
|
|
257
|
+
note: e.target.value
|
|
258
|
+
})])));
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextArea, {
|
|
262
|
+
"data-test-customproperty-note": true,
|
|
263
|
+
id: "edit-customproperty-".concat(index, "-internal-note"),
|
|
264
|
+
label: (_labelOverrides$inter = labelOverrides.internalNote) !== null && _labelOverrides$inter !== void 0 ? _labelOverrides$inter : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
265
|
+
id: "stripes-kint-components.customProperty.internalNote"
|
|
266
|
+
}),
|
|
267
|
+
onChange: handleChange,
|
|
268
|
+
value: customPropertyObject === null || customPropertyObject === void 0 ? void 0 : customPropertyObject.note
|
|
269
|
+
});
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
var renderCustomPropertyNotePublic = function renderCustomPropertyNotePublic() {
|
|
273
|
+
var _value$customProperty5, _value$customProperty6, _labelOverrides$publi;
|
|
274
|
+
|
|
275
|
+
var customPropertyObject = (_value$customProperty5 = (_value$customProperty6 = value[customProperty.value]) === null || _value$customProperty6 === void 0 ? void 0 : _value$customProperty6[0]) !== null && _value$customProperty5 !== void 0 ? _value$customProperty5 : {};
|
|
276
|
+
|
|
277
|
+
var handleChange = function handleChange(e) {
|
|
278
|
+
_onChange(_objectSpread(_objectSpread({}, value), {}, _defineProperty({}, customProperty.value, [_objectSpread(_objectSpread({}, customPropertyObject), {}, {
|
|
279
|
+
publicNote: e.target.value
|
|
280
|
+
})])));
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextArea, {
|
|
284
|
+
"data-test-customproperty-public-note": true,
|
|
285
|
+
id: "edit-customproperty-".concat(index, "-public-note"),
|
|
286
|
+
label: (_labelOverrides$publi = labelOverrides.publicNote) !== null && _labelOverrides$publi !== void 0 ? _labelOverrides$publi : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
287
|
+
id: "stripes-kint-components.customProperty.publicNote"
|
|
288
|
+
}),
|
|
289
|
+
onChange: handleChange,
|
|
290
|
+
value: customPropertyObject === null || customPropertyObject === void 0 ? void 0 : customPropertyObject.publicNote
|
|
291
|
+
});
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
295
|
+
children: [customPropertyType === 'optional' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Row, {
|
|
296
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
297
|
+
xs: 12,
|
|
298
|
+
children: renderCustomPropertyName()
|
|
299
|
+
})
|
|
300
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Row, {
|
|
301
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
302
|
+
md: 6,
|
|
303
|
+
xs: 12,
|
|
304
|
+
children: renderCustomPropertyValue()
|
|
305
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
306
|
+
md: 6,
|
|
307
|
+
xs: 12,
|
|
308
|
+
children: renderCustomPropertyNoteInternal()
|
|
309
|
+
})]
|
|
310
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Row, {
|
|
311
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
312
|
+
md: 6,
|
|
313
|
+
xs: 12,
|
|
314
|
+
children: renderCustomPropertyVisibility()
|
|
315
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
316
|
+
md: 6,
|
|
317
|
+
xs: 12,
|
|
318
|
+
children: renderCustomPropertyNotePublic()
|
|
319
|
+
})]
|
|
320
|
+
})]
|
|
321
|
+
});
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
CustomPropertyField.propTypes = {
|
|
325
|
+
availableCustomProperties: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
326
|
+
customProperty: _propTypes.default.object,
|
|
327
|
+
customPropertyType: _propTypes.default.string,
|
|
328
|
+
customProperties: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
329
|
+
index: _propTypes.default.number,
|
|
330
|
+
labelOverrides: _propTypes.default.object,
|
|
331
|
+
name: _propTypes.default.string,
|
|
332
|
+
onChange: _propTypes.default.func,
|
|
333
|
+
setCustomProperties: _propTypes.default.func,
|
|
334
|
+
value: _propTypes.default.object
|
|
335
|
+
};
|
|
336
|
+
var _default = CustomPropertyField;
|
|
337
|
+
exports.default = _default;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
|
|
10
|
+
var _reactIntl = require("react-intl");
|
|
11
|
+
|
|
12
|
+
var _components = require("@folio/stripes/components");
|
|
13
|
+
|
|
14
|
+
var _CustomPropertyField = _interopRequireDefault(require("./CustomPropertyField"));
|
|
15
|
+
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
var CustomPropertyFormCard = function CustomPropertyFormCard(_ref) {
|
|
21
|
+
var availableCustomProperties = _ref.availableCustomProperties,
|
|
22
|
+
customProperty = _ref.customProperty,
|
|
23
|
+
customPropertyType = _ref.customPropertyType,
|
|
24
|
+
customProperties = _ref.customProperties,
|
|
25
|
+
handleDeleteCustomProperty = _ref.handleDeleteCustomProperty,
|
|
26
|
+
index = _ref.index,
|
|
27
|
+
internalPropertyCounter = _ref.internalPropertyCounter,
|
|
28
|
+
labelOverrides = _ref.labelOverrides,
|
|
29
|
+
name = _ref.name,
|
|
30
|
+
onChange = _ref.onChange,
|
|
31
|
+
setCustomProperties = _ref.setCustomProperties,
|
|
32
|
+
value = _ref.value;
|
|
33
|
+
|
|
34
|
+
var getHeader = function getHeader() {
|
|
35
|
+
var _labelOverrides$prima;
|
|
36
|
+
|
|
37
|
+
if (customPropertyType === 'optional') {
|
|
38
|
+
var _labelOverrides$optio;
|
|
39
|
+
|
|
40
|
+
if (labelOverrides.optionalPropertyHeader && typeof labelOverrides.optionalPropertyHeader === 'function') {
|
|
41
|
+
return labelOverrides.optionalPropertyHeader(internalPropertyCounter);
|
|
42
|
+
} // Label override for optionalPropertyHeader or finally built in default
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
return (_labelOverrides$optio = labelOverrides.optionalPropertyHeader) !== null && _labelOverrides$optio !== void 0 ? _labelOverrides$optio : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
46
|
+
id: "stripes-kint-components.customProperty.optionalPropertyHeader",
|
|
47
|
+
values: {
|
|
48
|
+
number: internalPropertyCounter
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
} // Label override for primaryPropertyHeader or finally built in default
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
return (_labelOverrides$prima = labelOverrides.primaryPropertyHeader) !== null && _labelOverrides$prima !== void 0 ? _labelOverrides$prima : customProperty.label;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
var getTooltipText = function getTooltipText() {
|
|
58
|
+
var _labelOverrides$remov;
|
|
59
|
+
|
|
60
|
+
if (labelOverrides.remove && typeof labelOverrides.remove === 'function') {
|
|
61
|
+
return labelOverrides.remove(internalPropertyCounter);
|
|
62
|
+
} // Label override for optionalPropertyHeader or finally built in default
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
return (_labelOverrides$remov = labelOverrides.remove) !== null && _labelOverrides$remov !== void 0 ? _labelOverrides$remov : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
66
|
+
id: "stripes-kint-components.customProperty.remove",
|
|
67
|
+
values: {
|
|
68
|
+
number: internalPropertyCounter
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Card, {
|
|
74
|
+
headerEnd: customPropertyType === 'optional' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Tooltip, {
|
|
75
|
+
id: "customProperty-".concat(customProperty.value, "-").concat(index),
|
|
76
|
+
text: getTooltipText(),
|
|
77
|
+
children: function children(_ref2) {
|
|
78
|
+
var ref = _ref2.ref,
|
|
79
|
+
ariaIds = _ref2.ariaIds;
|
|
80
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.IconButton, {
|
|
81
|
+
ref: ref,
|
|
82
|
+
"aria-labelledby": ariaIds.text,
|
|
83
|
+
icon: "trash",
|
|
84
|
+
id: "edit-customproperty-".concat(index, "-delete"),
|
|
85
|
+
onClick: function onClick() {
|
|
86
|
+
return handleDeleteCustomProperty(customProperty, index);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}) : null,
|
|
91
|
+
headerStart: /*#__PURE__*/(0, _jsxRuntime.jsxs)("strong", {
|
|
92
|
+
children: [getHeader(), customProperty.description ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.InfoPopover, {
|
|
93
|
+
content: customProperty.description
|
|
94
|
+
}) : null]
|
|
95
|
+
}),
|
|
96
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertyField.default, {
|
|
97
|
+
availableCustomProperties: availableCustomProperties,
|
|
98
|
+
customProperty: customProperty,
|
|
99
|
+
customPropertyType: customPropertyType,
|
|
100
|
+
customProperties: customProperties,
|
|
101
|
+
index: index,
|
|
102
|
+
internalPropertyCounter: internalPropertyCounter,
|
|
103
|
+
labelOverrides: labelOverrides,
|
|
104
|
+
name: name,
|
|
105
|
+
onChange: onChange,
|
|
106
|
+
setCustomProperties: setCustomProperties,
|
|
107
|
+
value: value
|
|
108
|
+
})
|
|
109
|
+
}, customProperty.value);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
CustomPropertyFormCard.propTypes = {
|
|
113
|
+
availableCustomProperties: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
114
|
+
customProperty: _propTypes.default.object,
|
|
115
|
+
customPropertyType: _propTypes.default.string,
|
|
116
|
+
customProperties: _propTypes.default.arrayOf(_propTypes.default.object),
|
|
117
|
+
handleDeleteCustomProperty: _propTypes.default.func,
|
|
118
|
+
index: _propTypes.default.number,
|
|
119
|
+
internalPropertyCounter: _propTypes.default.number,
|
|
120
|
+
labelOverrides: _propTypes.default.object,
|
|
121
|
+
name: _propTypes.default.string,
|
|
122
|
+
onChange: _propTypes.default.func,
|
|
123
|
+
setCustomProperties: _propTypes.default.func,
|
|
124
|
+
value: _propTypes.default.object
|
|
125
|
+
};
|
|
126
|
+
var _default = CustomPropertyFormCard;
|
|
127
|
+
exports.default = _default;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "CustomPropertiesEdit", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _CustomPropertiesEdit.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "CustomPropertiesEditCtx", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _CustomPropertiesEditCtx.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "CustomPropertiesListField", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _CustomPropertiesListField.default;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "CustomPropertyField", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function get() {
|
|
27
|
+
return _CustomPropertyField.default;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "CustomPropertyFormCard", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function get() {
|
|
33
|
+
return _CustomPropertyFormCard.default;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
var _CustomPropertiesEdit = _interopRequireDefault(require("./CustomPropertiesEdit"));
|
|
38
|
+
|
|
39
|
+
var _CustomPropertiesEditCtx = _interopRequireDefault(require("./CustomPropertiesEditCtx"));
|
|
40
|
+
|
|
41
|
+
var _CustomPropertiesListField = _interopRequireDefault(require("./CustomPropertiesListField"));
|
|
42
|
+
|
|
43
|
+
var _CustomPropertyFormCard = _interopRequireDefault(require("./CustomPropertyFormCard"));
|
|
44
|
+
|
|
45
|
+
var _CustomPropertyField = _interopRequireDefault(require("./CustomPropertyField"));
|
|
46
|
+
|
|
47
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|