@bluemarble/bm-components 1.7.1 → 1.8.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/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +17 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -194,7 +194,7 @@ interface TabPanelProps {
|
|
|
194
194
|
}
|
|
195
195
|
declare const TabPanel: (props: TabPanelProps) => React__default.JSX.Element;
|
|
196
196
|
|
|
197
|
-
type FilterCompareType = 'gte' | 'lte' | 'lt' | 'gt' | 'equal' | 'in' | 'notEqual' | 'notIn';
|
|
197
|
+
type FilterCompareType = 'gte' | 'lte' | 'lt' | 'gt' | 'equal' | 'valueIn' | 'in' | 'notEqual' | 'valueNotIn' | 'notIn';
|
|
198
198
|
type FilterProps = {
|
|
199
199
|
id?: string;
|
|
200
200
|
prop: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -194,7 +194,7 @@ interface TabPanelProps {
|
|
|
194
194
|
}
|
|
195
195
|
declare const TabPanel: (props: TabPanelProps) => React__default.JSX.Element;
|
|
196
196
|
|
|
197
|
-
type FilterCompareType = 'gte' | 'lte' | 'lt' | 'gt' | 'equal' | 'in' | 'notEqual' | 'notIn';
|
|
197
|
+
type FilterCompareType = 'gte' | 'lte' | 'lt' | 'gt' | 'equal' | 'valueIn' | 'in' | 'notEqual' | 'valueNotIn' | 'notIn';
|
|
198
198
|
type FilterProps = {
|
|
199
199
|
id?: string;
|
|
200
200
|
prop: string;
|
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
|
-
}
|
|
3375
|
-
|
|
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
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
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
|
-
|
|
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
|
-
|
|
3430
|
+
if (key)
|
|
3427
3431
|
return a[key] === b[key];
|
|
3428
3432
|
return Object.values(a)[0] === Object.values(b)[0];
|
|
3429
3433
|
};
|
|
@@ -4660,6 +4664,10 @@ function compareFilter(item, filter) {
|
|
|
4660
4664
|
return filter.value.includes(itemValue);
|
|
4661
4665
|
case "notIn":
|
|
4662
4666
|
return !filter.value.includes(itemValue);
|
|
4667
|
+
case "valueIn":
|
|
4668
|
+
return itemValue.includes(filter.value);
|
|
4669
|
+
case "valueNotIn":
|
|
4670
|
+
return !itemValue.includes(filter.value);
|
|
4663
4671
|
case "gte":
|
|
4664
4672
|
return isDate(itemValue) ? _moment2.default.call(void 0, String(itemValue)).isSameOrAfter(filter.value) : itemValue >= filter.value;
|
|
4665
4673
|
case "gt":
|