@ssa-ui-kit/core 2.31.0 → 2.32.0-canary-d213a33-20251219
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/Charts/BarLineComplexChart/BarLineComplexChartView.d.ts +2 -2
- package/dist/components/Charts/BarLineComplexChart/types.d.ts +2 -2
- package/dist/components/Charts/BigNumberChart/BigNumberChart.d.ts +4 -2
- package/dist/components/Charts/BigNumberChart/components/TrendLine.d.ts +8 -3
- package/dist/components/Charts/BigNumberChart/components/TrendLineTooltip.d.ts +8 -5
- package/dist/components/Charts/GaugeChart/components/GaugeChartBase.d.ts +3 -1
- package/dist/components/Charts/PieChart/types.d.ts +1 -1
- package/dist/components/Charts/RadarChart/RadarChart.d.ts +1 -1
- package/dist/components/Charts/TreeMapChart/TreeMapChart.d.ts +1 -1
- package/dist/components/Charts/index.d.ts +1 -0
- package/dist/components/Charts/utils/nivoReact19Compat.d.ts +20 -0
- package/dist/components/Checkbox/types.d.ts +2 -2
- package/dist/components/CollapsibleNavBar/components/TriggerIcon.d.ts +4 -2
- package/dist/components/DatePicker/styles.d.ts +0 -1
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +1 -1
- package/dist/components/DateRangePicker/components/DatesListWrapper.d.ts +0 -1
- package/dist/components/DateRangePicker/components/TriggerInput.d.ts +1 -4
- package/dist/components/DateRangePicker/hooks/index.d.ts +1 -0
- package/dist/components/DateRangePicker/hooks/useDatePickerMask.d.ts +3 -9
- package/dist/components/DateRangePicker/hooks/useDateRangePicker.d.ts +21 -18
- package/dist/components/DateRangePicker/hooks/useRangeSelection.d.ts +20 -0
- package/dist/components/DateRangePicker/styles.d.ts +0 -2
- package/dist/components/DateRangePicker/types.d.ts +6 -4
- package/dist/components/DateRangePicker/useDateRangePickerContext.d.ts +2 -1
- package/dist/components/Field/FieldControl.d.ts +1 -1
- package/dist/components/Filters/FilterBlockWrapper.d.ts +0 -1
- package/dist/components/Filters/FiltersContext.d.ts +4 -4
- package/dist/components/Filters/hooks/useVisibility.d.ts +2 -2
- package/dist/components/Indicator/types.d.ts +4 -2
- package/dist/components/JsonSchemaForm/constants.d.ts +1 -0
- package/dist/components/JsonSchemaForm/index.d.ts +2 -0
- package/dist/components/JsonSchemaForm/types.d.ts +6 -0
- package/dist/components/ModalDismissButton/ModalDismissButton.d.ts +2 -2
- package/dist/components/ModalOpenButton/ModalOpenButton.d.ts +1 -1
- package/dist/components/NavBar/types.d.ts +1 -1
- package/dist/components/NotificationMenu/types.d.ts +3 -3
- package/dist/components/Pagination/WithPagination.d.ts +2 -4
- package/dist/components/PersonInfo/PersonInfoAvatar.d.ts +1 -8
- package/dist/components/PersonInfo/PersonInfoCounter.d.ts +3 -0
- package/dist/components/PersonInfo/PersonInfoValue.d.ts +1 -8
- package/dist/components/PersonInfo/helpers.d.ts +11 -0
- package/dist/components/PersonInfo/styles.d.ts +29 -14
- package/dist/components/PersonInfo/types.d.ts +31 -1
- package/dist/components/TableFilters/hooks/useTableData.d.ts +3 -3
- package/dist/components/Tooltip/SimpleChartTooltip.d.ts +2 -1
- package/dist/components/Tooltip/types.d.ts +6 -5
- package/dist/components/TooltipTrigger/TooltipTrigger.d.ts +1 -1
- package/dist/components/Typeahead/Typeahead.context.d.ts +4 -4
- package/dist/components/Typeahead/styles.d.ts +0 -1
- package/dist/components/Typeahead/useTypeahead.d.ts +4 -4
- package/dist/components/UserProfile/styles.d.ts +0 -2
- package/dist/components/UserProfile/types.d.ts +1 -1
- package/dist/components/WithLink.d.ts +1 -1
- package/dist/components/Wrapper/Wrapper.d.ts +0 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +770 -412
- package/dist/index.js.map +1 -1
- package/dist/utils/react19HocCompat.d.ts +14 -0
- package/package.json +30 -30
package/dist/index.js
CHANGED
|
@@ -248,6 +248,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
248
248
|
iconsList: () => (/* reexport */ iconsList),
|
|
249
249
|
mainTheme: () => (/* reexport */ themes_main),
|
|
250
250
|
pieChartPalettes: () => (/* reexport */ colorPalettes_namespaceObject),
|
|
251
|
+
setHocDisplayName: () => (/* reexport */ setHocDisplayName),
|
|
251
252
|
styleUtils: () => (/* reexport */ safari_focus_outline_namespaceObject),
|
|
252
253
|
styles: () => (/* reexport */ Tooltip_styles_namespaceObject),
|
|
253
254
|
useAccordionGroupContext: () => (/* reexport */ useAccordionGroupContext),
|
|
@@ -267,7 +268,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
267
268
|
useTooltip: () => (/* reexport */ useTooltip),
|
|
268
269
|
useTooltipContext: () => (/* reexport */ useTooltipContext),
|
|
269
270
|
useTranslation: () => (/* reexport */ useTranslation),
|
|
270
|
-
useTypeaheadContext: () => (/* reexport */ useTypeaheadContext)
|
|
271
|
+
useTypeaheadContext: () => (/* reexport */ useTypeaheadContext),
|
|
272
|
+
wrapNivoResponsiveComponent: () => (/* reexport */ wrapNivoResponsiveComponent)
|
|
271
273
|
});
|
|
272
274
|
|
|
273
275
|
// NAMESPACE OBJECT: ./src/styles/global.ts
|
|
@@ -1102,6 +1104,7 @@ __webpack_require__.d(Field_index_parts_namespaceObject, {
|
|
|
1102
1104
|
var JsonSchemaForm_namespaceObject = {};
|
|
1103
1105
|
__webpack_require__.r(JsonSchemaForm_namespaceObject);
|
|
1104
1106
|
__webpack_require__.d(JsonSchemaForm_namespaceObject, {
|
|
1107
|
+
DEFAULT_AVATAR_SIZE: () => (DEFAULT_AVATAR_SIZE),
|
|
1105
1108
|
Fields: () => (fields),
|
|
1106
1109
|
Form: () => (JsonSchemaForm_Form),
|
|
1107
1110
|
Templates: () => (templates),
|
|
@@ -4766,6 +4769,8 @@ const DropdownOptions = ({
|
|
|
4766
4769
|
activeItem
|
|
4767
4770
|
} = useDropdownContext();
|
|
4768
4771
|
const childrenArray = external_react_default().Children.toArray(children).filter(Boolean);
|
|
4772
|
+
|
|
4773
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4769
4774
|
const options = childrenArray.map(child => {
|
|
4770
4775
|
const isActive = activeItem?.value === child.props.value;
|
|
4771
4776
|
return /*#__PURE__*/external_react_default().cloneElement(child, {
|
|
@@ -4881,6 +4886,8 @@ const Dropdown = ({
|
|
|
4881
4886
|
}
|
|
4882
4887
|
}, [isDisabled]);
|
|
4883
4888
|
const childrenArray = external_react_default().Children.toArray(children).filter(Boolean);
|
|
4889
|
+
|
|
4890
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4884
4891
|
const items = childrenArray.map((child, index) => {
|
|
4885
4892
|
options.push(child.props);
|
|
4886
4893
|
return /*#__PURE__*/external_react_default().cloneElement(child, {
|
|
@@ -5233,7 +5240,9 @@ const Indicator = ({
|
|
|
5233
5240
|
background: background,
|
|
5234
5241
|
children: text
|
|
5235
5242
|
}) : null, /*#__PURE__*/external_react_default().cloneElement(children, {
|
|
5236
|
-
ref: ref =>
|
|
5243
|
+
ref: ref => {
|
|
5244
|
+
childrenRef.current = ref;
|
|
5245
|
+
}
|
|
5237
5246
|
})]
|
|
5238
5247
|
});
|
|
5239
5248
|
};
|
|
@@ -5852,6 +5861,8 @@ const MultipleDropdownOptions = ({
|
|
|
5852
5861
|
}
|
|
5853
5862
|
};
|
|
5854
5863
|
const childrenArray = external_react_default().Children.toArray(children).filter(Boolean);
|
|
5864
|
+
|
|
5865
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5855
5866
|
const options = childrenArray.map(child => {
|
|
5856
5867
|
const element = allItems[child.props.value];
|
|
5857
5868
|
const isActive = Boolean(element?.isSelected);
|
|
@@ -6822,6 +6833,34 @@ const getRoundedNumber = (number, roundingDigits) => Number(Number(number).toFix
|
|
|
6822
6833
|
const getFixedNumber = (number, roundingDigits) => Number(number).toFixed(roundingDigits);
|
|
6823
6834
|
;// ./src/components/Charts/PieChart/constants.ts
|
|
6824
6835
|
const TOOLTIP_HEIGHT = 30;
|
|
6836
|
+
;// ./src/components/Charts/utils/nivoReact19Compat.tsx
|
|
6837
|
+
/**
|
|
6838
|
+
* React 19 compatibility wrapper for Nivo responsive components.
|
|
6839
|
+
*
|
|
6840
|
+
* @nivo v0.99.0 works correctly with React 19 without additional wrapping.
|
|
6841
|
+
* This function simply returns the component as-is to avoid type issues.
|
|
6842
|
+
*
|
|
6843
|
+
* Previously, this function attempted to wrap components with forwardRef,
|
|
6844
|
+
* but this caused issues in production builds where the wrapped component
|
|
6845
|
+
* would be passed as an object instead of a function, resulting in:
|
|
6846
|
+
* "React.jsx: type is invalid -- expected a string or a class/function but got: object"
|
|
6847
|
+
*
|
|
6848
|
+
* By returning the component unchanged, we let the consuming application's
|
|
6849
|
+
* bundler resolve the module correctly and avoid CommonJS/ESM interop issues.
|
|
6850
|
+
*
|
|
6851
|
+
* @param Component - The Nivo responsive component (e.g., ResponsiveLine, ResponsivePie)
|
|
6852
|
+
* @param displayName - Optional display name for debugging in React DevTools
|
|
6853
|
+
* @returns The original component unchanged (with displayName set if provided)
|
|
6854
|
+
*/
|
|
6855
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6856
|
+
function wrapNivoResponsiveComponent(Component, displayName) {
|
|
6857
|
+
// Set displayName for better debugging if provided
|
|
6858
|
+
if (displayName && Component) {
|
|
6859
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6860
|
+
Component.displayName = displayName;
|
|
6861
|
+
}
|
|
6862
|
+
return Component;
|
|
6863
|
+
}
|
|
6825
6864
|
;// ./src/components/Charts/PieChart/PieChartInternal.tsx
|
|
6826
6865
|
function PieChartInternal_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)."; }
|
|
6827
6866
|
|
|
@@ -6837,6 +6876,8 @@ function PieChartInternal_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tr
|
|
|
6837
6876
|
|
|
6838
6877
|
|
|
6839
6878
|
|
|
6879
|
+
|
|
6880
|
+
const ResponsivePie = wrapNivoResponsiveComponent(pie_namespaceObject.ResponsivePie, 'ResponsivePie');
|
|
6840
6881
|
var PieChartInternal_ref = true ? {
|
|
6841
6882
|
name: "1jvc3zp",
|
|
6842
6883
|
styles: "width:95%!important;height:95%!important;top:2.5%!important;left:2.5%!important"
|
|
@@ -6965,7 +7006,7 @@ const PieChartInternal = ({
|
|
|
6965
7006
|
className: "pie-chart-wrapper",
|
|
6966
7007
|
ref: refs.setReference,
|
|
6967
7008
|
...getReferenceProps(),
|
|
6968
|
-
children: [(0,jsx_runtime_namespaceObject.jsx)(
|
|
7009
|
+
children: [(0,jsx_runtime_namespaceObject.jsx)(ResponsivePie, {
|
|
6969
7010
|
margin: {
|
|
6970
7011
|
top: internalOffset,
|
|
6971
7012
|
right: internalOffset,
|
|
@@ -8226,7 +8267,8 @@ const useTooltip = props => {
|
|
|
8226
8267
|
size = 'small',
|
|
8227
8268
|
hasArrow = true,
|
|
8228
8269
|
arrowProps = {},
|
|
8229
|
-
isOpen: isInitOpen = false
|
|
8270
|
+
isOpen: isInitOpen = false,
|
|
8271
|
+
allowHoverContent = false
|
|
8230
8272
|
} = props || {};
|
|
8231
8273
|
const [isOpen, setIsOpen] = (0,external_react_namespaceObject.useState)(isInitOpen || false);
|
|
8232
8274
|
const arrowRef = (0,external_react_namespaceObject.useRef)(null);
|
|
@@ -8244,7 +8286,8 @@ const useTooltip = props => {
|
|
|
8244
8286
|
} = floatingData;
|
|
8245
8287
|
const hover = (0,external_floating_ui_react_namespaceObject.useHover)(context, {
|
|
8246
8288
|
enabled: enableHover,
|
|
8247
|
-
move: true
|
|
8289
|
+
move: true,
|
|
8290
|
+
handleClose: allowHoverContent ? (0,external_floating_ui_react_namespaceObject.safePolygon)() : undefined
|
|
8248
8291
|
});
|
|
8249
8292
|
const click = (0,external_floating_ui_react_namespaceObject.useClick)(context, {
|
|
8250
8293
|
enabled: enableClick
|
|
@@ -10306,6 +10349,8 @@ function TreeMapChart_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried
|
|
|
10306
10349
|
|
|
10307
10350
|
|
|
10308
10351
|
|
|
10352
|
+
|
|
10353
|
+
const ResponsiveTreeMap = wrapNivoResponsiveComponent(treemap_namespaceObject.ResponsiveTreeMap, 'ResponsiveTreeMap');
|
|
10309
10354
|
var TreeMapChart_ref = true ? {
|
|
10310
10355
|
name: "1qkt16r",
|
|
10311
10356
|
styles: "position:relative;height:100%;width:100%"
|
|
@@ -10336,7 +10381,7 @@ const TreeMapChartComponent = ({
|
|
|
10336
10381
|
css: TreeMapChart_ref,
|
|
10337
10382
|
children: (0,jsx_runtime_namespaceObject.jsx)("div", {
|
|
10338
10383
|
css: TreeMapChart_ref2,
|
|
10339
|
-
children: (0,jsx_runtime_namespaceObject.jsx)(
|
|
10384
|
+
children: (0,jsx_runtime_namespaceObject.jsx)(ResponsiveTreeMap, {
|
|
10340
10385
|
borderWidth: 0,
|
|
10341
10386
|
colors: colors,
|
|
10342
10387
|
data: data,
|
|
@@ -10437,11 +10482,13 @@ const GaugeChartLayer = /*#__PURE__*/base_default()("div", true ? {
|
|
|
10437
10482
|
|
|
10438
10483
|
|
|
10439
10484
|
|
|
10485
|
+
|
|
10486
|
+
const GaugeChartBase_ResponsivePie = wrapNivoResponsiveComponent(pie_namespaceObject.ResponsivePie, 'ResponsivePie');
|
|
10440
10487
|
const GaugeChartBase = ({
|
|
10441
10488
|
...props
|
|
10442
10489
|
}) => {
|
|
10443
10490
|
const theme = (0,react_namespaceObject.useTheme)();
|
|
10444
|
-
return (0,jsx_runtime_namespaceObject.jsx)(
|
|
10491
|
+
return (0,jsx_runtime_namespaceObject.jsx)(GaugeChartBase_ResponsivePie, {
|
|
10445
10492
|
startAngle: -90,
|
|
10446
10493
|
endAngle: 90,
|
|
10447
10494
|
innerRadius: 0.8,
|
|
@@ -11033,7 +11080,7 @@ const line_namespaceObject = require("@nivo/line");
|
|
|
11033
11080
|
|
|
11034
11081
|
const TrendLineTooltipStyled = /*#__PURE__*/base_default()("div", true ? {
|
|
11035
11082
|
target: "e19yhkwp0"
|
|
11036
|
-
} : 0)("background:", ({
|
|
11083
|
+
} : 0)("white-space:nowrap;background:", ({
|
|
11037
11084
|
theme
|
|
11038
11085
|
}) => theme.colors.white, ";border:1px solid ", ({
|
|
11039
11086
|
theme
|
|
@@ -11042,6 +11089,7 @@ const TrendLineTooltipStyled = /*#__PURE__*/base_default()("div", true ? {
|
|
|
11042
11089
|
}) => theme.colors.greyDarker, ";font-weight:600;line-height:12px;font-size:10px;padding:0.5rem;" + ( true ? "" : 0));
|
|
11043
11090
|
const TrendLineTooltip = ({
|
|
11044
11091
|
point,
|
|
11092
|
+
css,
|
|
11045
11093
|
valueFormat
|
|
11046
11094
|
}) => {
|
|
11047
11095
|
const {
|
|
@@ -11052,6 +11100,7 @@ const TrendLineTooltip = ({
|
|
|
11052
11100
|
yFormatted
|
|
11053
11101
|
} = point.data;
|
|
11054
11102
|
return (0,jsx_runtime_namespaceObject.jsx)(TrendLineTooltipStyled, {
|
|
11103
|
+
css: css,
|
|
11055
11104
|
children: valueFormat?.(data) ?? `${xFormatted} - ${yFormatted}`
|
|
11056
11105
|
});
|
|
11057
11106
|
};
|
|
@@ -11061,6 +11110,8 @@ const TrendLineTooltip = ({
|
|
|
11061
11110
|
|
|
11062
11111
|
|
|
11063
11112
|
|
|
11113
|
+
|
|
11114
|
+
const ResponsiveLine = wrapNivoResponsiveComponent(line_namespaceObject.ResponsiveLine, 'ResponsiveLine');
|
|
11064
11115
|
const ActivePoint = ({
|
|
11065
11116
|
currentPoint,
|
|
11066
11117
|
lastActivePoint,
|
|
@@ -11090,7 +11141,7 @@ const TrendLine = ({
|
|
|
11090
11141
|
}) => {
|
|
11091
11142
|
const theme = (0,react_namespaceObject.useTheme)();
|
|
11092
11143
|
const _color = color ?? theme.colors.purpleDark;
|
|
11093
|
-
return (0,jsx_runtime_namespaceObject.jsx)(
|
|
11144
|
+
return (0,jsx_runtime_namespaceObject.jsx)(ResponsiveLine, {
|
|
11094
11145
|
axisBottom: null,
|
|
11095
11146
|
axisLeft: null,
|
|
11096
11147
|
axisRight: null,
|
|
@@ -11165,12 +11216,8 @@ var BigNumberChart_ref2 = true ? {
|
|
|
11165
11216
|
styles: "font-size:32px;font-weight:700"
|
|
11166
11217
|
} : 0;
|
|
11167
11218
|
var BigNumberChart_ref3 = true ? {
|
|
11168
|
-
name: "
|
|
11169
|
-
styles: "position:relative;width:100%;height:50
|
|
11170
|
-
} : 0;
|
|
11171
|
-
var BigNumberChart_ref4 = true ? {
|
|
11172
|
-
name: "19s8nj4",
|
|
11173
|
-
styles: "position:absolute;width:100%;height:100%"
|
|
11219
|
+
name: "195w1i9",
|
|
11220
|
+
styles: "position:relative;width:100%;height:50%;min-height:100px"
|
|
11174
11221
|
} : 0;
|
|
11175
11222
|
const BigNumberChartComponent = ({
|
|
11176
11223
|
data,
|
|
@@ -11182,6 +11229,11 @@ const BigNumberChartComponent = ({
|
|
|
11182
11229
|
valueFormat
|
|
11183
11230
|
}) => {
|
|
11184
11231
|
const [hoveredValue, setHoveredValue] = (0,external_react_namespaceObject.useState)(null);
|
|
11232
|
+
const {
|
|
11233
|
+
ref: chartContainerRef,
|
|
11234
|
+
width,
|
|
11235
|
+
height
|
|
11236
|
+
} = (0,hooks_namespaceObject.useElementSize)();
|
|
11185
11237
|
const lastValue = data.sort((a, b) => {
|
|
11186
11238
|
const ax = a.x ?? 0;
|
|
11187
11239
|
const bx = b.x ?? 0;
|
|
@@ -11190,9 +11242,11 @@ const BigNumberChartComponent = ({
|
|
|
11190
11242
|
const setHoveredValueThrottled = (0,hooks_namespaceObject.useThrottledCallback)(value => {
|
|
11191
11243
|
setHoveredValue(value);
|
|
11192
11244
|
}, 100);
|
|
11193
|
-
const handleMouseMove =
|
|
11245
|
+
const handleMouseMove = datum => {
|
|
11194
11246
|
if (!interactive) return;
|
|
11195
|
-
|
|
11247
|
+
if ('data' in datum) {
|
|
11248
|
+
setHoveredValueThrottled(datum.data);
|
|
11249
|
+
}
|
|
11196
11250
|
};
|
|
11197
11251
|
const value = hoveredValue ?? lastValue;
|
|
11198
11252
|
return (0,jsx_runtime_namespaceObject.jsx)(WithWidgetCard, {
|
|
@@ -11214,18 +11268,18 @@ const BigNumberChartComponent = ({
|
|
|
11214
11268
|
children: value && (valueFormat?.(value) ?? value?.y?.toString())
|
|
11215
11269
|
})
|
|
11216
11270
|
}), (0,jsx_runtime_namespaceObject.jsx)("div", {
|
|
11271
|
+
ref: chartContainerRef,
|
|
11217
11272
|
css: BigNumberChart_ref3,
|
|
11218
|
-
children: (0,jsx_runtime_namespaceObject.jsx)(
|
|
11219
|
-
|
|
11220
|
-
|
|
11221
|
-
|
|
11222
|
-
data
|
|
11223
|
-
|
|
11224
|
-
|
|
11225
|
-
|
|
11226
|
-
|
|
11227
|
-
|
|
11228
|
-
})
|
|
11273
|
+
children: width > 0 && height > 0 && (0,jsx_runtime_namespaceObject.jsx)(TrendLine, {
|
|
11274
|
+
...trendLineProps,
|
|
11275
|
+
data: [{
|
|
11276
|
+
id: 'trend-line',
|
|
11277
|
+
data
|
|
11278
|
+
}],
|
|
11279
|
+
onMouseMove: handleMouseMove,
|
|
11280
|
+
lastActivePoint: value,
|
|
11281
|
+
height: height,
|
|
11282
|
+
width: width
|
|
11229
11283
|
})
|
|
11230
11284
|
})]
|
|
11231
11285
|
})
|
|
@@ -11481,6 +11535,7 @@ const CandlestickChart = WithFullscreenMode(CandlestickChartComponent);
|
|
|
11481
11535
|
|
|
11482
11536
|
|
|
11483
11537
|
|
|
11538
|
+
|
|
11484
11539
|
;// ./src/components/Checkbox/index.ts
|
|
11485
11540
|
|
|
11486
11541
|
|
|
@@ -11908,10 +11963,12 @@ const PopoverTrigger = /*#__PURE__*/external_react_namespaceObject.forwardRef(fu
|
|
|
11908
11963
|
|
|
11909
11964
|
// `asChild` allows the user to pass any element as the anchor
|
|
11910
11965
|
if (asChild && /*#__PURE__*/external_react_namespaceObject.isValidElement(children)) {
|
|
11966
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11967
|
+
const childrenElement = children;
|
|
11911
11968
|
return /*#__PURE__*/external_react_namespaceObject.cloneElement(children, context?.getReferenceProps({
|
|
11912
11969
|
ref,
|
|
11913
11970
|
...props,
|
|
11914
|
-
...
|
|
11971
|
+
...childrenElement.props,
|
|
11915
11972
|
'data-state': context.open ? 'open' : 'closed'
|
|
11916
11973
|
}));
|
|
11917
11974
|
}
|
|
@@ -12156,14 +12213,15 @@ const TriggerIcon = ({
|
|
|
12156
12213
|
iconName,
|
|
12157
12214
|
iconSize,
|
|
12158
12215
|
className,
|
|
12159
|
-
CustomIcon
|
|
12216
|
+
CustomIcon,
|
|
12217
|
+
css: cssProp
|
|
12160
12218
|
}) => {
|
|
12161
12219
|
const theme = (0,react_namespaceObject.useTheme)();
|
|
12162
12220
|
const {
|
|
12163
12221
|
showIconTooltip
|
|
12164
12222
|
} = useCollapsibleNavBarContext();
|
|
12165
12223
|
return (0,jsx_runtime_namespaceObject.jsx)(Wrapper_Wrapper, {
|
|
12166
|
-
css: TriggerIcon_ref,
|
|
12224
|
+
css: [TriggerIcon_ref, cssProp, true ? "" : 0, true ? "" : 0],
|
|
12167
12225
|
className: "trigger-icon",
|
|
12168
12226
|
children: CustomIcon ? (0,jsx_runtime_namespaceObject.jsx)(CustomIcon, {
|
|
12169
12227
|
size: iconSize,
|
|
@@ -12191,7 +12249,6 @@ const TriggerIcon = ({
|
|
|
12191
12249
|
|
|
12192
12250
|
|
|
12193
12251
|
|
|
12194
|
-
|
|
12195
12252
|
const ItemAccordionTitle_Link = CollapsibleNavBarLink.withComponent('div', true ? {
|
|
12196
12253
|
target: "e69hc760"
|
|
12197
12254
|
} : 0);
|
|
@@ -12227,9 +12284,7 @@ const ItemAccordionTitle = ({
|
|
|
12227
12284
|
const Icon = () => (0,jsx_runtime_namespaceObject.jsx)(TriggerIcon, {
|
|
12228
12285
|
iconName: item.iconName,
|
|
12229
12286
|
iconSize: item.iconSize,
|
|
12230
|
-
css:
|
|
12231
|
-
...item.css
|
|
12232
|
-
}, true ? "" : 0, true ? "" : 0)
|
|
12287
|
+
css: item.css
|
|
12233
12288
|
});
|
|
12234
12289
|
return (0,jsx_runtime_namespaceObject.jsx)(CollapsibleNavBarItemProvider, {
|
|
12235
12290
|
isActive: isActive,
|
|
@@ -12353,7 +12408,6 @@ const Item = ({
|
|
|
12353
12408
|
|
|
12354
12409
|
|
|
12355
12410
|
|
|
12356
|
-
|
|
12357
12411
|
const ItemWithoutSubMenu_Item = ({
|
|
12358
12412
|
item,
|
|
12359
12413
|
onClick
|
|
@@ -12395,9 +12449,7 @@ const ItemWithoutSubMenu_Item = ({
|
|
|
12395
12449
|
iconName: iconName,
|
|
12396
12450
|
iconSize: iconSize,
|
|
12397
12451
|
CustomIcon: CustomIcon,
|
|
12398
|
-
css:
|
|
12399
|
-
...css
|
|
12400
|
-
}, true ? "" : 0, true ? "" : 0)
|
|
12452
|
+
css: css
|
|
12401
12453
|
});
|
|
12402
12454
|
return (0,jsx_runtime_namespaceObject.jsx)(CollapsibleNavBarItemProvider, {
|
|
12403
12455
|
isActive: isActive,
|
|
@@ -14350,54 +14402,72 @@ function PersonInfo_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have t
|
|
|
14350
14402
|
|
|
14351
14403
|
|
|
14352
14404
|
const PersonInfoBase = /*#__PURE__*/base_default()("div", true ? {
|
|
14353
|
-
target: "
|
|
14405
|
+
target: "ej2kihb15"
|
|
14354
14406
|
} : 0)( true ? {
|
|
14355
14407
|
name: "3w0yoi",
|
|
14356
14408
|
styles: "display:flex;flex-direction:column;gap:8px"
|
|
14357
14409
|
} : 0);
|
|
14358
14410
|
const PersonInfoHeader = /*#__PURE__*/base_default()("div", true ? {
|
|
14359
|
-
target: "
|
|
14411
|
+
target: "ej2kihb14"
|
|
14360
14412
|
} : 0)( true ? {
|
|
14361
14413
|
name: "1ocjxm6",
|
|
14362
14414
|
styles: "display:flex;align-items:flex-start;gap:8px"
|
|
14363
14415
|
} : 0);
|
|
14364
14416
|
const styles_IconWrapper = /*#__PURE__*/base_default()("div", true ? {
|
|
14365
|
-
target: "
|
|
14417
|
+
target: "ej2kihb13"
|
|
14366
14418
|
} : 0)( true ? {
|
|
14367
14419
|
name: "13ltyg2",
|
|
14368
14420
|
styles: "display:flex;align-items:flex-start;flex-shrink:0"
|
|
14369
14421
|
} : 0);
|
|
14370
14422
|
const styles_TitleWrapper = /*#__PURE__*/base_default()("div", true ? {
|
|
14371
|
-
target: "
|
|
14423
|
+
target: "ej2kihb12"
|
|
14372
14424
|
} : 0)( true ? {
|
|
14373
14425
|
name: "1tcizyl",
|
|
14374
14426
|
styles: "display:flex;flex-direction:column;gap:4px;flex:1"
|
|
14375
14427
|
} : 0);
|
|
14376
14428
|
const Title = /*#__PURE__*/base_default()("div", true ? {
|
|
14377
|
-
target: "
|
|
14429
|
+
target: "ej2kihb11"
|
|
14378
14430
|
} : 0)( true ? {
|
|
14379
14431
|
name: "edklr6",
|
|
14380
14432
|
styles: "font-size:14px;font-weight:600;line-height:19px"
|
|
14381
14433
|
} : 0);
|
|
14434
|
+
const Row = /*#__PURE__*/base_default()("div", true ? {
|
|
14435
|
+
target: "ej2kihb10"
|
|
14436
|
+
} : 0)( true ? {
|
|
14437
|
+
name: "1j5vobt",
|
|
14438
|
+
styles: "display:flex;align-items:center;gap:4px"
|
|
14439
|
+
} : 0);
|
|
14382
14440
|
const TextBase = /*#__PURE__*/base_default()("div", true ? {
|
|
14383
|
-
target: "
|
|
14441
|
+
target: "ej2kihb9"
|
|
14384
14442
|
} : 0)( true ? {
|
|
14385
14443
|
name: "1bzpq77",
|
|
14386
14444
|
styles: "font-size:14px;font-weight:400;line-height:19px"
|
|
14387
14445
|
} : 0);
|
|
14388
14446
|
const ValueWithCounter = /*#__PURE__*/base_default()("div", true ? {
|
|
14389
|
-
target: "
|
|
14447
|
+
target: "ej2kihb8"
|
|
14390
14448
|
} : 0)( true ? {
|
|
14391
14449
|
name: "1j5vobt",
|
|
14392
14450
|
styles: "display:flex;align-items:center;gap:4px"
|
|
14393
14451
|
} : 0);
|
|
14394
14452
|
const Counter = /*#__PURE__*/base_default()(TextBase.withComponent('span', true ? {
|
|
14395
|
-
target: "
|
|
14453
|
+
target: "ej2kihb16"
|
|
14396
14454
|
} : 0), true ? {
|
|
14397
|
-
target: "
|
|
14455
|
+
target: "ej2kihb7"
|
|
14398
14456
|
} : 0)("color:", ({
|
|
14399
14457
|
theme
|
|
14400
|
-
}) => theme.colors.greyDropdownFocused, ";margin-left:5px;" + ( true ? "" : 0));
|
|
14458
|
+
}) => theme.colors.greyDropdownFocused, ";margin-left:5px;cursor:pointer;" + ( true ? "" : 0));
|
|
14459
|
+
const CounterTooltipContent = /*#__PURE__*/base_default()("div", true ? {
|
|
14460
|
+
target: "ej2kihb6"
|
|
14461
|
+
} : 0)( true ? {
|
|
14462
|
+
name: "1oeds5o",
|
|
14463
|
+
styles: "min-width:220px;padding:12px"
|
|
14464
|
+
} : 0);
|
|
14465
|
+
const CounterTooltipList = /*#__PURE__*/base_default()("div", true ? {
|
|
14466
|
+
target: "ej2kihb5"
|
|
14467
|
+
} : 0)( true ? {
|
|
14468
|
+
name: "1acx518",
|
|
14469
|
+
styles: "display:flex;flex-direction:column;gap:8px;height:auto;max-height:220px;overflow:hidden;overflow-y:auto;padding-right:4px"
|
|
14470
|
+
} : 0);
|
|
14401
14471
|
const AttributesList = /*#__PURE__*/base_default()("div", true ? {
|
|
14402
14472
|
target: "ej2kihb4"
|
|
14403
14473
|
} : 0)( true ? {
|
|
@@ -14441,6 +14511,29 @@ const CustomBadge = /*#__PURE__*/base_default()("div", true ? {
|
|
|
14441
14511
|
} = BADGE_COLORS(theme)[colorName];
|
|
14442
14512
|
return bg;
|
|
14443
14513
|
}, ";" + ( true ? "" : 0));
|
|
14514
|
+
const personInfoValueLinkStyles = theme => ({
|
|
14515
|
+
textDecoration: 'none',
|
|
14516
|
+
color: theme.colors.greyDarker,
|
|
14517
|
+
cursor: 'pointer',
|
|
14518
|
+
transition: 'color 0.2s ease',
|
|
14519
|
+
display: 'inline-flex',
|
|
14520
|
+
alignItems: 'center',
|
|
14521
|
+
'&:hover': {
|
|
14522
|
+
color: theme.colors.blue
|
|
14523
|
+
}
|
|
14524
|
+
});
|
|
14525
|
+
const avatarWrapperLinkStyles = theme => ({
|
|
14526
|
+
textDecoration: 'none',
|
|
14527
|
+
color: theme.colors.greyDarker,
|
|
14528
|
+
cursor: 'pointer',
|
|
14529
|
+
transition: 'color 0.2s ease',
|
|
14530
|
+
'&:hover': {
|
|
14531
|
+
color: theme.colors.blue,
|
|
14532
|
+
'& > div:last-child': {
|
|
14533
|
+
color: theme.colors.blue
|
|
14534
|
+
}
|
|
14535
|
+
}
|
|
14536
|
+
});
|
|
14444
14537
|
;// ./src/components/PersonInfo/PersonInfoIcon.tsx
|
|
14445
14538
|
|
|
14446
14539
|
|
|
@@ -14465,17 +14558,25 @@ const PersonInfoIcon = ({
|
|
|
14465
14558
|
|
|
14466
14559
|
const PersonInfoValue = ({
|
|
14467
14560
|
value,
|
|
14468
|
-
counter,
|
|
14469
14561
|
css,
|
|
14470
|
-
|
|
14562
|
+
linkAttributes
|
|
14471
14563
|
}) => {
|
|
14472
|
-
|
|
14473
|
-
|
|
14474
|
-
|
|
14475
|
-
|
|
14476
|
-
|
|
14477
|
-
|
|
14478
|
-
|
|
14564
|
+
const isLink = Boolean(linkAttributes?.href);
|
|
14565
|
+
return (0,jsx_runtime_namespaceObject.jsx)(TextBase, {
|
|
14566
|
+
css: [isLink ? personInfoValueLinkStyles : undefined, css, true ? "" : 0, true ? "" : 0],
|
|
14567
|
+
...(linkAttributes ?? {}),
|
|
14568
|
+
children: value
|
|
14569
|
+
});
|
|
14570
|
+
};
|
|
14571
|
+
;// ./src/components/PersonInfo/helpers.ts
|
|
14572
|
+
const getLinkAttributes = (link, openLinkInNewTab) => {
|
|
14573
|
+
const isLink = Boolean(link);
|
|
14574
|
+
return isLink ? {
|
|
14575
|
+
as: 'a',
|
|
14576
|
+
href: link,
|
|
14577
|
+
target: openLinkInNewTab ? '_blank' : undefined,
|
|
14578
|
+
rel: openLinkInNewTab ? 'noreferrer' : undefined
|
|
14579
|
+
} : {};
|
|
14479
14580
|
};
|
|
14480
14581
|
;// ./src/components/PersonInfo/PersonInfoAvatar.tsx
|
|
14481
14582
|
|
|
@@ -14483,22 +14584,34 @@ const PersonInfoValue = ({
|
|
|
14483
14584
|
|
|
14484
14585
|
|
|
14485
14586
|
|
|
14587
|
+
|
|
14486
14588
|
const PersonInfoAvatar = ({
|
|
14487
14589
|
avatar,
|
|
14488
14590
|
value,
|
|
14489
|
-
|
|
14490
|
-
|
|
14591
|
+
styles,
|
|
14592
|
+
link,
|
|
14593
|
+
openLinkInNewTab
|
|
14491
14594
|
}) => {
|
|
14595
|
+
const hasAvatar = Boolean(avatar);
|
|
14596
|
+
const hasValue = Boolean(value);
|
|
14597
|
+
const isLink = Boolean(link);
|
|
14598
|
+
const linkAttributes = getLinkAttributes(link, openLinkInNewTab);
|
|
14599
|
+
if (!hasAvatar && !hasValue) return null;
|
|
14600
|
+
const valueNode = hasValue ? (0,jsx_runtime_namespaceObject.jsx)(PersonInfoValue, {
|
|
14601
|
+
value: value,
|
|
14602
|
+
css: hasAvatar ? styles?.avatarName : styles?.value,
|
|
14603
|
+
linkAttributes: !hasAvatar ? linkAttributes : undefined
|
|
14604
|
+
}) : null;
|
|
14605
|
+
if (!hasAvatar) {
|
|
14606
|
+
return valueNode;
|
|
14607
|
+
}
|
|
14492
14608
|
return (0,jsx_runtime_namespaceObject.jsxs)(styles_AvatarWrapper, {
|
|
14609
|
+
css: isLink ? avatarWrapperLinkStyles : undefined,
|
|
14610
|
+
...linkAttributes,
|
|
14493
14611
|
children: [(0,jsx_runtime_namespaceObject.jsx)(Avatar_Avatar, {
|
|
14494
14612
|
size: 24,
|
|
14495
14613
|
image: avatar
|
|
14496
|
-
}),
|
|
14497
|
-
value: value,
|
|
14498
|
-
counter: counter,
|
|
14499
|
-
css: styles?.avatarName,
|
|
14500
|
-
counterCss: styles?.counter
|
|
14501
|
-
})]
|
|
14614
|
+
}), valueNode]
|
|
14502
14615
|
});
|
|
14503
14616
|
};
|
|
14504
14617
|
;// ./src/components/PersonInfo/PersonInfoBadges.tsx
|
|
@@ -14535,6 +14648,100 @@ const PersonInfoBadges = ({
|
|
|
14535
14648
|
})
|
|
14536
14649
|
});
|
|
14537
14650
|
};
|
|
14651
|
+
;// ./src/components/ImageItem/ImageItem.tsx
|
|
14652
|
+
function ImageItem_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)."; }
|
|
14653
|
+
|
|
14654
|
+
|
|
14655
|
+
|
|
14656
|
+
|
|
14657
|
+
var ImageItem_ref = true ? {
|
|
14658
|
+
name: "c5ejfv",
|
|
14659
|
+
styles: "gap:8px;text-decoration:none"
|
|
14660
|
+
} : 0;
|
|
14661
|
+
const ImageItem = ({
|
|
14662
|
+
children,
|
|
14663
|
+
image,
|
|
14664
|
+
avatarSize = 24,
|
|
14665
|
+
link = '',
|
|
14666
|
+
openLinkInNewTab = false,
|
|
14667
|
+
className
|
|
14668
|
+
}) => {
|
|
14669
|
+
const theme = (0,react_namespaceObject.useTheme)();
|
|
14670
|
+
const additionalProps = link ? {
|
|
14671
|
+
href: link,
|
|
14672
|
+
target: openLinkInNewTab ? '_blank' : undefined
|
|
14673
|
+
} : {};
|
|
14674
|
+
return (0,jsx_runtime_namespaceObject.jsxs)(Wrapper_Wrapper, {
|
|
14675
|
+
css: ImageItem_ref,
|
|
14676
|
+
as: link ? 'a' : 'div',
|
|
14677
|
+
className: className,
|
|
14678
|
+
"data-testid": "image-item",
|
|
14679
|
+
...additionalProps,
|
|
14680
|
+
children: [(0,jsx_runtime_namespaceObject.jsx)(Avatar_Avatar, {
|
|
14681
|
+
size: avatarSize,
|
|
14682
|
+
image: image
|
|
14683
|
+
}), (0,jsx_runtime_namespaceObject.jsx)("span", {
|
|
14684
|
+
css: /*#__PURE__*/(0,react_namespaceObject.css)({
|
|
14685
|
+
color: theme.colors.greyDarker,
|
|
14686
|
+
fontSize: 14,
|
|
14687
|
+
fontWeight: 500,
|
|
14688
|
+
cursor: link ? 'pointer' : 'default',
|
|
14689
|
+
'&:hover': {
|
|
14690
|
+
color: link ? theme.colors.blue : theme.colors.greyDarker
|
|
14691
|
+
}
|
|
14692
|
+
}, true ? "" : 0, true ? "" : 0),
|
|
14693
|
+
children: children
|
|
14694
|
+
})]
|
|
14695
|
+
});
|
|
14696
|
+
};
|
|
14697
|
+
;// ./src/components/PersonInfo/PersonInfoCounter.tsx
|
|
14698
|
+
|
|
14699
|
+
|
|
14700
|
+
|
|
14701
|
+
|
|
14702
|
+
|
|
14703
|
+
|
|
14704
|
+
|
|
14705
|
+
const PersonInfoCounter = ({
|
|
14706
|
+
counterTooltip,
|
|
14707
|
+
css
|
|
14708
|
+
}) => {
|
|
14709
|
+
const tooltipUsers = counterTooltip?.users ?? [];
|
|
14710
|
+
const hasTooltipUsers = tooltipUsers.length > 0;
|
|
14711
|
+
const counterValue = hasTooltipUsers ? `+${tooltipUsers.length}` : null;
|
|
14712
|
+
if (!counterValue) {
|
|
14713
|
+
return null;
|
|
14714
|
+
}
|
|
14715
|
+
const tooltipBody = (0,jsx_runtime_namespaceObject.jsx)(CounterTooltipList, {
|
|
14716
|
+
"data-testid": "person-info-counter-tooltip-list",
|
|
14717
|
+
children: tooltipUsers.map(user => (0,jsx_runtime_namespaceObject.jsx)(ImageItem, {
|
|
14718
|
+
image: user.avatar,
|
|
14719
|
+
link: user.link,
|
|
14720
|
+
openLinkInNewTab: user.openLinkInNewTab,
|
|
14721
|
+
children: user.name
|
|
14722
|
+
}, user.id))
|
|
14723
|
+
});
|
|
14724
|
+
const counterNode = (0,jsx_runtime_namespaceObject.jsx)(Counter, {
|
|
14725
|
+
css: css,
|
|
14726
|
+
"data-testid": "person-info-counter",
|
|
14727
|
+
children: counterValue
|
|
14728
|
+
});
|
|
14729
|
+
return (0,jsx_runtime_namespaceObject.jsxs)(Tooltip_Tooltip, {
|
|
14730
|
+
enableHover: true,
|
|
14731
|
+
enableClick: false,
|
|
14732
|
+
allowHoverContent: true,
|
|
14733
|
+
placement: "top",
|
|
14734
|
+
size: "medium",
|
|
14735
|
+
hasArrow: true,
|
|
14736
|
+
children: [(0,jsx_runtime_namespaceObject.jsx)(TooltipTrigger_TooltipTrigger, {
|
|
14737
|
+
children: counterNode
|
|
14738
|
+
}), (0,jsx_runtime_namespaceObject.jsx)(TooltipContent_TooltipContent, {
|
|
14739
|
+
children: (0,jsx_runtime_namespaceObject.jsx)(CounterTooltipContent, {
|
|
14740
|
+
children: tooltipBody
|
|
14741
|
+
})
|
|
14742
|
+
})]
|
|
14743
|
+
});
|
|
14744
|
+
};
|
|
14538
14745
|
;// ./src/components/PersonInfo/PersonInfo.tsx
|
|
14539
14746
|
|
|
14540
14747
|
|
|
@@ -14549,11 +14756,13 @@ const PersonInfo = /*#__PURE__*/external_react_default().forwardRef(function Per
|
|
|
14549
14756
|
value,
|
|
14550
14757
|
badges,
|
|
14551
14758
|
avatar,
|
|
14552
|
-
|
|
14759
|
+
counterTooltip,
|
|
14553
14760
|
attributes,
|
|
14554
14761
|
description,
|
|
14555
14762
|
styles,
|
|
14556
14763
|
className,
|
|
14764
|
+
link,
|
|
14765
|
+
openLinkInNewTab,
|
|
14557
14766
|
...props
|
|
14558
14767
|
}, ref) {
|
|
14559
14768
|
return (0,jsx_runtime_namespaceObject.jsx)(PersonInfoBase, {
|
|
@@ -14567,16 +14776,17 @@ const PersonInfo = /*#__PURE__*/external_react_default().forwardRef(function Per
|
|
|
14567
14776
|
children: [(0,jsx_runtime_namespaceObject.jsx)(Title, {
|
|
14568
14777
|
css: styles?.title,
|
|
14569
14778
|
children: title
|
|
14570
|
-
}),
|
|
14571
|
-
|
|
14572
|
-
|
|
14573
|
-
|
|
14574
|
-
|
|
14575
|
-
|
|
14576
|
-
|
|
14577
|
-
|
|
14578
|
-
|
|
14579
|
-
|
|
14779
|
+
}), (0,jsx_runtime_namespaceObject.jsxs)(Row, {
|
|
14780
|
+
children: [(0,jsx_runtime_namespaceObject.jsx)(PersonInfoAvatar, {
|
|
14781
|
+
avatar: avatar,
|
|
14782
|
+
value: value,
|
|
14783
|
+
styles: styles,
|
|
14784
|
+
link: link,
|
|
14785
|
+
openLinkInNewTab: openLinkInNewTab
|
|
14786
|
+
}), counterTooltip && (0,jsx_runtime_namespaceObject.jsx)(PersonInfoCounter, {
|
|
14787
|
+
counterTooltip: counterTooltip,
|
|
14788
|
+
css: styles?.counter
|
|
14789
|
+
})]
|
|
14580
14790
|
}), badges && (0,jsx_runtime_namespaceObject.jsx)(PersonInfoBadges, {
|
|
14581
14791
|
badges: badges,
|
|
14582
14792
|
styles: styles
|
|
@@ -14814,8 +15024,8 @@ const styles_MonthsViewCell = /*#__PURE__*/base_default()("div", true ? {
|
|
|
14814
15024
|
const TriggerWrapper = /*#__PURE__*/base_default()(Wrapper_Wrapper, true ? {
|
|
14815
15025
|
target: "e19l41fq0"
|
|
14816
15026
|
} : 0)( true ? {
|
|
14817
|
-
name: "
|
|
14818
|
-
styles: "padding:14px"
|
|
15027
|
+
name: "1h91tay",
|
|
15028
|
+
styles: "padding:14px;cursor:default"
|
|
14819
15029
|
} : 0);
|
|
14820
15030
|
;// ./src/components/DateRangePicker/utils/dates.ts
|
|
14821
15031
|
|
|
@@ -14907,7 +15117,6 @@ const DateRangePickerContext = /*#__PURE__*/(0,external_react_namespaceObject.cr
|
|
|
14907
15117
|
nameFrom: '',
|
|
14908
15118
|
nameTo: '',
|
|
14909
15119
|
maskOptions: {},
|
|
14910
|
-
openCalendarMode: 'icon',
|
|
14911
15120
|
inputFromRef: {
|
|
14912
15121
|
current: null
|
|
14913
15122
|
},
|
|
@@ -14936,9 +15145,6 @@ const DateRangePickerContext = /*#__PURE__*/(0,external_react_namespaceObject.cr
|
|
|
14936
15145
|
day: 1
|
|
14937
15146
|
}),
|
|
14938
15147
|
currentIndex: 0,
|
|
14939
|
-
handleSetIsOpen: () => {
|
|
14940
|
-
// no-op
|
|
14941
|
-
},
|
|
14942
15148
|
handleToggleOpen: () => {
|
|
14943
15149
|
// no-op
|
|
14944
15150
|
},
|
|
@@ -14948,6 +15154,13 @@ const DateRangePickerContext = /*#__PURE__*/(0,external_react_namespaceObject.cr
|
|
|
14948
15154
|
setCalendarType: () => {
|
|
14949
15155
|
// no-op
|
|
14950
15156
|
},
|
|
15157
|
+
rangeSelectionStep: null,
|
|
15158
|
+
setRangeSelectionStep: () => {
|
|
15159
|
+
// no-op
|
|
15160
|
+
},
|
|
15161
|
+
clearInputValue: () => {
|
|
15162
|
+
// no-op
|
|
15163
|
+
},
|
|
14951
15164
|
setCalendarViewDateTime: () => {
|
|
14952
15165
|
// no-op
|
|
14953
15166
|
},
|
|
@@ -14956,7 +15169,8 @@ const DateRangePickerContext = /*#__PURE__*/(0,external_react_namespaceObject.cr
|
|
|
14956
15169
|
},
|
|
14957
15170
|
setLastFocusedElement: () => {
|
|
14958
15171
|
// no-op
|
|
14959
|
-
}
|
|
15172
|
+
},
|
|
15173
|
+
allowReverseSelection: false
|
|
14960
15174
|
});
|
|
14961
15175
|
;// ./src/components/DateRangePicker/useDateRangePickerContext.tsx
|
|
14962
15176
|
|
|
@@ -15014,6 +15228,88 @@ const useRangeHighlighting = () => {
|
|
|
15014
15228
|
hoveredDate
|
|
15015
15229
|
};
|
|
15016
15230
|
};
|
|
15231
|
+
;// ./src/components/DateRangePicker/hooks/useRangeSelection.ts
|
|
15232
|
+
|
|
15233
|
+
const useRangeSelection = ({
|
|
15234
|
+
createNewDate,
|
|
15235
|
+
getComparisonFormat
|
|
15236
|
+
}) => {
|
|
15237
|
+
const {
|
|
15238
|
+
dateTime,
|
|
15239
|
+
calendarViewDateTime,
|
|
15240
|
+
setCalendarViewDateTime,
|
|
15241
|
+
setDateTime,
|
|
15242
|
+
setIsOpen,
|
|
15243
|
+
setLastFocusedElement,
|
|
15244
|
+
rangeSelectionStep,
|
|
15245
|
+
setRangeSelectionStep,
|
|
15246
|
+
clearInputValue,
|
|
15247
|
+
allowReverseSelection = false,
|
|
15248
|
+
onChange
|
|
15249
|
+
} = useDateRangePickerContext();
|
|
15250
|
+
const handleRangeSelect = selectedValue => {
|
|
15251
|
+
const newDate = createNewDate(selectedValue);
|
|
15252
|
+
if (!newDate) return;
|
|
15253
|
+
|
|
15254
|
+
// Range selection logic
|
|
15255
|
+
const isSelectingStart = rangeSelectionStep === 'start';
|
|
15256
|
+
if (isSelectingStart) {
|
|
15257
|
+
clearInputValue('to');
|
|
15258
|
+
setLastFocusedElement('to');
|
|
15259
|
+
setRangeSelectionStep('end');
|
|
15260
|
+
}
|
|
15261
|
+
let newDateTuple = isSelectingStart ? [newDate, undefined] : [dateTime[0], newDate];
|
|
15262
|
+
setCalendarViewDateTime(isSelectingStart ? [newDate, newDate] : [dateTime[0] ? calendarViewDateTime?.[0] : newDate, newDate]);
|
|
15263
|
+
|
|
15264
|
+
// Check if dates are in reverse order
|
|
15265
|
+
const isReversed = newDateTuple[0] && newDateTuple[1] && newDateTuple[0].toMillis() > newDateTuple[1].toMillis();
|
|
15266
|
+
if (isReversed) {
|
|
15267
|
+
if (allowReverseSelection) {
|
|
15268
|
+
// Auto-swap dates when reverse selection is allowed
|
|
15269
|
+
newDateTuple = [newDateTuple[1], newDateTuple[0]];
|
|
15270
|
+
} else if (!isSelectingStart) {
|
|
15271
|
+
// User selected an earlier date - update start date
|
|
15272
|
+
newDateTuple = [newDateTuple[1], undefined];
|
|
15273
|
+
setLastFocusedElement('to');
|
|
15274
|
+
setRangeSelectionStep('end');
|
|
15275
|
+
setCalendarViewDateTime([newDateTuple[0], newDateTuple[0]]);
|
|
15276
|
+
}
|
|
15277
|
+
}
|
|
15278
|
+
setDateTime(newDateTuple);
|
|
15279
|
+
const normalizeToMidnight = dt => dt.set({
|
|
15280
|
+
hour: 0,
|
|
15281
|
+
minute: 0,
|
|
15282
|
+
second: 0,
|
|
15283
|
+
millisecond: 0
|
|
15284
|
+
}).toJSDate();
|
|
15285
|
+
|
|
15286
|
+
// Call onChange when a date is selected from calendar
|
|
15287
|
+
if (isSelectingStart && newDateTuple[0]) {
|
|
15288
|
+
// First date selected
|
|
15289
|
+
onChange?.([normalizeToMidnight(newDateTuple[0]), null]);
|
|
15290
|
+
} else if (newDateTuple[0] && newDateTuple[1] && newDateTuple[0].toMillis() <= newDateTuple[1].toMillis()) {
|
|
15291
|
+
// Both dates selected and in correct order
|
|
15292
|
+
onChange?.([normalizeToMidnight(newDateTuple[0]), normalizeToMidnight(newDateTuple[1])]);
|
|
15293
|
+
setRangeSelectionStep(null);
|
|
15294
|
+
setIsOpen(false);
|
|
15295
|
+
}
|
|
15296
|
+
};
|
|
15297
|
+
const getDateSelectionState = currentDT => {
|
|
15298
|
+
const comparisonFormat = getComparisonFormat();
|
|
15299
|
+
const isCalendarFirstDateSelected = currentDT.toFormat(comparisonFormat) === dateTime[0]?.toFormat(comparisonFormat);
|
|
15300
|
+
const isCalendarSecondDateSelected = currentDT.toFormat(comparisonFormat) === dateTime[1]?.toFormat(comparisonFormat);
|
|
15301
|
+
const isCalendarDateSelected = isCalendarFirstDateSelected || isCalendarSecondDateSelected;
|
|
15302
|
+
return {
|
|
15303
|
+
isCalendarFirstDateSelected,
|
|
15304
|
+
isCalendarSecondDateSelected,
|
|
15305
|
+
isCalendarDateSelected
|
|
15306
|
+
};
|
|
15307
|
+
};
|
|
15308
|
+
return {
|
|
15309
|
+
handleRangeSelect,
|
|
15310
|
+
getDateSelectionState
|
|
15311
|
+
};
|
|
15312
|
+
};
|
|
15017
15313
|
;// ./src/components/DateRangePicker/components/DaysView.tsx
|
|
15018
15314
|
function components_DaysView_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)."; }
|
|
15019
15315
|
|
|
@@ -15040,15 +15336,9 @@ var components_DaysView_ref3 = true ? {
|
|
|
15040
15336
|
const DaysView_DaysView = () => {
|
|
15041
15337
|
const weekDays = dates_getWeekDays();
|
|
15042
15338
|
const {
|
|
15043
|
-
dateTime,
|
|
15044
|
-
calendarViewDateTime,
|
|
15045
15339
|
dateMinDT,
|
|
15046
15340
|
dateMaxDT,
|
|
15047
|
-
|
|
15048
|
-
currentCalendarViewDT,
|
|
15049
|
-
setCalendarViewDateTime,
|
|
15050
|
-
setDateTime,
|
|
15051
|
-
setIsOpen
|
|
15341
|
+
currentCalendarViewDT
|
|
15052
15342
|
} = useDateRangePickerContext();
|
|
15053
15343
|
const currentDate = currentCalendarViewDT.toJSDate();
|
|
15054
15344
|
const currentMonth = currentDate?.getMonth();
|
|
@@ -15059,22 +15349,23 @@ const DaysView_DaysView = () => {
|
|
|
15059
15349
|
getClassNames,
|
|
15060
15350
|
isHighlightDate
|
|
15061
15351
|
} = useRangeHighlighting();
|
|
15352
|
+
const {
|
|
15353
|
+
handleRangeSelect,
|
|
15354
|
+
getDateSelectionState
|
|
15355
|
+
} = useRangeSelection({
|
|
15356
|
+
createNewDate: selectedDay => currentCalendarViewDT.set({
|
|
15357
|
+
day: Number(selectedDay)
|
|
15358
|
+
}),
|
|
15359
|
+
getComparisonFormat: () => 'D'
|
|
15360
|
+
});
|
|
15062
15361
|
const handleDaySelect = event => {
|
|
15063
15362
|
const {
|
|
15064
15363
|
target
|
|
15065
15364
|
} = event;
|
|
15066
|
-
const selectedDay =
|
|
15365
|
+
const selectedDay = target.innerHTML;
|
|
15067
15366
|
const isEnabled = target.getAttribute('aria-disabled') === 'false';
|
|
15068
15367
|
if (isEnabled) {
|
|
15069
|
-
|
|
15070
|
-
day: selectedDay
|
|
15071
|
-
});
|
|
15072
|
-
const newDateTuple = lastFocusedElement === 'from' ? [newDate, dateTime[1]] : [dateTime[0], newDate];
|
|
15073
|
-
setCalendarViewDateTime(lastFocusedElement === 'from' ? [newDate, dateTime[1] ? calendarViewDateTime?.[1] : newDate] : [dateTime[0] ? calendarViewDateTime?.[0] : newDate, newDate]);
|
|
15074
|
-
setDateTime(newDateTuple);
|
|
15075
|
-
if (newDateTuple[0] && newDateTuple[1]) {
|
|
15076
|
-
setIsOpen(false);
|
|
15077
|
-
}
|
|
15368
|
+
handleRangeSelect(selectedDay);
|
|
15078
15369
|
}
|
|
15079
15370
|
};
|
|
15080
15371
|
return (0,jsx_runtime_namespaceObject.jsxs)((external_react_default()).Fragment, {
|
|
@@ -15088,16 +15379,18 @@ const DaysView_DaysView = () => {
|
|
|
15088
15379
|
css: components_DaysView_ref3,
|
|
15089
15380
|
onClick: handleDaySelect,
|
|
15090
15381
|
children: dates.map((currentDate, index) => {
|
|
15091
|
-
const currentDT = external_luxon_namespaceObject.DateTime.fromJSDate(currentDate);
|
|
15382
|
+
const currentDT = external_luxon_namespaceObject.DateTime.fromJSDate(currentDate).startOf('day');
|
|
15092
15383
|
const calendarDate = currentDT.toFormat('D');
|
|
15093
15384
|
const calendarDay = currentDate.getDate();
|
|
15094
15385
|
const calendarMonth = currentDate.getMonth();
|
|
15095
15386
|
const ariaLabel = currentDT.toLocaleString(external_luxon_namespaceObject.DateTime.DATE_HUGE);
|
|
15096
15387
|
const isCalendarDateNow = nowDate === calendarDate;
|
|
15097
15388
|
const isCalendarMonth = currentMonth === calendarMonth;
|
|
15098
|
-
const
|
|
15099
|
-
|
|
15100
|
-
|
|
15389
|
+
const {
|
|
15390
|
+
isCalendarFirstDateSelected,
|
|
15391
|
+
isCalendarSecondDateSelected,
|
|
15392
|
+
isCalendarDateSelected
|
|
15393
|
+
} = getDateSelectionState(currentDT);
|
|
15101
15394
|
let isAriaDisabled = false;
|
|
15102
15395
|
if (dateMinDT && dateMaxDT) {
|
|
15103
15396
|
isAriaDisabled = currentDT < dateMinDT || currentDT > dateMaxDT || !isCalendarMonth;
|
|
@@ -15146,24 +15439,36 @@ var components_MonthsView_ref = true ? {
|
|
|
15146
15439
|
} : 0;
|
|
15147
15440
|
const MonthsView_MonthsView = () => {
|
|
15148
15441
|
const {
|
|
15149
|
-
dateTime,
|
|
15150
|
-
calendarViewDateTime,
|
|
15151
15442
|
dateMinDT,
|
|
15152
15443
|
dateMaxDT,
|
|
15153
15444
|
lastFocusedElement,
|
|
15154
15445
|
currentCalendarViewDT,
|
|
15446
|
+
calendarViewDateTime,
|
|
15155
15447
|
rangePickerType,
|
|
15156
15448
|
setCalendarType,
|
|
15157
15449
|
setCalendarViewDateTime,
|
|
15158
|
-
onMonthChange
|
|
15159
|
-
setDateTime,
|
|
15160
|
-
setIsOpen
|
|
15450
|
+
onMonthChange
|
|
15161
15451
|
} = useDateRangePickerContext();
|
|
15162
15452
|
const {
|
|
15163
15453
|
handleDateHover,
|
|
15164
15454
|
getClassNames,
|
|
15165
15455
|
isHighlightDate
|
|
15166
15456
|
} = useRangeHighlighting();
|
|
15457
|
+
const {
|
|
15458
|
+
handleRangeSelect,
|
|
15459
|
+
getDateSelectionState
|
|
15460
|
+
} = useRangeSelection({
|
|
15461
|
+
createNewDate: selectedMonth => {
|
|
15462
|
+
const monthNumber = constants_MONTHS.findIndex(month => month === selectedMonth);
|
|
15463
|
+
const newMonth = currentCalendarViewDT?.set({
|
|
15464
|
+
month: monthNumber + 1
|
|
15465
|
+
});
|
|
15466
|
+
return newMonth?.set({
|
|
15467
|
+
day: lastFocusedElement === 'from' ? 1 : newMonth.daysInMonth
|
|
15468
|
+
});
|
|
15469
|
+
},
|
|
15470
|
+
getComparisonFormat: () => 'yyyy-MM'
|
|
15471
|
+
});
|
|
15167
15472
|
const handleMonthSelect = event => {
|
|
15168
15473
|
const {
|
|
15169
15474
|
target
|
|
@@ -15174,29 +15479,20 @@ const MonthsView_MonthsView = () => {
|
|
|
15174
15479
|
return;
|
|
15175
15480
|
}
|
|
15176
15481
|
const selectedMonth = target.innerHTML;
|
|
15177
|
-
const monthNumber = constants_MONTHS.findIndex(month => month === selectedMonth);
|
|
15178
15482
|
if (rangePickerType === 'days') {
|
|
15483
|
+
// Navigation case: selecting month navigates to days view
|
|
15484
|
+
const monthNumber = constants_MONTHS.findIndex(month => month === selectedMonth);
|
|
15179
15485
|
const newDate = currentCalendarViewDT?.set({
|
|
15180
15486
|
month: monthNumber + 1
|
|
15181
15487
|
});
|
|
15182
|
-
setCalendarViewDateTime(lastFocusedElement === 'from' ? [newDate, calendarViewDateTime[1]] : [calendarViewDateTime[0], newDate]);
|
|
15183
15488
|
if (newDate) {
|
|
15489
|
+
setCalendarViewDateTime(lastFocusedElement === 'from' ? [newDate, calendarViewDateTime[1]] : [calendarViewDateTime[0], newDate]);
|
|
15184
15490
|
onMonthChange?.(newDate.toJSDate());
|
|
15491
|
+
setCalendarType('days');
|
|
15185
15492
|
}
|
|
15186
|
-
setCalendarType('days');
|
|
15187
15493
|
} else {
|
|
15188
|
-
|
|
15189
|
-
|
|
15190
|
-
});
|
|
15191
|
-
const newDate = newMonth?.set({
|
|
15192
|
-
day: lastFocusedElement === 'from' ? 1 : newMonth.daysInMonth
|
|
15193
|
-
});
|
|
15194
|
-
const newDateTuple = lastFocusedElement === 'from' ? [newDate, dateTime[1]] : [dateTime[0], newDate];
|
|
15195
|
-
setCalendarViewDateTime(lastFocusedElement === 'from' ? [newDate, dateTime[1] ? calendarViewDateTime?.[1] : newDate] : [dateTime[0] ? calendarViewDateTime?.[0] : newDate, newDate]);
|
|
15196
|
-
setDateTime(newDateTuple);
|
|
15197
|
-
if (newDateTuple[0] && newDateTuple[1]) {
|
|
15198
|
-
setIsOpen(false);
|
|
15199
|
-
}
|
|
15494
|
+
// Range selection case: selecting month completes the range
|
|
15495
|
+
handleRangeSelect(selectedMonth);
|
|
15200
15496
|
}
|
|
15201
15497
|
};
|
|
15202
15498
|
return (0,jsx_runtime_namespaceObject.jsx)(DatesListWrapper, {
|
|
@@ -15211,8 +15507,10 @@ const MonthsView_MonthsView = () => {
|
|
|
15211
15507
|
const isMinMonthReached = dateMinDT ? currentMonthDT.month < dateMinDT.month && currentMonthDT.year === dateMinDT.year : false;
|
|
15212
15508
|
const isMaxMonthReached = dateMaxDT ? currentMonthDT.month > dateMaxDT.month && currentMonthDT.year === dateMaxDT.year : false;
|
|
15213
15509
|
const isAriaDisabled = isMinMonthReached || isMaxMonthReached;
|
|
15214
|
-
const
|
|
15215
|
-
|
|
15510
|
+
const {
|
|
15511
|
+
isCalendarFirstDateSelected,
|
|
15512
|
+
isCalendarSecondDateSelected
|
|
15513
|
+
} = getDateSelectionState(currentMonthDT);
|
|
15216
15514
|
const classNames = getClassNames(currentMonthDT, {
|
|
15217
15515
|
isCalendarFirstDateSelected,
|
|
15218
15516
|
isCalendarSecondDateSelected
|
|
@@ -15248,7 +15546,6 @@ var components_YearsView_ref = true ? {
|
|
|
15248
15546
|
const YearsView_YearsView = () => {
|
|
15249
15547
|
const {
|
|
15250
15548
|
rangePickerType,
|
|
15251
|
-
dateTime,
|
|
15252
15549
|
calendarViewDateTime,
|
|
15253
15550
|
currentCalendarViewDT,
|
|
15254
15551
|
dateMinParts,
|
|
@@ -15257,9 +15554,7 @@ const YearsView_YearsView = () => {
|
|
|
15257
15554
|
lastFocusedElement,
|
|
15258
15555
|
setCalendarType,
|
|
15259
15556
|
setCalendarViewDateTime,
|
|
15260
|
-
onYearChange
|
|
15261
|
-
setDateTime,
|
|
15262
|
-
setIsOpen
|
|
15557
|
+
onYearChange
|
|
15263
15558
|
} = useDateRangePickerContext();
|
|
15264
15559
|
const wrapper = (0,external_react_namespaceObject.useRef)(null);
|
|
15265
15560
|
const yearsList = dates_getYearsList({
|
|
@@ -15271,6 +15566,24 @@ const YearsView_YearsView = () => {
|
|
|
15271
15566
|
getClassNames,
|
|
15272
15567
|
isHighlightDate
|
|
15273
15568
|
} = useRangeHighlighting();
|
|
15569
|
+
const {
|
|
15570
|
+
handleRangeSelect,
|
|
15571
|
+
getDateSelectionState
|
|
15572
|
+
} = useRangeSelection({
|
|
15573
|
+
createNewDate: selectedYear => {
|
|
15574
|
+
const newYear = currentCalendarViewDT?.set({
|
|
15575
|
+
year: Number(selectedYear)
|
|
15576
|
+
});
|
|
15577
|
+
return newYear?.set(lastFocusedElement === 'from' ? {
|
|
15578
|
+
day: 1,
|
|
15579
|
+
month: 1
|
|
15580
|
+
} : {
|
|
15581
|
+
day: 31,
|
|
15582
|
+
month: 12
|
|
15583
|
+
});
|
|
15584
|
+
},
|
|
15585
|
+
getComparisonFormat: () => 'yyyy'
|
|
15586
|
+
});
|
|
15274
15587
|
(0,external_react_namespaceObject.useEffect)(() => {
|
|
15275
15588
|
if (currentCalendarViewDT && wrapper.current) {
|
|
15276
15589
|
wrapper.current.querySelector('[aria-current=date]')?.scrollIntoView({
|
|
@@ -15278,15 +15591,16 @@ const YearsView_YearsView = () => {
|
|
|
15278
15591
|
block: 'center'
|
|
15279
15592
|
});
|
|
15280
15593
|
}
|
|
15281
|
-
}, [calendarViewDateTime, lastFocusedElement]);
|
|
15594
|
+
}, [calendarViewDateTime, lastFocusedElement, currentCalendarViewDT]);
|
|
15282
15595
|
const handleYearSelect = event => {
|
|
15283
15596
|
const {
|
|
15284
15597
|
target
|
|
15285
15598
|
} = event;
|
|
15286
|
-
const selectedYear =
|
|
15599
|
+
const selectedYear = target.innerHTML;
|
|
15287
15600
|
if (rangePickerType !== 'years') {
|
|
15601
|
+
// Navigation case: selecting year navigates to months view
|
|
15288
15602
|
const newDate = currentCalendarViewDT.set({
|
|
15289
|
-
year: selectedYear
|
|
15603
|
+
year: Number(selectedYear)
|
|
15290
15604
|
});
|
|
15291
15605
|
setCalendarType('months');
|
|
15292
15606
|
setCalendarViewDateTime(lastFocusedElement === 'from' ? [newDate, calendarViewDateTime[1]] : [calendarViewDateTime[0], newDate]);
|
|
@@ -15294,22 +15608,8 @@ const YearsView_YearsView = () => {
|
|
|
15294
15608
|
onYearChange?.(newDate.toJSDate());
|
|
15295
15609
|
}
|
|
15296
15610
|
} else {
|
|
15297
|
-
|
|
15298
|
-
|
|
15299
|
-
});
|
|
15300
|
-
const newDate = newYear?.set(lastFocusedElement === 'from' ? {
|
|
15301
|
-
day: 1,
|
|
15302
|
-
month: 1
|
|
15303
|
-
} : {
|
|
15304
|
-
day: 31,
|
|
15305
|
-
month: 12
|
|
15306
|
-
});
|
|
15307
|
-
const newDateTuple = lastFocusedElement === 'from' ? [newDate, dateTime[1]] : [dateTime[0], newDate];
|
|
15308
|
-
setCalendarViewDateTime(lastFocusedElement === 'from' ? [newDate, dateTime[1] ? calendarViewDateTime?.[1] : newDate] : [dateTime[0] ? calendarViewDateTime?.[0] : newDate, newDate]);
|
|
15309
|
-
setDateTime(newDateTuple);
|
|
15310
|
-
if (newDateTuple[0] && newDateTuple[1]) {
|
|
15311
|
-
setIsOpen(false);
|
|
15312
|
-
}
|
|
15611
|
+
// Range selection case: selecting year completes the range
|
|
15612
|
+
handleRangeSelect(selectedYear);
|
|
15313
15613
|
}
|
|
15314
15614
|
};
|
|
15315
15615
|
return (0,jsx_runtime_namespaceObject.jsx)(DatesListWrapper, {
|
|
@@ -15327,8 +15627,10 @@ const YearsView_YearsView = () => {
|
|
|
15327
15627
|
if (isCalendarYear) {
|
|
15328
15628
|
additionalProps['aria-current'] = 'date';
|
|
15329
15629
|
}
|
|
15330
|
-
const
|
|
15331
|
-
|
|
15630
|
+
const {
|
|
15631
|
+
isCalendarFirstDateSelected,
|
|
15632
|
+
isCalendarSecondDateSelected
|
|
15633
|
+
} = getDateSelectionState(currentYearDT);
|
|
15332
15634
|
const classNames = getClassNames(currentYearDT, {
|
|
15333
15635
|
isCalendarFirstDateSelected,
|
|
15334
15636
|
isCalendarSecondDateSelected
|
|
@@ -15668,24 +15970,9 @@ function TriggerInput_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried
|
|
|
15668
15970
|
|
|
15669
15971
|
|
|
15670
15972
|
|
|
15671
|
-
const WithTriggerPopover = ({
|
|
15672
|
-
isEnabled,
|
|
15673
|
-
children
|
|
15674
|
-
}) => {
|
|
15675
|
-
return isEnabled ? (0,jsx_runtime_namespaceObject.jsx)(PopoverTrigger, {
|
|
15676
|
-
asChild: true,
|
|
15677
|
-
children: /*#__PURE__*/external_react_default().cloneElement(children, {
|
|
15678
|
-
...children.props
|
|
15679
|
-
})
|
|
15680
|
-
}) : (/*#__PURE__*/external_react_default().cloneElement(children, {
|
|
15681
|
-
...children.props
|
|
15682
|
-
}));
|
|
15683
|
-
};
|
|
15684
15973
|
const TriggerInput = ({
|
|
15685
15974
|
datepickerType,
|
|
15686
|
-
|
|
15687
|
-
className,
|
|
15688
|
-
onClick
|
|
15975
|
+
className
|
|
15689
15976
|
}) => {
|
|
15690
15977
|
const {
|
|
15691
15978
|
format,
|
|
@@ -15698,7 +15985,9 @@ const TriggerInput = ({
|
|
|
15698
15985
|
messages,
|
|
15699
15986
|
setLastFocusedElement,
|
|
15700
15987
|
classNames,
|
|
15701
|
-
onBlur: handleBlur
|
|
15988
|
+
onBlur: handleBlur,
|
|
15989
|
+
isOpen,
|
|
15990
|
+
setIsOpen
|
|
15702
15991
|
} = useDateRangePickerContext();
|
|
15703
15992
|
const formContext = (0,external_react_hook_form_namespaceObject.useFormContext)(); // Using FormProvider from react-hook-form
|
|
15704
15993
|
const useFormResult = (0,external_react_hook_form_namespaceObject.useForm)();
|
|
@@ -15720,42 +16009,55 @@ const TriggerInput = ({
|
|
|
15720
16009
|
setLastFocusedElement(datepickerType);
|
|
15721
16010
|
inputProps?.inputProps?.onFocus?.(e);
|
|
15722
16011
|
};
|
|
15723
|
-
|
|
15724
|
-
|
|
15725
|
-
|
|
15726
|
-
|
|
15727
|
-
|
|
15728
|
-
|
|
15729
|
-
|
|
15730
|
-
|
|
15731
|
-
|
|
15732
|
-
|
|
15733
|
-
|
|
15734
|
-
|
|
15735
|
-
|
|
15736
|
-
|
|
15737
|
-
|
|
15738
|
-
onClick
|
|
15739
|
-
onFocus: handleFocus,
|
|
15740
|
-
id: inputProps?.inputProps?.id || currentName,
|
|
15741
|
-
'data-testid': `daterangepicker-input-${datepickerType}`,
|
|
15742
|
-
autoComplete: 'off',
|
|
15743
|
-
className: [/*#__PURE__*/(0,css_namespaceObject.css)( true ? {
|
|
15744
|
-
name: "15obm9d",
|
|
15745
|
-
styles: "border:none!important;height:auto!important;padding:0!important;min-width:75px;line-height:16px;max-height:16px;letter-spacing:0.8px;border-radius:0!important;&::placeholder{letter-spacing:normal;}"
|
|
15746
|
-
} : 0), datepickerType === 'from' ? classNames?.trigger?.inputFrom : classNames?.trigger?.inputTo].filter(Boolean).join(' '),
|
|
15747
|
-
...inputElementProps
|
|
16012
|
+
return (0,jsx_runtime_namespaceObject.jsx)(Input_Input, {
|
|
16013
|
+
name: currentName,
|
|
16014
|
+
placeholder: format,
|
|
16015
|
+
ref: datepickerType === 'from' ? inputFromRef : inputToRef,
|
|
16016
|
+
disabled: disabled,
|
|
16017
|
+
register: register,
|
|
16018
|
+
className: className,
|
|
16019
|
+
wrapperClassName: /*#__PURE__*/(0,css_namespaceObject.css)("display:flex;padding-left:", datepickerType === 'from' ? 0 : 14, "px;" + ( true ? "" : 0), true ? "" : 0),
|
|
16020
|
+
inputProps: {
|
|
16021
|
+
onBlur: handleBlur,
|
|
16022
|
+
onFocus: handleFocus,
|
|
16023
|
+
onClick: e => {
|
|
16024
|
+
if (isOpen) {
|
|
16025
|
+
setIsOpen(false);
|
|
16026
|
+
}
|
|
16027
|
+
inputProps?.inputProps?.onClick?.(e);
|
|
15748
16028
|
},
|
|
15749
|
-
|
|
15750
|
-
|
|
15751
|
-
|
|
15752
|
-
|
|
15753
|
-
|
|
15754
|
-
|
|
15755
|
-
|
|
15756
|
-
|
|
15757
|
-
|
|
15758
|
-
|
|
16029
|
+
onKeyDown: e => {
|
|
16030
|
+
inputProps?.inputProps?.onKeyDown?.(e);
|
|
16031
|
+
},
|
|
16032
|
+
onBeforeInput: e => {
|
|
16033
|
+
// pass-through
|
|
16034
|
+
inputProps?.inputProps?.onBeforeInput?.(e);
|
|
16035
|
+
},
|
|
16036
|
+
onInput: e => {
|
|
16037
|
+
// pass-through
|
|
16038
|
+
inputProps?.inputProps?.onInput?.(e);
|
|
16039
|
+
},
|
|
16040
|
+
onChange: e => {
|
|
16041
|
+
inputProps?.inputProps?.onChange?.(e);
|
|
16042
|
+
},
|
|
16043
|
+
id: inputProps?.inputProps?.id || currentName,
|
|
16044
|
+
'data-testid': `daterangepicker-input-${datepickerType}`,
|
|
16045
|
+
autoComplete: 'off',
|
|
16046
|
+
className: [/*#__PURE__*/(0,css_namespaceObject.css)( true ? {
|
|
16047
|
+
name: "15obm9d",
|
|
16048
|
+
styles: "border:none!important;height:auto!important;padding:0!important;min-width:75px;line-height:16px;max-height:16px;letter-spacing:0.8px;border-radius:0!important;&::placeholder{letter-spacing:normal;}"
|
|
16049
|
+
} : 0), datepickerType === 'from' ? classNames?.trigger?.inputFrom : classNames?.trigger?.inputTo].filter(Boolean).join(' '),
|
|
16050
|
+
...inputElementProps
|
|
16051
|
+
},
|
|
16052
|
+
showStatusIcon: false,
|
|
16053
|
+
errors: fieldError,
|
|
16054
|
+
status: fieldStatus,
|
|
16055
|
+
helperText: fieldStatus === 'basic' ? messages?.description : messages?.error,
|
|
16056
|
+
helperClassName: /*#__PURE__*/(0,css_namespaceObject.css)( true ? {
|
|
16057
|
+
name: "lhoo11",
|
|
16058
|
+
styles: "&>span::first-letter{text-transform:uppercase;}"
|
|
16059
|
+
} : 0),
|
|
16060
|
+
...restInputProps
|
|
15759
16061
|
});
|
|
15760
16062
|
};
|
|
15761
16063
|
;// ./src/components/Field/FieldDescription.tsx
|
|
@@ -15855,8 +16157,8 @@ function Trigger_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to st
|
|
|
15855
16157
|
|
|
15856
16158
|
|
|
15857
16159
|
var Trigger_ref = true ? {
|
|
15858
|
-
name: "
|
|
15859
|
-
styles: "margin:0 3px"
|
|
16160
|
+
name: "cx8u11",
|
|
16161
|
+
styles: "margin:0 3px;cursor:pointer"
|
|
15860
16162
|
} : 0;
|
|
15861
16163
|
const Trigger = () => {
|
|
15862
16164
|
const {
|
|
@@ -15866,7 +16168,6 @@ const Trigger = () => {
|
|
|
15866
16168
|
lastFocusedElement,
|
|
15867
16169
|
disabled,
|
|
15868
16170
|
status,
|
|
15869
|
-
openCalendarMode,
|
|
15870
16171
|
isOpen,
|
|
15871
16172
|
showCalendarIcon,
|
|
15872
16173
|
showStatusArea,
|
|
@@ -15899,49 +16200,46 @@ const Trigger = () => {
|
|
|
15899
16200
|
ref: wrapperRef,
|
|
15900
16201
|
className: classNames?.trigger?.controlsWrapper,
|
|
15901
16202
|
children: [(0,jsx_runtime_namespaceObject.jsx)(TriggerInput, {
|
|
15902
|
-
withPopover: true,
|
|
15903
16203
|
datepickerType: "from",
|
|
15904
|
-
className: classNames?.trigger?.inputFrom
|
|
15905
|
-
onClick: () => {
|
|
15906
|
-
if (!isOpen) {
|
|
15907
|
-
setIsOpen(true);
|
|
15908
|
-
}
|
|
15909
|
-
}
|
|
16204
|
+
className: classNames?.trigger?.inputFrom
|
|
15910
16205
|
}), (0,jsx_runtime_namespaceObject.jsx)(Icon_Icon, {
|
|
15911
16206
|
name: "carrot-right",
|
|
15912
16207
|
size: 16,
|
|
15913
16208
|
color: disabled ? theme.colors.grey : theme.colors.greyDarker,
|
|
15914
16209
|
className: classNames?.trigger?.arrowIcon,
|
|
16210
|
+
onClick: () => {
|
|
16211
|
+
if (isOpen) {
|
|
16212
|
+
setIsOpen(false);
|
|
16213
|
+
}
|
|
16214
|
+
},
|
|
15915
16215
|
css: Trigger_ref
|
|
15916
16216
|
}), (0,jsx_runtime_namespaceObject.jsx)(TriggerInput, {
|
|
15917
16217
|
datepickerType: "to",
|
|
15918
|
-
className: classNames?.trigger?.inputTo
|
|
15919
|
-
|
|
15920
|
-
|
|
15921
|
-
|
|
15922
|
-
|
|
15923
|
-
|
|
15924
|
-
|
|
15925
|
-
|
|
15926
|
-
|
|
15927
|
-
|
|
15928
|
-
|
|
15929
|
-
|
|
15930
|
-
|
|
15931
|
-
|
|
15932
|
-
|
|
15933
|
-
|
|
15934
|
-
|
|
15935
|
-
|
|
15936
|
-
|
|
15937
|
-
|
|
15938
|
-
|
|
15939
|
-
|
|
15940
|
-
|
|
15941
|
-
|
|
15942
|
-
|
|
15943
|
-
}
|
|
15944
|
-
}, true ? "" : 0, true ? "" : 0)
|
|
16218
|
+
className: classNames?.trigger?.inputTo
|
|
16219
|
+
}), showCalendarIcon && (0,jsx_runtime_namespaceObject.jsx)(PopoverTrigger, {
|
|
16220
|
+
asChild: true,
|
|
16221
|
+
children: (0,jsx_runtime_namespaceObject.jsx)(Button_Button, {
|
|
16222
|
+
endIcon: (0,jsx_runtime_namespaceObject.jsx)(Icon_Icon, {
|
|
16223
|
+
name: "calendar",
|
|
16224
|
+
size: 16,
|
|
16225
|
+
color: disabled ? theme.colors.grey : theme.colors.greyDarker
|
|
16226
|
+
}),
|
|
16227
|
+
"data-testid": 'daterangepicker-button',
|
|
16228
|
+
onClick: handleToggleOpen,
|
|
16229
|
+
variant: "tertiary",
|
|
16230
|
+
"aria-label": "Calendar",
|
|
16231
|
+
isDisabled: disabled,
|
|
16232
|
+
className: classNames?.trigger?.calendarIcon,
|
|
16233
|
+
css: /*#__PURE__*/(0,react_namespaceObject.css)({
|
|
16234
|
+
padding: 0,
|
|
16235
|
+
margin: '0 0 0 10px',
|
|
16236
|
+
height: 'auto',
|
|
16237
|
+
cursor: disabled ? 'default' : 'pointer',
|
|
16238
|
+
'&:focus::before': {
|
|
16239
|
+
display: 'none'
|
|
16240
|
+
}
|
|
16241
|
+
}, true ? "" : 0, true ? "" : 0)
|
|
16242
|
+
})
|
|
15945
16243
|
})]
|
|
15946
16244
|
})
|
|
15947
16245
|
}), showStatusArea && (0,jsx_runtime_namespaceObject.jsx)(TriggerStatusArea, {})]
|
|
@@ -15966,12 +16264,8 @@ const Content_DatePickerContent = () => {
|
|
|
15966
16264
|
};
|
|
15967
16265
|
;// ./src/components/DateRangePicker/hooks/useDatePickerMask.tsx
|
|
15968
16266
|
|
|
15969
|
-
|
|
15970
16267
|
const useDatePickerMask_useDatePickerMask = ({
|
|
15971
|
-
maskOptions
|
|
15972
|
-
formatIndexes,
|
|
15973
|
-
dateMinParts,
|
|
15974
|
-
dateMaxParts
|
|
16268
|
+
maskOptions
|
|
15975
16269
|
}) => {
|
|
15976
16270
|
const {
|
|
15977
16271
|
mask,
|
|
@@ -15984,28 +16278,13 @@ const useDatePickerMask_useDatePickerMask = ({
|
|
|
15984
16278
|
mask,
|
|
15985
16279
|
replacement,
|
|
15986
16280
|
track: ({
|
|
15987
|
-
data
|
|
15988
|
-
selectionStart,
|
|
15989
|
-
selectionEnd,
|
|
15990
|
-
value: currentValue
|
|
16281
|
+
data
|
|
15991
16282
|
}) => {
|
|
15992
|
-
|
|
15993
|
-
|
|
15994
|
-
|
|
15995
|
-
|
|
15996
|
-
|
|
15997
|
-
replacement
|
|
15998
|
-
});
|
|
15999
|
-
const splittedValue = updatedValue.split('/');
|
|
16000
|
-
const isChecked = dates_processDate({
|
|
16001
|
-
day: splittedValue[formatIndexes['day']],
|
|
16002
|
-
month: splittedValue[formatIndexes['month']],
|
|
16003
|
-
year: splittedValue[formatIndexes['year']]
|
|
16004
|
-
}, dateMinParts[formatIndexes['year']], dateMaxParts[formatIndexes['year']]);
|
|
16005
|
-
return isChecked ? data : '';
|
|
16006
|
-
} else {
|
|
16007
|
-
return data;
|
|
16008
|
-
}
|
|
16283
|
+
// The mask should only format input, not validate it
|
|
16284
|
+
// Validation happens on blur in useDateRangePicker.handleBlur
|
|
16285
|
+
// This allows users to freely type and edit dates without blocking
|
|
16286
|
+
// Return data as-is (string for insertions, null/undefined for deletions)
|
|
16287
|
+
return data;
|
|
16009
16288
|
},
|
|
16010
16289
|
...restMaskOptions
|
|
16011
16290
|
});
|
|
@@ -16047,15 +16326,12 @@ const useDateRangePicker = ({
|
|
|
16047
16326
|
const [isOpen, setIsOpen] = (0,external_react_namespaceObject.useState)(isOpenState);
|
|
16048
16327
|
const [status, setStatus] = (0,external_react_namespaceObject.useState)(rest.status);
|
|
16049
16328
|
const previousOpenState = (0,external_react_namespaceObject.useRef)(isOpenState);
|
|
16050
|
-
const
|
|
16051
|
-
|
|
16052
|
-
};
|
|
16329
|
+
const previousDateTime = (0,external_react_namespaceObject.useRef)([undefined, undefined]);
|
|
16330
|
+
const defaultValueProcessed = (0,external_react_namespaceObject.useRef)(false);
|
|
16053
16331
|
const {
|
|
16054
16332
|
clearErrors,
|
|
16055
16333
|
setError,
|
|
16056
|
-
setValue
|
|
16057
|
-
resetField,
|
|
16058
|
-
setFocus
|
|
16334
|
+
setValue
|
|
16059
16335
|
} = (0,external_react_hook_form_namespaceObject.useFormContext)();
|
|
16060
16336
|
const nameFrom = `${_name}From`;
|
|
16061
16337
|
const nameTo = `${_name}To`;
|
|
@@ -16069,7 +16345,6 @@ const useDateRangePicker = ({
|
|
|
16069
16345
|
const [lastChangedDate, setLastChangedDate] = (0,external_react_namespaceObject.useState)([undefined, undefined]);
|
|
16070
16346
|
const [lastFocusedElement, setLastFocusedElement] = (0,external_react_namespaceObject.useState)('from');
|
|
16071
16347
|
const currentIndex = lastFocusedElement === 'from' ? 0 : 1;
|
|
16072
|
-
const currentName = lastFocusedElement === 'from' ? nameFrom : nameTo;
|
|
16073
16348
|
const [dateTimeForChangeEvent, setDateTimeForChangeEvent] = (0,external_react_namespaceObject.useState)(undefined);
|
|
16074
16349
|
const [currentError, setCurrentError] = (0,external_react_namespaceObject.useState)({
|
|
16075
16350
|
date: null,
|
|
@@ -16082,6 +16357,7 @@ const useDateRangePicker = ({
|
|
|
16082
16357
|
year: splittedFormat.findIndex(item => item === 'yyyy')
|
|
16083
16358
|
});
|
|
16084
16359
|
const [calendarType, setCalendarType] = (0,external_react_namespaceObject.useState)(rangePickerType);
|
|
16360
|
+
const [rangeSelectionStep, setRangeSelectionStep] = (0,external_react_namespaceObject.useState)(null);
|
|
16085
16361
|
const [calendarViewDateTime, setCalendarViewDateTime] = (0,external_react_namespaceObject.useState)([undefined, undefined]);
|
|
16086
16362
|
const currentCalendarViewDT = calendarViewDateTime[currentIndex] || external_luxon_namespaceObject.DateTime.now().set({
|
|
16087
16363
|
day: 1
|
|
@@ -16091,14 +16367,18 @@ const useDateRangePicker = ({
|
|
|
16091
16367
|
const dateMinParts = finalDateMin.split('/').map(Number);
|
|
16092
16368
|
const dateMaxParts = finalDateMax.split('/').map(Number);
|
|
16093
16369
|
const defaultMask = getMaskForFormat(format);
|
|
16094
|
-
|
|
16370
|
+
// separate mask refs per input to prevent focus/typing conflicts
|
|
16371
|
+
const maskInputRefFrom = useDatePickerMask_useDatePickerMask({
|
|
16095
16372
|
maskOptions: {
|
|
16096
16373
|
mask: defaultMask,
|
|
16097
|
-
...maskOptions
|
|
16098
|
-
}
|
|
16099
|
-
|
|
16100
|
-
|
|
16101
|
-
|
|
16374
|
+
...(maskOptions || {})
|
|
16375
|
+
}
|
|
16376
|
+
});
|
|
16377
|
+
const maskInputRefTo = useDatePickerMask_useDatePickerMask({
|
|
16378
|
+
maskOptions: {
|
|
16379
|
+
mask: defaultMask,
|
|
16380
|
+
...(maskOptions || {})
|
|
16381
|
+
}
|
|
16102
16382
|
});
|
|
16103
16383
|
const dateMaxDT = external_luxon_namespaceObject.DateTime.fromObject({
|
|
16104
16384
|
year: dateMaxParts[formatIndexes['year']],
|
|
@@ -16152,7 +16432,7 @@ const useDateRangePicker = ({
|
|
|
16152
16432
|
setError(currentName, {
|
|
16153
16433
|
message: errorMessage
|
|
16154
16434
|
}, {
|
|
16155
|
-
shouldFocus:
|
|
16435
|
+
shouldFocus: false
|
|
16156
16436
|
});
|
|
16157
16437
|
setStatus('error');
|
|
16158
16438
|
setDateTime(newDateTimeIfInvalid);
|
|
@@ -16164,7 +16444,7 @@ const useDateRangePicker = ({
|
|
|
16164
16444
|
setError(currentName, {
|
|
16165
16445
|
message: errorMessage
|
|
16166
16446
|
}, {
|
|
16167
|
-
shouldFocus:
|
|
16447
|
+
shouldFocus: false
|
|
16168
16448
|
});
|
|
16169
16449
|
setStatus('error');
|
|
16170
16450
|
setDateTime(newDateTimeIfInvalid);
|
|
@@ -16172,6 +16452,33 @@ const useDateRangePicker = ({
|
|
|
16172
16452
|
safeOnChange();
|
|
16173
16453
|
} else {
|
|
16174
16454
|
setDateTime(newDateTimeIfValid);
|
|
16455
|
+
// Update calendar view to reflect the manually entered date
|
|
16456
|
+
let adjustedDateTime = newDateTime.startOf('day');
|
|
16457
|
+
if (adjustedDateTime < dateMinDT) {
|
|
16458
|
+
const {
|
|
16459
|
+
year,
|
|
16460
|
+
month,
|
|
16461
|
+
day
|
|
16462
|
+
} = dateMinDT;
|
|
16463
|
+
adjustedDateTime = adjustedDateTime.set({
|
|
16464
|
+
year,
|
|
16465
|
+
month,
|
|
16466
|
+
day
|
|
16467
|
+
});
|
|
16468
|
+
}
|
|
16469
|
+
if (adjustedDateTime > dateMaxDT) {
|
|
16470
|
+
const {
|
|
16471
|
+
year,
|
|
16472
|
+
month,
|
|
16473
|
+
day
|
|
16474
|
+
} = dateMaxDT;
|
|
16475
|
+
adjustedDateTime = adjustedDateTime.set({
|
|
16476
|
+
year,
|
|
16477
|
+
month,
|
|
16478
|
+
day
|
|
16479
|
+
});
|
|
16480
|
+
}
|
|
16481
|
+
setCalendarViewDateTime(currentElementType === 'from' ? [adjustedDateTime, calendarViewDateTime[1] || adjustedDateTime] : [calendarViewDateTime[0] || adjustedDateTime, adjustedDateTime]);
|
|
16175
16482
|
clearErrors();
|
|
16176
16483
|
setStatus('basic');
|
|
16177
16484
|
safeOnError?.(null);
|
|
@@ -16180,26 +16487,35 @@ const useDateRangePicker = ({
|
|
|
16180
16487
|
}
|
|
16181
16488
|
};
|
|
16182
16489
|
const handleBlur = event => {
|
|
16183
|
-
event.preventDefault();
|
|
16184
16490
|
const blurredValue = event.currentTarget.value;
|
|
16491
|
+
const fieldName = event.currentTarget.name;
|
|
16492
|
+
const isFromField = fieldName === nameFrom;
|
|
16185
16493
|
if (blurredValue.length > 0) {
|
|
16186
|
-
processValue(blurredValue);
|
|
16494
|
+
processValue(blurredValue, isFromField ? 'from' : 'to');
|
|
16495
|
+
} else {
|
|
16496
|
+
// User cleared the field - clear the corresponding dateTime
|
|
16497
|
+
setDateTime(prev => isFromField ? [undefined, prev[1]] : [prev[0], undefined]);
|
|
16498
|
+
setLastChangedDate(prev => isFromField ? [undefined, prev[1]] : [prev[0], undefined]);
|
|
16499
|
+
setValue(fieldName, undefined);
|
|
16500
|
+
clearErrors(fieldName);
|
|
16187
16501
|
}
|
|
16188
16502
|
};
|
|
16189
16503
|
const processInputValue = (inputValue, elementName) => {
|
|
16190
16504
|
const currentElementType = elementName || lastFocusedElement;
|
|
16191
16505
|
const currentName = currentElementType === 'from' ? nameFrom : nameTo;
|
|
16506
|
+
const currentWatchedValue = currentElementType === 'from' ? inputValueFrom : inputValueTo;
|
|
16192
16507
|
if (typeof inputValue === 'string' && inputValue.length && inputValue.length < expectedDateLength) {
|
|
16193
16508
|
setIsOpen(false);
|
|
16194
|
-
setTimeout(() => {
|
|
16195
|
-
maskInputRef.current.focus();
|
|
16196
|
-
}, 10);
|
|
16197
16509
|
}
|
|
16198
16510
|
let newDateTime;
|
|
16199
16511
|
if (typeof inputValue === 'string' && inputValue.length === expectedDateLength) {
|
|
16200
16512
|
newDateTime = external_luxon_namespaceObject.DateTime.fromFormat(inputValue, luxonFormat);
|
|
16201
|
-
setValue
|
|
16202
|
-
|
|
16513
|
+
// Avoid redundant setValue to prevent React Hook Form update loops
|
|
16514
|
+
if (currentWatchedValue !== inputValue) {
|
|
16515
|
+
setValue(currentName, inputValue);
|
|
16516
|
+
}
|
|
16517
|
+
// Do NOT validate immediately here to avoid blocking mid-edit scenarios and feedback loops.
|
|
16518
|
+
// Validation will happen on blur explicitly.
|
|
16203
16519
|
}
|
|
16204
16520
|
const newCalendarViewDateTime = newDateTime && newDateTime.isValid ? newDateTime : undefined;
|
|
16205
16521
|
if (newCalendarViewDateTime) {
|
|
@@ -16247,56 +16563,95 @@ const useDateRangePicker = ({
|
|
|
16247
16563
|
}
|
|
16248
16564
|
}, [inputValueTo]);
|
|
16249
16565
|
(0,external_react_namespaceObject.useEffect)(() => {
|
|
16250
|
-
|
|
16251
|
-
|
|
16252
|
-
|
|
16253
|
-
|
|
16254
|
-
|
|
16255
|
-
|
|
16566
|
+
// Only sync when dateTime actually changes (from calendar selection or programmatic change)
|
|
16567
|
+
// Don't sync when only inputValue changes (user typing)
|
|
16568
|
+
const dateTimeChanged = previousDateTime.current[0]?.toMillis() !== dateTime[0]?.toMillis() || previousDateTime.current[1]?.toMillis() !== dateTime[1]?.toMillis();
|
|
16569
|
+
|
|
16570
|
+
// Initialize on first run
|
|
16571
|
+
if (previousDateTime.current[0] === undefined && previousDateTime.current[1] === undefined && (dateTime[0] !== undefined || dateTime[1] !== undefined)) {
|
|
16572
|
+
previousDateTime.current = [dateTime[0], dateTime[1]];
|
|
16573
|
+
// Continue to sync on initialization
|
|
16574
|
+
} else if (!dateTimeChanged) {
|
|
16575
|
+
// dateTime hasn't changed, don't sync (user is typing)
|
|
16576
|
+
return;
|
|
16577
|
+
} else {
|
|
16578
|
+
// Update previous dateTime
|
|
16579
|
+
previousDateTime.current = [dateTime[0], dateTime[1]];
|
|
16580
|
+
}
|
|
16581
|
+
const nextFromValue = dateTime[0]?.toFormat(luxonFormat);
|
|
16582
|
+
if (nextFromValue) {
|
|
16583
|
+
// Sync dateTime to form when dateTime changed (calendar selection)
|
|
16584
|
+
// Don't overwrite if user is actively typing (input is focused and partial)
|
|
16585
|
+
const isInputFocused = inputFromRef.current && document.activeElement === inputFromRef.current || inputToRef.current && document.activeElement === inputToRef.current;
|
|
16586
|
+
if (!inputValueFrom) {
|
|
16587
|
+
// Input is empty - sync from dateTime
|
|
16588
|
+
setValue(nameFrom, nextFromValue);
|
|
16589
|
+
} else if (inputValueFrom === nextFromValue) {
|
|
16590
|
+
// Already in sync - no action needed
|
|
16591
|
+
} else if (inputValueFrom.length < expectedDateLength && isInputFocused) {
|
|
16592
|
+
// User is actively typing partial input - don't overwrite
|
|
16593
|
+
} else {
|
|
16594
|
+
// dateTime changed (calendar selection) - sync to form
|
|
16595
|
+
setValue(nameFrom, nextFromValue);
|
|
16596
|
+
}
|
|
16597
|
+
}
|
|
16598
|
+
const nextToValue = dateTime[1]?.toFormat(luxonFormat);
|
|
16599
|
+
if (nextToValue) {
|
|
16600
|
+
// Sync dateTime to form when dateTime changed (calendar selection)
|
|
16601
|
+
// Don't overwrite if user is actively typing (input is focused and partial)
|
|
16602
|
+
const isInputFocused = inputFromRef.current && document.activeElement === inputFromRef.current || inputToRef.current && document.activeElement === inputToRef.current;
|
|
16603
|
+
if (!inputValueTo) {
|
|
16604
|
+
// Input is empty - sync from dateTime
|
|
16605
|
+
setValue(nameTo, nextToValue);
|
|
16606
|
+
} else if (inputValueTo === nextToValue) {
|
|
16607
|
+
// Already in sync - no action needed
|
|
16608
|
+
} else if (inputValueTo.length < expectedDateLength && isInputFocused) {
|
|
16609
|
+
// User is actively typing partial input - don't overwrite
|
|
16610
|
+
} else {
|
|
16611
|
+
// dateTime changed (calendar selection) - sync to form
|
|
16612
|
+
setValue(nameTo, nextToValue);
|
|
16256
16613
|
}
|
|
16257
16614
|
}
|
|
16258
|
-
}, [dateTime,
|
|
16615
|
+
}, [dateTime, inputValueFrom, inputValueTo, luxonFormat, nameFrom, nameTo, setValue, expectedDateLength, inputFromRef, inputToRef]);
|
|
16259
16616
|
(0,external_react_namespaceObject.useEffect)(() => {
|
|
16260
16617
|
if (dateTime[0] && dateTime[1] && dateTime[0] > dateTime[1]) {
|
|
16618
|
+
// When dates are in reverse order, swap them silently
|
|
16619
|
+
// Calendar only opens via user click on icon button, not automatically
|
|
16261
16620
|
if (lastFocusedElement === 'from') {
|
|
16262
|
-
resetField(nameTo);
|
|
16263
16621
|
setDateTime([dateTime[0], undefined]);
|
|
16264
16622
|
setLastChangedDate([dateTime[0].toJSDate(), undefined]);
|
|
16265
16623
|
setValue(nameTo, undefined);
|
|
16266
|
-
setLastFocusedElement('to');
|
|
16267
|
-
setTimeout(() => {
|
|
16268
|
-
setFocus(nameTo, {
|
|
16269
|
-
shouldSelect: true
|
|
16270
|
-
});
|
|
16271
|
-
}, 50);
|
|
16272
|
-
setIsOpen(true);
|
|
16273
16624
|
} else {
|
|
16274
|
-
resetField(nameFrom);
|
|
16275
16625
|
setDateTime([undefined, dateTime[1]]);
|
|
16276
16626
|
setLastChangedDate([undefined, dateTime[1].toJSDate()]);
|
|
16277
16627
|
setValue(nameFrom, undefined);
|
|
16278
|
-
setLastFocusedElement('from');
|
|
16279
|
-
setTimeout(() => {
|
|
16280
|
-
setFocus(nameFrom, {
|
|
16281
|
-
shouldSelect: true
|
|
16282
|
-
});
|
|
16283
|
-
}, 50);
|
|
16284
|
-
setIsOpen(true);
|
|
16285
16628
|
}
|
|
16286
16629
|
}
|
|
16287
|
-
}, [dateTime]);
|
|
16630
|
+
}, [dateTime, lastFocusedElement, nameFrom, nameTo, setValue]);
|
|
16288
16631
|
(0,external_react_namespaceObject.useEffect)(() => {
|
|
16289
16632
|
if (previousOpenState.current !== isOpen) {
|
|
16290
16633
|
if (isOpen) {
|
|
16291
16634
|
onOpen?.();
|
|
16635
|
+
setRangeSelectionStep('start');
|
|
16636
|
+
setLastFocusedElement('from');
|
|
16637
|
+
// Sync calendar view with current dateTime when opening
|
|
16638
|
+
// This ensures preselected dates are visible in the calendar
|
|
16639
|
+
if (dateTime[0] || dateTime[1]) {
|
|
16640
|
+
setCalendarViewDateTime([dateTime[0] || dateTime[1] || external_luxon_namespaceObject.DateTime.now().set({
|
|
16641
|
+
day: 1
|
|
16642
|
+
}), dateTime[1] || dateTime[0] || external_luxon_namespaceObject.DateTime.now().set({
|
|
16643
|
+
day: 1
|
|
16644
|
+
})]);
|
|
16645
|
+
}
|
|
16292
16646
|
} else {
|
|
16293
16647
|
onClose?.();
|
|
16648
|
+
setRangeSelectionStep(null);
|
|
16294
16649
|
setCalendarType(rangePickerType);
|
|
16295
16650
|
setCalendarViewDateTime([dateTime[0], dateTime[1]]);
|
|
16296
16651
|
}
|
|
16297
16652
|
previousOpenState.current = isOpen;
|
|
16298
16653
|
}
|
|
16299
|
-
}, [isOpen]);
|
|
16654
|
+
}, [isOpen, dateTime, rangePickerType, onOpen, onClose]);
|
|
16300
16655
|
(0,external_react_namespaceObject.useEffect)(() => {
|
|
16301
16656
|
const splittedFormat = format.split('/');
|
|
16302
16657
|
setFormatIndexes({
|
|
@@ -16323,27 +16678,18 @@ const useDateRangePicker = ({
|
|
|
16323
16678
|
if (Array.isArray(rest.value)) {
|
|
16324
16679
|
const newDateTimeFrom = typeof rest.value[0] === 'string' && rest.value[0].length === expectedDateLength ? external_luxon_namespaceObject.DateTime.fromFormat(rest.value[0], luxonFormat) : undefined;
|
|
16325
16680
|
const newDateTimeTo = typeof rest.value[1] === 'string' && rest.value[1].length === expectedDateLength ? external_luxon_namespaceObject.DateTime.fromFormat(rest.value[1], luxonFormat) : undefined;
|
|
16326
|
-
const newDateTime = [newDateTimeFrom?.isValid ? newDateTimeFrom : undefined, newDateTimeTo?.isValid ? newDateTimeTo : undefined];
|
|
16681
|
+
const newDateTime = [newDateTimeFrom?.isValid ? newDateTimeFrom.startOf('day') : undefined, newDateTimeTo?.isValid ? newDateTimeTo.startOf('day') : undefined];
|
|
16327
16682
|
setDateTime(newDateTime);
|
|
16328
16683
|
setLastChangedDate([newDateTime[0]?.toJSDate(), newDateTime[1]?.toJSDate()]);
|
|
16684
|
+
// Sync calendar view with the new dates so they're visible when calendar opens
|
|
16685
|
+
setCalendarViewDateTime([newDateTime[0] || newDateTime[1] || undefined, newDateTime[1] || newDateTime[0] || undefined]);
|
|
16329
16686
|
setValue(nameFrom, newDateTime[0]?.toFormat(luxonFormat));
|
|
16330
16687
|
setValue(nameTo, newDateTime[1]?.toFormat(luxonFormat));
|
|
16331
16688
|
}
|
|
16332
|
-
}, [rest.value]);
|
|
16689
|
+
}, [rest.value, expectedDateLength, luxonFormat, nameFrom, nameTo, setValue, _name]);
|
|
16333
16690
|
(0,external_react_namespaceObject.useEffect)(() => {
|
|
16334
16691
|
setStatus(rest.status);
|
|
16335
16692
|
}, [rest.status]);
|
|
16336
|
-
(0,external_react_namespaceObject.useEffect)(() => {
|
|
16337
|
-
if (lastChangedDate[0] || lastChangedDate[1]) {
|
|
16338
|
-
if (lastFocusedElement === 'from' && !lastChangedDate[1]) {
|
|
16339
|
-
setFocus(nameTo);
|
|
16340
|
-
}
|
|
16341
|
-
if (lastFocusedElement === 'to' && !lastChangedDate[0]) {
|
|
16342
|
-
setFocus(nameFrom);
|
|
16343
|
-
inputFromRef.current?.focus();
|
|
16344
|
-
}
|
|
16345
|
-
}
|
|
16346
|
-
}, [lastChangedDate]);
|
|
16347
16693
|
(0,external_react_namespaceObject.useEffect)(() => {
|
|
16348
16694
|
if (calendarViewDateTime[0] && !calendarViewDateTime[1]) {
|
|
16349
16695
|
setCalendarViewDateTime([calendarViewDateTime[0], calendarViewDateTime[0]]);
|
|
@@ -16358,11 +16704,20 @@ const useDateRangePicker = ({
|
|
|
16358
16704
|
}
|
|
16359
16705
|
}, [isOpenState]);
|
|
16360
16706
|
(0,external_react_namespaceObject.useEffect)(() => {
|
|
16361
|
-
|
|
16362
|
-
|
|
16363
|
-
|
|
16707
|
+
// Only process defaultValue once on mount to avoid re-processing
|
|
16708
|
+
if (Array.isArray(defaultValue) && !defaultValueProcessed.current) {
|
|
16709
|
+
const defaultDateTimeFrom = typeof defaultValue[0] === 'string' && defaultValue[0].length === expectedDateLength ? external_luxon_namespaceObject.DateTime.fromFormat(defaultValue[0], luxonFormat) : undefined;
|
|
16710
|
+
const defaultDateTimeTo = typeof defaultValue[1] === 'string' && defaultValue[1].length === expectedDateLength ? external_luxon_namespaceObject.DateTime.fromFormat(defaultValue[1], luxonFormat) : undefined;
|
|
16711
|
+
const newDateTime = [defaultDateTimeFrom?.isValid ? defaultDateTimeFrom.startOf('day') : undefined, defaultDateTimeTo?.isValid ? defaultDateTimeTo.startOf('day') : undefined];
|
|
16712
|
+
setDateTime(newDateTime);
|
|
16713
|
+
setLastChangedDate([newDateTime[0]?.toJSDate(), newDateTime[1]?.toJSDate()]);
|
|
16714
|
+
// Sync calendar view with default dates so they're visible when calendar opens
|
|
16715
|
+
setCalendarViewDateTime([newDateTime[0] || newDateTime[1] || undefined, newDateTime[1] || newDateTime[0] || undefined]);
|
|
16716
|
+
setValue(nameFrom, newDateTime[0]?.toFormat(luxonFormat));
|
|
16717
|
+
setValue(nameTo, newDateTime[1]?.toFormat(luxonFormat));
|
|
16718
|
+
defaultValueProcessed.current = true;
|
|
16364
16719
|
}
|
|
16365
|
-
}, []);
|
|
16720
|
+
}, [defaultValue, expectedDateLength, luxonFormat, nameFrom, nameTo, setCalendarViewDateTime, setValue, _name]);
|
|
16366
16721
|
return {
|
|
16367
16722
|
formatIndexes,
|
|
16368
16723
|
dateMinParts,
|
|
@@ -16373,7 +16728,6 @@ const useDateRangePicker = ({
|
|
|
16373
16728
|
inputValueFrom,
|
|
16374
16729
|
inputValueTo,
|
|
16375
16730
|
calendarViewDateTime,
|
|
16376
|
-
maskInputRef,
|
|
16377
16731
|
calendarType,
|
|
16378
16732
|
lastChangedDate,
|
|
16379
16733
|
luxonFormat,
|
|
@@ -16384,16 +16738,24 @@ const useDateRangePicker = ({
|
|
|
16384
16738
|
currentCalendarViewDT,
|
|
16385
16739
|
isOpen,
|
|
16386
16740
|
status,
|
|
16387
|
-
inputFromRef: (0,external_floating_ui_react_namespaceObject.useMergeRefs)([
|
|
16388
|
-
inputToRef: (0,external_floating_ui_react_namespaceObject.useMergeRefs)([
|
|
16741
|
+
inputFromRef: (0,external_floating_ui_react_namespaceObject.useMergeRefs)([maskInputRefFrom, inputFromRef]),
|
|
16742
|
+
inputToRef: (0,external_floating_ui_react_namespaceObject.useMergeRefs)([maskInputRefTo, inputToRef]),
|
|
16389
16743
|
setIsOpen,
|
|
16390
|
-
handleSetIsOpen,
|
|
16391
16744
|
setLastFocusedElement,
|
|
16392
16745
|
safeOnChange,
|
|
16393
16746
|
setCalendarType,
|
|
16394
16747
|
setCalendarViewDateTime,
|
|
16395
16748
|
setDateTime,
|
|
16396
|
-
handleBlur
|
|
16749
|
+
handleBlur,
|
|
16750
|
+
rangeSelectionStep,
|
|
16751
|
+
setRangeSelectionStep,
|
|
16752
|
+
clearInputValue: field => {
|
|
16753
|
+
const targetName = field === 'from' ? nameFrom : nameTo;
|
|
16754
|
+
clearErrors(targetName);
|
|
16755
|
+
setValue(targetName, undefined);
|
|
16756
|
+
setDateTime(prev => field === 'from' ? [undefined, prev[1]] : [prev[0], undefined]);
|
|
16757
|
+
setLastChangedDate(prev => field === 'from' ? [undefined, prev[1]] : [prev[0], undefined]);
|
|
16758
|
+
}
|
|
16397
16759
|
};
|
|
16398
16760
|
};
|
|
16399
16761
|
;// ./src/components/DateRangePicker/DateRangePickerProvider.tsx
|
|
@@ -16422,7 +16784,7 @@ const DateRangePickerProvider = ({
|
|
|
16422
16784
|
};
|
|
16423
16785
|
const handleToggleOpen = e => {
|
|
16424
16786
|
const tagName = e.currentTarget.tagName.toLowerCase();
|
|
16425
|
-
if (
|
|
16787
|
+
if (tagName === 'button') {
|
|
16426
16788
|
toggleOpen();
|
|
16427
16789
|
}
|
|
16428
16790
|
if (tagName === 'input' && rest.inputProps?.inputProps?.onClick) {
|
|
@@ -16449,7 +16811,6 @@ const DateRangePickerProvider = ({
|
|
|
16449
16811
|
|
|
16450
16812
|
const DateRangePicker = ({
|
|
16451
16813
|
format,
|
|
16452
|
-
openCalendarMode = 'icon',
|
|
16453
16814
|
showCalendarIcon = true,
|
|
16454
16815
|
showStatusArea = true,
|
|
16455
16816
|
rangePickerType = 'days',
|
|
@@ -16458,7 +16819,6 @@ const DateRangePicker = ({
|
|
|
16458
16819
|
const actualFormat = format || getFormatForRangePickerType(rangePickerType);
|
|
16459
16820
|
return (0,jsx_runtime_namespaceObject.jsx)(DateRangePickerProvider, {
|
|
16460
16821
|
format: actualFormat,
|
|
16461
|
-
openCalendarMode: openCalendarMode,
|
|
16462
16822
|
showCalendarIcon: showCalendarIcon,
|
|
16463
16823
|
showStatusArea: showStatusArea,
|
|
16464
16824
|
rangePickerType: rangePickerType,
|
|
@@ -18173,52 +18533,6 @@ const FiltersMultiSelectOptions = ({
|
|
|
18173
18533
|
;// ./src/components/Icon/index.ts
|
|
18174
18534
|
|
|
18175
18535
|
|
|
18176
|
-
;// ./src/components/ImageItem/ImageItem.tsx
|
|
18177
|
-
function ImageItem_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)."; }
|
|
18178
|
-
|
|
18179
|
-
|
|
18180
|
-
|
|
18181
|
-
|
|
18182
|
-
var ImageItem_ref = true ? {
|
|
18183
|
-
name: "c5ejfv",
|
|
18184
|
-
styles: "gap:8px;text-decoration:none"
|
|
18185
|
-
} : 0;
|
|
18186
|
-
const ImageItem = ({
|
|
18187
|
-
children,
|
|
18188
|
-
image,
|
|
18189
|
-
avatarSize = 24,
|
|
18190
|
-
link = '',
|
|
18191
|
-
openLinkInNewTab = false,
|
|
18192
|
-
className
|
|
18193
|
-
}) => {
|
|
18194
|
-
const theme = (0,react_namespaceObject.useTheme)();
|
|
18195
|
-
const additionalProps = link ? {
|
|
18196
|
-
href: link,
|
|
18197
|
-
target: openLinkInNewTab ? '_blank' : undefined
|
|
18198
|
-
} : {};
|
|
18199
|
-
return (0,jsx_runtime_namespaceObject.jsxs)(Wrapper_Wrapper, {
|
|
18200
|
-
css: ImageItem_ref,
|
|
18201
|
-
as: link ? 'a' : 'div',
|
|
18202
|
-
className: className,
|
|
18203
|
-
"data-testid": "image-item",
|
|
18204
|
-
...additionalProps,
|
|
18205
|
-
children: [(0,jsx_runtime_namespaceObject.jsx)(Avatar_Avatar, {
|
|
18206
|
-
size: avatarSize,
|
|
18207
|
-
image: image
|
|
18208
|
-
}), (0,jsx_runtime_namespaceObject.jsx)("span", {
|
|
18209
|
-
css: /*#__PURE__*/(0,react_namespaceObject.css)({
|
|
18210
|
-
color: theme.colors.greyDarker,
|
|
18211
|
-
fontSize: 14,
|
|
18212
|
-
fontWeight: 500,
|
|
18213
|
-
cursor: link ? 'pointer' : 'default',
|
|
18214
|
-
'&:hover': {
|
|
18215
|
-
color: link ? theme.colors.blue : theme.colors.greyDarker
|
|
18216
|
-
}
|
|
18217
|
-
}, true ? "" : 0, true ? "" : 0),
|
|
18218
|
-
children: children
|
|
18219
|
-
})]
|
|
18220
|
-
});
|
|
18221
|
-
};
|
|
18222
18536
|
;// ./src/components/ImageItem/index.ts
|
|
18223
18537
|
|
|
18224
18538
|
;// ./src/components/LinksTabBar/LinksTabBarBase.tsx
|
|
@@ -19140,18 +19454,47 @@ const Pagination = ({
|
|
|
19140
19454
|
});
|
|
19141
19455
|
};
|
|
19142
19456
|
/* harmony default export */ const Pagination_Pagination = (Pagination);
|
|
19457
|
+
;// ./src/utils/react19HocCompat.tsx
|
|
19458
|
+
/**
|
|
19459
|
+
* React 19 compatibility helper for Higher-Order Components (HOCs).
|
|
19460
|
+
*
|
|
19461
|
+
* React 19 has stricter requirements for component identification.
|
|
19462
|
+
* This utility ensures HOCs properly set displayName for better debugging
|
|
19463
|
+
* and React DevTools integration.
|
|
19464
|
+
*
|
|
19465
|
+
* @param hocName - The name of the HOC (e.g., 'WithPagination', 'WithLayout')
|
|
19466
|
+
* @param Component - The component being wrapped
|
|
19467
|
+
* @param WrappedComponent - The wrapper component function
|
|
19468
|
+
* @returns The wrapper component with proper displayName set
|
|
19469
|
+
*/
|
|
19470
|
+
|
|
19471
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19472
|
+
function setHocDisplayName(hocName,
|
|
19473
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19474
|
+
Component, WrappedComponent) {
|
|
19475
|
+
const componentName = typeof Component === 'function' ?
|
|
19476
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19477
|
+
Component.displayName ||
|
|
19478
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19479
|
+
Component.name || 'Component' : 'Component';
|
|
19480
|
+
WrappedComponent.displayName = `${hocName}(${componentName})`;
|
|
19481
|
+
return WrappedComponent;
|
|
19482
|
+
}
|
|
19143
19483
|
;// ./src/components/Pagination/WithPagination.tsx
|
|
19144
19484
|
|
|
19145
19485
|
|
|
19486
|
+
|
|
19487
|
+
|
|
19146
19488
|
const WithPagination = Component => {
|
|
19147
|
-
|
|
19148
|
-
|
|
19149
|
-
|
|
19150
|
-
|
|
19151
|
-
|
|
19152
|
-
|
|
19153
|
-
|
|
19154
|
-
|
|
19489
|
+
function WrappedComponent(props) {
|
|
19490
|
+
return (0,jsx_runtime_namespaceObject.jsx)(PaginationContextProvider, {
|
|
19491
|
+
selectedPage: 1,
|
|
19492
|
+
children: (0,jsx_runtime_namespaceObject.jsx)(Component, {
|
|
19493
|
+
...props
|
|
19494
|
+
})
|
|
19495
|
+
});
|
|
19496
|
+
}
|
|
19497
|
+
return setHocDisplayName('WithPagination', Component, WrappedComponent);
|
|
19155
19498
|
};
|
|
19156
19499
|
;// ./src/components/Pagination/index.ts
|
|
19157
19500
|
|
|
@@ -19575,15 +19918,17 @@ const useTypeahead = ({
|
|
|
19575
19918
|
const items = (0,external_react_namespaceObject.useMemo)(() => {
|
|
19576
19919
|
return filteredChildren.map((child, index) => {
|
|
19577
19920
|
if (! /*#__PURE__*/external_react_default().isValidElement(child)) return null;
|
|
19578
|
-
|
|
19921
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19922
|
+
const childElement = child;
|
|
19923
|
+
const isActive = selectedItems.includes(childElement.props.value);
|
|
19579
19924
|
const {
|
|
19580
19925
|
value,
|
|
19581
19926
|
label,
|
|
19582
19927
|
id,
|
|
19583
19928
|
isDisabled
|
|
19584
|
-
} =
|
|
19585
|
-
return /*#__PURE__*/external_react_default().cloneElement(
|
|
19586
|
-
...
|
|
19929
|
+
} = childElement.props;
|
|
19930
|
+
return /*#__PURE__*/external_react_default().cloneElement(childElement, {
|
|
19931
|
+
...childElement.props,
|
|
19587
19932
|
index,
|
|
19588
19933
|
isActive,
|
|
19589
19934
|
isDisabled,
|
|
@@ -19604,7 +19949,7 @@ const useTypeahead = ({
|
|
|
19604
19949
|
value: id || value,
|
|
19605
19950
|
input: inputValue,
|
|
19606
19951
|
label
|
|
19607
|
-
}) ??
|
|
19952
|
+
}) ?? childElement.props.children ?? label ?? value
|
|
19608
19953
|
});
|
|
19609
19954
|
});
|
|
19610
19955
|
}, [children, selectedItems, inputValue]);
|
|
@@ -19613,7 +19958,9 @@ const useTypeahead = ({
|
|
|
19613
19958
|
const needle = inputValue.toLowerCase();
|
|
19614
19959
|
for (const child of filteredChildren) {
|
|
19615
19960
|
if (! /*#__PURE__*/external_react_default().isValidElement(child)) continue;
|
|
19616
|
-
|
|
19961
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19962
|
+
const childElement = child;
|
|
19963
|
+
const labelText = (childElement.props.label ?? childElement.props.value).toString();
|
|
19617
19964
|
if (labelText.toLowerCase().startsWith(needle)) {
|
|
19618
19965
|
return inputValue + labelText.slice(inputValue.length);
|
|
19619
19966
|
}
|
|
@@ -21132,10 +21479,22 @@ const RadioWidget = props => {
|
|
|
21132
21479
|
}, i)) : undefined
|
|
21133
21480
|
});
|
|
21134
21481
|
};
|
|
21482
|
+
;// ./src/components/JsonSchemaForm/constants.ts
|
|
21483
|
+
const DEFAULT_AVATAR_SIZE = 24;
|
|
21135
21484
|
;// ./src/components/JsonSchemaForm/widgets/SelectWidget.tsx
|
|
21136
21485
|
|
|
21137
21486
|
|
|
21138
21487
|
|
|
21488
|
+
|
|
21489
|
+
const getAvatarNode = (option, uiOptions) => {
|
|
21490
|
+
const avatar = option.schema?.avatar;
|
|
21491
|
+
if (!avatar) return;
|
|
21492
|
+
const avatarSize = uiOptions.typeaheadAvatarSize ?? DEFAULT_AVATAR_SIZE;
|
|
21493
|
+
return (0,jsx_runtime_namespaceObject.jsx)(Avatar_Avatar, {
|
|
21494
|
+
size: avatarSize,
|
|
21495
|
+
image: avatar
|
|
21496
|
+
});
|
|
21497
|
+
};
|
|
21139
21498
|
const SelectWidget = props => {
|
|
21140
21499
|
const {
|
|
21141
21500
|
id,
|
|
@@ -21156,6 +21515,7 @@ const SelectWidget = props => {
|
|
|
21156
21515
|
enumDisabled = []
|
|
21157
21516
|
} = options;
|
|
21158
21517
|
const customPlaceholder = placeholder || uiSchema?.['ui:placeholder'];
|
|
21518
|
+
const selectUiOptions = uiSchema?.['ui:options'] || {};
|
|
21159
21519
|
const isMultiple = !!multiple || Array.isArray(value);
|
|
21160
21520
|
const items = Array.isArray(enumOptions) ? enumOptions : [];
|
|
21161
21521
|
const handleChange = onChangeOverride ? onChangeOverride : value => {
|
|
@@ -21183,8 +21543,7 @@ const SelectWidget = props => {
|
|
|
21183
21543
|
};
|
|
21184
21544
|
const handleTypeaheadChange = (changedValue, isAdded) => {
|
|
21185
21545
|
if (isMultiple) {
|
|
21186
|
-
const
|
|
21187
|
-
const newSelected = isAdded ? [...currentSelected, changedValue] : currentSelected.filter(item => item !== changedValue);
|
|
21546
|
+
const newSelected = isAdded ? [...selectedItems, changedValue] : selectedItems.filter(item => item !== changedValue);
|
|
21188
21547
|
handleFormChange(newSelected);
|
|
21189
21548
|
} else {
|
|
21190
21549
|
const newValue = isAdded ? changedValue : undefined;
|
|
@@ -21207,8 +21566,7 @@ const SelectWidget = props => {
|
|
|
21207
21566
|
};
|
|
21208
21567
|
const onRemoveSelectedClick = removedValue => {
|
|
21209
21568
|
if (isMultiple) {
|
|
21210
|
-
const
|
|
21211
|
-
const newSelected = currentSelected.filter(item => item !== removedValue);
|
|
21569
|
+
const newSelected = selectedItems.filter(item => item !== removedValue);
|
|
21212
21570
|
handleChange(newSelected);
|
|
21213
21571
|
} else {
|
|
21214
21572
|
handleChange(undefined);
|
|
@@ -21233,15 +21591,13 @@ const SelectWidget = props => {
|
|
|
21233
21591
|
label,
|
|
21234
21592
|
input
|
|
21235
21593
|
}) => highlightInputMatch(label, input),
|
|
21236
|
-
children: items.map(({
|
|
21237
|
-
|
|
21238
|
-
value
|
|
21239
|
-
|
|
21240
|
-
|
|
21241
|
-
|
|
21242
|
-
|
|
21243
|
-
children: label || value
|
|
21244
|
-
}, value))
|
|
21594
|
+
children: items.map(item => (0,jsx_runtime_namespaceObject.jsx)(TypeaheadOption_TypeaheadOption, {
|
|
21595
|
+
value: item.value,
|
|
21596
|
+
label: item.label || item.value,
|
|
21597
|
+
avatar: getAvatarNode(item, selectUiOptions),
|
|
21598
|
+
isDisabled: disabled || Array.isArray(enumDisabled) && enumDisabled.includes(item.value),
|
|
21599
|
+
children: item.label || item.value
|
|
21600
|
+
}, item.value))
|
|
21245
21601
|
})
|
|
21246
21602
|
});
|
|
21247
21603
|
};
|
|
@@ -21579,6 +21935,7 @@ const JsonSchemaForm_Form = /*#__PURE__*/base_default()(UnstyledForm, true ? {
|
|
|
21579
21935
|
styles: ".form-group{margin-bottom:16px;}.form-group:last-child{margin-bottom:0;}"
|
|
21580
21936
|
} : 0);
|
|
21581
21937
|
|
|
21938
|
+
|
|
21582
21939
|
;// ./src/components/index.ts
|
|
21583
21940
|
|
|
21584
21941
|
|
|
@@ -21759,6 +22116,7 @@ const useTranslation = () => (0,external_react_namespaceObject.useContext)(Trans
|
|
|
21759
22116
|
|
|
21760
22117
|
|
|
21761
22118
|
|
|
22119
|
+
|
|
21762
22120
|
/******/ return __webpack_exports__;
|
|
21763
22121
|
/******/ })()
|
|
21764
22122
|
;
|