@digital-ai/dot-components 2.5.2 → 2.5.4
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/CHANGE_LOG.md +35 -6
- package/index.esm.js +417 -249
- package/index.umd.js +579 -392
- package/lib/components/app-switcher/utils/helpers.d.ts +2 -2
- package/lib/components/date-picker/DatePicker.d.ts +68 -0
- package/lib/components/date-picker/DatePicker.stories.d.ts +20 -0
- package/lib/components/date-picker/DatePicker.stories.styles.d.ts +4 -0
- package/lib/components/date-picker/DatePicker.styles.d.ts +11 -0
- package/lib/components/date-picker/index.d.ts +3 -0
- package/lib/components/date-picker/utils/models.d.ts +38 -0
- package/lib/components/index.d.ts +2 -0
- package/lib/components/input-form-fields/InputText.d.ts +3 -3
- package/lib/components/input-form-fields/common.styles.d.ts +3 -0
- package/lib/theme-provider/ThemeProvider.d.ts +1 -0
- package/package.json +2 -1
|
@@ -10,7 +10,7 @@ export declare const daiAppsHeaderMenuItem: (count?: number) => {
|
|
|
10
10
|
children: JSX.Element;
|
|
11
11
|
key: string;
|
|
12
12
|
};
|
|
13
|
-
export declare const sectionHeaderMenuItem: (title: string, count: number, showEmpty?: boolean) => {
|
|
13
|
+
export declare const sectionHeaderMenuItem: (title: string, count: number, showEmpty?: boolean, showCount?: boolean) => {
|
|
14
14
|
children: JSX.Element;
|
|
15
15
|
key: string;
|
|
16
16
|
};
|
|
@@ -19,7 +19,7 @@ export declare const createTopLevelMenuItem: (url: string, logo: string, title:
|
|
|
19
19
|
export declare const createAppTypeLabel: (appTypeName: string, logo: string, appProps: MenuItemProps[]) => JSX.Element;
|
|
20
20
|
export declare const getInstanceStateText: (application: {
|
|
21
21
|
instance_state?: number;
|
|
22
|
-
}) => "Production
|
|
22
|
+
}) => "Production" | "Non-production";
|
|
23
23
|
export declare const sortRecentAppInstancesFn: (a: RecentAppInstance, b: RecentAppInstance) => number;
|
|
24
24
|
export declare const sortAppInstancesFn: (a: Partial<ApplicationModel>, b: Partial<ApplicationModel>) => number;
|
|
25
25
|
export declare const RECENT_INSTANCES_KEY = "dot-app-switcher-recent-app-instances";
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { PickersDayProps } from '@mui/x-date-pickers';
|
|
3
|
+
import { FieldChangeHandlerContext } from '@mui/x-date-pickers/internals';
|
|
4
|
+
import { CommonProps } from '../CommonProps';
|
|
5
|
+
import { DatePickerLocale } from './';
|
|
6
|
+
export declare const RectanglePickersDay: (pickersDayProps: PickersDayProps<unknown>) => JSX.Element;
|
|
7
|
+
export interface DatePickerProps extends CommonProps {
|
|
8
|
+
/** If `true`, the `input` element is focused during the first mount. */
|
|
9
|
+
autoFocus?: boolean;
|
|
10
|
+
/** If `true`, the popover or modal will close after submitting the full date. */
|
|
11
|
+
closeOnSelect?: boolean;
|
|
12
|
+
/** If `true`, the open picker button will not be rendered (renders only the field). */
|
|
13
|
+
disableOpenPicker?: boolean;
|
|
14
|
+
/** If `true`, disable values before the current date for date components, time for time components and both for date time components. */
|
|
15
|
+
disablePast?: boolean;
|
|
16
|
+
/** If `true`, the picker and text field are disabled. */
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/** If `true`, 'Clear' button will be displayed in the calendar popper. `True` by default. */
|
|
19
|
+
displayClearButton?: boolean;
|
|
20
|
+
/** If `true`, the week number will be display in the calendar. */
|
|
21
|
+
displayWeekNumber?: boolean;
|
|
22
|
+
/** If true, the label will be displayed in an error state. */
|
|
23
|
+
error?: boolean;
|
|
24
|
+
/** Calendar will show more weeks in order to match this value. Put it to 6 for having fix number of week in Gregorian calendars */
|
|
25
|
+
fixedWeekNumber?: number;
|
|
26
|
+
/** Format of the date when rendered in the input(s). Defaults to localized format based on the used `views`. */
|
|
27
|
+
format?: string;
|
|
28
|
+
/** If true, the input will take up the full width of its container */
|
|
29
|
+
fullWidth?: boolean;
|
|
30
|
+
/** The helper text content. */
|
|
31
|
+
helperText?: ReactNode;
|
|
32
|
+
/** Identifies the input element and also used to create label "for" and helper text id attribute */
|
|
33
|
+
inputId: string;
|
|
34
|
+
/** The name of input element */
|
|
35
|
+
inputName?: string;
|
|
36
|
+
/** The label content. */
|
|
37
|
+
label?: string;
|
|
38
|
+
/** Locale for the date library you are using */
|
|
39
|
+
locale?: DatePickerLocale;
|
|
40
|
+
/** Callback fired when the value is accepted. */
|
|
41
|
+
onAccept?: (value: string) => void;
|
|
42
|
+
/** Callback fired when the value changes. */
|
|
43
|
+
onChange?: (value: string, context: FieldChangeHandlerContext<string>) => void;
|
|
44
|
+
/** Callback fired when the popup requests to be closed. Use in controlled mode (see `open`). */
|
|
45
|
+
onClose?: () => void;
|
|
46
|
+
/** Callback fired when the error associated to the current value changes. */
|
|
47
|
+
onError?: (error: string, value: string) => void;
|
|
48
|
+
/** Callback fired when the popup requests to be opened. Use in controlled mode (see `open`). */
|
|
49
|
+
onOpen?: () => void;
|
|
50
|
+
/** Control the popup or dialog open state. */
|
|
51
|
+
open?: boolean;
|
|
52
|
+
/** If true, the label will be persistently displayed outside the field */
|
|
53
|
+
persistentLabel?: boolean;
|
|
54
|
+
/** If true, the input will be read-only. */
|
|
55
|
+
readOnly?: boolean;
|
|
56
|
+
/** If true, the label is displayed as required and the input element` will be required. */
|
|
57
|
+
required?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* If `true`, days outside the current month are rendered:
|
|
60
|
+
* - if `fixedWeekNumber` is defined, renders days to have the weeks requested.
|
|
61
|
+
* - if `fixedWeekNumber` is not defined, renders day to fill the first and last week of the current month.
|
|
62
|
+
* - ignored if `calendars` equals more than `1` on range pickers.
|
|
63
|
+
*/
|
|
64
|
+
showDaysOutsideCurrentMonth?: boolean;
|
|
65
|
+
/** The selected value. Used when the component is controlled. */
|
|
66
|
+
value?: string;
|
|
67
|
+
}
|
|
68
|
+
export declare const DotDatePicker: ({ ariaLabel, autoFocus, className, closeOnSelect, "data-testid": dataTestId, disableOpenPicker, disablePast, disabled, displayWeekNumber, displayClearButton, error, fixedWeekNumber, format, fullWidth, helperText, inputId, inputName, label, locale, onAccept, onChange, onClose, onError, onOpen, open, persistentLabel, readOnly, required, showDaysOutsideCurrentMonth, value, }: DatePickerProps) => JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ComponentMeta, Story } from '@storybook/react';
|
|
2
|
+
import { DatePickerProps } from './';
|
|
3
|
+
declare const _default: ComponentMeta<({ ariaLabel, autoFocus, className, closeOnSelect, "data-testid": dataTestId, disableOpenPicker, disablePast, disabled, displayWeekNumber, displayClearButton, error, fixedWeekNumber, format, fullWidth, helperText, inputId, inputName, label, locale, onAccept, onChange, onClose, onError, onOpen, open, persistentLabel, readOnly, required, showDaysOutsideCurrentMonth, value, }: DatePickerProps) => JSX.Element>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Default: DatePickerProps;
|
|
6
|
+
export declare const WithHelperText: any;
|
|
7
|
+
export declare const WithError: any;
|
|
8
|
+
export declare const WithPersistentLabel: any;
|
|
9
|
+
export declare const WithReadOnly: any;
|
|
10
|
+
export declare const WithDisabledPast: any;
|
|
11
|
+
export declare const WithDisabledPicker: any;
|
|
12
|
+
export declare const WithDisabledOption: any;
|
|
13
|
+
export declare const WithDisplayedWeekNumber: any;
|
|
14
|
+
export declare const WithCustomDateFormat: any;
|
|
15
|
+
export declare const WithRequiredOption: any;
|
|
16
|
+
export declare const WithDaysOutsideOfCurrentMonth: any;
|
|
17
|
+
export declare const WithFullWidth: any;
|
|
18
|
+
export declare const WithoutClearButton: any;
|
|
19
|
+
export declare const WithControlledMode: Story<DatePickerProps>;
|
|
20
|
+
export declare const WithLocaleConfiguration: Story<DatePickerProps>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const datePickerWithControlledModeClassName = "dot-date-picker-with-controlled-mode";
|
|
2
|
+
export declare const datePickerWithLocaleClassName = "dot-date-picker-with-locale";
|
|
3
|
+
export declare const StyledDatePickerWithControlledMode: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export declare const StyledDatePickerWithLocale: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const rootClassName = "dot-date-picker";
|
|
3
|
+
export declare const containerClassName = "dot-date-picker-container";
|
|
4
|
+
export declare const rectanglePickersDayClassName = "dot-rectangle-pickers-day";
|
|
5
|
+
export declare const StyledDatePickerContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
6
|
+
export declare const StyledDatePicker: import("styled-components").StyledComponent<(<TDate>(props: import("@mui/x-date-pickers").DatePickerProps<TDate> & import("react").RefAttributes<HTMLDivElement>) => JSX.Element) & {
|
|
7
|
+
propTypes?: any;
|
|
8
|
+
}, any, {}, never>;
|
|
9
|
+
export declare const StyledPickersDay: import("styled-components").StyledComponent<(<TDate>(props: import("@mui/x-date-pickers").PickersDayProps<TDate> & import("react").RefAttributes<HTMLButtonElement>) => JSX.Element) & {
|
|
10
|
+
propTypes?: any;
|
|
11
|
+
}, any, {}, never>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface DatePickerLocale {
|
|
2
|
+
formats?: {
|
|
3
|
+
L: string;
|
|
4
|
+
LL: string;
|
|
5
|
+
LLL: string;
|
|
6
|
+
LLLL: string;
|
|
7
|
+
LT: string;
|
|
8
|
+
LTS: string;
|
|
9
|
+
l: string;
|
|
10
|
+
ll: string;
|
|
11
|
+
lll: string;
|
|
12
|
+
llll: string;
|
|
13
|
+
};
|
|
14
|
+
meridiem?: (hour: number, minute: number, isLowercase: boolean) => string;
|
|
15
|
+
months?: string[];
|
|
16
|
+
monthsShort?: string[];
|
|
17
|
+
ordinal?: (n: number) => string;
|
|
18
|
+
relativeTime?: {
|
|
19
|
+
M: string;
|
|
20
|
+
MM: string;
|
|
21
|
+
d: string;
|
|
22
|
+
dd: string;
|
|
23
|
+
future: string;
|
|
24
|
+
h: string;
|
|
25
|
+
hh: string;
|
|
26
|
+
m: string;
|
|
27
|
+
mm: string;
|
|
28
|
+
past: string;
|
|
29
|
+
s: string;
|
|
30
|
+
y: string;
|
|
31
|
+
yy: string;
|
|
32
|
+
};
|
|
33
|
+
weekStart?: number;
|
|
34
|
+
weekdays?: string[];
|
|
35
|
+
weekdaysMin?: string[];
|
|
36
|
+
weekdaysShort?: string[];
|
|
37
|
+
yearStart?: number;
|
|
38
|
+
}
|
|
@@ -33,6 +33,7 @@ export type { CharactersLimit, InlineEditProps } from './inline-edit';
|
|
|
33
33
|
export type { progressColorOptions, progressVariantOptions, ProgressProps, } from './progress';
|
|
34
34
|
export type { FileItemProps, FileUploadError, FileUploadProps, ListItemFile, MappedFile, MappedListItemFile, } from './file-upload';
|
|
35
35
|
export type { LinearProgressColor, LinearProgressProps, LinearProgressVariant, } from './linear-progress';
|
|
36
|
+
export type { DatePickerLocale, DatePickerProps, FieldChangeHandlerContext, } from './date-picker';
|
|
36
37
|
export { DotAccordion } from './accordion/Accordion';
|
|
37
38
|
export { DotActionToolbar } from './action-toolbar/ActionToolbar';
|
|
38
39
|
export { DotAlertBanner } from './alert-banner/AlertBanner';
|
|
@@ -92,4 +93,5 @@ export { DotPopper } from './popper';
|
|
|
92
93
|
export { DotTruncateWithTooltip } from './truncate-with-tooltip';
|
|
93
94
|
export { DotDraggableList } from './draggable-list';
|
|
94
95
|
export { DotLinearProgress } from './linear-progress';
|
|
96
|
+
export { DotDatePicker } from './date-picker';
|
|
95
97
|
export { CreateUUID } from './createUUID';
|
|
@@ -4,9 +4,9 @@ export declare const DELAY_MS = 300;
|
|
|
4
4
|
export declare type endAdornmentIconType = 'warning' | 'error' | 'check';
|
|
5
5
|
export interface InputTextProps extends InputProps {
|
|
6
6
|
/** The HTML autocomplete property to pass along to the input tag. Used for
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
controlling autofill behavior in forms. This property follows this HTML spec:
|
|
8
|
+
https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill
|
|
9
|
+
**/
|
|
10
10
|
autoComplete?: string;
|
|
11
11
|
endAdornmentTooltip?: string;
|
|
12
12
|
/** If true, the input will use debounce functionality. **/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digital-ai/dot-components",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "SEE LICENSE IN <LICENSE.md>",
|
|
6
6
|
"contributors": [
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"@emotion/styled": "^11.10.4",
|
|
30
30
|
"@mui/material": "^5.2.5",
|
|
31
31
|
"@mui/styles": "^5.2.3",
|
|
32
|
+
"@mui/x-date-pickers": "^6.0.1",
|
|
32
33
|
"jwt-decode": "^3.1.2",
|
|
33
34
|
"react-dropzone": "^11.4.2",
|
|
34
35
|
"react-grid-layout": "^1.3.4",
|