@visns-studio/visns-components 5.10.4 → 5.10.5

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/package.json CHANGED
@@ -87,7 +87,7 @@
87
87
  "react-dom": "^17.0.0 || ^18.0.0"
88
88
  },
89
89
  "name": "@visns-studio/visns-components",
90
- "version": "5.10.4",
90
+ "version": "5.10.5",
91
91
  "description": "Various packages to assist in the development of our Custom Applications.",
92
92
  "main": "src/index.js",
93
93
  "files": [
@@ -3027,11 +3027,18 @@ const DataGrid = forwardRef(
3027
3027
  <>
3028
3028
  {/* Top container with search, action buttons, and auto-refresh */}
3029
3029
  {/* Only show top container if there are controls to display */}
3030
- {(!form.searchDisable ||
3031
- !form.createDisable ||
3032
- (!shouldRelocateAutoRefresh() &&
3033
- ajaxSetting &&
3034
- ajaxSetting.autoRefresh !== undefined)) && (
3030
+ {(() => {
3031
+ const hasSearchOrCreate = !form.searchDisable || !form.createDisable;
3032
+ const hasAutoRefresh = !shouldRelocateAutoRefresh() && ajaxSetting && ajaxSetting.autoRefresh !== undefined;
3033
+
3034
+ // If DataGridSearch would return null (both search and create disabled),
3035
+ // only show container if there are other controls besides auto-refresh
3036
+ if (form.searchDisable === true && form.createDisable === true) {
3037
+ return false; // Hide AutoRefreshControls when it would be the only control
3038
+ }
3039
+
3040
+ return hasSearchOrCreate || hasAutoRefresh;
3041
+ })() && (
3035
3042
  <div className={styles.dataGridTopContainer}>
3036
3043
  <div className={styles.dataGridTopLeftContainer}>
3037
3044
  <DataGridSearch
@@ -819,11 +819,12 @@ function Form({
819
819
  : null;
820
820
 
821
821
  // Check if formData[item.id] is null, undefined, or an empty string AND there's no auto value
822
- if (!formData[item.id] && !autoValue) {
822
+ // Note: 0 is considered a valid value for dropdowns/options
823
+ if ((formData[item.id] === null || formData[item.id] === undefined || formData[item.id] === '') && !autoValue) {
823
824
  // Check for required_check dependency
824
825
  if (
825
826
  item.required_check &&
826
- !formData[item.required_check]
827
+ (formData[item.required_check] === null || formData[item.required_check] === undefined || formData[item.required_check] === '')
827
828
  ) {
828
829
  validation += `${item.label} is a required field.<br/>`;
829
830
  _inputClass[item.id] = styles.inputError;
@@ -837,7 +838,7 @@ function Form({
837
838
  } else if (
838
839
  item.required_rely &&
839
840
  formData[item.required_rely] &&
840
- !formData[item.id]
841
+ (formData[item.id] === null || formData[item.id] === undefined || formData[item.id] === '')
841
842
  ) {
842
843
  // Check if the dependent required field is empty when it should be filled
843
844
  validation += `${item.label} is a required field.<br/>`;