@ssa-ui-kit/core 2.8.3 → 2.9.0-canary-4b2c248-20250414
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/AccordionGroup/types.d.ts +6 -3
- package/dist/components/Charts/GaugeChart/GaugeChart.d.ts +25 -0
- package/dist/components/Charts/GaugeChart/components/GaugeChartBase.d.ts +7 -0
- package/dist/components/Charts/GaugeChart/components/GaugeChartCanvas.d.ts +4 -0
- package/dist/components/Charts/GaugeChart/components/GaugeChartHeader.d.ts +8 -0
- package/dist/components/Charts/GaugeChart/components/GaugeChartLabels.d.ts +14 -0
- package/dist/components/Charts/GaugeChart/components/GaugeChartLayer.d.ts +4 -0
- package/dist/components/Charts/GaugeChart/components/GaugeChartNeedle.d.ts +12 -0
- package/dist/components/Charts/GaugeChart/components/GaugeChartTickers.d.ts +17 -0
- package/dist/components/Charts/GaugeChart/components/index.d.ts +7 -0
- package/dist/components/Charts/GaugeChart/index.d.ts +1 -0
- package/dist/components/Charts/GaugeChart/utils/index.d.ts +1 -0
- package/dist/components/Charts/GaugeChart/utils/math.d.ts +19 -0
- package/dist/components/Charts/TreeMapChart/TreeMapChart.d.ts +2 -2
- package/dist/components/Charts/index.d.ts +1 -0
- package/dist/components/JsonSchemaForm/fields/AccordionField.d.ts +6 -0
- package/dist/components/JsonSchemaForm/fields/DateRangeField.d.ts +2 -0
- package/dist/components/JsonSchemaForm/fields/index.d.ts +4 -0
- package/dist/components/JsonSchemaForm/index.d.ts +2 -1
- package/dist/components/JsonSchemaForm/utils/index.d.ts +1 -0
- package/dist/components/JsonSchemaForm/utils/schema.d.ts +3 -0
- package/dist/components/JsonSchemaForm/widgets/DateWidget.d.ts +2 -0
- package/dist/index.js +669 -37
- package/dist/index.js.map +1 -1
- package/package.json +31 -5
package/dist/index.js
CHANGED
|
@@ -110,6 +110,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
110
110
|
FormRadioGroup: () => (/* reexport */ FormRadioGroup_FormRadioGroup),
|
|
111
111
|
FullscreenModeContext: () => (/* reexport */ FullscreenModeContext),
|
|
112
112
|
FullscreenModeProvider: () => (/* reexport */ FullscreenModeProvider),
|
|
113
|
+
GaugeChart: () => (/* reexport */ GaugeChart),
|
|
113
114
|
Icon: () => (/* reexport */ Icon_Icon),
|
|
114
115
|
ImageItem: () => (/* reexport */ ImageItem),
|
|
115
116
|
Indicator: () => (/* reexport */ Indicator_Indicator),
|
|
@@ -935,10 +936,12 @@ __webpack_require__.d(colorPalettes_namespaceObject, {
|
|
|
935
936
|
var JsonSchemaForm_namespaceObject = {};
|
|
936
937
|
__webpack_require__.r(JsonSchemaForm_namespaceObject);
|
|
937
938
|
__webpack_require__.d(JsonSchemaForm_namespaceObject, {
|
|
939
|
+
Fields: () => (fields),
|
|
938
940
|
Form: () => (JsonSchemaForm_Form),
|
|
939
941
|
Templates: () => (templates),
|
|
940
942
|
Theme: () => (Theme),
|
|
941
943
|
Widgets: () => (widgets),
|
|
944
|
+
generateFields: () => (generateFields),
|
|
942
945
|
generateForm: () => (generateForm),
|
|
943
946
|
generateTemplates: () => (generateTemplates),
|
|
944
947
|
generateTheme: () => (generateTheme),
|
|
@@ -7645,8 +7648,8 @@ const useAccordionGroupContext = () => (0,external_react_namespaceObject.useCont
|
|
|
7645
7648
|
const useAccordionGroup = () => {
|
|
7646
7649
|
const [openedAccordions, setOpenedAccordions] = (0,external_react_namespaceObject.useState)([]);
|
|
7647
7650
|
const [stayOpen, setStayOpen] = (0,external_react_namespaceObject.useState)(false);
|
|
7648
|
-
const toggleOpenedAccordion = accordion => {
|
|
7649
|
-
const isOpened = !!openedAccordions.find(activeAccordion => activeAccordion.id === accordion.id);
|
|
7651
|
+
const toggleOpenedAccordion = (accordion, opened) => {
|
|
7652
|
+
const isOpened = opened ?? !!openedAccordions.find(activeAccordion => activeAccordion.id === accordion.id);
|
|
7650
7653
|
if (stayOpen) {
|
|
7651
7654
|
const newOpenedAccordions = isOpened ? openedAccordions.filter(activeAccordion => activeAccordion.id !== accordion.id) : openedAccordions.concat([accordion]);
|
|
7652
7655
|
setOpenedAccordions(newOpenedAccordions);
|
|
@@ -7731,20 +7734,15 @@ const AccordionGroup = ({
|
|
|
7731
7734
|
children: external_react_namespaceObject.Children.map(children, child => {
|
|
7732
7735
|
if (/*#__PURE__*/(0,external_react_namespaceObject.isValidElement)(child)) {
|
|
7733
7736
|
const {
|
|
7734
|
-
|
|
7735
|
-
renderTitle,
|
|
7736
|
-
...rest
|
|
7737
|
+
id
|
|
7737
7738
|
} = child.props;
|
|
7738
|
-
const id = rest.id;
|
|
7739
7739
|
const isOpened = !!openedAccordions?.find(activeAccordion => activeAccordion.id === id);
|
|
7740
7740
|
return /*#__PURE__*/(0,external_react_namespaceObject.cloneElement)(child, {
|
|
7741
7741
|
key: id,
|
|
7742
7742
|
isOpened,
|
|
7743
7743
|
size,
|
|
7744
7744
|
onClick: () => toggleOpenedAccordion({
|
|
7745
|
-
id
|
|
7746
|
-
renderContent: renderContent.bind(null, rest),
|
|
7747
|
-
renderTitle: renderTitle.bind(null, rest)
|
|
7745
|
+
id
|
|
7748
7746
|
})
|
|
7749
7747
|
});
|
|
7750
7748
|
}
|
|
@@ -7822,7 +7820,8 @@ const AccordionTitle = ({
|
|
|
7822
7820
|
isOpened,
|
|
7823
7821
|
ariaControls,
|
|
7824
7822
|
className,
|
|
7825
|
-
onClick
|
|
7823
|
+
onClick,
|
|
7824
|
+
...props
|
|
7826
7825
|
}) => {
|
|
7827
7826
|
const theme = (0,react_namespaceObject.useTheme)();
|
|
7828
7827
|
const styles = createTitleStyles(theme, isOpened);
|
|
@@ -7839,6 +7838,7 @@ const AccordionTitle = ({
|
|
|
7839
7838
|
onClick();
|
|
7840
7839
|
}
|
|
7841
7840
|
},
|
|
7841
|
+
...props,
|
|
7842
7842
|
children: (0,jsx_runtime_namespaceObject.jsxs)(external_react_namespaceObject.Fragment, {
|
|
7843
7843
|
children: [title, isOpened ? (0,jsx_runtime_namespaceObject.jsx)(Icon_Icon, {
|
|
7844
7844
|
name: "carrot-down"
|
|
@@ -15716,7 +15716,6 @@ function TreeMapChart_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried
|
|
|
15716
15716
|
|
|
15717
15717
|
|
|
15718
15718
|
|
|
15719
|
-
|
|
15720
15719
|
var TreeMapChart_ref = true ? {
|
|
15721
15720
|
name: "1qkt16r",
|
|
15722
15721
|
styles: "position:relative;height:100%;width:100%"
|
|
@@ -15782,6 +15781,429 @@ const TreeMapChart = WithFullscreenMode(TreeMapChartComponent);
|
|
|
15782
15781
|
|
|
15783
15782
|
;// ./src/components/Charts/hooks/index.ts
|
|
15784
15783
|
|
|
15784
|
+
;// ./src/components/Charts/GaugeChart/components/GaugeChartHeader.tsx
|
|
15785
|
+
|
|
15786
|
+
function GaugeChartHeader_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
15787
|
+
|
|
15788
|
+
|
|
15789
|
+
|
|
15790
|
+
|
|
15791
|
+
const GaugeChartHeader_FullScreenButton = /*#__PURE__*/base_default()(Button_Button, true ? {
|
|
15792
|
+
target: "e1mg237f0"
|
|
15793
|
+
} : 0)("height:auto;padding:0;background:none;box-shadow:none;&:hover,&:focus{background:none;box-shadow:none;&::before{display:none;}}&:hover{svg path{fill:", ({
|
|
15794
|
+
theme
|
|
15795
|
+
}) => theme.colors.greyDarker, ";}}" + ( true ? "" : 0));
|
|
15796
|
+
var GaugeChartHeader_ref = true ? {
|
|
15797
|
+
name: "1pqzlpx",
|
|
15798
|
+
styles: "width:auto;margin-left:auto"
|
|
15799
|
+
} : 0;
|
|
15800
|
+
var GaugeChartHeader_ref2 = true ? {
|
|
15801
|
+
name: "e0dnmk",
|
|
15802
|
+
styles: "cursor:pointer"
|
|
15803
|
+
} : 0;
|
|
15804
|
+
const GaugeChartHeader = ({
|
|
15805
|
+
features = []
|
|
15806
|
+
}) => {
|
|
15807
|
+
const {
|
|
15808
|
+
isFullscreenMode,
|
|
15809
|
+
toggleFullscreenMode
|
|
15810
|
+
} = useFullscreenMode();
|
|
15811
|
+
const theme = (0,react_namespaceObject.useTheme)();
|
|
15812
|
+
return (0,jsx_runtime_namespaceObject.jsx)(Wrapper_Wrapper, {
|
|
15813
|
+
css: GaugeChartHeader_ref,
|
|
15814
|
+
children: features.includes('fullscreenMode') && (0,jsx_runtime_namespaceObject.jsx)(GaugeChartHeader_FullScreenButton, {
|
|
15815
|
+
variant: "tertiary",
|
|
15816
|
+
onClick: toggleFullscreenMode,
|
|
15817
|
+
children: (0,jsx_runtime_namespaceObject.jsx)(Icon_Icon, {
|
|
15818
|
+
name: isFullscreenMode ? 'cross' : 'maximize',
|
|
15819
|
+
css: GaugeChartHeader_ref2,
|
|
15820
|
+
tooltip: isFullscreenMode ? 'Close' : 'Maximize',
|
|
15821
|
+
size: 18,
|
|
15822
|
+
color: theme.colors.greyFilterIcon
|
|
15823
|
+
})
|
|
15824
|
+
})
|
|
15825
|
+
});
|
|
15826
|
+
};
|
|
15827
|
+
;// ./src/components/Charts/GaugeChart/components/GaugeChartCanvas.tsx
|
|
15828
|
+
|
|
15829
|
+
function GaugeChartCanvas_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
15830
|
+
const GaugeChartCanvas = /*#__PURE__*/base_default()("div", true ? {
|
|
15831
|
+
target: "e838210"
|
|
15832
|
+
} : 0)( true ? {
|
|
15833
|
+
name: "1f0ps9l",
|
|
15834
|
+
styles: "position:relative;width:100%;max-height:100%;aspect-ratio:3"
|
|
15835
|
+
} : 0);
|
|
15836
|
+
;// ./src/components/Charts/GaugeChart/components/GaugeChartLayer.tsx
|
|
15837
|
+
|
|
15838
|
+
function GaugeChartLayer_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
15839
|
+
const GaugeChartLayer = /*#__PURE__*/base_default()("div", true ? {
|
|
15840
|
+
target: "ecz750w0"
|
|
15841
|
+
} : 0)( true ? {
|
|
15842
|
+
name: "xyyuvf",
|
|
15843
|
+
styles: "position:absolute;height:100%;width:100%"
|
|
15844
|
+
} : 0);
|
|
15845
|
+
;// ./src/components/Charts/GaugeChart/components/GaugeChartBase.tsx
|
|
15846
|
+
|
|
15847
|
+
|
|
15848
|
+
|
|
15849
|
+
const GaugeChartBase = ({
|
|
15850
|
+
...props
|
|
15851
|
+
}) => {
|
|
15852
|
+
const theme = (0,react_namespaceObject.useTheme)();
|
|
15853
|
+
return (0,jsx_runtime_namespaceObject.jsx)(pie_namespaceObject.ResponsivePie, {
|
|
15854
|
+
startAngle: -90,
|
|
15855
|
+
endAngle: 90,
|
|
15856
|
+
innerRadius: 0.8,
|
|
15857
|
+
padAngle: 1,
|
|
15858
|
+
cornerRadius: 100,
|
|
15859
|
+
enableArcLabels: false,
|
|
15860
|
+
enableArcLinkLabels: false,
|
|
15861
|
+
colors: ({
|
|
15862
|
+
data
|
|
15863
|
+
}) => data.color ?? theme.colors.greyLighter,
|
|
15864
|
+
isInteractive: false,
|
|
15865
|
+
animate: false,
|
|
15866
|
+
sortByValue: false,
|
|
15867
|
+
fit: true,
|
|
15868
|
+
layers: ['arcs', 'legends'],
|
|
15869
|
+
...props
|
|
15870
|
+
});
|
|
15871
|
+
};
|
|
15872
|
+
;// ./src/components/Charts/GaugeChart/utils/math.ts
|
|
15873
|
+
const scaleFromBase = (baseValue, base, current) => {
|
|
15874
|
+
return current / base * baseValue;
|
|
15875
|
+
};
|
|
15876
|
+
const normalizeToRange = (value, min, max, targetMin = 0, targetMax = 100) => {
|
|
15877
|
+
if (max === min) return targetMin;
|
|
15878
|
+
const clampedValue = Math.min(Math.max(value, min), max);
|
|
15879
|
+
const ratio = (clampedValue - min) / (max - min);
|
|
15880
|
+
return ratio * (targetMax - targetMin) + targetMin;
|
|
15881
|
+
};
|
|
15882
|
+
const calculateFittedSize = (container, aspectRatio) => {
|
|
15883
|
+
const containerRatio = container.width / container.height;
|
|
15884
|
+
if (containerRatio < aspectRatio) {
|
|
15885
|
+
// container is too tall → constrain by width
|
|
15886
|
+
const width = container.width;
|
|
15887
|
+
return {
|
|
15888
|
+
width,
|
|
15889
|
+
height: width / aspectRatio
|
|
15890
|
+
};
|
|
15891
|
+
} else {
|
|
15892
|
+
// container is too wide → constrain by height
|
|
15893
|
+
const height = container.height;
|
|
15894
|
+
return {
|
|
15895
|
+
width: height * aspectRatio,
|
|
15896
|
+
height
|
|
15897
|
+
};
|
|
15898
|
+
}
|
|
15899
|
+
};
|
|
15900
|
+
const centeredOffset = (container, content) => {
|
|
15901
|
+
return {
|
|
15902
|
+
x: (container.width - content.width) / 2,
|
|
15903
|
+
y: (container.height - content.height) / 2
|
|
15904
|
+
};
|
|
15905
|
+
};
|
|
15906
|
+
;// ./src/components/Charts/GaugeChart/components/GaugeChartTickers.tsx
|
|
15907
|
+
|
|
15908
|
+
|
|
15909
|
+
|
|
15910
|
+
const GaugeChartTickers = ({
|
|
15911
|
+
pieOffset,
|
|
15912
|
+
pieSize,
|
|
15913
|
+
minValue,
|
|
15914
|
+
maxValue,
|
|
15915
|
+
ticks = []
|
|
15916
|
+
}) => {
|
|
15917
|
+
const theme = (0,react_namespaceObject.useTheme)();
|
|
15918
|
+
if (pieSize.height <= 0) {
|
|
15919
|
+
return;
|
|
15920
|
+
}
|
|
15921
|
+
const radius = pieSize.width / 2;
|
|
15922
|
+
const labelRadius = radius * 1.05;
|
|
15923
|
+
const pieBottomCenter = {
|
|
15924
|
+
x: pieOffset.x + pieSize.width / 2,
|
|
15925
|
+
y: pieOffset.y + pieSize.height
|
|
15926
|
+
};
|
|
15927
|
+
const tickLabels = ticks.map(tick => {
|
|
15928
|
+
const {
|
|
15929
|
+
value,
|
|
15930
|
+
label
|
|
15931
|
+
} = typeof tick === 'number' ? {
|
|
15932
|
+
value: tick,
|
|
15933
|
+
label: tick
|
|
15934
|
+
} : tick;
|
|
15935
|
+
const normalizedValue = normalizeToRange(value, minValue, maxValue, 0, 100);
|
|
15936
|
+
const angle = (-90 + normalizedValue / 100 * 180) * (Math.PI / 180);
|
|
15937
|
+
const x = pieBottomCenter.x + labelRadius * Math.sin(angle);
|
|
15938
|
+
const y = pieBottomCenter.y - labelRadius * Math.cos(angle);
|
|
15939
|
+
const align = normalizedValue > 50 ? 'left' : 'right';
|
|
15940
|
+
return {
|
|
15941
|
+
x,
|
|
15942
|
+
y,
|
|
15943
|
+
normalizedValue,
|
|
15944
|
+
label: label ?? value,
|
|
15945
|
+
align
|
|
15946
|
+
};
|
|
15947
|
+
});
|
|
15948
|
+
return (0,jsx_runtime_namespaceObject.jsx)(jsx_runtime_namespaceObject.Fragment, {
|
|
15949
|
+
children: tickLabels.map(({
|
|
15950
|
+
normalizedValue,
|
|
15951
|
+
label,
|
|
15952
|
+
align,
|
|
15953
|
+
x,
|
|
15954
|
+
y
|
|
15955
|
+
}, index) => {
|
|
15956
|
+
let translateX = '-50%'; // center
|
|
15957
|
+
if (align === 'right') {
|
|
15958
|
+
translateX = '-100%';
|
|
15959
|
+
}
|
|
15960
|
+
if (align === 'left') {
|
|
15961
|
+
translateX = '0%';
|
|
15962
|
+
}
|
|
15963
|
+
return (0,jsx_runtime_namespaceObject.jsx)("div", {
|
|
15964
|
+
// prevents class creation for each label
|
|
15965
|
+
style: {
|
|
15966
|
+
left: `${x}px`,
|
|
15967
|
+
top: `${y}px`,
|
|
15968
|
+
transform: `translate(${translateX}, -50%)`
|
|
15969
|
+
},
|
|
15970
|
+
css: /*#__PURE__*/(0,react_namespaceObject.css)({
|
|
15971
|
+
color: theme.colors.greyDarker60,
|
|
15972
|
+
position: 'absolute',
|
|
15973
|
+
fontSize: 12,
|
|
15974
|
+
fontWeight: 500
|
|
15975
|
+
}, true ? "" : 0, true ? "" : 0),
|
|
15976
|
+
children: label
|
|
15977
|
+
}, normalizedValue + index);
|
|
15978
|
+
})
|
|
15979
|
+
});
|
|
15980
|
+
};
|
|
15981
|
+
;// ./src/components/Charts/GaugeChart/components/GaugeChartNeedle.tsx
|
|
15982
|
+
|
|
15983
|
+
|
|
15984
|
+
const GaugeChartNeedle = ({
|
|
15985
|
+
pieSize,
|
|
15986
|
+
pieOffset,
|
|
15987
|
+
needleAngle
|
|
15988
|
+
}) => {
|
|
15989
|
+
if (pieSize.height <= 0) {
|
|
15990
|
+
return;
|
|
15991
|
+
}
|
|
15992
|
+
const needle = {
|
|
15993
|
+
x: pieOffset.x + pieSize.width / 2,
|
|
15994
|
+
y: pieOffset.y + pieSize.height - scaleFromBase(10, 100, pieSize.height),
|
|
15995
|
+
width: scaleFromBase(40, 100, pieSize.width) - scaleFromBase(10, 100, pieSize.height),
|
|
15996
|
+
height: scaleFromBase(8, 100, pieSize.height)
|
|
15997
|
+
};
|
|
15998
|
+
return (0,jsx_runtime_namespaceObject.jsx)("div", {
|
|
15999
|
+
style: {
|
|
16000
|
+
position: 'absolute',
|
|
16001
|
+
top: `${needle.y}px`,
|
|
16002
|
+
left: `${needle.x}px`,
|
|
16003
|
+
width: `${needle.width}px`,
|
|
16004
|
+
borderRadius: needle.height / 2,
|
|
16005
|
+
height: `${needle.height}px`,
|
|
16006
|
+
backgroundColor: '#73767B',
|
|
16007
|
+
transformOrigin: 'left center',
|
|
16008
|
+
transform: `rotate(${needleAngle}deg)`
|
|
16009
|
+
}
|
|
16010
|
+
});
|
|
16011
|
+
};
|
|
16012
|
+
;// ./src/components/Charts/GaugeChart/components/GaugeChartLabels.tsx
|
|
16013
|
+
|
|
16014
|
+
|
|
16015
|
+
function GaugeChartLabels_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
16016
|
+
|
|
16017
|
+
|
|
16018
|
+
|
|
16019
|
+
const GaugeChartLabel = /*#__PURE__*/base_default()("span", true ? {
|
|
16020
|
+
target: "e1hn6mi60"
|
|
16021
|
+
} : 0)("line-height:0;color:", ({
|
|
16022
|
+
theme
|
|
16023
|
+
}) => theme.colors.greyDarker60, ";" + ( true ? "" : 0));
|
|
16024
|
+
var GaugeChartLabels_ref = true ? {
|
|
16025
|
+
name: "1azakc",
|
|
16026
|
+
styles: "text-align:center"
|
|
16027
|
+
} : 0;
|
|
16028
|
+
var GaugeChartLabels_ref2 = true ? {
|
|
16029
|
+
name: "5bhc30",
|
|
16030
|
+
styles: "margin-bottom:8px"
|
|
16031
|
+
} : 0;
|
|
16032
|
+
var GaugeChartLabels_ref3 = true ? {
|
|
16033
|
+
name: "6r7ers",
|
|
16034
|
+
styles: "font-size:28px;font-weight:700;white-space:nowrap;color:unset"
|
|
16035
|
+
} : 0;
|
|
16036
|
+
const GaugeChartLabels = ({
|
|
16037
|
+
width,
|
|
16038
|
+
withLabels,
|
|
16039
|
+
value,
|
|
16040
|
+
unitLabel,
|
|
16041
|
+
minLabel,
|
|
16042
|
+
maxLabel,
|
|
16043
|
+
totalLabel
|
|
16044
|
+
}) => {
|
|
16045
|
+
const theme = (0,react_namespaceObject.useTheme)();
|
|
16046
|
+
return (0,jsx_runtime_namespaceObject.jsxs)(Wrapper_Wrapper, {
|
|
16047
|
+
css: /*#__PURE__*/(0,react_namespaceObject.css)({
|
|
16048
|
+
width,
|
|
16049
|
+
justifyContent: 'space-between'
|
|
16050
|
+
}, true ? "" : 0, true ? "" : 0),
|
|
16051
|
+
children: [(0,jsx_runtime_namespaceObject.jsx)(GaugeChartLabel, {
|
|
16052
|
+
children: withLabels && minLabel
|
|
16053
|
+
}), (0,jsx_runtime_namespaceObject.jsxs)("div", {
|
|
16054
|
+
css: GaugeChartLabels_ref,
|
|
16055
|
+
children: [(0,jsx_runtime_namespaceObject.jsx)("div", {
|
|
16056
|
+
css: GaugeChartLabels_ref2,
|
|
16057
|
+
children: (0,jsx_runtime_namespaceObject.jsx)(GaugeChartLabel, {
|
|
16058
|
+
children: withLabels && totalLabel
|
|
16059
|
+
})
|
|
16060
|
+
}), (0,jsx_runtime_namespaceObject.jsxs)(GaugeChartLabel, {
|
|
16061
|
+
css: GaugeChartLabels_ref3,
|
|
16062
|
+
children: [(0,jsx_runtime_namespaceObject.jsxs)("span", {
|
|
16063
|
+
children: [value, " "]
|
|
16064
|
+
}), (0,jsx_runtime_namespaceObject.jsx)(GaugeChartLabel, {
|
|
16065
|
+
css: /*#__PURE__*/(0,react_namespaceObject.css)({
|
|
16066
|
+
fontSize: 18,
|
|
16067
|
+
fontWeight: 500,
|
|
16068
|
+
color: theme.colors.greyDarker80
|
|
16069
|
+
}, true ? "" : 0, true ? "" : 0),
|
|
16070
|
+
children: unitLabel
|
|
16071
|
+
})]
|
|
16072
|
+
})]
|
|
16073
|
+
}), (0,jsx_runtime_namespaceObject.jsx)(GaugeChartLabel, {
|
|
16074
|
+
children: withLabels && maxLabel
|
|
16075
|
+
})]
|
|
16076
|
+
});
|
|
16077
|
+
};
|
|
16078
|
+
;// ./src/components/Charts/GaugeChart/GaugeChart.tsx
|
|
16079
|
+
function GaugeChart_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
16080
|
+
|
|
16081
|
+
|
|
16082
|
+
|
|
16083
|
+
|
|
16084
|
+
|
|
16085
|
+
|
|
16086
|
+
|
|
16087
|
+
|
|
16088
|
+
var GaugeChart_ref = true ? {
|
|
16089
|
+
name: "13udsys",
|
|
16090
|
+
styles: "height:100%"
|
|
16091
|
+
} : 0;
|
|
16092
|
+
var GaugeChart_ref2 = true ? {
|
|
16093
|
+
name: "67cb9k",
|
|
16094
|
+
styles: "justify-content:center;height:100%"
|
|
16095
|
+
} : 0;
|
|
16096
|
+
const GaugeChartComponent = ({
|
|
16097
|
+
minLabel,
|
|
16098
|
+
maxLabel,
|
|
16099
|
+
totalLabel,
|
|
16100
|
+
unitLabel,
|
|
16101
|
+
minValue,
|
|
16102
|
+
maxValue,
|
|
16103
|
+
value,
|
|
16104
|
+
title,
|
|
16105
|
+
chartProps,
|
|
16106
|
+
trackProps,
|
|
16107
|
+
widgetCardProps,
|
|
16108
|
+
withLabels = true,
|
|
16109
|
+
withTrack = true,
|
|
16110
|
+
withNeedle = true,
|
|
16111
|
+
features = [],
|
|
16112
|
+
segments = [],
|
|
16113
|
+
ticks = []
|
|
16114
|
+
}) => {
|
|
16115
|
+
const theme = (0,react_namespaceObject.useTheme)();
|
|
16116
|
+
const {
|
|
16117
|
+
ref: containerRef,
|
|
16118
|
+
...containerSize
|
|
16119
|
+
} = (0,hooks_namespaceObject.useElementSize)();
|
|
16120
|
+
const normalizedValue = normalizeToRange(value, minValue, maxValue, 0, 100);
|
|
16121
|
+
const normalizedSegments = segments.map((segment, index) => {
|
|
16122
|
+
const prev = segments[index - 1];
|
|
16123
|
+
const start = normalizeToRange(prev?.value ?? minValue, minValue, maxValue, 0, 100);
|
|
16124
|
+
const end = normalizeToRange(segment.value, minValue, maxValue, 0, 100);
|
|
16125
|
+
return {
|
|
16126
|
+
...segment,
|
|
16127
|
+
value: end - start
|
|
16128
|
+
};
|
|
16129
|
+
});
|
|
16130
|
+
if (normalizedSegments.length === 0) {
|
|
16131
|
+
normalizedSegments.push({
|
|
16132
|
+
value: normalizedValue,
|
|
16133
|
+
color: theme.colors.blueLight
|
|
16134
|
+
});
|
|
16135
|
+
}
|
|
16136
|
+
|
|
16137
|
+
// ensure normalized segments value sum to 100
|
|
16138
|
+
const totalValue = normalizedSegments.reduce((acc, segment) => acc + segment.value, 0);
|
|
16139
|
+
if (totalValue !== 100) {
|
|
16140
|
+
normalizedSegments.push({
|
|
16141
|
+
value: 100 - totalValue,
|
|
16142
|
+
color: 'transparent'
|
|
16143
|
+
});
|
|
16144
|
+
}
|
|
16145
|
+
const needleAngle = 180 + normalizedValue / 100 * 180;
|
|
16146
|
+
const trackSize = 100;
|
|
16147
|
+
const pieAspectRatio = 2;
|
|
16148
|
+
const pieSize = calculateFittedSize(containerSize, pieAspectRatio);
|
|
16149
|
+
const pieOffset = centeredOffset(containerSize, pieSize);
|
|
16150
|
+
return (0,jsx_runtime_namespaceObject.jsx)("div", {
|
|
16151
|
+
css: GaugeChart_ref,
|
|
16152
|
+
children: (0,jsx_runtime_namespaceObject.jsx)(WithWidgetCard, {
|
|
16153
|
+
features: features,
|
|
16154
|
+
cardProps: {
|
|
16155
|
+
title,
|
|
16156
|
+
headerContent: (0,jsx_runtime_namespaceObject.jsx)(GaugeChartHeader, {
|
|
16157
|
+
features: features
|
|
16158
|
+
}),
|
|
16159
|
+
...widgetCardProps
|
|
16160
|
+
},
|
|
16161
|
+
children: (0,jsx_runtime_namespaceObject.jsxs)(Wrapper_Wrapper, {
|
|
16162
|
+
direction: "column",
|
|
16163
|
+
css: GaugeChart_ref2,
|
|
16164
|
+
children: [(0,jsx_runtime_namespaceObject.jsxs)(GaugeChartCanvas, {
|
|
16165
|
+
children: [(0,jsx_runtime_namespaceObject.jsx)(GaugeChartLayer, {
|
|
16166
|
+
children: withTrack && (0,jsx_runtime_namespaceObject.jsx)(GaugeChartBase, {
|
|
16167
|
+
data: [{
|
|
16168
|
+
value: trackSize
|
|
16169
|
+
}],
|
|
16170
|
+
colors: theme.colors.greyLighter,
|
|
16171
|
+
layers: ['arcs'],
|
|
16172
|
+
...trackProps
|
|
16173
|
+
})
|
|
16174
|
+
}), (0,jsx_runtime_namespaceObject.jsxs)(GaugeChartLayer, {
|
|
16175
|
+
ref: containerRef,
|
|
16176
|
+
children: [(0,jsx_runtime_namespaceObject.jsx)(GaugeChartBase, {
|
|
16177
|
+
data: normalizedSegments,
|
|
16178
|
+
...chartProps
|
|
16179
|
+
}), (0,jsx_runtime_namespaceObject.jsx)(GaugeChartTickers, {
|
|
16180
|
+
pieOffset: pieOffset,
|
|
16181
|
+
pieSize: pieSize,
|
|
16182
|
+
minValue: minValue,
|
|
16183
|
+
maxValue: maxValue,
|
|
16184
|
+
ticks: ticks
|
|
16185
|
+
}), withNeedle && (0,jsx_runtime_namespaceObject.jsx)(GaugeChartNeedle, {
|
|
16186
|
+
needleAngle: needleAngle,
|
|
16187
|
+
pieOffset: pieOffset,
|
|
16188
|
+
pieSize: pieSize
|
|
16189
|
+
})]
|
|
16190
|
+
})]
|
|
16191
|
+
}), pieSize.height > 0 && (0,jsx_runtime_namespaceObject.jsx)(GaugeChartLabels, {
|
|
16192
|
+
withLabels: withLabels,
|
|
16193
|
+
width: `${pieSize.width}px`,
|
|
16194
|
+
value: value,
|
|
16195
|
+
unitLabel: unitLabel,
|
|
16196
|
+
minLabel: minLabel,
|
|
16197
|
+
maxLabel: maxLabel,
|
|
16198
|
+
totalLabel: totalLabel
|
|
16199
|
+
})]
|
|
16200
|
+
})
|
|
16201
|
+
})
|
|
16202
|
+
});
|
|
16203
|
+
};
|
|
16204
|
+
const GaugeChart = WithFullscreenMode(GaugeChartComponent);
|
|
16205
|
+
;// ./src/components/Charts/GaugeChart/index.ts
|
|
16206
|
+
|
|
15785
16207
|
;// ./src/components/Charts/index.ts
|
|
15786
16208
|
|
|
15787
16209
|
|
|
@@ -15789,6 +16211,7 @@ const TreeMapChart = WithFullscreenMode(TreeMapChartComponent);
|
|
|
15789
16211
|
|
|
15790
16212
|
|
|
15791
16213
|
|
|
16214
|
+
|
|
15792
16215
|
;// ./src/components/Popover/hooks/index.ts
|
|
15793
16216
|
|
|
15794
16217
|
|
|
@@ -16181,6 +16604,10 @@ const useTypeahead = ({
|
|
|
16181
16604
|
}, [selectedItems, children]);
|
|
16182
16605
|
(0,external_react_namespaceObject.useEffect)(() => {
|
|
16183
16606
|
setSelected(selectedItems || []);
|
|
16607
|
+
if (!selectedItems?.length) {
|
|
16608
|
+
setInputValue('');
|
|
16609
|
+
setFirstSuggestion('');
|
|
16610
|
+
}
|
|
16184
16611
|
}, [selectedItems]);
|
|
16185
16612
|
(0,external_react_namespaceObject.useEffect)(() => {
|
|
16186
16613
|
const childrenArray = external_react_default().Children.toArray(children).filter(Boolean);
|
|
@@ -17039,14 +17466,9 @@ const core_namespaceObject = require("@rjsf/core");
|
|
|
17039
17466
|
;// external "@rjsf/utils"
|
|
17040
17467
|
const external_rjsf_utils_namespaceObject = require("@rjsf/utils");
|
|
17041
17468
|
;// ./src/components/JsonSchemaForm/templates/SubmitButton.tsx
|
|
17042
|
-
function SubmitButton_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
17043
17469
|
|
|
17044
17470
|
|
|
17045
17471
|
|
|
17046
|
-
var SubmitButton_ref = true ? {
|
|
17047
|
-
name: "xda5ep",
|
|
17048
|
-
styles: "margin-top:12px"
|
|
17049
|
-
} : 0;
|
|
17050
17472
|
const SubmitButton = ({
|
|
17051
17473
|
uiSchema
|
|
17052
17474
|
}) => {
|
|
@@ -17060,7 +17482,6 @@ const SubmitButton = ({
|
|
|
17060
17482
|
}
|
|
17061
17483
|
return (0,jsx_runtime_namespaceObject.jsx)(Button_Button, {
|
|
17062
17484
|
type: "submit",
|
|
17063
|
-
css: SubmitButton_ref,
|
|
17064
17485
|
...submitButtonProps,
|
|
17065
17486
|
"data-testid": "rjsf-submit-button",
|
|
17066
17487
|
children: submitText
|
|
@@ -17676,10 +18097,13 @@ const RadioWidget = props => {
|
|
|
17676
18097
|
|
|
17677
18098
|
const SelectWidget = props => {
|
|
17678
18099
|
const {
|
|
18100
|
+
id,
|
|
18101
|
+
name,
|
|
17679
18102
|
disabled,
|
|
17680
18103
|
options,
|
|
17681
18104
|
placeholder,
|
|
17682
18105
|
onChange,
|
|
18106
|
+
onBlur,
|
|
17683
18107
|
onChangeOverride,
|
|
17684
18108
|
value
|
|
17685
18109
|
} = props;
|
|
@@ -17688,24 +18112,49 @@ const SelectWidget = props => {
|
|
|
17688
18112
|
enumDisabled = []
|
|
17689
18113
|
} = options;
|
|
17690
18114
|
const selectedIndex = (0,external_rjsf_utils_namespaceObject.enumOptionsIndexForValue)(value, enumOptions);
|
|
17691
|
-
const handleChange = onChangeOverride ? onChangeOverride :
|
|
17692
|
-
value
|
|
17693
|
-
}
|
|
17694
|
-
|
|
17695
|
-
|
|
17696
|
-
|
|
17697
|
-
|
|
17698
|
-
|
|
17699
|
-
|
|
17700
|
-
|
|
17701
|
-
|
|
17702
|
-
|
|
17703
|
-
|
|
17704
|
-
|
|
17705
|
-
|
|
17706
|
-
|
|
17707
|
-
|
|
17708
|
-
|
|
18115
|
+
const handleChange = onChangeOverride ? onChangeOverride : value => {
|
|
18116
|
+
onChange(value);
|
|
18117
|
+
};
|
|
18118
|
+
const handleBlur = ({
|
|
18119
|
+
target
|
|
18120
|
+
}) => onBlur(id, target && target.value);
|
|
18121
|
+
const onEmptyChange = isEmpty => {
|
|
18122
|
+
if (isEmpty) {
|
|
18123
|
+
handleChange();
|
|
18124
|
+
}
|
|
18125
|
+
};
|
|
18126
|
+
const register = fieldName => ({
|
|
18127
|
+
onBlur: handleBlur,
|
|
18128
|
+
onChange: handleChange,
|
|
18129
|
+
name: fieldName,
|
|
18130
|
+
ref: () => {}
|
|
18131
|
+
});
|
|
18132
|
+
const items = Array.isArray(enumOptions) ? enumOptions : [];
|
|
18133
|
+
const selectedItems = selectedIndex ? [items[Number(selectedIndex)].value] : [];
|
|
18134
|
+
return (0,jsx_runtime_namespaceObject.jsx)(Typeahead, {
|
|
18135
|
+
width: "100%",
|
|
18136
|
+
selectedItems: selectedItems,
|
|
18137
|
+
isDisabled: disabled,
|
|
18138
|
+
name: name
|
|
18139
|
+
// RJSF provides placeholder as empty string
|
|
18140
|
+
,
|
|
18141
|
+
placeholder: placeholder || undefined,
|
|
18142
|
+
onChange: handleChange,
|
|
18143
|
+
register: register,
|
|
18144
|
+
onEmptyChange: onEmptyChange,
|
|
18145
|
+
renderOption: ({
|
|
18146
|
+
label,
|
|
18147
|
+
input
|
|
18148
|
+
}) => highlightInputMatch(label, input),
|
|
18149
|
+
children: items.map(({
|
|
18150
|
+
label,
|
|
18151
|
+
value
|
|
18152
|
+
}) => (0,jsx_runtime_namespaceObject.jsx)(TypeaheadOption_TypeaheadOption, {
|
|
18153
|
+
value: value,
|
|
18154
|
+
label: label || value,
|
|
18155
|
+
isDisabled: disabled || Array.isArray(enumDisabled) && enumDisabled.includes(value),
|
|
18156
|
+
children: label || value
|
|
18157
|
+
}, value))
|
|
17709
18158
|
});
|
|
17710
18159
|
};
|
|
17711
18160
|
;// ./src/components/JsonSchemaForm/widgets/PasswordWidget.tsx
|
|
@@ -17817,6 +18266,35 @@ const RangeWidget = props => {
|
|
|
17817
18266
|
})
|
|
17818
18267
|
});
|
|
17819
18268
|
};
|
|
18269
|
+
;// ./src/components/JsonSchemaForm/widgets/DateWidget.tsx
|
|
18270
|
+
|
|
18271
|
+
|
|
18272
|
+
|
|
18273
|
+
|
|
18274
|
+
const DateWidget = props => {
|
|
18275
|
+
const {
|
|
18276
|
+
value,
|
|
18277
|
+
name,
|
|
18278
|
+
uiSchema,
|
|
18279
|
+
onChange
|
|
18280
|
+
} = props;
|
|
18281
|
+
const useFormResult = (0,external_react_hook_form_namespaceObject.useForm)();
|
|
18282
|
+
const {
|
|
18283
|
+
outputFormat = 'yyyy-MM-dd'
|
|
18284
|
+
} = uiSchema?.['ui:options'] || {};
|
|
18285
|
+
const onDateChange = date => {
|
|
18286
|
+
const formattedDate = date && external_luxon_namespaceObject.DateTime.fromJSDate(date).toFormat(outputFormat);
|
|
18287
|
+
onChange(formattedDate);
|
|
18288
|
+
};
|
|
18289
|
+
return (0,jsx_runtime_namespaceObject.jsx)(external_react_hook_form_namespaceObject.FormProvider, {
|
|
18290
|
+
...useFormResult,
|
|
18291
|
+
children: (0,jsx_runtime_namespaceObject.jsx)(DatePicker, {
|
|
18292
|
+
name: name,
|
|
18293
|
+
defaultValue: value,
|
|
18294
|
+
onChange: onDateChange
|
|
18295
|
+
})
|
|
18296
|
+
});
|
|
18297
|
+
};
|
|
17820
18298
|
;// ./src/components/JsonSchemaForm/widgets/index.ts
|
|
17821
18299
|
|
|
17822
18300
|
|
|
@@ -17824,6 +18302,7 @@ const RangeWidget = props => {
|
|
|
17824
18302
|
|
|
17825
18303
|
|
|
17826
18304
|
|
|
18305
|
+
|
|
17827
18306
|
function generateWidgets() {
|
|
17828
18307
|
return {
|
|
17829
18308
|
CheckboxWidget: CheckboxWidget,
|
|
@@ -17831,20 +18310,173 @@ function generateWidgets() {
|
|
|
17831
18310
|
RadioWidget: RadioWidget,
|
|
17832
18311
|
PasswordWidget: PasswordWidget,
|
|
17833
18312
|
SelectWidget: SelectWidget,
|
|
17834
|
-
RangeWidget: RangeWidget
|
|
18313
|
+
RangeWidget: RangeWidget,
|
|
18314
|
+
DateWidget: DateWidget
|
|
17835
18315
|
};
|
|
17836
18316
|
}
|
|
17837
18317
|
/* harmony default export */ const widgets = (generateWidgets());
|
|
18318
|
+
;// ./src/components/JsonSchemaForm/fields/AccordionField.tsx
|
|
18319
|
+
|
|
18320
|
+
function AccordionField_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
18321
|
+
|
|
18322
|
+
|
|
18323
|
+
|
|
18324
|
+
const StyledAccordionTitle = /*#__PURE__*/base_default()(AccordionTitle, true ? {
|
|
18325
|
+
target: "eilkhls0"
|
|
18326
|
+
} : 0)("color:", ({
|
|
18327
|
+
theme
|
|
18328
|
+
}) => theme.colors.greyDarker, ";font-weight:700;padding:0;", ({
|
|
18329
|
+
collapsed
|
|
18330
|
+
}) => !collapsed && `margin-bottom: 20px;`, " & svg{& path{stroke:", ({
|
|
18331
|
+
theme
|
|
18332
|
+
}) => theme.colors.greyDarker80, ";}}" + ( true ? "" : 0));
|
|
18333
|
+
var AccordionField_ref = true ? {
|
|
18334
|
+
name: "1pc4ge5",
|
|
18335
|
+
styles: "padding:0;border:none"
|
|
18336
|
+
} : 0;
|
|
18337
|
+
var AccordionField_ref2 = true ? {
|
|
18338
|
+
name: "1d3w5wq",
|
|
18339
|
+
styles: "width:100%"
|
|
18340
|
+
} : 0;
|
|
18341
|
+
const AccordionField = props => {
|
|
18342
|
+
const {
|
|
18343
|
+
uiSchema,
|
|
18344
|
+
idSchema,
|
|
18345
|
+
name,
|
|
18346
|
+
schema,
|
|
18347
|
+
registry
|
|
18348
|
+
} = props;
|
|
18349
|
+
const accordionOptions = uiSchema?.['ui:options'] || {};
|
|
18350
|
+
if (!accordionOptions.targetField) {
|
|
18351
|
+
throw new Error('AccordionField: options.targetField is required to render AccordionField');
|
|
18352
|
+
}
|
|
18353
|
+
const title = uiSchema?.['ui:title'] ? uiSchema['ui:title'] : schema?.title ? schema.title : name;
|
|
18354
|
+
|
|
18355
|
+
// if `ui:widget` is set to 'hide', this field won't be mounted
|
|
18356
|
+
// useAccordionGroupContext manages the open/close state of accordions across mounts
|
|
18357
|
+
const {
|
|
18358
|
+
openedAccordions,
|
|
18359
|
+
toggleOpenedAccordion,
|
|
18360
|
+
setStayOpen
|
|
18361
|
+
} = useAccordionGroupContext();
|
|
18362
|
+
(0,external_react_namespaceObject.useEffect)(() => {
|
|
18363
|
+
// prevent this accordion from being auto-collapsed when another one is opened
|
|
18364
|
+
setStayOpen(true);
|
|
18365
|
+
}, []);
|
|
18366
|
+
const openedAccordion = openedAccordions.find(({
|
|
18367
|
+
id
|
|
18368
|
+
}) => id === idSchema.$id);
|
|
18369
|
+
const collapsed = openedAccordion !== undefined ? false : !!accordionOptions.collapsed;
|
|
18370
|
+
const onAccordionClick = () => {
|
|
18371
|
+
toggleOpenedAccordion({
|
|
18372
|
+
id: idSchema.$id
|
|
18373
|
+
}, !collapsed);
|
|
18374
|
+
};
|
|
18375
|
+
const TargetField = registry.fields[accordionOptions.targetField];
|
|
18376
|
+
const accordionId = `${idSchema.$id}.accordion`;
|
|
18377
|
+
return (0,jsx_runtime_namespaceObject.jsx)(Accordion, {
|
|
18378
|
+
id: accordionId,
|
|
18379
|
+
size: "small",
|
|
18380
|
+
ariaControls: `${accordionId}-content`,
|
|
18381
|
+
title: title,
|
|
18382
|
+
isOpened: !collapsed,
|
|
18383
|
+
onClick: () => onAccordionClick(),
|
|
18384
|
+
css: AccordionField_ref,
|
|
18385
|
+
renderContent: contentProps => (0,jsx_runtime_namespaceObject.jsx)(AccordionContent, {
|
|
18386
|
+
...contentProps,
|
|
18387
|
+
css: AccordionField_ref2,
|
|
18388
|
+
children: (0,jsx_runtime_namespaceObject.jsx)(TargetField, {
|
|
18389
|
+
...props,
|
|
18390
|
+
schema: {
|
|
18391
|
+
...schema,
|
|
18392
|
+
title: ''
|
|
18393
|
+
}
|
|
18394
|
+
})
|
|
18395
|
+
}),
|
|
18396
|
+
renderTitle: titleProps => (0,jsx_runtime_namespaceObject.jsx)(StyledAccordionTitle, {
|
|
18397
|
+
...titleProps,
|
|
18398
|
+
collapsed: collapsed
|
|
18399
|
+
})
|
|
18400
|
+
});
|
|
18401
|
+
};
|
|
18402
|
+
;// ./src/components/JsonSchemaForm/fields/DateRangeField.tsx
|
|
18403
|
+
|
|
18404
|
+
|
|
18405
|
+
|
|
18406
|
+
|
|
18407
|
+
const DateRangeField = props => {
|
|
18408
|
+
const {
|
|
18409
|
+
idSchema,
|
|
18410
|
+
uiSchema,
|
|
18411
|
+
schema,
|
|
18412
|
+
name,
|
|
18413
|
+
formData,
|
|
18414
|
+
disabled,
|
|
18415
|
+
onChange
|
|
18416
|
+
} = props;
|
|
18417
|
+
if (schema.type !== 'object') {
|
|
18418
|
+
throw new Error('DateRangeField: schema.type must be "object" to render DateRangeField');
|
|
18419
|
+
}
|
|
18420
|
+
if (!schema.properties?.start || !schema.properties?.end) {
|
|
18421
|
+
throw new Error('DateRangeField: schema.properties.start and schema.properties.end are required to render DateRangeField');
|
|
18422
|
+
}
|
|
18423
|
+
const useFormResult = (0,external_react_hook_form_namespaceObject.useForm)();
|
|
18424
|
+
const {
|
|
18425
|
+
outputFormat = 'yyyy-MM-dd'
|
|
18426
|
+
} = uiSchema?.['ui:options'] || {};
|
|
18427
|
+
const title = uiSchema?.['ui:title'] ? uiSchema['ui:title'] : schema?.title ? schema.title : name;
|
|
18428
|
+
const id = idSchema.$id;
|
|
18429
|
+
const {
|
|
18430
|
+
start,
|
|
18431
|
+
end
|
|
18432
|
+
} = formData || {};
|
|
18433
|
+
const onDateRangeChange = date => {
|
|
18434
|
+
const [startDate, endDate] = date || [null, null];
|
|
18435
|
+
const start = startDate && external_luxon_namespaceObject.DateTime.fromJSDate(startDate).toFormat(outputFormat);
|
|
18436
|
+
const end = endDate && external_luxon_namespaceObject.DateTime.fromJSDate(endDate).toFormat(outputFormat);
|
|
18437
|
+
const dateRangeChange = {
|
|
18438
|
+
...(start && {
|
|
18439
|
+
start
|
|
18440
|
+
}),
|
|
18441
|
+
...(end && {
|
|
18442
|
+
end
|
|
18443
|
+
})
|
|
18444
|
+
};
|
|
18445
|
+
onChange(dateRangeChange);
|
|
18446
|
+
};
|
|
18447
|
+
return (0,jsx_runtime_namespaceObject.jsx)(external_react_hook_form_namespaceObject.FormProvider, {
|
|
18448
|
+
...useFormResult,
|
|
18449
|
+
children: (0,jsx_runtime_namespaceObject.jsx)(DateRangePicker, {
|
|
18450
|
+
name: id,
|
|
18451
|
+
label: title,
|
|
18452
|
+
disabled: disabled,
|
|
18453
|
+
defaultValue: [start, end],
|
|
18454
|
+
onChange: onDateRangeChange
|
|
18455
|
+
})
|
|
18456
|
+
});
|
|
18457
|
+
};
|
|
18458
|
+
;// ./src/components/JsonSchemaForm/fields/index.ts
|
|
18459
|
+
|
|
18460
|
+
|
|
18461
|
+
const generateFields = () => {
|
|
18462
|
+
return {
|
|
18463
|
+
accordion: AccordionField,
|
|
18464
|
+
daterange: DateRangeField
|
|
18465
|
+
};
|
|
18466
|
+
};
|
|
18467
|
+
/* harmony default export */ const fields = (generateFields());
|
|
17838
18468
|
;// ./src/components/JsonSchemaForm/index.ts
|
|
17839
18469
|
|
|
17840
18470
|
function JsonSchemaForm_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
17841
18471
|
|
|
17842
18472
|
|
|
17843
18473
|
|
|
18474
|
+
|
|
17844
18475
|
function generateTheme() {
|
|
17845
18476
|
return {
|
|
17846
18477
|
templates: generateTemplates(),
|
|
17847
|
-
widgets: generateWidgets()
|
|
18478
|
+
widgets: generateWidgets(),
|
|
18479
|
+
fields: generateFields()
|
|
17848
18480
|
};
|
|
17849
18481
|
}
|
|
17850
18482
|
const Theme = generateTheme();
|