ublo-lib 1.12.26 → 1.12.28

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.
@@ -95,7 +95,9 @@ function Inner({
95
95
  options: fieldOptions = [],
96
96
  placeholder,
97
97
  required,
98
- autoSizing
98
+ autoSizing,
99
+ min,
100
+ max
99
101
  } = field;
100
102
  const [options, setOptions] = React.useState(fieldOptions);
101
103
  const fieldClasses = classNames(className, {
@@ -127,7 +129,7 @@ function Inner({
127
129
  }
128
130
  }));
129
131
  }, [name, required, setActivated, setData, setValid, type]);
130
- const props = getProps(type, name, fieldClasses, data, required, placeholder, autoSizing, onChange);
132
+ const props = getProps(type, name, fieldClasses, data, required, placeholder, autoSizing, onChange, min, max);
131
133
  const onBlur = e => {
132
134
  const {
133
135
  value
@@ -191,7 +193,7 @@ function getTag(type) {
191
193
  return Input;
192
194
  }
193
195
  }
194
- function getProps(type, name, className, data, required, placeholder, autoSizing, onChange) {
196
+ function getProps(type, name, className, data, required, placeholder, autoSizing, onChange, min, max) {
195
197
  const commonProps = {
196
198
  className,
197
199
  value: data[name].value,
@@ -223,6 +225,8 @@ function getProps(type, name, className, data, required, placeholder, autoSizing
223
225
  return {
224
226
  withInput: true,
225
227
  onChange,
228
+ min,
229
+ max,
226
230
  ...commonProps
227
231
  };
228
232
  }
@@ -46,7 +46,7 @@ export function getInitialFormState(fields, presets, existingSubject) {
46
46
  };
47
47
  }
48
48
  if (type === "number") {
49
- const value = presets?.[key] ?? 0;
49
+ const value = presets?.[key] ?? field?.min ?? 0;
50
50
  return {
51
51
  ...acc,
52
52
  [key]: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ublo-lib",
3
- "version": "1.12.26",
3
+ "version": "1.12.28",
4
4
  "peerDependencies": {
5
5
  "dt-design-system": "^2.1.0",
6
6
  "leaflet": "^1.9.1",