@bluemarble/bm-components 1.7.0 → 1.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -223,7 +223,6 @@ interface SearchOptions$1 {
223
223
  value: string;
224
224
  }
225
225
  interface UseGridProps$1<T> {
226
- updatedTimes: number;
227
226
  columns: ColumnsProps[];
228
227
  filters?: FilterProps[];
229
228
  rowsPerPageOptions?: number[];
package/dist/index.d.ts CHANGED
@@ -223,7 +223,6 @@ interface SearchOptions$1 {
223
223
  value: string;
224
224
  }
225
225
  interface UseGridProps$1<T> {
226
- updatedTimes: number;
227
226
  columns: ColumnsProps[];
228
227
  filters?: FilterProps[];
229
228
  rowsPerPageOptions?: number[];
package/dist/index.js CHANGED
@@ -3353,6 +3353,9 @@ function FormikSelect(_a) {
3353
3353
 
3354
3354
 
3355
3355
 
3356
+
3357
+
3358
+
3356
3359
  function Autocomplete2(_a) {
3357
3360
  var _b = _a, {
3358
3361
  withFormik = true,
@@ -3371,8 +3374,8 @@ function Autocomplete2(_a) {
3371
3374
  getOptionValue
3372
3375
  }, rest)
3373
3376
  );
3374
- } else
3375
- return /* @__PURE__ */ React2.default.createElement(BaseInput2, __spreadValues({}, rest));
3377
+ }
3378
+ return /* @__PURE__ */ React2.default.createElement(BaseInput2, __spreadValues({}, rest));
3376
3379
  }
3377
3380
  function BaseInput2(props) {
3378
3381
  return /* @__PURE__ */ React2.default.createElement(
@@ -3395,14 +3398,15 @@ function FormikAutocomplete(_a) {
3395
3398
  name: props.name
3396
3399
  }), _c = _a2, { value: defaultValue } = _c, field = __objRest(_c, ["value"]), [meta, { setValue }] = _b2;
3397
3400
  const defaultOption = _react.useMemo.call(void 0, () => {
3401
+ if (!option)
3402
+ return defaultValue;
3398
3403
  const key = option == null ? void 0 : option.key;
3399
3404
  if (key)
3400
3405
  return props.options.find((option2) => option2[key] === defaultValue);
3401
- else
3402
- return props.options.find(
3403
- (option2) => Object.values(option2)[0] === defaultValue
3404
- );
3405
- }, []);
3406
+ return props.options.find(
3407
+ (option2) => Object.values(option2)[0] === defaultValue
3408
+ );
3409
+ }, [defaultValue, option, props.options.find]);
3406
3410
  const onChange = (_, newValue) => {
3407
3411
  const value = option == null ? void 0 : option.value;
3408
3412
  if (getOptionValue) {
@@ -3415,7 +3419,7 @@ function FormikAutocomplete(_a) {
3415
3419
  const getOptionLabel = (item) => {
3416
3420
  if (props == null ? void 0 : props.getOptionLabel)
3417
3421
  return props.getOptionLabel(item);
3418
- else if (option == null ? void 0 : option.label)
3422
+ if (option == null ? void 0 : option.label)
3419
3423
  return String(item[option.label]);
3420
3424
  return "[getOptionLabel] error";
3421
3425
  };
@@ -3423,7 +3427,7 @@ function FormikAutocomplete(_a) {
3423
3427
  const key = option == null ? void 0 : option.key;
3424
3428
  if (props == null ? void 0 : props.isOptionEqualToValue)
3425
3429
  return props.isOptionEqualToValue(a, b);
3426
- else if (key)
3430
+ if (key)
3427
3431
  return a[key] === b[key];
3428
3432
  return Object.values(a)[0] === Object.values(b)[0];
3429
3433
  };