@ssa-ui-kit/core 2.15.0 → 2.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { MouseEventHandler } from 'react';
|
|
2
|
-
export declare const TriggerInput: ({ datepickerType, withPopover, onClick, }: {
|
|
2
|
+
export declare const TriggerInput: ({ datepickerType, withPopover, className, onClick, }: {
|
|
3
3
|
datepickerType: "from" | "to";
|
|
4
4
|
withPopover?: boolean;
|
|
5
|
+
className?: string;
|
|
5
6
|
onClick: MouseEventHandler<HTMLInputElement>;
|
|
6
7
|
}) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -20,8 +20,17 @@ export type DateRangePickerProps = {
|
|
|
20
20
|
disabled?: boolean;
|
|
21
21
|
helperText?: string;
|
|
22
22
|
showCalendarIcon?: boolean;
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
classNames?: {
|
|
24
|
+
trigger?: {
|
|
25
|
+
root?: string;
|
|
26
|
+
controlsWrapper?: string;
|
|
27
|
+
inputFrom?: string;
|
|
28
|
+
inputTo?: string;
|
|
29
|
+
icon?: string;
|
|
30
|
+
};
|
|
31
|
+
calendar?: string;
|
|
32
|
+
label?: string;
|
|
33
|
+
};
|
|
25
34
|
onChange?: (dates?: [Date | null, Date | null]) => void;
|
|
26
35
|
onOpen?: () => void;
|
|
27
36
|
onClose?: () => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LabelProps } from '../Label/types';
|
|
2
2
|
export interface FieldLabelProps extends LabelProps {
|
|
3
3
|
children: React.ReactNode;
|
|
4
|
+
className?: string;
|
|
4
5
|
}
|
|
5
6
|
export declare const FieldLabel: ({ children, ...props }: FieldLabelProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
package/dist/index.js
CHANGED
|
@@ -11307,11 +11307,11 @@ const Calendar_DatePickerCalendar = () => {
|
|
|
11307
11307
|
};
|
|
11308
11308
|
const {
|
|
11309
11309
|
calendarType,
|
|
11310
|
-
|
|
11310
|
+
classNames
|
|
11311
11311
|
} = useDateRangePickerContext();
|
|
11312
11312
|
const Component = components[calendarType];
|
|
11313
11313
|
return (0,jsx_runtime_namespaceObject.jsxs)(PopoverContent, {
|
|
11314
|
-
className: ['popover',
|
|
11314
|
+
className: ['popover', classNames?.calendar].filter(Boolean).join(' '),
|
|
11315
11315
|
"data-testid": "daterangepicker-calendar",
|
|
11316
11316
|
css: /*#__PURE__*/(0,react_namespaceObject.css)({
|
|
11317
11317
|
background: theme.colors.white,
|
|
@@ -11529,6 +11529,7 @@ const WithTriggerPopover = ({
|
|
|
11529
11529
|
const TriggerInput = ({
|
|
11530
11530
|
datepickerType,
|
|
11531
11531
|
withPopover = false,
|
|
11532
|
+
className,
|
|
11532
11533
|
onClick
|
|
11533
11534
|
}) => {
|
|
11534
11535
|
const {
|
|
@@ -11541,6 +11542,7 @@ const TriggerInput = ({
|
|
|
11541
11542
|
disabled,
|
|
11542
11543
|
helperText,
|
|
11543
11544
|
setLastFocusedElement,
|
|
11545
|
+
classNames,
|
|
11544
11546
|
onBlur: handleBlur
|
|
11545
11547
|
} = useDateRangePickerContext();
|
|
11546
11548
|
const formContext = (0,external_react_hook_form_namespaceObject.useFormContext)(); // Using FormProvider from react-hook-form
|
|
@@ -11574,6 +11576,7 @@ const TriggerInput = ({
|
|
|
11574
11576
|
ref: datepickerType === 'from' ? inputFromRef : inputToRef,
|
|
11575
11577
|
disabled: disabled,
|
|
11576
11578
|
register: register,
|
|
11579
|
+
className: className,
|
|
11577
11580
|
inputProps: {
|
|
11578
11581
|
onBlur: handleBlur,
|
|
11579
11582
|
onClick: handleOpen,
|
|
@@ -11581,10 +11584,10 @@ const TriggerInput = ({
|
|
|
11581
11584
|
id: inputProps?.inputProps?.id || currentName,
|
|
11582
11585
|
'data-testid': `daterangepicker-input-${datepickerType}`,
|
|
11583
11586
|
autoComplete: 'off',
|
|
11584
|
-
className: /*#__PURE__*/(0,css_namespaceObject.css)( true ? {
|
|
11587
|
+
className: [/*#__PURE__*/(0,css_namespaceObject.css)( true ? {
|
|
11585
11588
|
name: "150iz59",
|
|
11586
11589
|
styles: "border:none!important"
|
|
11587
|
-
} : 0),
|
|
11590
|
+
} : 0), datepickerType === 'from' ? classNames?.trigger?.inputFrom : classNames?.trigger?.inputTo].filter(Boolean).join(' '),
|
|
11588
11591
|
...inputElementProps
|
|
11589
11592
|
},
|
|
11590
11593
|
showStatusIcon: false,
|
|
@@ -11630,7 +11633,7 @@ const Trigger = () => {
|
|
|
11630
11633
|
openCalendarMode,
|
|
11631
11634
|
isOpen,
|
|
11632
11635
|
showCalendarIcon,
|
|
11633
|
-
|
|
11636
|
+
classNames,
|
|
11634
11637
|
setIsOpen,
|
|
11635
11638
|
handleToggleOpen
|
|
11636
11639
|
} = useDateRangePickerContext();
|
|
@@ -11653,16 +11656,19 @@ const Trigger = () => {
|
|
|
11653
11656
|
status: status,
|
|
11654
11657
|
disabled: disabled,
|
|
11655
11658
|
"data-testid": "daterangepicker",
|
|
11656
|
-
className:
|
|
11659
|
+
className: classNames?.trigger?.root,
|
|
11657
11660
|
children: [(0,jsx_runtime_namespaceObject.jsx)(FieldLabel, {
|
|
11658
11661
|
htmlFor: lastFocusedElement === 'from' ? nameFrom : nameTo,
|
|
11662
|
+
className: classNames?.label,
|
|
11659
11663
|
children: label
|
|
11660
11664
|
}), (0,jsx_runtime_namespaceObject.jsx)(FieldControl, {
|
|
11661
11665
|
children: (0,jsx_runtime_namespaceObject.jsxs)(Wrapper_Wrapper, {
|
|
11662
11666
|
ref: wrapperRef,
|
|
11667
|
+
className: classNames?.trigger?.controlsWrapper,
|
|
11663
11668
|
children: [(0,jsx_runtime_namespaceObject.jsx)(TriggerInput, {
|
|
11664
11669
|
withPopover: true,
|
|
11665
11670
|
datepickerType: "from",
|
|
11671
|
+
className: classNames?.trigger?.inputFrom,
|
|
11666
11672
|
onClick: () => {
|
|
11667
11673
|
if (!isOpen) {
|
|
11668
11674
|
setIsOpen(true);
|
|
@@ -11672,9 +11678,11 @@ const Trigger = () => {
|
|
|
11672
11678
|
name: "carrot-right",
|
|
11673
11679
|
size: 18,
|
|
11674
11680
|
color: theme.colors.greyDarker80,
|
|
11681
|
+
className: classNames?.trigger?.icon,
|
|
11675
11682
|
css: Trigger_ref
|
|
11676
11683
|
}), (0,jsx_runtime_namespaceObject.jsx)(TriggerInput, {
|
|
11677
11684
|
datepickerType: "to",
|
|
11685
|
+
className: classNames?.trigger?.inputTo,
|
|
11678
11686
|
onClick: () => {
|
|
11679
11687
|
if (!isOpen) {
|
|
11680
11688
|
setIsOpen(true);
|