@ssa-ui-kit/core 2.15.0 → 2.16.0
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 {
|
|
@@ -11574,6 +11575,7 @@ const TriggerInput = ({
|
|
|
11574
11575
|
ref: datepickerType === 'from' ? inputFromRef : inputToRef,
|
|
11575
11576
|
disabled: disabled,
|
|
11576
11577
|
register: register,
|
|
11578
|
+
className: className,
|
|
11577
11579
|
inputProps: {
|
|
11578
11580
|
onBlur: handleBlur,
|
|
11579
11581
|
onClick: handleOpen,
|
|
@@ -11630,7 +11632,7 @@ const Trigger = () => {
|
|
|
11630
11632
|
openCalendarMode,
|
|
11631
11633
|
isOpen,
|
|
11632
11634
|
showCalendarIcon,
|
|
11633
|
-
|
|
11635
|
+
classNames,
|
|
11634
11636
|
setIsOpen,
|
|
11635
11637
|
handleToggleOpen
|
|
11636
11638
|
} = useDateRangePickerContext();
|
|
@@ -11653,16 +11655,19 @@ const Trigger = () => {
|
|
|
11653
11655
|
status: status,
|
|
11654
11656
|
disabled: disabled,
|
|
11655
11657
|
"data-testid": "daterangepicker",
|
|
11656
|
-
className:
|
|
11658
|
+
className: classNames?.trigger?.root,
|
|
11657
11659
|
children: [(0,jsx_runtime_namespaceObject.jsx)(FieldLabel, {
|
|
11658
11660
|
htmlFor: lastFocusedElement === 'from' ? nameFrom : nameTo,
|
|
11661
|
+
className: classNames?.label,
|
|
11659
11662
|
children: label
|
|
11660
11663
|
}), (0,jsx_runtime_namespaceObject.jsx)(FieldControl, {
|
|
11661
11664
|
children: (0,jsx_runtime_namespaceObject.jsxs)(Wrapper_Wrapper, {
|
|
11662
11665
|
ref: wrapperRef,
|
|
11666
|
+
className: classNames?.trigger?.controlsWrapper,
|
|
11663
11667
|
children: [(0,jsx_runtime_namespaceObject.jsx)(TriggerInput, {
|
|
11664
11668
|
withPopover: true,
|
|
11665
11669
|
datepickerType: "from",
|
|
11670
|
+
className: classNames?.trigger?.inputFrom,
|
|
11666
11671
|
onClick: () => {
|
|
11667
11672
|
if (!isOpen) {
|
|
11668
11673
|
setIsOpen(true);
|
|
@@ -11672,9 +11677,11 @@ const Trigger = () => {
|
|
|
11672
11677
|
name: "carrot-right",
|
|
11673
11678
|
size: 18,
|
|
11674
11679
|
color: theme.colors.greyDarker80,
|
|
11680
|
+
className: classNames?.trigger?.icon,
|
|
11675
11681
|
css: Trigger_ref
|
|
11676
11682
|
}), (0,jsx_runtime_namespaceObject.jsx)(TriggerInput, {
|
|
11677
11683
|
datepickerType: "to",
|
|
11684
|
+
className: classNames?.trigger?.inputTo,
|
|
11678
11685
|
onClick: () => {
|
|
11679
11686
|
if (!isOpen) {
|
|
11680
11687
|
setIsOpen(true);
|