@activecollab/components 1.0.210 → 1.0.212
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/cjs/components/Dialog/Dialog.js +32 -14
- package/dist/cjs/components/Dialog/Dialog.js.map +1 -1
- package/dist/cjs/components/Dialog/DialogActions.js +4 -0
- package/dist/cjs/components/Dialog/DialogActions.js.map +1 -1
- package/dist/cjs/components/Dialog/DialogContent.js +4 -0
- package/dist/cjs/components/Dialog/DialogContent.js.map +1 -1
- package/dist/cjs/components/Dialog/DialogContentDivider.js +4 -0
- package/dist/cjs/components/Dialog/DialogContentDivider.js.map +1 -1
- package/dist/cjs/components/Dialog/DialogContext.js +18 -0
- package/dist/cjs/components/Dialog/DialogContext.js.map +1 -0
- package/dist/cjs/components/Dialog/DialogTitle.js +2 -0
- package/dist/cjs/components/Dialog/DialogTitle.js.map +1 -1
- package/dist/cjs/components/Dialog/index.js.map +1 -1
- package/dist/cjs/components/Steppers/DateStepper/DateStepper.js +2 -3
- package/dist/cjs/components/Steppers/DateStepper/DateStepper.js.map +1 -1
- package/dist/cjs/components/Steppers/DateStepper/Styles.js +8 -1
- package/dist/cjs/components/Steppers/DateStepper/Styles.js.map +1 -1
- package/dist/esm/components/Dialog/Dialog.d.ts +25 -4
- package/dist/esm/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/esm/components/Dialog/Dialog.js +32 -13
- package/dist/esm/components/Dialog/Dialog.js.map +1 -1
- package/dist/esm/components/Dialog/DialogActions.d.ts +5 -2
- package/dist/esm/components/Dialog/DialogActions.d.ts.map +1 -1
- package/dist/esm/components/Dialog/DialogActions.js +4 -0
- package/dist/esm/components/Dialog/DialogActions.js.map +1 -1
- package/dist/esm/components/Dialog/DialogContent.d.ts +5 -2
- package/dist/esm/components/Dialog/DialogContent.d.ts.map +1 -1
- package/dist/esm/components/Dialog/DialogContent.js +4 -0
- package/dist/esm/components/Dialog/DialogContent.js.map +1 -1
- package/dist/esm/components/Dialog/DialogContentDivider.d.ts +5 -2
- package/dist/esm/components/Dialog/DialogContentDivider.d.ts.map +1 -1
- package/dist/esm/components/Dialog/DialogContentDivider.js +4 -0
- package/dist/esm/components/Dialog/DialogContentDivider.js.map +1 -1
- package/dist/esm/components/Dialog/DialogContext.d.ts +6 -0
- package/dist/esm/components/Dialog/DialogContext.d.ts.map +1 -0
- package/dist/esm/components/Dialog/DialogContext.js +13 -0
- package/dist/esm/components/Dialog/DialogContext.js.map +1 -0
- package/dist/esm/components/Dialog/DialogTitle.d.ts +6 -5
- package/dist/esm/components/Dialog/DialogTitle.d.ts.map +1 -1
- package/dist/esm/components/Dialog/DialogTitle.js +4 -0
- package/dist/esm/components/Dialog/DialogTitle.js.map +1 -1
- package/dist/esm/components/Dialog/index.d.ts.map +1 -1
- package/dist/esm/components/Dialog/index.js +9 -0
- package/dist/esm/components/Dialog/index.js.map +1 -1
- package/dist/esm/components/Steppers/DateStepper/DateStepper.js +3 -4
- package/dist/esm/components/Steppers/DateStepper/DateStepper.js.map +1 -1
- package/dist/esm/components/Steppers/DateStepper/Styles.d.ts +1 -0
- package/dist/esm/components/Steppers/DateStepper/Styles.d.ts.map +1 -1
- package/dist/esm/components/Steppers/DateStepper/Styles.js +6 -0
- package/dist/esm/components/Steppers/DateStepper/Styles.js.map +1 -1
- package/dist/index.js +72 -38
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogContent.d.ts","sourceRoot":"","sources":["../../../../src/components/Dialog/DialogContent.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"DialogContent.d.ts","sourceRoot":"","sources":["../../../../src/components/Dialog/DialogContent.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAK9C,eAAO,MAAM,aAAa;uCAIvB,eAAe,cAAc,CAAC;;CAWhC,CAAC"}
|
|
@@ -4,10 +4,14 @@ var _excluded = ["className", "children"];
|
|
|
4
4
|
import React from "react";
|
|
5
5
|
import classnames from "classnames";
|
|
6
6
|
import { StyledDialogContent } from "./Styles";
|
|
7
|
+
// import { useDialogContext } from "./DialogContext";
|
|
8
|
+
|
|
7
9
|
export var DialogContent = function DialogContent(_ref) {
|
|
8
10
|
var className = _ref.className,
|
|
9
11
|
children = _ref.children,
|
|
10
12
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
13
|
+
// useDialogContext();
|
|
14
|
+
|
|
11
15
|
return /*#__PURE__*/React.createElement(StyledDialogContent, _extends({
|
|
12
16
|
className: classnames("c-dialog-content", className)
|
|
13
17
|
}, rest), children);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogContent.js","names":["React","classnames","StyledDialogContent","DialogContent","className","children","rest","displayName"],"sources":["../../../../src/components/Dialog/DialogContent.tsx"],"sourcesContent":["import React, {
|
|
1
|
+
{"version":3,"file":"DialogContent.js","names":["React","classnames","StyledDialogContent","DialogContent","className","children","rest","displayName"],"sources":["../../../../src/components/Dialog/DialogContent.tsx"],"sourcesContent":["import React, { HTMLAttributes } from \"react\";\nimport classnames from \"classnames\";\nimport { StyledDialogContent } from \"./Styles\";\n// import { useDialogContext } from \"./DialogContext\";\n\nexport const DialogContent = ({\n className,\n children,\n ...rest\n}: HTMLAttributes<HTMLDivElement>) => {\n // useDialogContext();\n\n return (\n <StyledDialogContent\n className={classnames(\"c-dialog-content\", className)}\n {...rest}\n >\n {children}\n </StyledDialogContent>\n );\n};\n\nDialogContent.displayName = \"DialogContent\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAA0B,OAAO;AAC7C,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,mBAAmB,QAAQ,UAAU;AAC9C;;AAEA,OAAO,IAAMC,aAAa,GAAG,SAAhBA,aAAa,OAIY;EAAA,IAHpCC,SAAS,QAATA,SAAS;IACTC,QAAQ,QAARA,QAAQ;IACLC,IAAI;EAEP;;EAEA,oBACE,oBAAC,mBAAmB;IAClB,SAAS,EAAEL,UAAU,CAAC,kBAAkB,EAAEG,SAAS;EAAE,GACjDE,IAAI,GAEPD,QAAQ,CACW;AAE1B,CAAC;AAEDF,aAAa,CAACI,WAAW,GAAG,eAAe"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const DialogContentDivider:
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
export declare const DialogContentDivider: {
|
|
3
|
+
({ className, }: HTMLAttributes<HTMLDivElement>): JSX.Element;
|
|
4
|
+
displayName: string;
|
|
5
|
+
};
|
|
3
6
|
//# sourceMappingURL=DialogContentDivider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogContentDivider.d.ts","sourceRoot":"","sources":["../../../../src/components/Dialog/DialogContentDivider.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"DialogContentDivider.d.ts","sourceRoot":"","sources":["../../../../src/components/Dialog/DialogContentDivider.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAK9C,eAAO,MAAM,oBAAoB;qBAE9B,eAAe,cAAc,CAAC;;CAQhC,CAAC"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import classnames from "classnames";
|
|
3
3
|
import { StyledDialogContentDivider } from "./Styles";
|
|
4
|
+
// import { useDialogContext } from "./DialogContext";
|
|
5
|
+
|
|
4
6
|
export var DialogContentDivider = function DialogContentDivider(_ref) {
|
|
5
7
|
var className = _ref.className;
|
|
8
|
+
// useDialogContext();
|
|
9
|
+
|
|
6
10
|
return /*#__PURE__*/React.createElement(StyledDialogContentDivider, {
|
|
7
11
|
className: classnames("c-dialog-content-divider", className)
|
|
8
12
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogContentDivider.js","names":["React","classnames","StyledDialogContentDivider","DialogContentDivider","className","displayName"],"sources":["../../../../src/components/Dialog/DialogContentDivider.tsx"],"sourcesContent":["import React, {
|
|
1
|
+
{"version":3,"file":"DialogContentDivider.js","names":["React","classnames","StyledDialogContentDivider","DialogContentDivider","className","displayName"],"sources":["../../../../src/components/Dialog/DialogContentDivider.tsx"],"sourcesContent":["import React, { HTMLAttributes } from \"react\";\nimport classnames from \"classnames\";\nimport { StyledDialogContentDivider } from \"./Styles\";\n// import { useDialogContext } from \"./DialogContext\";\n\nexport const DialogContentDivider = ({\n className,\n}: HTMLAttributes<HTMLDivElement>) => {\n // useDialogContext();\n\n return (\n <StyledDialogContentDivider\n className={classnames(\"c-dialog-content-divider\", className)}\n />\n );\n};\n\nDialogContentDivider.displayName = \"DialogContentDivider\";\n"],"mappings":"AAAA,OAAOA,KAAK,MAA0B,OAAO;AAC7C,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,0BAA0B,QAAQ,UAAU;AACrD;;AAEA,OAAO,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAoB,OAEK;EAAA,IADpCC,SAAS,QAATA,SAAS;EAET;;EAEA,oBACE,oBAAC,0BAA0B;IACzB,SAAS,EAAEH,UAAU,CAAC,0BAA0B,EAAEG,SAAS;EAAE,EAC7D;AAEN,CAAC;AAEDD,oBAAoB,CAACE,WAAW,GAAG,sBAAsB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface DialogContextProps {
|
|
3
|
+
}
|
|
4
|
+
export declare const DialogContext: import("react").Context<DialogContextProps | null>;
|
|
5
|
+
export declare const useDialogContext: () => DialogContextProps;
|
|
6
|
+
//# sourceMappingURL=DialogContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogContext.d.ts","sourceRoot":"","sources":["../../../../src/components/Dialog/DialogContext.tsx"],"names":[],"mappings":";AAGA,MAAM,WAAW,kBAAkB;CAAG;AAEtC,eAAO,MAAM,aAAa,oDAAiD,CAAC;AAE5E,eAAO,MAAM,gBAAgB,0BAU5B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
4
|
+
|
|
5
|
+
export var DialogContext = /*#__PURE__*/createContext(null);
|
|
6
|
+
export var useDialogContext = function useDialogContext() {
|
|
7
|
+
var context = useContext(DialogContext);
|
|
8
|
+
if (!context) {
|
|
9
|
+
throw new Error("Child components of Dialog can not be rendered outside the Dialog component!");
|
|
10
|
+
}
|
|
11
|
+
return context;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=DialogContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogContext.js","names":["createContext","useContext","DialogContext","useDialogContext","context","Error"],"sources":["../../../../src/components/Dialog/DialogContext.tsx"],"sourcesContent":["import { createContext, useContext } from \"react\";\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface DialogContextProps {}\n\nexport const DialogContext = createContext<DialogContextProps | null>(null);\n\nexport const useDialogContext = () => {\n const context = useContext(DialogContext);\n\n if (!context) {\n throw new Error(\n \"Child components of Dialog can not be rendered outside the Dialog component!\"\n );\n }\n\n return context;\n};\n"],"mappings":"AAAA,SAASA,aAAa,EAAEC,UAAU,QAAQ,OAAO;;AAEjD;;AAGA,OAAO,IAAMC,aAAa,gBAAGF,aAAa,CAA4B,IAAI,CAAC;AAE3E,OAAO,IAAMG,gBAAgB,GAAG,SAAnBA,gBAAgB,GAAS;EACpC,IAAMC,OAAO,GAAGH,UAAU,CAACC,aAAa,CAAC;EAEzC,IAAI,CAACE,OAAO,EAAE;IACZ,MAAM,IAAIC,KAAK,CACb,8EAA8E,CAC/E;EACH;EAEA,OAAOD,OAAO;AAChB,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
interface
|
|
3
|
-
children: ReactNode;
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
|
+
export interface DialogTitleProps {
|
|
4
3
|
className?: string;
|
|
5
4
|
disableDefaultHeading?: boolean;
|
|
6
5
|
}
|
|
7
|
-
export declare const DialogTitle:
|
|
8
|
-
|
|
6
|
+
export declare const DialogTitle: {
|
|
7
|
+
({ children, className, disableDefaultHeading, ...rest }: PropsWithChildren<DialogTitleProps>): JSX.Element;
|
|
8
|
+
displayName: string;
|
|
9
|
+
};
|
|
9
10
|
//# sourceMappingURL=DialogTitle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogTitle.d.ts","sourceRoot":"","sources":["../../../../src/components/Dialog/DialogTitle.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"DialogTitle.d.ts","sourceRoot":"","sources":["../../../../src/components/Dialog/DialogTitle.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAMjD,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,eAAO,MAAM,WAAW;8DAKrB,kBAAkB,gBAAgB,CAAC;;CAWrC,CAAC"}
|
|
@@ -5,12 +5,16 @@ import React from "react";
|
|
|
5
5
|
import classnames from "classnames";
|
|
6
6
|
import { Header3 } from "../Typography/Variants/Header3";
|
|
7
7
|
import { StyledDialogTitle } from "./Styles";
|
|
8
|
+
// import { useDialogContext } from "./DialogContext";
|
|
9
|
+
|
|
8
10
|
export var DialogTitle = function DialogTitle(_ref) {
|
|
9
11
|
var children = _ref.children,
|
|
10
12
|
className = _ref.className,
|
|
11
13
|
_ref$disableDefaultHe = _ref.disableDefaultHeading,
|
|
12
14
|
disableDefaultHeading = _ref$disableDefaultHe === void 0 ? false : _ref$disableDefaultHe,
|
|
13
15
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
16
|
+
// useDialogContext();
|
|
17
|
+
|
|
14
18
|
return /*#__PURE__*/React.createElement(StyledDialogTitle, _extends({
|
|
15
19
|
className: classnames("c-dialog-title-wrapper", className)
|
|
16
20
|
}, rest), disableDefaultHeading ? children : /*#__PURE__*/React.createElement(Header3, null, children));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogTitle.js","names":["React","classnames","Header3","StyledDialogTitle","DialogTitle","children","className","disableDefaultHeading","rest","displayName"],"sources":["../../../../src/components/Dialog/DialogTitle.tsx"],"sourcesContent":["import React, {
|
|
1
|
+
{"version":3,"file":"DialogTitle.js","names":["React","classnames","Header3","StyledDialogTitle","DialogTitle","children","className","disableDefaultHeading","rest","displayName"],"sources":["../../../../src/components/Dialog/DialogTitle.tsx"],"sourcesContent":["import React, { PropsWithChildren } from \"react\";\nimport classnames from \"classnames\";\nimport { Header3 } from \"../Typography/Variants/Header3\";\nimport { StyledDialogTitle } from \"./Styles\";\n// import { useDialogContext } from \"./DialogContext\";\n\nexport interface DialogTitleProps {\n className?: string;\n disableDefaultHeading?: boolean;\n}\n\nexport const DialogTitle = ({\n children,\n className,\n disableDefaultHeading = false,\n ...rest\n}: PropsWithChildren<DialogTitleProps>) => {\n // useDialogContext();\n\n return (\n <StyledDialogTitle\n className={classnames(\"c-dialog-title-wrapper\", className)}\n {...rest}\n >\n {disableDefaultHeading ? children : <Header3>{children}</Header3>}\n </StyledDialogTitle>\n );\n};\n\nDialogTitle.displayName = \"DialogTitle\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAA6B,OAAO;AAChD,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,OAAO,QAAQ,gCAAgC;AACxD,SAASC,iBAAiB,QAAQ,UAAU;AAC5C;;AAOA,OAAO,IAAMC,WAAW,GAAG,SAAdA,WAAW,OAKmB;EAAA,IAJzCC,QAAQ,QAARA,QAAQ;IACRC,SAAS,QAATA,SAAS;IAAA,6BACTC,qBAAqB;IAArBA,qBAAqB,sCAAG,KAAK;IAC1BC,IAAI;EAEP;;EAEA,oBACE,oBAAC,iBAAiB;IAChB,SAAS,EAAEP,UAAU,CAAC,wBAAwB,EAAEK,SAAS;EAAE,GACvDE,IAAI,GAEPD,qBAAqB,GAAGF,QAAQ,gBAAG,oBAAC,OAAO,QAAEA,QAAQ,CAAW,CAC/C;AAExB,CAAC;AAEDD,WAAW,CAACK,WAAW,GAAG,aAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Dialog/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Dialog/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AAUzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC"}
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
export * from "./Dialog";
|
|
2
|
+
// @TODO:
|
|
3
|
+
// Nakon refaktora Dialog komponente na legacy AC-u i Next-u, obrisati individualne exporte.
|
|
4
|
+
// Korisčenje će se svesti samo na `import { Dialog } from @activecollab/components`.
|
|
5
|
+
|
|
6
|
+
// <Dialog>
|
|
7
|
+
// <Dialog.Title>Hello</Dialog.Title>
|
|
8
|
+
// itd...
|
|
9
|
+
// </Dialog>
|
|
10
|
+
|
|
2
11
|
export * from "./DialogContent";
|
|
3
12
|
export * from "./DialogContentDivider";
|
|
4
13
|
export * from "./DialogTitle";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/Dialog/index.ts"],"sourcesContent":["export * from \"./Dialog\";\nexport * from \"./DialogContent\";\nexport * from \"./DialogContentDivider\";\nexport * from \"./DialogTitle\";\nexport * from \"./DialogActions\";\n"],"mappings":"AAAA,cAAc,UAAU;AACxB,cAAc,iBAAiB;AAC/B,cAAc,wBAAwB;AACtC,cAAc,eAAe;AAC7B,cAAc,iBAAiB"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/Dialog/index.ts"],"sourcesContent":["export * from \"./Dialog\";\n// @TODO:\n// Nakon refaktora Dialog komponente na legacy AC-u i Next-u, obrisati individualne exporte.\n// Korisčenje će se svesti samo na `import { Dialog } from @activecollab/components`.\n\n// <Dialog>\n// <Dialog.Title>Hello</Dialog.Title>\n// itd...\n// </Dialog>\n\nexport * from \"./DialogContent\";\nexport * from \"./DialogContentDivider\";\nexport * from \"./DialogTitle\";\nexport * from \"./DialogActions\";\n"],"mappings":"AAAA,cAAc,UAAU;AACxB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,cAAc,iBAAiB;AAC/B,cAAc,wBAAwB;AACtC,cAAc,eAAe;AAC7B,cAAc,iBAAiB"}
|
|
@@ -2,11 +2,10 @@ import React, { useCallback, useMemo, useState, useEffect } from "react";
|
|
|
2
2
|
import classNames from "classnames";
|
|
3
3
|
import moment from "moment";
|
|
4
4
|
import MomentLocaleUtils from "react-day-picker/moment";
|
|
5
|
-
import { Button } from "../../Button/Button";
|
|
6
5
|
import ArrowLeftIcon from "../../Icons/collection/ArrowLeft";
|
|
7
6
|
import { DatePicker } from "../../DatePicker";
|
|
8
7
|
import { customClassNames } from "../../DatePicker/ClassNames";
|
|
9
|
-
import { StyledButton, StyledButtonGroup, StyledDiv, StyledMenu, StyledSpan } from "./Styles";
|
|
8
|
+
import { StyledButton, StyledButtonGroup, StyledDiv, StyledMenu, StyledSpan, StyledControl } from "./Styles";
|
|
10
9
|
import { ArrowRightIcon } from "../../Icons";
|
|
11
10
|
/**
|
|
12
11
|
* This component allow you to select date range. It accepts two parameters "from" and "to" as valid format
|
|
@@ -219,7 +218,7 @@ export var DateStepper = function DateStepper(_ref) {
|
|
|
219
218
|
}, [isDisabled]);
|
|
220
219
|
return /*#__PURE__*/React.createElement(StyledButtonGroup, {
|
|
221
220
|
className: classNames("c-date-stepper", className)
|
|
222
|
-
}, renderLeftRightButtons ? /*#__PURE__*/React.createElement(
|
|
221
|
+
}, renderLeftRightButtons ? /*#__PURE__*/React.createElement(StyledControl, {
|
|
223
222
|
type: "button",
|
|
224
223
|
variant: "secondary",
|
|
225
224
|
onClick: onLeftClickHandler,
|
|
@@ -253,7 +252,7 @@ export var DateStepper = function DateStepper(_ref) {
|
|
|
253
252
|
modifiers: modifiers,
|
|
254
253
|
dateRequired: true,
|
|
255
254
|
fixedWeeks: true
|
|
256
|
-
})) : /*#__PURE__*/React.createElement(StyledSpan, null, getDateFormatted)), renderLeftRightButtons ? /*#__PURE__*/React.createElement(
|
|
255
|
+
})) : /*#__PURE__*/React.createElement(StyledSpan, null, getDateFormatted)), renderLeftRightButtons ? /*#__PURE__*/React.createElement(StyledControl, {
|
|
257
256
|
type: "button",
|
|
258
257
|
variant: "secondary",
|
|
259
258
|
onClick: onRightClickHandler,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateStepper.js","names":["React","useCallback","useMemo","useState","useEffect","classNames","moment","MomentLocaleUtils","Button","ArrowLeftIcon","DatePicker","customClassNames","StyledButton","StyledButtonGroup","StyledDiv","StyledMenu","StyledSpan","ArrowRightIcon","DateStepper","step","formatCallback","onChange","from","to","onBack","onForward","minValue","maxValue","className","period","datePickerClass","withDatePicker","defaultMonth","Date","popperClassName","position","fromDate","setFromDate","toDate","setToDate","showDatePicker","setShowDatePicker","month","setMonth","getDatesByPeriod","interval","date","add","clone","startOf","endOf","getDateFormatted","actualYear","year","showWeekOrCustomDateFormat","start","end","format","startDate","endDate","quarter","onChangeCallback","amount","newFrom","newTo","onDatePickerChange","dates","fromDateTemp","toDateTemp","isAfterMaxDate","isSameOrBefore","isBeforeMinDate","isSameOrAfter","onRightClickHandler","onLeftClickHandler","renderLeftRightButtons","handleShow","closeMenu","onMonthChange","m","dateStepperWidth","fromDay","toDay","range","minWidth","isDisabled","day","dayFormat","isBefore","isAfter","modifiers","disabled","nonWorkingDay","displayName"],"sources":["../../../../../src/components/Steppers/DateStepper/DateStepper.tsx"],"sourcesContent":["import React, { FC, useCallback, useMemo, useState, useEffect } from \"react\";\nimport classNames from \"classnames\";\nimport moment, { Moment } from \"moment\";\nimport MomentLocaleUtils from \"react-day-picker/moment\";\nimport { Placement } from \"@popperjs/core\";\nimport { Button } from \"../../Button/Button\";\nimport ArrowLeftIcon from \"../../Icons/collection/ArrowLeft\";\nimport { DatePicker } from \"../../DatePicker\";\nimport { customClassNames } from \"../../DatePicker/ClassNames\";\nimport {\n StyledButton,\n StyledButtonGroup,\n StyledDiv,\n StyledMenu,\n StyledSpan,\n} from \"./Styles\";\nimport { ArrowRightIcon } from \"../../Icons\";\n\ninterface IDateStepperProps {\n /** One of the possible steps for this component */\n step:\n | \"daily\"\n | \"weekly\"\n | \"monthly\"\n | \"quarterly\"\n | \"yearly\"\n | \"custom\"\n | string;\n /** Callback function that will be called after the changed range */\n onChange?: (from: Date, to: Date) => void;\n /** Start date of the range */\n from: Date | string;\n /** End date of the range */\n to: Date | string;\n /** Callback function that will format the text label */\n formatCallback?: (from: string | Date, to: string | Date) => string;\n /** Default month */\n defaultMonth?: Date;\n /** Callback function onBack */\n onBack?: (from: Date, to: Date) => void;\n /** Callback function onForward */\n onForward?: (from: Date, to: Date) => void;\n /** Min date */\n minValue?: Date;\n /** Max fate */\n maxValue?: Date;\n /** html class */\n className?: string;\n /** Period for calculating week (isoWeek) */\n period?: \"week\" | \"isoWeek\";\n /** Classes for datePicker */\n datePickerClass?: string;\n /** Show datePicker in the middle button */\n withDatePicker?: boolean;\n /** Popper class name*/\n popperClassName?: string;\n /** DatePicker menu position */\n position?: Placement;\n}\n\n/**\n * This component allow you to select date range. It accepts two parameters \"from\" and \"to\" as valid format\n * onChange and onBack and onForward it will return \"from: Date\" and \"to: Date\" as function arguments\n */\nexport const DateStepper: FC<IDateStepperProps> = ({\n step,\n formatCallback,\n onChange,\n from,\n to,\n onBack,\n onForward,\n minValue,\n maxValue,\n className,\n period = \"week\",\n datePickerClass,\n withDatePicker = true,\n defaultMonth = new Date(),\n popperClassName,\n position = \"bottom\",\n}) => {\n const [fromDate, setFromDate] = useState(moment(from));\n const [toDate, setToDate] = useState(moment(to));\n const [showDatePicker, setShowDatePicker] = useState(false);\n const [month, setMonth] = useState(defaultMonth);\n\n const getDatesByPeriod = useCallback(\n (interval: number): Moment[] => {\n const date = fromDate ? fromDate : moment();\n if (step === \"daily\") {\n date.add(interval, \"days\");\n return [date, date.clone()];\n } else if (step === \"weekly\") {\n date.add(interval, \"weeks\");\n return [date.clone().startOf(period), date.clone().endOf(period)];\n } else if (step === \"monthly\") {\n date.add(interval, \"months\");\n return [date.clone().startOf(\"month\"), date.clone().endOf(\"month\")];\n } else if (step === \"quarterly\") {\n date.add(interval, \"quarters\");\n return [date.clone().startOf(\"quarter\"), date.clone().endOf(\"quarter\")];\n } else if (step === \"yearly\") {\n date.add(interval, \"years\");\n return [date.clone().startOf(\"year\"), date.clone().endOf(\"year\")];\n }\n return [date, date];\n },\n [fromDate, period, step]\n );\n\n const getDateFormatted = useMemo(() => {\n if (formatCallback) {\n return formatCallback(fromDate.toDate(), toDate.toDate());\n }\n\n const actualYear = moment().year();\n\n const showWeekOrCustomDateFormat = (start, end): string => {\n if (start.year() === actualYear && end.year() === actualYear) {\n return start.format(\"MMM DD\") + \" - \" + end.format(\"MMM DD\");\n } else {\n return start.format(\"MMM DD YYYY\") + \" - \" + end.format(\"MMM DD YYYY\");\n }\n };\n\n if (step === \"daily\") {\n if (fromDate.year() === actualYear) {\n return fromDate.format(\"MMM DD\");\n }\n return fromDate.format(\"MMM DD YYYY\");\n } else if (step === \"weekly\") {\n const startDate = fromDate.clone().startOf(period);\n const endDate = startDate.clone().endOf(period);\n return showWeekOrCustomDateFormat(startDate, endDate);\n } else if (step === \"monthly\") {\n return fromDate.format(\"MMM YYYY\");\n } else if (step === \"quarterly\") {\n return `Q${fromDate.quarter()}/${fromDate.format(\"YYYY\")}`;\n } else if (step === \"yearly\") {\n return fromDate.format(\"YYYY\");\n } else if (step === \"custom\") {\n return showWeekOrCustomDateFormat(fromDate, toDate);\n }\n\n return \"\";\n }, [fromDate, step, toDate, formatCallback, period]);\n\n const onChangeCallback = useCallback(\n (amount: number) => {\n const [newFrom, newTo] = getDatesByPeriod(amount);\n setFromDate(moment(newFrom));\n setToDate(moment(newTo));\n\n if (onChange) {\n onChange(newFrom.toDate(), newTo.toDate());\n }\n },\n [onChange, getDatesByPeriod]\n );\n\n const onDatePickerChange = useCallback(\n (dates?: { from: Date; to: Date }) => {\n const fromDateTemp = dates?.from;\n const toDateTemp = dates?.to;\n\n setFromDate(moment(fromDateTemp));\n setToDate(moment(toDateTemp));\n\n if (\n onChange &&\n fromDateTemp instanceof Date &&\n toDateTemp instanceof Date\n ) {\n onChange(fromDateTemp, toDateTemp);\n }\n },\n [onChange, setFromDate, setToDate]\n );\n\n const isAfterMaxDate = useMemo(() => {\n return (\n maxValue instanceof Date &&\n moment(moment(maxValue).format(\"YYYY-MM-DD\")).isSameOrBefore(\n toDate.format(\"YYYY-MM-DD\")\n )\n );\n }, [maxValue, toDate]);\n\n const isBeforeMinDate = useMemo(() => {\n return (\n minValue instanceof Date &&\n moment(moment(minValue).format(\"YYYY-MM-DD\")).isSameOrAfter(\n toDate.format(\"YYYY-MM-DD\")\n )\n );\n }, [minValue, toDate]);\n\n useEffect(() => {\n if (isBeforeMinDate) {\n if (step === \"daily\") {\n setFromDate(moment(minValue));\n setToDate(moment(minValue));\n }\n }\n if (isAfterMaxDate) {\n if (step === \"daily\") {\n setFromDate(moment(maxValue));\n setToDate(moment(maxValue));\n }\n }\n }, [step, minValue, maxValue, isBeforeMinDate, isAfterMaxDate]);\n\n const onRightClickHandler = useCallback(() => {\n if (isAfterMaxDate) {\n return;\n }\n\n onChangeCallback(1);\n\n if (onForward) {\n onForward(fromDate.toDate(), toDate.toDate());\n }\n }, [isAfterMaxDate, onChangeCallback, onForward, fromDate, toDate]);\n\n const onLeftClickHandler = useCallback(() => {\n if (isBeforeMinDate) {\n return;\n }\n\n onChangeCallback(-1);\n\n if (onBack) {\n onBack(fromDate.toDate(), toDate.toDate());\n }\n }, [isBeforeMinDate, onChangeCallback, onBack, fromDate, toDate]);\n\n const renderLeftRightButtons = useMemo(() => {\n return step !== \"custom\";\n }, [step]);\n\n const handleShow = useCallback(() => {\n setShowDatePicker(!showDatePicker);\n if (fromDate) {\n setMonth(fromDate.toDate());\n }\n }, [setShowDatePicker, showDatePicker, fromDate]);\n\n const closeMenu = useCallback(() => {\n setShowDatePicker(false);\n }, []);\n\n const onMonthChange = useCallback(\n (m: Date) => {\n setMonth(m);\n },\n [setMonth]\n );\n\n useEffect(() => {\n setFromDate(moment(from));\n setToDate(moment(to));\n }, [from, to]);\n\n const dateStepperWidth = (\n fromDay: Moment,\n toDay: Moment,\n range: string\n ): { minWidth: string } => {\n if (\n fromDay.year() !== moment().year() ||\n toDay.year() !== moment().year()\n ) {\n switch (range) {\n case \"daily\":\n case \"monthly\":\n return { minWidth: \"122px\" };\n case \"weekly\":\n case \"custom\":\n return { minWidth: \"232px\" };\n }\n }\n switch (range) {\n case \"monthly\":\n return { minWidth: \"122px\" };\n case \"weekly\":\n case \"custom\":\n return { minWidth: \"182px\" };\n }\n\n return { minWidth: \"102px\" };\n };\n const isDisabled = useCallback(\n (day: Date): boolean => {\n const dayFormat = moment(day).format(\"YYYY-MM-DD\");\n\n const isBefore =\n maxValue instanceof Date &&\n moment(moment(maxValue).format(\"YYYY-MM-DD\")).isBefore(dayFormat);\n const isAfter =\n minValue instanceof Date &&\n moment(moment(minValue).format(\"YYYY-MM-DD\")).isAfter(dayFormat);\n\n return isBefore || isAfter;\n },\n [maxValue, minValue]\n );\n\n const modifiers = useMemo(() => {\n return {\n [customClassNames.disabled]: (day: Date): boolean => {\n return isDisabled(day);\n },\n [customClassNames.nonWorkingDay]: (day: Date): boolean => {\n return isDisabled(day);\n },\n };\n }, [isDisabled]);\n\n return (\n <StyledButtonGroup className={classNames(\"c-date-stepper\", className)}>\n {renderLeftRightButtons ? (\n <Button\n type=\"button\"\n variant=\"secondary\"\n onClick={onLeftClickHandler}\n disabled={isBeforeMinDate}\n >\n <ArrowLeftIcon />\n </Button>\n ) : null}\n <StyledDiv\n $isTargetable={step === \"yearly\" || !withDatePicker}\n $isRounded={step === \"custom\"}\n style={dateStepperWidth(fromDate, toDate, step)}\n >\n {withDatePicker ? (\n <StyledMenu\n target={\n <StyledButton type=\"button\">\n <span>{getDateFormatted}</span>\n </StyledButton>\n }\n open={showDatePicker}\n onOpen={handleShow}\n onClose={closeMenu}\n popperClassName={popperClassName}\n position={position}\n >\n <DatePicker\n month={month}\n localeUtils={MomentLocaleUtils}\n locale=\"en\"\n selectionMode={step}\n className={datePickerClass}\n selectedDays={{ from: fromDate.toDate(), to: toDate.toDate() }}\n onChange={onDatePickerChange}\n onMonthChange={onMonthChange}\n firstDayOfWeek={period === \"week\" ? 0 : 1}\n modifiers={modifiers}\n dateRequired\n fixedWeeks\n />\n </StyledMenu>\n ) : (\n <StyledSpan>{getDateFormatted}</StyledSpan>\n )}\n </StyledDiv>\n {renderLeftRightButtons ? (\n <Button\n type=\"button\"\n variant=\"secondary\"\n onClick={onRightClickHandler}\n disabled={isAfterMaxDate}\n >\n <ArrowRightIcon />\n </Button>\n ) : null}\n </StyledButtonGroup>\n );\n};\n\nDateStepper.displayName = \"DateStepper\";\n"],"mappings":"AAAA,OAAOA,KAAK,IAAQC,WAAW,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAC5E,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,MAAM,MAAkB,QAAQ;AACvC,OAAOC,iBAAiB,MAAM,yBAAyB;AAEvD,SAASC,MAAM,QAAQ,qBAAq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AY;MAAC,IAAI,EAAC;IAAQ,gBACzB,kCAAOoB,gBAAgB,CAAQ,CAElC;IACD,IAAI,EAAEX,cAAe;IACrB,MAAM,EAAEoC,UAAW;IACnB,OAAO,EAAEC,SAAU;IACnB,eAAe,EAAE3C,eAAgB;IACjC,QAAQ,EAAEC;EAAS,gBAEnB,oBAAC,UAAU;IACT,KAAK,EAAEO,KAAM;IACb,WAAW,EAAEnC,iBAAkB;IAC/B,MAAM,EAAC,IAAI;IACX,aAAa,EAAEY,IAAK;IACpB,SAAS,EAAEW,eAAgB;IAC3B,YAAY,EAAE;MAAER,IAAI,EAAEc,QAAQ,CAACE,MAAM,EAAE;MAAEf,EAAE,EAAEe,MAAM,CAACA,MAAM;IAAG,CAAE;IAC/D,QAAQ,EAAE2B,kBAAmB;IAC7B,aAAa,EAAEa,aAAc;IAC7B,cAAc,EAAEjD,MAAM,KAAK,MAAM,GAAG,CAAC,GAAG,CAAE;IAC1C,SAAS,EAAE6D,SAAU;IACrB,YAAY;IACZ,UAAU;EAAA,EACV,CACS,gBAEb,oBAAC,UAAU,QAAEvC,gBAAgB,CAC9B,CACS,EACXwB,sBAAsB,gBACrB,oBAAC,MAAM;IACL,IAAI,EAAC,QAAQ;IACb,OAAO,EAAC,WAAW;IACnB,OAAO,EAAEF,mBAAoB;IAC7B,QAAQ,EAAEJ;EAAe,gBAEzB,oBAAC,cAAc,OAAG,CACX,GACP,IAAI,CACU;AAExB,CAAC;AAEDnD,WAAW,CAAC2E,WAAW,GAAG,aAAa"}
|
|
1
|
+
{"version":3,"file":"DateStepper.js","names":["React","useCallback","useMemo","useState","useEffect","classNames","moment","MomentLocaleUtils","ArrowLeftIcon","DatePicker","customClassNames","StyledButton","StyledButtonGroup","StyledDiv","StyledMenu","StyledSpan","StyledControl","ArrowRightIcon","DateStepper","step","formatCallback","onChange","from","to","onBack","onForward","minValue","maxValue","className","period","datePickerClass","withDatePicker","defaultMonth","Date","popperClassName","position","fromDate","setFromDate","toDate","setToDate","showDatePicker","setShowDatePicker","month","setMonth","getDatesByPeriod","interval","date","add","clone","startOf","endOf","getDateFormatted","actualYear","year","showWeekOrCustomDateFormat","start","end","format","startDate","endDate","quarter","onChangeCallback","amount","newFrom","newTo","onDatePickerChange","dates","fromDateTemp","toDateTemp","isAfterMaxDate","isSameOrBefore","isBeforeMinDate","isSameOrAfter","onRightClickHandler","onLeftClickHandler","renderLeftRightButtons","handleShow","closeMenu","onMonthChange","m","dateStepperWidth","fromDay","toDay","range","minWidth","isDisabled","day","dayFormat","isBefore","isAfter","modifiers","disabled","nonWorkingDay","displayName"],"sources":["../../../../../src/components/Steppers/DateStepper/DateStepper.tsx"],"sourcesContent":["import React, { FC, useCallback, useMemo, useState, useEffect } from \"react\";\nimport classNames from \"classnames\";\nimport moment, { Moment } from \"moment\";\nimport MomentLocaleUtils from \"react-day-picker/moment\";\nimport { Placement } from \"@popperjs/core\";\nimport ArrowLeftIcon from \"../../Icons/collection/ArrowLeft\";\nimport { DatePicker } from \"../../DatePicker\";\nimport { customClassNames } from \"../../DatePicker/ClassNames\";\nimport {\n StyledButton,\n StyledButtonGroup,\n StyledDiv,\n StyledMenu,\n StyledSpan,\n StyledControl,\n} from \"./Styles\";\nimport { ArrowRightIcon } from \"../../Icons\";\n\ninterface IDateStepperProps {\n /** One of the possible steps for this component */\n step:\n | \"daily\"\n | \"weekly\"\n | \"monthly\"\n | \"quarterly\"\n | \"yearly\"\n | \"custom\"\n | string;\n /** Callback function that will be called after the changed range */\n onChange?: (from: Date, to: Date) => void;\n /** Start date of the range */\n from: Date | string;\n /** End date of the range */\n to: Date | string;\n /** Callback function that will format the text label */\n formatCallback?: (from: string | Date, to: string | Date) => string;\n /** Default month */\n defaultMonth?: Date;\n /** Callback function onBack */\n onBack?: (from: Date, to: Date) => void;\n /** Callback function onForward */\n onForward?: (from: Date, to: Date) => void;\n /** Min date */\n minValue?: Date;\n /** Max fate */\n maxValue?: Date;\n /** html class */\n className?: string;\n /** Period for calculating week (isoWeek) */\n period?: \"week\" | \"isoWeek\";\n /** Classes for datePicker */\n datePickerClass?: string;\n /** Show datePicker in the middle button */\n withDatePicker?: boolean;\n /** Popper class name*/\n popperClassName?: string;\n /** DatePicker menu position */\n position?: Placement;\n}\n\n/**\n * This component allow you to select date range. It accepts two parameters \"from\" and \"to\" as valid format\n * onChange and onBack and onForward it will return \"from: Date\" and \"to: Date\" as function arguments\n */\nexport const DateStepper: FC<IDateStepperProps> = ({\n step,\n formatCallback,\n onChange,\n from,\n to,\n onBack,\n onForward,\n minValue,\n maxValue,\n className,\n period = \"week\",\n datePickerClass,\n withDatePicker = true,\n defaultMonth = new Date(),\n popperClassName,\n position = \"bottom\",\n}) => {\n const [fromDate, setFromDate] = useState(moment(from));\n const [toDate, setToDate] = useState(moment(to));\n const [showDatePicker, setShowDatePicker] = useState(false);\n const [month, setMonth] = useState(defaultMonth);\n\n const getDatesByPeriod = useCallback(\n (interval: number): Moment[] => {\n const date = fromDate ? fromDate : moment();\n if (step === \"daily\") {\n date.add(interval, \"days\");\n return [date, date.clone()];\n } else if (step === \"weekly\") {\n date.add(interval, \"weeks\");\n return [date.clone().startOf(period), date.clone().endOf(period)];\n } else if (step === \"monthly\") {\n date.add(interval, \"months\");\n return [date.clone().startOf(\"month\"), date.clone().endOf(\"month\")];\n } else if (step === \"quarterly\") {\n date.add(interval, \"quarters\");\n return [date.clone().startOf(\"quarter\"), date.clone().endOf(\"quarter\")];\n } else if (step === \"yearly\") {\n date.add(interval, \"years\");\n return [date.clone().startOf(\"year\"), date.clone().endOf(\"year\")];\n }\n return [date, date];\n },\n [fromDate, period, step]\n );\n\n const getDateFormatted = useMemo(() => {\n if (formatCallback) {\n return formatCallback(fromDate.toDate(), toDate.toDate());\n }\n\n const actualYear = moment().year();\n\n const showWeekOrCustomDateFormat = (start, end): string => {\n if (start.year() === actualYear && end.year() === actualYear) {\n return start.format(\"MMM DD\") + \" - \" + end.format(\"MMM DD\");\n } else {\n return start.format(\"MMM DD YYYY\") + \" - \" + end.format(\"MMM DD YYYY\");\n }\n };\n\n if (step === \"daily\") {\n if (fromDate.year() === actualYear) {\n return fromDate.format(\"MMM DD\");\n }\n return fromDate.format(\"MMM DD YYYY\");\n } else if (step === \"weekly\") {\n const startDate = fromDate.clone().startOf(period);\n const endDate = startDate.clone().endOf(period);\n return showWeekOrCustomDateFormat(startDate, endDate);\n } else if (step === \"monthly\") {\n return fromDate.format(\"MMM YYYY\");\n } else if (step === \"quarterly\") {\n return `Q${fromDate.quarter()}/${fromDate.format(\"YYYY\")}`;\n } else if (step === \"yearly\") {\n return fromDate.format(\"YYYY\");\n } else if (step === \"custom\") {\n return showWeekOrCustomDateFormat(fromDate, toDate);\n }\n\n return \"\";\n }, [fromDate, step, toDate, formatCallback, period]);\n\n const onChangeCallback = useCallback(\n (amount: number) => {\n const [newFrom, newTo] = getDatesByPeriod(amount);\n setFromDate(moment(newFrom));\n setToDate(moment(newTo));\n\n if (onChange) {\n onChange(newFrom.toDate(), newTo.toDate());\n }\n },\n [onChange, getDatesByPeriod]\n );\n\n const onDatePickerChange = useCallback(\n (dates?: { from: Date; to: Date }) => {\n const fromDateTemp = dates?.from;\n const toDateTemp = dates?.to;\n\n setFromDate(moment(fromDateTemp));\n setToDate(moment(toDateTemp));\n\n if (\n onChange &&\n fromDateTemp instanceof Date &&\n toDateTemp instanceof Date\n ) {\n onChange(fromDateTemp, toDateTemp);\n }\n },\n [onChange, setFromDate, setToDate]\n );\n\n const isAfterMaxDate = useMemo(() => {\n return (\n maxValue instanceof Date &&\n moment(moment(maxValue).format(\"YYYY-MM-DD\")).isSameOrBefore(\n toDate.format(\"YYYY-MM-DD\")\n )\n );\n }, [maxValue, toDate]);\n\n const isBeforeMinDate = useMemo(() => {\n return (\n minValue instanceof Date &&\n moment(moment(minValue).format(\"YYYY-MM-DD\")).isSameOrAfter(\n toDate.format(\"YYYY-MM-DD\")\n )\n );\n }, [minValue, toDate]);\n\n useEffect(() => {\n if (isBeforeMinDate) {\n if (step === \"daily\") {\n setFromDate(moment(minValue));\n setToDate(moment(minValue));\n }\n }\n if (isAfterMaxDate) {\n if (step === \"daily\") {\n setFromDate(moment(maxValue));\n setToDate(moment(maxValue));\n }\n }\n }, [step, minValue, maxValue, isBeforeMinDate, isAfterMaxDate]);\n\n const onRightClickHandler = useCallback(() => {\n if (isAfterMaxDate) {\n return;\n }\n\n onChangeCallback(1);\n\n if (onForward) {\n onForward(fromDate.toDate(), toDate.toDate());\n }\n }, [isAfterMaxDate, onChangeCallback, onForward, fromDate, toDate]);\n\n const onLeftClickHandler = useCallback(() => {\n if (isBeforeMinDate) {\n return;\n }\n\n onChangeCallback(-1);\n\n if (onBack) {\n onBack(fromDate.toDate(), toDate.toDate());\n }\n }, [isBeforeMinDate, onChangeCallback, onBack, fromDate, toDate]);\n\n const renderLeftRightButtons = useMemo(() => {\n return step !== \"custom\";\n }, [step]);\n\n const handleShow = useCallback(() => {\n setShowDatePicker(!showDatePicker);\n if (fromDate) {\n setMonth(fromDate.toDate());\n }\n }, [setShowDatePicker, showDatePicker, fromDate]);\n\n const closeMenu = useCallback(() => {\n setShowDatePicker(false);\n }, []);\n\n const onMonthChange = useCallback(\n (m: Date) => {\n setMonth(m);\n },\n [setMonth]\n );\n\n useEffect(() => {\n setFromDate(moment(from));\n setToDate(moment(to));\n }, [from, to]);\n\n const dateStepperWidth = (\n fromDay: Moment,\n toDay: Moment,\n range: string\n ): { minWidth: string } => {\n if (\n fromDay.year() !== moment().year() ||\n toDay.year() !== moment().year()\n ) {\n switch (range) {\n case \"daily\":\n case \"monthly\":\n return { minWidth: \"122px\" };\n case \"weekly\":\n case \"custom\":\n return { minWidth: \"232px\" };\n }\n }\n switch (range) {\n case \"monthly\":\n return { minWidth: \"122px\" };\n case \"weekly\":\n case \"custom\":\n return { minWidth: \"182px\" };\n }\n\n return { minWidth: \"102px\" };\n };\n const isDisabled = useCallback(\n (day: Date): boolean => {\n const dayFormat = moment(day).format(\"YYYY-MM-DD\");\n\n const isBefore =\n maxValue instanceof Date &&\n moment(moment(maxValue).format(\"YYYY-MM-DD\")).isBefore(dayFormat);\n const isAfter =\n minValue instanceof Date &&\n moment(moment(minValue).format(\"YYYY-MM-DD\")).isAfter(dayFormat);\n\n return isBefore || isAfter;\n },\n [maxValue, minValue]\n );\n\n const modifiers = useMemo(() => {\n return {\n [customClassNames.disabled]: (day: Date): boolean => {\n return isDisabled(day);\n },\n [customClassNames.nonWorkingDay]: (day: Date): boolean => {\n return isDisabled(day);\n },\n };\n }, [isDisabled]);\n\n return (\n <StyledButtonGroup className={classNames(\"c-date-stepper\", className)}>\n {renderLeftRightButtons ? (\n <StyledControl\n type=\"button\"\n variant=\"secondary\"\n onClick={onLeftClickHandler}\n disabled={isBeforeMinDate}\n >\n <ArrowLeftIcon />\n </StyledControl>\n ) : null}\n <StyledDiv\n $isTargetable={step === \"yearly\" || !withDatePicker}\n $isRounded={step === \"custom\"}\n style={dateStepperWidth(fromDate, toDate, step)}\n >\n {withDatePicker ? (\n <StyledMenu\n target={\n <StyledButton type=\"button\">\n <span>{getDateFormatted}</span>\n </StyledButton>\n }\n open={showDatePicker}\n onOpen={handleShow}\n onClose={closeMenu}\n popperClassName={popperClassName}\n position={position}\n >\n <DatePicker\n month={month}\n localeUtils={MomentLocaleUtils}\n locale=\"en\"\n selectionMode={step}\n className={datePickerClass}\n selectedDays={{ from: fromDate.toDate(), to: toDate.toDate() }}\n onChange={onDatePickerChange}\n onMonthChange={onMonthChange}\n firstDayOfWeek={period === \"week\" ? 0 : 1}\n modifiers={modifiers}\n dateRequired\n fixedWeeks\n />\n </StyledMenu>\n ) : (\n <StyledSpan>{getDateFormatted}</StyledSpan>\n )}\n </StyledDiv>\n {renderLeftRightButtons ? (\n <StyledControl\n type=\"button\"\n variant=\"secondary\"\n onClick={onRightClickHandler}\n disabled={isAfterMaxDate}\n >\n <ArrowRightIcon />\n </StyledControl>\n ) : null}\n </StyledButtonGroup>\n );\n};\n\nDateStepper.displayName = \"DateStepper\";\n"],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
|
10
10
|
export declare const StyledDiv: import("styled-components").StyledComponent<"div", any, StyledDiv, never>;
|
|
11
|
+
export declare const StyledControl: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../Button").IButtonProps & import("react").RefAttributes<HTMLButtonElement>>, any, {}, never>;
|
|
11
12
|
export {};
|
|
12
13
|
//# sourceMappingURL=Styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/Steppers/DateStepper/Styles.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../../src/components/Steppers/DateStepper/Styles.ts"],"names":[],"mappings":";AASA,eAAO,MAAM,YAAY,uEAmDxB,CAAC;AAEF,eAAO,MAAM,UAAU,6GAOtB,CAAC;AAEF,eAAO,MAAM,iBAAiB,6wJAQ7B,CAAC;AAEF,eAAO,MAAM,UAAU,qEAGtB,CAAC;AAEF,UAAU,SAAS;IACjB,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,SAAS,2EAwErB,CAAC;AAEF,eAAO,MAAM,aAAa,gMAEzB,CAAC"}
|
|
@@ -4,6 +4,7 @@ import { FontStyle } from "../../FontStyle";
|
|
|
4
4
|
import { BoxSizingStyle } from "../../BoxSizingStyle";
|
|
5
5
|
import { screen } from "../../BreakPoints";
|
|
6
6
|
import { Menu } from "../../Menu";
|
|
7
|
+
import { Button } from "../../Button";
|
|
7
8
|
export var StyledButton = styled.button.withConfig({
|
|
8
9
|
displayName: "Styles__StyledButton",
|
|
9
10
|
componentId: "sc-1v8h7mt-0"
|
|
@@ -68,9 +69,14 @@ export var StyledDiv = styled.div.withConfig({
|
|
|
68
69
|
"borderWidth": "1px",
|
|
69
70
|
"borderStyle": "solid"
|
|
70
71
|
}, screen.md);
|
|
72
|
+
export var StyledControl = styled(Button).withConfig({
|
|
73
|
+
displayName: "Styles__StyledControl",
|
|
74
|
+
componentId: "sc-1v8h7mt-5"
|
|
75
|
+
})(["border-radius:var(--ac-br-8);"]);
|
|
71
76
|
StyledButtonGroup.displayName = "StyledButtonGroup";
|
|
72
77
|
StyledSpan.displayName = "StyledSpan";
|
|
73
78
|
StyledDiv.displayName = "StyledDiv";
|
|
74
79
|
StyledMenu.displayName = "StyledMenu";
|
|
75
80
|
StyledButton.displayName = "StyledButton";
|
|
81
|
+
StyledControl.displayName = "StyledControl";
|
|
76
82
|
//# sourceMappingURL=Styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.js","names":["styled","css","ButtonGroup","FontStyle","BoxSizingStyle","screen","Menu","StyledButton","button","StyledMenu","StyledButtonGroup","StyledSpan","span","StyledDiv","div","props","$isTargetable","$isRounded","md","displayName"],"sources":["../../../../../src/components/Steppers/DateStepper/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\nimport { ButtonGroup } from \"../../ButtonGroup\";\nimport { FontStyle } from \"../../FontStyle\";\nimport { BoxSizingStyle } from \"../../BoxSizingStyle\";\nimport { screen } from \"../../BreakPoints\";\nimport tw from \"twin.macro\";\nimport { Menu } from \"../../Menu\";\n\nexport const StyledButton = styled.button`\n ${FontStyle}\n ${BoxSizingStyle}\n\n ${tw`\n tw-relative\n tw-antialiased\n tw-align-middle\n tw-font-medium\n tw-inline-block\n tw-leading-none\n tw-m-0\n tw-no-underline\n tw-text-sm\n tw-select-none\n tw-cursor-pointer\n tw-text-center\n `}\n\n color: var(--color-theme-700);\n margin: 0;\n padding: 0;\n background: none;\n width: 100%;\n height: auto;\n border: none;\n height: 30px;\n line-height: 1;\n transition: all 0.3s ease;\n\n svg {\n fill: currentColor;\n }\n\n &::-moz-focus-inner {\n border: 0;\n }\n\n &:focus {\n outline: none;\n }\n\n &:hover {\n text-decoration: none;\n }\n\n &:disabled {\n cursor: default;\n opacity: 50%;\n pointer-events: none;\n }\n`;\n\nexport const StyledMenu = styled(Menu)`\n ${tw`\n tw-w-auto\n tw-h-auto\n tw-py-4\n tw-px-2\n `}\n`;\n\nexport const StyledButtonGroup = styled(ButtonGroup)`\n ${FontStyle}\n ${BoxSizingStyle}\n\n button:hover {\n position: relative;\n z-index: 1;\n }\n`;\n\nexport const StyledSpan = styled.span`\n line-height: 30px;\n color: var(--color-theme-700);\n`;\n\ninterface StyledDiv {\n $isTargetable: boolean;\n $isRounded: boolean;\n}\n\nexport const StyledDiv = styled.div<StyledDiv>`\n ${(props) =>\n props.$isTargetable &&\n css`\n ${tw`tw-pointer-events-none`}\n `}\n\n ${(props) =>\n props.$isRounded &&\n css`\n border-radius: var(--ac-br-rounded);\n `}\n\n ${tw`\n tw-relative\n tw-text-center\n tw-p-0\n tw-antialiased\n tw-align-middle\n tw-font-medium\n tw-inline-block\n tw-leading-none\n tw-m-0\n tw-no-underline\n tw-text-sm\n tw-select-none\n tw-cursor-pointer\n tw-border\n tw-border-solid\n `}\n\n height: 32px;\n transition: all 0.3s ease;\n background-color: transparent;\n border: solid 1px var(--color-theme-700);\n color: var(--color-theme-700);\n margin-right: -1px;\n display: none;\n\n ${screen.md} {\n display: block;\n }\n\n svg {\n fill: currentColor;\n }\n\n &::-moz-focus-inner {\n border: 0;\n }\n\n &:focus {\n outline: none;\n }\n\n &:disabled {\n cursor: default;\n opacity: 50%;\n pointer-events: none;\n }\n\n &:hover {\n border-color: var(--color-primary);\n color: var(--color-primary);\n text-decoration: none;\n }\n\n &:active {\n border-color: var(--color-primary);\n color: var(--color-primary);\n background-color: var(--color-primary-200);\n }\n`;\n\nStyledButtonGroup.displayName = \"StyledButtonGroup\";\nStyledSpan.displayName = \"StyledSpan\";\nStyledDiv.displayName = \"StyledDiv\";\nStyledMenu.displayName = \"StyledMenu\";\nStyledButton.displayName = \"StyledButton\";\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAC/C,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,cAAc,QAAQ,sBAAsB;AACrD,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,SAASC,IAAI,QAAQ,YAAY;
|
|
1
|
+
{"version":3,"file":"Styles.js","names":["styled","css","ButtonGroup","FontStyle","BoxSizingStyle","screen","Menu","Button","StyledButton","button","StyledMenu","StyledButtonGroup","StyledSpan","span","StyledDiv","div","props","$isTargetable","$isRounded","md","StyledControl","displayName"],"sources":["../../../../../src/components/Steppers/DateStepper/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\nimport { ButtonGroup } from \"../../ButtonGroup\";\nimport { FontStyle } from \"../../FontStyle\";\nimport { BoxSizingStyle } from \"../../BoxSizingStyle\";\nimport { screen } from \"../../BreakPoints\";\nimport tw from \"twin.macro\";\nimport { Menu } from \"../../Menu\";\nimport { Button } from \"../../Button\";\n\nexport const StyledButton = styled.button`\n ${FontStyle}\n ${BoxSizingStyle}\n\n ${tw`\n tw-relative\n tw-antialiased\n tw-align-middle\n tw-font-medium\n tw-inline-block\n tw-leading-none\n tw-m-0\n tw-no-underline\n tw-text-sm\n tw-select-none\n tw-cursor-pointer\n tw-text-center\n `}\n\n color: var(--color-theme-700);\n margin: 0;\n padding: 0;\n background: none;\n width: 100%;\n height: auto;\n border: none;\n height: 30px;\n line-height: 1;\n transition: all 0.3s ease;\n\n svg {\n fill: currentColor;\n }\n\n &::-moz-focus-inner {\n border: 0;\n }\n\n &:focus {\n outline: none;\n }\n\n &:hover {\n text-decoration: none;\n }\n\n &:disabled {\n cursor: default;\n opacity: 50%;\n pointer-events: none;\n }\n`;\n\nexport const StyledMenu = styled(Menu)`\n ${tw`\n tw-w-auto\n tw-h-auto\n tw-py-4\n tw-px-2\n `}\n`;\n\nexport const StyledButtonGroup = styled(ButtonGroup)`\n ${FontStyle}\n ${BoxSizingStyle}\n\n button:hover {\n position: relative;\n z-index: 1;\n }\n`;\n\nexport const StyledSpan = styled.span`\n line-height: 30px;\n color: var(--color-theme-700);\n`;\n\ninterface StyledDiv {\n $isTargetable: boolean;\n $isRounded: boolean;\n}\n\nexport const StyledDiv = styled.div<StyledDiv>`\n ${(props) =>\n props.$isTargetable &&\n css`\n ${tw`tw-pointer-events-none`}\n `}\n\n ${(props) =>\n props.$isRounded &&\n css`\n border-radius: var(--ac-br-rounded);\n `}\n\n ${tw`\n tw-relative\n tw-text-center\n tw-p-0\n tw-antialiased\n tw-align-middle\n tw-font-medium\n tw-inline-block\n tw-leading-none\n tw-m-0\n tw-no-underline\n tw-text-sm\n tw-select-none\n tw-cursor-pointer\n tw-border\n tw-border-solid\n `}\n\n height: 32px;\n transition: all 0.3s ease;\n background-color: transparent;\n border: solid 1px var(--color-theme-700);\n color: var(--color-theme-700);\n margin-right: -1px;\n display: none;\n\n ${screen.md} {\n display: block;\n }\n\n svg {\n fill: currentColor;\n }\n\n &::-moz-focus-inner {\n border: 0;\n }\n\n &:focus {\n outline: none;\n }\n\n &:disabled {\n cursor: default;\n opacity: 50%;\n pointer-events: none;\n }\n\n &:hover {\n border-color: var(--color-primary);\n color: var(--color-primary);\n text-decoration: none;\n }\n\n &:active {\n border-color: var(--color-primary);\n color: var(--color-primary);\n background-color: var(--color-primary-200);\n }\n`;\n\nexport const StyledControl = styled(Button)`\n border-radius: var(--ac-br-8);\n`;\n\nStyledButtonGroup.displayName = \"StyledButtonGroup\";\nStyledSpan.displayName = \"StyledSpan\";\nStyledDiv.displayName = \"StyledDiv\";\nStyledMenu.displayName = \"StyledMenu\";\nStyledButton.displayName = \"StyledButton\";\nStyledControl.displayName = \"StyledControl\";\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAC/C,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,cAAc,QAAQ,sBAAsB;AACrD,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,SAASC,IAAI,QAAQ,YAAY;AACjC,SA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ACC,WAAW,GAAG,eAAe"}
|
package/dist/index.js
CHANGED
|
@@ -4917,11 +4917,16 @@
|
|
|
4917
4917
|
"borderWidth": "1px",
|
|
4918
4918
|
"borderStyle": "solid"
|
|
4919
4919
|
}, screen.md);
|
|
4920
|
+
var StyledControl = styled__default["default"](Button).withConfig({
|
|
4921
|
+
displayName: "Styles__StyledControl",
|
|
4922
|
+
componentId: "sc-1v8h7mt-5"
|
|
4923
|
+
})(["border-radius:var(--ac-br-8);"]);
|
|
4920
4924
|
StyledButtonGroup.displayName = "StyledButtonGroup";
|
|
4921
4925
|
StyledSpan$1.displayName = "StyledSpan";
|
|
4922
4926
|
StyledDiv$1.displayName = "StyledDiv";
|
|
4923
4927
|
StyledMenu$1.displayName = "StyledMenu";
|
|
4924
4928
|
StyledButton$1.displayName = "StyledButton";
|
|
4929
|
+
StyledControl.displayName = "StyledControl";
|
|
4925
4930
|
|
|
4926
4931
|
/**
|
|
4927
4932
|
* This component allow you to select date range. It accepts two parameters "from" and "to" as valid format
|
|
@@ -5139,7 +5144,7 @@
|
|
|
5139
5144
|
}, [isDisabled]);
|
|
5140
5145
|
return /*#__PURE__*/React__default["default"].createElement(StyledButtonGroup, {
|
|
5141
5146
|
className: classNames__default["default"]("c-date-stepper", className)
|
|
5142
|
-
}, renderLeftRightButtons ? /*#__PURE__*/React__default["default"].createElement(
|
|
5147
|
+
}, renderLeftRightButtons ? /*#__PURE__*/React__default["default"].createElement(StyledControl, {
|
|
5143
5148
|
type: "button",
|
|
5144
5149
|
variant: "secondary",
|
|
5145
5150
|
onClick: onLeftClickHandler,
|
|
@@ -5173,7 +5178,7 @@
|
|
|
5173
5178
|
modifiers: modifiers,
|
|
5174
5179
|
dateRequired: true,
|
|
5175
5180
|
fixedWeeks: true
|
|
5176
|
-
})) : /*#__PURE__*/React__default["default"].createElement(StyledSpan$1, null, getDateFormatted)), renderLeftRightButtons ? /*#__PURE__*/React__default["default"].createElement(
|
|
5181
|
+
})) : /*#__PURE__*/React__default["default"].createElement(StyledSpan$1, null, getDateFormatted)), renderLeftRightButtons ? /*#__PURE__*/React__default["default"].createElement(StyledControl, {
|
|
5177
5182
|
type: "button",
|
|
5178
5183
|
variant: "secondary",
|
|
5179
5184
|
onClick: onRightClickHandler,
|
|
@@ -9189,73 +9194,101 @@
|
|
|
9189
9194
|
})(["padding:20px 30px;", " ", ""], FontStyle, BoxSizingStyle);
|
|
9190
9195
|
StyledDialogActions.displayName = "StyledDialogActions";
|
|
9191
9196
|
|
|
9192
|
-
var
|
|
9197
|
+
var _excluded$m = ["children", "className", "disableDefaultHeading"];
|
|
9198
|
+
// import { useDialogContext } from "./DialogContext";
|
|
9199
|
+
|
|
9200
|
+
var DialogTitle = function DialogTitle(_ref) {
|
|
9193
9201
|
var children = _ref.children,
|
|
9194
|
-
_ref$open = _ref.open,
|
|
9195
|
-
open = _ref$open === void 0 ? false : _ref$open,
|
|
9196
|
-
onClose = _ref.onClose,
|
|
9197
9202
|
className = _ref.className,
|
|
9198
|
-
_ref$
|
|
9199
|
-
|
|
9200
|
-
|
|
9201
|
-
|
|
9202
|
-
|
|
9203
|
-
|
|
9204
|
-
|
|
9205
|
-
|
|
9206
|
-
|
|
9207
|
-
|
|
9208
|
-
|
|
9209
|
-
|
|
9210
|
-
|
|
9211
|
-
className: classNames__default["default"]("c-dialog", className)
|
|
9212
|
-
}, children)));
|
|
9213
|
-
});
|
|
9214
|
-
Dialog.displayName = "Dialog";
|
|
9203
|
+
_ref$disableDefaultHe = _ref.disableDefaultHeading,
|
|
9204
|
+
disableDefaultHeading = _ref$disableDefaultHe === void 0 ? false : _ref$disableDefaultHe,
|
|
9205
|
+
rest = _objectWithoutProperties(_ref, _excluded$m);
|
|
9206
|
+
// useDialogContext();
|
|
9207
|
+
|
|
9208
|
+
return /*#__PURE__*/React__default["default"].createElement(StyledDialogTitle, _extends({
|
|
9209
|
+
className: classNames__default["default"]("c-dialog-title-wrapper", className)
|
|
9210
|
+
}, rest), disableDefaultHeading ? children : /*#__PURE__*/React__default["default"].createElement(Header3, null, children));
|
|
9211
|
+
};
|
|
9212
|
+
DialogTitle.displayName = "DialogTitle";
|
|
9213
|
+
|
|
9214
|
+
var _excluded$l = ["className", "children"];
|
|
9215
|
+
// import { useDialogContext } from "./DialogContext";
|
|
9215
9216
|
|
|
9216
|
-
var _excluded$m = ["className", "children"];
|
|
9217
9217
|
var DialogContent = function DialogContent(_ref) {
|
|
9218
9218
|
var className = _ref.className,
|
|
9219
9219
|
children = _ref.children,
|
|
9220
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
9220
|
+
rest = _objectWithoutProperties(_ref, _excluded$l);
|
|
9221
|
+
// useDialogContext();
|
|
9222
|
+
|
|
9221
9223
|
return /*#__PURE__*/React__default["default"].createElement(StyledDialogContent, _extends({
|
|
9222
9224
|
className: classNames__default["default"]("c-dialog-content", className)
|
|
9223
9225
|
}, rest), children);
|
|
9224
9226
|
};
|
|
9225
9227
|
DialogContent.displayName = "DialogContent";
|
|
9226
9228
|
|
|
9229
|
+
// import { useDialogContext } from "./DialogContext";
|
|
9230
|
+
|
|
9227
9231
|
var DialogContentDivider = function DialogContentDivider(_ref) {
|
|
9228
9232
|
var className = _ref.className;
|
|
9233
|
+
// useDialogContext();
|
|
9234
|
+
|
|
9229
9235
|
return /*#__PURE__*/React__default["default"].createElement(StyledDialogContentDivider, {
|
|
9230
9236
|
className: classNames__default["default"]("c-dialog-content-divider", className)
|
|
9231
9237
|
});
|
|
9232
9238
|
};
|
|
9233
9239
|
DialogContentDivider.displayName = "DialogContentDivider";
|
|
9234
9240
|
|
|
9235
|
-
var _excluded$l = ["children", "className", "disableDefaultHeading"];
|
|
9236
|
-
var DialogTitle = function DialogTitle(_ref) {
|
|
9237
|
-
var children = _ref.children,
|
|
9238
|
-
className = _ref.className,
|
|
9239
|
-
_ref$disableDefaultHe = _ref.disableDefaultHeading,
|
|
9240
|
-
disableDefaultHeading = _ref$disableDefaultHe === void 0 ? false : _ref$disableDefaultHe,
|
|
9241
|
-
rest = _objectWithoutProperties(_ref, _excluded$l);
|
|
9242
|
-
return /*#__PURE__*/React__default["default"].createElement(StyledDialogTitle, _extends({
|
|
9243
|
-
className: classNames__default["default"]("c-dialog-title-wrapper", className)
|
|
9244
|
-
}, rest), disableDefaultHeading ? children : /*#__PURE__*/React__default["default"].createElement(Header3, null, children));
|
|
9245
|
-
};
|
|
9246
|
-
DialogTitle.displayName = "DialogTitle";
|
|
9247
|
-
|
|
9248
9241
|
var _excluded$k = ["className", "children"];
|
|
9242
|
+
// import { useDialogContext } from "./DialogContext";
|
|
9243
|
+
|
|
9249
9244
|
var DialogActions = function DialogActions(_ref) {
|
|
9250
9245
|
var className = _ref.className,
|
|
9251
9246
|
children = _ref.children,
|
|
9252
9247
|
rest = _objectWithoutProperties(_ref, _excluded$k);
|
|
9248
|
+
// useDialogContext();
|
|
9249
|
+
|
|
9253
9250
|
return /*#__PURE__*/React__default["default"].createElement(StyledDialogActions, _extends({
|
|
9254
9251
|
className: classNames__default["default"]("c-dialog-actions", className)
|
|
9255
9252
|
}, rest), children);
|
|
9256
9253
|
};
|
|
9257
9254
|
DialogActions.displayName = "DialogActions";
|
|
9258
9255
|
|
|
9256
|
+
var _Dialog = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
9257
|
+
var children = _ref.children,
|
|
9258
|
+
_ref$open = _ref.open,
|
|
9259
|
+
open = _ref$open === void 0 ? false : _ref$open,
|
|
9260
|
+
onClose = _ref.onClose,
|
|
9261
|
+
className = _ref.className,
|
|
9262
|
+
_ref$enableBackground = _ref.enableBackgroundClick,
|
|
9263
|
+
enableBackgroundClick = _ref$enableBackground === void 0 ? false : _ref$enableBackground,
|
|
9264
|
+
_ref$disableCloseOnEs = _ref.disableCloseOnEsc,
|
|
9265
|
+
disableCloseOnEsc = _ref$disableCloseOnEs === void 0 ? false : _ref$disableCloseOnEs;
|
|
9266
|
+
return (
|
|
9267
|
+
/*#__PURE__*/
|
|
9268
|
+
// <DialogContext.Provider value={{}}>
|
|
9269
|
+
React__default["default"].createElement(Modal, {
|
|
9270
|
+
ref: ref,
|
|
9271
|
+
open: open,
|
|
9272
|
+
onClose: onClose,
|
|
9273
|
+
disableBackgroundClick: !enableBackgroundClick,
|
|
9274
|
+
disableCloseOnEsc: disableCloseOnEsc
|
|
9275
|
+
}, /*#__PURE__*/React__default["default"].createElement(SlideFromTop, {
|
|
9276
|
+
in: open
|
|
9277
|
+
}, /*#__PURE__*/React__default["default"].createElement(StyledDialog, {
|
|
9278
|
+
className: classNames__default["default"]("c-dialog", className)
|
|
9279
|
+
}, children)))
|
|
9280
|
+
// </DialogContext.Provider>
|
|
9281
|
+
);
|
|
9282
|
+
});
|
|
9283
|
+
|
|
9284
|
+
var Dialog = Object.assign({}, _Dialog, {
|
|
9285
|
+
Title: DialogTitle,
|
|
9286
|
+
Content: DialogContent,
|
|
9287
|
+
ContentDivider: DialogContentDivider,
|
|
9288
|
+
Actions: DialogActions
|
|
9289
|
+
});
|
|
9290
|
+
_Dialog.displayName = "Dialog";
|
|
9291
|
+
|
|
9259
9292
|
var ConfirmDialog = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
9260
9293
|
var _ref$open = _ref.open,
|
|
9261
9294
|
open = _ref$open === void 0 ? false : _ref$open,
|
|
@@ -12621,6 +12654,7 @@
|
|
|
12621
12654
|
exports.Wizard = Wizard;
|
|
12622
12655
|
exports.WorkloadIcon = WorkloadIcon$1;
|
|
12623
12656
|
exports.YearMonthPicker = YearMonthPicker;
|
|
12657
|
+
exports._Dialog = _Dialog;
|
|
12624
12658
|
exports.isOptionGroup = isOptionGroup;
|
|
12625
12659
|
exports.layers = layers;
|
|
12626
12660
|
exports.signifierTypes = signifierTypes;
|