@emeraldemperaur/vector-sigma 1.4.32 → 1.4.33
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 +112 -161
- package/lib/index.esm.js +112 -161
- package/lib/types/components/dropdown/dropdown.d.ts +6 -6
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -31436,9 +31436,10 @@ const DatePicker = ({ alias, inputLabel, inputtype = 'datepicker-outline', width
|
|
|
31436
31436
|
};
|
|
31437
31437
|
|
|
31438
31438
|
const Dropdown = (_a) => {
|
|
31439
|
-
var { inputtype = 'dropdown-outline', alias, readOnly, width, inputLabel, placeholder, inputOptions, style, newRow, isHinted, hintText, hintUrl, errorText, className, formikContext } = _a
|
|
31439
|
+
var { inputtype = 'dropdown-outline', alias, readOnly, width, inputLabel, placeholder, inputOptions, style, newRow, isHinted, hintText, hintUrl, errorText, className, formikContext, onValueChange } = _a; __rest$1(_a, ["inputtype", "alias", "readOnly", "width", "inputLabel", "placeholder", "inputOptions", "style", "newRow", "isHinted", "hintText", "hintUrl", "errorText", "className", "formikContext", "onValueChange"]);
|
|
31440
31440
|
const defaultFormikContext = formik.useFormikContext();
|
|
31441
31441
|
const activeContext = formikContext || defaultFormikContext;
|
|
31442
|
+
const RESET_ID = `__RESET__${alias}`;
|
|
31442
31443
|
if (!activeContext) {
|
|
31443
31444
|
console.error(`Dropdown '${alias}' must be used within a Formik provider or receive a formikContext prop.`);
|
|
31444
31445
|
return null;
|
|
@@ -31450,7 +31451,7 @@ const Dropdown = (_a) => {
|
|
|
31450
31451
|
const hasError = Boolean(fieldTouched && fieldError);
|
|
31451
31452
|
const triggerRef = React.useRef(null);
|
|
31452
31453
|
const [neuVars, setNeuVars] = React.useState({});
|
|
31453
|
-
const inputId = `${alias}FormInput
|
|
31454
|
+
const inputId = `${alias}FormInput`;
|
|
31454
31455
|
const errorId = `${alias}-error`;
|
|
31455
31456
|
React.useEffect(() => {
|
|
31456
31457
|
if (inputtype === 'dropdown-neumorphic' && triggerRef.current) {
|
|
@@ -31481,7 +31482,6 @@ const Dropdown = (_a) => {
|
|
|
31481
31482
|
borderRadius: '4px',
|
|
31482
31483
|
boxShadow: '0 5px 15px rgba(0,0,0,0.2)',
|
|
31483
31484
|
};
|
|
31484
|
-
// OUTLINE
|
|
31485
31485
|
const outlineTrigger = {
|
|
31486
31486
|
backgroundColor: 'transparent',
|
|
31487
31487
|
border: '2px solid var(--gray-7)',
|
|
@@ -31494,7 +31494,6 @@ const Dropdown = (_a) => {
|
|
|
31494
31494
|
borderRadius: '4px',
|
|
31495
31495
|
boxShadow: 'none',
|
|
31496
31496
|
};
|
|
31497
|
-
// NEUMORPHIC
|
|
31498
31497
|
const neumorphicTrigger = {
|
|
31499
31498
|
backgroundColor: 'var(--neu-bg)',
|
|
31500
31499
|
color: 'var(--neu-text)',
|
|
@@ -31518,50 +31517,45 @@ const Dropdown = (_a) => {
|
|
|
31518
31517
|
const activeContentStyle = inputtype === 'dropdown' ? materialContent :
|
|
31519
31518
|
inputtype === 'dropdown-material' ? materialContent :
|
|
31520
31519
|
inputtype === 'dropdown-outline' ? outlineContent : Object.assign(Object.assign({}, neumorphicContent), neuVars);
|
|
31521
|
-
return (React.createElement(
|
|
31522
|
-
React.createElement(
|
|
31523
|
-
React.createElement(
|
|
31524
|
-
|
|
31525
|
-
|
|
31526
|
-
|
|
31527
|
-
|
|
31528
|
-
|
|
31529
|
-
|
|
31530
|
-
|
|
31531
|
-
|
|
31532
|
-
}
|
|
31533
|
-
|
|
31534
|
-
|
|
31535
|
-
|
|
31536
|
-
|
|
31537
|
-
|
|
31538
|
-
|
|
31539
|
-
|
|
31540
|
-
|
|
31541
|
-
|
|
31542
|
-
|
|
31543
|
-
|
|
31544
|
-
|
|
31545
|
-
|
|
31546
|
-
React.createElement(
|
|
31547
|
-
|
|
31548
|
-
|
|
31549
|
-
|
|
31550
|
-
React.createElement(
|
|
31551
|
-
|
|
31552
|
-
:
|
|
31553
|
-
|
|
31554
|
-
React.createElement("
|
|
31555
|
-
|
|
31556
|
-
|
|
31557
|
-
|
|
31558
|
-
React.createElement(
|
|
31559
|
-
|
|
31560
|
-
React.createElement("a", { href: hintUrl || "", target: "_blank", rel: "noopener noreferrer" },
|
|
31561
|
-
React.createElement(Icon, { name: "questionmarkcircled", height: "16", width: "16", style: { cursor: 'pointer', color: 'gray' } })))) : null,
|
|
31562
|
-
hasError ?
|
|
31563
|
-
React.createElement(React.Fragment, null,
|
|
31564
|
-
React.createElement("p", { id: errorId, className: 'core-input-label-error' }, errorText || (typeof fieldError === 'string' ? fieldError : "Required field"))) : null)))));
|
|
31520
|
+
return (React.createElement(Column, { span: width, newLine: newRow },
|
|
31521
|
+
React.createElement(p$5, { direction: "column", gap: "2", style: { width: '100%' } },
|
|
31522
|
+
inputtype === 'dropdown-neumorphic' && (React.createElement("style", { dangerouslySetInnerHTML: { __html: `
|
|
31523
|
+
.neu-select-trigger[data-state='open'] {
|
|
31524
|
+
box-shadow: inset 6px 6px 12px var(--neu-shadow-dark),
|
|
31525
|
+
inset -6px -6px 12px var(--neu-shadow-light) !important;
|
|
31526
|
+
}
|
|
31527
|
+
.neu-select-item:hover {
|
|
31528
|
+
background-color: rgba(0,0,0,0.05) !important;
|
|
31529
|
+
cursor: pointer;
|
|
31530
|
+
}
|
|
31531
|
+
` } })),
|
|
31532
|
+
React.createElement(C$1, { name: alias, disabled: readOnly, value: fieldValue || "", onValueChange: (val) => {
|
|
31533
|
+
const finalVal = val === RESET_ID ? "" : val;
|
|
31534
|
+
setFieldValue(alias, finalVal);
|
|
31535
|
+
setTimeout(() => setFieldTouched(alias, true, false), 0);
|
|
31536
|
+
if (onValueChange)
|
|
31537
|
+
onValueChange(finalVal);
|
|
31538
|
+
}, onOpenChange: (isOpen) => {
|
|
31539
|
+
if (!isOpen) {
|
|
31540
|
+
setFieldTouched(alias, true, false);
|
|
31541
|
+
}
|
|
31542
|
+
} },
|
|
31543
|
+
React.createElement(u$1, { id: inputId, ref: triggerRef, variant: "ghost", placeholder: placeholder || "Select an option", className: `${inputtype === 'dropdown-neumorphic' ? 'neu-select-trigger' : ''} ${className || ''}`, style: Object.assign(Object.assign({}, activeTriggerStyle), style) }),
|
|
31544
|
+
React.createElement(g, { position: "popper", sideOffset: 5, style: activeContentStyle },
|
|
31545
|
+
React.createElement(v, { value: RESET_ID, className: inputtype === 'dropdown-neumorphic' ? 'neu-select-item' : '', style: { color: 'var(--gray-10)', fontStyle: 'italic' } }, placeholder || "Select an option"),
|
|
31546
|
+
React.createElement(o$2, { size: "4", style: { margin: '4px 0', opacity: 0.5 } }),
|
|
31547
|
+
inputOptions.map((inputoption, idx) => (React.createElement(React.Fragment, { key: `${alias}-opt-${inputoption.optionid || idx}` }, inputoption.optionurl ?
|
|
31548
|
+
React.createElement(v, { id: String(inputoption.optionid) || `${alias}-item-${idx}`, value: String(inputoption.optionvalue) || `__empty_${idx}`, className: inputtype === 'dropdown-neumorphic' ? 'neu-select-item' : '' },
|
|
31549
|
+
React.createElement("a", { onClick: (e) => { e.stopPropagation(); openLink(inputoption.optionurl || "#"); }, style: { textDecoration: 'none', color: 'inherit' } }, inputoption.text))
|
|
31550
|
+
:
|
|
31551
|
+
React.createElement(v, { id: String(inputoption.optionid) || `${alias}-item-${idx}`, value: String(inputoption.optionvalue) || `__empty_${idx}`, className: inputtype === 'dropdown-neumorphic' ? 'neu-select-item' : '' }, inputoption.text)))))),
|
|
31552
|
+
React.createElement("div", null,
|
|
31553
|
+
React.createElement(p$d, { id: `${alias}InputLabel`, as: "label", size: "2", weight: "bold", htmlFor: inputId }, inputLabel),
|
|
31554
|
+
"\u00A0",
|
|
31555
|
+
isHinted ? (React.createElement(e, { content: hintText || "No hint available", align: "start", sideOffset: 5, className: "core-input-tooltip" },
|
|
31556
|
+
React.createElement("a", { href: hintUrl || "", target: "_blank", rel: "noopener noreferrer" },
|
|
31557
|
+
React.createElement(Icon, { name: "questionmarkcircled", height: "16", width: "16", style: { cursor: 'pointer', color: 'gray' } })))) : null,
|
|
31558
|
+
hasError ? (React.createElement("p", { id: errorId, className: 'core-input-label-error' }, errorText || (typeof fieldError === 'string' ? fieldError : "Required field"))) : null))));
|
|
31565
31559
|
};
|
|
31566
31560
|
|
|
31567
31561
|
const DateRangePicker = ({ alias, inputLabel, inputtype = 'daterangepicker-outline', width = 12, newRow, placeholder = "Select date range", isHinted, hintText, hintUrl, errorText, readOnly, className, formikContext }) => {
|
|
@@ -52595,6 +52589,7 @@ const OptionSelect = (_a) => {
|
|
|
52595
52589
|
const fieldValue = formik.getIn(values, alias);
|
|
52596
52590
|
const fieldTouched = formik.getIn(touched, alias);
|
|
52597
52591
|
const fieldError = formik.getIn(errors, alias);
|
|
52592
|
+
const RESET_ID = `__RESET__${alias}`;
|
|
52598
52593
|
const hasError = Boolean(fieldTouched && fieldError);
|
|
52599
52594
|
const errorId = `${alias}-error`;
|
|
52600
52595
|
React.useEffect(() => {
|
|
@@ -52674,7 +52669,7 @@ const OptionSelect = (_a) => {
|
|
|
52674
52669
|
}
|
|
52675
52670
|
` } })),
|
|
52676
52671
|
React.createElement(C$1, { name: alias, disabled: readOnly, value: fieldValue || "", onValueChange: (val) => {
|
|
52677
|
-
const finalVal = val ===
|
|
52672
|
+
const finalVal = val === RESET_ID ? "" : val;
|
|
52678
52673
|
setFieldValue(alias, finalVal);
|
|
52679
52674
|
setTimeout(() => setFieldTouched(alias, true, false), 0);
|
|
52680
52675
|
if (props.onValueChange)
|
|
@@ -52686,7 +52681,7 @@ const OptionSelect = (_a) => {
|
|
|
52686
52681
|
} },
|
|
52687
52682
|
React.createElement(u$1, Object.assign({ id: `${alias}FormInput`, ref: triggerRef, variant: "ghost", placeholder: placeholder || "Select an option", className: `${inputtype === 'dropdown-neumorphic' ? 'neu-select-trigger' : ''} ${props.className || ''}`, style: Object.assign(Object.assign({}, activeTriggerStyle), style) }, props)),
|
|
52688
52683
|
React.createElement(g, { position: "popper", sideOffset: 5, style: activeContentStyle },
|
|
52689
|
-
React.createElement(v, { value:
|
|
52684
|
+
React.createElement(v, { value: RESET_ID, className: inputtype === 'dropdown-neumorphic' ? 'neu-select-item' : '', style: { color: 'var(--gray-10)', fontStyle: 'italic' } }, placeholder || "Select an option"),
|
|
52690
52685
|
React.createElement(o$2, { size: "4", style: { margin: '4px 0', opacity: 0.5 } }),
|
|
52691
52686
|
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) || `__empty_${inputoption.optionid}`, className: inputtype === 'dropdown-neumorphic' ? 'neu-select-item' : '' },
|
|
52692
52687
|
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) || `__empty_${inputoption.optionid}`, className: inputtype === 'dropdown-neumorphic' ? 'neu-select-item' : '' }, inputoption.text))))))),
|
|
@@ -53638,158 +53633,114 @@ const Teletraan1 = ({ xFormModel, readOnlyMode = false, displayMode = 'codice',
|
|
|
53638
53633
|
if (readOnlyMode)
|
|
53639
53634
|
readOnly = true;
|
|
53640
53635
|
const normalizedType = inputType.toLocaleLowerCase();
|
|
53636
|
+
const layoutProps = {
|
|
53637
|
+
alias: inputAlias,
|
|
53638
|
+
width: inputWidth,
|
|
53639
|
+
inputLabel: inputLabel,
|
|
53640
|
+
key: inputUID,
|
|
53641
|
+
newRow: newRow,
|
|
53642
|
+
readOnly: readOnly,
|
|
53643
|
+
isHinted: isHinted,
|
|
53644
|
+
hintText: hintText,
|
|
53645
|
+
hintUrl: hintUrl,
|
|
53646
|
+
errorText: errorText
|
|
53647
|
+
};
|
|
53641
53648
|
switch (true) {
|
|
53642
53649
|
case avatarInputType.includes(normalizedType):
|
|
53643
|
-
return React.createElement(AvatarInput, {
|
|
53650
|
+
return React.createElement(AvatarInput, Object.assign({}, layoutProps));
|
|
53644
53651
|
case buttonInputType.includes(normalizedType):
|
|
53645
|
-
return React.createElement(ButtonInput, {
|
|
53652
|
+
return React.createElement(ButtonInput, Object.assign({}, layoutProps), defaultValue);
|
|
53646
53653
|
case checkboxInputType.includes(normalizedType):
|
|
53647
|
-
return React.createElement(CheckboxGroupInput, {
|
|
53654
|
+
return React.createElement(CheckboxGroupInput, Object.assign({}, layoutProps, { inputOptions: inputOptions || [InputOptionsPlaceholder] }));
|
|
53648
53655
|
case conditionalInputType.includes(normalizedType):
|
|
53649
|
-
return React.createElement(ConditionalTrigger, {
|
|
53656
|
+
return React.createElement(ConditionalTrigger, Object.assign({}, layoutProps, { inputOptions: inputOptions, triggerValue: defaultValue, children: toggledInput }));
|
|
53650
53657
|
case datePickerInputType.includes(normalizedType):
|
|
53651
|
-
return React.createElement(DatePicker, {
|
|
53658
|
+
return React.createElement(DatePicker, Object.assign({}, layoutProps, { placeholder: inputPlaceholder }));
|
|
53652
53659
|
case dateRangePickerInputType.includes(normalizedType):
|
|
53653
|
-
return React.createElement(DateRangePicker, { alias: inputAlias, inputLabel: inputLabel, width: inputWidth, newRow: newRow, readOnly: readOnly, isHinted: isHinted, hintText: hintText, hintUrl: hintUrl, key: inputUID, errorText: errorText });
|
|
53654
53660
|
case dateTimePickerInputType.includes(normalizedType):
|
|
53655
|
-
return React.createElement(DateRangePicker, {
|
|
53661
|
+
return React.createElement(DateRangePicker, Object.assign({}, layoutProps));
|
|
53656
53662
|
case dropdownInputType.includes(normalizedType):
|
|
53657
|
-
return React.createElement(Dropdown, {
|
|
53663
|
+
return React.createElement(Dropdown, Object.assign({}, layoutProps, { inputOptions: inputOptions || [InputOptionsPlaceholder] }));
|
|
53658
53664
|
case fileInputType.includes(normalizedType):
|
|
53659
|
-
return React.createElement(File$1, {
|
|
53665
|
+
return React.createElement(File$1, Object.assign({}, layoutProps, { preview: true }));
|
|
53660
53666
|
case fileMultipleInputType.includes(normalizedType):
|
|
53661
|
-
return React.createElement(FileMultiple, {
|
|
53667
|
+
return React.createElement(FileMultiple, Object.assign({}, layoutProps, { placeholder: inputPlaceholder, preview: true }));
|
|
53662
53668
|
case imageOutputType.includes(normalizedType):
|
|
53663
|
-
return React.createElement(ImageOutput, { id: inputAlias, src: defaultValue, alt: inputPlaceholder, width: inputWidth, height: inputHeight });
|
|
53669
|
+
return React.createElement(ImageOutput, { id: inputAlias, src: defaultValue, alt: inputPlaceholder, width: inputWidth, height: inputHeight, key: inputUID });
|
|
53664
53670
|
case textInputType.includes(normalizedType):
|
|
53665
|
-
return React.createElement(Input$2, {
|
|
53671
|
+
return React.createElement(Input$2, Object.assign({}, layoutProps, { placeholder: inputPlaceholder }));
|
|
53666
53672
|
case passwordInputType.includes(normalizedType):
|
|
53667
|
-
return React.createElement(PasswordInput, {
|
|
53673
|
+
return React.createElement(PasswordInput, Object.assign({}, layoutProps, { placeholder: inputPlaceholder }));
|
|
53668
53674
|
case phoneInputType.includes(normalizedType):
|
|
53669
|
-
return React.createElement(PhoneInput, {
|
|
53675
|
+
return React.createElement(PhoneInput, Object.assign({}, layoutProps, { placeholder: inputPlaceholder }));
|
|
53670
53676
|
case creditCardInputType.includes(normalizedType):
|
|
53671
|
-
return React.createElement(CreditCardInput, {
|
|
53677
|
+
return React.createElement(CreditCardInput, Object.assign({}, layoutProps, { placeholder: inputPlaceholder }));
|
|
53672
53678
|
case currencyInputType.includes(normalizedType):
|
|
53673
|
-
return React.createElement(CurrencyInput, {
|
|
53679
|
+
return React.createElement(CurrencyInput, Object.assign({}, layoutProps, { placeholder: inputPlaceholder }));
|
|
53674
53680
|
case stockInputType.includes(normalizedType):
|
|
53675
|
-
return React.createElement(StockInput, {
|
|
53681
|
+
return React.createElement(StockInput, Object.assign({}, layoutProps, { placeholder: inputPlaceholder, defaultvalue: defaultValue }));
|
|
53676
53682
|
case radioInputType.includes(normalizedType):
|
|
53677
|
-
return React.createElement(RadioGroupInput, {
|
|
53683
|
+
return React.createElement(RadioGroupInput, Object.assign({}, layoutProps, { inputOptions: inputOptions || [InputOptionsPlaceholder] }));
|
|
53678
53684
|
case selectInputType.includes(normalizedType):
|
|
53679
|
-
return React.createElement(OptionSelect, {
|
|
53685
|
+
return React.createElement(OptionSelect, Object.assign({}, layoutProps, { inputOptions: inputOptions || [InputOptionsPlaceholder] }));
|
|
53680
53686
|
case selectMultipleInputType.includes(normalizedType):
|
|
53681
|
-
return React.createElement(MultipleSelect, {
|
|
53687
|
+
return React.createElement(MultipleSelect, Object.assign({}, layoutProps, { inputOptions: inputOptions || [InputOptionsPlaceholder] }));
|
|
53682
53688
|
case sliderInputType.includes(normalizedType):
|
|
53683
|
-
return React.createElement(SliderInput, {
|
|
53689
|
+
return React.createElement(SliderInput, Object.assign({}, layoutProps, { stepvalue: Number(stepValue), minvalue: Number(inputMinValue), maxvalue: Number(inputMaxValue) }));
|
|
53684
53690
|
case rangeSliderInputType.includes(normalizedType):
|
|
53685
|
-
return React.createElement(RangeSlider, {
|
|
53691
|
+
return React.createElement(RangeSlider, Object.assign({}, layoutProps, { stepvalue: Number(stepValue), minvalue: Number(inputMinValue), maxvalue: Number(inputMaxValue) }));
|
|
53686
53692
|
case toggleInputType.includes(normalizedType):
|
|
53687
|
-
return React.createElement(Toggle, {
|
|
53693
|
+
return React.createElement(Toggle, Object.assign({}, layoutProps, { icon: defaultValue }));
|
|
53688
53694
|
default:
|
|
53689
|
-
return React.createElement(Input$2, {
|
|
53695
|
+
return React.createElement(Input$2, Object.assign({}, layoutProps, { placeholder: inputPlaceholder }));
|
|
53690
53696
|
}
|
|
53691
53697
|
};
|
|
53692
53698
|
const renderQueries = (queries) => {
|
|
53693
53699
|
if (!queries)
|
|
53694
53700
|
return null;
|
|
53695
|
-
return queries.map((xFormelement) =>
|
|
53696
|
-
|
|
53697
|
-
|
|
53701
|
+
return queries.map((xFormelement) => {
|
|
53702
|
+
const childInput = xFormelement.toggledInput ? inputAlphaTrion(xFormelement.toggledInput.inputAlias, xFormelement.toggledInput.inputType, xFormelement.toggledInput.inputWidth, xFormelement.toggledInput.inputLabel, String(xFormelement.toggledInput.minValue), String(xFormelement.toggledInput.maxValue), xFormelement.toggledInput.defaultValue, xFormelement.toggledInput.inputOptions, xFormelement.toggledInput.stepValue, xFormelement.toggledInput.inputHeight, null, null, xFormelement.toggledInput.newRow, xFormelement.toggledInput.inputPlaceholder, readOnlyMode, xFormelement.toggledInput.isHinted, xFormelement.toggledInput.hintText || "", xFormelement.toggledInput.hintUrl || "", xFormelement.toggledInput.errorText, String(xFormelement.toggledInput.queryId) || crypto.randomUUID()) : null;
|
|
53703
|
+
return inputAlphaTrion(xFormelement.inputAlias, xFormelement.inputType, xFormelement.inputWidth, xFormelement.inputLabel, String(xFormelement.minValue), String(xFormelement.maxValue), xFormelement.defaultValue, xFormelement.inputOptions, xFormelement.stepValue, xFormelement.inputHeight, childInput, xFormelement.triggerValue, xFormelement.newRow, xFormelement.inputPlaceholder, readOnlyMode, xFormelement.isHinted, xFormelement.hintText || "", xFormelement.hintUrl || "", xFormelement.errorText, String(xFormelement.queryId) || crypto.randomUUID());
|
|
53704
|
+
});
|
|
53698
53705
|
};
|
|
53699
53706
|
const renderDisplayMode = () => {
|
|
53700
53707
|
switch (displayMode) {
|
|
53701
53708
|
case 'dual':
|
|
53702
53709
|
return (React.createElement(React.Fragment, null,
|
|
53703
|
-
"
|
|
53704
|
-
|
|
53705
|
-
React.createElement("div", { style: {
|
|
53706
|
-
React.createElement("
|
|
53707
|
-
|
|
53708
|
-
|
|
53709
|
-
|
|
53710
|
-
|
|
53711
|
-
|
|
53712
|
-
|
|
53713
|
-
|
|
53714
|
-
|
|
53715
|
-
|
|
53716
|
-
|
|
53717
|
-
|
|
53718
|
-
|
|
53719
|
-
|
|
53720
|
-
|
|
53721
|
-
|
|
53722
|
-
}
|
|
53723
|
-
|
|
53724
|
-
.neu-toggle-state {
|
|
53725
|
-
display: none;
|
|
53726
|
-
}
|
|
53727
|
-
|
|
53728
|
-
.neu-indicator {
|
|
53729
|
-
height: 100%;
|
|
53730
|
-
width: 200%;
|
|
53731
|
-
background: var(--neu-bg);
|
|
53732
|
-
border-radius: 15px;
|
|
53733
|
-
transform: translate3d(-75%, 0, 0);
|
|
53734
|
-
transition: transform 0.4s cubic-bezier(0.85, 0.05, 0.18, 1.35);
|
|
53735
|
-
box-shadow:
|
|
53736
|
-
-8px -4px 8px 0px var(--neu-shadow-light),
|
|
53737
|
-
8px 4px 12px 0px var(--neu-shadow-dark);
|
|
53738
|
-
}
|
|
53739
|
-
|
|
53740
|
-
.neu-toggle-state:checked ~ .neu-indicator {
|
|
53741
|
-
transform: translate3d(25%, 0, 0);
|
|
53742
|
-
}
|
|
53743
|
-
` } }),
|
|
53744
|
-
React.createElement("input", { id: `teletraan1DualToggle`, className: "neu-toggle-state", type: "checkbox", checked: dualToggled, readOnly: true }),
|
|
53745
|
-
React.createElement("div", { className: "neu-indicator" })),
|
|
53746
|
-
React.createElement(Icon, { name: "layers", height: "20", width: "20", color: brandColor, style: {
|
|
53747
|
-
transition: 'color 0.3s ease',
|
|
53748
|
-
opacity: readOnlyMode ? 0.5 : 1,
|
|
53749
|
-
cursor: 'pointer'
|
|
53750
|
-
}, onClick: () => setDualToggled(!dualToggled) })),
|
|
53751
|
-
dualToggled ?
|
|
53752
|
-
React.createElement(React.Fragment, null,
|
|
53753
|
-
"Accordion Display",
|
|
53754
|
-
React.createElement(Accordion, { allowMultiple: true, brandcolor: brandColor, titleColor: '#ffffff' }, xFormModel.model.map((formsection) => (React.createElement(AccordionItem, { key: formsection.sectionId, sectionId: String(formsection.sectionId), title: formsection.title },
|
|
53755
|
-
React.createElement(Row, { key: formsection.sectionId }, renderQueries(formsection.queries)))))))
|
|
53756
|
-
:
|
|
53757
|
-
React.createElement(React.Fragment, null,
|
|
53758
|
-
"Codice Display",
|
|
53759
|
-
React.createElement(React.Fragment, { key: xFormModel.uuid }, xFormModel.model.map((formsection) => (React.createElement(React.Fragment, { key: formsection.sectionId || crypto.randomUUID() },
|
|
53760
|
-
React.createElement(SectionTitle, { title: formsection.title, icon: React.createElement(Icon, { name: String(formsection.icon) }) }),
|
|
53761
|
-
React.createElement(Row, null, renderQueries(formsection.queries))))))))));
|
|
53710
|
+
React.createElement("div", { style: { display: 'flex', alignItems: 'center', gap: '12px', marginBottom: '20px' } },
|
|
53711
|
+
React.createElement("span", null, "Dual Display"),
|
|
53712
|
+
React.createElement("div", { className: "neu-toggle-wrapper", style: Object.assign(Object.assign({}, neuVars), { opacity: readOnlyMode ? 0.6 : 1, pointerEvents: readOnlyMode ? 'none' : 'auto' }), onClick: () => setDualToggled(!dualToggled) },
|
|
53713
|
+
React.createElement("style", { dangerouslySetInnerHTML: { __html: `
|
|
53714
|
+
.neu-toggle-wrapper { isolation: isolate; position: relative; height: 30px; width: 60px; border-radius: 15px; overflow: hidden; cursor: pointer; background: var(--neu-bg); box-shadow: -8px -4px 8px 0px var(--neu-shadow-light), 8px 4px 12px 0px var(--neu-shadow-dark), 4px 4px 4px 0px var(--neu-shadow-dark) inset, -4px -4px 4px 0px var(--neu-shadow-light) inset; }
|
|
53715
|
+
.neu-toggle-state { display: none; }
|
|
53716
|
+
.neu-indicator { height: 100%; width: 200%; background: var(--neu-bg); border-radius: 15px; transform: translate3d(-75%, 0, 0); transition: transform 0.4s cubic-bezier(0.85, 0.05, 0.18, 1.35); box-shadow: -8px -4px 8px 0px var(--neu-shadow-light), 8px 4px 12px 0px var(--neu-shadow-dark); }
|
|
53717
|
+
.neu-toggle-state:checked ~ .neu-indicator { transform: translate3d(25%, 0, 0); }
|
|
53718
|
+
` } }),
|
|
53719
|
+
React.createElement("input", { className: "neu-toggle-state", type: "checkbox", checked: dualToggled, readOnly: true }),
|
|
53720
|
+
React.createElement("div", { className: "neu-indicator" })),
|
|
53721
|
+
React.createElement(Icon, { name: "layers", height: "20", width: "20", color: brandColor, style: { opacity: readOnlyMode ? 0.5 : 1, cursor: 'pointer' }, onClick: () => setDualToggled(!dualToggled) })),
|
|
53722
|
+
dualToggled ?
|
|
53723
|
+
React.createElement(Accordion, { allowMultiple: true, brandcolor: brandColor, titleColor: '#ffffff' }, xFormModel.model.map((formsection) => (React.createElement(AccordionItem, { key: formsection.sectionId, sectionId: String(formsection.sectionId), title: formsection.title },
|
|
53724
|
+
React.createElement(Row, { key: formsection.sectionId }, renderQueries(formsection.queries))))))
|
|
53725
|
+
:
|
|
53726
|
+
xFormModel.model.map((formsection) => (React.createElement(React.Fragment, { key: formsection.sectionId || crypto.randomUUID() },
|
|
53727
|
+
React.createElement(SectionTitle, { title: formsection.title, icon: React.createElement(Icon, { name: String(formsection.icon) }) }),
|
|
53728
|
+
React.createElement(Row, null, renderQueries(formsection.queries)))))));
|
|
53762
53729
|
case 'accordion':
|
|
53763
|
-
return (React.createElement(React.
|
|
53764
|
-
|
|
53765
|
-
React.createElement(Accordion, { allowMultiple: true, brandcolor: brandColor, titleColor: '#ffffff' }, xFormModel.model.map((formsection) => (React.createElement(AccordionItem, { key: formsection.sectionId, sectionId: String(formsection.sectionId), title: formsection.title },
|
|
53766
|
-
React.createElement(Row, { key: formsection.sectionId }, renderQueries(formsection.queries))))))));
|
|
53730
|
+
return (React.createElement(Accordion, { allowMultiple: true, brandcolor: brandColor, titleColor: '#ffffff' }, xFormModel.model.map((formsection) => (React.createElement(AccordionItem, { key: formsection.sectionId, sectionId: String(formsection.sectionId), title: formsection.title },
|
|
53731
|
+
React.createElement(Row, { key: formsection.sectionId }, renderQueries(formsection.queries)))))));
|
|
53767
53732
|
case 'codex':
|
|
53768
|
-
return (React.createElement(React.
|
|
53769
|
-
|
|
53770
|
-
React.createElement(
|
|
53771
|
-
const prevStepId = index > 0 ? String(array[index - 1].sectionId) : undefined;
|
|
53772
|
-
const nextStepId = index < array.length - 1 ? String(array[index + 1].sectionId) : undefined;
|
|
53773
|
-
return (React.createElement(CodexItem, { key: formsection.sectionId, stepId: String(formsection.sectionId), title: formsection.title },
|
|
53774
|
-
React.createElement(Row, { key: formsection.sectionId }, renderQueries(formsection.queries)),
|
|
53775
|
-
React.createElement(CodexControls, { prevStepId: prevStepId, nextStepId: nextStepId, onPrev: () => {
|
|
53776
|
-
console.log(`Teletraan-1 Codex :: ${formsection.title} :: onPrev()`);
|
|
53777
|
-
}, onNext: () => {
|
|
53778
|
-
console.log(`Teletraan-1 Codex :: ${formsection.title} :: onNext()`);
|
|
53779
|
-
}, onFinish: () => {
|
|
53780
|
-
console.log(`Teletraan-1 Codex :: ${formsection.title} :: onFinish()`);
|
|
53781
|
-
} })));
|
|
53782
|
-
}))));
|
|
53733
|
+
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 },
|
|
53734
|
+
React.createElement(Row, { key: formsection.sectionId }, renderQueries(formsection.queries)),
|
|
53735
|
+
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 }))))));
|
|
53783
53736
|
case 'codice':
|
|
53784
53737
|
default:
|
|
53785
|
-
return (React.createElement(React.Fragment,
|
|
53786
|
-
|
|
53787
|
-
React.createElement(
|
|
53788
|
-
React.createElement(SectionTitle, { title: formsection.title, icon: React.createElement(Icon, { name: String(formsection.icon) }) }),
|
|
53789
|
-
React.createElement(Row, null, renderQueries(formsection.queries))))))));
|
|
53738
|
+
return (React.createElement(React.Fragment, { key: xFormModel.uuid }, xFormModel.model.map((formsection) => (React.createElement(React.Fragment, { key: formsection.sectionId || crypto.randomUUID() },
|
|
53739
|
+
React.createElement(SectionTitle, { title: formsection.title, icon: React.createElement(Icon, { name: String(formsection.icon) }) }),
|
|
53740
|
+
React.createElement(Row, null, renderQueries(formsection.queries)))))));
|
|
53790
53741
|
}
|
|
53791
53742
|
};
|
|
53792
|
-
return (React.createElement(
|
|
53743
|
+
return (React.createElement(React.Fragment, null, renderDisplayMode()));
|
|
53793
53744
|
};
|
|
53794
53745
|
|
|
53795
53746
|
// ==========================================
|
package/lib/index.esm.js
CHANGED
|
@@ -31415,9 +31415,10 @@ const DatePicker = ({ alias, inputLabel, inputtype = 'datepicker-outline', width
|
|
|
31415
31415
|
};
|
|
31416
31416
|
|
|
31417
31417
|
const Dropdown = (_a) => {
|
|
31418
|
-
var { inputtype = 'dropdown-outline', alias, readOnly, width, inputLabel, placeholder, inputOptions, style, newRow, isHinted, hintText, hintUrl, errorText, className, formikContext } = _a
|
|
31418
|
+
var { inputtype = 'dropdown-outline', alias, readOnly, width, inputLabel, placeholder, inputOptions, style, newRow, isHinted, hintText, hintUrl, errorText, className, formikContext, onValueChange } = _a; __rest$1(_a, ["inputtype", "alias", "readOnly", "width", "inputLabel", "placeholder", "inputOptions", "style", "newRow", "isHinted", "hintText", "hintUrl", "errorText", "className", "formikContext", "onValueChange"]);
|
|
31419
31419
|
const defaultFormikContext = useFormikContext();
|
|
31420
31420
|
const activeContext = formikContext || defaultFormikContext;
|
|
31421
|
+
const RESET_ID = `__RESET__${alias}`;
|
|
31421
31422
|
if (!activeContext) {
|
|
31422
31423
|
console.error(`Dropdown '${alias}' must be used within a Formik provider or receive a formikContext prop.`);
|
|
31423
31424
|
return null;
|
|
@@ -31429,7 +31430,7 @@ const Dropdown = (_a) => {
|
|
|
31429
31430
|
const hasError = Boolean(fieldTouched && fieldError);
|
|
31430
31431
|
const triggerRef = useRef(null);
|
|
31431
31432
|
const [neuVars, setNeuVars] = useState({});
|
|
31432
|
-
const inputId = `${alias}FormInput
|
|
31433
|
+
const inputId = `${alias}FormInput`;
|
|
31433
31434
|
const errorId = `${alias}-error`;
|
|
31434
31435
|
useEffect(() => {
|
|
31435
31436
|
if (inputtype === 'dropdown-neumorphic' && triggerRef.current) {
|
|
@@ -31460,7 +31461,6 @@ const Dropdown = (_a) => {
|
|
|
31460
31461
|
borderRadius: '4px',
|
|
31461
31462
|
boxShadow: '0 5px 15px rgba(0,0,0,0.2)',
|
|
31462
31463
|
};
|
|
31463
|
-
// OUTLINE
|
|
31464
31464
|
const outlineTrigger = {
|
|
31465
31465
|
backgroundColor: 'transparent',
|
|
31466
31466
|
border: '2px solid var(--gray-7)',
|
|
@@ -31473,7 +31473,6 @@ const Dropdown = (_a) => {
|
|
|
31473
31473
|
borderRadius: '4px',
|
|
31474
31474
|
boxShadow: 'none',
|
|
31475
31475
|
};
|
|
31476
|
-
// NEUMORPHIC
|
|
31477
31476
|
const neumorphicTrigger = {
|
|
31478
31477
|
backgroundColor: 'var(--neu-bg)',
|
|
31479
31478
|
color: 'var(--neu-text)',
|
|
@@ -31497,50 +31496,45 @@ const Dropdown = (_a) => {
|
|
|
31497
31496
|
const activeContentStyle = inputtype === 'dropdown' ? materialContent :
|
|
31498
31497
|
inputtype === 'dropdown-material' ? materialContent :
|
|
31499
31498
|
inputtype === 'dropdown-outline' ? outlineContent : Object.assign(Object.assign({}, neumorphicContent), neuVars);
|
|
31500
|
-
return (React__default.createElement(
|
|
31501
|
-
React__default.createElement(
|
|
31502
|
-
React__default.createElement(
|
|
31503
|
-
|
|
31504
|
-
|
|
31505
|
-
|
|
31506
|
-
|
|
31507
|
-
|
|
31508
|
-
|
|
31509
|
-
|
|
31510
|
-
|
|
31511
|
-
}
|
|
31512
|
-
|
|
31513
|
-
|
|
31514
|
-
|
|
31515
|
-
|
|
31516
|
-
|
|
31517
|
-
|
|
31518
|
-
|
|
31519
|
-
|
|
31520
|
-
|
|
31521
|
-
|
|
31522
|
-
|
|
31523
|
-
|
|
31524
|
-
|
|
31525
|
-
React__default.createElement(
|
|
31526
|
-
|
|
31527
|
-
|
|
31528
|
-
|
|
31529
|
-
React__default.createElement(
|
|
31530
|
-
|
|
31531
|
-
:
|
|
31532
|
-
|
|
31533
|
-
React__default.createElement("
|
|
31534
|
-
|
|
31535
|
-
|
|
31536
|
-
|
|
31537
|
-
React__default.createElement(
|
|
31538
|
-
|
|
31539
|
-
React__default.createElement("a", { href: hintUrl || "", target: "_blank", rel: "noopener noreferrer" },
|
|
31540
|
-
React__default.createElement(Icon, { name: "questionmarkcircled", height: "16", width: "16", style: { cursor: 'pointer', color: 'gray' } })))) : null,
|
|
31541
|
-
hasError ?
|
|
31542
|
-
React__default.createElement(React__default.Fragment, null,
|
|
31543
|
-
React__default.createElement("p", { id: errorId, className: 'core-input-label-error' }, errorText || (typeof fieldError === 'string' ? fieldError : "Required field"))) : null)))));
|
|
31499
|
+
return (React__default.createElement(Column, { span: width, newLine: newRow },
|
|
31500
|
+
React__default.createElement(p$5, { direction: "column", gap: "2", style: { width: '100%' } },
|
|
31501
|
+
inputtype === 'dropdown-neumorphic' && (React__default.createElement("style", { dangerouslySetInnerHTML: { __html: `
|
|
31502
|
+
.neu-select-trigger[data-state='open'] {
|
|
31503
|
+
box-shadow: inset 6px 6px 12px var(--neu-shadow-dark),
|
|
31504
|
+
inset -6px -6px 12px var(--neu-shadow-light) !important;
|
|
31505
|
+
}
|
|
31506
|
+
.neu-select-item:hover {
|
|
31507
|
+
background-color: rgba(0,0,0,0.05) !important;
|
|
31508
|
+
cursor: pointer;
|
|
31509
|
+
}
|
|
31510
|
+
` } })),
|
|
31511
|
+
React__default.createElement(C$1, { name: alias, disabled: readOnly, value: fieldValue || "", onValueChange: (val) => {
|
|
31512
|
+
const finalVal = val === RESET_ID ? "" : val;
|
|
31513
|
+
setFieldValue(alias, finalVal);
|
|
31514
|
+
setTimeout(() => setFieldTouched(alias, true, false), 0);
|
|
31515
|
+
if (onValueChange)
|
|
31516
|
+
onValueChange(finalVal);
|
|
31517
|
+
}, onOpenChange: (isOpen) => {
|
|
31518
|
+
if (!isOpen) {
|
|
31519
|
+
setFieldTouched(alias, true, false);
|
|
31520
|
+
}
|
|
31521
|
+
} },
|
|
31522
|
+
React__default.createElement(u$1, { id: inputId, ref: triggerRef, variant: "ghost", placeholder: placeholder || "Select an option", className: `${inputtype === 'dropdown-neumorphic' ? 'neu-select-trigger' : ''} ${className || ''}`, style: Object.assign(Object.assign({}, activeTriggerStyle), style) }),
|
|
31523
|
+
React__default.createElement(g, { position: "popper", sideOffset: 5, style: activeContentStyle },
|
|
31524
|
+
React__default.createElement(v, { value: RESET_ID, className: inputtype === 'dropdown-neumorphic' ? 'neu-select-item' : '', style: { color: 'var(--gray-10)', fontStyle: 'italic' } }, placeholder || "Select an option"),
|
|
31525
|
+
React__default.createElement(o$2, { size: "4", style: { margin: '4px 0', opacity: 0.5 } }),
|
|
31526
|
+
inputOptions.map((inputoption, idx) => (React__default.createElement(React__default.Fragment, { key: `${alias}-opt-${inputoption.optionid || idx}` }, inputoption.optionurl ?
|
|
31527
|
+
React__default.createElement(v, { id: String(inputoption.optionid) || `${alias}-item-${idx}`, value: String(inputoption.optionvalue) || `__empty_${idx}`, className: inputtype === 'dropdown-neumorphic' ? 'neu-select-item' : '' },
|
|
31528
|
+
React__default.createElement("a", { onClick: (e) => { e.stopPropagation(); openLink(inputoption.optionurl || "#"); }, style: { textDecoration: 'none', color: 'inherit' } }, inputoption.text))
|
|
31529
|
+
:
|
|
31530
|
+
React__default.createElement(v, { id: String(inputoption.optionid) || `${alias}-item-${idx}`, value: String(inputoption.optionvalue) || `__empty_${idx}`, className: inputtype === 'dropdown-neumorphic' ? 'neu-select-item' : '' }, inputoption.text)))))),
|
|
31531
|
+
React__default.createElement("div", null,
|
|
31532
|
+
React__default.createElement(p$d, { id: `${alias}InputLabel`, as: "label", size: "2", weight: "bold", htmlFor: inputId }, inputLabel),
|
|
31533
|
+
"\u00A0",
|
|
31534
|
+
isHinted ? (React__default.createElement(e, { content: hintText || "No hint available", align: "start", sideOffset: 5, className: "core-input-tooltip" },
|
|
31535
|
+
React__default.createElement("a", { href: hintUrl || "", target: "_blank", rel: "noopener noreferrer" },
|
|
31536
|
+
React__default.createElement(Icon, { name: "questionmarkcircled", height: "16", width: "16", style: { cursor: 'pointer', color: 'gray' } })))) : null,
|
|
31537
|
+
hasError ? (React__default.createElement("p", { id: errorId, className: 'core-input-label-error' }, errorText || (typeof fieldError === 'string' ? fieldError : "Required field"))) : null))));
|
|
31544
31538
|
};
|
|
31545
31539
|
|
|
31546
31540
|
const DateRangePicker = ({ alias, inputLabel, inputtype = 'daterangepicker-outline', width = 12, newRow, placeholder = "Select date range", isHinted, hintText, hintUrl, errorText, readOnly, className, formikContext }) => {
|
|
@@ -52574,6 +52568,7 @@ const OptionSelect = (_a) => {
|
|
|
52574
52568
|
const fieldValue = getIn(values, alias);
|
|
52575
52569
|
const fieldTouched = getIn(touched, alias);
|
|
52576
52570
|
const fieldError = getIn(errors, alias);
|
|
52571
|
+
const RESET_ID = `__RESET__${alias}`;
|
|
52577
52572
|
const hasError = Boolean(fieldTouched && fieldError);
|
|
52578
52573
|
const errorId = `${alias}-error`;
|
|
52579
52574
|
useEffect(() => {
|
|
@@ -52653,7 +52648,7 @@ const OptionSelect = (_a) => {
|
|
|
52653
52648
|
}
|
|
52654
52649
|
` } })),
|
|
52655
52650
|
React__default.createElement(C$1, { name: alias, disabled: readOnly, value: fieldValue || "", onValueChange: (val) => {
|
|
52656
|
-
const finalVal = val ===
|
|
52651
|
+
const finalVal = val === RESET_ID ? "" : val;
|
|
52657
52652
|
setFieldValue(alias, finalVal);
|
|
52658
52653
|
setTimeout(() => setFieldTouched(alias, true, false), 0);
|
|
52659
52654
|
if (props.onValueChange)
|
|
@@ -52665,7 +52660,7 @@ const OptionSelect = (_a) => {
|
|
|
52665
52660
|
} },
|
|
52666
52661
|
React__default.createElement(u$1, Object.assign({ id: `${alias}FormInput`, ref: triggerRef, variant: "ghost", placeholder: placeholder || "Select an option", className: `${inputtype === 'dropdown-neumorphic' ? 'neu-select-trigger' : ''} ${props.className || ''}`, style: Object.assign(Object.assign({}, activeTriggerStyle), style) }, props)),
|
|
52667
52662
|
React__default.createElement(g, { position: "popper", sideOffset: 5, style: activeContentStyle },
|
|
52668
|
-
React__default.createElement(v, { value:
|
|
52663
|
+
React__default.createElement(v, { value: RESET_ID, className: inputtype === 'dropdown-neumorphic' ? 'neu-select-item' : '', style: { color: 'var(--gray-10)', fontStyle: 'italic' } }, placeholder || "Select an option"),
|
|
52669
52664
|
React__default.createElement(o$2, { size: "4", style: { margin: '4px 0', opacity: 0.5 } }),
|
|
52670
52665
|
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) || `__empty_${inputoption.optionid}`, className: inputtype === 'dropdown-neumorphic' ? 'neu-select-item' : '' },
|
|
52671
52666
|
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) || `__empty_${inputoption.optionid}`, className: inputtype === 'dropdown-neumorphic' ? 'neu-select-item' : '' }, inputoption.text))))))),
|
|
@@ -53617,158 +53612,114 @@ const Teletraan1 = ({ xFormModel, readOnlyMode = false, displayMode = 'codice',
|
|
|
53617
53612
|
if (readOnlyMode)
|
|
53618
53613
|
readOnly = true;
|
|
53619
53614
|
const normalizedType = inputType.toLocaleLowerCase();
|
|
53615
|
+
const layoutProps = {
|
|
53616
|
+
alias: inputAlias,
|
|
53617
|
+
width: inputWidth,
|
|
53618
|
+
inputLabel: inputLabel,
|
|
53619
|
+
key: inputUID,
|
|
53620
|
+
newRow: newRow,
|
|
53621
|
+
readOnly: readOnly,
|
|
53622
|
+
isHinted: isHinted,
|
|
53623
|
+
hintText: hintText,
|
|
53624
|
+
hintUrl: hintUrl,
|
|
53625
|
+
errorText: errorText
|
|
53626
|
+
};
|
|
53620
53627
|
switch (true) {
|
|
53621
53628
|
case avatarInputType.includes(normalizedType):
|
|
53622
|
-
return React__default.createElement(AvatarInput, {
|
|
53629
|
+
return React__default.createElement(AvatarInput, Object.assign({}, layoutProps));
|
|
53623
53630
|
case buttonInputType.includes(normalizedType):
|
|
53624
|
-
return React__default.createElement(ButtonInput, {
|
|
53631
|
+
return React__default.createElement(ButtonInput, Object.assign({}, layoutProps), defaultValue);
|
|
53625
53632
|
case checkboxInputType.includes(normalizedType):
|
|
53626
|
-
return React__default.createElement(CheckboxGroupInput, {
|
|
53633
|
+
return React__default.createElement(CheckboxGroupInput, Object.assign({}, layoutProps, { inputOptions: inputOptions || [InputOptionsPlaceholder] }));
|
|
53627
53634
|
case conditionalInputType.includes(normalizedType):
|
|
53628
|
-
return React__default.createElement(ConditionalTrigger, {
|
|
53635
|
+
return React__default.createElement(ConditionalTrigger, Object.assign({}, layoutProps, { inputOptions: inputOptions, triggerValue: defaultValue, children: toggledInput }));
|
|
53629
53636
|
case datePickerInputType.includes(normalizedType):
|
|
53630
|
-
return React__default.createElement(DatePicker, {
|
|
53637
|
+
return React__default.createElement(DatePicker, Object.assign({}, layoutProps, { placeholder: inputPlaceholder }));
|
|
53631
53638
|
case dateRangePickerInputType.includes(normalizedType):
|
|
53632
|
-
return React__default.createElement(DateRangePicker, { alias: inputAlias, inputLabel: inputLabel, width: inputWidth, newRow: newRow, readOnly: readOnly, isHinted: isHinted, hintText: hintText, hintUrl: hintUrl, key: inputUID, errorText: errorText });
|
|
53633
53639
|
case dateTimePickerInputType.includes(normalizedType):
|
|
53634
|
-
return React__default.createElement(DateRangePicker, {
|
|
53640
|
+
return React__default.createElement(DateRangePicker, Object.assign({}, layoutProps));
|
|
53635
53641
|
case dropdownInputType.includes(normalizedType):
|
|
53636
|
-
return React__default.createElement(Dropdown, {
|
|
53642
|
+
return React__default.createElement(Dropdown, Object.assign({}, layoutProps, { inputOptions: inputOptions || [InputOptionsPlaceholder] }));
|
|
53637
53643
|
case fileInputType.includes(normalizedType):
|
|
53638
|
-
return React__default.createElement(File$1, {
|
|
53644
|
+
return React__default.createElement(File$1, Object.assign({}, layoutProps, { preview: true }));
|
|
53639
53645
|
case fileMultipleInputType.includes(normalizedType):
|
|
53640
|
-
return React__default.createElement(FileMultiple, {
|
|
53646
|
+
return React__default.createElement(FileMultiple, Object.assign({}, layoutProps, { placeholder: inputPlaceholder, preview: true }));
|
|
53641
53647
|
case imageOutputType.includes(normalizedType):
|
|
53642
|
-
return React__default.createElement(ImageOutput, { id: inputAlias, src: defaultValue, alt: inputPlaceholder, width: inputWidth, height: inputHeight });
|
|
53648
|
+
return React__default.createElement(ImageOutput, { id: inputAlias, src: defaultValue, alt: inputPlaceholder, width: inputWidth, height: inputHeight, key: inputUID });
|
|
53643
53649
|
case textInputType.includes(normalizedType):
|
|
53644
|
-
return React__default.createElement(Input$2, {
|
|
53650
|
+
return React__default.createElement(Input$2, Object.assign({}, layoutProps, { placeholder: inputPlaceholder }));
|
|
53645
53651
|
case passwordInputType.includes(normalizedType):
|
|
53646
|
-
return React__default.createElement(PasswordInput, {
|
|
53652
|
+
return React__default.createElement(PasswordInput, Object.assign({}, layoutProps, { placeholder: inputPlaceholder }));
|
|
53647
53653
|
case phoneInputType.includes(normalizedType):
|
|
53648
|
-
return React__default.createElement(PhoneInput, {
|
|
53654
|
+
return React__default.createElement(PhoneInput, Object.assign({}, layoutProps, { placeholder: inputPlaceholder }));
|
|
53649
53655
|
case creditCardInputType.includes(normalizedType):
|
|
53650
|
-
return React__default.createElement(CreditCardInput, {
|
|
53656
|
+
return React__default.createElement(CreditCardInput, Object.assign({}, layoutProps, { placeholder: inputPlaceholder }));
|
|
53651
53657
|
case currencyInputType.includes(normalizedType):
|
|
53652
|
-
return React__default.createElement(CurrencyInput, {
|
|
53658
|
+
return React__default.createElement(CurrencyInput, Object.assign({}, layoutProps, { placeholder: inputPlaceholder }));
|
|
53653
53659
|
case stockInputType.includes(normalizedType):
|
|
53654
|
-
return React__default.createElement(StockInput, {
|
|
53660
|
+
return React__default.createElement(StockInput, Object.assign({}, layoutProps, { placeholder: inputPlaceholder, defaultvalue: defaultValue }));
|
|
53655
53661
|
case radioInputType.includes(normalizedType):
|
|
53656
|
-
return React__default.createElement(RadioGroupInput, {
|
|
53662
|
+
return React__default.createElement(RadioGroupInput, Object.assign({}, layoutProps, { inputOptions: inputOptions || [InputOptionsPlaceholder] }));
|
|
53657
53663
|
case selectInputType.includes(normalizedType):
|
|
53658
|
-
return React__default.createElement(OptionSelect, {
|
|
53664
|
+
return React__default.createElement(OptionSelect, Object.assign({}, layoutProps, { inputOptions: inputOptions || [InputOptionsPlaceholder] }));
|
|
53659
53665
|
case selectMultipleInputType.includes(normalizedType):
|
|
53660
|
-
return React__default.createElement(MultipleSelect, {
|
|
53666
|
+
return React__default.createElement(MultipleSelect, Object.assign({}, layoutProps, { inputOptions: inputOptions || [InputOptionsPlaceholder] }));
|
|
53661
53667
|
case sliderInputType.includes(normalizedType):
|
|
53662
|
-
return React__default.createElement(SliderInput, {
|
|
53668
|
+
return React__default.createElement(SliderInput, Object.assign({}, layoutProps, { stepvalue: Number(stepValue), minvalue: Number(inputMinValue), maxvalue: Number(inputMaxValue) }));
|
|
53663
53669
|
case rangeSliderInputType.includes(normalizedType):
|
|
53664
|
-
return React__default.createElement(RangeSlider, {
|
|
53670
|
+
return React__default.createElement(RangeSlider, Object.assign({}, layoutProps, { stepvalue: Number(stepValue), minvalue: Number(inputMinValue), maxvalue: Number(inputMaxValue) }));
|
|
53665
53671
|
case toggleInputType.includes(normalizedType):
|
|
53666
|
-
return React__default.createElement(Toggle, {
|
|
53672
|
+
return React__default.createElement(Toggle, Object.assign({}, layoutProps, { icon: defaultValue }));
|
|
53667
53673
|
default:
|
|
53668
|
-
return React__default.createElement(Input$2, {
|
|
53674
|
+
return React__default.createElement(Input$2, Object.assign({}, layoutProps, { placeholder: inputPlaceholder }));
|
|
53669
53675
|
}
|
|
53670
53676
|
};
|
|
53671
53677
|
const renderQueries = (queries) => {
|
|
53672
53678
|
if (!queries)
|
|
53673
53679
|
return null;
|
|
53674
|
-
return queries.map((xFormelement) =>
|
|
53675
|
-
|
|
53676
|
-
|
|
53680
|
+
return queries.map((xFormelement) => {
|
|
53681
|
+
const childInput = xFormelement.toggledInput ? inputAlphaTrion(xFormelement.toggledInput.inputAlias, xFormelement.toggledInput.inputType, xFormelement.toggledInput.inputWidth, xFormelement.toggledInput.inputLabel, String(xFormelement.toggledInput.minValue), String(xFormelement.toggledInput.maxValue), xFormelement.toggledInput.defaultValue, xFormelement.toggledInput.inputOptions, xFormelement.toggledInput.stepValue, xFormelement.toggledInput.inputHeight, null, null, xFormelement.toggledInput.newRow, xFormelement.toggledInput.inputPlaceholder, readOnlyMode, xFormelement.toggledInput.isHinted, xFormelement.toggledInput.hintText || "", xFormelement.toggledInput.hintUrl || "", xFormelement.toggledInput.errorText, String(xFormelement.toggledInput.queryId) || crypto.randomUUID()) : null;
|
|
53682
|
+
return inputAlphaTrion(xFormelement.inputAlias, xFormelement.inputType, xFormelement.inputWidth, xFormelement.inputLabel, String(xFormelement.minValue), String(xFormelement.maxValue), xFormelement.defaultValue, xFormelement.inputOptions, xFormelement.stepValue, xFormelement.inputHeight, childInput, xFormelement.triggerValue, xFormelement.newRow, xFormelement.inputPlaceholder, readOnlyMode, xFormelement.isHinted, xFormelement.hintText || "", xFormelement.hintUrl || "", xFormelement.errorText, String(xFormelement.queryId) || crypto.randomUUID());
|
|
53683
|
+
});
|
|
53677
53684
|
};
|
|
53678
53685
|
const renderDisplayMode = () => {
|
|
53679
53686
|
switch (displayMode) {
|
|
53680
53687
|
case 'dual':
|
|
53681
53688
|
return (React__default.createElement(React__default.Fragment, null,
|
|
53682
|
-
"
|
|
53683
|
-
|
|
53684
|
-
React__default.createElement("div", { style: {
|
|
53685
|
-
React__default.createElement("
|
|
53686
|
-
|
|
53687
|
-
|
|
53688
|
-
|
|
53689
|
-
|
|
53690
|
-
|
|
53691
|
-
|
|
53692
|
-
|
|
53693
|
-
|
|
53694
|
-
|
|
53695
|
-
|
|
53696
|
-
|
|
53697
|
-
|
|
53698
|
-
|
|
53699
|
-
|
|
53700
|
-
|
|
53701
|
-
}
|
|
53702
|
-
|
|
53703
|
-
.neu-toggle-state {
|
|
53704
|
-
display: none;
|
|
53705
|
-
}
|
|
53706
|
-
|
|
53707
|
-
.neu-indicator {
|
|
53708
|
-
height: 100%;
|
|
53709
|
-
width: 200%;
|
|
53710
|
-
background: var(--neu-bg);
|
|
53711
|
-
border-radius: 15px;
|
|
53712
|
-
transform: translate3d(-75%, 0, 0);
|
|
53713
|
-
transition: transform 0.4s cubic-bezier(0.85, 0.05, 0.18, 1.35);
|
|
53714
|
-
box-shadow:
|
|
53715
|
-
-8px -4px 8px 0px var(--neu-shadow-light),
|
|
53716
|
-
8px 4px 12px 0px var(--neu-shadow-dark);
|
|
53717
|
-
}
|
|
53718
|
-
|
|
53719
|
-
.neu-toggle-state:checked ~ .neu-indicator {
|
|
53720
|
-
transform: translate3d(25%, 0, 0);
|
|
53721
|
-
}
|
|
53722
|
-
` } }),
|
|
53723
|
-
React__default.createElement("input", { id: `teletraan1DualToggle`, className: "neu-toggle-state", type: "checkbox", checked: dualToggled, readOnly: true }),
|
|
53724
|
-
React__default.createElement("div", { className: "neu-indicator" })),
|
|
53725
|
-
React__default.createElement(Icon, { name: "layers", height: "20", width: "20", color: brandColor, style: {
|
|
53726
|
-
transition: 'color 0.3s ease',
|
|
53727
|
-
opacity: readOnlyMode ? 0.5 : 1,
|
|
53728
|
-
cursor: 'pointer'
|
|
53729
|
-
}, onClick: () => setDualToggled(!dualToggled) })),
|
|
53730
|
-
dualToggled ?
|
|
53731
|
-
React__default.createElement(React__default.Fragment, null,
|
|
53732
|
-
"Accordion Display",
|
|
53733
|
-
React__default.createElement(Accordion, { allowMultiple: true, brandcolor: brandColor, titleColor: '#ffffff' }, xFormModel.model.map((formsection) => (React__default.createElement(AccordionItem, { key: formsection.sectionId, sectionId: String(formsection.sectionId), title: formsection.title },
|
|
53734
|
-
React__default.createElement(Row, { key: formsection.sectionId }, renderQueries(formsection.queries)))))))
|
|
53735
|
-
:
|
|
53736
|
-
React__default.createElement(React__default.Fragment, null,
|
|
53737
|
-
"Codice Display",
|
|
53738
|
-
React__default.createElement(React__default.Fragment, { key: xFormModel.uuid }, xFormModel.model.map((formsection) => (React__default.createElement(React__default.Fragment, { key: formsection.sectionId || crypto.randomUUID() },
|
|
53739
|
-
React__default.createElement(SectionTitle, { title: formsection.title, icon: React__default.createElement(Icon, { name: String(formsection.icon) }) }),
|
|
53740
|
-
React__default.createElement(Row, null, renderQueries(formsection.queries))))))))));
|
|
53689
|
+
React__default.createElement("div", { style: { display: 'flex', alignItems: 'center', gap: '12px', marginBottom: '20px' } },
|
|
53690
|
+
React__default.createElement("span", null, "Dual Display"),
|
|
53691
|
+
React__default.createElement("div", { className: "neu-toggle-wrapper", style: Object.assign(Object.assign({}, neuVars), { opacity: readOnlyMode ? 0.6 : 1, pointerEvents: readOnlyMode ? 'none' : 'auto' }), onClick: () => setDualToggled(!dualToggled) },
|
|
53692
|
+
React__default.createElement("style", { dangerouslySetInnerHTML: { __html: `
|
|
53693
|
+
.neu-toggle-wrapper { isolation: isolate; position: relative; height: 30px; width: 60px; border-radius: 15px; overflow: hidden; cursor: pointer; background: var(--neu-bg); box-shadow: -8px -4px 8px 0px var(--neu-shadow-light), 8px 4px 12px 0px var(--neu-shadow-dark), 4px 4px 4px 0px var(--neu-shadow-dark) inset, -4px -4px 4px 0px var(--neu-shadow-light) inset; }
|
|
53694
|
+
.neu-toggle-state { display: none; }
|
|
53695
|
+
.neu-indicator { height: 100%; width: 200%; background: var(--neu-bg); border-radius: 15px; transform: translate3d(-75%, 0, 0); transition: transform 0.4s cubic-bezier(0.85, 0.05, 0.18, 1.35); box-shadow: -8px -4px 8px 0px var(--neu-shadow-light), 8px 4px 12px 0px var(--neu-shadow-dark); }
|
|
53696
|
+
.neu-toggle-state:checked ~ .neu-indicator { transform: translate3d(25%, 0, 0); }
|
|
53697
|
+
` } }),
|
|
53698
|
+
React__default.createElement("input", { className: "neu-toggle-state", type: "checkbox", checked: dualToggled, readOnly: true }),
|
|
53699
|
+
React__default.createElement("div", { className: "neu-indicator" })),
|
|
53700
|
+
React__default.createElement(Icon, { name: "layers", height: "20", width: "20", color: brandColor, style: { opacity: readOnlyMode ? 0.5 : 1, cursor: 'pointer' }, onClick: () => setDualToggled(!dualToggled) })),
|
|
53701
|
+
dualToggled ?
|
|
53702
|
+
React__default.createElement(Accordion, { allowMultiple: true, brandcolor: brandColor, titleColor: '#ffffff' }, xFormModel.model.map((formsection) => (React__default.createElement(AccordionItem, { key: formsection.sectionId, sectionId: String(formsection.sectionId), title: formsection.title },
|
|
53703
|
+
React__default.createElement(Row, { key: formsection.sectionId }, renderQueries(formsection.queries))))))
|
|
53704
|
+
:
|
|
53705
|
+
xFormModel.model.map((formsection) => (React__default.createElement(React__default.Fragment, { key: formsection.sectionId || crypto.randomUUID() },
|
|
53706
|
+
React__default.createElement(SectionTitle, { title: formsection.title, icon: React__default.createElement(Icon, { name: String(formsection.icon) }) }),
|
|
53707
|
+
React__default.createElement(Row, null, renderQueries(formsection.queries)))))));
|
|
53741
53708
|
case 'accordion':
|
|
53742
|
-
return (React__default.createElement(React__default.
|
|
53743
|
-
|
|
53744
|
-
React__default.createElement(Accordion, { allowMultiple: true, brandcolor: brandColor, titleColor: '#ffffff' }, xFormModel.model.map((formsection) => (React__default.createElement(AccordionItem, { key: formsection.sectionId, sectionId: String(formsection.sectionId), title: formsection.title },
|
|
53745
|
-
React__default.createElement(Row, { key: formsection.sectionId }, renderQueries(formsection.queries))))))));
|
|
53709
|
+
return (React__default.createElement(Accordion, { allowMultiple: true, brandcolor: brandColor, titleColor: '#ffffff' }, xFormModel.model.map((formsection) => (React__default.createElement(AccordionItem, { key: formsection.sectionId, sectionId: String(formsection.sectionId), title: formsection.title },
|
|
53710
|
+
React__default.createElement(Row, { key: formsection.sectionId }, renderQueries(formsection.queries)))))));
|
|
53746
53711
|
case 'codex':
|
|
53747
|
-
return (React__default.createElement(React__default.
|
|
53748
|
-
|
|
53749
|
-
React__default.createElement(
|
|
53750
|
-
const prevStepId = index > 0 ? String(array[index - 1].sectionId) : undefined;
|
|
53751
|
-
const nextStepId = index < array.length - 1 ? String(array[index + 1].sectionId) : undefined;
|
|
53752
|
-
return (React__default.createElement(CodexItem, { key: formsection.sectionId, stepId: String(formsection.sectionId), title: formsection.title },
|
|
53753
|
-
React__default.createElement(Row, { key: formsection.sectionId }, renderQueries(formsection.queries)),
|
|
53754
|
-
React__default.createElement(CodexControls, { prevStepId: prevStepId, nextStepId: nextStepId, onPrev: () => {
|
|
53755
|
-
console.log(`Teletraan-1 Codex :: ${formsection.title} :: onPrev()`);
|
|
53756
|
-
}, onNext: () => {
|
|
53757
|
-
console.log(`Teletraan-1 Codex :: ${formsection.title} :: onNext()`);
|
|
53758
|
-
}, onFinish: () => {
|
|
53759
|
-
console.log(`Teletraan-1 Codex :: ${formsection.title} :: onFinish()`);
|
|
53760
|
-
} })));
|
|
53761
|
-
}))));
|
|
53712
|
+
return (React__default.createElement(Codex, { brandColor: brandColor }, xFormModel.model.map((formsection, index, array) => (React__default.createElement(CodexItem, { key: formsection.sectionId, stepId: String(formsection.sectionId), title: formsection.title },
|
|
53713
|
+
React__default.createElement(Row, { key: formsection.sectionId }, renderQueries(formsection.queries)),
|
|
53714
|
+
React__default.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 }))))));
|
|
53762
53715
|
case 'codice':
|
|
53763
53716
|
default:
|
|
53764
|
-
return (React__default.createElement(React__default.Fragment,
|
|
53765
|
-
|
|
53766
|
-
React__default.createElement(
|
|
53767
|
-
React__default.createElement(SectionTitle, { title: formsection.title, icon: React__default.createElement(Icon, { name: String(formsection.icon) }) }),
|
|
53768
|
-
React__default.createElement(Row, null, renderQueries(formsection.queries))))))));
|
|
53717
|
+
return (React__default.createElement(React__default.Fragment, { key: xFormModel.uuid }, xFormModel.model.map((formsection) => (React__default.createElement(React__default.Fragment, { key: formsection.sectionId || crypto.randomUUID() },
|
|
53718
|
+
React__default.createElement(SectionTitle, { title: formsection.title, icon: React__default.createElement(Icon, { name: String(formsection.icon) }) }),
|
|
53719
|
+
React__default.createElement(Row, null, renderQueries(formsection.queries)))))));
|
|
53769
53720
|
}
|
|
53770
53721
|
};
|
|
53771
|
-
return (React__default.createElement(
|
|
53722
|
+
return (React__default.createElement(React__default.Fragment, null, renderDisplayMode()));
|
|
53772
53723
|
};
|
|
53773
53724
|
|
|
53774
53725
|
// ==========================================
|
|
@@ -84,11 +84,11 @@ export interface xDropDownProps {
|
|
|
84
84
|
* * Required inputOptions{} for the Dropdown input field.
|
|
85
85
|
* * @example
|
|
86
86
|
* inputOptions={
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
87
|
+
* [
|
|
88
|
+
* {optionid: 1, optionvalue: "Kaiju", optionurl:"https://github.com/emeraldemperaur", text: "Kaiju"},
|
|
89
|
+
* {optionid: 2, optionvalue: "MekaGodzilla", optionurl:"https://github.com/emeraldemperaur", text: "MekaGodzilla"},
|
|
90
|
+
* {optionid: 3, optionvalue: "Zaibatsu", optionurl:"https://github.com/emeraldemperaur", text: "Zaibatsu"},
|
|
91
|
+
* ]}
|
|
92
92
|
*/
|
|
93
93
|
inputOptions: InputOption[];
|
|
94
94
|
/**
|
|
@@ -109,4 +109,4 @@ export interface xDropDownProps {
|
|
|
109
109
|
*/
|
|
110
110
|
formikContext?: FormikContextType<any>;
|
|
111
111
|
}
|
|
112
|
-
export declare const Dropdown: ({ inputtype, alias, readOnly, width, inputLabel, placeholder, inputOptions, style, newRow, isHinted, hintText, hintUrl, errorText, className, formikContext, ...props }: xDropDownProps) => React.JSX.Element | null;
|
|
112
|
+
export declare const Dropdown: ({ inputtype, alias, readOnly, width, inputLabel, placeholder, inputOptions, style, newRow, isHinted, hintText, hintUrl, errorText, className, formikContext, onValueChange, ...props }: xDropDownProps) => React.JSX.Element | null;
|