@visns-studio/visns-components 1.2.3 → 1.2.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.
@@ -259,6 +259,45 @@ const DataGrid = (props) => {
259
259
  };
260
260
  }, []);
261
261
 
262
+ const renderCreateButton = () => {
263
+ if (form.createDisable && form.createDisable === true) {
264
+ return null;
265
+ }
266
+
267
+ return (
268
+ <div className="filterAction--alt">
269
+ <button
270
+ className="btn"
271
+ onClick={() => {
272
+ modalOpen("create", 0);
273
+ }}
274
+ >
275
+ <div className="icon-plus"></div> Create
276
+ </button>
277
+ </div>
278
+ );
279
+ };
280
+
281
+ const renderSearch = () => {
282
+ const searchEnable = !(
283
+ form.searchDisable && form.searchDisable === true
284
+ );
285
+
286
+ return searchEnable ? (
287
+ <div className="filterInput--alt">
288
+ <div className="icon-search">
289
+ <Search strokeWidth={2} size={18} />
290
+ </div>
291
+ <input
292
+ type="text"
293
+ placeholder="Search"
294
+ value={search}
295
+ onChange={handleChangeSearch}
296
+ />
297
+ </div>
298
+ ) : null;
299
+ };
300
+
262
301
  /** Table Hooks */
263
302
  useEffect(() => {
264
303
  const delayedSetDSearch = debounce(() => {
@@ -854,27 +893,8 @@ const DataGrid = (props) => {
854
893
 
855
894
  return (
856
895
  <>
857
- <div className="filterInput--alt">
858
- <div className="icon-search">
859
- <Search strokeWidth={2} size={18} />
860
- </div>
861
- <input
862
- type="text"
863
- placeholder="Search"
864
- value={search}
865
- onChange={handleChangeSearch}
866
- />
867
- </div>
868
- <div className="filterAction--alt">
869
- <button
870
- className="btn"
871
- onClick={() => {
872
- modalOpen("create", 0);
873
- }}
874
- >
875
- <div className="icon-plus"></div> Create
876
- </button>
877
- </div>
896
+ {renderSearch()}
897
+ {renderCreateButton()}
878
898
  <ReactDataGrid
879
899
  columns={gridColumns}
880
900
  dataSource={data}
@@ -80,7 +80,8 @@ function TableFilter(props) {
80
80
  parseInt(value) >= 0
81
81
  ) {
82
82
  if (parseInt(value) === parseInt(item.value)) {
83
- tempFilters[index].class = "subactive";
83
+ tempFilters[index].class =
84
+ type === "simple" ? "activetab" : "subactive";
84
85
  tempFilters[index].show = true;
85
86
  } else {
86
87
  tempFilters[index].class = "";
@@ -88,7 +89,8 @@ function TableFilter(props) {
88
89
  }
89
90
  } else {
90
91
  if (id === item.id) {
91
- tempFilters[index].class = "subactive";
92
+ tempFilters[index].class =
93
+ type === "simple" ? "activetab" : "subactive";
92
94
  tempFilters[index].show = true;
93
95
  } else {
94
96
  tempFilters[index].class = "";
package/package.json CHANGED
@@ -33,7 +33,7 @@
33
33
  "react-dom": ">=18.2.0"
34
34
  },
35
35
  "name": "@visns-studio/visns-components",
36
- "version": "1.2.3",
36
+ "version": "1.2.5",
37
37
  "description": "Various packages to assist in the development of our Custom Applications.",
38
38
  "main": "index.js",
39
39
  "devDependencies": {},