@emeraldemperaur/vector-sigma 1.4.29 → 1.4.31
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 +139 -13
- package/lib/index.esm.js +139 -14
- package/lib/types/index.d.ts +1 -0
- package/lib/types/layouts/codex/codexcontrols.d.ts +6 -1
- package/lib/types/teletraan1.d.ts +2 -2
- package/lib/types/tests/components/components.avatar.test.d.ts +1 -0
- package/lib/types/tests/components/components.button.test.d.ts +1 -0
- package/lib/types/tests/components/components.checkboxgroup.test.d.ts +1 -0
- package/lib/types/tests/components/components.conditional.test.d.ts +1 -0
- package/lib/types/tests/components/components.datepickers.test.d.ts +1 -0
- package/lib/types/tests/components/components.files.test.d.ts +1 -0
- package/lib/types/tests/components/components.iconimage.test.d.ts +1 -0
- package/lib/types/tests/components/components.inputs.finance.test.d.ts +1 -0
- package/lib/types/tests/components/components.inputs.test.d.ts +1 -0
- package/lib/types/tests/components/components.radiogroup.test.d.ts +1 -0
- package/lib/types/tests/components/components.rangeslider.test.d.ts +1 -0
- package/lib/types/tests/components/components.sectiontitle.test.d.ts +1 -0
- package/lib/types/tests/components/components.selectors.test.d.ts +1 -0
- package/lib/types/tests/layouts/layouts.accordion.test.d.ts +1 -0
- package/lib/types/tests/layouts/layouts.codex.test.d.ts +1 -0
- package/lib/types/tests/layouts/layouts.column.test.d.ts +1 -0
- package/lib/types/tests/layouts/layouts.container.test.d.ts +1 -0
- package/lib/types/tests/layouts/layouts.row.test.d.ts +1 -0
- package/lib/types/tests/orion.test.d.ts +0 -0
- package/lib/types/tests/utils/utils.chronos.test.d.ts +1 -0
- package/lib/types/tests/utils/utils.minerva.test.d.ts +1 -0
- package/lib/types/tests/utils/utils.uuid.test.d.ts +1 -0
- package/lib/types/tests/utils/utils.vinci.test.d.ts +1 -0
- package/lib/types/utils/artificer.d.ts +2 -0
- package/lib/types/utils/minerva.d.ts +10 -0
- package/lib/types/utils/vinci.d.ts +1 -1
- package/lib/types/utils/voltaire.d.ts +2 -0
- package/lib/types/utils/voltron.d.ts +54 -0
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -13052,13 +13052,13 @@ const CheckboxGroupInput = (_a) => {
|
|
|
13052
13052
|
` } })),
|
|
13053
13053
|
React.createElement(o$6, { columns: columns || (direction === 'row' ? 'repeat(auto-fit, minmax(100px, 1fr))' : '1'), gap: "3", style: neuVars }, inputOptions.map((inputoption) => {
|
|
13054
13054
|
const isChecked = currentValues.some(val => String(val) === String(inputoption.optionvalue));
|
|
13055
|
-
return (React.createElement(p$d, { as: "label", key: inputoption.optionvalue || crypto.randomUUID(), size: "2", style: {
|
|
13055
|
+
return (React.createElement(p$d, { as: "label", key: String(inputoption.optionvalue) || crypto.randomUUID(), size: "2", style: {
|
|
13056
13056
|
display: 'flex',
|
|
13057
13057
|
alignItems: 'center',
|
|
13058
13058
|
gap: '8px',
|
|
13059
13059
|
cursor: 'pointer'
|
|
13060
13060
|
} },
|
|
13061
|
-
React.createElement(c$2, { name: alias, id: `${alias}FormInput${inputoption.optionid}`, "aria-describedby": `${alias}InputLabel${inputoption.optionid}`, disabled: readOnly, value: inputoption.optionvalue, checked: isChecked, onCheckedChange: (checked) => handleCheckedChange(checked, inputoption.optionvalue), variant: inputtype === 'checkbox-outline' ? 'soft' : 'surface', className: inputtype === 'checkbox-neumorphic' ? 'neu-checkbox' : '', style: Object.assign({}, (inputtype === 'checkbox-outline' ? {
|
|
13061
|
+
React.createElement(c$2, { name: alias, id: `${alias}FormInput${inputoption.optionid}`, "aria-describedby": `${alias}InputLabel${inputoption.optionid}`, disabled: readOnly, value: String(inputoption.optionvalue), checked: isChecked, onCheckedChange: (checked) => handleCheckedChange(checked, String(inputoption.optionvalue)), variant: inputtype === 'checkbox-outline' ? 'soft' : 'surface', className: inputtype === 'checkbox-neumorphic' ? 'neu-checkbox' : '', style: Object.assign({}, (inputtype === 'checkbox-outline' ? {
|
|
13062
13062
|
border: isChecked ? '2px solid var(--accent-9)' : '2px solid var(--gray-8)',
|
|
13063
13063
|
backgroundColor: 'transparent'
|
|
13064
13064
|
} : {})) }),
|
|
@@ -13135,7 +13135,7 @@ const ConditionalTrigger = (_a) => {
|
|
|
13135
13135
|
return (React.createElement(p$5, { direction: "column", gap: "1", style: { width: '100%' } },
|
|
13136
13136
|
React.createElement(C$1, { name: alias, disabled: readOnly, value: fieldValue, defaultValue: placeholder || "", onValueChange: handleChange },
|
|
13137
13137
|
React.createElement(u$1, { id: inputId, variant: isNeumorphic ? 'soft' : 'surface', style: { width: '100%' } }),
|
|
13138
|
-
React.createElement(g, null, inputOptions.map((inputoption) => (React.createElement(v, { key: inputoption.optionvalue || crypto.randomUUID(), value: inputoption.optionvalue }, inputoption.text)))))));
|
|
13138
|
+
React.createElement(g, null, inputOptions.map((inputoption) => (React.createElement(v, { key: String(inputoption.optionvalue) || crypto.randomUUID(), value: String(inputoption.optionvalue) }, inputoption.text)))))));
|
|
13139
13139
|
case inputtype.includes('conditionaltoggle'):
|
|
13140
13140
|
default:
|
|
13141
13141
|
return (React.createElement(p$5, { justify: "between", align: "center", style: { width: '100%' } },
|
|
@@ -27267,10 +27267,10 @@ const Dropdown = (_a) => {
|
|
|
27267
27267
|
React.createElement(v, { value: "__RESET__", className: inputtype === 'dropdown-neumorphic' ? 'neu-select-item' : '', style: { color: 'var(--gray-10)', fontStyle: 'italic' } }, placeholder || "Select an option"),
|
|
27268
27268
|
React.createElement(o$2, { size: "4", style: { margin: '4px 0', opacity: 0.5 } }),
|
|
27269
27269
|
inputOptions.map((inputoption) => (React.createElement(React.Fragment, { key: inputoption.optionid || crypto.randomUUID() }, inputoption.optionurl ?
|
|
27270
|
-
React.createElement(v, { id: String(inputoption.optionid) || '', value: inputoption.optionvalue, className: inputtype === 'dropdown-neumorphic' ? 'neu-select-item' : '' },
|
|
27270
|
+
React.createElement(v, { id: String(inputoption.optionid) || '', value: String(inputoption.optionvalue), className: inputtype === 'dropdown-neumorphic' ? 'neu-select-item' : '' },
|
|
27271
27271
|
React.createElement("a", { onClick: (e) => { e.stopPropagation(); openLink(inputoption.optionurl || "#"); }, style: { textDecoration: 'none', color: 'inherit' } }, inputoption.text))
|
|
27272
27272
|
:
|
|
27273
|
-
React.createElement(v, { id: String(inputoption.optionid) || '', value: inputoption.optionvalue, className: inputtype === 'dropdown-neumorphic' ? 'neu-select-item' : '' }, inputoption.text)))))),
|
|
27273
|
+
React.createElement(v, { id: String(inputoption.optionid) || '', value: String(inputoption.optionvalue), className: inputtype === 'dropdown-neumorphic' ? 'neu-select-item' : '' }, inputoption.text)))))),
|
|
27274
27274
|
React.createElement("div", null,
|
|
27275
27275
|
React.createElement(p$d, { id: `${alias}InputLabel`, as: "label", size: "2", weight: "bold", htmlFor: inputId }, inputLabel),
|
|
27276
27276
|
"\u00A0",
|
|
@@ -48234,9 +48234,9 @@ const RadioGroupInput = (_a) => {
|
|
|
48234
48234
|
} },
|
|
48235
48235
|
React.createElement(o$6, { columns: columns || (direction === 'row' ? 'repeat(auto-fit, minmax(100px, 1fr))' : '1'), gap: "3", style: neuVars }, inputOptions.map((inputoption) => {
|
|
48236
48236
|
const isChecked = String(fieldValue) === String(inputoption.optionvalue);
|
|
48237
|
-
return (React.createElement(p$5, { asChild: true, key: inputoption.optionvalue, align: "center", gap: "2" },
|
|
48237
|
+
return (React.createElement(p$5, { asChild: true, key: String(inputoption.optionvalue), align: "center", gap: "2" },
|
|
48238
48238
|
React.createElement(p$d, { as: "label", size: "2", style: { cursor: 'pointer' } },
|
|
48239
|
-
React.createElement(y$1, { value: inputoption.optionvalue, className: inputtype === 'radio-neumorphic' ? 'neu-radio' : '', style: Object.assign({}, (inputtype === 'radio-outline' ? {
|
|
48239
|
+
React.createElement(y$1, { value: String(inputoption.optionvalue), className: inputtype === 'radio-neumorphic' ? 'neu-radio' : '', style: Object.assign({}, (inputtype === 'radio-outline' ? {
|
|
48240
48240
|
border: isChecked ? '2px solid var(--accent-9)' : '2px solid var(--gray-8)',
|
|
48241
48241
|
backgroundColor: 'transparent'
|
|
48242
48242
|
} : {})) }),
|
|
@@ -48362,8 +48362,8 @@ const OptionSelect = (_a) => {
|
|
|
48362
48362
|
React.createElement(g, { position: "popper", sideOffset: 5, style: activeContentStyle },
|
|
48363
48363
|
React.createElement(v, { value: "__RESET__", className: inputtype === 'dropdown-neumorphic' ? 'neu-select-item' : '', style: { color: 'var(--gray-10)', fontStyle: 'italic' } }, placeholder || "Select an option"),
|
|
48364
48364
|
React.createElement(o$2, { size: "4", style: { margin: '4px 0', opacity: 0.5 } }),
|
|
48365
|
-
inputOptions.map((inputoption) => (React.createElement(React.Fragment, { key: inputoption.optionid || crypto.randomUUID() }, inputoption.optionurl ? (React.createElement(v, { id: String(inputoption.optionid) || '', value: inputoption.optionvalue, className: inputtype === 'dropdown-neumorphic' ? 'neu-select-item' : '' },
|
|
48366
|
-
React.createElement("a", { onClick: (e) => { e.stopPropagation(); openLink(inputoption.optionurl || "#"); }, style: { textDecoration: 'none', color: 'inherit' } }, inputoption.text))) : (React.createElement(v, { id: String(inputoption.optionid) || '', value: inputoption.optionvalue, className: inputtype === 'dropdown-neumorphic' ? 'neu-select-item' : '' }, inputoption.text))))))),
|
|
48365
|
+
inputOptions.map((inputoption) => (React.createElement(React.Fragment, { key: inputoption.optionid || crypto.randomUUID() }, inputoption.optionurl ? (React.createElement(v, { id: String(inputoption.optionid) || '', value: String(inputoption.optionvalue), className: inputtype === 'dropdown-neumorphic' ? 'neu-select-item' : '' },
|
|
48366
|
+
React.createElement("a", { onClick: (e) => { e.stopPropagation(); openLink(inputoption.optionurl || "#"); }, style: { textDecoration: 'none', color: 'inherit' } }, inputoption.text))) : (React.createElement(v, { id: String(inputoption.optionid) || '', value: String(inputoption.optionvalue), className: inputtype === 'dropdown-neumorphic' ? 'neu-select-item' : '' }, inputoption.text))))))),
|
|
48367
48367
|
React.createElement("div", null,
|
|
48368
48368
|
React.createElement(p$d, { id: `${alias}InputLabel`, as: "label", size: "2", weight: "bold", htmlFor: `${alias}FormInput` }, inputLabel),
|
|
48369
48369
|
"\u00A0",
|
|
@@ -48404,7 +48404,7 @@ const MultipleSelect = (_a) => {
|
|
|
48404
48404
|
};
|
|
48405
48405
|
const displayLabel = selectedValues.length > 0
|
|
48406
48406
|
? inputOptions
|
|
48407
|
-
.filter(inputoption => selectedValues.includes(inputoption.optionvalue))
|
|
48407
|
+
.filter(inputoption => selectedValues.includes(String(inputoption.optionvalue)))
|
|
48408
48408
|
.map(inputoption => inputoption.text)
|
|
48409
48409
|
.join(', ')
|
|
48410
48410
|
: placeholder;
|
|
@@ -48467,7 +48467,7 @@ const MultipleSelect = (_a) => {
|
|
|
48467
48467
|
=== String(inputoption.optionvalue));
|
|
48468
48468
|
return (React.createElement(p$5, { id: String(inputoption.optionid) || '', key: inputoption.optionid, align: "center", gap: "2", onClick: () => {
|
|
48469
48469
|
if (!readOnly)
|
|
48470
|
-
handleToggle(inputoption.optionvalue);
|
|
48470
|
+
handleToggle(String(inputoption.optionvalue));
|
|
48471
48471
|
}, style: {
|
|
48472
48472
|
padding: '8px',
|
|
48473
48473
|
cursor: readOnly ? 'default' : 'pointer',
|
|
@@ -49146,7 +49146,7 @@ const CodexItem = ({ stepId, children, }) => {
|
|
|
49146
49146
|
return (React.createElement("div", { className: "v-step-content-animation", style: { width: '100%' } }, children));
|
|
49147
49147
|
};
|
|
49148
49148
|
|
|
49149
|
-
const CodexControls = ({ nextStepId, prevStepId, nextLabel = "Continue", prevLabel = "Back", finishLabel = "Submit", prevIcon = "doublearrowleft", nextIcon = "doublearrowright", finishIcon = "paperplane", onNext, onPrev, onFinish }) => {
|
|
49149
|
+
const CodexControls = ({ nextStepId, prevStepId, nextLabel = "Continue", prevLabel = "Back", finishLabel = "Submit", prevIcon = "doublearrowleft", nextIcon = "doublearrowright", finishIcon = "paperplane", onSubmit = false, onNext, onPrev, onFinish }) => {
|
|
49150
49150
|
const { setActiveStepId, brandColor } = useStepper();
|
|
49151
49151
|
const handlePrev = () => {
|
|
49152
49152
|
if (onPrev)
|
|
@@ -49171,7 +49171,7 @@ const CodexControls = ({ nextStepId, prevStepId, nextLabel = "Continue", prevLab
|
|
|
49171
49171
|
React.createElement(Icon, { name: prevIcon }),
|
|
49172
49172
|
"\u00A0")),
|
|
49173
49173
|
prevLabel)) : (React.createElement("div", null)),
|
|
49174
|
-
React.createElement(o$a, { variant: "solid", color: brandColor ? undefined : (nextStepId ? "blue" : "green"), onClick: handleNext, style: Object.assign({ cursor: 'pointer' }, (brandColor ? { backgroundColor: 'var(--codex-brand)', color: '#fff' } : {})) }, nextStepId ? (React.createElement(React.Fragment, null,
|
|
49174
|
+
React.createElement(o$a, { variant: "solid", color: brandColor ? undefined : (nextStepId ? "blue" : "green"), onClick: handleNext, style: Object.assign({ cursor: 'pointer' }, (brandColor ? { backgroundColor: 'var(--codex-brand)', color: '#fff' } : {})), type: onSubmit && !nextStepId ? "submit" : "button" }, nextStepId ? (React.createElement(React.Fragment, null,
|
|
49175
49175
|
nextIcon && React.createElement(React.Fragment, null,
|
|
49176
49176
|
React.createElement(Icon, { name: nextIcon }),
|
|
49177
49177
|
"\u00A0"),
|
|
@@ -53907,6 +53907,131 @@ const parseUuidFormat = (input) => {
|
|
|
53907
53907
|
return numbers;
|
|
53908
53908
|
};
|
|
53909
53909
|
|
|
53910
|
+
/**
|
|
53911
|
+
* Utility to convert any string to camelCase (e.g., "USER NAME" -> "userName", "user_profile" -> "userProfile")
|
|
53912
|
+
* Safely handles ALL CAPS, snake_case, spaces, and existing camelCase.
|
|
53913
|
+
* @param str - String to convert to camelCase format
|
|
53914
|
+
*/
|
|
53915
|
+
const toCamelCase = (str) => {
|
|
53916
|
+
if (!str)
|
|
53917
|
+
return "";
|
|
53918
|
+
const words = str
|
|
53919
|
+
.replace(/([a-z])([A-Z])/g, '$1 $2') // 1. Split existing camelCase with a space
|
|
53920
|
+
.replace(/[^a-zA-Z0-9]+/g, ' ') // 2. Replace non-alphanumeric characters with spaces
|
|
53921
|
+
.trim()
|
|
53922
|
+
.toLowerCase() // 3. Lowercase everything
|
|
53923
|
+
.split(/\s+/); // 4. Split into an array of words
|
|
53924
|
+
if (words.length === 0 || words[0] === '')
|
|
53925
|
+
return "";
|
|
53926
|
+
return words.map((word, index) => {
|
|
53927
|
+
if (index === 0)
|
|
53928
|
+
return word; // First word stays lowercase
|
|
53929
|
+
return word.charAt(0).toUpperCase() + word.slice(1); // Capitalize subsequent words
|
|
53930
|
+
}).join('');
|
|
53931
|
+
};
|
|
53932
|
+
/**
|
|
53933
|
+
* Utility to convert a string to kebab-case (e.g., "Profile Section" -> "profile-section")
|
|
53934
|
+
* Ensures code-friendly standard strings.
|
|
53935
|
+
* @param str - String to convert to kebab-case format
|
|
53936
|
+
*/
|
|
53937
|
+
const toKebabCase = (str) => {
|
|
53938
|
+
if (!str)
|
|
53939
|
+
return "";
|
|
53940
|
+
return str
|
|
53941
|
+
.replace(/([a-z])([A-Z])/g, '$1-$2') // 1. Handle camelCase inputs
|
|
53942
|
+
.replace(/[^a-zA-Z0-9]+/g, '-') // 2. Replace non-alphanumeric chars with hyphens
|
|
53943
|
+
.toLowerCase() // 3. Lowercase everything
|
|
53944
|
+
.replace(/^-+|-+$/g, ''); // 4. Trim any leading or trailing hyphens
|
|
53945
|
+
};
|
|
53946
|
+
/**
|
|
53947
|
+
* Normalizes and sanitizes an XFormType object.
|
|
53948
|
+
* - Standardizes Section IDs (Consecutive numbers or code-friendly strings).
|
|
53949
|
+
* - Enforces globally consecutive Query IDs.
|
|
53950
|
+
* - Ensures unique, Formik-friendly camelCase Input Aliases.
|
|
53951
|
+
* - Auto-fills empty inputAliases with unique 'undefinedElement[N]' placeholder.
|
|
53952
|
+
* @param xform - xForm object {} to normalize `sectionId`, `queryId` and `inputAlias` attributes for `<Teletraan1/>` component
|
|
53953
|
+
*/
|
|
53954
|
+
const normalizeXForm = (xform) => {
|
|
53955
|
+
var _a, _b;
|
|
53956
|
+
// Deep clone the object to prevent mutating the original data reference
|
|
53957
|
+
const normalizedForm = JSON.parse(JSON.stringify(xform));
|
|
53958
|
+
if (!normalizedForm.model || normalizedForm.model.length === 0) {
|
|
53959
|
+
return normalizedForm;
|
|
53960
|
+
}
|
|
53961
|
+
// ==========================================
|
|
53962
|
+
// 1. SECTION ID NORMALIZATION
|
|
53963
|
+
// ==========================================
|
|
53964
|
+
const firstSectionId = normalizedForm.model[0].sectionId;
|
|
53965
|
+
const isFirstSectionNumbered = !isNaN(Number(firstSectionId)) && String(firstSectionId).trim() !== '';
|
|
53966
|
+
let sectionCounter = isFirstSectionNumbered ? Number(firstSectionId) : 1;
|
|
53967
|
+
normalizedForm.model.forEach((section) => {
|
|
53968
|
+
if (isFirstSectionNumbered) {
|
|
53969
|
+
// If the first section was a number, make all subsequent sections consecutive numbers
|
|
53970
|
+
section.sectionId = String(sectionCounter++);
|
|
53971
|
+
}
|
|
53972
|
+
else {
|
|
53973
|
+
// Otherwise, sanitize to a code-friendly string
|
|
53974
|
+
section.sectionId = toKebabCase(section.sectionId) || `section-${sectionCounter++}`;
|
|
53975
|
+
}
|
|
53976
|
+
});
|
|
53977
|
+
// ==========================================
|
|
53978
|
+
// 2. QUERY ID & ALIAS NORMALIZATION
|
|
53979
|
+
// ==========================================
|
|
53980
|
+
const aliasTracker = {};
|
|
53981
|
+
let undefinedCounter = 1;
|
|
53982
|
+
// Set the global query counter based on the very first query's ID (defaults to 1)
|
|
53983
|
+
let globalQueryId = 1;
|
|
53984
|
+
const firstQuery = (_b = (_a = normalizedForm.model[0]) === null || _a === void 0 ? void 0 : _a.queries) === null || _b === void 0 ? void 0 : _b[0];
|
|
53985
|
+
if (firstQuery && typeof firstQuery.queryId === 'number' && !isNaN(firstQuery.queryId)) {
|
|
53986
|
+
globalQueryId = firstQuery.queryId;
|
|
53987
|
+
}
|
|
53988
|
+
// Recursive function to process flat queries AND nested conditional queries
|
|
53989
|
+
const processQuery = (query) => {
|
|
53990
|
+
// A. Assign consecutive ordered queryId
|
|
53991
|
+
query.queryId = globalQueryId++;
|
|
53992
|
+
// B. Sanitize inputAlias to camelCase
|
|
53993
|
+
let baseAlias = toCamelCase(query.inputAlias);
|
|
53994
|
+
// C. Handle completely empty/invalid strings
|
|
53995
|
+
if (!baseAlias) {
|
|
53996
|
+
// Ensure we don't collide with a user who manually typed "undefinedElement1"
|
|
53997
|
+
let potentialAlias = `undefinedElement${undefinedCounter}`;
|
|
53998
|
+
while (aliasTracker[potentialAlias]) {
|
|
53999
|
+
undefinedCounter++;
|
|
54000
|
+
potentialAlias = `undefinedElement${undefinedCounter}`;
|
|
54001
|
+
}
|
|
54002
|
+
query.inputAlias = potentialAlias;
|
|
54003
|
+
aliasTracker[potentialAlias] = 1; // Mark this generated alias as used
|
|
54004
|
+
undefinedCounter++;
|
|
54005
|
+
}
|
|
54006
|
+
// D. Enforce global uniqueness across all sections for standard aliases
|
|
54007
|
+
else {
|
|
54008
|
+
if (aliasTracker[baseAlias]) {
|
|
54009
|
+
// Duplicate found: Increment the count and attach it (e.g., "userProfile2")
|
|
54010
|
+
aliasTracker[baseAlias]++;
|
|
54011
|
+
query.inputAlias = `${baseAlias}${aliasTracker[baseAlias]}`;
|
|
54012
|
+
}
|
|
54013
|
+
else {
|
|
54014
|
+
// First instance: Record it as 1
|
|
54015
|
+
aliasTracker[baseAlias] = 1;
|
|
54016
|
+
query.inputAlias = baseAlias;
|
|
54017
|
+
}
|
|
54018
|
+
}
|
|
54019
|
+
// E. Recursively process toggledInput if the query contains conditional logic
|
|
54020
|
+
if (query.toggledInput) {
|
|
54021
|
+
processQuery(query.toggledInput);
|
|
54022
|
+
}
|
|
54023
|
+
};
|
|
54024
|
+
// Run the processor over all queries in all sections
|
|
54025
|
+
normalizedForm.model.forEach((section) => {
|
|
54026
|
+
if (section.queries && Array.isArray(section.queries)) {
|
|
54027
|
+
section.queries.forEach((query) => {
|
|
54028
|
+
processQuery(query);
|
|
54029
|
+
});
|
|
54030
|
+
}
|
|
54031
|
+
});
|
|
54032
|
+
return normalizedForm;
|
|
54033
|
+
};
|
|
54034
|
+
|
|
53910
54035
|
exports.Accordion = Accordion;
|
|
53911
54036
|
exports.AccordionItem = AccordionItem;
|
|
53912
54037
|
exports.AvatarInput = AvatarInput;
|
|
@@ -53946,6 +54071,7 @@ exports.Theme = R;
|
|
|
53946
54071
|
exports.ThemePanel = N;
|
|
53947
54072
|
exports.Toggle = Toggle;
|
|
53948
54073
|
exports.UUIDInput = UUIDInput;
|
|
54074
|
+
exports.normalizeXForm = normalizeXForm;
|
|
53949
54075
|
exports.parseUuidFormat = parseUuidFormat;
|
|
53950
54076
|
exports.primeMatrix = primeMatrix;
|
|
53951
54077
|
exports.useStepper = useStepper;
|
package/lib/index.esm.js
CHANGED
|
@@ -13032,13 +13032,13 @@ const CheckboxGroupInput = (_a) => {
|
|
|
13032
13032
|
` } })),
|
|
13033
13033
|
React__default.createElement(o$6, { columns: columns || (direction === 'row' ? 'repeat(auto-fit, minmax(100px, 1fr))' : '1'), gap: "3", style: neuVars }, inputOptions.map((inputoption) => {
|
|
13034
13034
|
const isChecked = currentValues.some(val => String(val) === String(inputoption.optionvalue));
|
|
13035
|
-
return (React__default.createElement(p$d, { as: "label", key: inputoption.optionvalue || crypto.randomUUID(), size: "2", style: {
|
|
13035
|
+
return (React__default.createElement(p$d, { as: "label", key: String(inputoption.optionvalue) || crypto.randomUUID(), size: "2", style: {
|
|
13036
13036
|
display: 'flex',
|
|
13037
13037
|
alignItems: 'center',
|
|
13038
13038
|
gap: '8px',
|
|
13039
13039
|
cursor: 'pointer'
|
|
13040
13040
|
} },
|
|
13041
|
-
React__default.createElement(c$2, { name: alias, id: `${alias}FormInput${inputoption.optionid}`, "aria-describedby": `${alias}InputLabel${inputoption.optionid}`, disabled: readOnly, value: inputoption.optionvalue, checked: isChecked, onCheckedChange: (checked) => handleCheckedChange(checked, inputoption.optionvalue), variant: inputtype === 'checkbox-outline' ? 'soft' : 'surface', className: inputtype === 'checkbox-neumorphic' ? 'neu-checkbox' : '', style: Object.assign({}, (inputtype === 'checkbox-outline' ? {
|
|
13041
|
+
React__default.createElement(c$2, { name: alias, id: `${alias}FormInput${inputoption.optionid}`, "aria-describedby": `${alias}InputLabel${inputoption.optionid}`, disabled: readOnly, value: String(inputoption.optionvalue), checked: isChecked, onCheckedChange: (checked) => handleCheckedChange(checked, String(inputoption.optionvalue)), variant: inputtype === 'checkbox-outline' ? 'soft' : 'surface', className: inputtype === 'checkbox-neumorphic' ? 'neu-checkbox' : '', style: Object.assign({}, (inputtype === 'checkbox-outline' ? {
|
|
13042
13042
|
border: isChecked ? '2px solid var(--accent-9)' : '2px solid var(--gray-8)',
|
|
13043
13043
|
backgroundColor: 'transparent'
|
|
13044
13044
|
} : {})) }),
|
|
@@ -13115,7 +13115,7 @@ const ConditionalTrigger = (_a) => {
|
|
|
13115
13115
|
return (React__default.createElement(p$5, { direction: "column", gap: "1", style: { width: '100%' } },
|
|
13116
13116
|
React__default.createElement(C$1, { name: alias, disabled: readOnly, value: fieldValue, defaultValue: placeholder || "", onValueChange: handleChange },
|
|
13117
13117
|
React__default.createElement(u$1, { id: inputId, variant: isNeumorphic ? 'soft' : 'surface', style: { width: '100%' } }),
|
|
13118
|
-
React__default.createElement(g, null, inputOptions.map((inputoption) => (React__default.createElement(v, { key: inputoption.optionvalue || crypto.randomUUID(), value: inputoption.optionvalue }, inputoption.text)))))));
|
|
13118
|
+
React__default.createElement(g, null, inputOptions.map((inputoption) => (React__default.createElement(v, { key: String(inputoption.optionvalue) || crypto.randomUUID(), value: String(inputoption.optionvalue) }, inputoption.text)))))));
|
|
13119
13119
|
case inputtype.includes('conditionaltoggle'):
|
|
13120
13120
|
default:
|
|
13121
13121
|
return (React__default.createElement(p$5, { justify: "between", align: "center", style: { width: '100%' } },
|
|
@@ -27247,10 +27247,10 @@ const Dropdown = (_a) => {
|
|
|
27247
27247
|
React__default.createElement(v, { value: "__RESET__", className: inputtype === 'dropdown-neumorphic' ? 'neu-select-item' : '', style: { color: 'var(--gray-10)', fontStyle: 'italic' } }, placeholder || "Select an option"),
|
|
27248
27248
|
React__default.createElement(o$2, { size: "4", style: { margin: '4px 0', opacity: 0.5 } }),
|
|
27249
27249
|
inputOptions.map((inputoption) => (React__default.createElement(React__default.Fragment, { key: inputoption.optionid || crypto.randomUUID() }, inputoption.optionurl ?
|
|
27250
|
-
React__default.createElement(v, { id: String(inputoption.optionid) || '', value: inputoption.optionvalue, className: inputtype === 'dropdown-neumorphic' ? 'neu-select-item' : '' },
|
|
27250
|
+
React__default.createElement(v, { id: String(inputoption.optionid) || '', value: String(inputoption.optionvalue), className: inputtype === 'dropdown-neumorphic' ? 'neu-select-item' : '' },
|
|
27251
27251
|
React__default.createElement("a", { onClick: (e) => { e.stopPropagation(); openLink(inputoption.optionurl || "#"); }, style: { textDecoration: 'none', color: 'inherit' } }, inputoption.text))
|
|
27252
27252
|
:
|
|
27253
|
-
React__default.createElement(v, { id: String(inputoption.optionid) || '', value: inputoption.optionvalue, className: inputtype === 'dropdown-neumorphic' ? 'neu-select-item' : '' }, inputoption.text)))))),
|
|
27253
|
+
React__default.createElement(v, { id: String(inputoption.optionid) || '', value: String(inputoption.optionvalue), className: inputtype === 'dropdown-neumorphic' ? 'neu-select-item' : '' }, inputoption.text)))))),
|
|
27254
27254
|
React__default.createElement("div", null,
|
|
27255
27255
|
React__default.createElement(p$d, { id: `${alias}InputLabel`, as: "label", size: "2", weight: "bold", htmlFor: inputId }, inputLabel),
|
|
27256
27256
|
"\u00A0",
|
|
@@ -48214,9 +48214,9 @@ const RadioGroupInput = (_a) => {
|
|
|
48214
48214
|
} },
|
|
48215
48215
|
React__default.createElement(o$6, { columns: columns || (direction === 'row' ? 'repeat(auto-fit, minmax(100px, 1fr))' : '1'), gap: "3", style: neuVars }, inputOptions.map((inputoption) => {
|
|
48216
48216
|
const isChecked = String(fieldValue) === String(inputoption.optionvalue);
|
|
48217
|
-
return (React__default.createElement(p$5, { asChild: true, key: inputoption.optionvalue, align: "center", gap: "2" },
|
|
48217
|
+
return (React__default.createElement(p$5, { asChild: true, key: String(inputoption.optionvalue), align: "center", gap: "2" },
|
|
48218
48218
|
React__default.createElement(p$d, { as: "label", size: "2", style: { cursor: 'pointer' } },
|
|
48219
|
-
React__default.createElement(y$1, { value: inputoption.optionvalue, className: inputtype === 'radio-neumorphic' ? 'neu-radio' : '', style: Object.assign({}, (inputtype === 'radio-outline' ? {
|
|
48219
|
+
React__default.createElement(y$1, { value: String(inputoption.optionvalue), className: inputtype === 'radio-neumorphic' ? 'neu-radio' : '', style: Object.assign({}, (inputtype === 'radio-outline' ? {
|
|
48220
48220
|
border: isChecked ? '2px solid var(--accent-9)' : '2px solid var(--gray-8)',
|
|
48221
48221
|
backgroundColor: 'transparent'
|
|
48222
48222
|
} : {})) }),
|
|
@@ -48342,8 +48342,8 @@ const OptionSelect = (_a) => {
|
|
|
48342
48342
|
React__default.createElement(g, { position: "popper", sideOffset: 5, style: activeContentStyle },
|
|
48343
48343
|
React__default.createElement(v, { value: "__RESET__", className: inputtype === 'dropdown-neumorphic' ? 'neu-select-item' : '', style: { color: 'var(--gray-10)', fontStyle: 'italic' } }, placeholder || "Select an option"),
|
|
48344
48344
|
React__default.createElement(o$2, { size: "4", style: { margin: '4px 0', opacity: 0.5 } }),
|
|
48345
|
-
inputOptions.map((inputoption) => (React__default.createElement(React__default.Fragment, { key: inputoption.optionid || crypto.randomUUID() }, inputoption.optionurl ? (React__default.createElement(v, { id: String(inputoption.optionid) || '', value: inputoption.optionvalue, className: inputtype === 'dropdown-neumorphic' ? 'neu-select-item' : '' },
|
|
48346
|
-
React__default.createElement("a", { onClick: (e) => { e.stopPropagation(); openLink(inputoption.optionurl || "#"); }, style: { textDecoration: 'none', color: 'inherit' } }, inputoption.text))) : (React__default.createElement(v, { id: String(inputoption.optionid) || '', value: inputoption.optionvalue, className: inputtype === 'dropdown-neumorphic' ? 'neu-select-item' : '' }, inputoption.text))))))),
|
|
48345
|
+
inputOptions.map((inputoption) => (React__default.createElement(React__default.Fragment, { key: inputoption.optionid || crypto.randomUUID() }, inputoption.optionurl ? (React__default.createElement(v, { id: String(inputoption.optionid) || '', value: String(inputoption.optionvalue), className: inputtype === 'dropdown-neumorphic' ? 'neu-select-item' : '' },
|
|
48346
|
+
React__default.createElement("a", { onClick: (e) => { e.stopPropagation(); openLink(inputoption.optionurl || "#"); }, style: { textDecoration: 'none', color: 'inherit' } }, inputoption.text))) : (React__default.createElement(v, { id: String(inputoption.optionid) || '', value: String(inputoption.optionvalue), className: inputtype === 'dropdown-neumorphic' ? 'neu-select-item' : '' }, inputoption.text))))))),
|
|
48347
48347
|
React__default.createElement("div", null,
|
|
48348
48348
|
React__default.createElement(p$d, { id: `${alias}InputLabel`, as: "label", size: "2", weight: "bold", htmlFor: `${alias}FormInput` }, inputLabel),
|
|
48349
48349
|
"\u00A0",
|
|
@@ -48384,7 +48384,7 @@ const MultipleSelect = (_a) => {
|
|
|
48384
48384
|
};
|
|
48385
48385
|
const displayLabel = selectedValues.length > 0
|
|
48386
48386
|
? inputOptions
|
|
48387
|
-
.filter(inputoption => selectedValues.includes(inputoption.optionvalue))
|
|
48387
|
+
.filter(inputoption => selectedValues.includes(String(inputoption.optionvalue)))
|
|
48388
48388
|
.map(inputoption => inputoption.text)
|
|
48389
48389
|
.join(', ')
|
|
48390
48390
|
: placeholder;
|
|
@@ -48447,7 +48447,7 @@ const MultipleSelect = (_a) => {
|
|
|
48447
48447
|
=== String(inputoption.optionvalue));
|
|
48448
48448
|
return (React__default.createElement(p$5, { id: String(inputoption.optionid) || '', key: inputoption.optionid, align: "center", gap: "2", onClick: () => {
|
|
48449
48449
|
if (!readOnly)
|
|
48450
|
-
handleToggle(inputoption.optionvalue);
|
|
48450
|
+
handleToggle(String(inputoption.optionvalue));
|
|
48451
48451
|
}, style: {
|
|
48452
48452
|
padding: '8px',
|
|
48453
48453
|
cursor: readOnly ? 'default' : 'pointer',
|
|
@@ -49126,7 +49126,7 @@ const CodexItem = ({ stepId, children, }) => {
|
|
|
49126
49126
|
return (React__default.createElement("div", { className: "v-step-content-animation", style: { width: '100%' } }, children));
|
|
49127
49127
|
};
|
|
49128
49128
|
|
|
49129
|
-
const CodexControls = ({ nextStepId, prevStepId, nextLabel = "Continue", prevLabel = "Back", finishLabel = "Submit", prevIcon = "doublearrowleft", nextIcon = "doublearrowright", finishIcon = "paperplane", onNext, onPrev, onFinish }) => {
|
|
49129
|
+
const CodexControls = ({ nextStepId, prevStepId, nextLabel = "Continue", prevLabel = "Back", finishLabel = "Submit", prevIcon = "doublearrowleft", nextIcon = "doublearrowright", finishIcon = "paperplane", onSubmit = false, onNext, onPrev, onFinish }) => {
|
|
49130
49130
|
const { setActiveStepId, brandColor } = useStepper();
|
|
49131
49131
|
const handlePrev = () => {
|
|
49132
49132
|
if (onPrev)
|
|
@@ -49151,7 +49151,7 @@ const CodexControls = ({ nextStepId, prevStepId, nextLabel = "Continue", prevLab
|
|
|
49151
49151
|
React__default.createElement(Icon, { name: prevIcon }),
|
|
49152
49152
|
"\u00A0")),
|
|
49153
49153
|
prevLabel)) : (React__default.createElement("div", null)),
|
|
49154
|
-
React__default.createElement(o$a, { variant: "solid", color: brandColor ? undefined : (nextStepId ? "blue" : "green"), onClick: handleNext, style: Object.assign({ cursor: 'pointer' }, (brandColor ? { backgroundColor: 'var(--codex-brand)', color: '#fff' } : {})) }, nextStepId ? (React__default.createElement(React__default.Fragment, null,
|
|
49154
|
+
React__default.createElement(o$a, { variant: "solid", color: brandColor ? undefined : (nextStepId ? "blue" : "green"), onClick: handleNext, style: Object.assign({ cursor: 'pointer' }, (brandColor ? { backgroundColor: 'var(--codex-brand)', color: '#fff' } : {})), type: onSubmit && !nextStepId ? "submit" : "button" }, nextStepId ? (React__default.createElement(React__default.Fragment, null,
|
|
49155
49155
|
nextIcon && React__default.createElement(React__default.Fragment, null,
|
|
49156
49156
|
React__default.createElement(Icon, { name: nextIcon }),
|
|
49157
49157
|
"\u00A0"),
|
|
@@ -53887,4 +53887,129 @@ const parseUuidFormat = (input) => {
|
|
|
53887
53887
|
return numbers;
|
|
53888
53888
|
};
|
|
53889
53889
|
|
|
53890
|
-
|
|
53890
|
+
/**
|
|
53891
|
+
* Utility to convert any string to camelCase (e.g., "USER NAME" -> "userName", "user_profile" -> "userProfile")
|
|
53892
|
+
* Safely handles ALL CAPS, snake_case, spaces, and existing camelCase.
|
|
53893
|
+
* @param str - String to convert to camelCase format
|
|
53894
|
+
*/
|
|
53895
|
+
const toCamelCase = (str) => {
|
|
53896
|
+
if (!str)
|
|
53897
|
+
return "";
|
|
53898
|
+
const words = str
|
|
53899
|
+
.replace(/([a-z])([A-Z])/g, '$1 $2') // 1. Split existing camelCase with a space
|
|
53900
|
+
.replace(/[^a-zA-Z0-9]+/g, ' ') // 2. Replace non-alphanumeric characters with spaces
|
|
53901
|
+
.trim()
|
|
53902
|
+
.toLowerCase() // 3. Lowercase everything
|
|
53903
|
+
.split(/\s+/); // 4. Split into an array of words
|
|
53904
|
+
if (words.length === 0 || words[0] === '')
|
|
53905
|
+
return "";
|
|
53906
|
+
return words.map((word, index) => {
|
|
53907
|
+
if (index === 0)
|
|
53908
|
+
return word; // First word stays lowercase
|
|
53909
|
+
return word.charAt(0).toUpperCase() + word.slice(1); // Capitalize subsequent words
|
|
53910
|
+
}).join('');
|
|
53911
|
+
};
|
|
53912
|
+
/**
|
|
53913
|
+
* Utility to convert a string to kebab-case (e.g., "Profile Section" -> "profile-section")
|
|
53914
|
+
* Ensures code-friendly standard strings.
|
|
53915
|
+
* @param str - String to convert to kebab-case format
|
|
53916
|
+
*/
|
|
53917
|
+
const toKebabCase = (str) => {
|
|
53918
|
+
if (!str)
|
|
53919
|
+
return "";
|
|
53920
|
+
return str
|
|
53921
|
+
.replace(/([a-z])([A-Z])/g, '$1-$2') // 1. Handle camelCase inputs
|
|
53922
|
+
.replace(/[^a-zA-Z0-9]+/g, '-') // 2. Replace non-alphanumeric chars with hyphens
|
|
53923
|
+
.toLowerCase() // 3. Lowercase everything
|
|
53924
|
+
.replace(/^-+|-+$/g, ''); // 4. Trim any leading or trailing hyphens
|
|
53925
|
+
};
|
|
53926
|
+
/**
|
|
53927
|
+
* Normalizes and sanitizes an XFormType object.
|
|
53928
|
+
* - Standardizes Section IDs (Consecutive numbers or code-friendly strings).
|
|
53929
|
+
* - Enforces globally consecutive Query IDs.
|
|
53930
|
+
* - Ensures unique, Formik-friendly camelCase Input Aliases.
|
|
53931
|
+
* - Auto-fills empty inputAliases with unique 'undefinedElement[N]' placeholder.
|
|
53932
|
+
* @param xform - xForm object {} to normalize `sectionId`, `queryId` and `inputAlias` attributes for `<Teletraan1/>` component
|
|
53933
|
+
*/
|
|
53934
|
+
const normalizeXForm = (xform) => {
|
|
53935
|
+
var _a, _b;
|
|
53936
|
+
// Deep clone the object to prevent mutating the original data reference
|
|
53937
|
+
const normalizedForm = JSON.parse(JSON.stringify(xform));
|
|
53938
|
+
if (!normalizedForm.model || normalizedForm.model.length === 0) {
|
|
53939
|
+
return normalizedForm;
|
|
53940
|
+
}
|
|
53941
|
+
// ==========================================
|
|
53942
|
+
// 1. SECTION ID NORMALIZATION
|
|
53943
|
+
// ==========================================
|
|
53944
|
+
const firstSectionId = normalizedForm.model[0].sectionId;
|
|
53945
|
+
const isFirstSectionNumbered = !isNaN(Number(firstSectionId)) && String(firstSectionId).trim() !== '';
|
|
53946
|
+
let sectionCounter = isFirstSectionNumbered ? Number(firstSectionId) : 1;
|
|
53947
|
+
normalizedForm.model.forEach((section) => {
|
|
53948
|
+
if (isFirstSectionNumbered) {
|
|
53949
|
+
// If the first section was a number, make all subsequent sections consecutive numbers
|
|
53950
|
+
section.sectionId = String(sectionCounter++);
|
|
53951
|
+
}
|
|
53952
|
+
else {
|
|
53953
|
+
// Otherwise, sanitize to a code-friendly string
|
|
53954
|
+
section.sectionId = toKebabCase(section.sectionId) || `section-${sectionCounter++}`;
|
|
53955
|
+
}
|
|
53956
|
+
});
|
|
53957
|
+
// ==========================================
|
|
53958
|
+
// 2. QUERY ID & ALIAS NORMALIZATION
|
|
53959
|
+
// ==========================================
|
|
53960
|
+
const aliasTracker = {};
|
|
53961
|
+
let undefinedCounter = 1;
|
|
53962
|
+
// Set the global query counter based on the very first query's ID (defaults to 1)
|
|
53963
|
+
let globalQueryId = 1;
|
|
53964
|
+
const firstQuery = (_b = (_a = normalizedForm.model[0]) === null || _a === void 0 ? void 0 : _a.queries) === null || _b === void 0 ? void 0 : _b[0];
|
|
53965
|
+
if (firstQuery && typeof firstQuery.queryId === 'number' && !isNaN(firstQuery.queryId)) {
|
|
53966
|
+
globalQueryId = firstQuery.queryId;
|
|
53967
|
+
}
|
|
53968
|
+
// Recursive function to process flat queries AND nested conditional queries
|
|
53969
|
+
const processQuery = (query) => {
|
|
53970
|
+
// A. Assign consecutive ordered queryId
|
|
53971
|
+
query.queryId = globalQueryId++;
|
|
53972
|
+
// B. Sanitize inputAlias to camelCase
|
|
53973
|
+
let baseAlias = toCamelCase(query.inputAlias);
|
|
53974
|
+
// C. Handle completely empty/invalid strings
|
|
53975
|
+
if (!baseAlias) {
|
|
53976
|
+
// Ensure we don't collide with a user who manually typed "undefinedElement1"
|
|
53977
|
+
let potentialAlias = `undefinedElement${undefinedCounter}`;
|
|
53978
|
+
while (aliasTracker[potentialAlias]) {
|
|
53979
|
+
undefinedCounter++;
|
|
53980
|
+
potentialAlias = `undefinedElement${undefinedCounter}`;
|
|
53981
|
+
}
|
|
53982
|
+
query.inputAlias = potentialAlias;
|
|
53983
|
+
aliasTracker[potentialAlias] = 1; // Mark this generated alias as used
|
|
53984
|
+
undefinedCounter++;
|
|
53985
|
+
}
|
|
53986
|
+
// D. Enforce global uniqueness across all sections for standard aliases
|
|
53987
|
+
else {
|
|
53988
|
+
if (aliasTracker[baseAlias]) {
|
|
53989
|
+
// Duplicate found: Increment the count and attach it (e.g., "userProfile2")
|
|
53990
|
+
aliasTracker[baseAlias]++;
|
|
53991
|
+
query.inputAlias = `${baseAlias}${aliasTracker[baseAlias]}`;
|
|
53992
|
+
}
|
|
53993
|
+
else {
|
|
53994
|
+
// First instance: Record it as 1
|
|
53995
|
+
aliasTracker[baseAlias] = 1;
|
|
53996
|
+
query.inputAlias = baseAlias;
|
|
53997
|
+
}
|
|
53998
|
+
}
|
|
53999
|
+
// E. Recursively process toggledInput if the query contains conditional logic
|
|
54000
|
+
if (query.toggledInput) {
|
|
54001
|
+
processQuery(query.toggledInput);
|
|
54002
|
+
}
|
|
54003
|
+
};
|
|
54004
|
+
// Run the processor over all queries in all sections
|
|
54005
|
+
normalizedForm.model.forEach((section) => {
|
|
54006
|
+
if (section.queries && Array.isArray(section.queries)) {
|
|
54007
|
+
section.queries.forEach((query) => {
|
|
54008
|
+
processQuery(query);
|
|
54009
|
+
});
|
|
54010
|
+
}
|
|
54011
|
+
});
|
|
54012
|
+
return normalizedForm;
|
|
54013
|
+
};
|
|
54014
|
+
|
|
54015
|
+
export { Accordion, AccordionItem, AvatarInput, ButtonInput, CURRENCIES, CheckboxGroupInput, Codex, CodexControls, CodexItem, Column, ConditionalTrigger, Container, CreditCardInput, CurrencyInput, DatePicker, DateRangePicker, DateTimePicker, Dropdown, File$1 as File, FileMultiple, FlagIcon, Icon, ImageOutput, Input$2 as Input, MultipleSelect, OptionSelect, PasswordInput, PhoneInput, RadioGroupInput, RangeSlider, Row, SectionTitle, SliderInput, StockInput, Teletraan1, R as Theme, N as ThemePanel, Toggle, UUIDInput, normalizeXForm, parseUuidFormat, primeMatrix, useStepper, vectorSigma, xFormSchema };
|
package/lib/types/index.d.ts
CHANGED
|
@@ -45,6 +45,11 @@ export interface CodexControlsProps {
|
|
|
45
45
|
* Default: "paperplane"
|
|
46
46
|
*/
|
|
47
47
|
finishIcon?: string;
|
|
48
|
+
/**
|
|
49
|
+
* * Option to enable `onFinish` control button as `submit` button type.
|
|
50
|
+
* Default: true
|
|
51
|
+
*/
|
|
52
|
+
onSubmit?: boolean;
|
|
48
53
|
/**
|
|
49
54
|
* * Optional callback triggered before navigating to the next step.
|
|
50
55
|
* Useful for triggering form validation.
|
|
@@ -59,4 +64,4 @@ export interface CodexControlsProps {
|
|
|
59
64
|
*/
|
|
60
65
|
onFinish?: () => void;
|
|
61
66
|
}
|
|
62
|
-
export declare const CodexControls: ({ nextStepId, prevStepId, nextLabel, prevLabel, finishLabel, prevIcon, nextIcon, finishIcon, onNext, onPrev, onFinish }: CodexControlsProps) => React.JSX.Element;
|
|
67
|
+
export declare const CodexControls: ({ nextStepId, prevStepId, nextLabel, prevLabel, finishLabel, prevIcon, nextIcon, finishIcon, onSubmit, onNext, onPrev, onFinish }: CodexControlsProps) => React.JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { XFormType } from 'utils/voltron';
|
|
3
3
|
export type teletraan1Display = 'accordion' | 'codice' | 'codex' | 'dual';
|
|
4
4
|
export interface Teletraan1Props {
|
|
5
5
|
/**
|
|
@@ -8,7 +8,7 @@ export interface Teletraan1Props {
|
|
|
8
8
|
* * @example
|
|
9
9
|
* xFormModel={xFormJSONPrototype}
|
|
10
10
|
*/
|
|
11
|
-
xFormModel:
|
|
11
|
+
xFormModel: XFormType;
|
|
12
12
|
/**
|
|
13
13
|
* * Option to render xForm as readonly (inputs disabled).
|
|
14
14
|
* * @example
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { XFormType } from "./voltron";
|
|
2
|
+
/**
|
|
3
|
+
* Normalizes and sanitizes an XFormType object.
|
|
4
|
+
* - Standardizes Section IDs (Consecutive numbers or code-friendly strings).
|
|
5
|
+
* - Enforces globally consecutive Query IDs.
|
|
6
|
+
* - Ensures unique, Formik-friendly camelCase Input Aliases.
|
|
7
|
+
* - Auto-fills empty inputAliases with unique 'undefinedElement[N]' placeholder.
|
|
8
|
+
* @param xform - xForm object {} to normalize `sectionId`, `queryId` and `inputAlias` attributes for `<Teletraan1/>` component
|
|
9
|
+
*/
|
|
10
|
+
export declare const normalizeXForm: (xform: XFormType) => XFormType;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { XFormType } from "./voltron";
|
|
1
2
|
export declare const avatarInputType: string[];
|
|
2
3
|
export declare const buttonInputType: string[];
|
|
3
4
|
export declare const checkboxInputType: string[];
|
|
@@ -22,3 +23,4 @@ export declare const rangeSliderInputType: string[];
|
|
|
22
23
|
export declare const toggleInputType: string[];
|
|
23
24
|
export declare const sectionTitleOutputType: string[];
|
|
24
25
|
export declare const conditionalInputType: string[];
|
|
26
|
+
export declare const generateInitialValues: (schema: XFormType) => Record<string, any>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const InputOptionSchema: z.ZodObject<{
|
|
3
|
+
optionid: z.ZodNumber;
|
|
4
|
+
optionvalue: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
5
|
+
optionurl: z.ZodOptional<z.ZodString>;
|
|
6
|
+
text: z.ZodString;
|
|
7
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
8
|
+
score: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodFloat64]>>;
|
|
9
|
+
note: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export type XFormQuery = {
|
|
12
|
+
queryId: number;
|
|
13
|
+
inputType: string;
|
|
14
|
+
inputAlias: string;
|
|
15
|
+
inputLabel: string;
|
|
16
|
+
inputPlaceholder?: string;
|
|
17
|
+
newRow?: boolean;
|
|
18
|
+
inputWidth: number;
|
|
19
|
+
inputHeight?: number;
|
|
20
|
+
isRequired?: boolean;
|
|
21
|
+
isHinted?: boolean;
|
|
22
|
+
hintText?: string;
|
|
23
|
+
hintUrl?: string;
|
|
24
|
+
errorText?: string;
|
|
25
|
+
defaultValue?: any;
|
|
26
|
+
queryResponse?: any;
|
|
27
|
+
inputOptions?: z.infer<typeof InputOptionSchema>[];
|
|
28
|
+
triggerValue?: any;
|
|
29
|
+
toggledInput?: XFormQuery | null;
|
|
30
|
+
minValue?: number;
|
|
31
|
+
maxValue?: number;
|
|
32
|
+
stepValue?: number;
|
|
33
|
+
};
|
|
34
|
+
export declare const QuerySchema: z.ZodType<XFormQuery>;
|
|
35
|
+
export declare const SectionSchema: z.ZodObject<{
|
|
36
|
+
sectionId: z.ZodString;
|
|
37
|
+
title: z.ZodString;
|
|
38
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
39
|
+
queries: z.ZodArray<z.ZodType<XFormQuery, unknown, z.core.$ZodTypeInternals<XFormQuery, unknown>>>;
|
|
40
|
+
}, z.core.$strip>;
|
|
41
|
+
export declare const XFormSchema: z.ZodObject<{
|
|
42
|
+
uuid: z.ZodString;
|
|
43
|
+
name: z.ZodString;
|
|
44
|
+
logo: z.ZodOptional<z.ZodString>;
|
|
45
|
+
brandColor: z.ZodOptional<z.ZodString>;
|
|
46
|
+
logoPosition: z.ZodOptional<z.ZodString>;
|
|
47
|
+
model: z.ZodArray<z.ZodObject<{
|
|
48
|
+
sectionId: z.ZodString;
|
|
49
|
+
title: z.ZodString;
|
|
50
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
51
|
+
queries: z.ZodArray<z.ZodType<XFormQuery, unknown, z.core.$ZodTypeInternals<XFormQuery, unknown>>>;
|
|
52
|
+
}, z.core.$strip>>;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
export type XFormType = z.infer<typeof XFormSchema>;
|