@civicactions/cmsds-open-data-components 4.0.16-alpha.1 → 4.0.16-alpha.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/main.js +11 -1
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -3622,6 +3622,16 @@ const $eadd6431fddf4b6c$var$FilterItem = ({ id: id, condition: condition, index:
|
|
|
3622
3622
|
}, [
|
|
3623
3623
|
operator
|
|
3624
3624
|
]);
|
|
3625
|
+
// Clear value when switching to an empty operator
|
|
3626
|
+
const isEmptyOperator = operator === 'is_empty' || operator === 'not_empty';
|
|
3627
|
+
(0, $hgUW1$useEffect)(()=>{
|
|
3628
|
+
if (isEmptyOperator && value !== '') {
|
|
3629
|
+
setValue('');
|
|
3630
|
+
update(index, 'value', '');
|
|
3631
|
+
}
|
|
3632
|
+
}, [
|
|
3633
|
+
isEmptyOperator
|
|
3634
|
+
]);
|
|
3625
3635
|
(0, $hgUW1$useEffect)(()=>{
|
|
3626
3636
|
if (value !== condition.value) {
|
|
3627
3637
|
if (value) update(index, 'value', value);
|
|
@@ -3649,7 +3659,7 @@ const $eadd6431fddf4b6c$var$FilterItem = ({ id: id, condition: condition, index:
|
|
|
3649
3659
|
name: `${condition.key}_operator`,
|
|
3650
3660
|
onChange: (e)=>setOperator(e.target.value)
|
|
3651
3661
|
}),
|
|
3652
|
-
schema[id].fields[property].mysql_type === 'date' ? /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
3662
|
+
isEmptyOperator ? /*#__PURE__*/ (0, $hgUW1$jsx)("div", {}) : schema[id].fields[property].mysql_type === 'date' ? /*#__PURE__*/ (0, $hgUW1$jsxs)("div", {
|
|
3653
3663
|
children: [
|
|
3654
3664
|
/*#__PURE__*/ (0, $hgUW1$jsx)("label", {
|
|
3655
3665
|
className: "ds-c-label",
|