@homecode/ui 4.22.13 → 4.22.15
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.
|
@@ -8,11 +8,11 @@ import { Popup } from '../Popup/Popup.js';
|
|
|
8
8
|
import S from './DatePickerInput.styl.js';
|
|
9
9
|
|
|
10
10
|
function DatePickerInput(props) {
|
|
11
|
-
const { value, variant = 'default', size = 'm', popupProps, displayFormat = 'MMM Do YYYY', } = props;
|
|
11
|
+
const { value, variant = 'default', size = 'm', popupProps, buttonProps, displayFormat = 'MMM Do YYYY', } = props;
|
|
12
12
|
const isRange = Array.isArray(value);
|
|
13
13
|
return (jsx(Popup, { size: size, focusControl: true, direction: "bottom-right", ...popupProps, trigger:
|
|
14
14
|
// @ts-ignore
|
|
15
|
-
jsx(Button, { variant: variant, size: size, children: isRange ? (jsxs(Fragment, { children: [jsx(DateTime, { value: strToDate(value[0]), format: displayFormat }), ' - ', jsx(DateTime, { value: strToDate(value[1]), format: displayFormat })] })) : (jsx(DateTime, { value: strToDate(value), format: displayFormat })) }), contentProps: {
|
|
15
|
+
jsx(Button, { variant: variant, size: size, ...buttonProps, children: isRange ? (jsxs(Fragment, { children: [jsx(DateTime, { value: strToDate(value[0]), format: displayFormat }), ' - ', jsx(DateTime, { value: strToDate(value[1]), format: displayFormat })] })) : (jsx(DateTime, { value: strToDate(value), format: displayFormat })) }), contentProps: {
|
|
16
16
|
className: cn(S.popupContent, props.doubleCalendar && S.doubleCalendar, S[`size-${size}`], popupProps?.contentProps?.className),
|
|
17
17
|
}, content: jsx(DatePicker, { ...props, className: S.content, calendarProps: { className: S.calendar } }) }));
|
|
18
18
|
}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import S from './Flex.styl.js';
|
|
3
3
|
|
|
4
|
-
const Flex = ({ children, ...props }) => {
|
|
5
|
-
return (jsx("div", { className: S.root,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
4
|
+
const Flex = ({ children, justifyContent, alignItems, flexDirection, flexWrap, flexGrow, flexShrink, flexBasis, flex, order, alignSelf, flexFlow, ...props }) => {
|
|
5
|
+
return (jsx("div", { className: S.root,
|
|
6
|
+
// {...props}
|
|
7
|
+
style: {
|
|
8
|
+
justifyContent,
|
|
9
|
+
alignItems,
|
|
10
|
+
flexDirection,
|
|
11
|
+
flexWrap,
|
|
12
|
+
flexGrow,
|
|
13
|
+
flexShrink,
|
|
14
|
+
flexBasis,
|
|
15
|
+
flex,
|
|
16
|
+
order,
|
|
17
|
+
alignSelf,
|
|
18
|
+
flexFlow,
|
|
17
19
|
}, children: children }));
|
|
18
20
|
};
|
|
19
21
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { Props as PopupProps } from 'uilib/components/Popup/Popup.types';
|
|
2
2
|
import type { Props as DatePickerProps } from 'uilib/components/DatePicker/DatePicker.types';
|
|
3
|
+
import type { Props as ButtonProps } from 'uilib/components/Button/Button.types';
|
|
3
4
|
export type Value = string | [string, string];
|
|
4
5
|
export type Props = DatePickerProps & {
|
|
5
6
|
variant?: string;
|
|
6
7
|
displayFormat: string;
|
|
7
8
|
popupProps?: PopupProps;
|
|
9
|
+
buttonProps?: Omit<ButtonProps, 'children'>;
|
|
8
10
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CSSProperties, HTMLAttributes } from 'react';
|
|
2
|
-
type FlexProps = HTMLAttributes<HTMLDivElement> & CSSProperties & {
|
|
2
|
+
type FlexProps = HTMLAttributes<HTMLDivElement> & Pick<CSSProperties, 'justifyContent' | 'alignItems' | 'flexDirection' | 'flexWrap' | 'flexGrow' | 'flexShrink' | 'flexBasis' | 'flex' | 'order' | 'alignSelf' | 'flexFlow'> & {
|
|
3
3
|
children: React.ReactNode;
|
|
4
4
|
};
|
|
5
|
-
export declare const Flex: ({ children, ...props }: FlexProps) => JSX.Element;
|
|
5
|
+
export declare const Flex: ({ children, justifyContent, alignItems, flexDirection, flexWrap, flexGrow, flexShrink, flexBasis, flex, order, alignSelf, flexFlow, ...props }: FlexProps) => JSX.Element;
|
|
6
6
|
export {};
|