@visns-studio/visns-components 4.0.8 → 4.0.9

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.
@@ -208,40 +208,45 @@ function Form({
208
208
  });
209
209
 
210
210
  formSettings.fields.forEach((f) => {
211
- if (
212
- f.id === id &&
213
- f.trigger &&
214
- f.trigger.type === 'addDays'
215
- ) {
216
- let newDate = moment();
217
- let add = false;
211
+ if (f.id === id && f.trigger) {
212
+ switch (f.trigger.type) {
213
+ case 'addDays':
214
+ let newDate = moment();
215
+ let add = false;
218
216
 
219
- if (
220
- inputValue.no_of_days &&
221
- parseFloat(inputValue.no_of_days) > 0
222
- ) {
223
- newDate.add(
224
- parseFloat(inputValue.no_of_days),
225
- 'days'
226
- );
227
- add = true;
228
- }
217
+ if (
218
+ inputValue.no_of_days &&
219
+ parseFloat(inputValue.no_of_days) > 0
220
+ ) {
221
+ newDate.add(
222
+ parseFloat(inputValue.no_of_days),
223
+ 'days'
224
+ );
225
+ add = true;
226
+ }
229
227
 
230
- if (
231
- inputValue.no_of_hours &&
232
- parseFloat(inputValue.no_of_hours) > 0
233
- ) {
234
- newDate.add(
235
- parseFloat(inputValue.no_of_hours),
236
- 'hours'
237
- );
238
- add = true;
239
- }
228
+ if (
229
+ inputValue.no_of_hours &&
230
+ parseFloat(inputValue.no_of_hours) > 0
231
+ ) {
232
+ newDate.add(
233
+ parseFloat(inputValue.no_of_hours),
234
+ 'hours'
235
+ );
236
+ add = true;
237
+ }
240
238
 
241
- if (add) {
242
- updateFormData({
243
- [f.trigger.id]: newDate.toDate(),
244
- });
239
+ if (add) {
240
+ updateFormData({
241
+ [f.trigger.id]: newDate.toDate(),
242
+ });
243
+ }
244
+ break;
245
+ case 'setContent':
246
+ updateFormData({
247
+ [f.trigger.id]: inputValue[f.trigger.key],
248
+ });
249
+ break;
245
250
  }
246
251
  }
247
252
  });
@@ -260,7 +265,7 @@ function Form({
260
265
  e.preventDefault();
261
266
  }
262
267
 
263
- console.info(userProfile, 'aaa');
268
+ console.info(`Debug Mode: ${userProfile}`);
264
269
  };
265
270
 
266
271
  const handleChangeToggle = (e) => {
@@ -235,21 +235,37 @@ function GenericIndex({ layout = 'full', setting, userProfile }) {
235
235
  if (subnav?.length > 0) {
236
236
  return (
237
237
  <div className="grid__subrow">
238
- <div
239
- className={`grid__${
240
- layout === 'full' ? 'subnav' : 'full'
241
- }`}
242
- >
243
- <TableFilter
244
- filters={subnav}
245
- setFilters={setSubnav}
246
- setSettings={setConfig}
247
- type={layout}
248
- />
249
- </div>
250
- <div className="grid__subcontent">
251
- {renderContentBasedOnType()}
252
- </div>
238
+ {layout === 'simple' ? (
239
+ <div className={`grid__full`}>
240
+ <div className="tabcontent">
241
+ <div className="tabcontent__menu">
242
+ <TableFilter
243
+ filters={subnav}
244
+ setFilters={setSubnav}
245
+ setSettings={setConfig}
246
+ type={layout}
247
+ />
248
+ </div>
249
+ <div className="tabcontent__main">
250
+ {renderContentBasedOnType()}
251
+ </div>
252
+ </div>
253
+ </div>
254
+ ) : (
255
+ <>
256
+ <div className={`grid__full`}>
257
+ <TableFilter
258
+ filters={subnav}
259
+ setFilters={setSubnav}
260
+ setSettings={setConfig}
261
+ type={layout}
262
+ />
263
+ </div>
264
+ <div className="grid__subcontent">
265
+ {renderContentBasedOnType()}
266
+ </div>
267
+ </>
268
+ )}
253
269
  </div>
254
270
  );
255
271
  } else {
@@ -44,7 +44,8 @@
44
44
  background: var(--item-color) !important;
45
45
  }
46
46
 
47
- .activetab {
48
- background: var(--primary-color) !important;
47
+ .activetab button {
48
+ font-weight: bold;
49
+ background: var(--item-color) !important;
49
50
  color: var(--paragraph-color) !important;
50
51
  }
package/package.json CHANGED
@@ -57,7 +57,7 @@
57
57
  "react-dom": "^17.0.1"
58
58
  },
59
59
  "name": "@visns-studio/visns-components",
60
- "version": "4.0.8",
60
+ "version": "4.0.9",
61
61
  "description": "Various packages to assist in the development of our Custom Applications.",
62
62
  "main": "index.js",
63
63
  "scripts": {