@activecollab/components 2.0.542 → 2.0.544
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/CommandPalette/CommandPalette.js +3 -1
- package/dist/cjs/components/CommandPalette/CommandPalette.js.map +1 -1
- package/dist/cjs/components/ConfirmDialog/ConfirmDialog.js +4 -4
- package/dist/cjs/components/ConfirmDialog/ConfirmDialog.js.map +1 -1
- package/dist/cjs/components/Dialog/Dialog.js +12 -9
- package/dist/cjs/components/Dialog/Dialog.js.map +1 -1
- package/dist/cjs/components/Dialog/DialogContext.js.map +1 -1
- package/dist/cjs/components/Dialog/DialogFrame.js +24 -103
- package/dist/cjs/components/Dialog/DialogFrame.js.map +1 -1
- package/dist/cjs/components/Dialog/usePropWarning.js +34 -0
- package/dist/cjs/components/Dialog/usePropWarning.js.map +1 -0
- package/dist/cjs/components/ModalRoot/ModalRoot.js +32 -8
- package/dist/cjs/components/ModalRoot/ModalRoot.js.map +1 -1
- package/dist/cjs/components/ModalRoot/modalRootStack.js +18 -4
- package/dist/cjs/components/ModalRoot/modalRootStack.js.map +1 -1
- package/dist/cjs/components/ObjectFormModal/ObjectFormModal.js +13 -12
- package/dist/cjs/components/ObjectFormModal/ObjectFormModal.js.map +1 -1
- package/dist/cjs/components/Sheet/Sheet.js +17 -5
- package/dist/cjs/components/Sheet/Sheet.js.map +1 -1
- package/dist/cjs/components/Sheet/useHostAboveOpenModal.js +7 -0
- package/dist/cjs/components/Sheet/useHostAboveOpenModal.js.map +1 -1
- package/dist/cjs/components/Wizard/Wizard.js +1 -0
- package/dist/cjs/components/Wizard/Wizard.js.map +1 -1
- package/dist/cjs/presentation/listView/columns.js +622 -184
- package/dist/cjs/presentation/listView/columns.js.map +1 -1
- package/dist/cjs/presentation/myWork/MyWorkListSettingsDialog.js +1 -1
- package/dist/cjs/presentation/myWork/MyWorkListSettingsDialog.js.map +1 -1
- package/dist/cjs/presentation/reports/availabilityExport.js +1 -1
- package/dist/cjs/presentation/reports/availabilityExport.js.map +1 -1
- package/dist/cjs/presentation/selfHostedRedesign/parts.js +6 -6
- package/dist/cjs/presentation/selfHostedRedesign/parts.js.map +1 -1
- package/dist/cjs/presentation/shared/LinkingCommandsButton.js +1 -1
- package/dist/cjs/presentation/shared/LinkingCommandsButton.js.map +1 -1
- package/dist/cjs/presentation/shared/MessageDialog.js +1 -1
- package/dist/cjs/presentation/shared/MessageDialog.js.map +1 -1
- package/dist/cjs/presentation/shared/MessageFeedback.js +1 -1
- package/dist/cjs/presentation/shared/MessageFeedback.js.map +1 -1
- package/dist/cjs/presentation/shared/ProjectOptionsMenu.js +1 -1
- package/dist/cjs/presentation/shared/ProjectOptionsMenu.js.map +1 -1
- package/dist/cjs/presentation/shared/SourceCodeSection.js +2 -2
- package/dist/cjs/presentation/shared/SourceCodeSection.js.map +1 -1
- package/dist/cjs/presentation/shared/UserDetailsDialog.js +1 -1
- package/dist/cjs/presentation/shared/UserDetailsDialog.js.map +1 -1
- package/dist/cjs/presentation/shared/WebhookLogsDialog.js +1 -1
- package/dist/cjs/presentation/shared/WebhookLogsDialog.js.map +1 -1
- package/dist/cjs/presentation/shared/selfHostedSettings.js +1 -1
- package/dist/cjs/presentation/shared/selfHostedSettings.js.map +1 -1
- package/dist/cjs/presentation/shared/selfHostedUpgrade.js +3 -3
- package/dist/cjs/presentation/shared/selfHostedUpgrade.js.map +1 -1
- package/dist/cjs/presentation/shared/systemSettingsDialog.js +1 -1
- package/dist/cjs/presentation/shared/systemSettingsDialog.js.map +1 -1
- package/dist/cjs/presentation/whiteboard/peopleMenu.js +1 -1
- package/dist/cjs/presentation/whiteboard/peopleMenu.js.map +1 -1
- package/dist/cjs/presentation/whiteboard/projectElements.js +1 -1
- package/dist/cjs/presentation/whiteboard/projectElements.js.map +1 -1
- package/dist/esm/components/CommandPalette/CommandPalette.d.ts +2 -2
- package/dist/esm/components/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/esm/components/CommandPalette/CommandPalette.js +3 -1
- package/dist/esm/components/CommandPalette/CommandPalette.js.map +1 -1
- package/dist/esm/components/ConfirmDialog/ConfirmDialog.d.ts +5 -2
- package/dist/esm/components/ConfirmDialog/ConfirmDialog.d.ts.map +1 -1
- package/dist/esm/components/ConfirmDialog/ConfirmDialog.js +4 -4
- package/dist/esm/components/ConfirmDialog/ConfirmDialog.js.map +1 -1
- package/dist/esm/components/DatePicker/Styles.d.ts +1 -1
- package/dist/esm/components/DatePicker/Styles.d.ts.map +1 -1
- package/dist/esm/components/Dialog/Dialog.d.ts +22 -4
- package/dist/esm/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/esm/components/Dialog/Dialog.js +12 -9
- package/dist/esm/components/Dialog/Dialog.js.map +1 -1
- package/dist/esm/components/Dialog/DialogContext.d.ts +2 -2
- package/dist/esm/components/Dialog/DialogContext.d.ts.map +1 -1
- package/dist/esm/components/Dialog/DialogContext.js.map +1 -1
- package/dist/esm/components/Dialog/DialogFrame.d.ts +5 -6
- package/dist/esm/components/Dialog/DialogFrame.d.ts.map +1 -1
- package/dist/esm/components/Dialog/DialogFrame.js +26 -103
- package/dist/esm/components/Dialog/DialogFrame.js.map +1 -1
- package/dist/esm/components/Dialog/usePropWarning.d.ts +13 -0
- package/dist/esm/components/Dialog/usePropWarning.d.ts.map +1 -0
- package/dist/esm/components/Dialog/usePropWarning.js +26 -0
- package/dist/esm/components/Dialog/usePropWarning.js.map +1 -0
- package/dist/esm/components/ModalRoot/ModalRoot.d.ts +10 -0
- package/dist/esm/components/ModalRoot/ModalRoot.d.ts.map +1 -1
- package/dist/esm/components/ModalRoot/ModalRoot.js +32 -8
- package/dist/esm/components/ModalRoot/ModalRoot.js.map +1 -1
- package/dist/esm/components/ModalRoot/modalRootStack.d.ts +8 -2
- package/dist/esm/components/ModalRoot/modalRootStack.d.ts.map +1 -1
- package/dist/esm/components/ModalRoot/modalRootStack.js +18 -4
- package/dist/esm/components/ModalRoot/modalRootStack.js.map +1 -1
- package/dist/esm/components/ObjectFormModal/ObjectFormModal.d.ts +9 -1
- package/dist/esm/components/ObjectFormModal/ObjectFormModal.d.ts.map +1 -1
- package/dist/esm/components/ObjectFormModal/ObjectFormModal.js +13 -12
- package/dist/esm/components/ObjectFormModal/ObjectFormModal.js.map +1 -1
- package/dist/esm/components/SelectDate/Styles.d.ts +1 -1
- package/dist/esm/components/SelectDate/Styles.d.ts.map +1 -1
- package/dist/esm/components/Sheet/Sheet.d.ts +6 -1
- package/dist/esm/components/Sheet/Sheet.d.ts.map +1 -1
- package/dist/esm/components/Sheet/Sheet.js +17 -5
- package/dist/esm/components/Sheet/Sheet.js.map +1 -1
- package/dist/esm/components/Sheet/useHostAboveOpenModal.d.ts.map +1 -1
- package/dist/esm/components/Sheet/useHostAboveOpenModal.js +9 -2
- package/dist/esm/components/Sheet/useHostAboveOpenModal.js.map +1 -1
- package/dist/esm/components/Wizard/Wizard.d.ts +1 -1
- package/dist/esm/components/Wizard/Wizard.d.ts.map +1 -1
- package/dist/esm/components/Wizard/Wizard.js +1 -0
- package/dist/esm/components/Wizard/Wizard.js.map +1 -1
- package/dist/esm/presentation/listView/columns.d.ts +20 -7
- package/dist/esm/presentation/listView/columns.d.ts.map +1 -1
- package/dist/esm/presentation/listView/columns.js +538 -166
- package/dist/esm/presentation/listView/columns.js.map +1 -1
- package/dist/esm/presentation/myWork/MyWorkListSettingsDialog.js +1 -1
- package/dist/esm/presentation/myWork/MyWorkListSettingsDialog.js.map +1 -1
- package/dist/esm/presentation/reports/availabilityExport.js +1 -1
- package/dist/esm/presentation/reports/availabilityExport.js.map +1 -1
- package/dist/esm/presentation/selfHostedRedesign/parts.js +6 -6
- package/dist/esm/presentation/selfHostedRedesign/parts.js.map +1 -1
- package/dist/esm/presentation/shared/LinkingCommandsButton.js +1 -1
- package/dist/esm/presentation/shared/LinkingCommandsButton.js.map +1 -1
- package/dist/esm/presentation/shared/MessageDialog.js +1 -1
- package/dist/esm/presentation/shared/MessageDialog.js.map +1 -1
- package/dist/esm/presentation/shared/MessageFeedback.js +1 -1
- package/dist/esm/presentation/shared/MessageFeedback.js.map +1 -1
- package/dist/esm/presentation/shared/ProjectOptionsMenu.js +1 -1
- package/dist/esm/presentation/shared/ProjectOptionsMenu.js.map +1 -1
- package/dist/esm/presentation/shared/SourceCodeSection.js +2 -2
- package/dist/esm/presentation/shared/SourceCodeSection.js.map +1 -1
- package/dist/esm/presentation/shared/UserDetailsDialog.js +1 -1
- package/dist/esm/presentation/shared/UserDetailsDialog.js.map +1 -1
- package/dist/esm/presentation/shared/WebhookLogsDialog.js +1 -1
- package/dist/esm/presentation/shared/WebhookLogsDialog.js.map +1 -1
- package/dist/esm/presentation/shared/selfHostedSettings.js +1 -1
- package/dist/esm/presentation/shared/selfHostedSettings.js.map +1 -1
- package/dist/esm/presentation/shared/selfHostedUpgrade.js +3 -3
- package/dist/esm/presentation/shared/selfHostedUpgrade.js.map +1 -1
- package/dist/esm/presentation/shared/systemSettingsDialog.d.ts.map +1 -1
- package/dist/esm/presentation/shared/systemSettingsDialog.js +1 -1
- package/dist/esm/presentation/shared/systemSettingsDialog.js.map +1 -1
- package/dist/esm/presentation/whiteboard/peopleMenu.js +1 -1
- package/dist/esm/presentation/whiteboard/peopleMenu.js.map +1 -1
- package/dist/esm/presentation/whiteboard/projectElements.js +1 -1
- package/dist/esm/presentation/whiteboard/projectElements.js.map +1 -1
- package/dist/index.js +368 -364
- 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":"ConfirmDialog.js","names":["React","forwardRef","useCallback","useEffect","useState","classnames","Button","Checkbox","Dialog","StyledConfirmation","Body2","CONFIRMATION_CHECKBOX_ID","ConfirmDialog","_ref","ref","_ref$open","open","onCancel","onConfirm","className","_ref$dialogTitle","dialogTitle","_ref$dialogContent","dialogContent","_ref$confirmBtnText","confirmBtnText","_ref$cancelBtnText","cancelBtnText","_ref$shouldShowCancel","shouldShowCancelButton","_ref$isLoading","isLoading","confirmationLabel","size","height","
|
|
1
|
+
{"version":3,"file":"ConfirmDialog.js","names":["React","forwardRef","useCallback","useEffect","useState","classnames","Button","Checkbox","Dialog","StyledConfirmation","usePropWarning","Body2","CONFIRMATION_CHECKBOX_ID","ConfirmDialog","_ref","ref","_ref$open","open","onCancel","onConfirm","className","_ref$dialogTitle","dialogTitle","_ref$dialogContent","dialogContent","_ref$confirmBtnText","confirmBtnText","_ref$cancelBtnText","cancelBtnText","_ref$shouldShowCancel","shouldShowCancelButton","_ref$isLoading","isLoading","confirmationLabel","size","height","native","_useState","confirmed","setConfirmed","isConfirmBlocked","Boolean","handleToggleConfirmed","event","target","checked","handleKeyDown","key","preventDefault","window","addEventListener","removeEventListener","createElement","onClose","disableCloseOnEsc","role","Title","ContentDivider","Content","lineHeight","color","whitespace","id","onChange","disabled","htmlFor","Actions","variant","onClick","type","displayName"],"sources":["../../../../src/components/ConfirmDialog/ConfirmDialog.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useEffect, useState } from \"react\";\n\nimport classnames from \"classnames\";\n\nimport { Button } from \"../Button/Button\";\nimport { Checkbox } from \"../Checkbox\";\nimport { Dialog } from \"../Dialog\";\nimport { StyledConfirmation } from \"./Styles\";\nimport { DialogSize } from \"../Dialog/Styles\";\nimport { usePropWarning } from \"../Dialog/usePropWarning\";\nimport { Body2 } from \"../Typography/Variants/Body2\";\n\nconst CONFIRMATION_CHECKBOX_ID = \"confirm-dialog-confirmation\";\n\nexport interface ConfirmDialogProps {\n open?: boolean;\n onCancel?: () => void;\n onConfirm?: () => void;\n className?: string;\n dialogTitle?: string;\n dialogContent?: React.ReactNode;\n confirmBtnText?: string;\n cancelBtnText?: string;\n shouldShowCancelButton?: boolean;\n isLoading?: boolean;\n confirmationLabel?: string;\n size?: DialogSize;\n height?: string;\n /**\n * @deprecated Every confirmation is a native modal alert dialog now. The prop is ignored, with a warning in\n * development, and will be removed.\n */\n native?: boolean;\n}\n\nexport const ConfirmDialog = forwardRef<HTMLDialogElement, ConfirmDialogProps>(\n (\n {\n open = false,\n onCancel,\n onConfirm,\n className,\n dialogTitle = \"Discard changes?\",\n dialogContent = \"All unsaved changes will be lost.\",\n confirmBtnText = \"OK\",\n cancelBtnText = \"Cancel\",\n shouldShowCancelButton = true,\n isLoading = false,\n confirmationLabel,\n size,\n height,\n native,\n },\n ref\n ) => {\n const [confirmed, setConfirmed] = useState(false);\n\n usePropWarning(\n \"ConfirmDialog\",\n \"native\",\n native,\n \"removed\",\n \"Every confirmation is a native modal now, so remove it.\"\n );\n const isConfirmBlocked = Boolean(confirmationLabel) && !confirmed;\n\n const handleToggleConfirmed = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) =>\n setConfirmed(event.target.checked),\n []\n );\n\n useEffect(() => {\n if (!open) {\n setConfirmed(false);\n }\n }, [open]);\n\n useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (\n event.key === \"Enter\" &&\n onConfirm &&\n !isConfirmBlocked &&\n !isLoading\n ) {\n event.preventDefault();\n onConfirm();\n }\n };\n\n if (open) {\n window.addEventListener(\"keydown\", handleKeyDown);\n }\n\n return () => {\n window.removeEventListener(\"keydown\", handleKeyDown);\n };\n }, [open, onConfirm, isConfirmBlocked, isLoading]);\n\n return (\n <Dialog\n ref={ref}\n open={open}\n onClose={onCancel}\n className={classnames(\"c-confirm-dialog\", className)}\n disableCloseOnEsc={isLoading}\n size={size}\n height={height}\n role=\"alertdialog\"\n >\n <Dialog.Title>{dialogTitle}</Dialog.Title>\n <Dialog.ContentDivider />\n <Dialog.Content>\n <Body2 lineHeight=\"loose\" color=\"secondary\" whitespace=\"pre-line\">\n {dialogContent}\n </Body2>\n {confirmationLabel ? (\n <StyledConfirmation className=\"c-confirm-dialog--confirmation\">\n <Checkbox\n id={CONFIRMATION_CHECKBOX_ID}\n checked={confirmed}\n onChange={handleToggleConfirmed}\n disabled={isLoading}\n />\n <label htmlFor={CONFIRMATION_CHECKBOX_ID}>\n <Body2 color=\"secondary\">{confirmationLabel}</Body2>\n </label>\n </StyledConfirmation>\n ) : null}\n </Dialog.Content>\n <Dialog.ContentDivider />\n <Dialog.Actions>\n <Button\n variant=\"primary\"\n onClick={onConfirm}\n disabled={isLoading || isConfirmBlocked}\n >\n {confirmBtnText}\n </Button>\n {shouldShowCancelButton ? (\n <Button\n variant=\"secondary\"\n data-action=\"cancel\"\n onClick={onCancel}\n type=\"button\"\n disabled={isLoading}\n >\n {cancelBtnText}\n </Button>\n ) : null}\n </Dialog.Actions>\n </Dialog>\n );\n }\n);\n\nConfirmDialog.displayName = \"ConfirmDialog\";\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAE3E,OAAOC,UAAU,MAAM,YAAY;AAEnC,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,QAAQ,QAAQ,aAAa;AACtC,SAASC,MAAM,QAAQ,WAAW;AAClC,SAASC,kBAAkB,QAAQ,UAAU;AAE7C,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,KAAK,QAAQ,8BAA8B;AAEpD,MAAMC,wBAAwB,GAAG,6BAA6B;AAuB9D,OAAO,MAAMC,aAAa,gBAAGZ,UAAU,CACrC,CAAAa,IAAA,EAiBEC,GAAG,KACA;EAAA,IAAAC,SAAA,GAAAF,IAAA,CAhBDG,IAAI;IAAJA,IAAI,GAAAD,SAAA,cAAG,KAAK,GAAAA,SAAA;IACZE,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;IACRC,SAAS,GAAAL,IAAA,CAATK,SAAS;IACTC,SAAS,GAAAN,IAAA,CAATM,SAAS;IAAAC,gBAAA,GAAAP,IAAA,CACTQ,WAAW;IAAXA,WAAW,GAAAD,gBAAA,cAAG,kBAAkB,GAAAA,gBAAA;IAAAE,kBAAA,GAAAT,IAAA,CAChCU,aAAa;IAAbA,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ACnByB,QAAQ,EAAErB,qBAAsB;IAChCsB,QAAQ,EAAEhC;EAAU,CACrB,CAAC,eACFhC,KAAA,CAAAoD,aAAA;IAAOa,OAAO,EAAErD;EAAyB,gBACvCZ,KAAA,CAAAoD,aAAA,CAACzC,KAAK;IAACiD,KAAK,EAAC;EAAW,GAAE3B,iBAAyB,CAC9C,CACW,CAAC,GACnB,IACU,CAAC,eACjBjC,KAAA,CAAAoD,aAAA,CAAC5C,MAAM,CAACiD,cAAc,MAAE,CAAC,eACzBzD,KAAA,CAAAoD,aAAA,CAAC5C,MAAM,CAAC0D,OAAO,qBACblE,KAAA,CAAAoD,aAAA,CAAC9C,MAAM;IACL6D,OAAO,EAAC,SAAS;IACjBC,OAAO,EAAEjD,SAAU;IACnB6C,QAAQ,EAAEhC,SAAS,IAAIQ;EAAiB,GAEvCd,cACK,CAAC,EACRI,sBAAsB,gBACrB9B,KAAA,CAAAoD,aAAA,CAAC9C,MAAM;IACL6D,OAAO,EAAC,WAAW;IACnB,eAAY,QAAQ;IACpBC,OAAO,EAAElD,QAAS;IAClBmD,IAAI,EAAC,QAAQ;IACbL,QAAQ,EAAEhC;EAAU,GAEnBJ,aACK,CAAC,GACP,IACU,CACV,CAAC;AAEb,CACF,CAAC;AAEDf,aAAa,CAACyD,WAAW,GAAG,eAAe","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const StyledConfirmDialog: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("..").ConfirmDialogProps & import("react").RefAttributes<
|
|
1
|
+
export declare const StyledConfirmDialog: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("..").ConfirmDialogProps & import("react").RefAttributes<HTMLDialogElement>>, any, {}, never>;
|
|
2
2
|
export declare const StyledDatePickerContainerInner: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
3
|
export declare const StyledDatePickerWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
4
|
export declare const StyledDaysOfWeek: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/DatePicker/Styles.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/DatePicker/Styles.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,mBAAmB,4LAkB/B,CAAC;AAIF,eAAO,MAAM,8BAA8B,oEAqO1C,CAAC;AAEF,eAAO,MAAM,uBAAuB,oEAInC,CAAC;AAIF,eAAO,MAAM,gBAAgB,oEAO5B,CAAC;AAIF,eAAO,MAAM,aAAa,oEAYzB,CAAC;AAIF,eAAO,MAAM,mBAAmB,oEAM/B,CAAC;AAIF,eAAO,MAAM,kBAAkB,oEAmB9B,CAAC;AAIF,eAAO,MAAM,aAAa,qEAkBzB,CAAC;AAIF,eAAO,MAAM,sBAAsB,oEAOlC,CAAC;AAIF,eAAO,MAAM,gBAAgB,oEAQ5B,CAAC;AAIF,eAAO,MAAM,gBAAgB,oEAsB5B,CAAC;AAIF,eAAO,MAAM,iBAAiB,oEAqB7B,CAAC;AAIF,eAAO,MAAM,iBAAiB,oEAO7B,CAAC;AAIF,eAAO,MAAM,mBAAmB,oEAG/B,CAAC;AAIF,eAAO,MAAM,cAAc,oEAM1B,CAAC;AAIF,eAAO,MAAM,kBAAkB,oEAG9B,CAAC;AAIF,eAAO,MAAM,wBAAwB;;sEAEpC,CAAC;AAIF,eAAO,MAAM,oBAAoB,oEAShC,CAAC"}
|
|
@@ -1,26 +1,44 @@
|
|
|
1
|
-
import React, { HTMLAttributes, PropsWithChildren } from "react";
|
|
1
|
+
import React, { HTMLAttributes, MouseEvent, PropsWithChildren } from "react";
|
|
2
2
|
import { DialogSize } from "./Styles";
|
|
3
3
|
export interface DialogProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
open?: boolean;
|
|
5
5
|
onClose?: () => void;
|
|
6
6
|
className?: string;
|
|
7
|
+
/** A click on the backdrop closes the dialog. Off by default. */
|
|
8
|
+
dismissOnBackdropClick?: boolean;
|
|
9
|
+
/** A click on the backdrop that did not close the dialog, because dismissOnBackdropClick is off. */
|
|
10
|
+
onBackdropClickBlocked?: (event?: MouseEvent<HTMLDialogElement>) => void;
|
|
11
|
+
/** @deprecated Use dismissOnBackdropClick. Still works, with a warning in development, and will be removed. */
|
|
7
12
|
enableBackgroundClick?: boolean;
|
|
8
13
|
disableCloseOnEsc?: boolean;
|
|
9
14
|
animate?: "fade" | "slide";
|
|
15
|
+
/** @deprecated Use onBackdropClickBlocked. Still works, with a warning in development, and will be removed. */
|
|
10
16
|
onClickOutside?: (event: any) => void;
|
|
11
17
|
/** Width step. Every step is a max-width; the dialog always fills it when there is room. */
|
|
12
18
|
size?: DialogSize;
|
|
13
19
|
/** "fluid" follows the content. A CSS length ("95%", "600px") pins the height instead. */
|
|
14
20
|
height?: string;
|
|
15
|
-
/**
|
|
21
|
+
/** Leaves the focus off the control that opened the dialog when it closes, so that control does not show focus. */
|
|
22
|
+
disableReturnFocus?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Counts as opened before the sheets that are open, so they stay above the dialog, also when it mounts after them
|
|
25
|
+
* on a reload. For a page dialog that opens a sheet over itself. A sheet that sits in the page when the dialog opens
|
|
26
|
+
* mounts its content again inside the dialog; a sheet that already sits in another dialog moves without remounting.
|
|
27
|
+
* Read when the dialog opens.
|
|
28
|
+
*/
|
|
29
|
+
belowOpenSheets?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated Every Dialog is a native modal <dialog> now: the page behind is inert and the dialog sits in the top
|
|
32
|
+
* layer. The prop is ignored, with a warning in development, and will be removed.
|
|
33
|
+
*/
|
|
16
34
|
native?: boolean;
|
|
17
35
|
}
|
|
18
36
|
export declare const _Dialog: React.ForwardRefExoticComponent<DialogProps & {
|
|
19
37
|
children?: React.ReactNode | undefined;
|
|
20
|
-
} & React.RefAttributes<
|
|
38
|
+
} & React.RefAttributes<HTMLDialogElement>>;
|
|
21
39
|
export declare const Dialog: React.ForwardRefExoticComponent<DialogProps & {
|
|
22
40
|
children?: React.ReactNode | undefined;
|
|
23
|
-
} & React.RefAttributes<
|
|
41
|
+
} & React.RefAttributes<HTMLDialogElement>> & {
|
|
24
42
|
Title: {
|
|
25
43
|
({ children, className, disableDefaultHeading, onClose, closeLabel, ...rest }: PropsWithChildren<import("./DialogTitle").DialogTitleProps>): React.JSX.Element;
|
|
26
44
|
displayName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAEZ,cAAc,EACd,iBAAiB,EAElB,MAAM,OAAO,CAAC;AASf,OAAO,EAAE,UAAU,EAA6B,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAEZ,cAAc,EACd,UAAU,EACV,iBAAiB,EAElB,MAAM,OAAO,CAAC;AASf,OAAO,EAAE,UAAU,EAA6B,MAAM,UAAU,CAAC;AAIjE,MAAM,WAAW,WAAY,SAAQ,cAAc,CAAC,cAAc,CAAC;IACjE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,oGAAoG;IACpG,sBAAsB,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IACzE,+GAA+G;IAC/G,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3B,+GAA+G;IAC/G,cAAc,CAAC,EAAE,CAAC,KAAK,KAAA,KAAK,IAAI,CAAC;IACjC,4FAA4F;IAC5F,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,0FAA0F;IAC1F,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mHAAmH;IACnH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,eAAO,MAAM,OAAO;;2CA6EnB,CAAC;AAKF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;CAKjB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["children", "open", "onClose", "className", "enableBackgroundClick", "disableCloseOnEsc", "animate", "onClickOutside", "size", "height", "native"];
|
|
3
|
+
const _excluded = ["children", "open", "onClose", "className", "dismissOnBackdropClick", "onBackdropClickBlocked", "enableBackgroundClick", "disableCloseOnEsc", "animate", "onClickOutside", "size", "height", "native"];
|
|
4
4
|
import React, { forwardRef, useState } from "react";
|
|
5
5
|
import classnames from "classnames";
|
|
6
6
|
import { DialogActions } from "./DialogActions";
|
|
@@ -10,15 +10,17 @@ import { DialogFrame } from "./DialogFrame";
|
|
|
10
10
|
import { DialogTitle } from "./DialogTitle";
|
|
11
11
|
import { dialogSizes, StyledDialog } from "./Styles";
|
|
12
12
|
import { useFluidHeightAnimation } from "./useFluidHeightAnimation";
|
|
13
|
+
import { usePropWarning } from "./usePropWarning";
|
|
13
14
|
export const _Dialog = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
14
|
-
var _dialogSizes$size;
|
|
15
|
+
var _dialogSizes$size, _ref2;
|
|
15
16
|
let children = _ref.children,
|
|
16
17
|
_ref$open = _ref.open,
|
|
17
18
|
open = _ref$open === void 0 ? false : _ref$open,
|
|
18
19
|
onClose = _ref.onClose,
|
|
19
20
|
className = _ref.className,
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
dismissOnBackdropClick = _ref.dismissOnBackdropClick,
|
|
22
|
+
onBackdropClickBlocked = _ref.onBackdropClickBlocked,
|
|
23
|
+
enableBackgroundClick = _ref.enableBackgroundClick,
|
|
22
24
|
_ref$disableCloseOnEs = _ref.disableCloseOnEsc,
|
|
23
25
|
disableCloseOnEsc = _ref$disableCloseOnEs === void 0 ? false : _ref$disableCloseOnEs,
|
|
24
26
|
_ref$animate = _ref.animate,
|
|
@@ -28,12 +30,14 @@ export const _Dialog = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
28
30
|
size = _ref$size === void 0 ? "m" : _ref$size,
|
|
29
31
|
_ref$height = _ref.height,
|
|
30
32
|
height = _ref$height === void 0 ? "fluid" : _ref$height,
|
|
31
|
-
|
|
32
|
-
native = _ref$native === void 0 ? false : _ref$native,
|
|
33
|
+
native = _ref.native,
|
|
33
34
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
34
35
|
const _useState = useState(null),
|
|
35
36
|
dialogNode = _useState[0],
|
|
36
37
|
setDialogNode = _useState[1];
|
|
38
|
+
usePropWarning("Dialog", "native", native, "removed", "Every Dialog is a native modal now, so remove it.");
|
|
39
|
+
usePropWarning("Dialog", "enableBackgroundClick", enableBackgroundClick, "deprecated", "Use dismissOnBackdropClick.");
|
|
40
|
+
usePropWarning("Dialog", "onClickOutside", onClickOutside, "deprecated", "Use onBackdropClickBlocked.");
|
|
37
41
|
useFluidHeightAnimation(dialogNode, height === "fluid");
|
|
38
42
|
const surface = /*#__PURE__*/React.createElement(StyledDialog, {
|
|
39
43
|
ref: setDialogNode,
|
|
@@ -43,13 +47,12 @@ export const _Dialog = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
43
47
|
}, children);
|
|
44
48
|
return /*#__PURE__*/React.createElement(DialogFrame, _extends({}, rest, {
|
|
45
49
|
forwardedRef: ref,
|
|
46
|
-
native: native,
|
|
47
50
|
open: open,
|
|
48
51
|
onClose: onClose,
|
|
49
|
-
enableBackgroundClick:
|
|
52
|
+
dismissOnBackdropClick: (_ref2 = dismissOnBackdropClick != null ? dismissOnBackdropClick : enableBackgroundClick) != null ? _ref2 : false,
|
|
53
|
+
onBackdropClickBlocked: onBackdropClickBlocked != null ? onBackdropClickBlocked : onClickOutside,
|
|
50
54
|
disableCloseOnEsc: disableCloseOnEsc,
|
|
51
55
|
animate: animate,
|
|
52
|
-
onClickOutside: onClickOutside,
|
|
53
56
|
surface: surface
|
|
54
57
|
}));
|
|
55
58
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.js","names":["React","forwardRef","useState","classnames","DialogActions","DialogContent","DialogContentDivider","DialogFrame","DialogTitle","dialogSizes","StyledDialog","useFluidHeightAnimation","_Dialog","_ref","ref","_dialogSizes$size","children","_ref$open","open","onClose","className","
|
|
1
|
+
{"version":3,"file":"Dialog.js","names":["React","forwardRef","useState","classnames","DialogActions","DialogContent","DialogContentDivider","DialogFrame","DialogTitle","dialogSizes","StyledDialog","useFluidHeightAnimation","usePropWarning","_Dialog","_ref","ref","_dialogSizes$size","_ref2","children","_ref$open","open","onClose","className","dismissOnBackdropClick","onBackdropClickBlocked","enableBackgroundClick","_ref$disableCloseOnEs","disableCloseOnEsc","_ref$animate","animate","onClickOutside","_ref$size","size","_ref$height","height","native","rest","_objectWithoutPropertiesLoose","_excluded","_useState","dialogNode","setDialogNode","surface","createElement","$maxWidth","m","$height","undefined","_extends","forwardedRef","displayName","Dialog","Object","assign","Title","Content","ContentDivider","Actions"],"sources":["../../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import React, {\n forwardRef,\n HTMLAttributes,\n MouseEvent,\n PropsWithChildren,\n useState,\n} from \"react\";\n\nimport classnames from \"classnames\";\n\nimport { DialogActions } from \"./DialogActions\";\nimport { DialogContent } from \"./DialogContent\";\nimport { DialogContentDivider } from \"./DialogContentDivider\";\nimport { DialogFrame } from \"./DialogFrame\";\nimport { DialogTitle } from \"./DialogTitle\";\nimport { DialogSize, dialogSizes, StyledDialog } from \"./Styles\";\nimport { useFluidHeightAnimation } from \"./useFluidHeightAnimation\";\nimport { usePropWarning } from \"./usePropWarning\";\n\nexport interface DialogProps extends HTMLAttributes<HTMLDivElement> {\n open?: boolean;\n onClose?: () => void;\n className?: string;\n /** A click on the backdrop closes the dialog. Off by default. */\n dismissOnBackdropClick?: boolean;\n /** A click on the backdrop that did not close the dialog, because dismissOnBackdropClick is off. */\n onBackdropClickBlocked?: (event?: MouseEvent<HTMLDialogElement>) => void;\n /** @deprecated Use dismissOnBackdropClick. Still works, with a warning in development, and will be removed. */\n enableBackgroundClick?: boolean;\n disableCloseOnEsc?: boolean;\n animate?: \"fade\" | \"slide\";\n /** @deprecated Use onBackdropClickBlocked. Still works, with a warning in development, and will be removed. */\n onClickOutside?: (event) => void;\n /** Width step. Every step is a max-width; the dialog always fills it when there is room. */\n size?: DialogSize;\n /** \"fluid\" follows the content. A CSS length (\"95%\", \"600px\") pins the height instead. */\n height?: string;\n /** Leaves the focus off the control that opened the dialog when it closes, so that control does not show focus. */\n disableReturnFocus?: boolean;\n /**\n * Counts as opened before the sheets that are open, so they stay above the dialog, also when it mounts after them\n * on a reload. For a page dialog that opens a sheet over itself. A sheet that sits in the page when the dialog opens\n * mounts its content again inside the dialog; a sheet that already sits in another dialog moves without remounting.\n * Read when the dialog opens.\n */\n belowOpenSheets?: boolean;\n /**\n * @deprecated Every Dialog is a native modal <dialog> now: the page behind is inert and the dialog sits in the top\n * layer. The prop is ignored, with a warning in development, and will be removed.\n */\n native?: boolean;\n}\n\nexport const _Dialog = forwardRef<\n HTMLDialogElement,\n PropsWithChildren<DialogProps>\n>(\n (\n {\n children,\n open = false,\n onClose,\n className,\n dismissOnBackdropClick,\n onBackdropClickBlocked,\n enableBackgroundClick,\n disableCloseOnEsc = false,\n animate = \"slide\",\n onClickOutside,\n size = \"m\",\n height = \"fluid\",\n native,\n ...rest\n },\n ref\n ) => {\n const [dialogNode, setDialogNode] = useState<HTMLDivElement | null>(null);\n\n usePropWarning(\n \"Dialog\",\n \"native\",\n native,\n \"removed\",\n \"Every Dialog is a native modal now, so remove it.\"\n );\n\n usePropWarning(\n \"Dialog\",\n \"enableBackgroundClick\",\n enableBackgroundClick,\n \"deprecated\",\n \"Use dismissOnBackdropClick.\"\n );\n usePropWarning(\n \"Dialog\",\n \"onClickOutside\",\n onClickOutside,\n \"deprecated\",\n \"Use onBackdropClickBlocked.\"\n );\n\n useFluidHeightAnimation(dialogNode, height === \"fluid\");\n\n const surface = (\n <StyledDialog\n ref={setDialogNode}\n $maxWidth={dialogSizes[size] ?? dialogSizes.m}\n $height={height === \"fluid\" ? undefined : height}\n className={classnames(\"c-dialog\", className)}\n >\n {children}\n </StyledDialog>\n );\n\n return (\n <DialogFrame\n {...rest}\n forwardedRef={ref}\n open={open}\n onClose={onClose}\n dismissOnBackdropClick={\n dismissOnBackdropClick ?? enableBackgroundClick ?? false\n }\n onBackdropClickBlocked={onBackdropClickBlocked ?? onClickOutside}\n disableCloseOnEsc={disableCloseOnEsc}\n animate={animate}\n surface={surface}\n />\n );\n }\n);\n\n_Dialog.displayName = \"Dialog\";\n\n// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/34757\nexport const Dialog = Object.assign({}, _Dialog, {\n Title: DialogTitle,\n Content: DialogContent,\n ContentDivider: DialogContentDivider,\n Actions: DialogActions,\n});\n"],"mappings":";;;AAAA,OAAOA,KAAK,IACVC,UAAU,EAIVC,QAAQ,QACH,OAAO;AAEd,OAAOC,UAAU,MAAM,YAAY;AAEnC,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,aAAa,QAAQ,iB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AAMC,MAAM,GAAGC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAExC,OAAO,EAAE;EAC/CyC,KAAK,EAAE9C,WAAW;EAClB+C,OAAO,EAAElD,aAAa;EACtBmD,cAAc,EAAElD,oBAAoB;EACpCmD,OAAO,EAAErD;AACX,CAAC,CAAC","ignoreList":[]}
|
|
@@ -3,9 +3,9 @@ export interface DialogContextProps {
|
|
|
3
3
|
requestClose?: () => void;
|
|
4
4
|
/** The handler the dialog was given, used to recognise a button that only closes. */
|
|
5
5
|
onClose?: () => void;
|
|
6
|
-
/**
|
|
6
|
+
/** The id of the dialog's title, which names the dialog. */
|
|
7
7
|
titleId?: string;
|
|
8
|
-
/**
|
|
8
|
+
/** The dialog's title reports that it is there. Returns the call that takes it back. */
|
|
9
9
|
registerTitle?: () => () => void;
|
|
10
10
|
}
|
|
11
11
|
export declare const DialogContext: import("react").Context<DialogContextProps | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogContext.d.ts","sourceRoot":"","sources":["../../../../src/components/Dialog/DialogContext.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,kBAAkB;IACjC,qFAAqF;IACrF,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,qFAAqF;IACrF,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,
|
|
1
|
+
{"version":3,"file":"DialogContext.d.ts","sourceRoot":"","sources":["../../../../src/components/Dialog/DialogContext.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,kBAAkB;IACjC,qFAAqF;IACrF,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,qFAAqF;IACrF,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,4DAA4D;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wFAAwF;IACxF,aAAa,CAAC,EAAE,MAAM,MAAM,IAAI,CAAC;CAClC;AAED,eAAO,MAAM,aAAa,oDAAiD,CAAC;AAE5E,eAAO,MAAM,gBAAgB,iCAAkC,CAAC;AAEhE;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,WAAW,MAAM,IAAI,WAlB7B,IAsBtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogContext.js","names":["createContext","useContext","DialogContext","useDialogContext","useDialogClose","fallback","_ref","_context$requestClose","context","requestClose","undefined"],"sources":["../../../../src/components/Dialog/DialogContext.tsx"],"sourcesContent":["import { createContext, useContext } from \"react\";\n\nexport interface DialogContextProps {\n /** Starts the closing transition. The dialog's own onClose runs once it finishes. */\n requestClose?: () => void;\n /** The handler the dialog was given, used to recognise a button that only closes. */\n onClose?: () => void;\n /**
|
|
1
|
+
{"version":3,"file":"DialogContext.js","names":["createContext","useContext","DialogContext","useDialogContext","useDialogClose","fallback","_ref","_context$requestClose","context","requestClose","undefined"],"sources":["../../../../src/components/Dialog/DialogContext.tsx"],"sourcesContent":["import { createContext, useContext } from \"react\";\n\nexport interface DialogContextProps {\n /** Starts the closing transition. The dialog's own onClose runs once it finishes. */\n requestClose?: () => void;\n /** The handler the dialog was given, used to recognise a button that only closes. */\n onClose?: () => void;\n /** The id of the dialog's title, which names the dialog. */\n titleId?: string;\n /** The dialog's title reports that it is there. Returns the call that takes it back. */\n registerTitle?: () => () => void;\n}\n\nexport const DialogContext = createContext<DialogContextProps | null>(null);\n\nexport const useDialogContext = () => useContext(DialogContext);\n\n/**\n * Closes the dialog the way clicking the overlay does: the exit transition runs first, and the\n * dialog's own onClose fires once it finishes. Use it for a Cancel button instead of calling the\n * parent's close handler, which would unmount the dialog before it can animate out.\n */\nexport const useDialogClose = (fallback?: () => void) => {\n const context = useContext(DialogContext);\n\n return context?.requestClose ?? fallback ?? (() => undefined);\n};\n"],"mappings":"AAAA,SAASA,aAAa,EAAEC,UAAU,QAAQ,OAAO;AAajD,OAAO,MAAMC,aAAa,gBAAGF,aAAa,CAA4B,IAAI,CAAC;AAE3E,OAAO,MAAMG,gBAAgB,GAAGA,CAAA,KAAMF,UAAU,CAACC,aAAa,CAAC;;AAE/D;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,cAAc,GAAIC,QAAqB,IAAK;EAAA,IAAAC,IAAA,EAAAC,qBAAA;EACvD,MAAMC,OAAO,GAAGP,UAAU,CAACC,aAAa,CAAC;EAEzC,QAAAI,IAAA,IAAAC,qBAAA,GAAOC,OAAO,oBAAPA,OAAO,CAAEC,YAAY,YAAAF,qBAAA,GAAIF,QAAQ,YAAAC,IAAA,GAAK,MAAMI,SAAS;AAC9D,CAAC","ignoreList":[]}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import React, { ReactElement, Ref } from "react";
|
|
1
|
+
import React, { ReactElement, ReactNode, Ref } from "react";
|
|
2
2
|
import type { DialogProps } from "./Dialog";
|
|
3
|
-
export interface DialogFrameProps extends Omit<DialogProps, "children" | "size" | "height"> {
|
|
4
|
-
forwardedRef?: Ref<
|
|
3
|
+
export interface DialogFrameProps extends Omit<DialogProps, "native" | "children" | "size" | "height" | "enableBackgroundClick" | "onClickOutside"> {
|
|
4
|
+
forwardedRef?: Ref<HTMLDialogElement>;
|
|
5
5
|
/** The visible card. The frame places it in the viewport and runs its open and close animation. */
|
|
6
6
|
surface: ReactElement;
|
|
7
|
-
|
|
8
|
-
disableFocusLock?: boolean;
|
|
7
|
+
children?: ReactNode;
|
|
9
8
|
}
|
|
10
9
|
export declare const DialogFrame: {
|
|
11
|
-
({ forwardedRef, surface,
|
|
10
|
+
({ forwardedRef, surface, open, onClose, dismissOnBackdropClick, disableCloseOnEsc, animate, onBackdropClickBlocked, disableReturnFocus, ...rest }: DialogFrameProps): React.JSX.Element;
|
|
12
11
|
displayName: string;
|
|
13
12
|
};
|
|
14
13
|
//# sourceMappingURL=DialogFrame.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogFrame.d.ts","sourceRoot":"","sources":["../../../../src/components/Dialog/DialogFrame.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAGZ,YAAY,
|
|
1
|
+
{"version":3,"file":"DialogFrame.d.ts","sourceRoot":"","sources":["../../../../src/components/Dialog/DialogFrame.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAGZ,YAAY,EACZ,SAAS,EACT,GAAG,EAMJ,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAQ5C,MAAM,WAAW,gBACf,SAAQ,IAAI,CACV,WAAW,EACT,QAAQ,GACR,UAAU,GACV,MAAM,GACN,QAAQ,GACR,uBAAuB,GACvB,gBAAgB,CACnB;IACD,YAAY,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACtC,mGAAmG;IACnG,OAAO,EAAE,YAAY,CAAC;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAGD,eAAO,MAAM,WAAW;wJAWrB,gBAAgB;;CA6FlB,CAAC"}
|
|
@@ -1,56 +1,30 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
-
const _excluded = ["forwardedRef", "surface", "open", "onClose", "
|
|
4
|
-
_excluded2 = ["forwardedRef", "surface", "native", "open", "onClose", "enableBackgroundClick", "disableCloseOnEsc", "animate", "onClickOutside", "disableFocusLock"];
|
|
3
|
+
const _excluded = ["forwardedRef", "surface", "open", "onClose", "dismissOnBackdropClick", "disableCloseOnEsc", "animate", "onBackdropClickBlocked", "disableReturnFocus"];
|
|
5
4
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
6
5
|
import { DialogContext } from "./DialogContext";
|
|
7
6
|
import { StyledDialogViewport } from "./Styles";
|
|
8
7
|
import useStableId from "../../utils/useStableId";
|
|
9
|
-
import { ModalBase } from "../Modal/ModalBase";
|
|
10
8
|
import { ModalRoot } from "../ModalRoot";
|
|
11
|
-
import { Fade
|
|
12
|
-
import { SlideFromTop
|
|
13
|
-
//
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
onExited = _ref.onExited,
|
|
20
|
-
forceClose = _ref.forceClose,
|
|
9
|
+
import { Fade } from "../Transitions";
|
|
10
|
+
import { SlideFromTop } from "../Transitions/SlideFromTop";
|
|
11
|
+
// What Dialog and ObjectFormModal share: the native modal, the viewport and the animation around a surface each draws.
|
|
12
|
+
export const DialogFrame = _ref => {
|
|
13
|
+
let forwardedRef = _ref.forwardedRef,
|
|
14
|
+
surface = _ref.surface,
|
|
15
|
+
_ref$open = _ref.open,
|
|
16
|
+
open = _ref$open === void 0 ? false : _ref$open,
|
|
21
17
|
onClose = _ref.onClose,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
className: "c-dialog-viewport"
|
|
33
|
-
}, /*#__PURE__*/React.createElement(Animation, {
|
|
34
|
-
in: inProp,
|
|
35
|
-
onEnter: onEnter,
|
|
36
|
-
onExited: onExited
|
|
37
|
-
}, children)));
|
|
38
|
-
};
|
|
39
|
-
DialogSurface.displayName = "DialogSurface";
|
|
40
|
-
const NativeDialog = _ref2 => {
|
|
41
|
-
let forwardedRef = _ref2.forwardedRef,
|
|
42
|
-
surface = _ref2.surface,
|
|
43
|
-
_ref2$open = _ref2.open,
|
|
44
|
-
open = _ref2$open === void 0 ? false : _ref2$open,
|
|
45
|
-
onClose = _ref2.onClose,
|
|
46
|
-
_ref2$enableBackgroun = _ref2.enableBackgroundClick,
|
|
47
|
-
enableBackgroundClick = _ref2$enableBackgroun === void 0 ? false : _ref2$enableBackgroun,
|
|
48
|
-
_ref2$disableCloseOnE = _ref2.disableCloseOnEsc,
|
|
49
|
-
disableCloseOnEsc = _ref2$disableCloseOnE === void 0 ? false : _ref2$disableCloseOnE,
|
|
50
|
-
_ref2$animate = _ref2.animate,
|
|
51
|
-
animate = _ref2$animate === void 0 ? "slide" : _ref2$animate,
|
|
52
|
-
onClickOutside = _ref2.onClickOutside,
|
|
53
|
-
rest = _objectWithoutPropertiesLoose(_ref2, _excluded);
|
|
18
|
+
_ref$dismissOnBackdro = _ref.dismissOnBackdropClick,
|
|
19
|
+
dismissOnBackdropClick = _ref$dismissOnBackdro === void 0 ? false : _ref$dismissOnBackdro,
|
|
20
|
+
_ref$disableCloseOnEs = _ref.disableCloseOnEsc,
|
|
21
|
+
disableCloseOnEsc = _ref$disableCloseOnEs === void 0 ? false : _ref$disableCloseOnEs,
|
|
22
|
+
_ref$animate = _ref.animate,
|
|
23
|
+
animate = _ref$animate === void 0 ? "slide" : _ref$animate,
|
|
24
|
+
onBackdropClickBlocked = _ref.onBackdropClickBlocked,
|
|
25
|
+
_ref$disableReturnFoc = _ref.disableReturnFocus,
|
|
26
|
+
disableReturnFocus = _ref$disableReturnFoc === void 0 ? false : _ref$disableReturnFoc,
|
|
27
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
54
28
|
const _useState = useState(open),
|
|
55
29
|
innerOpen = _useState[0],
|
|
56
30
|
setInnerOpen = _useState[1];
|
|
@@ -93,9 +67,9 @@ const NativeDialog = _ref2 => {
|
|
|
93
67
|
}, [innerOpen, ariaLabel, explicitLabelledBy]);
|
|
94
68
|
const handleDismissBlocked = useCallback((reason, event) => {
|
|
95
69
|
if (reason === "backdrop") {
|
|
96
|
-
|
|
70
|
+
onBackdropClickBlocked == null || onBackdropClickBlocked(event);
|
|
97
71
|
}
|
|
98
|
-
}, [
|
|
72
|
+
}, [onBackdropClickBlocked]);
|
|
99
73
|
const contextValue = useMemo(() => ({
|
|
100
74
|
requestClose,
|
|
101
75
|
onClose,
|
|
@@ -109,11 +83,12 @@ const NativeDialog = _ref2 => {
|
|
|
109
83
|
onDismissBlocked: handleDismissBlocked,
|
|
110
84
|
onClose: onClose,
|
|
111
85
|
disableCloseOnEsc: disableCloseOnEsc,
|
|
112
|
-
|
|
86
|
+
disableReturnFocus: disableReturnFocus,
|
|
87
|
+
disableBackgroundClick: !dismissOnBackdropClick,
|
|
113
88
|
"aria-labelledby": ariaLabelledBy
|
|
114
|
-
}),
|
|
115
|
-
let isIn =
|
|
116
|
-
onExited =
|
|
89
|
+
}), _ref2 => {
|
|
90
|
+
let isIn = _ref2.in,
|
|
91
|
+
onExited = _ref2.onExited;
|
|
117
92
|
return /*#__PURE__*/React.createElement(DialogContext.Provider, {
|
|
118
93
|
value: contextValue
|
|
119
94
|
}, /*#__PURE__*/React.createElement(StyledDialogViewport, {
|
|
@@ -124,57 +99,5 @@ const NativeDialog = _ref2 => {
|
|
|
124
99
|
}, surface)));
|
|
125
100
|
});
|
|
126
101
|
};
|
|
127
|
-
NativeDialog.displayName = "NativeDialog";
|
|
128
|
-
// What Dialog and ObjectFormModal share: the modal, the viewport and the animation around a surface each draws.
|
|
129
|
-
export const DialogFrame = _ref4 => {
|
|
130
|
-
let forwardedRef = _ref4.forwardedRef,
|
|
131
|
-
surface = _ref4.surface,
|
|
132
|
-
_ref4$native = _ref4.native,
|
|
133
|
-
native = _ref4$native === void 0 ? false : _ref4$native,
|
|
134
|
-
_ref4$open = _ref4.open,
|
|
135
|
-
open = _ref4$open === void 0 ? false : _ref4$open,
|
|
136
|
-
onClose = _ref4.onClose,
|
|
137
|
-
_ref4$enableBackgroun = _ref4.enableBackgroundClick,
|
|
138
|
-
enableBackgroundClick = _ref4$enableBackgroun === void 0 ? false : _ref4$enableBackgroun,
|
|
139
|
-
_ref4$disableCloseOnE = _ref4.disableCloseOnEsc,
|
|
140
|
-
disableCloseOnEsc = _ref4$disableCloseOnE === void 0 ? false : _ref4$disableCloseOnE,
|
|
141
|
-
_ref4$animate = _ref4.animate,
|
|
142
|
-
animate = _ref4$animate === void 0 ? "slide" : _ref4$animate,
|
|
143
|
-
onClickOutside = _ref4.onClickOutside,
|
|
144
|
-
disableFocusLock = _ref4.disableFocusLock,
|
|
145
|
-
rest = _objectWithoutPropertiesLoose(_ref4, _excluded2);
|
|
146
|
-
if (native) {
|
|
147
|
-
return /*#__PURE__*/React.createElement(NativeDialog, _extends({}, rest, {
|
|
148
|
-
forwardedRef: forwardedRef,
|
|
149
|
-
open: open,
|
|
150
|
-
onClose: onClose,
|
|
151
|
-
enableBackgroundClick: enableBackgroundClick,
|
|
152
|
-
disableCloseOnEsc: disableCloseOnEsc,
|
|
153
|
-
animate: animate,
|
|
154
|
-
onClickOutside: onClickOutside,
|
|
155
|
-
surface: surface
|
|
156
|
-
}));
|
|
157
|
-
}
|
|
158
|
-
return /*#__PURE__*/React.createElement(ModalBase, _extends({
|
|
159
|
-
ref: forwardedRef,
|
|
160
|
-
open: open,
|
|
161
|
-
onClose: onClose,
|
|
162
|
-
disableBackgroundClick: !enableBackgroundClick,
|
|
163
|
-
disableCloseOnEsc: disableCloseOnEsc,
|
|
164
|
-
disableFocusLock: disableFocusLock,
|
|
165
|
-
onClickOutside: onClickOutside,
|
|
166
|
-
overlayTimeout: animate === "fade" ? {
|
|
167
|
-
enter: FADE_DURATION,
|
|
168
|
-
exit: FADE_DURATION
|
|
169
|
-
} : {
|
|
170
|
-
enter: SLIDE_FROM_TOP_ENTER,
|
|
171
|
-
exit: SLIDE_FROM_TOP_EXIT
|
|
172
|
-
}
|
|
173
|
-
}, rest), /*#__PURE__*/React.createElement(DialogSurface, {
|
|
174
|
-
in: open,
|
|
175
|
-
onClose: onClose,
|
|
176
|
-
animate: animate
|
|
177
|
-
}, surface));
|
|
178
|
-
};
|
|
179
102
|
DialogFrame.displayName = "DialogFrame";
|
|
180
103
|
//# sourceMappingURL=DialogFrame.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogFrame.js","names":["React","useCallback","useEffect","useMemo","useRef","useState","DialogContext","StyledDialogViewport","useStableId","ModalBase","ModalRoot","Fade","FADE_DURATION","SlideFromTop","SLIDE_FROM_TOP_ENTER","SLIDE_FROM_TOP_EXIT","DialogSurface","_ref","_ref$in","in","inProp","onEnter","onExited","forceClose","onClose","animate","children","Animation","value","requestClose","createElement","Provider","className","displayName","NativeDialog","_ref2","forwardedRef","surface","_ref2$open","open","_ref2$enableBackgroun","enableBackgroundClick","_ref2$disableCloseOnE","disableCloseOnEsc","_ref2$animate","onClickOutside","rest","_objectWithoutPropertiesLoose","_excluded","_useState","innerOpen","setInnerOpen","titleId","_useState2","titleCount","setTitleCount","titleCountRef","warnedAboutName","registerTitle","current","count","ariaLabel","explicitLabelledBy","ariaLabelledBy","undefined","process","env","NODE_ENV","timeout","setTimeout","console","warn","clearTimeout","handleDismissBlocked","reason","event","contextValue","_extends","ref","onRequestClose","onDismissBlocked","disableBackgroundClick","_ref3","isIn","DialogFrame","_ref4","_ref4$native","native","_ref4$open","_ref4$enableBackgroun","_ref4$disableCloseOnE","_ref4$animate","disableFocusLock","_excluded2","overlayTimeout","enter","exit"],"sources":["../../../../src/components/Dialog/DialogFrame.tsx"],"sourcesContent":["import React, {\n HTMLAttributes,\n MouseEvent,\n ReactElement,\n ReactNode,\n Ref,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\n\nimport type { DialogProps } from \"./Dialog\";\nimport { DialogContext } from \"./DialogContext\";\nimport { StyledDialogViewport } from \"./Styles\";\nimport useStableId from \"../../utils/useStableId\";\nimport { ModalBase } from \"../Modal/ModalBase\";\nimport { ModalRoot, ModalRootDismissReason } from \"../ModalRoot\";\nimport { Fade, FADE_DURATION } from \"../Transitions\";\nimport {\n SlideFromTop,\n SLIDE_FROM_TOP_ENTER,\n SLIDE_FROM_TOP_EXIT,\n} from \"../Transitions/SlideFromTop\";\n\ninterface DialogSurfaceProps {\n in?: boolean;\n onEnter?: () => void;\n onExited?: () => void;\n forceClose?: () => void;\n onClose?: () => void;\n animate: \"fade\" | \"slide\";\n children: ReactElement;\n}\n\n// ModalBase only treats a child as a transition when its props already carry `in`, so this element\n// must declare it even though ModalBase overwrites it on clone.\nconst DialogSurface = ({\n in: inProp = false,\n onEnter,\n onExited,\n forceClose,\n onClose,\n animate,\n children,\n}: DialogSurfaceProps) => {\n const Animation = animate === \"fade\" ? Fade : SlideFromTop;\n const value = useMemo(\n () => ({ requestClose: forceClose, onClose }),\n [forceClose, onClose]\n );\n\n return (\n <DialogContext.Provider value={value}>\n <StyledDialogViewport className=\"c-dialog-viewport\">\n <Animation in={inProp} onEnter={onEnter} onExited={onExited}>\n {children}\n </Animation>\n </StyledDialogViewport>\n </DialogContext.Provider>\n );\n};\n\nDialogSurface.displayName = \"DialogSurface\";\n\ninterface NativeDialogProps\n extends Omit<DialogProps, \"native\" | \"children\" | \"size\" | \"height\"> {\n forwardedRef?: Ref<HTMLDivElement>;\n surface: ReactElement;\n children?: ReactNode;\n}\n\nconst NativeDialog = ({\n forwardedRef,\n surface,\n open = false,\n onClose,\n enableBackgroundClick = false,\n disableCloseOnEsc = false,\n animate = \"slide\",\n onClickOutside,\n ...rest\n}: NativeDialogProps) => {\n const [innerOpen, setInnerOpen] = useState(open);\n const Animation = animate === \"fade\" ? Fade : SlideFromTop;\n\n useEffect(() => {\n setInnerOpen(open);\n }, [open]);\n\n const requestClose = useCallback(() => setInnerOpen(false), []);\n\n const titleId = useStableId();\n const [titleCount, setTitleCount] = useState(0);\n const titleCountRef = useRef(0);\n const warnedAboutName = useRef(false);\n\n const registerTitle = useCallback(() => {\n titleCountRef.current += 1;\n setTitleCount((count) => count + 1);\n\n return () => {\n titleCountRef.current -= 1;\n setTitleCount((count) => count - 1);\n };\n }, []);\n\n const ariaLabel = rest[\"aria-label\"];\n const explicitLabelledBy = rest[\"aria-labelledby\"];\n const ariaLabelledBy =\n explicitLabelledBy ?? (ariaLabel || titleCount === 0 ? undefined : titleId);\n\n // A dialog inside another one mounts its content a render later, so the check waits a tick for its title.\n useEffect(() => {\n if (\n process.env.NODE_ENV === \"production\" ||\n !innerOpen ||\n warnedAboutName.current ||\n ariaLabel ||\n explicitLabelledBy\n ) {\n return undefined;\n }\n\n const timeout = setTimeout(() => {\n if (titleCountRef.current === 0) {\n warnedAboutName.current = true;\n // eslint-disable-next-line no-console\n console.warn(\n \"Dialog: a native dialog needs an accessible name. Add a Dialog.Title, aria-label or aria-labelledby.\"\n );\n }\n });\n\n return () => clearTimeout(timeout);\n }, [innerOpen, ariaLabel, explicitLabelledBy]);\n\n const handleDismissBlocked = useCallback(\n (reason: ModalRootDismissReason, event?: MouseEvent<HTMLDialogElement>) => {\n if (reason === \"backdrop\") {\n onClickOutside?.(event);\n }\n },\n [onClickOutside]\n );\n\n const contextValue = useMemo(\n () => ({ requestClose, onClose, titleId, registerTitle }),\n [requestClose, onClose, titleId, registerTitle]\n );\n\n return (\n <ModalRoot\n {...(rest as HTMLAttributes<HTMLDialogElement>)}\n ref={forwardedRef as unknown as Ref<HTMLDialogElement>}\n open={innerOpen}\n onRequestClose={requestClose}\n onDismissBlocked={handleDismissBlocked}\n onClose={onClose}\n disableCloseOnEsc={disableCloseOnEsc}\n disableBackgroundClick={!enableBackgroundClick}\n aria-labelledby={ariaLabelledBy}\n >\n {({ in: isIn, onExited }) => (\n <DialogContext.Provider value={contextValue}>\n <StyledDialogViewport className=\"c-dialog-viewport\">\n <Animation in={isIn} onExited={onExited}>\n {surface}\n </Animation>\n </StyledDialogViewport>\n </DialogContext.Provider>\n )}\n </ModalRoot>\n );\n};\n\nNativeDialog.displayName = \"NativeDialog\";\n\nexport interface DialogFrameProps\n extends Omit<DialogProps, \"children\" | \"size\" | \"height\"> {\n forwardedRef?: Ref<HTMLDivElement>;\n /** The visible card. The frame places it in the viewport and runs its open and close animation. */\n surface: ReactElement;\n /** Only the modal path has a focus lock to turn off. */\n disableFocusLock?: boolean;\n}\n\n// What Dialog and ObjectFormModal share: the modal, the viewport and the animation around a surface each draws.\nexport const DialogFrame = ({\n forwardedRef,\n surface,\n native = false,\n open = false,\n onClose,\n enableBackgroundClick = false,\n disableCloseOnEsc = false,\n animate = \"slide\",\n onClickOutside,\n disableFocusLock,\n ...rest\n}: DialogFrameProps) => {\n if (native) {\n return (\n <NativeDialog\n {...rest}\n forwardedRef={forwardedRef}\n open={open}\n onClose={onClose}\n enableBackgroundClick={enableBackgroundClick}\n disableCloseOnEsc={disableCloseOnEsc}\n animate={animate}\n onClickOutside={onClickOutside}\n surface={surface}\n />\n );\n }\n\n return (\n <ModalBase\n ref={forwardedRef}\n open={open}\n onClose={onClose}\n disableBackgroundClick={!enableBackgroundClick}\n disableCloseOnEsc={disableCloseOnEsc}\n disableFocusLock={disableFocusLock}\n onClickOutside={onClickOutside}\n overlayTimeout={\n animate === \"fade\"\n ? { enter: FADE_DURATION, exit: FADE_DURATION }\n : { enter: SLIDE_FROM_TOP_ENTER, exit: SLIDE_FROM_TOP_EXIT }\n }\n {...rest}\n >\n <DialogSurface in={open} onClose={onClose} animate={animate}>\n {surface}\n </DialogSurface>\n </ModalBase>\n );\n};\n\nDialogFrame.displayName = \"DialogFrame\";\n"],"mappings":";;;;AAAA,OAAOA,KAAK,IAMVC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,OAAO;AAGd,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,oBAAoB,QAAQ,UAAU;AAC/C,OAAOC,WAAW,MAAM,yBAAyB;AACjD,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,SAAS,QAAgC,cAAc;AAChE,SAASC,IAAI,EAAEC,aAAa,QAAQ,gBAAgB;AACpD,SACEC,YAAY,EACZC,oBAAoB,EACpBC,mBAAmB,QACd,6BAA6B;AAYpC;AACA;AACA,MAAMC,aAAa,GAAGC,IAAA,IAQI;EAAA,IAAAC,OAAA,GAAAD,IAAA,CAPxBE,EAAE;IAAEC,MAAM,GAAAF,OAAA,cAAG,KAAK,GAAAA,OAAA;IAClBG,OAAO,GAAAJ,IAAA,CAAPI,OAAO;IACPC,QAAQ,GAA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B9C,cAAc,GAAAwC,KAAA,CAAdxC,cAAc;IACd+C,gBAAgB,GAAAP,KAAA,CAAhBO,gBAAgB;IACb9C,IAAI,GAAAC,6BAAA,CAAAsC,KAAA,EAAAQ,UAAA;EAEP,IAAIN,MAAM,EAAE;IACV,oBACEvF,KAAA,CAAA8B,aAAA,CAACI,YAAY,EAAA2C,QAAA,KACP/B,IAAI;MACRV,YAAY,EAAEA,YAAa;MAC3BG,IAAI,EAAEA,IAAK;MACXf,OAAO,EAAEA,OAAQ;MACjBiB,qBAAqB,EAAEA,qBAAsB;MAC7CE,iBAAiB,EAAEA,iBAAkB;MACrClB,OAAO,EAAEA,OAAQ;MACjBoB,cAAc,EAAEA,cAAe;MAC/BR,OAAO,EAAEA;IAAQ,EAClB,CAAC;EAEN;EAEA,oBACErC,KAAA,CAAA8B,aAAA,CAACrB,SAAS,EAAAoE,QAAA;IACRC,GAAG,EAAE1C,YAAa;IAClBG,IAAI,EAAEA,IAAK;IACXf,OAAO,EAAEA,OAAQ;IACjByD,sBAAsB,EAAE,CAACxC,qBAAsB;IAC/CE,iBAAiB,EAAEA,iBAAkB;IACrCiD,gBAAgB,EAAEA,gBAAiB;IACnC/C,cAAc,EAAEA,cAAe;IAC/BiD,cAAc,EACZrE,OAAO,KAAK,MAAM,GACd;MAAEsE,KAAK,EAAEnF,aAAa;MAAEoF,IAAI,EAAEpF;IAAc,CAAC,GAC7C;MAAEmF,KAAK,EAAEjF,oBAAoB;MAAEkF,IAAI,EAAEjF;IAAoB;EAC9D,GACG+B,IAAI,gBAER9C,KAAA,CAAA8B,aAAA,CAACd,aAAa;IAACG,EAAE,EAAEoB,IAAK;IAACf,OAAO,EAAEA,OAAQ;IAACC,OAAO,EAAEA;EAAQ,GACzDY,OACY,CACN,CAAC;AAEhB,CAAC;AAED+C,WAAW,CAACnD,WAAW,GAAG,aAAa","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"DialogFrame.js","names":["React","useCallback","useEffect","useMemo","useRef","useState","DialogContext","StyledDialogViewport","useStableId","ModalRoot","Fade","SlideFromTop","DialogFrame","_ref","forwardedRef","surface","_ref$open","open","onClose","_ref$dismissOnBackdro","dismissOnBackdropClick","_ref$disableCloseOnEs","disableCloseOnEsc","_ref$animate","animate","onBackdropClickBlocked","_ref$disableReturnFoc","disableReturnFocus","rest","_objectWithoutPropertiesLoose","_excluded","_useState","innerOpen","setInnerOpen","Animation","requestClose","titleId","_useState2","titleCount","setTitleCount","titleCountRef","warnedAboutName","registerTitle","current","count","ariaLabel","explicitLabelledBy","ariaLabelledBy","undefined","process","env","NODE_ENV","timeout","setTimeout","console","warn","clearTimeout","handleDismissBlocked","reason","event","contextValue","createElement","_extends","ref","onRequestClose","onDismissBlocked","disableBackgroundClick","_ref2","isIn","in","onExited","Provider","value","className","displayName"],"sources":["../../../../src/components/Dialog/DialogFrame.tsx"],"sourcesContent":["import React, {\n HTMLAttributes,\n MouseEvent,\n ReactElement,\n ReactNode,\n Ref,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\n\nimport type { DialogProps } from \"./Dialog\";\nimport { DialogContext } from \"./DialogContext\";\nimport { StyledDialogViewport } from \"./Styles\";\nimport useStableId from \"../../utils/useStableId\";\nimport { ModalRoot, ModalRootDismissReason } from \"../ModalRoot\";\nimport { Fade } from \"../Transitions\";\nimport { SlideFromTop } from \"../Transitions/SlideFromTop\";\n\nexport interface DialogFrameProps\n extends Omit<\n DialogProps,\n | \"native\"\n | \"children\"\n | \"size\"\n | \"height\"\n | \"enableBackgroundClick\"\n | \"onClickOutside\"\n > {\n forwardedRef?: Ref<HTMLDialogElement>;\n /** The visible card. The frame places it in the viewport and runs its open and close animation. */\n surface: ReactElement;\n children?: ReactNode;\n}\n\n// What Dialog and ObjectFormModal share: the native modal, the viewport and the animation around a surface each draws.\nexport const DialogFrame = ({\n forwardedRef,\n surface,\n open = false,\n onClose,\n dismissOnBackdropClick = false,\n disableCloseOnEsc = false,\n animate = \"slide\",\n onBackdropClickBlocked,\n disableReturnFocus = false,\n ...rest\n}: DialogFrameProps) => {\n const [innerOpen, setInnerOpen] = useState(open);\n const Animation = animate === \"fade\" ? Fade : SlideFromTop;\n\n useEffect(() => {\n setInnerOpen(open);\n }, [open]);\n\n const requestClose = useCallback(() => setInnerOpen(false), []);\n\n const titleId = useStableId();\n const [titleCount, setTitleCount] = useState(0);\n const titleCountRef = useRef(0);\n const warnedAboutName = useRef(false);\n\n const registerTitle = useCallback(() => {\n titleCountRef.current += 1;\n setTitleCount((count) => count + 1);\n\n return () => {\n titleCountRef.current -= 1;\n setTitleCount((count) => count - 1);\n };\n }, []);\n\n const ariaLabel = rest[\"aria-label\"];\n const explicitLabelledBy = rest[\"aria-labelledby\"];\n const ariaLabelledBy =\n explicitLabelledBy ?? (ariaLabel || titleCount === 0 ? undefined : titleId);\n\n // A dialog inside another one mounts its content a render later, so the check waits a tick for its title.\n useEffect(() => {\n if (\n process.env.NODE_ENV === \"production\" ||\n !innerOpen ||\n warnedAboutName.current ||\n ariaLabel ||\n explicitLabelledBy\n ) {\n return undefined;\n }\n\n const timeout = setTimeout(() => {\n if (titleCountRef.current === 0) {\n warnedAboutName.current = true;\n // eslint-disable-next-line no-console\n console.warn(\n \"Dialog: a native dialog needs an accessible name. Add a Dialog.Title, aria-label or aria-labelledby.\"\n );\n }\n });\n\n return () => clearTimeout(timeout);\n }, [innerOpen, ariaLabel, explicitLabelledBy]);\n\n const handleDismissBlocked = useCallback(\n (reason: ModalRootDismissReason, event?: MouseEvent<HTMLDialogElement>) => {\n if (reason === \"backdrop\") {\n onBackdropClickBlocked?.(event);\n }\n },\n [onBackdropClickBlocked]\n );\n\n const contextValue = useMemo(\n () => ({ requestClose, onClose, titleId, registerTitle }),\n [requestClose, onClose, titleId, registerTitle]\n );\n\n return (\n <ModalRoot\n {...(rest as HTMLAttributes<HTMLDialogElement>)}\n ref={forwardedRef}\n open={innerOpen}\n onRequestClose={requestClose}\n onDismissBlocked={handleDismissBlocked}\n onClose={onClose}\n disableCloseOnEsc={disableCloseOnEsc}\n disableReturnFocus={disableReturnFocus}\n disableBackgroundClick={!dismissOnBackdropClick}\n aria-labelledby={ariaLabelledBy}\n >\n {({ in: isIn, onExited }) => (\n <DialogContext.Provider value={contextValue}>\n <StyledDialogViewport className=\"c-dialog-viewport\">\n <Animation in={isIn} onExited={onExited}>\n {surface}\n </Animation>\n </StyledDialogViewport>\n </DialogContext.Provider>\n )}\n </ModalRoot>\n );\n};\n\nDialogFrame.displayName = \"DialogFrame\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAMVC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,OAAO;AAGd,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,oBAAoB,QAAQ,UAAU;AAC/C,OAAOC,WAAW,MAAM,yBAAyB;AACjD,SAASC,SAAS,QAAgC,cAAc;AAChE,SAASC,IAAI,QAAQ,gBAAgB;AACrC,SAASC,YAAY,QAAQ,6BAA6B;AAkB1D;AACA,OAAO,MAAMC,WAAW,GAAGC,IAAA,IAWH;EAAA,IAVtBC,YAAY,GAAAD,IAAA,CAAZC,YAAY;IACZC,OAAO,GAAAF,IAAA,CAAPE,OAAO;IAAAC,SAAA,GAAAH,IAAA,CACPI,IAAI;IAAJA,IAAI,GAAAD,SAAA,cAAG,KAAK,GAAAA,SAAA;IACZE,OAAO,GAAAL,IAAA,CAAPK,OAAO;IAAAC,qBAAA,GAAAN,IAAA,CACPO,sBAAsB;IAAtBA,sBAAsB,GAAAD,qBAAA,cAAG,KAAK,GAAAA,qBAAA;IAAAE,qBAAA,GAAAR,IAAA,CAC9BS,iBAAiB;IAAjBA,iBAAiB,GAAAD,qBAAA,cAAG,KAAK,GAAAA,qBAAA;IAAAE,YAAA,GAAAV,IAAA,CACzBW,OAAO;IAAPA,OAAO,GAAAD,YAAA,cAAG,OAAO,GAAAA,YAAA;IACjBE,sBAAsB,GAAAZ,IAAA,CAAtBY,sB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Q;IACjBI,iBAAiB,EAAEA,iBAAkB;IACrCK,kBAAkB,EAAEA,kBAAmB;IACvCuC,sBAAsB,EAAE,CAAC9C,sBAAuB;IAChD,mBAAiB2B;EAAe,IAE/BoB,KAAA;IAAA,IAAOC,IAAI,GAAAD,KAAA,CAARE,EAAE;MAAQC,QAAQ,GAAAH,KAAA,CAARG,QAAQ;IAAA,oBACpBtE,KAAA,CAAA6D,aAAA,CAACvD,aAAa,CAACiE,QAAQ;MAACC,KAAK,EAAEZ;IAAa,gBAC1C5D,KAAA,CAAA6D,aAAA,CAACtD,oBAAoB;MAACkE,SAAS,EAAC;IAAmB,gBACjDzE,KAAA,CAAA6D,aAAA,CAAC3B,SAAS;MAACmC,EAAE,EAAED,IAAK;MAACE,QAAQ,EAAEA;IAAS,GACrCvD,OACQ,CACS,CACA,CAAC;EAAA,CAElB,CAAC;AAEhB,CAAC;AAEDH,WAAW,CAAC8D,WAAW,GAAG,aAAa","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const STATUS_TEXT: {
|
|
2
|
+
deprecated: string;
|
|
3
|
+
removed: string;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Warns once per component and prop in development while a caller still passes a prop that is deprecated (it still
|
|
7
|
+
* works and has a replacement) or removed (it does nothing any more).
|
|
8
|
+
*/
|
|
9
|
+
export declare const usePropWarning: (component: string, prop: string, value: unknown, status: keyof typeof STATUS_TEXT, message: string) => void;
|
|
10
|
+
/** Forgets the warnings given so far, so a test can expect one again whatever ran before it. */
|
|
11
|
+
export declare const resetPropWarnings: () => void;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=usePropWarning.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePropWarning.d.ts","sourceRoot":"","sources":["../../../../src/components/Dialog/usePropWarning.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,WAAW;;;CAGhB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,GACzB,WAAW,MAAM,EACjB,MAAM,MAAM,EACZ,OAAO,OAAO,EACd,QAAQ,MAAM,OAAO,WAAW,EAChC,SAAS,MAAM,KACd,IAkBF,CAAC;AAEF,gGAAgG;AAChG,eAAO,MAAM,iBAAiB,QAAO,IAAsB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
const warned = new Set();
|
|
3
|
+
const STATUS_TEXT = {
|
|
4
|
+
deprecated: "is deprecated",
|
|
5
|
+
removed: "is gone"
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Warns once per component and prop in development while a caller still passes a prop that is deprecated (it still
|
|
10
|
+
* works and has a replacement) or removed (it does nothing any more).
|
|
11
|
+
*/
|
|
12
|
+
export const usePropWarning = (component, prop, value, status, message) => {
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
const key = component + "." + prop;
|
|
15
|
+
if (process.env.NODE_ENV === "production" || value === undefined || warned.has(key)) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
warned.add(key);
|
|
19
|
+
// eslint-disable-next-line no-console
|
|
20
|
+
console.warn(component + ": the " + prop + " prop " + STATUS_TEXT[status] + ". " + message);
|
|
21
|
+
}, [component, prop, value, status, message]);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** Forgets the warnings given so far, so a test can expect one again whatever ran before it. */
|
|
25
|
+
export const resetPropWarnings = () => warned.clear();
|
|
26
|
+
//# sourceMappingURL=usePropWarning.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePropWarning.js","names":["useEffect","warned","Set","STATUS_TEXT","deprecated","removed","usePropWarning","component","prop","value","status","message","key","process","env","NODE_ENV","undefined","has","add","console","warn","resetPropWarnings","clear"],"sources":["../../../../src/components/Dialog/usePropWarning.ts"],"sourcesContent":["import { useEffect } from \"react\";\n\nconst warned = new Set<string>();\n\nconst STATUS_TEXT = {\n deprecated: \"is deprecated\",\n removed: \"is gone\",\n};\n\n/**\n * Warns once per component and prop in development while a caller still passes a prop that is deprecated (it still\n * works and has a replacement) or removed (it does nothing any more).\n */\nexport const usePropWarning = (\n component: string,\n prop: string,\n value: unknown,\n status: keyof typeof STATUS_TEXT,\n message: string\n): void => {\n useEffect(() => {\n const key = `${component}.${prop}`;\n\n if (\n process.env.NODE_ENV === \"production\" ||\n value === undefined ||\n warned.has(key)\n ) {\n return;\n }\n\n warned.add(key);\n // eslint-disable-next-line no-console\n console.warn(\n `${component}: the ${prop} prop ${STATUS_TEXT[status]}. ${message}`\n );\n }, [component, prop, value, status, message]);\n};\n\n/** Forgets the warnings given so far, so a test can expect one again whatever ran before it. */\nexport const resetPropWarnings = (): void => warned.clear();\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,OAAO;AAEjC,MAAMC,MAAM,GAAG,IAAIC,GAAG,CAAS,CAAC;AAEhC,MAAMC,WAAW,GAAG;EAClBC,UAAU,EAAE,eAAe;EAC3BC,OAAO,EAAE;AACX,CAAC;;AAED;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAAc,GAAGA,CAC5BC,SAAiB,EACjBC,IAAY,EACZC,KAAc,EACdC,MAAgC,EAChCC,OAAe,KACN;EACTX,SAAS,CAAC,MAAM;IACd,MAAMY,GAAG,GAAML,SAAS,SAAIC,IAAM;IAElC,IACEK,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,IACrCN,KAAK,KAAKO,SAAS,IACnBf,MAAM,CAACgB,GAAG,CAACL,GAAG,CAAC,EACf;MACA;IACF;IAEAX,MAAM,CAACiB,GAAG,CAACN,GAAG,CAAC;IACf;IACAO,OAAO,CAACC,IAAI,CACPb,SAAS,cAASC,IAAI,cAASL,WAAW,CAACO,MAAM,CAAC,UAAKC,OAC5D,CAAC;EACH,CAAC,EAAE,CAACJ,SAAS,EAAEC,IAAI,EAAEC,KAAK,EAAEC,MAAM,EAAEC,OAAO,CAAC,CAAC;AAC/C,CAAC;;AAED;AACA,OAAO,MAAMU,iBAAiB,GAAGA,CAAA,KAAYpB,MAAM,CAACqB,KAAK,CAAC,CAAC","ignoreList":[]}
|
|
@@ -15,6 +15,16 @@ export interface ModalRootProps extends Omit<HTMLAttributes<HTMLDialogElement>,
|
|
|
15
15
|
disableCloseOnEsc?: boolean;
|
|
16
16
|
disableBackgroundClick?: boolean;
|
|
17
17
|
disableScrollLock?: boolean;
|
|
18
|
+
/** Closing leaves the focus off the element that had it before the dialog opened, also when the owner unmounts it */
|
|
19
|
+
disableReturnFocus?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The dialog counts as opened before the sheets that are open, so they move into its overlay root and stay above
|
|
22
|
+
* it. For a page dialog that a sheet covers, such as an archive that opens a task, also when the dialog mounts after
|
|
23
|
+
* the sheet on a reload. A sheet that sits in the page mounts its content again in the overlay root; one that sits
|
|
24
|
+
* in another modal moves without remounting, also above a modal opened in between from outside the sheet. Read when
|
|
25
|
+
* the dialog opens; a later change does not move the stack entry.
|
|
26
|
+
*/
|
|
27
|
+
belowOpenSheets?: boolean;
|
|
18
28
|
/** A function gets the transition state, and the dialog closes when it calls onExited. A node closes at once. */
|
|
19
29
|
children: ReactNode | ((transition: ModalRootTransition) => ReactNode);
|
|
20
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalRoot.d.ts","sourceRoot":"","sources":["../../../../src/components/ModalRoot/ModalRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAEZ,cAAc,EAEd,UAAU,EAEV,SAAS,EAMV,MAAM,OAAO,CAAC;AAiBf,MAAM,MAAM,sBAAsB,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE3D,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,OAAO,CAAC;IACZ,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,cACf,SAAQ,IAAI,CACV,cAAc,CAAC,iBAAiB,CAA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