@visns-studio/visns-components 3.7.13 → 3.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.
@@ -36,7 +36,7 @@ function Breadcrumb({ data, page }) {
36
36
  <Link to={page && page.previousUrl ? page.previousUrl : null}>
37
37
  {page && page.title ? page.title : null}
38
38
  </Link>{' '}
39
- {data && data[page.titleKey] ? (
39
+ {page?.titleKey && data && data[page.titleKey] ? (
40
40
  <>
41
41
  <CircleChevronRight strokeWidth={2} size={18} />{' '}
42
42
  {data[page.titleKey]}
@@ -1099,7 +1099,6 @@ function Field({
1099
1099
  switch (settings.type) {
1100
1100
  case 'date':
1101
1101
  case 'datetime':
1102
- case 'time':
1103
1102
  return (
1104
1103
  <DatePicker
1105
1104
  dateFormat={
@@ -1127,6 +1126,24 @@ function Field({
1127
1126
  shouldCloseOnSelect={true}
1128
1127
  />
1129
1128
  );
1129
+ case 'time':
1130
+ return (
1131
+ <DatePicker
1132
+ dateFormat="hh:mm aa"
1133
+ isClearable
1134
+ className={inputClass[settings.id]}
1135
+ selected={inputValue || ''}
1136
+ showMonthDropdown
1137
+ showYearDropdown
1138
+ scrollableYearDropdown
1139
+ onChange={(date) => onChangeDate(date, settings.id)}
1140
+ showTimeSelect={true}
1141
+ showTimeSelectOnly={true}
1142
+ timeIntervals={15}
1143
+ timeCaption={'Time'}
1144
+ shouldCloseOnSelect={true}
1145
+ />
1146
+ );
1130
1147
  case 'toggle':
1131
1148
  return (
1132
1149
  <div>
@@ -466,6 +466,11 @@ function Form({
466
466
 
467
467
  if (['create', 'update'].includes(formType)) {
468
468
  fields.forEach((item) => {
469
+ // Skip validation if formType is 'update' and field has createOnly property
470
+ if (formType === 'update' && item.createOnly) {
471
+ return; // Skip this field
472
+ }
473
+
469
474
  if (item.required === true) {
470
475
  if (
471
476
  formData[item.id] === '' ||
@@ -542,7 +547,6 @@ function Form({
542
547
 
543
548
  setInputClass(_inputClass);
544
549
  }
545
-
546
550
  if (validation !== '') {
547
551
  toast.error(<div>{parse(validation)}</div>);
548
552
  } else {
@@ -733,16 +737,6 @@ function Form({
733
737
  }
734
738
  }
735
739
  }
736
- } else {
737
- toast.error(
738
- <div>
739
- {parse(
740
- res.data.error !== undefined
741
- ? res.data.error
742
- : ''
743
- )}
744
- </div>
745
- );
746
740
  }
747
741
  }
748
742
  } catch (err) {
package/package.json CHANGED
@@ -54,7 +54,7 @@
54
54
  "react-dom": "^17.0.1"
55
55
  },
56
56
  "name": "@visns-studio/visns-components",
57
- "version": "3.7.13",
57
+ "version": "3.8.1",
58
58
  "description": "Various packages to assist in the development of our Custom Applications.",
59
59
  "main": "index.js",
60
60
  "scripts": {