@k-int/stripes-kint-components 2.1.2 → 2.3.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/CHANGELOG.md +26 -4
- package/es/index.js +150 -4
- package/es/lib/ActionList/ActionList.js +10 -2
- package/es/lib/ActionList/ActionListFieldArray.js +53 -11
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +3 -2
- package/es/lib/CustomProperties/Config/CustomPropertyForm.js +88 -44
- package/es/lib/CustomProperties/Config/{CustomPropertiesView.js → CustomPropertyView.js} +27 -14
- package/es/lib/CustomProperties/Config/index.js +6 -4
- package/es/lib/CustomProperties/Edit/CustomPropertiesEdit.js +72 -0
- package/es/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js +133 -0
- package/es/lib/CustomProperties/Edit/CustomPropertiesListField.js +279 -0
- package/es/lib/CustomProperties/Edit/CustomPropertyField.js +370 -0
- package/es/lib/CustomProperties/Edit/CustomPropertyFormCard.js +156 -0
- package/es/lib/CustomProperties/Edit/index.js +51 -0
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilter.js +216 -0
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterField.js +236 -0
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterFieldArray.js +159 -0
- package/es/lib/CustomProperties/Filter/CustomPropertiesFilterForm.js +119 -0
- package/es/lib/CustomProperties/Filter/CustomPropertiesRule.js +173 -0
- package/es/lib/CustomProperties/Filter/index.js +59 -0
- package/es/lib/CustomProperties/Filter/useOperators.js +138 -0
- package/es/lib/CustomProperties/Filter/useParseActiveFilterStrings.js +97 -0
- package/es/lib/CustomProperties/Filter/useValueProps.js +101 -0
- package/es/lib/CustomProperties/View/CustomPropertiesView.js +73 -0
- package/es/lib/CustomProperties/View/CustomPropertiesViewCtx.js +187 -0
- package/es/lib/CustomProperties/View/CustomPropertyCard.js +204 -0
- package/es/lib/CustomProperties/View/index.js +35 -0
- package/es/lib/CustomProperties/index.js +125 -0
- package/es/lib/EditableRefdataList/EditableRefdataList.js +12 -16
- package/es/lib/FormModal/FormModal.js +20 -11
- package/es/lib/QueryTypedown/QueryTypedown.js +9 -4
- package/es/lib/constants/customProperties.js +4 -1
- package/es/lib/hooks/index.js +16 -0
- package/es/lib/hooks/typedownHooks/useTypedownData.js +9 -2
- package/es/lib/hooks/useAvailableCustomProperties.js +106 -0
- package/es/lib/hooks/useInvalidateRefdata.js +53 -0
- package/es/lib/hooks/useMutateRefdataValue.js +11 -6
- package/es/lib/hooks/useRefdata.js +1 -3
- package/es/lib/utils/groupCustomPropertiesByCtx.js +69 -0
- package/es/lib/utils/index.js +24 -0
- package/es/lib/utils/refdataQueryKey.js +48 -0
- package/es/lib/utils/typedownQueryKey.js +48 -0
- package/es/lib/utils/validators.js +160 -0
- package/git_translate.sh +8 -0
- package/junit.xml +38 -38
- package/package.json +1 -1
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionList.js.html +11 -2
- package/src/artifacts/coverage-jest/lcov-report/ActionList/ActionListFieldArray.js.html +25 -13
- package/src/artifacts/coverage-jest/lcov-report/ActionList/index.html +3 -3
- package/src/artifacts/coverage-jest/lcov-report/ActionList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesLookup.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesSettings.js.html +5 -2
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertiesView.js.html +75 -9
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/CustomPropertyForm.js.html +195 -33
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.html +10 -10
- package/src/artifacts/coverage-jest/lcov-report/CustomProperties/Config/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/EditableRefdataList.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableRefdataList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsList.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/EditableSettingsListFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/EditSettingValue.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/RenderSettingValue.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/SettingField.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/SettingField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/EditableSettingsList/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/FormModal/FormModal.js.html +7 -22
- package/src/artifacts/coverage-jest/lcov-report/FormModal/index.html +7 -7
- package/src/artifacts/coverage-jest/lcov-report/FormModal/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/NoResultsMessage.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/NoResultsMessage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/QueryTypedown.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/QueryTypedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/RefdataButtons.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/RefdataButtons/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/SASQLookupComponent.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQLookupComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/SASQRoute.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQRoute/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/SASQViewComponent.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SASQViewComponent/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SearchField/SearchField.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SearchField/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SearchField/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPage.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/SettingPagePane.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/SettingPage/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/Typedown/Typedown.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/Typedown/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/constants/customProperties.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/constants/eventCodes.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/constants/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/contexts/SettingsContext.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/contexts/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/contexts/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettingSection.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/settingsHooks/useSettings.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedown.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownData.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/typedownHooks/useTypedownToggle.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useActiveElement.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useCustomProperties.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useHelperApp.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtFieldArray.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useKiwtSASQuery.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useLocalStorageState.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateCustomProperties.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useMutateRefdataValue.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useQIndex.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useRefdata.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/hooks/useTemplates.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/index.html +27 -27
- package/src/artifacts/coverage-jest/lcov-report/utils/buildUrl.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQuery.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/generateKiwtQueryParams.js.html +16 -10
- package/src/artifacts/coverage-jest/lcov-report/utils/index.html +24 -9
- package/src/artifacts/coverage-jest/lcov-report/utils/index.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/refdataOptions.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/renderHelpText.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/selectorSafe.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/sortByLabel.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/toCamelCase.js.html +1 -1
- package/src/artifacts/coverage-jest/lcov-report/utils/validators.js.html +202 -0
- package/src/artifacts/coverage-jest/lcov.info +366 -296
- package/src/index.js +35 -3
- package/src/lib/ActionList/ActionList.js +8 -2
- package/src/lib/ActionList/ActionListFieldArray.js +44 -17
- package/src/lib/ActionList/README.md +24 -20
- package/src/lib/CustomProperties/Config/CustomPropertiesSettings.js +3 -2
- package/src/lib/CustomProperties/Config/CustomPropertyForm.js +77 -23
- package/src/lib/CustomProperties/Config/{CustomPropertiesView.js → CustomPropertyView.js} +31 -9
- 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 +37 -22
- 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/generateKiwtQueryParams.js +2 -2
- 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 +79 -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 +59 -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
|
@@ -15,7 +15,7 @@ var _reactFinalForm = require("react-final-form");
|
|
|
15
15
|
|
|
16
16
|
var _components = require("@folio/stripes/components");
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _validators = require("../../utils/validators");
|
|
19
19
|
|
|
20
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
21
|
|
|
@@ -51,7 +51,7 @@ var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoader
|
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
var CustomPropertyForm = function CustomPropertyForm(_ref) {
|
|
54
|
-
var _labelOverrides$label, _labelOverrides$name, _labelOverrides$descr, _labelOverrides$weigh, _labelOverrides$
|
|
54
|
+
var _labelOverrides$label, _labelOverrides$name, _labelOverrides$descr, _labelOverrides$ctx, _labelOverrides$weigh, _labelOverrides$prima2, _labelOverrides$retir, _labelOverrides$defau, _labelOverrides$type, _labelOverrides$categ;
|
|
55
55
|
|
|
56
56
|
var contextFilterOptions = _ref.contextFilterOptions,
|
|
57
57
|
helpPopovers = _ref.helpPopovers,
|
|
@@ -109,6 +109,18 @@ var CustomPropertyForm = function CustomPropertyForm(_ref) {
|
|
|
109
109
|
}
|
|
110
110
|
};
|
|
111
111
|
|
|
112
|
+
var primaryRetiredValidator = function primaryRetiredValidator(_v, allValues) {
|
|
113
|
+
if (allValues.primary && allValues.retired) {
|
|
114
|
+
var _labelOverrides$prima;
|
|
115
|
+
|
|
116
|
+
return (_labelOverrides$prima = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.primaryRetired) !== null && _labelOverrides$prima !== void 0 ? _labelOverrides$prima : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
117
|
+
id: "stripes-kint-components.errors.primaryRetired"
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return null;
|
|
122
|
+
};
|
|
123
|
+
|
|
112
124
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
113
125
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Row, {
|
|
114
126
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
@@ -123,7 +135,7 @@ var CustomPropertyForm = function CustomPropertyForm(_ref) {
|
|
|
123
135
|
startControl: helpPopovers !== null && helpPopovers !== void 0 && helpPopovers.label ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.InfoPopover, {
|
|
124
136
|
content: helpPopovers === null || helpPopovers === void 0 ? void 0 : helpPopovers.label
|
|
125
137
|
}) : null,
|
|
126
|
-
validate:
|
|
138
|
+
validate: _validators.required
|
|
127
139
|
})
|
|
128
140
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
129
141
|
xs: 6,
|
|
@@ -144,13 +156,13 @@ var CustomPropertyForm = function CustomPropertyForm(_ref) {
|
|
|
144
156
|
});
|
|
145
157
|
}
|
|
146
158
|
|
|
147
|
-
return (0,
|
|
159
|
+
return (0, _validators.required)(v);
|
|
148
160
|
}
|
|
149
161
|
})
|
|
150
162
|
})]
|
|
151
|
-
}), /*#__PURE__*/(0, _jsxRuntime.
|
|
152
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
153
|
-
xs:
|
|
163
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Row, {
|
|
164
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
165
|
+
xs: 9,
|
|
154
166
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
|
|
155
167
|
component: _components.TextArea,
|
|
156
168
|
label: (_labelOverrides$descr = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.description) !== null && _labelOverrides$descr !== void 0 ? _labelOverrides$descr : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
@@ -161,9 +173,38 @@ var CustomPropertyForm = function CustomPropertyForm(_ref) {
|
|
|
161
173
|
startControl: helpPopovers !== null && helpPopovers !== void 0 && helpPopovers.description ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.InfoPopover, {
|
|
162
174
|
content: helpPopovers === null || helpPopovers === void 0 ? void 0 : helpPopovers.description
|
|
163
175
|
}) : null,
|
|
164
|
-
validate:
|
|
176
|
+
validate: _validators.required
|
|
165
177
|
})
|
|
166
|
-
})
|
|
178
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
179
|
+
xs: 3,
|
|
180
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
|
|
181
|
+
actions: [{
|
|
182
|
+
onSelect: addCtx,
|
|
183
|
+
render: renderAddCtx
|
|
184
|
+
}],
|
|
185
|
+
component: _components.MultiSelection,
|
|
186
|
+
dataOptions: contextOptions,
|
|
187
|
+
emptyMessage: intl.formatMessage({
|
|
188
|
+
id: 'stripes-kint-components.customProperties.noCtxFound'
|
|
189
|
+
}),
|
|
190
|
+
label: (_labelOverrides$ctx = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.ctx) !== null && _labelOverrides$ctx !== void 0 ? _labelOverrides$ctx : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
191
|
+
id: "stripes-kint-components.customProperties.ctx"
|
|
192
|
+
}),
|
|
193
|
+
name: "ctx",
|
|
194
|
+
onChange: function onChange(selectedItems) {
|
|
195
|
+
if (selectedItems.length) {
|
|
196
|
+
change('ctx', [selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems[(selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.length) - 1]]);
|
|
197
|
+
} else {
|
|
198
|
+
change('ctx', undefined);
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
validate: function validate(value) {
|
|
202
|
+
return (value === null || value === void 0 ? void 0 : value.length) > 1 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
203
|
+
id: "stripes-kint-components.customProperties.ctx.error.moreThanOne"
|
|
204
|
+
}) : null;
|
|
205
|
+
}
|
|
206
|
+
})
|
|
207
|
+
})]
|
|
167
208
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Row, {
|
|
168
209
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
169
210
|
xs: 3,
|
|
@@ -178,7 +219,7 @@ var CustomPropertyForm = function CustomPropertyForm(_ref) {
|
|
|
178
219
|
content: helpPopovers === null || helpPopovers === void 0 ? void 0 : helpPopovers.weight
|
|
179
220
|
}) : null,
|
|
180
221
|
type: "number",
|
|
181
|
-
validate:
|
|
222
|
+
validate: _validators.required
|
|
182
223
|
})
|
|
183
224
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
184
225
|
xs: 3,
|
|
@@ -196,7 +237,7 @@ var CustomPropertyForm = function CustomPropertyForm(_ref) {
|
|
|
196
237
|
value: 'false'
|
|
197
238
|
}],
|
|
198
239
|
format: booleanToString,
|
|
199
|
-
label: (_labelOverrides$
|
|
240
|
+
label: (_labelOverrides$prima2 = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.primary) !== null && _labelOverrides$prima2 !== void 0 ? _labelOverrides$prima2 : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
200
241
|
id: "stripes-kint-components.customProperties.primary"
|
|
201
242
|
}),
|
|
202
243
|
name: "primary",
|
|
@@ -205,7 +246,34 @@ var CustomPropertyForm = function CustomPropertyForm(_ref) {
|
|
|
205
246
|
startControl: helpPopovers !== null && helpPopovers !== void 0 && helpPopovers.primary ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.InfoPopover, {
|
|
206
247
|
content: helpPopovers === null || helpPopovers === void 0 ? void 0 : helpPopovers.primary
|
|
207
248
|
}) : null,
|
|
208
|
-
validate:
|
|
249
|
+
validate: (0, _validators.composeValidators)(_validators.required, primaryRetiredValidator)
|
|
250
|
+
})
|
|
251
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
252
|
+
xs: 3,
|
|
253
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
|
|
254
|
+
component: _components.Select,
|
|
255
|
+
dataOptions: [{
|
|
256
|
+
label: intl.formatMessage({
|
|
257
|
+
id: 'stripes-kint-components.yes'
|
|
258
|
+
}),
|
|
259
|
+
value: 'true'
|
|
260
|
+
}, {
|
|
261
|
+
label: intl.formatMessage({
|
|
262
|
+
id: 'stripes-kint-components.no'
|
|
263
|
+
}),
|
|
264
|
+
value: 'false'
|
|
265
|
+
}],
|
|
266
|
+
format: booleanToString,
|
|
267
|
+
label: (_labelOverrides$retir = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.retired) !== null && _labelOverrides$retir !== void 0 ? _labelOverrides$retir : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
268
|
+
id: "stripes-kint-components.customProperties.retired"
|
|
269
|
+
}),
|
|
270
|
+
name: "retired",
|
|
271
|
+
parse: stringToBoolean,
|
|
272
|
+
required: true,
|
|
273
|
+
startControl: helpPopovers !== null && helpPopovers !== void 0 && helpPopovers.primary ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.InfoPopover, {
|
|
274
|
+
content: helpPopovers === null || helpPopovers === void 0 ? void 0 : helpPopovers.primary
|
|
275
|
+
}) : null,
|
|
276
|
+
validate: (0, _validators.composeValidators)(_validators.required, primaryRetiredValidator)
|
|
209
277
|
})
|
|
210
278
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
211
279
|
xs: 3,
|
|
@@ -232,36 +300,7 @@ var CustomPropertyForm = function CustomPropertyForm(_ref) {
|
|
|
232
300
|
startControl: helpPopovers !== null && helpPopovers !== void 0 && helpPopovers.defaultVisibility ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.InfoPopover, {
|
|
233
301
|
content: helpPopovers === null || helpPopovers === void 0 ? void 0 : helpPopovers.defaultVisibility
|
|
234
302
|
}) : null,
|
|
235
|
-
validate:
|
|
236
|
-
})
|
|
237
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
238
|
-
xs: 3,
|
|
239
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFinalForm.Field, {
|
|
240
|
-
actions: [{
|
|
241
|
-
onSelect: addCtx,
|
|
242
|
-
render: renderAddCtx
|
|
243
|
-
}],
|
|
244
|
-
component: _components.MultiSelection,
|
|
245
|
-
dataOptions: contextOptions,
|
|
246
|
-
emptyMessage: intl.formatMessage({
|
|
247
|
-
id: 'stripes-kint-components.customProperties.noCtxFound'
|
|
248
|
-
}),
|
|
249
|
-
label: (_labelOverrides$ctx = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.ctx) !== null && _labelOverrides$ctx !== void 0 ? _labelOverrides$ctx : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
250
|
-
id: "stripes-kint-components.customProperties.ctx"
|
|
251
|
-
}),
|
|
252
|
-
name: "ctx",
|
|
253
|
-
onChange: function onChange(selectedItems) {
|
|
254
|
-
if (selectedItems.length) {
|
|
255
|
-
change('ctx', [selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems[(selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.length) - 1]]);
|
|
256
|
-
} else {
|
|
257
|
-
change('ctx', undefined);
|
|
258
|
-
}
|
|
259
|
-
},
|
|
260
|
-
validate: function validate(value) {
|
|
261
|
-
return (value === null || value === void 0 ? void 0 : value.length) > 1 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
262
|
-
id: "stripes-kint-components.customProperties.ctx.error.moreThanOne"
|
|
263
|
-
}) : null;
|
|
264
|
-
}
|
|
303
|
+
validate: _validators.required
|
|
265
304
|
})
|
|
266
305
|
})]
|
|
267
306
|
}), !(values !== null && values !== void 0 && values.id) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Row, {
|
|
@@ -292,6 +331,11 @@ var CustomPropertyForm = function CustomPropertyForm(_ref) {
|
|
|
292
331
|
id: 'stripes-kint-components.customProperties.type.com.k_int.web.toolkit.custprops.types.CustomPropertyRefdata'
|
|
293
332
|
}),
|
|
294
333
|
value: 'Refdata'
|
|
334
|
+
}, {
|
|
335
|
+
label: intl.formatMessage({
|
|
336
|
+
id: 'stripes-kint-components.customProperties.type.com.k_int.web.toolkit.custprops.types.CustomPropertyLocalDate'
|
|
337
|
+
}),
|
|
338
|
+
value: 'LocalDate'
|
|
295
339
|
}],
|
|
296
340
|
label: (_labelOverrides$type = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.type) !== null && _labelOverrides$type !== void 0 ? _labelOverrides$type : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
297
341
|
id: "stripes-kint-components.customProperties.type"
|
|
@@ -301,7 +345,7 @@ var CustomPropertyForm = function CustomPropertyForm(_ref) {
|
|
|
301
345
|
startControl: helpPopovers !== null && helpPopovers !== void 0 && helpPopovers.type ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.InfoPopover, {
|
|
302
346
|
content: helpPopovers === null || helpPopovers === void 0 ? void 0 : helpPopovers.type
|
|
303
347
|
}) : null,
|
|
304
|
-
validate:
|
|
348
|
+
validate: _validators.required
|
|
305
349
|
})
|
|
306
350
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
307
351
|
xs: 6,
|
|
@@ -319,7 +363,7 @@ var CustomPropertyForm = function CustomPropertyForm(_ref) {
|
|
|
319
363
|
startControl: helpPopovers !== null && helpPopovers !== void 0 && helpPopovers.category ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.InfoPopover, {
|
|
320
364
|
content: helpPopovers === null || helpPopovers === void 0 ? void 0 : helpPopovers.category
|
|
321
365
|
}) : null,
|
|
322
|
-
validate:
|
|
366
|
+
validate: _validators.required
|
|
323
367
|
})
|
|
324
368
|
})]
|
|
325
369
|
})]
|
|
@@ -27,8 +27,8 @@ var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoader
|
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
// A default option for CustProp view pane, with the ability to override labels for fields
|
|
30
|
-
var
|
|
31
|
-
var _labelOverrides$label, _labelOverrides$name, _labelOverrides$descr, _labelOverrides$
|
|
30
|
+
var CustomPropertyView = function CustomPropertyView(_ref) {
|
|
31
|
+
var _labelOverrides$label, _labelOverrides$name, _labelOverrides$descr, _labelOverrides$prima, _labelOverrides$retir, _labelOverrides$weigh, _labelOverrides$defau, _labelOverrides$ctx, _customProperty$ctx, _labelOverrides$type, _labelOverrides$categ, _customProperty$categ, _customProperty$categ2;
|
|
32
32
|
|
|
33
33
|
var customProperty = _ref.customProperty,
|
|
34
34
|
labelOverrides = _ref.labelOverrides;
|
|
@@ -65,24 +65,34 @@ var CustomPropertiesView = function CustomPropertiesView(_ref) {
|
|
|
65
65
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
66
66
|
xs: 6,
|
|
67
67
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
68
|
-
label: (_labelOverrides$
|
|
69
|
-
id: "stripes-kint-components.customProperties.
|
|
68
|
+
label: (_labelOverrides$prima = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.primary) !== null && _labelOverrides$prima !== void 0 ? _labelOverrides$prima : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
69
|
+
id: "stripes-kint-components.customProperties.primary"
|
|
70
70
|
}),
|
|
71
|
-
value:
|
|
71
|
+
value: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
72
|
+
id: customProperty !== null && customProperty !== void 0 && customProperty.primary ? 'stripes-kint-components.yes' : 'stripes-kint-components.no'
|
|
73
|
+
})
|
|
72
74
|
})
|
|
73
75
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
74
76
|
xs: 6,
|
|
75
77
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
76
|
-
label: (_labelOverrides$
|
|
77
|
-
id: "stripes-kint-components.customProperties.
|
|
78
|
+
label: (_labelOverrides$retir = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.retired) !== null && _labelOverrides$retir !== void 0 ? _labelOverrides$retir : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
79
|
+
id: "stripes-kint-components.customProperties.retired"
|
|
78
80
|
}),
|
|
79
81
|
value: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
80
|
-
id: customProperty !== null && customProperty !== void 0 && customProperty.
|
|
82
|
+
id: customProperty !== null && customProperty !== void 0 && customProperty.retired ? 'stripes-kint-components.yes' : 'stripes-kint-components.no'
|
|
81
83
|
})
|
|
82
84
|
})
|
|
83
85
|
})]
|
|
84
86
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Row, {
|
|
85
87
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
88
|
+
xs: 6,
|
|
89
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
90
|
+
label: (_labelOverrides$weigh = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.weight) !== null && _labelOverrides$weigh !== void 0 ? _labelOverrides$weigh : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
91
|
+
id: "stripes-kint-components.customProperties.weight"
|
|
92
|
+
}),
|
|
93
|
+
value: customProperty === null || customProperty === void 0 ? void 0 : customProperty.weight
|
|
94
|
+
})
|
|
95
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
86
96
|
xs: 6,
|
|
87
97
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
88
98
|
label: (_labelOverrides$defau = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.defaultVisibility) !== null && _labelOverrides$defau !== void 0 ? _labelOverrides$defau : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
@@ -92,7 +102,9 @@ var CustomPropertiesView = function CustomPropertiesView(_ref) {
|
|
|
92
102
|
id: customProperty !== null && customProperty !== void 0 && customProperty.defaultInternal ? 'stripes-kint-components.customProperties.internalTrue' : 'stripes-kint-components.customProperties.internalFalse'
|
|
93
103
|
})
|
|
94
104
|
})
|
|
95
|
-
})
|
|
105
|
+
})]
|
|
106
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Row, {
|
|
107
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
96
108
|
xs: 6,
|
|
97
109
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.KeyValue, {
|
|
98
110
|
label: (_labelOverrides$ctx = labelOverrides === null || labelOverrides === void 0 ? void 0 : labelOverrides.ctx) !== null && _labelOverrides$ctx !== void 0 ? _labelOverrides$ctx : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
@@ -100,7 +112,7 @@ var CustomPropertiesView = function CustomPropertiesView(_ref) {
|
|
|
100
112
|
}),
|
|
101
113
|
value: (_customProperty$ctx = customProperty === null || customProperty === void 0 ? void 0 : customProperty.ctx) !== null && _customProperty$ctx !== void 0 ? _customProperty$ctx : /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.NoValue, {})
|
|
102
114
|
})
|
|
103
|
-
})
|
|
115
|
+
})
|
|
104
116
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Row, {
|
|
105
117
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Col, {
|
|
106
118
|
xs: 6,
|
|
@@ -125,7 +137,7 @@ var CustomPropertiesView = function CustomPropertiesView(_ref) {
|
|
|
125
137
|
});
|
|
126
138
|
};
|
|
127
139
|
|
|
128
|
-
|
|
140
|
+
CustomPropertyView.propTypes = {
|
|
129
141
|
customProperty: _propTypes.default.shape({
|
|
130
142
|
id: _propTypes.default.string,
|
|
131
143
|
label: _propTypes.default.string,
|
|
@@ -133,6 +145,7 @@ CustomPropertiesView.propTypes = {
|
|
|
133
145
|
description: _propTypes.default.string,
|
|
134
146
|
weight: _propTypes.default.number,
|
|
135
147
|
primary: _propTypes.default.bool,
|
|
148
|
+
retired: _propTypes.default.bool,
|
|
136
149
|
defaultInternal: _propTypes.default.bool,
|
|
137
150
|
ctx: _propTypes.default.string,
|
|
138
151
|
type: _propTypes.default.string,
|
|
@@ -142,7 +155,7 @@ CustomPropertiesView.propTypes = {
|
|
|
142
155
|
}),
|
|
143
156
|
labelOverrides: _propTypes.default.object
|
|
144
157
|
};
|
|
145
|
-
var _default =
|
|
158
|
+
var _default = CustomPropertyView;
|
|
146
159
|
var _default2 = _default;
|
|
147
160
|
exports.default = _default2;
|
|
148
161
|
;
|
|
@@ -154,8 +167,8 @@ exports.default = _default2;
|
|
|
154
167
|
return;
|
|
155
168
|
}
|
|
156
169
|
|
|
157
|
-
reactHotLoader.register(
|
|
158
|
-
reactHotLoader.register(_default, "default", "/home/ethan/FolioModules/stripes-kint-components/src/lib/CustomProperties/Config/
|
|
170
|
+
reactHotLoader.register(CustomPropertyView, "CustomPropertyView", "/home/ethan/FolioModules/stripes-kint-components/src/lib/CustomProperties/Config/CustomPropertyView.js");
|
|
171
|
+
reactHotLoader.register(_default, "default", "/home/ethan/FolioModules/stripes-kint-components/src/lib/CustomProperties/Config/CustomPropertyView.js");
|
|
159
172
|
})();
|
|
160
173
|
|
|
161
174
|
;
|
|
@@ -15,21 +15,23 @@ Object.defineProperty(exports, "CustomPropertiesSettings", {
|
|
|
15
15
|
return _CustomPropertiesSettings.default;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
Object.defineProperty(exports, "
|
|
18
|
+
Object.defineProperty(exports, "CustomPropertyForm", {
|
|
19
19
|
enumerable: true,
|
|
20
20
|
get: function get() {
|
|
21
|
-
return
|
|
21
|
+
return _CustomPropertyForm.default;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
Object.defineProperty(exports, "
|
|
24
|
+
Object.defineProperty(exports, "CustomPropertyView", {
|
|
25
25
|
enumerable: true,
|
|
26
26
|
get: function get() {
|
|
27
|
-
return
|
|
27
|
+
return _CustomPropertyView.default;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
var _CustomPropertiesLookup = _interopRequireDefault(require("./CustomPropertiesLookup"));
|
|
32
32
|
|
|
33
|
+
var _CustomPropertyView = _interopRequireDefault(require("./CustomPropertyView"));
|
|
34
|
+
|
|
33
35
|
var _CustomPropertiesSettings = _interopRequireDefault(require("./CustomPropertiesSettings"));
|
|
34
36
|
|
|
35
37
|
var _CustomPropertyForm = _interopRequireDefault(require("./CustomPropertyForm"));
|
|
@@ -0,0 +1,72 @@
|
|
|
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 _CustomPropertiesEditCtx = _interopRequireDefault(require("./CustomPropertiesEditCtx"));
|
|
11
|
+
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
(function () {
|
|
17
|
+
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
18
|
+
enterModule && enterModule(module);
|
|
19
|
+
})();
|
|
20
|
+
|
|
21
|
+
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
22
|
+
return a;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
var CustomPropertiesEdit = function CustomPropertiesEdit(_ref) {
|
|
26
|
+
var _ref$contexts = _ref.contexts,
|
|
27
|
+
contexts = _ref$contexts === void 0 ? [] : _ref$contexts,
|
|
28
|
+
customPropertiesEndpoint = _ref.customPropertiesEndpoint,
|
|
29
|
+
id = _ref.id,
|
|
30
|
+
_ref$labelOverrides = _ref.labelOverrides,
|
|
31
|
+
labelOverrides = _ref$labelOverrides === void 0 ? {} : _ref$labelOverrides,
|
|
32
|
+
nameOverride = _ref.nameOverride;
|
|
33
|
+
return contexts.map(function (ctx) {
|
|
34
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesEditCtx.default, {
|
|
35
|
+
ctx: ctx,
|
|
36
|
+
customPropertiesEndpoint: customPropertiesEndpoint,
|
|
37
|
+
id: id,
|
|
38
|
+
labelOverrides: labelOverrides,
|
|
39
|
+
nameOverride: nameOverride
|
|
40
|
+
}, "customPropertiesEdit-".concat(ctx));
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
CustomPropertiesEdit.propTypes = {
|
|
45
|
+
contexts: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
46
|
+
customPropertiesEndpoint: _propTypes.default.string,
|
|
47
|
+
id: _propTypes.default.string,
|
|
48
|
+
labelOverrides: _propTypes.default.object,
|
|
49
|
+
nameOverride: _propTypes.default.string
|
|
50
|
+
};
|
|
51
|
+
var _default = CustomPropertiesEdit;
|
|
52
|
+
var _default2 = _default;
|
|
53
|
+
exports.default = _default2;
|
|
54
|
+
;
|
|
55
|
+
|
|
56
|
+
(function () {
|
|
57
|
+
var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
|
|
58
|
+
|
|
59
|
+
if (!reactHotLoader) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
reactHotLoader.register(CustomPropertiesEdit, "CustomPropertiesEdit", "/home/ethan/FolioModules/stripes-kint-components/src/lib/CustomProperties/Edit/CustomPropertiesEdit.js");
|
|
64
|
+
reactHotLoader.register(_default, "default", "/home/ethan/FolioModules/stripes-kint-components/src/lib/CustomProperties/Edit/CustomPropertiesEdit.js");
|
|
65
|
+
})();
|
|
66
|
+
|
|
67
|
+
;
|
|
68
|
+
|
|
69
|
+
(function () {
|
|
70
|
+
var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
|
|
71
|
+
leaveModule && leaveModule(module);
|
|
72
|
+
})();
|
|
@@ -0,0 +1,133 @@
|
|
|
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 _CustomPropertiesListField = _interopRequireDefault(require("./CustomPropertiesListField"));
|
|
15
|
+
|
|
16
|
+
var _hooks = require("../../hooks");
|
|
17
|
+
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
(function () {
|
|
23
|
+
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
24
|
+
enterModule && enterModule(module);
|
|
25
|
+
})();
|
|
26
|
+
|
|
27
|
+
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
28
|
+
return a;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
var CustomPropertiesEditCtx = function CustomPropertiesEditCtx(_ref) {
|
|
32
|
+
var ctx = _ref.ctx,
|
|
33
|
+
customPropertiesEndpoint = _ref.customPropertiesEndpoint,
|
|
34
|
+
id = _ref.id,
|
|
35
|
+
labelOverrides = _ref.labelOverrides,
|
|
36
|
+
nameOverride = _ref.nameOverride;
|
|
37
|
+
|
|
38
|
+
// Deal with all the possible label override options
|
|
39
|
+
var getAccordionLabel = function getAccordionLabel() {
|
|
40
|
+
var _labelOverrides$defau;
|
|
41
|
+
|
|
42
|
+
// Special case for null context
|
|
43
|
+
if (ctx === 'isNull') {
|
|
44
|
+
var _labelOverrides$noCon;
|
|
45
|
+
|
|
46
|
+
return (_labelOverrides$noCon = labelOverrides.noContext) !== null && _labelOverrides$noCon !== void 0 ? _labelOverrides$noCon : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
47
|
+
id: "stripes-kint-components.customProperties"
|
|
48
|
+
});
|
|
49
|
+
} // Label overrides for specific contexts
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
if (labelOverrides[ctx]) {
|
|
53
|
+
return labelOverrides[ctx];
|
|
54
|
+
} // Label override for default title, taking ctx into account
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
if (labelOverrides.defaultTitle && typeof labelOverrides.defaultTitle === 'function') {
|
|
58
|
+
return labelOverrides.defaultTitle(ctx);
|
|
59
|
+
} // Label override for default title or finally built in default
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
return (_labelOverrides$defau = labelOverrides.defaultTitle) !== null && _labelOverrides$defau !== void 0 ? _labelOverrides$defau : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
63
|
+
id: "stripes-kint-components.customProperties.ctx.title",
|
|
64
|
+
values: {
|
|
65
|
+
ctx: ctx
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
var _useCustomProperties = (0, _hooks.useCustomProperties)({
|
|
71
|
+
ctx: ctx,
|
|
72
|
+
endpoint: customPropertiesEndpoint,
|
|
73
|
+
returnQueryObject: true,
|
|
74
|
+
options: {
|
|
75
|
+
filters: [{
|
|
76
|
+
path: 'retired',
|
|
77
|
+
comparator: '!=',
|
|
78
|
+
value: 'true'
|
|
79
|
+
}]
|
|
80
|
+
}
|
|
81
|
+
}),
|
|
82
|
+
custprops = _useCustomProperties.data,
|
|
83
|
+
isLoading = _useCustomProperties.isLoading;
|
|
84
|
+
|
|
85
|
+
if (isLoading) {
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return custprops.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Accordion, {
|
|
90
|
+
id: "".concat(id, "-accordion-").concat(ctx),
|
|
91
|
+
label: getAccordionLabel(),
|
|
92
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomPropertiesListField.default, {
|
|
93
|
+
ctx: ctx,
|
|
94
|
+
customProperties: custprops,
|
|
95
|
+
labelOverrides: labelOverrides,
|
|
96
|
+
name: nameOverride !== null && nameOverride !== void 0 ? nameOverride : 'customProperties'
|
|
97
|
+
})
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
__signature__(CustomPropertiesEditCtx, "useCustomProperties{{ data: custprops, isLoading }}", function () {
|
|
102
|
+
return [_hooks.useCustomProperties];
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
CustomPropertiesEditCtx.propTypes = {
|
|
106
|
+
ctx: _propTypes.default.string,
|
|
107
|
+
customPropertiesEndpoint: _propTypes.default.string,
|
|
108
|
+
id: _propTypes.default.string,
|
|
109
|
+
labelOverrides: _propTypes.default.object,
|
|
110
|
+
nameOverride: _propTypes.default.string
|
|
111
|
+
};
|
|
112
|
+
var _default = CustomPropertiesEditCtx;
|
|
113
|
+
var _default2 = _default;
|
|
114
|
+
exports.default = _default2;
|
|
115
|
+
;
|
|
116
|
+
|
|
117
|
+
(function () {
|
|
118
|
+
var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
|
|
119
|
+
|
|
120
|
+
if (!reactHotLoader) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
reactHotLoader.register(CustomPropertiesEditCtx, "CustomPropertiesEditCtx", "/home/ethan/FolioModules/stripes-kint-components/src/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js");
|
|
125
|
+
reactHotLoader.register(_default, "default", "/home/ethan/FolioModules/stripes-kint-components/src/lib/CustomProperties/Edit/CustomPropertiesEditCtx.js");
|
|
126
|
+
})();
|
|
127
|
+
|
|
128
|
+
;
|
|
129
|
+
|
|
130
|
+
(function () {
|
|
131
|
+
var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
|
|
132
|
+
leaveModule && leaveModule(module);
|
|
133
|
+
})();
|