@k-int/stripes-kint-components 3.0.0 → 3.0.1

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 CHANGED
@@ -1,4 +1,7 @@
1
- ## 3.0.0 In progress
1
+ ## 3.0.1 2022-09-22
2
+ * Removed unnecessary validate prop on CustomPropertyField, fixed broken out of range validator
3
+
4
+ ## 3.0.0 2022-09-16
2
5
  * RichSelect default trigger now uses DropdownButton under the hood -- changed styling
3
6
  * ActionList previously added actionListItems directly to cached object--sometimes this caused the react-query cache ITSELF to update, although I'm not sure why here and not anywhere else. Fixed by creating a clone internally in ActionListFieldArray and assigning actionListActions on that.
4
7
  * New util function `parseErrorResponse`, used in places where we catch http errors, allows for text only response bodies
@@ -94,7 +94,7 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
94
94
  if (customProperty.type === CUSTOM_PROPERTY_TYPES.INTEGER_CLASS_NAME) {
95
95
  var min = Number.MIN_SAFE_INTEGER;
96
96
  var max = Number.MAX_SAFE_INTEGER;
97
- return fieldValue && !Number.isInteger(+fieldValue) ? kintIntl.formatKintMessage({
97
+ return fieldValue && (fieldValue > max || fieldValue < min) ? kintIntl.formatKintMessage({
98
98
  id: 'errors.valueNotInRange',
99
99
  overrideValue: labelOverrides.valueNotInRangeError
100
100
  }, {
@@ -226,10 +226,7 @@ var CustomPropertyField = function CustomPropertyField(_ref) {
226
226
  max: max,
227
227
  min: min,
228
228
  step: 'any',
229
- type: 'number',
230
- validate: function validate(validateValue) {
231
- return (0, _utils.composeValidatorsWithArgs)(_utils.invalidNumber, _utils.rangeOverflow, _utils.rangeUnderflow)(validateValue, min, max, passedIntlKey, passedIntlNS, labelOverrides);
232
- }
229
+ type: 'number'
233
230
  };
234
231
 
235
232
  handleChange = function handleChange(e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k-int/stripes-kint-components",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "Stripes Component library for K-Int specific applications",
5
5
  "sideEffects": [
6
6
  "*.css"
@@ -77,7 +77,7 @@ const CustomPropertyField = ({
77
77
  const min = Number.MIN_SAFE_INTEGER;
78
78
  const max = Number.MAX_SAFE_INTEGER;
79
79
 
80
- return (fieldValue && !Number.isInteger(+fieldValue)) ?
80
+ return (fieldValue && (fieldValue > max || fieldValue < min)) ?
81
81
  kintIntl.formatKintMessage({
82
82
  id: 'errors.valueNotInRange',
83
83
  overrideValue: labelOverrides.valueNotInRangeError
@@ -206,20 +206,6 @@ const CustomPropertyField = ({
206
206
  min,
207
207
  step: 'any',
208
208
  type: 'number',
209
- validate: (validateValue) => {
210
- return composeValidatorsWithArgs(
211
- invalidNumber,
212
- rangeOverflow,
213
- rangeUnderflow
214
- )(
215
- validateValue,
216
- min,
217
- max,
218
- passedIntlKey,
219
- passedIntlNS,
220
- labelOverrides
221
- );
222
- }
223
209
  };
224
210
  handleChange = e => {
225
211
  onChange({