@k-int/stripes-kint-components 2.1.1 → 2.2.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 +5 -1
- package/es/index.js +26 -0
- package/es/lib/ActionList/ActionList.js +4 -1
- package/es/lib/ActionList/ActionListFieldArray.js +5 -2
- package/es/lib/CustomProperties/Config/CustomPropertiesSettings.js +1 -0
- package/es/lib/CustomProperties/Config/CustomPropertiesView.js +22 -9
- package/es/lib/CustomProperties/Config/CustomPropertyForm.js +88 -44
- package/es/lib/FormModal/FormModal.js +2 -7
- package/es/lib/utils/validators.js +101 -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 +8 -0
- package/src/lib/ActionList/ActionList.js +3 -0
- package/src/lib/ActionList/ActionListFieldArray.js +14 -10
- package/src/lib/ActionList/README.md +1 -0
- package/src/lib/CustomProperties/Config/CustomPropertiesSettings.js +1 -0
- package/src/lib/CustomProperties/Config/CustomPropertiesView.js +28 -6
- package/src/lib/CustomProperties/Config/CustomPropertyForm.js +77 -23
- package/src/lib/FormModal/FormModal.js +2 -7
- package/src/lib/utils/generateKiwtQueryParams.js +2 -2
- package/src/lib/utils/validators.js +39 -0
- package/translations/stripes-kint-components/en.json +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
## 2.2.
|
|
1
|
+
## 2.2.0 2022-03-11
|
|
2
2
|
* Fix -- GenerateQueryParams no longer assumes you want EITHER nsValues filters or options filters, it simply adds both to the params array
|
|
3
|
+
* ActionList -- added a hideCreateButton prop for custom rolled solutions
|
|
4
|
+
* FormModal -- No longer restart form on submit... should stop validation errors clearing the form
|
|
5
|
+
* Added support for Date type custom properties, as well as retired prop.
|
|
6
|
+
* Shift away from stripes-erm-components validators to internally defined validators.
|
|
3
7
|
## 2.1.0 2022-03-09
|
|
4
8
|
* Fixes for ActionList
|
|
5
9
|
* When no formatter is present, it no longer crashes
|
package/es/index.js
CHANGED
|
@@ -107,6 +107,12 @@ Object.defineProperty(exports, "Typedown", {
|
|
|
107
107
|
return _Typedown.default;
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
|
+
Object.defineProperty(exports, "composeValidators", {
|
|
111
|
+
enumerable: true,
|
|
112
|
+
get: function get() {
|
|
113
|
+
return _validators.composeValidators;
|
|
114
|
+
}
|
|
115
|
+
});
|
|
110
116
|
exports.customPropertyContants = void 0;
|
|
111
117
|
Object.defineProperty(exports, "generateKiwtQuery", {
|
|
112
118
|
enumerable: true,
|
|
@@ -120,12 +126,30 @@ Object.defineProperty(exports, "generateKiwtQueryParams", {
|
|
|
120
126
|
return _utils.generateKiwtQueryParams;
|
|
121
127
|
}
|
|
122
128
|
});
|
|
129
|
+
Object.defineProperty(exports, "invalidNumber", {
|
|
130
|
+
enumerable: true,
|
|
131
|
+
get: function get() {
|
|
132
|
+
return _validators.invalidNumber;
|
|
133
|
+
}
|
|
134
|
+
});
|
|
123
135
|
Object.defineProperty(exports, "refdataOptions", {
|
|
124
136
|
enumerable: true,
|
|
125
137
|
get: function get() {
|
|
126
138
|
return _utils.refdataOptions;
|
|
127
139
|
}
|
|
128
140
|
});
|
|
141
|
+
Object.defineProperty(exports, "required", {
|
|
142
|
+
enumerable: true,
|
|
143
|
+
get: function get() {
|
|
144
|
+
return _validators.required;
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
Object.defineProperty(exports, "requiredObject", {
|
|
148
|
+
enumerable: true,
|
|
149
|
+
get: function get() {
|
|
150
|
+
return _validators.requiredObject;
|
|
151
|
+
}
|
|
152
|
+
});
|
|
129
153
|
Object.defineProperty(exports, "selectorSafe", {
|
|
130
154
|
enumerable: true,
|
|
131
155
|
get: function get() {
|
|
@@ -209,6 +233,8 @@ var _hooks = require("./lib/hooks");
|
|
|
209
233
|
|
|
210
234
|
var _utils = require("./lib/utils");
|
|
211
235
|
|
|
236
|
+
var _validators = require("./lib/utils/validators");
|
|
237
|
+
|
|
212
238
|
var _contexts = require("./lib/contexts");
|
|
213
239
|
|
|
214
240
|
var _SettingPage = require("./lib/SettingPage");
|
|
@@ -19,7 +19,7 @@ var _ActionListFieldArray = _interopRequireDefault(require("./ActionListFieldArr
|
|
|
19
19
|
|
|
20
20
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
21
|
|
|
22
|
-
var _excluded = ["actionAssigner", "actionCalls", "columnMapping", "contentData", "creatableFields", "editableFields", "fieldComponents", "visibleFields"];
|
|
22
|
+
var _excluded = ["actionAssigner", "actionCalls", "columnMapping", "contentData", "creatableFields", "editableFields", "fieldComponents", "hideCreateButton", "visibleFields"];
|
|
23
23
|
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
25
|
|
|
@@ -50,6 +50,7 @@ var propTypes = {
|
|
|
50
50
|
creatableFields: _propTypes.default.object,
|
|
51
51
|
editableFields: _propTypes.default.object,
|
|
52
52
|
fieldComponents: _propTypes.default.object,
|
|
53
|
+
hideCreateButton: _propTypes.default.bool,
|
|
53
54
|
visibleFields: _propTypes.default.arrayOf(_propTypes.default.string)
|
|
54
55
|
};
|
|
55
56
|
|
|
@@ -65,6 +66,7 @@ var ActionList = function ActionList(_ref) {
|
|
|
65
66
|
editableFields = _ref$editableFields === void 0 ? {} : _ref$editableFields,
|
|
66
67
|
_ref$fieldComponents = _ref.fieldComponents,
|
|
67
68
|
fieldComponents = _ref$fieldComponents === void 0 ? {} : _ref$fieldComponents,
|
|
69
|
+
hideCreateButton = _ref.hideCreateButton,
|
|
68
70
|
visibleFields = _ref.visibleFields,
|
|
69
71
|
mclProps = _objectWithoutProperties(_ref, _excluded);
|
|
70
72
|
|
|
@@ -92,6 +94,7 @@ var ActionList = function ActionList(_ref) {
|
|
|
92
94
|
creatableFields: creatableFields,
|
|
93
95
|
editableFields: editableFields,
|
|
94
96
|
fieldComponents: fieldComponents,
|
|
97
|
+
hideCreateButton: hideCreateButton,
|
|
95
98
|
name: "contentData",
|
|
96
99
|
visibleFields: visibleFields
|
|
97
100
|
}, mclProps))
|
|
@@ -23,7 +23,7 @@ var _ActionListFieldArray = _interopRequireDefault(require("../../../styles/Acti
|
|
|
23
23
|
|
|
24
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
25
|
|
|
26
|
-
var _excluded = ["actionAssigner", "actionCalls", "columnMapping", "creatableFields", "editableFields", "fields", "fieldComponents", "visibleFields"],
|
|
26
|
+
var _excluded = ["actionAssigner", "actionCalls", "columnMapping", "creatableFields", "editableFields", "fields", "fieldComponents", "hideCreateButton", "visibleFields"],
|
|
27
27
|
_excluded2 = ["actionListActions"],
|
|
28
28
|
_excluded3 = ["actionListActions"],
|
|
29
29
|
_excluded4 = ["actionListActions"],
|
|
@@ -88,6 +88,7 @@ var propTypes = {
|
|
|
88
88
|
fields: _propTypes.default.object,
|
|
89
89
|
fieldComponents: _propTypes.default.object,
|
|
90
90
|
formatter: _propTypes.default.object,
|
|
91
|
+
hideCreateButton: _propTypes.default.bool,
|
|
91
92
|
visibleFields: _propTypes.default.arrayOf(_propTypes.default.string)
|
|
92
93
|
};
|
|
93
94
|
|
|
@@ -99,6 +100,8 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
|
|
|
99
100
|
editableFields = _ref.editableFields,
|
|
100
101
|
fields = _ref.fields,
|
|
101
102
|
fieldComponents = _ref.fieldComponents,
|
|
103
|
+
_ref$hideCreateButton = _ref.hideCreateButton,
|
|
104
|
+
hideCreateButton = _ref$hideCreateButton === void 0 ? false : _ref$hideCreateButton,
|
|
102
105
|
visibleFields = _ref.visibleFields,
|
|
103
106
|
mclProps = _objectWithoutProperties(_ref, _excluded);
|
|
104
107
|
|
|
@@ -328,7 +331,7 @@ var ActionListFieldArray = function ActionListFieldArray(_ref) {
|
|
|
328
331
|
};
|
|
329
332
|
|
|
330
333
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
331
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
334
|
+
children: [!hideCreateButton && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
332
335
|
buttonClass: _ActionListFieldArray.default.buttonRight,
|
|
333
336
|
disabled: !actionCalls.create,
|
|
334
337
|
onClick: function onClick() {
|
|
@@ -230,6 +230,7 @@ var CustomPropertiesSettings = function CustomPropertiesSettings(_ref) {
|
|
|
230
230
|
initialValues: mode === CREATING ? {
|
|
231
231
|
weight: 0,
|
|
232
232
|
primary: true,
|
|
233
|
+
retired: false,
|
|
233
234
|
defaultInternal: true
|
|
234
235
|
} : _objectSpread(_objectSpread({}, customProperty), {}, {
|
|
235
236
|
ctx: customProperty !== null && customProperty !== void 0 && customProperty.ctx ? [{
|
|
@@ -28,7 +28,7 @@ var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoader
|
|
|
28
28
|
|
|
29
29
|
// A default option for CustProp view pane, with the ability to override labels for fields
|
|
30
30
|
var CustomPropertiesView = function CustomPropertiesView(_ref) {
|
|
31
|
-
var _labelOverrides$label, _labelOverrides$name, _labelOverrides$descr, _labelOverrides$
|
|
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,
|
|
@@ -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,
|
|
@@ -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
|
})]
|
|
@@ -59,16 +59,11 @@ var FormModal = function FormModal(_ref) {
|
|
|
59
59
|
restart();
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
-
var handleSubmitAndClear = function handleSubmitAndClear() {
|
|
63
|
-
handleSubmit();
|
|
64
|
-
restart();
|
|
65
|
-
};
|
|
66
|
-
|
|
67
62
|
var renderFooter = function renderFooter() {
|
|
68
63
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.ModalFooter, {
|
|
69
64
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
70
65
|
buttonStyle: "primary",
|
|
71
|
-
onClick:
|
|
66
|
+
onClick: handleSubmit,
|
|
72
67
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
73
68
|
id: "stripes-kint-components.save"
|
|
74
69
|
})
|
|
@@ -82,7 +77,7 @@ var FormModal = function FormModal(_ref) {
|
|
|
82
77
|
};
|
|
83
78
|
|
|
84
79
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("form", {
|
|
85
|
-
onSubmit:
|
|
80
|
+
onSubmit: handleSubmit,
|
|
86
81
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Modal, _objectSpread(_objectSpread({
|
|
87
82
|
enforceFocus: false,
|
|
88
83
|
footer: renderFooter(),
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.requiredObject = exports.required = exports.invalidNumber = exports.composeValidators = void 0;
|
|
7
|
+
|
|
8
|
+
var _reactIntl = require("react-intl");
|
|
9
|
+
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
|
|
12
|
+
var _excluded = ["_delete"];
|
|
13
|
+
|
|
14
|
+
(function () {
|
|
15
|
+
var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
|
|
16
|
+
enterModule && enterModule(module);
|
|
17
|
+
})();
|
|
18
|
+
|
|
19
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
20
|
+
|
|
21
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
22
|
+
|
|
23
|
+
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
|
|
24
|
+
return a;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
var invalidNumber = function invalidNumber(value) {
|
|
28
|
+
return value || value === 0 ? undefined : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
29
|
+
id: "stripes-kint-components.errors.invalidNumber"
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
exports.invalidNumber = invalidNumber;
|
|
34
|
+
|
|
35
|
+
var required = function required(value) {
|
|
36
|
+
var blankString = /^\s+$/;
|
|
37
|
+
|
|
38
|
+
if (value && !blankString.test(value) || value === false || value === 0) {
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
43
|
+
id: "stripes-core.label.missingRequiredField"
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
exports.required = required;
|
|
48
|
+
|
|
49
|
+
var requiredObject = function requiredObject() {
|
|
50
|
+
var formValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
51
|
+
|
|
52
|
+
// withKiwtFieldArray sets the _delete property on new objects by default
|
|
53
|
+
// eslint-disable-next-line no-unused-vars
|
|
54
|
+
var _delete = formValue._delete,
|
|
55
|
+
value = _objectWithoutProperties(formValue, _excluded);
|
|
56
|
+
|
|
57
|
+
if (Object.keys(value).length === 0) {
|
|
58
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.FormattedMessage, {
|
|
59
|
+
id: "stripes-core.label.missingRequiredField"
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return undefined;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
exports.requiredObject = requiredObject;
|
|
67
|
+
|
|
68
|
+
var composeValidators = function composeValidators() {
|
|
69
|
+
for (var _len = arguments.length, validators = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
70
|
+
validators[_key] = arguments[_key];
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return function (value, allValues, meta) {
|
|
74
|
+
return validators.reduce(function (error, validator) {
|
|
75
|
+
return error || validator(value, allValues, meta);
|
|
76
|
+
}, undefined);
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
exports.composeValidators = composeValidators;
|
|
81
|
+
;
|
|
82
|
+
|
|
83
|
+
(function () {
|
|
84
|
+
var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
|
|
85
|
+
|
|
86
|
+
if (!reactHotLoader) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
reactHotLoader.register(invalidNumber, "invalidNumber", "/home/ethan/FolioModules/stripes-kint-components/src/lib/utils/validators.js");
|
|
91
|
+
reactHotLoader.register(required, "required", "/home/ethan/FolioModules/stripes-kint-components/src/lib/utils/validators.js");
|
|
92
|
+
reactHotLoader.register(requiredObject, "requiredObject", "/home/ethan/FolioModules/stripes-kint-components/src/lib/utils/validators.js");
|
|
93
|
+
reactHotLoader.register(composeValidators, "composeValidators", "/home/ethan/FolioModules/stripes-kint-components/src/lib/utils/validators.js");
|
|
94
|
+
})();
|
|
95
|
+
|
|
96
|
+
;
|
|
97
|
+
|
|
98
|
+
(function () {
|
|
99
|
+
var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
|
|
100
|
+
leaveModule && leaveModule(module);
|
|
101
|
+
})();
|