@emeraldemperaur/vector-sigma 1.4.42 → 1.4.43

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/lib/index.cjs CHANGED
@@ -754,7 +754,7 @@ const guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9
754
754
  /** Returns a regex for validating an RFC 9562/4122 UUID.
755
755
  *
756
756
  * @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */
757
- const uuid$1 = (version) => {
757
+ const uuid = (version) => {
758
758
  if (!version)
759
759
  return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;
760
760
  return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
@@ -1437,10 +1437,10 @@ const $ZodUUID = /*@__PURE__*/ $constructor("$ZodUUID", (inst, def) => {
1437
1437
  const v = versionMap[def.version];
1438
1438
  if (v === undefined)
1439
1439
  throw new Error(`Invalid UUID version: "${def.version}"`);
1440
- def.pattern ?? (def.pattern = uuid$1(v));
1440
+ def.pattern ?? (def.pattern = uuid(v));
1441
1441
  }
1442
1442
  else
1443
- def.pattern ?? (def.pattern = uuid$1());
1443
+ def.pattern ?? (def.pattern = uuid());
1444
1444
  $ZodStringFormat.init(inst, def);
1445
1445
  });
1446
1446
  const $ZodEmail = /*@__PURE__*/ $constructor("$ZodEmail", (inst, def) => {
@@ -4106,17 +4106,11 @@ const ZodUUID = /*@__PURE__*/ $constructor("ZodUUID", (inst, def) => {
4106
4106
  $ZodUUID.init(inst, def);
4107
4107
  ZodStringFormat.init(inst, def);
4108
4108
  });
4109
- function uuid(params) {
4110
- return _uuid(ZodUUID, params);
4111
- }
4112
4109
  const ZodURL = /*@__PURE__*/ $constructor("ZodURL", (inst, def) => {
4113
4110
  // ZodStringFormat.init(inst, def);
4114
4111
  $ZodURL.init(inst, def);
4115
4112
  ZodStringFormat.init(inst, def);
4116
4113
  });
4117
- function url(params) {
4118
- return _url(ZodURL, params);
4119
- }
4120
4114
  const ZodEmoji = /*@__PURE__*/ $constructor("ZodEmoji", (inst, def) => {
4121
4115
  // ZodStringFormat.init(inst, def);
4122
4116
  $ZodEmoji.init(inst, def);
@@ -4571,7 +4565,7 @@ function superRefine(fn) {
4571
4565
  return _superRefine(fn);
4572
4566
  }
4573
4567
 
4574
- const InputOptionSchema$1 = object({
4568
+ const InputOptionSchema = object({
4575
4569
  optionid: number(),
4576
4570
  optionvalue: union([string(), number(), boolean()]),
4577
4571
  optionurl: string().optional(),
@@ -4580,7 +4574,7 @@ const InputOptionSchema$1 = object({
4580
4574
  score: number().or(float64()).optional(),
4581
4575
  note: string().optional(),
4582
4576
  });
4583
- const QuerySchema$1 = lazy(() => object({
4577
+ const QuerySchema = lazy(() => object({
4584
4578
  queryId: number(),
4585
4579
  inputType: string(),
4586
4580
  inputAlias: string(),
@@ -4596,18 +4590,19 @@ const QuerySchema$1 = lazy(() => object({
4596
4590
  errorText: string().optional(),
4597
4591
  defaultValue: any().optional(),
4598
4592
  queryResponse: any().nullable().optional(),
4599
- inputOptions: array(InputOptionSchema$1).optional(),
4593
+ inputOptions: array(InputOptionSchema).optional(),
4600
4594
  triggerValue: any().optional(),
4601
- toggledInput: QuerySchema$1.nullable().optional(),
4595
+ toggledInput: QuerySchema.nullable().optional(),
4602
4596
  minValue: number().optional(),
4603
4597
  maxValue: number().optional(),
4604
4598
  stepValue: number().optional(),
4605
4599
  }));
4606
- const SectionSchema$1 = object({
4600
+ const SectionSchema = object({
4607
4601
  sectionId: string(),
4608
4602
  title: string(),
4603
+ subtitle: string().optional(),
4609
4604
  icon: string().optional(),
4610
- queries: array(QuerySchema$1),
4605
+ queries: array(QuerySchema),
4611
4606
  });
4612
4607
  const XFormSchema = object({
4613
4608
  uuid: string(),
@@ -4615,7 +4610,7 @@ const XFormSchema = object({
4615
4610
  logo: string().optional(),
4616
4611
  brandColor: string().optional(),
4617
4612
  logoPosition: string().optional(),
4618
- model: array(SectionSchema$1),
4613
+ model: array(SectionSchema),
4619
4614
  });
4620
4615
 
4621
4616
  /**
@@ -56608,14 +56603,15 @@ const Accordion = ({ design = 'outline', defaultOpenId = "", allowMultiple = fal
56608
56603
  ` } }),
56609
56604
  accordionRoot))));
56610
56605
  };
56611
- const AccordionItem = ({ sectionId, title, children, disabled = false, icon }) => {
56606
+ const AccordionItem = ({ sectionId, title, subtitle, children, disabled = false, icon }) => {
56612
56607
  const { design } = React.useContext(AccordionContext);
56613
56608
  return (React.createElement(Item$2, { value: sectionId, disabled: disabled, className: `v-accordion-item-${design}` },
56614
56609
  React.createElement(Header, { style: { margin: 0 } },
56615
56610
  React.createElement(Trigger2, { className: "v-accordion-trigger" },
56616
56611
  React.createElement(p$5, { align: "center", gap: "3" },
56617
56612
  icon && (React.createElement("div", { style: { display: 'flex', alignItems: 'center', color: 'var(--accordion-title-color, var(--accent-9))' } }, icon)),
56618
- React.createElement(p$d, { size: "3", weight: "bold", style: { color: 'var(--accordion-title-color, var(--gray-12))' } }, title)),
56613
+ React.createElement(p$d, { size: "3", weight: "bold", style: { color: 'var(--accordion-title-color, var(--gray-12))' } }, title),
56614
+ React.createElement(p$d, { size: "2", weight: "light", style: { color: 'var(--accordion-title-color, var(--gray-12))' } }, subtitle)),
56619
56615
  React.createElement(Icon, { name: "chevrondown", height: "20", width: "20", className: "v-accordion-chevron" }))),
56620
56616
  React.createElement(Content2$3, { className: "v-accordion-content", style: { overflow: 'hidden' } },
56621
56617
  React.createElement("div", { style: { padding: '24px 16px 24px 16px' } },
@@ -56884,6 +56880,138 @@ const rangeSliderInputType = ["range", "rangeslider", "rangeinput", "rangeslider
56884
56880
  const toggleInputType = ["toggle", "switch", "toggleinput", "toggle-input", "input-toggle", "inputtoggle"];
56885
56881
  const conditionalInputType = ["conditional", "conditionaltoggle", "conditionalcheckbox", "conditionalselect", "conditional-toggle", "conditional-select", "conditional-checkbox"];
56886
56882
 
56883
+ const DateTimePicker = ({ alias, inputLabel, inputtype = 'datetimepicker-outline', width = 12, newRow, placeholder = "Select date & time", isHinted, hintText, hintUrl, errorText, readOnly, className, formikContext }) => {
56884
+ const defaultFormikContext = formik.useFormikContext();
56885
+ const activeContext = formikContext || defaultFormikContext;
56886
+ if (!activeContext) {
56887
+ console.error(`DateTimePicker '${alias}' must be used within a Formik provider or receive a formikContext prop.`);
56888
+ return null;
56889
+ }
56890
+ const { values, touched, errors, setFieldValue, setFieldTouched } = activeContext;
56891
+ const fieldValue = formik.getIn(values, alias);
56892
+ const fieldTouched = formik.getIn(touched, alias);
56893
+ const fieldError = formik.getIn(errors, alias);
56894
+ const inputId = `${alias}FormInput`;
56895
+ const labelId = `${alias}InputLabel`;
56896
+ const hasError = Boolean(fieldTouched && fieldError);
56897
+ const containerRef = React.useRef(null);
56898
+ const [neuVars, setNeuVars] = React.useState({});
56899
+ React.useEffect(() => {
56900
+ if (inputtype === 'datetimepicker-neumorphic' && containerRef.current) {
56901
+ const parentBg = getNearestParentBackground(containerRef.current.parentElement);
56902
+ setNeuVars({
56903
+ '--neu-bg': parentBg,
56904
+ '--neu-shadow-dark': adjustColor(parentBg, -20),
56905
+ '--neu-shadow-light': adjustColor(parentBg, 20),
56906
+ '--neu-text': 'var(--gray-12)',
56907
+ '--accent': 'var(--accent-9)',
56908
+ });
56909
+ }
56910
+ }, [inputtype]);
56911
+ // --- STYLES ---
56912
+ const getInputStyles = () => {
56913
+ const base = { cursor: 'pointer', transition: 'all 0.2s' };
56914
+ if (inputtype === 'datetimepicker-neumorphic')
56915
+ return Object.assign(Object.assign(Object.assign({}, base), { backgroundColor: 'var(--neu-bg)', border: 'none', boxShadow: hasError ? 'inset 2px 2px 5px var(--red-9), inset -2px -2px 5px var(--neu-shadow-light)'
56916
+ : 'inset 3px 3px 6px var(--neu-shadow-dark), inset -3px -3px 6px var(--neu-shadow-light)', borderRadius: '12px', height: '40px' }), neuVars);
56917
+ if (inputtype === 'datetimepicker-material')
56918
+ return Object.assign(Object.assign({}, base), { backgroundColor: 'var(--gray-2)', border: 'none', borderBottom: hasError ? '2px solid var(--red-9)' : '2px solid var(--gray-8)', borderRadius: '4px 4px 0 0' });
56919
+ return Object.assign(Object.assign({}, base), { backgroundColor: 'transparent', boxShadow: hasError ? '0 0 0 1px var(--red-9)' : '0 0 0 1px var(--gray-7)', borderRadius: '6px' });
56920
+ };
56921
+ return (React.createElement(Column, { span: width, newLine: newRow },
56922
+ React.createElement(p$5, { direction: "column", gap: "2", ref: containerRef, className: className, style: { width: '100%' } },
56923
+ React.createElement("style", null, `
56924
+ .react-datepicker-popper { z-index: 9999 !important; }
56925
+ .react-datepicker {
56926
+ font-family: var(--default-font-family, sans-serif);
56927
+ border: none !important;
56928
+ border-radius: 12px !important;
56929
+ box-shadow: 0 10px 40px -10px rgba(0,0,0,0.2);
56930
+ background-color: var(--color-panel-solid) !important;
56931
+ padding: 12px;
56932
+ display: flex !important; /* Needed for Time column layout */
56933
+ }
56934
+ .react-datepicker__header {
56935
+ background-color: transparent !important;
56936
+ border-bottom: none !important;
56937
+ }
56938
+ .react-datepicker__day-name { color: var(--gray-9); font-weight: 600; text-transform: uppercase; font-size: 0.75rem; }
56939
+ .react-datepicker__day {
56940
+ width: 32px; height: 32px; line-height: 32px;
56941
+ border-radius: 50% !important;
56942
+ margin: 2px !important;
56943
+ color: var(--gray-12);
56944
+ }
56945
+ .react-datepicker__day:hover { background-color: var(--gray-4) !important; }
56946
+ .react-datepicker__day--selected {
56947
+ background-color: var(--accent-9) !important;
56948
+ color: white !important;
56949
+ font-weight: bold;
56950
+ }
56951
+ .react-datepicker__day--keyboard-selected { background-color: var(--accent-3) !important; color: var(--accent-11) !important; }
56952
+ .react-datepicker__day--today { color: var(--accent-11); font-weight: 900; }
56953
+
56954
+ /* --- TIME PICKER SPECIFIC STYLES --- */
56955
+ .react-datepicker__time-container {
56956
+ border-left: 1px solid var(--gray-5) !important;
56957
+ width: 110px !important;
56958
+ background: transparent !important;
56959
+ }
56960
+ .react-datepicker__header--time {
56961
+ background: transparent !important;
56962
+ padding-top: 10px;
56963
+ padding-bottom: 10px;
56964
+ }
56965
+ .react-datepicker-time__header {
56966
+ color: var(--gray-11) !important;
56967
+ font-size: 0.75rem !important;
56968
+ text-transform: uppercase;
56969
+ }
56970
+ .react-datepicker__time-list-item {
56971
+ height: 32px !important;
56972
+ display: flex !important;
56973
+ align-items: center !important;
56974
+ justify-content: center !important;
56975
+ font-size: 0.9rem !important;
56976
+ color: var(--gray-12);
56977
+ }
56978
+ .react-datepicker__time-list-item:hover {
56979
+ background-color: var(--gray-4) !important;
56980
+ }
56981
+ .react-datepicker__time-list-item--selected {
56982
+ background-color: var(--accent-9) !important;
56983
+ color: white !important;
56984
+ font-weight: bold;
56985
+ }
56986
+
56987
+ /* Custom Scrollbar for Time List */
56988
+ .react-datepicker__time-list::-webkit-scrollbar { width: 4px; }
56989
+ .react-datepicker__time-list::-webkit-scrollbar-thumb { background: var(--gray-6); border-radius: 4px; }
56990
+
56991
+ /* Neumorphic Popup Overrides */
56992
+ ${inputtype === 'datetimepicker-neumorphic' ? `
56993
+ .react-datepicker {
56994
+ background-color: var(--neu-bg) !important;
56995
+ box-shadow: 6px 6px 12px var(--neu-shadow-dark), -6px -6px 12px var(--neu-shadow-light);
56996
+ }
56997
+ .react-datepicker__day:hover, .react-datepicker__time-list-item:hover { box-shadow: 3px 3px 6px var(--neu-shadow-dark), -3px -3px 6px var(--neu-shadow-light); background: transparent !important; }
56998
+ .react-datepicker__day--selected, .react-datepicker__time-list-item--selected { box-shadow: inset 2px 2px 5px var(--neu-shadow-dark), inset -2px -2px 5px var(--neu-shadow-light); color: var(--accent) !important; background: var(--neu-bg) !important; }
56999
+ ` : ''}
57000
+ `),
57001
+ React.createElement(DatePicker$1, { id: `${alias}DatePicker`, selected: (fieldValue && new Date(fieldValue)) || null, onChange: (val) => {
57002
+ setFieldValue(alias, val);
57003
+ setFieldTouched(alias, true, false);
57004
+ }, showTimeSelect: true, timeFormat: "HH:mm", timeIntervals: 15, dateFormat: "MMM d, yyyy h:mm aa", disabled: readOnly, placeholderText: placeholder, "aria-labelledby": labelId, customInput: React.createElement(u, { id: inputId, variant: "surface", style: getInputStyles() },
57005
+ React.createElement(c, null,
57006
+ React.createElement(Icon, { name: "clock", height: "16", width: "16", style: { color: 'var(--gray-10)' } }))) }),
57007
+ React.createElement("div", null,
57008
+ inputLabel && React.createElement(p$d, { id: labelId, size: "2", weight: "bold", as: "div", style: { display: 'inline' } }, inputLabel),
57009
+ isHinted && (React.createElement(e, { content: hintText || "No hint", align: "start" },
57010
+ React.createElement("a", { href: hintUrl || "#", target: "_blank", rel: "noopener noreferrer", style: { marginLeft: 6 } },
57011
+ React.createElement(Icon, { name: "questionmarkcircled", height: "16", width: "16", style: { cursor: 'pointer', color: 'gray' } })))),
57012
+ hasError && (React.createElement(p$d, { size: "1", color: "red", style: { display: 'block' } }, errorText || (typeof fieldError === 'string' ? fieldError : "Required field")))))));
57013
+ };
57014
+
56887
57015
  const Teletraan1 = ({ xFormModel, readOnlyMode = false, displayMode = 'codice', brandColor = "#000000", onPrev, onNext, onFinish }) => {
56888
57016
  const [dualToggled, setDualToggled] = React.useState(false);
56889
57017
  const [neuVars] = React.useState({
@@ -56925,8 +57053,9 @@ const Teletraan1 = ({ xFormModel, readOnlyMode = false, displayMode = 'codice',
56925
57053
  case datePickerInputType.includes(normalizedType):
56926
57054
  return React.createElement(DatePicker, Object.assign({}, layoutProps, { placeholder: inputPlaceholder }));
56927
57055
  case dateRangePickerInputType.includes(normalizedType):
57056
+ return React.createElement(DateRangePicker, Object.assign({}, layoutProps, { placeholder: inputPlaceholder }));
56928
57057
  case dateTimePickerInputType.includes(normalizedType):
56929
- return React.createElement(DateRangePicker, Object.assign({}, layoutProps));
57058
+ return React.createElement(DateTimePicker, Object.assign({}, layoutProps, { placeholder: inputPlaceholder }));
56930
57059
  case dropdownInputType.includes(normalizedType):
56931
57060
  return React.createElement(Dropdown, Object.assign({}, layoutProps, { placeholder: inputPlaceholder, inputOptions: inputOptions || [InputOptionsPlaceholder] }));
56932
57061
  case fileInputType.includes(normalizedType):
@@ -56988,23 +57117,23 @@ const Teletraan1 = ({ xFormModel, readOnlyMode = false, displayMode = 'codice',
56988
57117
  React.createElement("div", { className: "neu-indicator" })),
56989
57118
  React.createElement(Icon, { name: "layers", height: "20", width: "20", color: brandColor, style: { opacity: readOnlyMode ? 0.5 : 1, cursor: 'pointer' }, onClick: () => setDualToggled(!dualToggled) })),
56990
57119
  dualToggled ?
56991
- React.createElement(Accordion, { defaultOpenId: ((_b = (_a = xFormModel.model) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.sectionId) ? String(xFormModel.model[0].sectionId) : '', allowMultiple: true, brandcolor: brandColor, titleColor: '#ffffff' }, xFormModel.model.map((formsection) => (React.createElement(AccordionItem, { key: formsection.sectionId, sectionId: String(formsection.sectionId), title: formsection.title, icon: React.createElement(Icon, { name: formsection.icon || "fontfamily" }) },
57120
+ React.createElement(Accordion, { defaultOpenId: ((_b = (_a = xFormModel.model) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.sectionId) ? String(xFormModel.model[0].sectionId) : '', allowMultiple: true, brandcolor: brandColor, titleColor: '#ffffff' }, xFormModel.model.map((formsection) => (React.createElement(AccordionItem, { key: formsection.sectionId, sectionId: String(formsection.sectionId), title: formsection.title, subtitle: formsection.subtitle ? formsection.subtitle : undefined, icon: React.createElement(Icon, { name: formsection.icon || "fontfamily" }) },
56992
57121
  React.createElement(Row, { key: formsection.sectionId }, renderQueries(formsection.queries))))))
56993
57122
  :
56994
57123
  xFormModel.model.map((formsection) => (React.createElement(React.Fragment, { key: formsection.sectionId || crypto.randomUUID() },
56995
- React.createElement(SectionTitle, { withSeparator: false, backgroundColor: brandColor, titleColor: '#FFFFFF', title: formsection.title, icon: React.createElement(Icon, { name: formsection.icon || "fontfamily" }) }),
57124
+ React.createElement(SectionTitle, { withSeparator: false, backgroundColor: brandColor, titleColor: '#FFFFFF', title: formsection.title, subTitle: formsection.subtitle ? formsection.subtitle : undefined, icon: React.createElement(Icon, { name: formsection.icon || "fontfamily" }) }),
56996
57125
  React.createElement(Row, null, renderQueries(formsection.queries)))))));
56997
57126
  case 'accordion':
56998
- return (React.createElement(Accordion, { defaultOpenId: ((_d = (_c = xFormModel.model) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.sectionId) ? String(xFormModel.model[0].sectionId) : '', allowMultiple: true, brandcolor: brandColor, titleColor: '#ffffff' }, xFormModel.model.map((formsection) => (React.createElement(AccordionItem, { key: formsection.sectionId, sectionId: String(formsection.sectionId), title: formsection.title, icon: React.createElement(Icon, { name: formsection.icon || "fontfamily" }) },
57127
+ return (React.createElement(Accordion, { defaultOpenId: ((_d = (_c = xFormModel.model) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.sectionId) ? String(xFormModel.model[0].sectionId) : '', allowMultiple: true, brandcolor: brandColor, titleColor: '#ffffff' }, xFormModel.model.map((formsection) => (React.createElement(AccordionItem, { key: formsection.sectionId, sectionId: String(formsection.sectionId), title: formsection.title, subtitle: formsection.subtitle ? formsection.subtitle : undefined, icon: React.createElement(Icon, { name: formsection.icon || "fontfamily" }) },
56999
57128
  React.createElement(Row, { key: formsection.sectionId }, renderQueries(formsection.queries)))))));
57000
57129
  case 'codex':
57001
- return (React.createElement(Codex, { brandColor: brandColor }, xFormModel.model.map((formsection, index, array) => (React.createElement(CodexItem, { key: formsection.sectionId, stepId: String(formsection.sectionId), title: formsection.title, icon: React.createElement(Icon, { name: formsection.icon || "fontfamily" }) },
57130
+ return (React.createElement(Codex, { brandColor: brandColor }, xFormModel.model.map((formsection, index, array) => (React.createElement(CodexItem, { key: formsection.sectionId, stepId: String(formsection.sectionId), title: formsection.title, subtitleDescription: formsection.subtitle ? formsection.subtitle : undefined, icon: React.createElement(Icon, { name: formsection.icon || "fontfamily" }) },
57002
57131
  React.createElement(Row, { key: formsection.sectionId }, renderQueries(formsection.queries)),
57003
57132
  React.createElement(CodexControls, { prevStepId: index > 0 ? String(array[index - 1].sectionId) : undefined, nextStepId: index < array.length - 1 ? String(array[index + 1].sectionId) : undefined, onPrev: onPrev, onNext: onNext, onFinish: onFinish }))))));
57004
57133
  case 'codice':
57005
57134
  default:
57006
57135
  return (React.createElement(React.Fragment, { key: xFormModel.uuid }, xFormModel.model.map((formsection) => (React.createElement(React.Fragment, { key: formsection.sectionId || crypto.randomUUID() },
57007
- React.createElement(SectionTitle, { withSeparator: false, backgroundColor: brandColor, titleColor: '#FFFFFF', title: formsection.title, icon: React.createElement(Icon, { name: String(formsection.icon) }) }),
57136
+ React.createElement(SectionTitle, { withSeparator: false, backgroundColor: brandColor, titleColor: '#FFFFFF', title: formsection.title, subTitle: formsection.subtitle ? formsection.subtitle : undefined, icon: React.createElement(Icon, { name: String(formsection.icon) }) }),
57008
57137
  React.createElement(Row, null, renderQueries(formsection.queries)))))));
57009
57138
  }
57010
57139
  };
@@ -57248,14 +57377,15 @@ class VectorSigma {
57248
57377
  * VΣ builder method to create a Section object in the xForm model.
57249
57378
  * @param sectionId sectionId string for the xForm model section.
57250
57379
  * @param title title string for the xForm model section.
57380
+ * @param subtitle optional subtitle string for the xForm model section.
57251
57381
  * @param icon xForm icon name for the xForm model section.
57252
57382
  * @example
57253
57383
  * const xForm97 = new VectorSigma()
57254
57384
  * .setBrand("#000000", brandLogoUrlRef, 'right')
57255
- * .createSection('bio-data', 'Personal Information', 'user')
57385
+ * .createSection('bio-data', 'Personal Information', 'Help us learn more to deliver a bespoke experience', 'user')
57256
57386
  */
57257
- createSection(sectionId, title, icon) {
57258
- this.formObject.model.push({ sectionId, title, icon, queries: [] });
57387
+ createSection(sectionId, title, subtitle, icon) {
57388
+ this.formObject.model.push({ sectionId, title, subtitle, icon, queries: [] });
57259
57389
  return this;
57260
57390
  }
57261
57391
  /**
@@ -57389,138 +57519,6 @@ class VectorSigma {
57389
57519
  }
57390
57520
  }
57391
57521
 
57392
- const DateTimePicker = ({ alias, inputLabel, inputtype = 'datetimepicker-outline', width = 12, newRow, placeholder = "Select date & time", isHinted, hintText, hintUrl, errorText, readOnly, className, formikContext }) => {
57393
- const defaultFormikContext = formik.useFormikContext();
57394
- const activeContext = formikContext || defaultFormikContext;
57395
- if (!activeContext) {
57396
- console.error(`DateTimePicker '${alias}' must be used within a Formik provider or receive a formikContext prop.`);
57397
- return null;
57398
- }
57399
- const { values, touched, errors, setFieldValue, setFieldTouched } = activeContext;
57400
- const fieldValue = formik.getIn(values, alias);
57401
- const fieldTouched = formik.getIn(touched, alias);
57402
- const fieldError = formik.getIn(errors, alias);
57403
- const inputId = `${alias}FormInput`;
57404
- const labelId = `${alias}InputLabel`;
57405
- const hasError = Boolean(fieldTouched && fieldError);
57406
- const containerRef = React.useRef(null);
57407
- const [neuVars, setNeuVars] = React.useState({});
57408
- React.useEffect(() => {
57409
- if (inputtype === 'datetimepicker-neumorphic' && containerRef.current) {
57410
- const parentBg = getNearestParentBackground(containerRef.current.parentElement);
57411
- setNeuVars({
57412
- '--neu-bg': parentBg,
57413
- '--neu-shadow-dark': adjustColor(parentBg, -20),
57414
- '--neu-shadow-light': adjustColor(parentBg, 20),
57415
- '--neu-text': 'var(--gray-12)',
57416
- '--accent': 'var(--accent-9)',
57417
- });
57418
- }
57419
- }, [inputtype]);
57420
- // --- STYLES ---
57421
- const getInputStyles = () => {
57422
- const base = { cursor: 'pointer', transition: 'all 0.2s' };
57423
- if (inputtype === 'datetimepicker-neumorphic')
57424
- return Object.assign(Object.assign(Object.assign({}, base), { backgroundColor: 'var(--neu-bg)', border: 'none', boxShadow: hasError ? 'inset 2px 2px 5px var(--red-9), inset -2px -2px 5px var(--neu-shadow-light)'
57425
- : 'inset 3px 3px 6px var(--neu-shadow-dark), inset -3px -3px 6px var(--neu-shadow-light)', borderRadius: '12px', height: '40px' }), neuVars);
57426
- if (inputtype === 'datetimepicker-material')
57427
- return Object.assign(Object.assign({}, base), { backgroundColor: 'var(--gray-2)', border: 'none', borderBottom: hasError ? '2px solid var(--red-9)' : '2px solid var(--gray-8)', borderRadius: '4px 4px 0 0' });
57428
- return Object.assign(Object.assign({}, base), { backgroundColor: 'transparent', boxShadow: hasError ? '0 0 0 1px var(--red-9)' : '0 0 0 1px var(--gray-7)', borderRadius: '6px' });
57429
- };
57430
- return (React.createElement(Column, { span: width, newLine: newRow },
57431
- React.createElement(p$5, { direction: "column", gap: "2", ref: containerRef, className: className, style: { width: '100%' } },
57432
- React.createElement("style", null, `
57433
- .react-datepicker-popper { z-index: 9999 !important; }
57434
- .react-datepicker {
57435
- font-family: var(--default-font-family, sans-serif);
57436
- border: none !important;
57437
- border-radius: 12px !important;
57438
- box-shadow: 0 10px 40px -10px rgba(0,0,0,0.2);
57439
- background-color: var(--color-panel-solid) !important;
57440
- padding: 12px;
57441
- display: flex !important; /* Needed for Time column layout */
57442
- }
57443
- .react-datepicker__header {
57444
- background-color: transparent !important;
57445
- border-bottom: none !important;
57446
- }
57447
- .react-datepicker__day-name { color: var(--gray-9); font-weight: 600; text-transform: uppercase; font-size: 0.75rem; }
57448
- .react-datepicker__day {
57449
- width: 32px; height: 32px; line-height: 32px;
57450
- border-radius: 50% !important;
57451
- margin: 2px !important;
57452
- color: var(--gray-12);
57453
- }
57454
- .react-datepicker__day:hover { background-color: var(--gray-4) !important; }
57455
- .react-datepicker__day--selected {
57456
- background-color: var(--accent-9) !important;
57457
- color: white !important;
57458
- font-weight: bold;
57459
- }
57460
- .react-datepicker__day--keyboard-selected { background-color: var(--accent-3) !important; color: var(--accent-11) !important; }
57461
- .react-datepicker__day--today { color: var(--accent-11); font-weight: 900; }
57462
-
57463
- /* --- TIME PICKER SPECIFIC STYLES --- */
57464
- .react-datepicker__time-container {
57465
- border-left: 1px solid var(--gray-5) !important;
57466
- width: 110px !important;
57467
- background: transparent !important;
57468
- }
57469
- .react-datepicker__header--time {
57470
- background: transparent !important;
57471
- padding-top: 10px;
57472
- padding-bottom: 10px;
57473
- }
57474
- .react-datepicker-time__header {
57475
- color: var(--gray-11) !important;
57476
- font-size: 0.75rem !important;
57477
- text-transform: uppercase;
57478
- }
57479
- .react-datepicker__time-list-item {
57480
- height: 32px !important;
57481
- display: flex !important;
57482
- align-items: center !important;
57483
- justify-content: center !important;
57484
- font-size: 0.9rem !important;
57485
- color: var(--gray-12);
57486
- }
57487
- .react-datepicker__time-list-item:hover {
57488
- background-color: var(--gray-4) !important;
57489
- }
57490
- .react-datepicker__time-list-item--selected {
57491
- background-color: var(--accent-9) !important;
57492
- color: white !important;
57493
- font-weight: bold;
57494
- }
57495
-
57496
- /* Custom Scrollbar for Time List */
57497
- .react-datepicker__time-list::-webkit-scrollbar { width: 4px; }
57498
- .react-datepicker__time-list::-webkit-scrollbar-thumb { background: var(--gray-6); border-radius: 4px; }
57499
-
57500
- /* Neumorphic Popup Overrides */
57501
- ${inputtype === 'datetimepicker-neumorphic' ? `
57502
- .react-datepicker {
57503
- background-color: var(--neu-bg) !important;
57504
- box-shadow: 6px 6px 12px var(--neu-shadow-dark), -6px -6px 12px var(--neu-shadow-light);
57505
- }
57506
- .react-datepicker__day:hover, .react-datepicker__time-list-item:hover { box-shadow: 3px 3px 6px var(--neu-shadow-dark), -3px -3px 6px var(--neu-shadow-light); background: transparent !important; }
57507
- .react-datepicker__day--selected, .react-datepicker__time-list-item--selected { box-shadow: inset 2px 2px 5px var(--neu-shadow-dark), inset -2px -2px 5px var(--neu-shadow-light); color: var(--accent) !important; background: var(--neu-bg) !important; }
57508
- ` : ''}
57509
- `),
57510
- React.createElement(DatePicker$1, { id: `${alias}DatePicker`, selected: (fieldValue && new Date(fieldValue)) || null, onChange: (val) => {
57511
- setFieldValue(alias, val);
57512
- setFieldTouched(alias, true, false);
57513
- }, showTimeSelect: true, timeFormat: "HH:mm", timeIntervals: 15, dateFormat: "MMM d, yyyy h:mm aa", disabled: readOnly, placeholderText: placeholder, "aria-labelledby": labelId, customInput: React.createElement(u, { id: inputId, variant: "surface", style: getInputStyles() },
57514
- React.createElement(c, null,
57515
- React.createElement(Icon, { name: "clock", height: "16", width: "16", style: { color: 'var(--gray-10)' } }))) }),
57516
- React.createElement("div", null,
57517
- inputLabel && React.createElement(p$d, { id: labelId, size: "2", weight: "bold", as: "div", style: { display: 'inline' } }, inputLabel),
57518
- isHinted && (React.createElement(e, { content: hintText || "No hint", align: "start" },
57519
- React.createElement("a", { href: hintUrl || "#", target: "_blank", rel: "noopener noreferrer", style: { marginLeft: 6 } },
57520
- React.createElement(Icon, { name: "questionmarkcircled", height: "16", width: "16", style: { cursor: 'pointer', color: 'gray' } })))),
57521
- hasError && (React.createElement(p$d, { size: "1", color: "red", style: { display: 'block' } }, errorText || (typeof fieldError === 'string' ? fieldError : "Required field")))))));
57522
- };
57523
-
57524
57522
  const safeParseUuidFormat = (typeString) => {
57525
57523
  try {
57526
57524
  if (!(typeString === null || typeString === void 0 ? void 0 : typeString.startsWith('uuid')))
@@ -57618,77 +57616,6 @@ const Container = (_a) => {
57618
57616
  return (React.createElement(p$2, Object.assign({ size: "3", px: "3" }, props), children));
57619
57617
  };
57620
57618
 
57621
- // JSON defintion (schema) for xForm object
57622
- const InputOptionSchema = object({
57623
- optionid: number().or(uuid()),
57624
- text: string(),
57625
- optionvalue: string(),
57626
- tag: string().optional(),
57627
- score: number().or(float64()).optional(),
57628
- note: string().optional(),
57629
- optionurl: url().optional(),
57630
- });
57631
- const NestedQuerySchema = object({
57632
- queryId: number().or(uuid()),
57633
- inputType: string(),
57634
- inputAlias: string(),
57635
- inputLabel: string(),
57636
- inputPlaceholder: string(),
57637
- defaultValue: any().optional(),
57638
- minValue: number().optional(),
57639
- maxValue: number().optional(),
57640
- stepValue: number().or(float64()).optional(),
57641
- newRow: boolean(),
57642
- inputWidth: number(),
57643
- inputHeight: number().optional(),
57644
- isRequired: boolean(),
57645
- isHinted: boolean(),
57646
- hintText: string().nullish(),
57647
- hintUrl: url().nullish(),
57648
- queryResponse: any().nullable(),
57649
- inputOptions: array(InputOptionSchema).optional(),
57650
- toggledInput: any().nullable().optional(),
57651
- triggerValue: any().nullable().optional(),
57652
- errorText: string().optional()
57653
- });
57654
- const QuerySchema = object({
57655
- queryId: number().or(uuid()),
57656
- inputType: string(),
57657
- inputAlias: string(),
57658
- inputLabel: string(),
57659
- inputPlaceholder: string(),
57660
- defaultValue: any().optional(),
57661
- minValue: number().optional(),
57662
- maxValue: number().optional(),
57663
- stepValue: number().or(float64()).optional(),
57664
- newRow: boolean(),
57665
- inputWidth: number(),
57666
- inputHeight: number().optional(),
57667
- isRequired: boolean(),
57668
- isHinted: boolean(),
57669
- hintText: string().nullable(),
57670
- hintUrl: url().nullable(),
57671
- queryResponse: any().nullable(),
57672
- inputOptions: array(InputOptionSchema).optional(),
57673
- toggledInput: NestedQuerySchema.nullable().optional(),
57674
- triggerValue: any().nullable().optional(),
57675
- errorText: string().optional()
57676
- });
57677
- const SectionSchema = object({
57678
- sectionId: number().or(string()),
57679
- title: string(),
57680
- icon: string().nullable(),
57681
- queries: array(QuerySchema)
57682
- });
57683
- const xFormSchema = object({
57684
- uuid: uuid(),
57685
- name: string(),
57686
- logo: url().nullable(),
57687
- brandcolor: string().nullable(),
57688
- logoPosition: string().nullable(),
57689
- model: array(SectionSchema),
57690
- });
57691
-
57692
57619
  const parseUuidFormat = (input) => {
57693
57620
  if (!input.toLowerCase().startsWith('uuid')) {
57694
57621
  return [4, 4, 4, 4];
@@ -57725,13 +57652,16 @@ exports.FlagIcon = FlagIcon;
57725
57652
  exports.Icon = Icon;
57726
57653
  exports.ImageOutput = ImageOutput;
57727
57654
  exports.Input = Input$1;
57655
+ exports.InputOptionSchema = InputOptionSchema;
57728
57656
  exports.MultipleSelect = MultipleSelect;
57729
57657
  exports.OptionSelect = OptionSelect;
57730
57658
  exports.PasswordInput = PasswordInput;
57731
57659
  exports.PhoneInput = PhoneInput;
57660
+ exports.QuerySchema = QuerySchema;
57732
57661
  exports.RadioGroupInput = RadioGroupInput;
57733
57662
  exports.RangeSlider = RangeSlider;
57734
57663
  exports.Row = Row;
57664
+ exports.SectionSchema = SectionSchema;
57735
57665
  exports.SectionTitle = SectionTitle;
57736
57666
  exports.SliderInput = SliderInput;
57737
57667
  exports.StockInput = StockInput;
@@ -57741,8 +57671,8 @@ exports.ThemePanel = N;
57741
57671
  exports.Toggle = Toggle;
57742
57672
  exports.UUIDInput = UUIDInput;
57743
57673
  exports.VectorSigma = VectorSigma;
57674
+ exports.XFormSchema = XFormSchema;
57744
57675
  exports.normalizeXForm = normalizeXForm;
57745
57676
  exports.parseUuidFormat = parseUuidFormat;
57746
57677
  exports.primeMatrix = primeMatrix;
57747
57678
  exports.useStepper = useStepper;
57748
- exports.xFormSchema = xFormSchema;