onekijs-ui 0.19.2 → 0.19.4
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/dist/components/card/FormCardDisplayer.d.ts +3 -0
- package/dist/components/card/components/FormCardDisplayerComponent.d.ts +4 -0
- package/dist/components/card/style.d.ts +2 -0
- package/dist/components/field/FieldDisplayer.d.ts +3 -0
- package/dist/components/field/FieldHelp.d.ts +2 -2
- package/dist/components/field/components/FieldDisplayerComponent.d.ts +4 -0
- package/dist/components/field/hoc/defaultFIeldDisplayer.d.ts +4 -0
- package/dist/components/field/style.d.ts +2 -1
- package/dist/components/field/typings.d.ts +10 -2
- package/dist/components/icon/HideIcon.d.ts +4 -0
- package/dist/components/icon/ShowIcon.d.ts +4 -0
- package/dist/components/input/typings.d.ts +3 -2
- package/dist/components/password/Password.d.ts +3 -0
- package/dist/components/password/components/PasswordComponent.d.ts +4 -0
- package/dist/components/password/style.d.ts +4 -0
- package/dist/components/password/typings.d.ts +4 -0
- package/dist/components/select/SelectService.d.ts +3 -3
- package/dist/components/table/columns/enumColumn.d.ts +1 -1
- package/dist/components/table/columns/inputColumn.d.ts +1 -1
- package/dist/components/table/displayers/DefaultCellDisplayer.d.ts +4 -0
- package/dist/components/table/displayers/FormTableItemDisplayer.d.ts +4 -0
- package/dist/components/table/displayers/FormTableValueDisplayer.d.ts +4 -0
- package/dist/components/table/typings.d.ts +37 -2
- package/dist/components/wizard/WizardSummary.d.ts +3 -0
- package/dist/components/wizard/components/FormStep.d.ts +2 -2
- package/dist/components/wizard/components/WizardSummaryComponent.d.ts +4 -0
- package/dist/components/wizard/style.d.ts +1 -0
- package/dist/components/wizard/typings.d.ts +1 -0
- package/dist/index.d.ts +23 -9
- package/dist/index.js +592 -132
- package/dist/index.js.map +1 -1
- package/dist/index.module.js +573 -131
- package/dist/index.module.js.map +1 -1
- package/dist/styles/border.d.ts +1 -1
- package/dist/styles/typography.d.ts +2 -2
- package/dist/utils/misc.d.ts +1 -0
- package/package.json +3 -3
- package/src/components/card/FormCard.tsx +40 -8
- package/src/components/card/FormCardDisplayer.tsx +9 -0
- package/src/components/card/components/FormCardDisplayerComponent.tsx +18 -0
- package/src/components/card/style.ts +17 -2
- package/src/components/checkbox/FormCheckbox.tsx +30 -3
- package/src/components/field/FieldDisplayer.tsx +9 -0
- package/src/components/field/FieldHelp.tsx +2 -2
- package/src/components/field/components/FieldDisplayerComponent.tsx +36 -0
- package/src/components/field/hoc/defaultFIeldDisplayer.tsx +25 -0
- package/src/components/field/style.ts +50 -3
- package/src/components/field/typings.ts +11 -1
- package/src/components/field/util.ts +20 -4
- package/src/components/icon/HideIcon.tsx +31 -0
- package/src/components/icon/ShowIcon.tsx +30 -0
- package/src/components/input/FormInput.tsx +35 -10
- package/src/components/input/typings.ts +3 -1
- package/src/components/password/Password.tsx +9 -0
- package/src/components/password/components/PasswordComponent.tsx +26 -0
- package/src/components/password/style.ts +26 -0
- package/src/components/password/typings.ts +5 -0
- package/src/components/select/FormSelect.tsx +63 -4
- package/src/components/select/components/ControlledTreeSelectComponent.tsx +1 -1
- package/src/components/table/FormTable.tsx +40 -7
- package/src/components/table/columns/checkboxColumn.ts +2 -0
- package/src/components/table/columns/enumColumn.tsx +3 -1
- package/src/components/table/columns/inputColumn.ts +3 -1
- package/src/components/table/columns/numberColumn.ts +2 -0
- package/src/components/table/columns/selectColumn.ts +2 -0
- package/src/components/table/columns/textColumn.ts +2 -0
- package/src/components/table/columns/textareaColumn.ts +2 -0
- package/src/components/table/displayers/DefaultCellDisplayer.tsx +29 -0
- package/src/components/table/displayers/FormTableItemDisplayer.tsx +49 -0
- package/src/components/table/displayers/FormTableValueDisplayer.tsx +43 -0
- package/src/components/table/typings.ts +41 -1
- package/src/components/textarea/FormTextarea.tsx +33 -9
- package/src/components/wizard/WizardSummary.tsx +9 -0
- package/src/components/wizard/components/FormStep.tsx +77 -11
- package/src/components/wizard/components/Step.tsx +11 -23
- package/src/components/wizard/components/WizardSummaryComponent.tsx +19 -0
- package/src/components/wizard/style.ts +16 -1
- package/src/components/wizard/typings.ts +1 -0
- package/src/index.ts +31 -11
- package/src/utils/misc.ts +5 -0
package/dist/index.js
CHANGED
|
@@ -718,7 +718,7 @@ const fill = cssProperty(null, colorFormatter('fill'));
|
|
|
718
718
|
const stroke = cssProperty(null, colorFormatter('stroke'));
|
|
719
719
|
const strokeWidth = cssProperty('stroke-width');
|
|
720
720
|
|
|
721
|
-
const IconComponent$
|
|
721
|
+
const IconComponent$a = ({ className }) => {
|
|
722
722
|
return (React.createElement("i", { className: addClassname('o-icon-loading-container', className) },
|
|
723
723
|
React.createElement("svg", { className: "o-icon-loading-svg", viewBox: "0 0 100 100", xmlns: "http://www.w3.org/2000/svg" },
|
|
724
724
|
React.createElement("circle", { className: "o-icon-loading-svg-circle", cx: "50", cy: "50", r: "45" }))));
|
|
@@ -769,7 +769,7 @@ const iconStyle = ({ width: cssWidth = '16px', height: cssHeight = '16px', color
|
|
|
769
769
|
}
|
|
770
770
|
`;
|
|
771
771
|
};
|
|
772
|
-
var LoadingIcon = styled(IconComponent$
|
|
772
|
+
var LoadingIcon = styled(IconComponent$a) `
|
|
773
773
|
${iconStyle}
|
|
774
774
|
`;
|
|
775
775
|
|
|
@@ -785,7 +785,7 @@ const toDegree = (position) => {
|
|
|
785
785
|
return '0';
|
|
786
786
|
}
|
|
787
787
|
};
|
|
788
|
-
const IconComponent$
|
|
788
|
+
const IconComponent$9 = ({ className, onClick, open, loading, model = 'arrow', closeArrowPosition = 'e', openArrowPosition = 's', }) => {
|
|
789
789
|
const iconClassName = addClassname('o-toggler-icon-container', className);
|
|
790
790
|
if (!loading) {
|
|
791
791
|
return (React.createElement("div", { className: iconClassName, onClick: onClick },
|
|
@@ -801,7 +801,7 @@ const IconComponent$7 = ({ className, onClick, open, loading, model = 'arrow', c
|
|
|
801
801
|
React.createElement(LoadingIcon, null)));
|
|
802
802
|
}
|
|
803
803
|
};
|
|
804
|
-
const TogglerIcon = styled(IconComponent$
|
|
804
|
+
const TogglerIcon = styled(IconComponent$9) `
|
|
805
805
|
${({ width = '24px', height = '24px', color: cssColor = 'inherit', visible = true }) => styled.css `
|
|
806
806
|
width: ${width};
|
|
807
807
|
height: ${height};
|
|
@@ -1637,19 +1637,79 @@ const cardStyle = ({ theme, collapsable = true, animate = 150, bordered = true,
|
|
|
1637
1637
|
}
|
|
1638
1638
|
`;
|
|
1639
1639
|
};
|
|
1640
|
+
const formCardDisplayerStyle = () => {
|
|
1641
|
+
return styled.css `
|
|
1642
|
+
.o-displayer-card-title {
|
|
1643
|
+
${borderBottomColor('primary')}
|
|
1644
|
+
${borderBottomWidth('1px')}
|
|
1645
|
+
${borderBottomStyle('solid')}
|
|
1646
|
+
${paddingBottom('sm')}
|
|
1647
|
+
${marginTop('xl')}
|
|
1648
|
+
${fontWeight('bold')}
|
|
1649
|
+
${color('primary')}
|
|
1650
|
+
}
|
|
1651
|
+
`;
|
|
1652
|
+
};
|
|
1640
1653
|
|
|
1641
1654
|
const Card = styled(CardComponent) `
|
|
1642
1655
|
${cardStyle}
|
|
1643
1656
|
`;
|
|
1644
1657
|
|
|
1645
|
-
const
|
|
1646
|
-
|
|
1658
|
+
const titlelize = (value) => {
|
|
1659
|
+
return value.split('_').map((v) => onekijsFramework.ucfirst(v)).join(' ');
|
|
1660
|
+
};
|
|
1661
|
+
|
|
1662
|
+
const FormCardDisplayerComponent = (displayerProps) => {
|
|
1663
|
+
const total = Object.values(displayerProps.children ?? {}).length;
|
|
1664
|
+
return (React.createElement("div", { className: addClassname('o-displayer-card', displayerProps.className) },
|
|
1665
|
+
React.createElement("div", { className: "o-displayer-card-title" }, displayerProps.name),
|
|
1666
|
+
Object.values(displayerProps.children ?? {}).map((field, index) => {
|
|
1667
|
+
const Displayer = field.Displayer;
|
|
1668
|
+
return React.createElement(Displayer, { ...field, index: index, key: `field-${index}`, first: index === 0, last: index === total - 1, format: displayerProps.format });
|
|
1669
|
+
})));
|
|
1670
|
+
};
|
|
1671
|
+
|
|
1672
|
+
const FormCardDisplayer = styled(FormCardDisplayerComponent) `
|
|
1673
|
+
${formCardDisplayerStyle}
|
|
1674
|
+
`;
|
|
1675
|
+
|
|
1676
|
+
const FormCard = ({ name, disabled, visible, ...cardProps }) => {
|
|
1677
|
+
const decorator = onekijsFramework.useFormDecorator(name, {
|
|
1678
|
+
Displayer: (displayerProps) => {
|
|
1679
|
+
return React.createElement(FormCardDisplayer, { ...displayerProps, name: typeof cardProps.title === 'string' ? cardProps.title : titlelize(name) });
|
|
1680
|
+
},
|
|
1681
|
+
});
|
|
1647
1682
|
const form = onekijsFramework.useForm();
|
|
1648
1683
|
const metadata = onekijsFramework.useFormMetadata(decorator.name);
|
|
1684
|
+
const fieldContainer = onekijsFramework.useFieldContainer({
|
|
1685
|
+
container: name,
|
|
1686
|
+
});
|
|
1687
|
+
const { hide, show, disable, enable } = fieldContainer;
|
|
1688
|
+
React.useEffect(() => {
|
|
1689
|
+
if (!metadata.visible) {
|
|
1690
|
+
if (metadata.disabled) {
|
|
1691
|
+
disable();
|
|
1692
|
+
}
|
|
1693
|
+
else {
|
|
1694
|
+
enable();
|
|
1695
|
+
}
|
|
1696
|
+
hide();
|
|
1697
|
+
}
|
|
1698
|
+
else {
|
|
1699
|
+
show();
|
|
1700
|
+
if (metadata.disabled) {
|
|
1701
|
+
disable();
|
|
1702
|
+
}
|
|
1703
|
+
else {
|
|
1704
|
+
enable();
|
|
1705
|
+
}
|
|
1706
|
+
}
|
|
1707
|
+
}, [metadata.visible, metadata.disabled, hide, show, disable, enable]);
|
|
1649
1708
|
if (metadata.visible === false) {
|
|
1650
1709
|
return null;
|
|
1651
1710
|
}
|
|
1652
|
-
return (React.createElement(
|
|
1711
|
+
return (React.createElement(onekijsFramework.FormContext.Provider, { value: fieldContainer.context },
|
|
1712
|
+
React.createElement(Card, { ...cardProps, open: !metadata.disabled, onToggle: () => (metadata.disabled ? form.enable(decorator.name) : form.disable(decorator.name)) })));
|
|
1653
1713
|
};
|
|
1654
1714
|
|
|
1655
1715
|
const CheckboxComponent = ({ label, className = '', onChange, value = false, bordered = true, status, ...checkboxProps }) => {
|
|
@@ -1868,35 +1928,23 @@ const Row = styled(RowComponent) `
|
|
|
1868
1928
|
${rowStyle}
|
|
1869
1929
|
`;
|
|
1870
1930
|
|
|
1871
|
-
const
|
|
1872
|
-
|
|
1873
|
-
React.createElement("
|
|
1874
|
-
React.createElement(
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
display: inline-block;
|
|
1886
|
-
stroke-width: 0;
|
|
1887
|
-
stroke: currentColor;
|
|
1888
|
-
fill: currentColor;
|
|
1931
|
+
const FieldDisplayerComponent = ({ className, label, value, format }) => {
|
|
1932
|
+
if (format === 'form_summary') {
|
|
1933
|
+
return (React.createElement(Row, { marginBottom: "md", className: addClassname('o-field-displayer-form-summary', className) },
|
|
1934
|
+
React.createElement(Col, { size: 12, md: 4, lg: 3, xl: 2, className: "o-field-displayer-form-summary-label-container" },
|
|
1935
|
+
React.createElement("div", { className: "o-field-displayer-form-summary-label" },
|
|
1936
|
+
React.createElement("span", null, label))),
|
|
1937
|
+
React.createElement(Col, { size: 12, md: 8, lg: 9, xl: 10, className: "o-field-displayer-form-summary-value" }, value)));
|
|
1938
|
+
}
|
|
1939
|
+
if (format === 'form_summary_table') {
|
|
1940
|
+
return (React.createElement("div", { className: addClassname('o-field-displayer-form-summary-table', className) },
|
|
1941
|
+
label && React.createElement("span", { className: "o-field-displayer-form-summary-table-label" },
|
|
1942
|
+
label,
|
|
1943
|
+
":"),
|
|
1944
|
+
React.createElement("span", { className: "o-field-displayer-form-summary-table-value" }, value)));
|
|
1889
1945
|
}
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
const FieldHelpComponent = React.memo(({ className, content, visible = true, size = 'medium' }) => {
|
|
1894
|
-
const classNames = addClassname(`o-helper-icon o-helper-icon-${size}`, className);
|
|
1895
|
-
return (React.createElement("div", { className: classNames },
|
|
1896
|
-
React.createElement(Tooltip, { content: content, placement: "top" },
|
|
1897
|
-
React.createElement(HelpIcon, { style: { visibility: visible ? 'visible' : 'hidden' } }))));
|
|
1898
|
-
});
|
|
1899
|
-
FieldHelpComponent.displayName = 'FieldHelpComponent';
|
|
1946
|
+
return null;
|
|
1947
|
+
};
|
|
1900
1948
|
|
|
1901
1949
|
const fieldStyle = () => {
|
|
1902
1950
|
return styled.css `
|
|
@@ -1956,12 +2004,90 @@ const fieldDescriptionStyle = ({ theme, layout }) => {
|
|
|
1956
2004
|
}
|
|
1957
2005
|
`;
|
|
1958
2006
|
};
|
|
2007
|
+
const fieldDisplayerStyle = ({ theme, last }) => {
|
|
2008
|
+
const t = theme.label;
|
|
2009
|
+
return styled.css `
|
|
2010
|
+
${display('flex')}
|
|
2011
|
+
${alignItems('stretch')}
|
|
2012
|
+
&.o-field-displayer-form-summary {
|
|
2013
|
+
${borderBottomWidth(!last ? '1px' : 0)}
|
|
2014
|
+
${borderBottomColor('lighter')}
|
|
2015
|
+
${borderBottomStyle('solid')}
|
|
2016
|
+
}
|
|
2017
|
+
.o-field-displayer-form-summary-label-container {
|
|
2018
|
+
${display('start')}
|
|
2019
|
+
${alignItems('stretch')}
|
|
2020
|
+
${paddingX('md')}
|
|
2021
|
+
${paddingY('xs')}
|
|
2022
|
+
${backgroundColor('lightest')}
|
|
2023
|
+
}
|
|
2024
|
+
.o-field-displayer-form-summary-label {
|
|
2025
|
+
${display('flex')}
|
|
2026
|
+
${alignItems('center')}
|
|
2027
|
+
${fontWeight(t.fontWeight)}
|
|
2028
|
+
${color(t.fontColor)}
|
|
2029
|
+
${fontSize(t.fontSize)}
|
|
2030
|
+
${letterSpacing(t.letterSpacing)}
|
|
2031
|
+
}
|
|
2032
|
+
|
|
2033
|
+
.o-field-displayer-form-summary-value {
|
|
2034
|
+
${paddingY('xs')}
|
|
2035
|
+
${paddingX('md')}
|
|
2036
|
+
${fontFamily('Consolas, Monaco, Courier, monospace')}
|
|
2037
|
+
}
|
|
2038
|
+
|
|
2039
|
+
.o-field-displayer-form-summary-table-label {
|
|
2040
|
+
${display('flex')}
|
|
2041
|
+
${fontWeight(t.fontWeight)}
|
|
2042
|
+
${paddingRight('xs')}
|
|
2043
|
+
}
|
|
2044
|
+
|
|
2045
|
+
.o-helper-icon {
|
|
2046
|
+
${fontSize('xl')}
|
|
2047
|
+
${marginLeft(t.helperMarginLeft)}
|
|
2048
|
+
}
|
|
2049
|
+
`;
|
|
2050
|
+
};
|
|
2051
|
+
|
|
2052
|
+
const FieldDisplayer = styled(FieldDisplayerComponent) `
|
|
2053
|
+
${fieldDisplayerStyle}
|
|
2054
|
+
`;
|
|
2055
|
+
|
|
2056
|
+
const IconComponent$8 = ({ className, onClick, style }) => {
|
|
2057
|
+
return (React.createElement("div", { className: addClassname('o-icon-help', className), onClick: onClick, style: style },
|
|
2058
|
+
React.createElement("svg", { className: "o-icon-help-svg", viewBox: "0 0 512 512" },
|
|
2059
|
+
React.createElement("path", { d: "M256 90c44.3 0 86 17.3 117.4 48.6C404.7 170 422 211.7 422 256s-17.3 86-48.6 117.4C342 404.7 300.3 422 256 422s-86-17.3-117.4-48.6C107.3 342 90 300.3 90 256s17.3-86 48.6-117.4C170 107.3 211.7 90 256 90m0-42C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48z" }),
|
|
2060
|
+
React.createElement("path", { d: "M235 339h42v42h-42zM276.8 318h-41.6c0-67 62.4-62.2 62.4-103.8 0-22.9-18.7-41.7-41.6-41.7S214.4 192 214.4 214h-41.6c0-46 37.2-83 83.2-83s83.2 37.1 83.2 83.1c0 52-62.4 57.9-62.4 103.9z" }))));
|
|
2061
|
+
};
|
|
2062
|
+
var HelpIcon = styled(IconComponent$8) `
|
|
2063
|
+
${({ width = '24px', height = '24px', color: cssColor = 'inherit' }) => styled.css `
|
|
2064
|
+
width: ${width};
|
|
2065
|
+
height: ${height};
|
|
2066
|
+
${display('flex')};
|
|
2067
|
+
${alignItems('center')};
|
|
2068
|
+
${color(cssColor)}
|
|
2069
|
+
.o-icon-help-svg {
|
|
2070
|
+
display: inline-block;
|
|
2071
|
+
stroke-width: 0;
|
|
2072
|
+
stroke: currentColor;
|
|
2073
|
+
fill: currentColor;
|
|
2074
|
+
}
|
|
2075
|
+
`}
|
|
2076
|
+
`;
|
|
2077
|
+
|
|
2078
|
+
const FieldHelpComponent = React.memo(({ className, content, visible = true, size = 'medium' }) => {
|
|
2079
|
+
const classNames = addClassname(`o-helper-icon o-helper-icon-${size}`, className);
|
|
2080
|
+
return (React.createElement("div", { className: classNames },
|
|
2081
|
+
React.createElement(Tooltip, { content: content, placement: "top" },
|
|
2082
|
+
React.createElement(HelpIcon, { style: { visibility: visible ? 'visible' : 'hidden' } }))));
|
|
2083
|
+
});
|
|
2084
|
+
FieldHelpComponent.displayName = 'FieldHelpComponent';
|
|
1959
2085
|
|
|
1960
|
-
const
|
|
2086
|
+
const FieldHelp = styled(FieldHelpComponent) `
|
|
1961
2087
|
${fieldHelpStyle}
|
|
1962
2088
|
`;
|
|
1963
2089
|
|
|
1964
|
-
const LabelComponent = React.memo(({ className, htmlFor, help, HelpComponent =
|
|
2090
|
+
const LabelComponent = React.memo(({ className, htmlFor, help, HelpComponent = FieldHelp, layout = 'vertical', required, text, size }) => {
|
|
1965
2091
|
const classNames = addClassname(`o-label o-label-${layout}${size ? ` o-label-${size}` : ''}`, className);
|
|
1966
2092
|
const labelProps = {
|
|
1967
2093
|
className: 'o-label-text',
|
|
@@ -2110,6 +2236,17 @@ const FieldLayout = styled(FieldLayoutComponent) `
|
|
|
2110
2236
|
${fieldStyle}
|
|
2111
2237
|
`;
|
|
2112
2238
|
|
|
2239
|
+
const defaultFieldDisplayer = (props) => {
|
|
2240
|
+
const Component = (displayerProps) => {
|
|
2241
|
+
const form = onekijsFramework.useForm();
|
|
2242
|
+
let value = form.getValue(displayerProps.name) ?? '';
|
|
2243
|
+
const ValueDisplayer = props.ValueDisplayer ?? (() => React.createElement(React.Fragment, null,
|
|
2244
|
+
React.createElement(React.Fragment, null, `${value || ''}`)));
|
|
2245
|
+
return (React.createElement(FieldDisplayer, { label: displayerProps.label ?? titlelize(displayerProps.name), help: props.help, first: displayerProps.first, last: displayerProps.last, value: React.createElement(ValueDisplayer, { value: value }), format: displayerProps.format }));
|
|
2246
|
+
};
|
|
2247
|
+
return Component;
|
|
2248
|
+
};
|
|
2249
|
+
|
|
2113
2250
|
// extract validators from props
|
|
2114
2251
|
const extractFieldLayoutProps = (props) => {
|
|
2115
2252
|
const [validators, nonValidatorProps] = onekijsFramework.extractValidators(props);
|
|
@@ -2134,18 +2271,31 @@ const extractFieldLayoutProps = (props) => {
|
|
|
2134
2271
|
'lgLabelWidth',
|
|
2135
2272
|
'xlLabelWidth',
|
|
2136
2273
|
];
|
|
2137
|
-
const fieldOptionsKeys = [
|
|
2274
|
+
const fieldOptionsKeys = [
|
|
2275
|
+
'defaultValue',
|
|
2276
|
+
'touchedOn',
|
|
2277
|
+
'disabled',
|
|
2278
|
+
'visible',
|
|
2279
|
+
'editable',
|
|
2280
|
+
'protected',
|
|
2281
|
+
'isUndefined',
|
|
2282
|
+
'Displayer',
|
|
2283
|
+
'containers',
|
|
2284
|
+
'ValueDisplayer',
|
|
2285
|
+
'label',
|
|
2286
|
+
];
|
|
2138
2287
|
Object.keys(nonValidatorProps).forEach((k) => {
|
|
2288
|
+
if (!fieldLayoutKeys.includes(k) && !fieldOptionsKeys.includes(k)) {
|
|
2289
|
+
fieldProps[k] = props[k];
|
|
2290
|
+
}
|
|
2139
2291
|
if (fieldLayoutKeys.includes(k)) {
|
|
2140
2292
|
fieldLayoutProps[k] = props[k];
|
|
2141
2293
|
}
|
|
2142
|
-
|
|
2294
|
+
if (fieldOptionsKeys.includes(k)) {
|
|
2143
2295
|
fieldOptions[k] = props[k];
|
|
2144
2296
|
}
|
|
2145
|
-
else if (k !== 'name') {
|
|
2146
|
-
fieldProps[k] = props[k];
|
|
2147
|
-
}
|
|
2148
2297
|
});
|
|
2298
|
+
fieldOptions.Displayer = fieldOptions.Displayer ?? defaultFieldDisplayer(props);
|
|
2149
2299
|
return {
|
|
2150
2300
|
name: props.name,
|
|
2151
2301
|
validators,
|
|
@@ -2182,11 +2332,53 @@ const useFieldLayout = (props) => {
|
|
|
2182
2332
|
];
|
|
2183
2333
|
};
|
|
2184
2334
|
|
|
2335
|
+
const RemoveIcon = ({ className, onClick }) => {
|
|
2336
|
+
return (React.createElement("div", { className: className, onClick: onClick },
|
|
2337
|
+
React.createElement("svg", { version: "1.1", xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", viewBox: "0 0 16 16", width: "100%", height: "100%" },
|
|
2338
|
+
React.createElement("path", { fill: "currentColor", d: "M15.854 12.854c-0-0-0-0-0-0l-4.854-4.854 4.854-4.854c0-0 0-0 0-0 0.052-0.052 0.090-0.113 0.114-0.178 0.066-0.178 0.028-0.386-0.114-0.529l-2.293-2.293c-0.143-0.143-0.351-0.181-0.529-0.114-0.065 0.024-0.126 0.062-0.178 0.114 0 0-0 0-0 0l-4.854 4.854-4.854-4.854c-0-0-0-0-0-0-0.052-0.052-0.113-0.090-0.178-0.114-0.178-0.066-0.386-0.029-0.529 0.114l-2.293 2.293c-0.143 0.143-0.181 0.351-0.114 0.529 0.024 0.065 0.062 0.126 0.114 0.178 0 0 0 0 0 0l4.854 4.854-4.854 4.854c-0 0-0 0-0 0-0.052 0.052-0.090 0.113-0.114 0.178-0.066 0.178-0.029 0.386 0.114 0.529l2.293 2.293c0.143 0.143 0.351 0.181 0.529 0.114 0.065-0.024 0.126-0.062 0.178-0.114 0-0 0-0 0-0l4.854-4.854 4.854 4.854c0 0 0 0 0 0 0.052 0.052 0.113 0.090 0.178 0.114 0.178 0.066 0.386 0.029 0.529-0.114l2.293-2.293c0.143-0.143 0.181-0.351 0.114-0.529-0.024-0.065-0.062-0.126-0.114-0.178z" }))));
|
|
2339
|
+
};
|
|
2340
|
+
var RemoveIcon$1 = styled(RemoveIcon) `
|
|
2341
|
+
${({ width = '16px', height = '16px', color: cssColor = 'inherit' }) => styled.css `
|
|
2342
|
+
width: ${width};
|
|
2343
|
+
height: ${height};
|
|
2344
|
+
${display('flex')};
|
|
2345
|
+
${alignItems('center')};
|
|
2346
|
+
${color(cssColor)}
|
|
2347
|
+
`}
|
|
2348
|
+
`;
|
|
2349
|
+
|
|
2350
|
+
const SuccessIconComponent = (props) => {
|
|
2351
|
+
return (React.createElement("div", { ...props },
|
|
2352
|
+
React.createElement("svg", { className: "o-icon-success-svg", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 12 16", fill: "currentColor" },
|
|
2353
|
+
React.createElement("path", { fillRule: "evenodd", d: "M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5L12 5z" }))));
|
|
2354
|
+
};
|
|
2355
|
+
var SuccessIcon = styled(SuccessIconComponent) `
|
|
2356
|
+
${({ width = '16px', height = '16px', color: cssColor = 'success' }) => styled.css `
|
|
2357
|
+
width: ${width};
|
|
2358
|
+
height: ${height};
|
|
2359
|
+
${display('flex')};
|
|
2360
|
+
${alignItems('center')};
|
|
2361
|
+
${color(cssColor)}
|
|
2362
|
+
.o-icon-success-svg {
|
|
2363
|
+
display: inline-block;
|
|
2364
|
+
fill: currentColor;
|
|
2365
|
+
}
|
|
2366
|
+
`}
|
|
2367
|
+
`;
|
|
2368
|
+
|
|
2369
|
+
const FormCheckboxValueDisplayer = ({ value }) => {
|
|
2370
|
+
return (React.createElement("div", { style: { display: 'flex', alignItems: 'center', marginTop: value ? '2px' : '4px' } }, value ? React.createElement(SuccessIcon, null) : React.createElement(RemoveIcon$1, { color: "red", width: "14px", height: "14px" })));
|
|
2371
|
+
};
|
|
2185
2372
|
const FormCheckbox = React.memo((props) => {
|
|
2186
|
-
const [fieldLayoutProps, fieldComponentProps] = useFieldLayout(Object.assign({
|
|
2187
|
-
defaultValue: props.defaultValue !== true ? false : true,
|
|
2188
|
-
}, props, {
|
|
2373
|
+
const [fieldLayoutProps, fieldComponentProps] = useFieldLayout(Object.assign({}, props, {
|
|
2189
2374
|
isUndefined: (value) => value !== true && value !== false,
|
|
2375
|
+
defaultValue: props.defaultValue !== true ? false : true,
|
|
2376
|
+
Displayer: props.Displayer === undefined ? ((displayerProps) => {
|
|
2377
|
+
const form = onekijsFramework.useForm();
|
|
2378
|
+
let value = form.getValue(displayerProps.name) ?? false;
|
|
2379
|
+
const ValueDisplayer = props.ValueDisplayer ?? FormCheckboxValueDisplayer;
|
|
2380
|
+
return (React.createElement(FieldDisplayer, { label: displayerProps.label ?? titlelize(displayerProps.name), help: props.help, first: displayerProps.first, last: displayerProps.last, value: React.createElement(ValueDisplayer, { value: value }), format: displayerProps.format }));
|
|
2381
|
+
}) : props.Displayer,
|
|
2190
2382
|
}));
|
|
2191
2383
|
const Component = props.FieldComponent || Checkbox;
|
|
2192
2384
|
return (React.createElement(FieldLayout, { ...fieldLayoutProps, required: props.required },
|
|
@@ -3551,14 +3743,14 @@ const DashboardLeft = dashboardVerticalPanel('left');
|
|
|
3551
3743
|
|
|
3552
3744
|
const DashboardRight = dashboardVerticalPanel('right');
|
|
3553
3745
|
|
|
3554
|
-
const IconComponent$
|
|
3746
|
+
const IconComponent$7 = (props) => {
|
|
3555
3747
|
return (React.createElement("div", { ...props },
|
|
3556
3748
|
React.createElement("svg", { className: "o-icon-menu-svg", viewBox: "0 0 100 100" },
|
|
3557
3749
|
React.createElement("rect", { width: "100", height: "15", rx: "15", ry: "15" }),
|
|
3558
3750
|
React.createElement("rect", { y: "40", width: "100", height: "15", rx: "15", ry: "15" }),
|
|
3559
3751
|
React.createElement("rect", { y: "80", width: "100", height: "15", rx: "15", ry: "15" }))));
|
|
3560
3752
|
};
|
|
3561
|
-
var MenuIcon = styled(IconComponent$
|
|
3753
|
+
var MenuIcon = styled(IconComponent$7) `
|
|
3562
3754
|
${({ width = '16px', height = '16px', color: cssColor = 'inherit' }) => styled.css `
|
|
3563
3755
|
width: ${width};
|
|
3564
3756
|
height: ${height};
|
|
@@ -3605,13 +3797,13 @@ const useDashoardBodyPanel = () => {
|
|
|
3605
3797
|
return state.body;
|
|
3606
3798
|
};
|
|
3607
3799
|
|
|
3608
|
-
const IconComponent$
|
|
3800
|
+
const IconComponent$6 = ({ className, onClick }) => {
|
|
3609
3801
|
return (React.createElement("div", { className: className, onClick: onClick },
|
|
3610
3802
|
React.createElement("svg", { className: "o-icon-close-all-svg", viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg" },
|
|
3611
3803
|
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.621 8.086l-.707-.707L6.5 8.793 5.086 7.379l-.707.707L5.793 9.5l-1.414 1.414.707.707L6.5 10.207l1.414 1.414.707-.707L7.207 9.5l1.414-1.414z" }),
|
|
3612
3804
|
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5 3l1-1h7l1 1v7l-1 1h-2v2l-1 1H3l-1-1V6l1-1h2V3zm1 2h4l1 1v4h2V3H6v2zm4 1H3v7h7V6z" }))));
|
|
3613
3805
|
};
|
|
3614
|
-
var CloseAllIcon = styled(IconComponent$
|
|
3806
|
+
var CloseAllIcon = styled(IconComponent$6) `
|
|
3615
3807
|
${({ width, height, color: cssColor = 'inherit' }) => styled.css `
|
|
3616
3808
|
width: ${width};
|
|
3617
3809
|
height: ${height};
|
|
@@ -3626,12 +3818,12 @@ var CloseAllIcon = styled(IconComponent$4) `
|
|
|
3626
3818
|
|
|
3627
3819
|
//#region -- system import
|
|
3628
3820
|
//#endregion
|
|
3629
|
-
const IconComponent$
|
|
3821
|
+
const IconComponent$5 = ({ className }) => {
|
|
3630
3822
|
return (React.createElement("div", { className: className },
|
|
3631
3823
|
React.createElement("svg", { className: "o-icon-close-svg", viewBox: "0 0 100 100" },
|
|
3632
3824
|
React.createElement("path", { d: "M35.6 34.4L28 26.8l7.6-7.6c.2-.2.2-.5 0-.7l-.5-.5c-.2-.2-.5-.2-.7 0l-7.6 7.6-7.5-7.6c-.2-.2-.5-.2-.7 0l-.6.6c-.2.2-.2.5 0 .7l7.6 7.6-7.6 7.5c-.2.2-.2.5 0 .7l.5.5c.2.2.5.2.7 0l7.6-7.6 7.6 7.6c.2.2.5.2.7 0l.5-.5c.2-.2.2-.5 0-.7z" }))));
|
|
3633
3825
|
};
|
|
3634
|
-
const CrossIcon = styled(IconComponent$
|
|
3826
|
+
const CrossIcon = styled(IconComponent$5) `
|
|
3635
3827
|
width: ${(props) => props.width || '32px'};
|
|
3636
3828
|
height: ${(props) => props.height || '32px'};
|
|
3637
3829
|
.o-icon-close-svg {
|
|
@@ -3664,13 +3856,13 @@ var ErrorIcon = styled(ErrorIconComponent) `
|
|
|
3664
3856
|
`}
|
|
3665
3857
|
`;
|
|
3666
3858
|
|
|
3667
|
-
const IconComponent$
|
|
3859
|
+
const IconComponent$4 = (props) => {
|
|
3668
3860
|
const className = addClassname('o-icon-file', props.className);
|
|
3669
3861
|
return (React.createElement("div", { ...props, className: className },
|
|
3670
3862
|
React.createElement("svg", { className: "o-icon-file-svg", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024", width: "16px", height: "16px" },
|
|
3671
3863
|
React.createElement("path", { d: "M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z" }))));
|
|
3672
3864
|
};
|
|
3673
|
-
var FileIcon = styled(IconComponent$
|
|
3865
|
+
var FileIcon = styled(IconComponent$4) `
|
|
3674
3866
|
${({ width = '16px', height = '16px', color: cssColor = 'currentColor' }) => styled.css `
|
|
3675
3867
|
width: ${width};
|
|
3676
3868
|
height: ${height};
|
|
@@ -3683,13 +3875,13 @@ var FileIcon = styled(IconComponent$2) `
|
|
|
3683
3875
|
`}
|
|
3684
3876
|
`;
|
|
3685
3877
|
|
|
3686
|
-
const IconComponent$
|
|
3878
|
+
const IconComponent$3 = (props) => {
|
|
3687
3879
|
const className = addClassname('o-icon-folder', props.className);
|
|
3688
3880
|
return (React.createElement("div", { ...props, className: className },
|
|
3689
3881
|
React.createElement("svg", { className: "o-icon-folder-svg", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "24px", height: "24px" },
|
|
3690
3882
|
React.createElement("path", { d: "M20,6h-8l-2-2H4C2.9,4,2,4.9,2,6v12c0,1.1,0.9,2,2,2h16c1.1,0,2-0.9,2-2V8C22,6.9,21.1,6,20,6z" }))));
|
|
3691
3883
|
};
|
|
3692
|
-
var FolderIcon = styled(IconComponent$
|
|
3884
|
+
var FolderIcon = styled(IconComponent$3) `
|
|
3693
3885
|
${({ width = '24px', height = '24px', color: cssColor = 'currentColor' }) => styled.css `
|
|
3694
3886
|
width: ${width};
|
|
3695
3887
|
height: ${height};
|
|
@@ -3702,12 +3894,12 @@ var FolderIcon = styled(IconComponent$1) `
|
|
|
3702
3894
|
`}
|
|
3703
3895
|
`;
|
|
3704
3896
|
|
|
3705
|
-
const IconComponent = ({ className, onClick }) => {
|
|
3897
|
+
const IconComponent$2 = ({ className, onClick }) => {
|
|
3706
3898
|
return (React.createElement("div", { className: className, onClick: onClick },
|
|
3707
3899
|
React.createElement("svg", { className: "o-icon-search-svg", viewBox: "0 0 118.783 118.783" },
|
|
3708
3900
|
React.createElement("path", { d: "M115.97,101.597L88.661,74.286c4.64-7.387,7.333-16.118,7.333-25.488c0-26.509-21.49-47.996-47.998-47.996\n\t\tS0,22.289,0,48.798c0,26.51,21.487,47.995,47.996,47.995c10.197,0,19.642-3.188,27.414-8.605l26.984,26.986\n\t\tc1.875,1.873,4.333,2.806,6.788,2.806c2.458,0,4.913-0.933,6.791-2.806C119.72,111.423,119.72,105.347,115.97,101.597z\n\t\t M47.996,81.243c-17.917,0-32.443-14.525-32.443-32.443s14.526-32.444,32.443-32.444c17.918,0,32.443,14.526,32.443,32.444\n\t\tS65.914,81.243,47.996,81.243z" }))));
|
|
3709
3901
|
};
|
|
3710
|
-
var SearchIcon = styled(IconComponent) `
|
|
3902
|
+
var SearchIcon = styled(IconComponent$2) `
|
|
3711
3903
|
${({ width, height, color: cssColor = 'inherit' }) => styled.css `
|
|
3712
3904
|
width: ${width};
|
|
3713
3905
|
height: ${height};
|
|
@@ -3723,25 +3915,6 @@ var SearchIcon = styled(IconComponent) `
|
|
|
3723
3915
|
`}
|
|
3724
3916
|
`;
|
|
3725
3917
|
|
|
3726
|
-
const SuccessIconComponent = (props) => {
|
|
3727
|
-
return (React.createElement("div", { ...props },
|
|
3728
|
-
React.createElement("svg", { className: "o-icon-success-svg", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 12 16", fill: "currentColor" },
|
|
3729
|
-
React.createElement("path", { fillRule: "evenodd", d: "M12 5l-8 8-4-4 1.5-1.5L4 10l6.5-6.5L12 5z" }))));
|
|
3730
|
-
};
|
|
3731
|
-
var SuccessIcon = styled(SuccessIconComponent) `
|
|
3732
|
-
${({ width = '16px', height = '16px', color: cssColor = 'success' }) => styled.css `
|
|
3733
|
-
width: ${width};
|
|
3734
|
-
height: ${height};
|
|
3735
|
-
${display('flex')};
|
|
3736
|
-
${alignItems('center')};
|
|
3737
|
-
${color(cssColor)}
|
|
3738
|
-
.o-icon-success-svg {
|
|
3739
|
-
display: inline-block;
|
|
3740
|
-
fill: currentColor;
|
|
3741
|
-
}
|
|
3742
|
-
`}
|
|
3743
|
-
`;
|
|
3744
|
-
|
|
3745
3918
|
const InputComponent = (props) => {
|
|
3746
3919
|
const { className, size = 'medium', status, PrefixComponent, SuffixComponent, onFocus: forwardFocus, onBlur: forwardBlur, onChange: forwardChange, value, ...inputProps } = props;
|
|
3747
3920
|
const [focus, setFocus] = React.useState(false);
|
|
@@ -3848,12 +4021,96 @@ const Input = styled(InputComponent) `
|
|
|
3848
4021
|
${inputStyle}
|
|
3849
4022
|
`;
|
|
3850
4023
|
|
|
4024
|
+
const IconComponent$1 = (props) => {
|
|
4025
|
+
const className = addClassname('o-icon-hide', props.className);
|
|
4026
|
+
return (React.createElement("div", { ...props, className: className },
|
|
4027
|
+
React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: "o-icon-hide-svg", viewBox: "0 0 1024 1024" },
|
|
4028
|
+
React.createElement("path", { d: "M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 0 0 0-51.5zm-63.57-320.64L836 122.88a8 8 0 0 0-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 0 0 0 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 0 0 0 11.31L155.17 889a8 8 0 0 0 11.31 0l712.15-712.12a8 8 0 0 0 0-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 0 0-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 0 1 146.2-106.69L401.31 546.2A112 112 0 0 1 396 512z" }),
|
|
4029
|
+
React.createElement("path", { d: "M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 0 0 227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 0 1-112 112z" }))));
|
|
4030
|
+
};
|
|
4031
|
+
var HideIcon = styled(IconComponent$1) `
|
|
4032
|
+
${({ width = '16px', height = '16px', color: cssColor = 'currentColor' }) => styled.css `
|
|
4033
|
+
width: ${width};
|
|
4034
|
+
height: ${height};
|
|
4035
|
+
${display('flex')};
|
|
4036
|
+
${alignItems('center')};
|
|
4037
|
+
.o-icon-hide-svg {
|
|
4038
|
+
display: inline-block;
|
|
4039
|
+
fill: ${cssColor};
|
|
4040
|
+
}
|
|
4041
|
+
`}
|
|
4042
|
+
`;
|
|
4043
|
+
|
|
4044
|
+
const IconComponent = (props) => {
|
|
4045
|
+
const className = addClassname('o-icon-show', props.className);
|
|
4046
|
+
return (React.createElement("div", { ...props, className: className },
|
|
4047
|
+
React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: "o-icon-show-svg", viewBox: "0 0 1024 1024" },
|
|
4048
|
+
React.createElement("path", { d: "M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 0 0 0 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z" }))));
|
|
4049
|
+
};
|
|
4050
|
+
var ShowIcon = styled(IconComponent) `
|
|
4051
|
+
${({ width = '16px', height = '16px', color: cssColor = 'currentColor' }) => styled.css `
|
|
4052
|
+
width: ${width};
|
|
4053
|
+
height: ${height};
|
|
4054
|
+
${display('flex')};
|
|
4055
|
+
${alignItems('center')};
|
|
4056
|
+
.o-icon-show-svg {
|
|
4057
|
+
display: inline-block;
|
|
4058
|
+
fill: ${cssColor};
|
|
4059
|
+
}
|
|
4060
|
+
`}
|
|
4061
|
+
`;
|
|
4062
|
+
|
|
4063
|
+
const PasswordComponent = ({ className, value }) => {
|
|
4064
|
+
const [show, setShow] = React.useState(false);
|
|
4065
|
+
if (show) {
|
|
4066
|
+
return (React.createElement("span", { className: addClassname('o-password', className) },
|
|
4067
|
+
React.createElement("span", { className: "o-password-text" }, value),
|
|
4068
|
+
React.createElement(HideIcon, { onClick: () => setShow(false) })));
|
|
4069
|
+
}
|
|
4070
|
+
return (React.createElement("span", { className: addClassname('o-password o-password-obfuscated', className) },
|
|
4071
|
+
React.createElement("span", { className: "o-password-text" }, value),
|
|
4072
|
+
React.createElement(ShowIcon, { onClick: () => setShow(true) })));
|
|
4073
|
+
};
|
|
4074
|
+
|
|
4075
|
+
const passwordStyle = () => {
|
|
4076
|
+
return styled.css `
|
|
4077
|
+
${display('flex')}
|
|
4078
|
+
${alignItems('center')}
|
|
4079
|
+
.g-icon-obfuscated-password {
|
|
4080
|
+
${fontSize('xl')}
|
|
4081
|
+
${marginBottom('-8px')}
|
|
4082
|
+
}
|
|
4083
|
+
.g-icon-show-password {
|
|
4084
|
+
${color('primary')}
|
|
4085
|
+
${marginLeft('sm')}
|
|
4086
|
+
${cursor('pointer')}
|
|
4087
|
+
}
|
|
4088
|
+
`;
|
|
4089
|
+
};
|
|
4090
|
+
|
|
4091
|
+
const Password = styled(PasswordComponent) `
|
|
4092
|
+
${passwordStyle}
|
|
4093
|
+
`;
|
|
4094
|
+
|
|
4095
|
+
const FormInputValueDisplayer = ({ value }) => {
|
|
4096
|
+
return React.createElement("span", { className: "o-input-displayer-value" }, value ?? '');
|
|
4097
|
+
};
|
|
3851
4098
|
const FormInput = React.memo((props) => {
|
|
3852
|
-
const [fieldLayoutProps, fieldComponentProps] = useFieldLayout(Object.assign({
|
|
4099
|
+
const [fieldLayoutProps, fieldComponentProps] = useFieldLayout(Object.assign({}, props, {
|
|
3853
4100
|
defaultValue: props.defaultValue === undefined ? '' : props.defaultValue,
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
4101
|
+
isUndefined: props.isUndefined === undefined ? (value) => value === undefined || value === null : props.isUndefined,
|
|
4102
|
+
protected: props.protected === undefined ? props.type === 'password' : props.protected,
|
|
4103
|
+
Displayer: props.Displayer === undefined
|
|
4104
|
+
? (displayerProps) => {
|
|
4105
|
+
const form = onekijsFramework.useForm();
|
|
4106
|
+
let value = form.getValue(displayerProps.name) ?? '';
|
|
4107
|
+
if (props.type === 'password' && value !== '') {
|
|
4108
|
+
value = React.createElement(Password, { value: value });
|
|
4109
|
+
}
|
|
4110
|
+
const ValueDisplayer = props.ValueDisplayer ?? FormInputValueDisplayer;
|
|
4111
|
+
return (React.createElement(FieldDisplayer, { label: displayerProps.label ?? titlelize(displayerProps.name), help: props.help, first: displayerProps.first, last: displayerProps.last, value: React.createElement(ValueDisplayer, { value: value }), format: displayerProps.format }));
|
|
4112
|
+
}
|
|
4113
|
+
: props.Displayer,
|
|
3857
4114
|
}));
|
|
3858
4115
|
const Component = props.FieldComponent || Input;
|
|
3859
4116
|
return (React.createElement(FieldLayout, { ...fieldLayoutProps, required: props.required },
|
|
@@ -7221,10 +7478,51 @@ const Select = styled(SelectComponent$1) `
|
|
|
7221
7478
|
${selectStyle}
|
|
7222
7479
|
`;
|
|
7223
7480
|
|
|
7481
|
+
const FormSelectValueDisplayer = ({ value }) => {
|
|
7482
|
+
if (Array.isArray(value)) {
|
|
7483
|
+
return (React.createElement(React.Fragment, null, value.map((v, index) => React.createElement("div", { key: `item-${index}`, className: "o-select-displayer-value" }, v ?? ''))));
|
|
7484
|
+
}
|
|
7485
|
+
return React.createElement("span", { className: "o-select-displayer-value" }, value ?? '');
|
|
7486
|
+
};
|
|
7224
7487
|
const FormSelect = (props) => {
|
|
7488
|
+
const service = props.controller ? props.controller.asService() : undefined;
|
|
7225
7489
|
const defaultValue = props.defaultValue === undefined ? (props.multiple ? [] : null) : props.defaultValue;
|
|
7226
7490
|
const [fieldLayoutProps, fieldComponentProps] = useFieldLayout(Object.assign({}, props, {
|
|
7227
7491
|
defaultValue,
|
|
7492
|
+
Displayer: props.Displayer ?? ((displayerProps) => {
|
|
7493
|
+
const form = onekijsFramework.useForm();
|
|
7494
|
+
let value = form.getValue(displayerProps.name) ?? '';
|
|
7495
|
+
const adapter = props.adapter;
|
|
7496
|
+
if (value === undefined || value === null) {
|
|
7497
|
+
value = '';
|
|
7498
|
+
}
|
|
7499
|
+
else if (service) {
|
|
7500
|
+
if (Array.isArray(value)) {
|
|
7501
|
+
value = value.map((v) => {
|
|
7502
|
+
const adaptee = service.adapt(v);
|
|
7503
|
+
return adaptee.text ?? `${value}`;
|
|
7504
|
+
});
|
|
7505
|
+
}
|
|
7506
|
+
else {
|
|
7507
|
+
const adaptee = service.adapt(value);
|
|
7508
|
+
value = adaptee.text ?? `${value}`;
|
|
7509
|
+
}
|
|
7510
|
+
}
|
|
7511
|
+
else if (adapter) {
|
|
7512
|
+
if (Array.isArray(value)) {
|
|
7513
|
+
value = value.map((v) => {
|
|
7514
|
+
const adaptee = adapter(v);
|
|
7515
|
+
return adaptee.text ?? `${value}`;
|
|
7516
|
+
});
|
|
7517
|
+
}
|
|
7518
|
+
else {
|
|
7519
|
+
const adaptee = adapter(value);
|
|
7520
|
+
value = adaptee.text ?? `${value}`;
|
|
7521
|
+
}
|
|
7522
|
+
}
|
|
7523
|
+
const ValueDisplayer = props.ValueDisplayer ?? FormSelectValueDisplayer;
|
|
7524
|
+
return (React.createElement(FieldDisplayer, { label: displayerProps.label ?? titlelize(displayerProps.name), help: props.help, first: displayerProps.first, last: displayerProps.last, value: React.createElement(ValueDisplayer, { value: value }), format: displayerProps.format }));
|
|
7525
|
+
}),
|
|
7228
7526
|
}));
|
|
7229
7527
|
const Component = props.FieldComponent || Select;
|
|
7230
7528
|
return (React.createElement(FieldLayout, { ...fieldLayoutProps, required: props.required },
|
|
@@ -9175,7 +9473,7 @@ const DefaultTableHeaderTitleComponent = ({ column, sort }) => {
|
|
|
9175
9473
|
};
|
|
9176
9474
|
return (React.createElement("div", { onClick: isSortable ? onSort : undefined, style: { display: 'flex', alignItems: 'center' } },
|
|
9177
9475
|
React.createElement("span", { className: "o-table-header-title" }, column.title),
|
|
9178
|
-
column.help && React.createElement(
|
|
9476
|
+
column.help && React.createElement(FieldHelp, { content: column.help, size: "small" }),
|
|
9179
9477
|
isSortable && React.createElement(TableSortComponent, { sort: sort, column: column })));
|
|
9180
9478
|
};
|
|
9181
9479
|
const TableHeaderTitleComponent = React.memo((props) => {
|
|
@@ -9854,21 +10152,6 @@ const Table = styled(TableComponent) `
|
|
|
9854
10152
|
${tableStyle}
|
|
9855
10153
|
`;
|
|
9856
10154
|
|
|
9857
|
-
const RemoveIcon = ({ className, onClick }) => {
|
|
9858
|
-
return (React.createElement("div", { className: className, onClick: onClick },
|
|
9859
|
-
React.createElement("svg", { version: "1.1", xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", viewBox: "0 0 16 16", width: "100%", height: "100%" },
|
|
9860
|
-
React.createElement("path", { fill: "currentColor", d: "M15.854 12.854c-0-0-0-0-0-0l-4.854-4.854 4.854-4.854c0-0 0-0 0-0 0.052-0.052 0.090-0.113 0.114-0.178 0.066-0.178 0.028-0.386-0.114-0.529l-2.293-2.293c-0.143-0.143-0.351-0.181-0.529-0.114-0.065 0.024-0.126 0.062-0.178 0.114 0 0-0 0-0 0l-4.854 4.854-4.854-4.854c-0-0-0-0-0-0-0.052-0.052-0.113-0.090-0.178-0.114-0.178-0.066-0.386-0.029-0.529 0.114l-2.293 2.293c-0.143 0.143-0.181 0.351-0.114 0.529 0.024 0.065 0.062 0.126 0.114 0.178 0 0 0 0 0 0l4.854 4.854-4.854 4.854c-0 0-0 0-0 0-0.052 0.052-0.090 0.113-0.114 0.178-0.066 0.178-0.029 0.386 0.114 0.529l2.293 2.293c0.143 0.143 0.351 0.181 0.529 0.114 0.065-0.024 0.126-0.062 0.178-0.114 0-0 0-0 0-0l4.854-4.854 4.854 4.854c0 0 0 0 0 0 0.052 0.052 0.113 0.090 0.178 0.114 0.178 0.066 0.386 0.029 0.529-0.114l2.293-2.293c0.143-0.143 0.181-0.351 0.114-0.529-0.024-0.065-0.062-0.126-0.114-0.178z" }))));
|
|
9861
|
-
};
|
|
9862
|
-
var RemoveIcon$1 = styled(RemoveIcon) `
|
|
9863
|
-
${({ width = '16px', height = '16px', color: cssColor = 'inherit' }) => styled.css `
|
|
9864
|
-
width: ${width};
|
|
9865
|
-
height: ${height};
|
|
9866
|
-
${display('flex')};
|
|
9867
|
-
${alignItems('center')};
|
|
9868
|
-
${color(cssColor)}
|
|
9869
|
-
`}
|
|
9870
|
-
`;
|
|
9871
|
-
|
|
9872
10155
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
9873
10156
|
const DefaultFormTableContext = React.createContext(null);
|
|
9874
10157
|
const useFormTableContext = () => {
|
|
@@ -9996,6 +10279,42 @@ const FormTableComponent = React.memo(({ addLabel = 'add', controller, value, on
|
|
|
9996
10279
|
});
|
|
9997
10280
|
FormTableComponent.displayName = 'FormTable';
|
|
9998
10281
|
|
|
10282
|
+
const FormTableItemDisplayer = ({ value, columns, first, last, className, format, name, index, }) => {
|
|
10283
|
+
const userColumns = columns.filter((c) => !c.id.startsWith('system.'));
|
|
10284
|
+
const monoColumnTable = userColumns.length === 1 && !userColumns[0].id;
|
|
10285
|
+
const classNames = monoColumnTable
|
|
10286
|
+
? 'o-form-mono-column-table-item-displayer'
|
|
10287
|
+
: `o-form-table-item-displayer${first ? ' o-form-table-item-displayer-first' : ''}${last ? ' o-form-table-item-displayer-last' : ''}`;
|
|
10288
|
+
return (React.createElement("div", { className: addClassname(classNames, className) }, userColumns.map((column, colIndex) => {
|
|
10289
|
+
const Displayer = column.Displayer;
|
|
10290
|
+
if (Displayer) {
|
|
10291
|
+
return (React.createElement(Displayer, { column: column, firstRow: first, lastRow: last, rowIndex: index, firstCol: colIndex === 0, lastCol: colIndex === columns.length - 1, colIndex: colIndex, format: format, value: value, rowName: name, key: `col-${colIndex}` }));
|
|
10292
|
+
}
|
|
10293
|
+
return null;
|
|
10294
|
+
})));
|
|
10295
|
+
};
|
|
10296
|
+
|
|
10297
|
+
const FormTableValueDisplayer = ({ name, columns, value, format, className }) => {
|
|
10298
|
+
if (!Array.isArray(value))
|
|
10299
|
+
return null;
|
|
10300
|
+
return (React.createElement("div", { className: addClassname('o-form-table-displayer-value', className) }, value.map((v, index) => (React.createElement(FormTableItemDisplayer, { key: `item-${index}`, value: v, columns: columns, first: index === 0, last: index === value.length - 1, format: format === 'csv' ? 'csv' : 'form_summary_table', name: `${name}.${index}`, index: index })))));
|
|
10301
|
+
};
|
|
10302
|
+
var FormTableValueDisplayer$1 = styled(FormTableValueDisplayer) `
|
|
10303
|
+
.o-form-table-item-displayer {
|
|
10304
|
+
${borderBottomColor('primary')}
|
|
10305
|
+
${borderBottomStyle('solid')}
|
|
10306
|
+
${borderBottomWidth('1px')}
|
|
10307
|
+
${paddingY('sm')}
|
|
10308
|
+
&.o-form-table-item-displayer-last{
|
|
10309
|
+
${paddingBottom(0)}
|
|
10310
|
+
${borderBottomWidth(0)}
|
|
10311
|
+
}
|
|
10312
|
+
&.o-form-table-item-displayer-first{
|
|
10313
|
+
${paddingTop(0)}
|
|
10314
|
+
}
|
|
10315
|
+
}
|
|
10316
|
+
`;
|
|
10317
|
+
|
|
9999
10318
|
const StyledFormTableComponent = styled(FormTableComponent) `
|
|
10000
10319
|
${tableStyle}
|
|
10001
10320
|
`;
|
|
@@ -10011,10 +10330,20 @@ const FormTable = React.memo((props) => {
|
|
|
10011
10330
|
}
|
|
10012
10331
|
const [fieldLayoutProps, fieldComponentProps] = useFieldLayout(Object.assign({
|
|
10013
10332
|
defaultValue,
|
|
10333
|
+
Displayer: (displayerProps) => {
|
|
10334
|
+
const form = onekijsFramework.useForm();
|
|
10335
|
+
let value = form.getValue(displayerProps.name) ?? [];
|
|
10336
|
+
const ValueDisplayer = props.ValueDisplayer ?? FormTableValueDisplayer$1;
|
|
10337
|
+
return (React.createElement(FieldDisplayer, { label: displayerProps.label ?? titlelize(displayerProps.name), help: props.help, first: displayerProps.first, last: displayerProps.last, value: React.createElement(ValueDisplayer, { name: displayerProps.name, value: value, columns: props.controller.columns, format: displayerProps.format }), format: displayerProps.format }));
|
|
10338
|
+
},
|
|
10014
10339
|
}, props));
|
|
10340
|
+
const fieldContainer = onekijsFramework.useFieldContainer({
|
|
10341
|
+
container: props.name,
|
|
10342
|
+
});
|
|
10015
10343
|
const Component = props.FieldComponent || StyledFormTableComponent;
|
|
10016
10344
|
return (React.createElement(FieldLayout, { ...fieldLayoutProps, required: props.required },
|
|
10017
|
-
React.createElement(
|
|
10345
|
+
React.createElement(onekijsFramework.FormContext.Provider, { value: fieldContainer.context },
|
|
10346
|
+
React.createElement(Component, { ...fieldComponentProps, name: props.name, required: props.required, minLength: props.minLength ?? props.min, maxLength: props.maxLength ?? props.max }))));
|
|
10018
10347
|
});
|
|
10019
10348
|
FormTable.displayName = 'FormTable';
|
|
10020
10349
|
|
|
@@ -10031,12 +10360,37 @@ const CheckboxCellComponent = (options) => {
|
|
|
10031
10360
|
return CheckboxCellComponent;
|
|
10032
10361
|
};
|
|
10033
10362
|
|
|
10363
|
+
const DefaultFormCellDisplayer = (props) => {
|
|
10364
|
+
const form = onekijsFramework.useForm();
|
|
10365
|
+
if (['form_summary', 'form_summary_table'].includes(props.format)) {
|
|
10366
|
+
if (props.column) {
|
|
10367
|
+
const name = props.column.id ? `${props.rowName}.${props.column.id}` : `${props.rowName}`;
|
|
10368
|
+
const field = form.fields[name];
|
|
10369
|
+
if (props.column.id === 'value') {
|
|
10370
|
+
console.log(field);
|
|
10371
|
+
}
|
|
10372
|
+
if (field && field.Displayer) {
|
|
10373
|
+
const Component = field.Displayer;
|
|
10374
|
+
return React.createElement(Component, { name: name, label: props.column.id ? props.column.title : '', Displayer: field.Displayer, children: {}, index: 0, first: true, last: true, format: props.format });
|
|
10375
|
+
}
|
|
10376
|
+
}
|
|
10377
|
+
}
|
|
10378
|
+
if (props.format === 'csv') {
|
|
10379
|
+
const value = onekijsFramework.get(props.value, props.column.id, '');
|
|
10380
|
+
if (typeof value === 'string')
|
|
10381
|
+
return value;
|
|
10382
|
+
return JSON.stringify(value);
|
|
10383
|
+
}
|
|
10384
|
+
return null;
|
|
10385
|
+
};
|
|
10386
|
+
|
|
10034
10387
|
const checkboxColumn = (id, options) => {
|
|
10035
10388
|
const Component = options.CellComponent || CheckboxCellComponent;
|
|
10036
10389
|
return Object.assign({
|
|
10037
10390
|
filterable: false,
|
|
10038
10391
|
sortable: false,
|
|
10039
10392
|
className: 'o-checkbox-cell',
|
|
10393
|
+
Displayer: DefaultFormCellDisplayer,
|
|
10040
10394
|
}, options, {
|
|
10041
10395
|
id,
|
|
10042
10396
|
CellComponent: Component(options),
|
|
@@ -10094,6 +10448,7 @@ const enumColumn = (id, options) => {
|
|
|
10094
10448
|
filterable: true,
|
|
10095
10449
|
FilterComponent: (props) => (React.createElement(TableSelectFilterComponent, { ...props, dataSource: options.filterDataSource })),
|
|
10096
10450
|
sortable: true,
|
|
10451
|
+
Displayer: DefaultFormCellDisplayer,
|
|
10097
10452
|
}, options, {
|
|
10098
10453
|
id,
|
|
10099
10454
|
});
|
|
@@ -10116,6 +10471,7 @@ const inputColumn = (id, options) => {
|
|
|
10116
10471
|
return Object.assign({
|
|
10117
10472
|
filterable: false,
|
|
10118
10473
|
sortable: false,
|
|
10474
|
+
Displayer: DefaultFormCellDisplayer,
|
|
10119
10475
|
}, options, {
|
|
10120
10476
|
id,
|
|
10121
10477
|
CellComponent: Component(options),
|
|
@@ -10138,6 +10494,7 @@ const textColumn = (id, options) => {
|
|
|
10138
10494
|
filterable: true,
|
|
10139
10495
|
FilterComponent: TableTextFilterComponent,
|
|
10140
10496
|
sortable: true,
|
|
10497
|
+
Displayer: DefaultFormCellDisplayer,
|
|
10141
10498
|
}, options, {
|
|
10142
10499
|
id,
|
|
10143
10500
|
});
|
|
@@ -10168,6 +10525,7 @@ const numberColumn = (id, options) => {
|
|
|
10168
10525
|
filterable: true,
|
|
10169
10526
|
FilterComponent: TableNumberFilterComponent,
|
|
10170
10527
|
sortable: true,
|
|
10528
|
+
Displayer: DefaultFormCellDisplayer,
|
|
10171
10529
|
}, options, {
|
|
10172
10530
|
id,
|
|
10173
10531
|
});
|
|
@@ -10212,6 +10570,7 @@ const selectColumn = (id, options) => {
|
|
|
10212
10570
|
return Object.assign({
|
|
10213
10571
|
filterable: false,
|
|
10214
10572
|
sortable: false,
|
|
10573
|
+
Displayer: DefaultFormCellDisplayer,
|
|
10215
10574
|
}, opts, {
|
|
10216
10575
|
id,
|
|
10217
10576
|
CellComponent: Component(opts, broker),
|
|
@@ -10311,11 +10670,21 @@ const Textarea = styled(TextareaComponent) `
|
|
|
10311
10670
|
${textareaStyle}
|
|
10312
10671
|
`;
|
|
10313
10672
|
|
|
10673
|
+
const FormTextareaValueDisplayer = ({ value }) => {
|
|
10674
|
+
return (React.createElement("span", { className: "o-input-displayer-value" }, value ? value.split('\n').map((v, index) => React.createElement("div", { key: `line-${index}` }, v)) : ''));
|
|
10675
|
+
};
|
|
10314
10676
|
const FormTextarea = React.memo((props) => {
|
|
10315
|
-
const [fieldLayoutProps, fieldComponentProps] = useFieldLayout(Object.assign({
|
|
10316
|
-
defaultValue: props.defaultValue === undefined ? '' : props.defaultValue,
|
|
10317
|
-
}, props, {
|
|
10677
|
+
const [fieldLayoutProps, fieldComponentProps] = useFieldLayout(Object.assign({}, props, {
|
|
10318
10678
|
isUndefined: (value) => value === undefined || value === null,
|
|
10679
|
+
defaultValue: props.defaultValue === undefined ? '' : props.defaultValue,
|
|
10680
|
+
Displayer: props.Displayer === undefined
|
|
10681
|
+
? (displayerProps) => {
|
|
10682
|
+
const form = onekijsFramework.useForm();
|
|
10683
|
+
let value = form.getValue(displayerProps.name) ?? '';
|
|
10684
|
+
const ValueDisplayer = props.ValueDisplayer ?? FormTextareaValueDisplayer;
|
|
10685
|
+
return (React.createElement(FieldDisplayer, { label: displayerProps.label ?? titlelize(displayerProps.name), help: props.help, first: displayerProps.first, last: displayerProps.last, value: React.createElement(ValueDisplayer, { value: value }), format: displayerProps.format }));
|
|
10686
|
+
}
|
|
10687
|
+
: props.Displayer,
|
|
10319
10688
|
}));
|
|
10320
10689
|
const Component = props.FieldComponent || Textarea;
|
|
10321
10690
|
return (React.createElement(FieldLayout, { ...fieldLayoutProps, required: props.required },
|
|
@@ -10340,6 +10709,7 @@ const textareaColumn = (id, options) => {
|
|
|
10340
10709
|
return Object.assign({
|
|
10341
10710
|
filterable: false,
|
|
10342
10711
|
sortable: false,
|
|
10712
|
+
Displayer: DefaultFormCellDisplayer,
|
|
10343
10713
|
}, options, {
|
|
10344
10714
|
id,
|
|
10345
10715
|
CellComponent: Component(options),
|
|
@@ -10830,6 +11200,20 @@ const wizardStyle = ({ layout = 'vertical', theme, inModal }) => {
|
|
|
10830
11200
|
const wizardModalStyle = () => {
|
|
10831
11201
|
return styled.css ``;
|
|
10832
11202
|
};
|
|
11203
|
+
const wizardSummaryStyle = () => {
|
|
11204
|
+
return styled.css `
|
|
11205
|
+
.o-accordion-panel {
|
|
11206
|
+
${paddingBottom('md')}
|
|
11207
|
+
}
|
|
11208
|
+
.o-accordion-panel-title {
|
|
11209
|
+
${backgroundColor('lighter')}
|
|
11210
|
+
}
|
|
11211
|
+
.o-accordion-content {
|
|
11212
|
+
${paddingX('sm')}
|
|
11213
|
+
${paddingBottom('sm')}
|
|
11214
|
+
}
|
|
11215
|
+
`;
|
|
11216
|
+
};
|
|
10833
11217
|
|
|
10834
11218
|
const Wizard = styled(WizardComponent) `
|
|
10835
11219
|
${wizardStyle}
|
|
@@ -10844,6 +11228,19 @@ const WizardModal = styled(WizardModalComponent) `
|
|
|
10844
11228
|
${wizardModalStyle}
|
|
10845
11229
|
`;
|
|
10846
11230
|
|
|
11231
|
+
const WizardSummaryComponent = ({ className }) => {
|
|
11232
|
+
const form = onekijsFramework.useForm();
|
|
11233
|
+
const tree = Object.values(form.getDisplayerTree());
|
|
11234
|
+
return (React.createElement(Accordion, { className: className }, tree.map((field, index) => {
|
|
11235
|
+
const Displayer = field.Displayer;
|
|
11236
|
+
return React.createElement(Displayer, { ...field, index: index, key: `field-${index}`, first: index === 0, last: index === tree.length - 1, format: "form_summary" });
|
|
11237
|
+
})));
|
|
11238
|
+
};
|
|
11239
|
+
|
|
11240
|
+
const WizardSummary = styled(WizardSummaryComponent) `
|
|
11241
|
+
${wizardSummaryStyle}
|
|
11242
|
+
`;
|
|
11243
|
+
|
|
10847
11244
|
const useStep = (props) => {
|
|
10848
11245
|
const service = useWizardService();
|
|
10849
11246
|
const state = useWizardState();
|
|
@@ -10856,9 +11253,8 @@ const useStep = (props) => {
|
|
|
10856
11253
|
return step;
|
|
10857
11254
|
};
|
|
10858
11255
|
|
|
10859
|
-
const Step = ({ title, active = false, disabled = false, visible = true, closable = false, children, icon, uid, optional = false, showTitle = true, className, }) => {
|
|
11256
|
+
const Step = ({ title, active = false, disabled = false, visible = true, closable = false, children, icon, uid, optional = false, showTitle = true, className, onTouch, }) => {
|
|
10860
11257
|
const { animate, forwardOnly } = useWizardState();
|
|
10861
|
-
const service = useWizardService();
|
|
10862
11258
|
const step = useStep({
|
|
10863
11259
|
title,
|
|
10864
11260
|
active,
|
|
@@ -10872,15 +11268,7 @@ const Step = ({ title, active = false, disabled = false, visible = true, closabl
|
|
|
10872
11268
|
touching: !forwardOnly,
|
|
10873
11269
|
uid: uid === undefined ? title : uid,
|
|
10874
11270
|
});
|
|
10875
|
-
const fieldContainer = onekijsFramework.useFieldContainer({
|
|
10876
|
-
onValidationChange: (touchedValidation, allValidation) => {
|
|
10877
|
-
if (step) {
|
|
10878
|
-
service.onValidationChange(step.uid, touchedValidation, allValidation);
|
|
10879
|
-
}
|
|
10880
|
-
},
|
|
10881
|
-
});
|
|
10882
11271
|
const touched = step?.touched;
|
|
10883
|
-
const touchAllFields = fieldContainer.touchAllFields;
|
|
10884
11272
|
const onEnter = (node) => {
|
|
10885
11273
|
node.style.opacity = '0';
|
|
10886
11274
|
};
|
|
@@ -10891,34 +11279,88 @@ const Step = ({ title, active = false, disabled = false, visible = true, closabl
|
|
|
10891
11279
|
}, 0);
|
|
10892
11280
|
};
|
|
10893
11281
|
React.useEffect(() => {
|
|
10894
|
-
if (touched) {
|
|
10895
|
-
|
|
11282
|
+
if (touched && onTouch) {
|
|
11283
|
+
onTouch();
|
|
10896
11284
|
}
|
|
10897
|
-
}, [touched,
|
|
11285
|
+
}, [touched, onTouch]);
|
|
10898
11286
|
if (!step || !step.active) {
|
|
10899
11287
|
return null;
|
|
10900
11288
|
}
|
|
10901
|
-
return (React.createElement(
|
|
10902
|
-
React.createElement(
|
|
10903
|
-
React.createElement("div", { className:
|
|
10904
|
-
|
|
10905
|
-
|
|
10906
|
-
|
|
10907
|
-
|
|
10908
|
-
const
|
|
10909
|
-
|
|
11289
|
+
return (React.createElement(reactTransitionGroup.CSSTransition, { in: true, timeout: animate, appear: true, onEnter: onEnter, onEntering: onEntering },
|
|
11290
|
+
React.createElement("div", { className: addClassname('o-step-content', className) },
|
|
11291
|
+
showTitle && React.createElement("div", { className: "o-step-content-title" }, title),
|
|
11292
|
+
children)));
|
|
11293
|
+
};
|
|
11294
|
+
|
|
11295
|
+
const FormStep = ({ name, disabled, visible, ...stepProps }) => {
|
|
11296
|
+
const decorator = onekijsFramework.useFormDecorator(name, {
|
|
11297
|
+
Displayer: (displayerProps) => {
|
|
11298
|
+
const total = Object.values(displayerProps.children ?? {}).length;
|
|
11299
|
+
return (React.createElement(AccordionPanel, { title: stepProps.title, initialActive: displayerProps.index === 0, initialExpand: displayerProps.index === 0 }, Object.values(displayerProps.children ?? {}).map((field, index) => {
|
|
11300
|
+
const Displayer = field.Displayer;
|
|
11301
|
+
return React.createElement(Displayer, { ...field, index: index, key: `field-${index}`, first: index === 0, last: index === total - 1, format: displayerProps.format });
|
|
11302
|
+
})));
|
|
11303
|
+
},
|
|
11304
|
+
});
|
|
10910
11305
|
const metadata = onekijsFramework.useFormMetadata(decorator.name);
|
|
10911
11306
|
const service = useWizardService();
|
|
11307
|
+
const fieldContainer = onekijsFramework.useFieldContainer({
|
|
11308
|
+
container: name,
|
|
11309
|
+
onValidationChange: (touchedValidation, allValidation) => {
|
|
11310
|
+
service.onValidationChange(name, touchedValidation, allValidation);
|
|
11311
|
+
},
|
|
11312
|
+
});
|
|
11313
|
+
const { touchAllFields, hide, show, disable, enable } = fieldContainer;
|
|
10912
11314
|
React.useEffect(() => {
|
|
10913
|
-
const
|
|
10914
|
-
|
|
10915
|
-
|
|
11315
|
+
const visible = metadata.visible ?? true;
|
|
11316
|
+
const disabled = metadata.disabled ?? false;
|
|
11317
|
+
if (!visible) {
|
|
11318
|
+
if (disabled) {
|
|
11319
|
+
service.disable(name);
|
|
11320
|
+
disable();
|
|
11321
|
+
}
|
|
11322
|
+
else {
|
|
11323
|
+
service.enable(name);
|
|
11324
|
+
enable();
|
|
11325
|
+
}
|
|
11326
|
+
service.hide(name);
|
|
11327
|
+
hide();
|
|
10916
11328
|
}
|
|
10917
|
-
|
|
10918
|
-
|
|
11329
|
+
else {
|
|
11330
|
+
service.show(name);
|
|
11331
|
+
show();
|
|
11332
|
+
if (disabled) {
|
|
11333
|
+
service.disable(name);
|
|
11334
|
+
disable();
|
|
11335
|
+
}
|
|
11336
|
+
else {
|
|
11337
|
+
service.enable(name);
|
|
11338
|
+
enable();
|
|
11339
|
+
}
|
|
10919
11340
|
}
|
|
10920
|
-
});
|
|
10921
|
-
|
|
11341
|
+
}, [name, metadata.visible, metadata.disabled]);
|
|
11342
|
+
React.useEffect(() => {
|
|
11343
|
+
if (!visible) {
|
|
11344
|
+
if (disabled) {
|
|
11345
|
+
disable();
|
|
11346
|
+
}
|
|
11347
|
+
else {
|
|
11348
|
+
enable();
|
|
11349
|
+
}
|
|
11350
|
+
hide();
|
|
11351
|
+
}
|
|
11352
|
+
else {
|
|
11353
|
+
show();
|
|
11354
|
+
if (disabled) {
|
|
11355
|
+
disable();
|
|
11356
|
+
}
|
|
11357
|
+
else {
|
|
11358
|
+
enable();
|
|
11359
|
+
}
|
|
11360
|
+
}
|
|
11361
|
+
}, [visible, disabled, hide, show, disable, enable]);
|
|
11362
|
+
return (React.createElement(onekijsFramework.FormContext.Provider, { value: fieldContainer.context },
|
|
11363
|
+
React.createElement(Step, { ...stepProps, uid: name, onTouch: touchAllFields })));
|
|
10922
11364
|
};
|
|
10923
11365
|
|
|
10924
11366
|
const animation = cssProperty('animation');
|
|
@@ -11846,6 +12288,7 @@ exports.DashboardServiceContext = DashboardServiceContext;
|
|
|
11846
12288
|
exports.DashboardStateContext = DashboardStateContext;
|
|
11847
12289
|
exports.DashboardToggler = DashboardToggler;
|
|
11848
12290
|
exports.DefaultCellComponent = DefaultCellComponent;
|
|
12291
|
+
exports.DefaultCellDisplayer = DefaultFormCellDisplayer;
|
|
11849
12292
|
exports.DefaultSelectBroker = DefaultSelectBroker;
|
|
11850
12293
|
exports.Dropdown = Dropdown;
|
|
11851
12294
|
exports.DropdownButton = DropdownButton;
|
|
@@ -11855,18 +12298,22 @@ exports.ErrorIcon = ErrorIcon;
|
|
|
11855
12298
|
exports.ExpandedCellComponent = ExpandedCellComponent;
|
|
11856
12299
|
exports.FieldDescription = FieldDescription;
|
|
11857
12300
|
exports.FieldDescriptionComponent = FieldDescriptionComponent;
|
|
11858
|
-
exports.
|
|
12301
|
+
exports.FieldDisplayer = FieldDisplayer;
|
|
12302
|
+
exports.FieldHelp = FieldHelp;
|
|
11859
12303
|
exports.FieldHelpComponent = FieldHelpComponent;
|
|
11860
12304
|
exports.FieldLayout = FieldLayout;
|
|
11861
12305
|
exports.FieldLayoutComponent = FieldLayoutComponent;
|
|
11862
12306
|
exports.FileIcon = FileIcon;
|
|
11863
12307
|
exports.FolderIcon = FolderIcon;
|
|
11864
|
-
exports.FormCard = FormCard
|
|
12308
|
+
exports.FormCard = FormCard;
|
|
12309
|
+
exports.FormCardDisplayer = FormCardDisplayer;
|
|
11865
12310
|
exports.FormCheckbox = FormCheckbox;
|
|
11866
12311
|
exports.FormInput = FormInput;
|
|
11867
12312
|
exports.FormSelect = FormSelect$1;
|
|
11868
|
-
exports.FormStep =
|
|
12313
|
+
exports.FormStep = FormStep;
|
|
11869
12314
|
exports.FormTable = FormTable;
|
|
12315
|
+
exports.FormTableItemDisplayer = FormTableItemDisplayer;
|
|
12316
|
+
exports.FormTableValueDisplayer = FormTableValueDisplayer$1;
|
|
11870
12317
|
exports.FormTextarea = FormTextarea;
|
|
11871
12318
|
exports.HelpIcon = HelpIcon;
|
|
11872
12319
|
exports.Input = Input;
|
|
@@ -11884,6 +12331,8 @@ exports.ModalComponent = ModalComponent;
|
|
|
11884
12331
|
exports.NotificationComponent = NotificationComponent;
|
|
11885
12332
|
exports.Notifications = Notifications;
|
|
11886
12333
|
exports.NotificationsComponent = NotificationsComponent;
|
|
12334
|
+
exports.Password = Password;
|
|
12335
|
+
exports.PasswordComponent = PasswordComponent;
|
|
11887
12336
|
exports.Properties = Properties;
|
|
11888
12337
|
exports.PropertiesComponent = PropertiesComponent;
|
|
11889
12338
|
exports.Property = Property;
|
|
@@ -11943,6 +12392,8 @@ exports.WizardComponent = WizardComponent;
|
|
|
11943
12392
|
exports.WizardContainer = WizardContainer;
|
|
11944
12393
|
exports.WizardModal = WizardModal;
|
|
11945
12394
|
exports.WizardModalComponent = WizardModalComponent;
|
|
12395
|
+
exports.WizardSummary = WizardSummary;
|
|
12396
|
+
exports.WizardSummaryComponent = WizardSummaryComponent;
|
|
11946
12397
|
exports.accordionStyle = accordionStyle;
|
|
11947
12398
|
exports.addClassname = addClassname;
|
|
11948
12399
|
exports.addStyle = addStyle;
|
|
@@ -12049,7 +12500,12 @@ exports.dropdownStyle = dropdownStyle;
|
|
|
12049
12500
|
exports.emptyCells = emptyCells;
|
|
12050
12501
|
exports.enumColumn = enumColumn;
|
|
12051
12502
|
exports.enumFormatter = enumFormatter;
|
|
12503
|
+
exports.fieldDescriptionStyle = fieldDescriptionStyle;
|
|
12504
|
+
exports.fieldDisplayerStyle = fieldDisplayerStyle;
|
|
12505
|
+
exports.fieldHelpStyle = fieldHelpStyle;
|
|
12506
|
+
exports.fieldStyle = fieldStyle;
|
|
12052
12507
|
exports.fill = fill;
|
|
12508
|
+
exports.filterListStyle = filterListStyle;
|
|
12053
12509
|
exports.findSelectItem = findSelectItem;
|
|
12054
12510
|
exports.findSelectItemIndex = findSelectItemIndex;
|
|
12055
12511
|
exports.flex = flex;
|
|
@@ -12160,6 +12616,7 @@ exports.paddingRight = paddingRight;
|
|
|
12160
12616
|
exports.paddingTop = paddingTop;
|
|
12161
12617
|
exports.paddingX = paddingX;
|
|
12162
12618
|
exports.paddingY = paddingY;
|
|
12619
|
+
exports.passwordStyle = passwordStyle;
|
|
12163
12620
|
exports.perspective = perspective;
|
|
12164
12621
|
exports.perspectiveOrigin = perspectiveOrigin;
|
|
12165
12622
|
exports.placeContent = placeContent;
|
|
@@ -12183,6 +12640,7 @@ exports.shouldCheckSelect = shouldCheckSelect;
|
|
|
12183
12640
|
exports.stroke = stroke;
|
|
12184
12641
|
exports.strokeWidth = strokeWidth;
|
|
12185
12642
|
exports.tableLayout = tableLayout;
|
|
12643
|
+
exports.tableStyle = tableStyle;
|
|
12186
12644
|
exports.tagStyle = tagStyle;
|
|
12187
12645
|
exports.tailwindPalette = tailwindPalette;
|
|
12188
12646
|
exports.tailwindTheme = tailwindTheme;
|
|
@@ -12208,6 +12666,7 @@ exports.textUnderlinePosition = textUnderlinePosition;
|
|
|
12208
12666
|
exports.textareaColumn = textareaColumn;
|
|
12209
12667
|
exports.themeFormatter = themeFormatter;
|
|
12210
12668
|
exports.timerStyle = timerStyle;
|
|
12669
|
+
exports.titlelize = titlelize;
|
|
12211
12670
|
exports.toCss = toCss;
|
|
12212
12671
|
exports.top = top;
|
|
12213
12672
|
exports.touchAction = touchAction;
|
|
@@ -12262,6 +12721,7 @@ exports.widows = widows;
|
|
|
12262
12721
|
exports.width = width;
|
|
12263
12722
|
exports.wizardModalStyle = wizardModalStyle;
|
|
12264
12723
|
exports.wizardStyle = wizardStyle;
|
|
12724
|
+
exports.wizardSummaryStyle = wizardSummaryStyle;
|
|
12265
12725
|
exports.wordBreak = wordBreak;
|
|
12266
12726
|
exports.wordSpacing = wordSpacing;
|
|
12267
12727
|
exports.zIndex = zIndex;
|