@visns-studio/visns-components 5.7.19 → 5.8.1

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
@@ -82,7 +82,7 @@
82
82
  "react-dom": "^17.0.0 || ^18.0.0"
83
83
  },
84
84
  "name": "@visns-studio/visns-components",
85
- "version": "5.7.19",
85
+ "version": "5.8.1",
86
86
  "description": "Various packages to assist in the development of our Custom Applications.",
87
87
  "main": "src/index.js",
88
88
  "files": [
@@ -538,27 +538,43 @@ const DataGrid = forwardRef(
538
538
  s[obj.id] = obj;
539
539
  });
540
540
  setSelected(s);
541
+ // Update parent component's rowsSelected state
542
+ if (setRowsSelected) {
543
+ setRowsSelected(s);
544
+ }
541
545
  } else if (typeof param.selected === 'object') {
542
546
  const selectedKey = Object.keys(param.selected)[0];
543
547
  const isSelectedAlready =
544
548
  selected.hasOwnProperty(selectedKey);
545
549
 
550
+ let newSelected;
546
551
  if (isSelectedAlready) {
547
- setSelected({});
552
+ newSelected = {};
553
+ setSelected(newSelected);
548
554
  } else {
549
- setSelected((prevSelected) => ({
550
- ...prevSelected,
555
+ newSelected = {
556
+ ...selected,
551
557
  [selectedKey]: param.selected[selectedKey],
552
- }));
558
+ };
559
+ setSelected(newSelected);
560
+ }
561
+
562
+ // Update parent component's rowsSelected state
563
+ if (setRowsSelected) {
564
+ setRowsSelected(newSelected);
553
565
  }
554
566
  }
555
567
  } else {
556
568
  // Handle deselection directly without confirmation
557
569
  setSelected(param.selected);
570
+ // Update parent component's rowsSelected state
571
+ if (setRowsSelected) {
572
+ setRowsSelected(param.selected);
573
+ }
558
574
  }
559
575
  },
560
- [selected]
561
- ); // Including selected in the dependency array
576
+ [selected, setRowsSelected]
577
+ ); // Including selected and setRowsSelected in the dependency array
562
578
 
563
579
  const findUpdatedFilter = (filters, currentValues) => {
564
580
  for (const filter of filters) {
@@ -226,91 +226,97 @@
226
226
  }
227
227
  }
228
228
 
229
- input:not(:placeholder-shown) + .fi__span,
230
- textarea:not(:placeholder-shown) + .fi__span,
231
- select:not(:placeholder-shown) + .fi__span {
232
- transform: translateY(-135%) translateX(10px) scale(0.85);
233
- opacity: 1;
234
- padding: 0;
235
- background: white;
236
- font-weight: 500;
237
- transition: all 0.3s ease;
238
- color: var(--primary-color, #4f46e5) !important;
239
- }
229
+ /* Login component wrapper for all scoped styles */
230
+ .login,
231
+ .logincontainer,
232
+ .lcontainer {
233
+ /* Input, textarea, and select styling */
234
+ input:not(:placeholder-shown) + .fi__span,
235
+ textarea:not(:placeholder-shown) + .fi__span,
236
+ select:not(:placeholder-shown) + .fi__span {
237
+ transform: translateY(-135%) translateX(10px) scale(0.85);
238
+ opacity: 1;
239
+ padding: 0;
240
+ background: white;
241
+ font-weight: 500;
242
+ transition: all 0.3s ease;
243
+ color: var(--primary-color, #4f46e5) !important;
244
+ }
240
245
 
241
- input:focus + .fi__span,
242
- textarea:focus + .fi__span,
243
- select:focus + .fi__span {
244
- color: var(--primary-color, #4f46e5) !important;
245
- }
246
+ input:focus + .fi__span,
247
+ textarea:focus + .fi__span,
248
+ select:focus + .fi__span {
249
+ color: var(--primary-color, #4f46e5) !important;
250
+ }
246
251
 
247
- input:focus,
248
- textarea:focus,
249
- select:focus {
250
- border-color: var(--primary-color, #4f46e5) !important;
251
- outline: none;
252
- box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.25);
253
- }
252
+ input:focus,
253
+ textarea:focus,
254
+ select:focus {
255
+ border-color: var(--primary-color, #4f46e5) !important;
256
+ outline: none;
257
+ box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.25);
258
+ }
254
259
 
255
- /* Add divider styling for the OR section */
256
- .divider {
257
- display: flex;
258
- align-items: center;
259
- text-align: center;
260
- margin: 1rem 0;
261
- color: #9ca3af;
262
- font-size: 0.875rem;
263
- }
260
+ /* Divider styling for the OR section */
261
+ .divider {
262
+ display: flex;
263
+ align-items: center;
264
+ text-align: center;
265
+ margin: 1rem 0;
266
+ color: #9ca3af;
267
+ font-size: 0.875rem;
268
+ }
264
269
 
265
- .divider::before,
266
- .divider::after {
267
- content: '';
268
- flex: 1;
269
- border-bottom: 1px solid #e5e7eb;
270
- }
270
+ .divider::before,
271
+ .divider::after {
272
+ content: '';
273
+ flex: 1;
274
+ border-bottom: 1px solid #e5e7eb;
275
+ }
271
276
 
272
- .divider::before {
273
- margin-right: 1rem;
274
- }
277
+ .divider::before {
278
+ margin-right: 1rem;
279
+ }
275
280
 
276
- .divider::after {
277
- margin-left: 1rem;
278
- }
281
+ .divider::after {
282
+ margin-left: 1rem;
283
+ }
279
284
 
280
- /* SSO button styling */
281
- .ssoButton {
282
- display: flex;
283
- align-items: center;
284
- justify-content: center;
285
- width: 100%;
286
- padding: 0.75rem 1rem;
287
- background-color: white;
288
- border: 1px solid #e5e7eb;
289
- border-radius: 0.5rem;
290
- font-size: 0.875rem;
291
- font-weight: 500;
292
- color: #374151;
293
- transition: all 0.2s ease;
294
- box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
285
+ /* SSO button styling */
286
+ .ssoButton {
287
+ display: flex;
288
+ align-items: center;
289
+ justify-content: center;
290
+ width: 100%;
291
+ padding: 0.75rem 1rem;
292
+ background-color: white;
293
+ border: 1px solid #e5e7eb;
294
+ border-radius: 0.5rem;
295
+ font-size: 0.875rem;
296
+ font-weight: 500;
297
+ color: #374151;
298
+ transition: all 0.2s ease;
299
+ box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
295
300
 
296
- &:hover {
297
- background-color: var(--bg-color, #f5f3ef);
298
- border-color: var(--border-color, #e1e1e1);
299
- }
301
+ &:hover {
302
+ background-color: var(--bg-color, #f5f3ef);
303
+ border-color: var(--border-color, #e1e1e1);
304
+ }
300
305
 
301
- img {
302
- margin-right: 0.5rem;
306
+ img {
307
+ margin-right: 0.5rem;
308
+ }
303
309
  }
304
- }
305
310
 
306
- .forgotPasswordLink {
307
- &:hover {
308
- color: var(--secondary-color, #3cbf7d) !important;
309
- text-decoration: underline !important;
310
- }
311
+ .forgotPasswordLink {
312
+ &:hover {
313
+ color: var(--secondary-color, #3cbf7d) !important;
314
+ text-decoration: underline !important;
315
+ }
311
316
 
312
- &:focus {
313
- outline: 2px solid rgba(var(--primary-rgb), 0.25) !important;
314
- outline-offset: 2px !important;
317
+ &:focus {
318
+ outline: 2px solid rgba(var(--primary-rgb), 0.25) !important;
319
+ outline-offset: 2px !important;
320
+ }
315
321
  }
316
322
  }
@@ -410,6 +410,8 @@ function GenericIndex({
410
410
 
411
411
  const { data, method, message, url } = checkboxUpdateConfig;
412
412
 
413
+ console.info('Selected rows:', rowsSelectedRef.current);
414
+
413
415
  if (!Object.keys(rowsSelectedRef.current).length) {
414
416
  toast.warning(message.warning);
415
417
  return;
@@ -553,6 +555,7 @@ function GenericIndex({
553
555
  setConfig={setConfig}
554
556
  setTableData={setTableData}
555
557
  setTotal={setTotal}
558
+ setRowsSelected={setRowsSelected}
556
559
  style={userProfile?.settings?.style || {}}
557
560
  userProfile={userProfile}
558
561
  />
@@ -570,7 +573,15 @@ function GenericIndex({
570
573
  }
571
574
 
572
575
  return null;
573
- }, [config, subnav, windowHeight, userProfile, setConfig, setTotal]);
576
+ }, [
577
+ config,
578
+ subnav,
579
+ windowHeight,
580
+ userProfile,
581
+ setConfig,
582
+ setTotal,
583
+ setRowsSelected,
584
+ ]);
574
585
 
575
586
  const renderContentBasedOnType = useCallback(() => {
576
587
  switch (config.type) {
@@ -742,6 +753,7 @@ function GenericIndex({
742
753
  <button className={styles.btn} onClick={handleCustomAction}>
743
754
  {getFunctionConfig('customAction').label ||
744
755
  'Custom Action'}
756
+ aa
745
757
  </button>
746
758
  )}
747
759