@ssa-ui-kit/core 2.9.0 → 2.9.1

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/index.js CHANGED
@@ -70,6 +70,8 @@ __webpack_require__.d(__webpack_exports__, {
70
70
  AddNewAccountCard: () => (/* reexport */ AddNewAccountCard),
71
71
  Avatar: () => (/* reexport */ Avatar_Avatar),
72
72
  Badge: () => (/* reexport */ Badge_Badge),
73
+ BarGaugeChart: () => (/* reexport */ BarGaugeChart),
74
+ BarGaugeChartComponent: () => (/* reexport */ BarGaugeChartComponent),
73
75
  BarLineComplexChart: () => (/* reexport */ BarLineComplexChart),
74
76
  Button: () => (/* reexport */ Button_Button),
75
77
  ButtonGroup: () => (/* reexport */ ButtonGroup),
@@ -137,6 +139,7 @@ __webpack_require__.d(__webpack_exports__, {
137
139
  NestedTableRowProvider: () => (/* reexport */ NestedTableRowProvider),
138
140
  NotificationCard: () => (/* reexport */ NotificationCard),
139
141
  NotificationMenu: () => (/* reexport */ NotificationMenu),
142
+ NumberField: () => (/* reexport */ NumberField),
140
143
  Pagination: () => (/* reexport */ Pagination_Pagination),
141
144
  PaginationContext: () => (/* reexport */ PaginationContext),
142
145
  PaginationContextProvider: () => (/* reexport */ PaginationContextProvider),
@@ -254,7 +257,8 @@ __webpack_require__.d(__webpack_exports__, {
254
257
  useTabBarContext: () => (/* reexport */ useTabBarContext),
255
258
  useTooltip: () => (/* reexport */ useTooltip),
256
259
  useTooltipContext: () => (/* reexport */ useTooltipContext),
257
- useTranslation: () => (/* reexport */ useTranslation)
260
+ useTranslation: () => (/* reexport */ useTranslation),
261
+ useTypeaheadContext: () => (/* reexport */ useTypeaheadContext)
258
262
  });
259
263
 
260
264
  // NAMESPACE OBJECT: ./src/styles/global.ts
@@ -936,10 +940,12 @@ __webpack_require__.d(colorPalettes_namespaceObject, {
936
940
  var JsonSchemaForm_namespaceObject = {};
937
941
  __webpack_require__.r(JsonSchemaForm_namespaceObject);
938
942
  __webpack_require__.d(JsonSchemaForm_namespaceObject, {
943
+ Fields: () => (fields),
939
944
  Form: () => (JsonSchemaForm_Form),
940
945
  Templates: () => (templates),
941
946
  Theme: () => (Theme),
942
947
  Widgets: () => (widgets),
948
+ generateFields: () => (generateFields),
943
949
  generateForm: () => (generateForm),
944
950
  generateTemplates: () => (generateTemplates),
945
951
  generateTheme: () => (generateTheme),
@@ -7646,8 +7652,8 @@ const useAccordionGroupContext = () => (0,external_react_namespaceObject.useCont
7646
7652
  const useAccordionGroup = () => {
7647
7653
  const [openedAccordions, setOpenedAccordions] = (0,external_react_namespaceObject.useState)([]);
7648
7654
  const [stayOpen, setStayOpen] = (0,external_react_namespaceObject.useState)(false);
7649
- const toggleOpenedAccordion = accordion => {
7650
- const isOpened = !!openedAccordions.find(activeAccordion => activeAccordion.id === accordion.id);
7655
+ const toggleOpenedAccordion = (accordion, opened) => {
7656
+ const isOpened = opened ?? !!openedAccordions.find(activeAccordion => activeAccordion.id === accordion.id);
7651
7657
  if (stayOpen) {
7652
7658
  const newOpenedAccordions = isOpened ? openedAccordions.filter(activeAccordion => activeAccordion.id !== accordion.id) : openedAccordions.concat([accordion]);
7653
7659
  setOpenedAccordions(newOpenedAccordions);
@@ -7732,20 +7738,15 @@ const AccordionGroup = ({
7732
7738
  children: external_react_namespaceObject.Children.map(children, child => {
7733
7739
  if (/*#__PURE__*/(0,external_react_namespaceObject.isValidElement)(child)) {
7734
7740
  const {
7735
- renderContent,
7736
- renderTitle,
7737
- ...rest
7741
+ id
7738
7742
  } = child.props;
7739
- const id = rest.id;
7740
7743
  const isOpened = !!openedAccordions?.find(activeAccordion => activeAccordion.id === id);
7741
7744
  return /*#__PURE__*/(0,external_react_namespaceObject.cloneElement)(child, {
7742
7745
  key: id,
7743
7746
  isOpened,
7744
7747
  size,
7745
7748
  onClick: () => toggleOpenedAccordion({
7746
- id,
7747
- renderContent: renderContent.bind(null, rest),
7748
- renderTitle: renderTitle.bind(null, rest)
7749
+ id
7749
7750
  })
7750
7751
  });
7751
7752
  }
@@ -7823,7 +7824,8 @@ const AccordionTitle = ({
7823
7824
  isOpened,
7824
7825
  ariaControls,
7825
7826
  className,
7826
- onClick
7827
+ onClick,
7828
+ ...props
7827
7829
  }) => {
7828
7830
  const theme = (0,react_namespaceObject.useTheme)();
7829
7831
  const styles = createTitleStyles(theme, isOpened);
@@ -7840,6 +7842,7 @@ const AccordionTitle = ({
7840
7842
  onClick();
7841
7843
  }
7842
7844
  },
7845
+ ...props,
7843
7846
  children: (0,jsx_runtime_namespaceObject.jsxs)(external_react_namespaceObject.Fragment, {
7844
7847
  children: [title, isOpened ? (0,jsx_runtime_namespaceObject.jsx)(Icon_Icon, {
7845
7848
  name: "carrot-down"
@@ -16205,6 +16208,188 @@ const GaugeChartComponent = ({
16205
16208
  const GaugeChart = WithFullscreenMode(GaugeChartComponent);
16206
16209
  ;// ./src/components/Charts/GaugeChart/index.ts
16207
16210
 
16211
+ ;// ./src/components/Charts/BarGaugeChart/components/BarGaugeChartHeader.tsx
16212
+
16213
+ function BarGaugeChartHeader_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)."; }
16214
+
16215
+
16216
+
16217
+
16218
+ const BarGaugeChartHeader_FullScreenButton = /*#__PURE__*/base_default()(Button_Button, true ? {
16219
+ target: "e1kdngqn0"
16220
+ } : 0)("height:auto;padding:0;background:none;box-shadow:none;&:hover,&:focus{background:none;box-shadow:none;&::before{display:none;}}&:hover{svg path{fill:", ({
16221
+ theme
16222
+ }) => theme.colors.greyDarker, ";}}" + ( true ? "" : 0));
16223
+ var BarGaugeChartHeader_ref = true ? {
16224
+ name: "1pqzlpx",
16225
+ styles: "width:auto;margin-left:auto"
16226
+ } : 0;
16227
+ var BarGaugeChartHeader_ref2 = true ? {
16228
+ name: "e0dnmk",
16229
+ styles: "cursor:pointer"
16230
+ } : 0;
16231
+ const BarGaugeChartHeader = ({
16232
+ features = []
16233
+ }) => {
16234
+ const {
16235
+ isFullscreenMode,
16236
+ toggleFullscreenMode
16237
+ } = useFullscreenMode();
16238
+ const theme = (0,react_namespaceObject.useTheme)();
16239
+ return (0,jsx_runtime_namespaceObject.jsx)(Wrapper_Wrapper, {
16240
+ css: BarGaugeChartHeader_ref,
16241
+ children: features.includes('fullscreenMode') && (0,jsx_runtime_namespaceObject.jsx)(BarGaugeChartHeader_FullScreenButton, {
16242
+ variant: "tertiary",
16243
+ onClick: toggleFullscreenMode,
16244
+ children: (0,jsx_runtime_namespaceObject.jsx)(Icon_Icon, {
16245
+ name: isFullscreenMode ? 'cross' : 'maximize',
16246
+ css: BarGaugeChartHeader_ref2,
16247
+ tooltip: isFullscreenMode ? 'Close' : 'Maximize',
16248
+ size: 18,
16249
+ color: theme.colors.greyFilterIcon
16250
+ })
16251
+ })
16252
+ });
16253
+ };
16254
+ ;// ./src/components/Charts/BarGaugeChart/components/Brick.tsx
16255
+
16256
+ const Brick = /*#__PURE__*/base_default()('div', true ? {
16257
+ shouldForwardProp: propName => !propName.startsWith('$'),
16258
+ target: "e1v2was00"
16259
+ } : 0)("position:relative;height:100%;width:", ({
16260
+ $width
16261
+ }) => `${$width}px`, ";background:", ({
16262
+ $color
16263
+ }) => $color, ";border-radius:12px;overflow:hidden;opacity:", ({
16264
+ $inactive
16265
+ }) => $inactive ? 0.4 : 1, ";&::after{content:'';position:absolute;inset:0;background:rgba(85, 87, 90, 0.1);opacity:", ({
16266
+ $inactive
16267
+ }) => $inactive ? 1 : 0, ";transition:opacity 0.2s;}" + ( true ? "" : 0));
16268
+ ;// ./src/components/Charts/BarGaugeChart/components/GaugeBar.tsx
16269
+ function GaugeBar_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)."; }
16270
+
16271
+
16272
+
16273
+
16274
+
16275
+ var GaugeBar_ref = true ? {
16276
+ name: "11upmbz",
16277
+ styles: "flex:1;width:100%;display:flex;flex-direction:column"
16278
+ } : 0;
16279
+ var GaugeBar_ref2 = true ? {
16280
+ name: "1iczwj8",
16281
+ styles: "font-weight:500;font-size:12px"
16282
+ } : 0;
16283
+ var GaugeBar_ref3 = true ? {
16284
+ name: "1r965ij",
16285
+ styles: "flex:1;gap:10px"
16286
+ } : 0;
16287
+ var GaugeBar_ref4 = true ? {
16288
+ name: "xvarew",
16289
+ styles: "font-weight:700;font-size:18px"
16290
+ } : 0;
16291
+ const GaugeBar = ({
16292
+ title,
16293
+ value,
16294
+ min = 0,
16295
+ max = 100,
16296
+ gap = 2,
16297
+ brickWidth = 6,
16298
+ thresholds = [],
16299
+ valueFormatter
16300
+ }) => {
16301
+ const {
16302
+ ref,
16303
+ width
16304
+ } = (0,hooks_namespaceObject.useElementSize)();
16305
+ const {
16306
+ ref: valueRef,
16307
+ width: valueWidth
16308
+ } = (0,hooks_namespaceObject.useElementSize)();
16309
+ const theme = (0,react_namespaceObject.useTheme)();
16310
+ const baseThreshold = {
16311
+ value: 0,
16312
+ color: theme.colors.green
16313
+ };
16314
+ const _thresholds = thresholds.slice().sort((a, b) => b.value - a.value);
16315
+ const activeThreshold = _thresholds.find(threshold => value >= threshold.value) || baseThreshold;
16316
+ const totalBricks = Math.max(0, Math.floor((width - valueWidth) / (brickWidth + gap)) - 1);
16317
+ const percentagePerBrick = (max - min) / totalBricks;
16318
+ const bricks = new Array(totalBricks).fill(0).map((_, index) => {
16319
+ const brickValue = min + index * percentagePerBrick;
16320
+ const threshold = _thresholds.find(threshold => brickValue >= threshold.value) || baseThreshold;
16321
+ const inactive = value < brickValue;
16322
+ return (0,jsx_runtime_namespaceObject.jsx)(Brick, {
16323
+ $width: brickWidth,
16324
+ $color: threshold.color,
16325
+ $inactive: inactive
16326
+ }, index);
16327
+ });
16328
+ return (0,jsx_runtime_namespaceObject.jsxs)("div", {
16329
+ css: GaugeBar_ref,
16330
+ children: [(0,jsx_runtime_namespaceObject.jsx)("div", {
16331
+ css: GaugeBar_ref2,
16332
+ children: title
16333
+ }), (0,jsx_runtime_namespaceObject.jsxs)(Wrapper_Wrapper, {
16334
+ ref: ref,
16335
+ css: GaugeBar_ref3,
16336
+ children: [(0,jsx_runtime_namespaceObject.jsx)("div", {
16337
+ css: /*#__PURE__*/(0,react_namespaceObject.css)({
16338
+ flex: 1,
16339
+ height: '100%',
16340
+ padding: '10px 0',
16341
+ display: 'flex',
16342
+ gap: `${gap}px`
16343
+ }, true ? "" : 0, true ? "" : 0),
16344
+ children: bricks
16345
+ }), (0,jsx_runtime_namespaceObject.jsx)("div", {
16346
+ ref: valueRef,
16347
+ style: {
16348
+ color: activeThreshold.color
16349
+ },
16350
+ css: GaugeBar_ref4,
16351
+ children: valueFormatter?.(value, activeThreshold.color) || value
16352
+ })]
16353
+ })]
16354
+ });
16355
+ };
16356
+ ;// ./src/components/Charts/BarGaugeChart/BarGaugeChart.tsx
16357
+ function BarGaugeChart_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)."; }
16358
+
16359
+
16360
+
16361
+
16362
+ var BarGaugeChart_ref = true ? {
16363
+ name: "s3tb3c",
16364
+ styles: "height:100%;gap:12px"
16365
+ } : 0;
16366
+ const BarGaugeChartComponent = ({
16367
+ title,
16368
+ widgetCardProps,
16369
+ bars = [],
16370
+ features = []
16371
+ }) => (0,jsx_runtime_namespaceObject.jsx)(WithWidgetCard, {
16372
+ features: features,
16373
+ cardProps: {
16374
+ title,
16375
+ headerContent: (0,jsx_runtime_namespaceObject.jsx)(BarGaugeChartHeader, {
16376
+ features: features
16377
+ }),
16378
+ ...widgetCardProps
16379
+ },
16380
+ children: (0,jsx_runtime_namespaceObject.jsx)(Wrapper_Wrapper, {
16381
+ direction: "column",
16382
+ alignItems: "start",
16383
+ css: BarGaugeChart_ref,
16384
+ children: bars.map((barProps, index) => (0,jsx_runtime_namespaceObject.jsx)(GaugeBar, {
16385
+ ...barProps
16386
+ }, index))
16387
+ })
16388
+ });
16389
+ const BarGaugeChart = WithFullscreenMode(BarGaugeChartComponent);
16390
+ ;// ./src/components/Charts/BarGaugeChart/index.ts
16391
+
16392
+
16208
16393
  ;// ./src/components/Charts/index.ts
16209
16394
 
16210
16395
 
@@ -16213,6 +16398,7 @@ const GaugeChart = WithFullscreenMode(GaugeChartComponent);
16213
16398
 
16214
16399
 
16215
16400
 
16401
+
16216
16402
  ;// ./src/components/Popover/hooks/index.ts
16217
16403
 
16218
16404
 
@@ -16367,6 +16553,83 @@ const SearchBox = ({
16367
16553
 
16368
16554
 
16369
16555
 
16556
+ ;// external "@react-input/number-format"
16557
+ const number_format_namespaceObject = require("@react-input/number-format");
16558
+ ;// ./src/components/NumberField/NumberField.tsx
16559
+ function NumberField_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)."; }
16560
+
16561
+
16562
+
16563
+
16564
+ var NumberField_ref = true ? {
16565
+ name: "t1bvca",
16566
+ styles: "padding:0 14px"
16567
+ } : 0;
16568
+ var NumberField_ref2 = true ? {
16569
+ name: "chpy5q",
16570
+ styles: "with:auto;border:0 !important;padding:2px 0;height:32px;border-radius:0"
16571
+ } : 0;
16572
+ const NumberField = ({
16573
+ id,
16574
+ value,
16575
+ defaultValue,
16576
+ description,
16577
+ label,
16578
+ success,
16579
+ error,
16580
+ status,
16581
+ numberFormat,
16582
+ onChange,
16583
+ ...inputProps
16584
+ }) => {
16585
+ const {
16586
+ disabled
16587
+ } = inputProps;
16588
+ const formattedValue = value == null ? value : (0,number_format_namespaceObject.format)(value, numberFormat);
16589
+ const formattedDefaultValue = defaultValue == null ? defaultValue : (0,number_format_namespaceObject.format)(defaultValue, numberFormat);
16590
+ const [_value, setValue] = (0,hooks_namespaceObject.useUncontrolled)({
16591
+ value: formattedValue,
16592
+ defaultValue: formattedDefaultValue,
16593
+ finalValue: undefined,
16594
+ onChange: value => {
16595
+ const number = Number((0,number_format_namespaceObject.unformat)(value, numberFormat?.locales));
16596
+ onChange?.(number);
16597
+ }
16598
+ });
16599
+ const inputRef = (0,number_format_namespaceObject.useNumberFormat)(numberFormat);
16600
+ const handleChange = event => {
16601
+ setValue(event.target.value);
16602
+ };
16603
+ return (0,jsx_runtime_namespaceObject.jsxs)(FieldRoot, {
16604
+ disabled: disabled,
16605
+ status: status,
16606
+ children: [label && (0,jsx_runtime_namespaceObject.jsx)(FieldLabel, {
16607
+ htmlFor: id,
16608
+ children: label
16609
+ }), (0,jsx_runtime_namespaceObject.jsx)(FieldControl, {
16610
+ css: NumberField_ref,
16611
+ children: (0,jsx_runtime_namespaceObject.jsx)(Input_Input, {
16612
+ ref: inputRef,
16613
+ css: NumberField_ref2,
16614
+ inputProps: {
16615
+ autoComplete: 'off',
16616
+ value: _value,
16617
+ onChange: handleChange
16618
+ },
16619
+ status: "custom",
16620
+ ...inputProps
16621
+ })
16622
+ }), description && (0,jsx_runtime_namespaceObject.jsx)(FieldDescription, {
16623
+ children: description
16624
+ }), success && (0,jsx_runtime_namespaceObject.jsx)(FieldSuccess, {
16625
+ children: success
16626
+ }), error && (0,jsx_runtime_namespaceObject.jsx)(FieldError, {
16627
+ children: error
16628
+ })]
16629
+ });
16630
+ };
16631
+ ;// ./src/components/NumberField/index.ts
16632
+
16370
16633
  ;// ./src/components/Tooltip/SimpleChartTooltip.tsx
16371
16634
 
16372
16635
 
@@ -16565,7 +16828,7 @@ const useTypeahead = ({
16565
16828
  setInputValue('');
16566
16829
  setFirstSuggestion('');
16567
16830
  } else {
16568
- setValue?.(name, selected.length ? selected[0] : undefined, {
16831
+ setValue?.(name, selected.length ? selected[0] : [], {
16569
16832
  shouldDirty: !isFirstRender
16570
16833
  });
16571
16834
  }
@@ -16589,22 +16852,25 @@ const useTypeahead = ({
16589
16852
  }
16590
16853
  }, [error]);
16591
16854
  (0,external_react_namespaceObject.useEffect)(() => {
16592
- const keyedOptions = {};
16593
- const childItems = external_react_default().Children.toArray(children).filter(Boolean).map((child, index) => {
16594
- keyedOptions[child.props.value] = {
16595
- ...child.props
16596
- };
16597
- return /*#__PURE__*/external_react_default().cloneElement(child, {
16598
- index,
16599
- ...child.props
16600
- });
16855
+ processChildren({
16856
+ selectedLocal: selected
16601
16857
  });
16602
- setOptionsWithKey(keyedOptions);
16603
- setItems(childItems);
16604
- setFirstRender(false);
16605
- }, [selectedItems, children]);
16858
+ }, [children]);
16606
16859
  (0,external_react_namespaceObject.useEffect)(() => {
16607
16860
  setSelected(selectedItems || []);
16861
+ if (selectedItems?.length) {
16862
+ if (!isMultiple) {
16863
+ const currentOption = optionsWithKey[selectedItems[0]];
16864
+ const optionText = currentOption && (currentOption.children || currentOption.label || currentOption.value);
16865
+ setInputValue(`${optionText}`);
16866
+ }
16867
+ } else {
16868
+ setInputValue('');
16869
+ setFirstSuggestion('');
16870
+ }
16871
+ processChildren({
16872
+ selectedLocal: selectedItems || []
16873
+ });
16608
16874
  }, [selectedItems]);
16609
16875
  (0,external_react_namespaceObject.useEffect)(() => {
16610
16876
  const childrenArray = external_react_default().Children.toArray(children).filter(Boolean);
@@ -16648,17 +16914,16 @@ const useTypeahead = ({
16648
16914
  setSelected([]);
16649
16915
  }
16650
16916
  if (foundItem && !selected.includes(foundItem?.value)) {
16651
- setSelected([foundItem?.value]);
16917
+ setSelected([foundItem.value]);
16652
16918
  }
16653
16919
  }
16654
16920
  }, [optionsWithKey, inputValue]);
16655
16921
  (0,external_react_namespaceObject.useEffect)(() => {
16656
- if (!isMultiple && selected.length && Object.keys(optionsWithKey).length) {
16657
- const currentOption = optionsWithKey[selected[0]];
16658
- const optionText = currentOption && (currentOption.children || currentOption.label || currentOption.value);
16659
- setInputValue(`${optionText}`);
16660
- }
16661
- }, [selected, optionsWithKey]);
16922
+ processSingleSelected({
16923
+ optionsWithKeyLocal: optionsWithKey,
16924
+ selectedLocal: selected
16925
+ });
16926
+ }, [selected]);
16662
16927
  (0,external_react_namespaceObject.useEffect)(() => {
16663
16928
  if (inputValue) {
16664
16929
  const newFirstSuggestion = Object.values(optionsWithKey)?.find(item => {
@@ -16675,12 +16940,41 @@ const useTypeahead = ({
16675
16940
  }
16676
16941
  }
16677
16942
  }, [inputValue, items, selected]);
16678
- (0,external_react_namespaceObject.useEffect)(() => {
16679
- onEmptyChange?.(isEmpty);
16680
- }, [isEmpty]);
16943
+ const processSingleSelected = ({
16944
+ optionsWithKeyLocal = {},
16945
+ selectedLocal = []
16946
+ }) => {
16947
+ if (!isMultiple && selectedLocal.length && Object.keys(optionsWithKeyLocal).length) {
16948
+ const currentOption = optionsWithKeyLocal[selectedLocal[0]];
16949
+ const optionText = currentOption && (currentOption.children || currentOption.label || currentOption.value);
16950
+ setInputValue(`${optionText}`);
16951
+ }
16952
+ };
16953
+ const processChildren = ({
16954
+ selectedLocal
16955
+ }) => {
16956
+ const keyedOptions = {};
16957
+ const childItems = external_react_default().Children.toArray(children).filter(Boolean).map((child, index) => {
16958
+ keyedOptions[child.props.value] = {
16959
+ ...child.props
16960
+ };
16961
+ return /*#__PURE__*/external_react_default().cloneElement(child, {
16962
+ index,
16963
+ ...child.props
16964
+ });
16965
+ });
16966
+ setOptionsWithKey(keyedOptions);
16967
+ setItems(childItems);
16968
+ processSingleSelected({
16969
+ optionsWithKeyLocal: keyedOptions,
16970
+ selectedLocal
16971
+ });
16972
+ setFirstRender(false);
16973
+ };
16681
16974
  const handleOnEmptyChange = newIsEmptyValue => {
16682
16975
  if (newIsEmptyValue !== isEmpty) {
16683
16976
  setIsEmpty(newIsEmptyValue);
16977
+ onEmptyChange?.(newIsEmptyValue);
16684
16978
  }
16685
16979
  };
16686
16980
  const handleOpenChange = open => {
@@ -16944,6 +17238,7 @@ const MultipleTrigger = () => {
16944
17238
  name: context.inputName,
16945
17239
  status: 'custom',
16946
17240
  disabled: context.isDisabled,
17241
+ validationSchema: context.validationSchema,
16947
17242
  inputProps: {
16948
17243
  onClick: context.handleInputClick,
16949
17244
  onKeyDown: context.handleInputKeyDown,
@@ -17004,6 +17299,7 @@ const SingleTrigger = () => {
17004
17299
  name: context.inputName,
17005
17300
  status: 'custom',
17006
17301
  disabled: context.isDisabled,
17302
+ validationSchema: context.validationSchema,
17007
17303
  inputProps: {
17008
17304
  onClick: context.handleInputClick,
17009
17305
  onKeyDown: context.handleInputKeyDown,
@@ -17288,6 +17584,8 @@ const highlightInputMatch = (item, keyword) => {
17288
17584
 
17289
17585
 
17290
17586
 
17587
+
17588
+
17291
17589
  ;// ./src/components/UserProfile/styles.ts
17292
17590
  function UserProfile_styles_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)."; }
17293
17591
 
@@ -17463,14 +17761,9 @@ const core_namespaceObject = require("@rjsf/core");
17463
17761
  ;// external "@rjsf/utils"
17464
17762
  const external_rjsf_utils_namespaceObject = require("@rjsf/utils");
17465
17763
  ;// ./src/components/JsonSchemaForm/templates/SubmitButton.tsx
17466
- 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)."; }
17467
17764
 
17468
17765
 
17469
17766
 
17470
- var SubmitButton_ref = true ? {
17471
- name: "xda5ep",
17472
- styles: "margin-top:12px"
17473
- } : 0;
17474
17767
  const SubmitButton = ({
17475
17768
  uiSchema
17476
17769
  }) => {
@@ -17484,7 +17777,6 @@ const SubmitButton = ({
17484
17777
  }
17485
17778
  return (0,jsx_runtime_namespaceObject.jsx)(Button_Button, {
17486
17779
  type: "submit",
17487
- css: SubmitButton_ref,
17488
17780
  ...submitButtonProps,
17489
17781
  "data-testid": "rjsf-submit-button",
17490
17782
  children: submitText
@@ -18100,10 +18392,13 @@ const RadioWidget = props => {
18100
18392
 
18101
18393
  const SelectWidget = props => {
18102
18394
  const {
18395
+ id,
18396
+ name,
18103
18397
  disabled,
18104
18398
  options,
18105
18399
  placeholder,
18106
18400
  onChange,
18401
+ onBlur,
18107
18402
  onChangeOverride,
18108
18403
  value
18109
18404
  } = props;
@@ -18112,24 +18407,49 @@ const SelectWidget = props => {
18112
18407
  enumDisabled = []
18113
18408
  } = options;
18114
18409
  const selectedIndex = (0,external_rjsf_utils_namespaceObject.enumOptionsIndexForValue)(value, enumOptions);
18115
- const handleChange = onChangeOverride ? onChangeOverride : ({
18116
- value
18117
- }) => onChange((0,external_rjsf_utils_namespaceObject.enumOptionsValueForIndex)(value, enumOptions));
18118
- return (0,jsx_runtime_namespaceObject.jsx)("div", {
18119
- children: (0,jsx_runtime_namespaceObject.jsx)(Dropdown_Dropdown, {
18120
- isDisabled: disabled,
18121
- onChange: handleChange,
18122
- placeholder: placeholder,
18123
- selectedItem: selectedIndex ? {
18124
- value: selectedIndex,
18125
- label: enumOptions[Number(selectedIndex)].label
18126
- } : undefined,
18127
- children: Array.isArray(enumOptions) && enumOptions.map((option, i) => (0,jsx_runtime_namespaceObject.jsx)(DropdownOption_DropdownOption, {
18128
- value: String(i),
18129
- label: option.label,
18130
- isDisabled: disabled || Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1
18131
- }, i))
18132
- })
18410
+ const handleChange = onChangeOverride ? onChangeOverride : value => {
18411
+ onChange(value);
18412
+ };
18413
+ const handleBlur = ({
18414
+ target
18415
+ }) => onBlur(id, target && target.value);
18416
+ const onEmptyChange = isEmpty => {
18417
+ if (isEmpty) {
18418
+ handleChange();
18419
+ }
18420
+ };
18421
+ const register = fieldName => ({
18422
+ onBlur: handleBlur,
18423
+ onChange: handleChange,
18424
+ name: fieldName,
18425
+ ref: () => {}
18426
+ });
18427
+ const items = Array.isArray(enumOptions) ? enumOptions : [];
18428
+ const selectedItems = selectedIndex ? [items[Number(selectedIndex)].value] : [];
18429
+ return (0,jsx_runtime_namespaceObject.jsx)(Typeahead, {
18430
+ width: "100%",
18431
+ selectedItems: selectedItems,
18432
+ isDisabled: disabled,
18433
+ name: name
18434
+ // RJSF provides placeholder as empty string
18435
+ ,
18436
+ placeholder: placeholder || undefined,
18437
+ onChange: handleChange,
18438
+ register: register,
18439
+ onEmptyChange: onEmptyChange,
18440
+ renderOption: ({
18441
+ label,
18442
+ input
18443
+ }) => highlightInputMatch(label, input),
18444
+ children: items.map(({
18445
+ label,
18446
+ value
18447
+ }) => (0,jsx_runtime_namespaceObject.jsx)(TypeaheadOption_TypeaheadOption, {
18448
+ value: value,
18449
+ label: label || value,
18450
+ isDisabled: disabled || Array.isArray(enumDisabled) && enumDisabled.includes(value),
18451
+ children: label || value
18452
+ }, value))
18133
18453
  });
18134
18454
  };
18135
18455
  ;// ./src/components/JsonSchemaForm/widgets/PasswordWidget.tsx
@@ -18241,6 +18561,35 @@ const RangeWidget = props => {
18241
18561
  })
18242
18562
  });
18243
18563
  };
18564
+ ;// ./src/components/JsonSchemaForm/widgets/DateWidget.tsx
18565
+
18566
+
18567
+
18568
+
18569
+ const DateWidget = props => {
18570
+ const {
18571
+ value,
18572
+ name,
18573
+ uiSchema,
18574
+ onChange
18575
+ } = props;
18576
+ const useFormResult = (0,external_react_hook_form_namespaceObject.useForm)();
18577
+ const {
18578
+ outputFormat = 'yyyy-MM-dd'
18579
+ } = uiSchema?.['ui:options'] || {};
18580
+ const onDateChange = date => {
18581
+ const formattedDate = date && external_luxon_namespaceObject.DateTime.fromJSDate(date).toFormat(outputFormat);
18582
+ onChange(formattedDate);
18583
+ };
18584
+ return (0,jsx_runtime_namespaceObject.jsx)(external_react_hook_form_namespaceObject.FormProvider, {
18585
+ ...useFormResult,
18586
+ children: (0,jsx_runtime_namespaceObject.jsx)(DatePicker, {
18587
+ name: name,
18588
+ defaultValue: value,
18589
+ onChange: onDateChange
18590
+ })
18591
+ });
18592
+ };
18244
18593
  ;// ./src/components/JsonSchemaForm/widgets/index.ts
18245
18594
 
18246
18595
 
@@ -18248,6 +18597,7 @@ const RangeWidget = props => {
18248
18597
 
18249
18598
 
18250
18599
 
18600
+
18251
18601
  function generateWidgets() {
18252
18602
  return {
18253
18603
  CheckboxWidget: CheckboxWidget,
@@ -18255,20 +18605,173 @@ function generateWidgets() {
18255
18605
  RadioWidget: RadioWidget,
18256
18606
  PasswordWidget: PasswordWidget,
18257
18607
  SelectWidget: SelectWidget,
18258
- RangeWidget: RangeWidget
18608
+ RangeWidget: RangeWidget,
18609
+ DateWidget: DateWidget
18259
18610
  };
18260
18611
  }
18261
18612
  /* harmony default export */ const widgets = (generateWidgets());
18613
+ ;// ./src/components/JsonSchemaForm/fields/AccordionField.tsx
18614
+
18615
+ 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)."; }
18616
+
18617
+
18618
+
18619
+ const StyledAccordionTitle = /*#__PURE__*/base_default()(AccordionTitle, true ? {
18620
+ target: "eilkhls0"
18621
+ } : 0)("color:", ({
18622
+ theme
18623
+ }) => theme.colors.greyDarker, ";font-weight:700;padding:0;", ({
18624
+ collapsed
18625
+ }) => !collapsed && `margin-bottom: 20px;`, " & svg{& path{stroke:", ({
18626
+ theme
18627
+ }) => theme.colors.greyDarker80, ";}}" + ( true ? "" : 0));
18628
+ var AccordionField_ref = true ? {
18629
+ name: "1pc4ge5",
18630
+ styles: "padding:0;border:none"
18631
+ } : 0;
18632
+ var AccordionField_ref2 = true ? {
18633
+ name: "1d3w5wq",
18634
+ styles: "width:100%"
18635
+ } : 0;
18636
+ const AccordionField = props => {
18637
+ const {
18638
+ uiSchema,
18639
+ idSchema,
18640
+ name,
18641
+ schema,
18642
+ registry
18643
+ } = props;
18644
+ const accordionOptions = uiSchema?.['ui:options'] || {};
18645
+ if (!accordionOptions.targetField) {
18646
+ throw new Error('AccordionField: options.targetField is required to render AccordionField');
18647
+ }
18648
+ const title = uiSchema?.['ui:title'] ? uiSchema['ui:title'] : schema?.title ? schema.title : name;
18649
+
18650
+ // if `ui:widget` is set to 'hide', this field won't be mounted
18651
+ // useAccordionGroupContext manages the open/close state of accordions across mounts
18652
+ const {
18653
+ openedAccordions,
18654
+ toggleOpenedAccordion,
18655
+ setStayOpen
18656
+ } = useAccordionGroupContext();
18657
+ (0,external_react_namespaceObject.useEffect)(() => {
18658
+ // prevent this accordion from being auto-collapsed when another one is opened
18659
+ setStayOpen(true);
18660
+ }, []);
18661
+ const openedAccordion = openedAccordions.find(({
18662
+ id
18663
+ }) => id === idSchema.$id);
18664
+ const collapsed = openedAccordion !== undefined ? false : !!accordionOptions.collapsed;
18665
+ const onAccordionClick = () => {
18666
+ toggleOpenedAccordion({
18667
+ id: idSchema.$id
18668
+ }, !collapsed);
18669
+ };
18670
+ const TargetField = registry.fields[accordionOptions.targetField];
18671
+ const accordionId = `${idSchema.$id}.accordion`;
18672
+ return (0,jsx_runtime_namespaceObject.jsx)(Accordion, {
18673
+ id: accordionId,
18674
+ size: "small",
18675
+ ariaControls: `${accordionId}-content`,
18676
+ title: title,
18677
+ isOpened: !collapsed,
18678
+ onClick: () => onAccordionClick(),
18679
+ css: AccordionField_ref,
18680
+ renderContent: contentProps => (0,jsx_runtime_namespaceObject.jsx)(AccordionContent, {
18681
+ ...contentProps,
18682
+ css: AccordionField_ref2,
18683
+ children: (0,jsx_runtime_namespaceObject.jsx)(TargetField, {
18684
+ ...props,
18685
+ schema: {
18686
+ ...schema,
18687
+ title: ''
18688
+ }
18689
+ })
18690
+ }),
18691
+ renderTitle: titleProps => (0,jsx_runtime_namespaceObject.jsx)(StyledAccordionTitle, {
18692
+ ...titleProps,
18693
+ collapsed: collapsed
18694
+ })
18695
+ });
18696
+ };
18697
+ ;// ./src/components/JsonSchemaForm/fields/DateRangeField.tsx
18698
+
18699
+
18700
+
18701
+
18702
+ const DateRangeField = props => {
18703
+ const {
18704
+ idSchema,
18705
+ uiSchema,
18706
+ schema,
18707
+ name,
18708
+ formData,
18709
+ disabled,
18710
+ onChange
18711
+ } = props;
18712
+ if (schema.type !== 'object') {
18713
+ throw new Error('DateRangeField: schema.type must be "object" to render DateRangeField');
18714
+ }
18715
+ if (!schema.properties?.start || !schema.properties?.end) {
18716
+ throw new Error('DateRangeField: schema.properties.start and schema.properties.end are required to render DateRangeField');
18717
+ }
18718
+ const useFormResult = (0,external_react_hook_form_namespaceObject.useForm)();
18719
+ const {
18720
+ outputFormat = 'yyyy-MM-dd'
18721
+ } = uiSchema?.['ui:options'] || {};
18722
+ const title = uiSchema?.['ui:title'] ? uiSchema['ui:title'] : schema?.title ? schema.title : name;
18723
+ const id = idSchema.$id;
18724
+ const {
18725
+ start,
18726
+ end
18727
+ } = formData || {};
18728
+ const onDateRangeChange = date => {
18729
+ const [startDate, endDate] = date || [null, null];
18730
+ const start = startDate && external_luxon_namespaceObject.DateTime.fromJSDate(startDate).toFormat(outputFormat);
18731
+ const end = endDate && external_luxon_namespaceObject.DateTime.fromJSDate(endDate).toFormat(outputFormat);
18732
+ const dateRangeChange = {
18733
+ ...(start && {
18734
+ start
18735
+ }),
18736
+ ...(end && {
18737
+ end
18738
+ })
18739
+ };
18740
+ onChange(dateRangeChange);
18741
+ };
18742
+ return (0,jsx_runtime_namespaceObject.jsx)(external_react_hook_form_namespaceObject.FormProvider, {
18743
+ ...useFormResult,
18744
+ children: (0,jsx_runtime_namespaceObject.jsx)(DateRangePicker, {
18745
+ name: id,
18746
+ label: title,
18747
+ disabled: disabled,
18748
+ defaultValue: [start, end],
18749
+ onChange: onDateRangeChange
18750
+ })
18751
+ });
18752
+ };
18753
+ ;// ./src/components/JsonSchemaForm/fields/index.ts
18754
+
18755
+
18756
+ const generateFields = () => {
18757
+ return {
18758
+ accordion: AccordionField,
18759
+ daterange: DateRangeField
18760
+ };
18761
+ };
18762
+ /* harmony default export */ const fields = (generateFields());
18262
18763
  ;// ./src/components/JsonSchemaForm/index.ts
18263
18764
 
18264
18765
  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)."; }
18265
18766
 
18266
18767
 
18267
18768
 
18769
+
18268
18770
  function generateTheme() {
18269
18771
  return {
18270
18772
  templates: generateTemplates(),
18271
- widgets: generateWidgets()
18773
+ widgets: generateWidgets(),
18774
+ fields: generateFields()
18272
18775
  };
18273
18776
  }
18274
18777
  const Theme = generateTheme();
@@ -18396,6 +18899,7 @@ const JsonSchemaForm_Form = /*#__PURE__*/base_default()(UnstyledForm, true ? {
18396
18899
 
18397
18900
 
18398
18901
 
18902
+
18399
18903
 
18400
18904
 
18401
18905
  ;// ./src/contexts/Translation/config.ts