@cratis/components 2.6.2 → 2.7.1
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/CommandDialog/CommandDialog.js +30 -4
- package/dist/cjs/CommandDialog/CommandDialog.js.map +1 -1
- package/dist/cjs/CommandDialog/CommandStepper.js +23 -15
- package/dist/cjs/CommandDialog/CommandStepper.js.map +1 -1
- package/dist/cjs/CommandDialog/StepperCommandDialog.js +17 -8
- package/dist/cjs/CommandDialog/StepperCommandDialog.js.map +1 -1
- package/dist/cjs/CommandDialog/stepChildren.js +31 -0
- package/dist/cjs/CommandDialog/stepChildren.js.map +1 -0
- package/dist/cjs/DataPage/DataPage.js +54 -10
- package/dist/cjs/DataPage/DataPage.js.map +1 -1
- package/dist/cjs/DataPage/DataPageLayout.js +34 -0
- package/dist/cjs/DataPage/DataPageLayout.js.map +1 -0
- package/dist/cjs/Dialogs/BusyIndicatorDialog.js +6 -2
- package/dist/cjs/Dialogs/BusyIndicatorDialog.js.map +1 -1
- package/dist/cjs/Dialogs/Dialog.js +61 -7
- package/dist/cjs/Dialogs/Dialog.js.map +1 -1
- package/dist/cjs/Dialogs/DialogInitialFocus.js +49 -0
- package/dist/cjs/Dialogs/DialogInitialFocus.js.map +1 -0
- package/dist/cjs/Dialogs/index.js +5 -0
- package/dist/cjs/Dialogs/index.js.map +1 -1
- package/dist/cjs/tailwind-utilities.css +3 -0
- package/dist/esm/CommandDialog/CommandDialog.d.ts.map +1 -1
- package/dist/esm/CommandDialog/CommandDialog.js +30 -4
- package/dist/esm/CommandDialog/CommandDialog.js.map +1 -1
- package/dist/esm/CommandDialog/CommandStepper.d.ts.map +1 -1
- package/dist/esm/CommandDialog/CommandStepper.js +23 -15
- package/dist/esm/CommandDialog/CommandStepper.js.map +1 -1
- package/dist/esm/CommandDialog/StepperCommandDialog.d.ts.map +1 -1
- package/dist/esm/CommandDialog/StepperCommandDialog.js +18 -9
- package/dist/esm/CommandDialog/StepperCommandDialog.js.map +1 -1
- package/dist/esm/CommandDialog/stepChildren.d.ts +3 -0
- package/dist/esm/CommandDialog/stepChildren.d.ts.map +1 -0
- package/dist/esm/CommandDialog/stepChildren.js +29 -0
- package/dist/esm/CommandDialog/stepChildren.js.map +1 -0
- package/dist/esm/DataPage/DataPage.d.ts +1 -0
- package/dist/esm/DataPage/DataPage.d.ts.map +1 -1
- package/dist/esm/DataPage/DataPage.js +54 -10
- package/dist/esm/DataPage/DataPage.js.map +1 -1
- package/dist/esm/DataPage/DataPageLayout.d.ts +6 -0
- package/dist/esm/DataPage/DataPageLayout.d.ts.map +1 -0
- package/dist/esm/DataPage/DataPageLayout.js +32 -0
- package/dist/esm/DataPage/DataPageLayout.js.map +1 -0
- package/dist/esm/Dialogs/BusyIndicatorDialog.d.ts.map +1 -1
- package/dist/esm/Dialogs/BusyIndicatorDialog.js +6 -2
- package/dist/esm/Dialogs/BusyIndicatorDialog.js.map +1 -1
- package/dist/esm/Dialogs/Dialog.d.ts +3 -1
- package/dist/esm/Dialogs/Dialog.d.ts.map +1 -1
- package/dist/esm/Dialogs/Dialog.js +62 -8
- package/dist/esm/Dialogs/Dialog.js.map +1 -1
- package/dist/esm/Dialogs/DialogInitialFocus.d.ts +6 -0
- package/dist/esm/Dialogs/DialogInitialFocus.d.ts.map +1 -0
- package/dist/esm/Dialogs/DialogInitialFocus.js +49 -0
- package/dist/esm/Dialogs/DialogInitialFocus.js.map +1 -0
- package/dist/esm/Dialogs/index.d.ts +1 -0
- package/dist/esm/Dialogs/index.d.ts.map +1 -1
- package/dist/esm/Dialogs/index.js +1 -0
- package/dist/esm/Dialogs/index.js.map +1 -1
- package/dist/esm/tailwind-utilities.css +3 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/vite.config.d.ts.map +1 -1
- package/dist/esm/vite.config.js +1 -0
- package/dist/esm/vite.config.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
4
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
5
|
+
/**
|
|
6
|
+
* Gets the step panels a stepper will actually render, in render order.
|
|
7
|
+
*
|
|
8
|
+
* A conditional step is written as `{condition && <StepperPanel/>}` — which yields
|
|
9
|
+
* `false` when the condition does not hold — and explicit `null` / `undefined` children
|
|
10
|
+
* are just as common. `React.Children.count` counts those, so anything deriving a step
|
|
11
|
+
* count from it believes the wizard has more steps than it renders: navigation runs past
|
|
12
|
+
* the last real panel and the per-step validation gate reads off the end of its array.
|
|
13
|
+
*
|
|
14
|
+
* `React.Children.toArray` already drops `null`, `undefined` and booleans; filtering to
|
|
15
|
+
* valid elements additionally drops bare text children, which are not steps either.
|
|
16
|
+
*
|
|
17
|
+
* Fragments are deliberately **not** flattened — a `<>…</>` wrapping several panels stays
|
|
18
|
+
* one entry, which is the behavior the stepper has always had. Supporting fragments as a
|
|
19
|
+
* container for multiple steps is a separate, additive change.
|
|
20
|
+
*
|
|
21
|
+
* @param children - The stepper children to inspect.
|
|
22
|
+
* @returns The child elements that render as steps.
|
|
23
|
+
*/
|
|
24
|
+
function getStepPanels(children) {
|
|
25
|
+
return React.Children.toArray(children).filter((child) => React.isValidElement(child));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { getStepPanels };
|
|
29
|
+
//# sourceMappingURL=stepChildren.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stepChildren.js","sources":["../../../CommandDialog/stepChildren.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;AACA;AAIA;;;;;;;;;;;;;;;;;;AAkBG;AACG,SAAU,aAAa,CAAC,QAAyB,EAAA;IACnD,OAAO,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,KAAkC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;AACvH;;;;"}
|
|
@@ -5,6 +5,7 @@ import { type MenubarProps } from 'primereact/menubar';
|
|
|
5
5
|
import { IObservableQueryFor, IQueryFor } from '@cratis/arc/queries';
|
|
6
6
|
import { DataTableFilterMeta, DataTableSelectionSingleChangeEvent, type DataTableProps as PrimeDataTableProps } from 'primereact/datatable';
|
|
7
7
|
import { Constructor } from '@cratis/fundamentals';
|
|
8
|
+
import 'allotment/dist/style.css';
|
|
8
9
|
export interface MenuItemProps extends PrimeMenuItem {
|
|
9
10
|
disableOnUnselected?: boolean;
|
|
10
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataPage.d.ts","sourceRoot":"","sources":["../../../DataPage/DataPage.tsx"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"DataPage.d.ts","sourceRoot":"","sources":["../../../DataPage/DataPage.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAiB,SAAS,EAAW,MAAM,OAAO,CAAC;AAE1D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAY,MAAM,qBAAqB,CAAC;AAE/E,OAAO,EAAE,mBAAmB,EAAE,mCAAmC,EAAE,KAAK,cAAc,IAAI,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAG5I,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAUnD,OAAO,0BAA0B,CAAC;AAQlC,MAAM,WAAW,aAAc,SAAQ,aAAa;IAMhD,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACjC;AAOD,eAAO,MAAM,QAAQ,GAAI,GAAG,aAAa,SAExC,CAAC;AAKF,MAAM,WAAW,cAAc;IAE3B,QAAQ,EAAE,SAAS,CAAC;CACvB;AA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S,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC;IAG/D,aAAa,CAAC,EAAE,OAAO,CAAC;IAKxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAG1B,SAAS,CAAC,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;IAG/B,gBAAgB,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;IAG7C,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B;AA2GD,QAAA,MAAM,QAAQ;KAAI,MAAM,SAAS,SAAS,CAAC,SAAS,CAAC,GAAG,mBAAmB,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,SAAS,SAAS,MAAM,EAAE,UAAU,SAAS,MAAM,SAAS,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,CAAC;8BA7TpK,cAAc;4BA4ChB,WAAW;CA+ShD,CAAC;AAKF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -6,16 +6,37 @@ import { QueryFor } from '@cratis/arc/queries';
|
|
|
6
6
|
import { DataTableForObservableQuery } from '../DataTables/DataTableForObservableQuery.js';
|
|
7
7
|
import { DataTableForQuery } from '../DataTables/DataTableForQuery.js';
|
|
8
8
|
import { Allotment } from 'allotment';
|
|
9
|
+
import { DataPageLayout } from './DataPageLayout.js';
|
|
10
|
+
import 'allotment/dist/style.css';
|
|
9
11
|
|
|
10
12
|
/**
|
|
11
13
|
* Declarative menu item for use inside `<DataPage.MenuItems>`. Renders nothing
|
|
12
14
|
* directly; the surrounding {@link MenuItems} component reads its props and
|
|
13
15
|
* forwards them to the action `Menubar`.
|
|
14
16
|
*/
|
|
15
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16
17
|
const MenuItem = (_) => {
|
|
17
18
|
return null;
|
|
18
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* The action bar is an intrinsically sized item in the page's layout column —
|
|
22
|
+
* it takes the height its menubar needs and never gives any of it up, so the
|
|
23
|
+
* table region below it is the only part that has to adapt to the space left.
|
|
24
|
+
*/
|
|
25
|
+
const actionsStyle = { flexShrink: 0 };
|
|
26
|
+
/**
|
|
27
|
+
* The table region takes every pixel the action bar leaves and no more.
|
|
28
|
+
* `minHeight: 0` is the load-bearing half: without it the region's automatic
|
|
29
|
+
* minimum keeps it at content height, the column grows past the page, and the
|
|
30
|
+
* table's paginator ends up below the clipped edge.
|
|
31
|
+
*/
|
|
32
|
+
const tableRegionStyle = { flexGrow: 1, flexBasis: 0, minHeight: 0 };
|
|
33
|
+
/**
|
|
34
|
+
* The floor a `DataPage` falls back to when its ancestors give it no height at
|
|
35
|
+
* all. A page that renders as an empty sliver is indistinguishable from a
|
|
36
|
+
* broken one, so a contract-violating consumer gets a small but usable page
|
|
37
|
+
* instead of nothing.
|
|
38
|
+
*/
|
|
39
|
+
const pageStyle = { minHeight: '20rem' };
|
|
19
40
|
/**
|
|
20
41
|
* Renders an action `Menubar` at the top of a {@link DataPage}, populated from
|
|
21
42
|
* `<DataPage.MenuItem>` children. Each menu item's `disableOnUnselected` flag
|
|
@@ -41,7 +62,7 @@ const MenuItems = ({ children }) => {
|
|
|
41
62
|
});
|
|
42
63
|
return menuItems;
|
|
43
64
|
}, [children, context.selectedItem]);
|
|
44
|
-
return (jsx("div", { className: "px-4 py-2", children: jsx(Menubar, { "aria-label": "Actions", model: items, className: context.menubarClassName, pt: context.menubarPt, ptOptions: context.menubarPtOptions, unstyled: context.menubarUnstyled }) }));
|
|
65
|
+
return (jsx("div", { className: "cratis-data-page-actions px-4 py-2", style: actionsStyle, children: jsx(Menubar, { "aria-label": "Actions", model: items, className: context.menubarClassName, pt: context.menubarPt, ptOptions: context.menubarPtOptions, unstyled: context.menubarUnstyled }) }));
|
|
45
66
|
};
|
|
46
67
|
/**
|
|
47
68
|
* Renders the data table at the body of a {@link DataPage}. Automatically
|
|
@@ -54,12 +75,10 @@ const MenuItems = ({ children }) => {
|
|
|
54
75
|
*/
|
|
55
76
|
const Columns = ({ children }) => {
|
|
56
77
|
const context = useDataPageContext();
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return (jsx(DataTableForObservableQuery, { ...context, selection: context.selectedItem, onSelectionChange: context.onSelectionChanged, clientFiltering: context.clientFiltering, className: context.tableClassName, pt: context.tablePt, ptOptions: context.tablePtOptions, unstyled: context.tableUnstyled, children: children }));
|
|
62
|
-
}
|
|
78
|
+
const isSnapshotQuery = context.query.prototype instanceof QueryFor;
|
|
79
|
+
return (jsx("div", { className: "cratis-data-page-table", style: tableRegionStyle, children: isSnapshotQuery
|
|
80
|
+
? jsx(DataTableForQuery, { ...context, selection: context.selectedItem, onSelectionChange: context.onSelectionChanged, clientFiltering: context.clientFiltering, className: context.tableClassName, pt: context.tablePt, ptOptions: context.tablePtOptions, unstyled: context.tableUnstyled, children: children })
|
|
81
|
+
: jsx(DataTableForObservableQuery, { ...context, selection: context.selectedItem, onSelectionChange: context.onSelectionChanged, clientFiltering: context.clientFiltering, className: context.tableClassName, pt: context.tablePt, ptOptions: context.tablePtOptions, unstyled: context.tableUnstyled, children: children }) }));
|
|
63
82
|
};
|
|
64
83
|
const DataPageContext = React.createContext(null);
|
|
65
84
|
function useDataPageContext() {
|
|
@@ -138,6 +157,29 @@ function useDataPageContext() {
|
|
|
138
157
|
* </DataPage>
|
|
139
158
|
* ```
|
|
140
159
|
*
|
|
160
|
+
* ## Height — `DataPage` needs a bounded ancestor
|
|
161
|
+
*
|
|
162
|
+
* `DataPage` fills the height it is given and divides it between the action
|
|
163
|
+
* bar and the table region, so the table's paginator always sits at the
|
|
164
|
+
* bottom of the page rather than below its edge. It cannot invent that height:
|
|
165
|
+
* every element from the page root down sizes as a percentage of its parent,
|
|
166
|
+
* so **some ancestor has to have a definite height**.
|
|
167
|
+
*
|
|
168
|
+
* ```tsx
|
|
169
|
+
* // ✅ the router outlet, a sized container, or a flex child with min-height
|
|
170
|
+
* <div style={{ height: '100vh' }}>
|
|
171
|
+
* <DataPage … />
|
|
172
|
+
* </div>
|
|
173
|
+
*
|
|
174
|
+
* // ❌ nothing above resolves to a height — the table grows to its content
|
|
175
|
+
* <div>
|
|
176
|
+
* <DataPage … />
|
|
177
|
+
* </div>
|
|
178
|
+
* ```
|
|
179
|
+
*
|
|
180
|
+
* Without one, the page falls back to a small fixed height so it stays
|
|
181
|
+
* usable instead of collapsing to nothing.
|
|
182
|
+
*
|
|
141
183
|
* ## Styling
|
|
142
184
|
*
|
|
143
185
|
* The inner DataTable and Menubar each have their own per-slot props:
|
|
@@ -160,8 +202,10 @@ const DataPage = (props) => {
|
|
|
160
202
|
}
|
|
161
203
|
};
|
|
162
204
|
const context = { ...props, selectedItem, onSelectionChanged: selectionChanged };
|
|
163
|
-
return (jsx(DataPageContext.Provider, { value: context, children: jsx(Page, { title: props.title, panel: true,
|
|
164
|
-
|
|
205
|
+
return (jsx(DataPageContext.Provider, { value: context, children: jsx(Page, { title: props.title, panel: true, style: pageStyle, children: props.detailsComponent
|
|
206
|
+
? jsxs(Allotment, { className: "h-full", proportionalLayout: false, children: [jsx(Allotment.Pane, { children: jsx(DataPageLayout, { children: props.children }) }), selectedItem &&
|
|
207
|
+
jsx(Allotment.Pane, { preferredSize: "450px", children: jsx(props.detailsComponent, { item: selectedItem, onRefresh: props.onRefresh }) })] })
|
|
208
|
+
: jsx(DataPageLayout, { children: props.children }) }) }));
|
|
165
209
|
};
|
|
166
210
|
DataPage.MenuItems = MenuItems;
|
|
167
211
|
DataPage.Columns = Columns;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataPage.js","sources":["../../../DataPage/DataPage.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DataPage.js","sources":["../../../DataPage/DataPage.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;;;AAwCA;;;;AAIG;AACI,MAAM,QAAQ,GAAG,CAAC,CAAgB,KAAI;AACzC,IAAA,OAAO,IAA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,SAAS,EAAC,QAAQ,EAAC,kBAAkB,EAAE,KAAK,EAAA,QAAA,EAAA,CACrDD,GAAA,CAAC,SAAS,CAAC,IAAI,EAAA,EAAA,QAAA,EACXA,GAAA,CAAC,cAAc,EAAA,EAAA,QAAA,EAAE,KAAK,CAAC,QAAQ,EAAA,CAAkB,EAAA,CACpC,EAChB,YAAY;4BACTA,GAAA,CAAC,SAAS,CAAC,IAAI,EAAA,EAAC,aAAa,EAAC,OAAO,EAAA,QAAA,EACjCA,GAAA,CAAC,KAAK,CAAC,gBAAgB,IAAC,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAA,CAAI,EAAA,CAC7D,CAAA,EAAA;kBAGvBA,GAAA,CAAC,cAAc,EAAA,EAAA,QAAA,EAAE,KAAK,CAAC,QAAQ,EAAA,CAAkB,EAAA,CACpD,EAAA,CACgB;AAEnC;AAEA,QAAQ,CAAC,SAAS,GAAG,SAAS;AAC9B,QAAQ,CAAC,OAAO,GAAG,OAAO;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataPageLayout.d.ts","sourceRoot":"","sources":["../../../DataPage/DataPageLayout.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AAKjD,MAAM,WAAW,mBAAmB;IAEhC,QAAQ,EAAE,SAAS,CAAC;CACvB;AA6BD,eAAO,MAAM,cAAc,GAAI,cAAc,mBAAmB,gCAI/D,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The layout root's own style. Declared inline rather than in a stylesheet on
|
|
5
|
+
* purpose: a consumer that never imports a stylesheet from this package still
|
|
6
|
+
* has to get a working page out of `DataPage`, and the height allocation is
|
|
7
|
+
* what the whole component depends on.
|
|
8
|
+
*
|
|
9
|
+
* `minHeight: 0` is what lets the column shrink inside the flex parent that
|
|
10
|
+
* `Page` renders — without it the default `min-height: auto` keeps the column
|
|
11
|
+
* at content height and everything below the available space is clipped.
|
|
12
|
+
*/
|
|
13
|
+
const layoutStyle = {
|
|
14
|
+
display: 'flex',
|
|
15
|
+
flexDirection: 'column',
|
|
16
|
+
height: '100%',
|
|
17
|
+
minHeight: 0
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* The vertical layout inside a `DataPage`'s primary pane.
|
|
21
|
+
*
|
|
22
|
+
* It is a definite-height flex column, so the action bar can be an intrinsic
|
|
23
|
+
* item while the table region absorbs whatever height is left. That is what
|
|
24
|
+
* keeps the table's own paginator inside the page instead of pushing it past
|
|
25
|
+
* the bottom edge, where the surrounding `overflow: hidden` clips it away.
|
|
26
|
+
*
|
|
27
|
+
* @param props - {@link DataPageLayoutProps}.
|
|
28
|
+
*/
|
|
29
|
+
const DataPageLayout = ({ children }) => (jsx("div", { className: 'cratis-data-page-layout', style: layoutStyle, children: children }));
|
|
30
|
+
|
|
31
|
+
export { DataPageLayout };
|
|
32
|
+
//# sourceMappingURL=DataPageLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataPageLayout.js","sources":["../../../DataPage/DataPageLayout.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;AAaA;;;;;;;;;AASG;AACH,MAAM,WAAW,GAAkB;AAC/B,IAAA,OAAO,EAAE,MAAM;AACf,IAAA,aAAa,EAAE,QAAQ;AACvB,IAAA,MAAM,EAAE,MAAM;AACd,IAAA,SAAS,EAAE;CACd;AAED;;;;;;;;;AASG;AACI,MAAM,cAAc,GAAG,CAAC,EAAE,QAAQ,EAAuB,MAC5DA,aAAK,SAAS,EAAC,yBAAyB,EAAC,KAAK,EAAE,WAAW,EAAA,QAAA,EACtD,QAAQ,EAAA,CACP;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BusyIndicatorDialog.d.ts","sourceRoot":"","sources":["../../../Dialogs/BusyIndicatorDialog.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"BusyIndicatorDialog.d.ts","sourceRoot":"","sources":["../../../Dialogs/BusyIndicatorDialog.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAuDvE,eAAO,MAAM,mBAAmB,GAAI,OAAO,0BAA0B,gCAiBpE,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { ProgressSpinner } from 'primereact/progressspinner';
|
|
3
3
|
import { Dialog } from './Dialog.js';
|
|
4
|
+
import { DialogInitialFocus } from './DialogInitialFocus.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Modal "busy" dialog used by the `@cratis/arc.react` dialog host whenever a
|
|
@@ -40,7 +41,10 @@ import { Dialog } from './Dialog.js';
|
|
|
40
41
|
*
|
|
41
42
|
* - **No interactive buttons.** A busy indicator is a wait-state, not a
|
|
42
43
|
* confirmation prompt. The dialog has no Ok / Cancel / X — only the host
|
|
43
|
-
* can dismiss it.
|
|
44
|
+
* can dismiss it. Because there is nothing focusable inside it, initial
|
|
45
|
+
* focus is put on the dialog's own title, so a keyboard or screen-reader
|
|
46
|
+
* user is told what is happening instead of being left on `document.body`
|
|
47
|
+
* behind the modal mask.
|
|
44
48
|
* - **No per-instance pass-through.** The request type
|
|
45
49
|
* ({@link BusyIndicatorDialogRequest}) is owned by `@cratis/arc.react`, so
|
|
46
50
|
* `pt` / `unstyled` are not exposed on a per-call basis. Restyle the
|
|
@@ -50,7 +54,7 @@ import { Dialog } from './Dialog.js';
|
|
|
50
54
|
* @param props - The request from the dialog host, containing `title` and `message`.
|
|
51
55
|
*/
|
|
52
56
|
const BusyIndicatorDialog = (props) => {
|
|
53
|
-
return (jsx(Dialog, { title: props.title, visible: true, onCancel: () => undefined, buttons: null, children: jsxs("div", { className: "flex flex-col items-center justify-center gap-4 py-4", children: [jsx(ProgressSpinner, {}), jsx("p", { className: "m-0 text-center", children: props.message })] }) }));
|
|
57
|
+
return (jsx(Dialog, { title: props.title, visible: true, onCancel: () => undefined, buttons: null, initialFocus: DialogInitialFocus.Content, children: jsxs("div", { className: "flex flex-col items-center justify-center gap-4 py-4", children: [jsx(ProgressSpinner, {}), jsx("p", { className: "m-0 text-center", children: props.message })] }) }));
|
|
54
58
|
};
|
|
55
59
|
|
|
56
60
|
export { BusyIndicatorDialog };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BusyIndicatorDialog.js","sources":["../../../Dialogs/BusyIndicatorDialog.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs"],"mappings":"
|
|
1
|
+
{"version":3,"file":"BusyIndicatorDialog.js","sources":["../../../Dialogs/BusyIndicatorDialog.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs"],"mappings":";;;;;AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDG;AACI,MAAM,mBAAmB,GAAG,CAAC,KAAiC,KAAI;IACrE,QACIA,GAAA,CAAC,MAAM,EAAA,EACH,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,OAAO,EAAE,IAAI,EACb,QAAQ,EAAE,MAAM,SAAS,EACzB,OAAO,EAAE,IAAI,EACb,YAAY,EAAE,kBAAkB,CAAC,OAAO,EAAA,QAAA,EAExCC,IAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,sDAAsD,EAAA,QAAA,EAAA,CACjED,GAAA,CAAC,eAAe,EAAA,EAAA,CAAG,EACnBA,WAAG,SAAS,EAAC,iBAAiB,EAAA,QAAA,EACzB,KAAK,CAAC,OAAO,EAAA,CACd,CAAA,EAAA,CACF,EAAA,CACD;AAEjB;;;;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type DialogProps as PrimeDialogProps } from 'primereact/dialog';
|
|
2
2
|
import { DialogResult, DialogButtons } from '@cratis/arc.react/dialogs';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
|
+
import { DialogInitialFocus } from './DialogInitialFocus';
|
|
4
5
|
export type CloseDialog = (result: DialogResult) => boolean | void | Promise<boolean> | Promise<void>;
|
|
5
6
|
export type ConfirmCallback = () => boolean | void | Promise<boolean> | Promise<void>;
|
|
6
7
|
export type CancelCallback = () => boolean | void | Promise<boolean> | Promise<void>;
|
|
@@ -11,6 +12,7 @@ export interface DialogProps {
|
|
|
11
12
|
onConfirm?: ConfirmCallback;
|
|
12
13
|
onCancel?: CancelCallback;
|
|
13
14
|
buttons?: DialogButtons | ReactNode;
|
|
15
|
+
initialFocus?: DialogInitialFocus;
|
|
14
16
|
children: ReactNode;
|
|
15
17
|
width?: string;
|
|
16
18
|
style?: PrimeDialogProps['style'];
|
|
@@ -27,5 +29,5 @@ export interface DialogProps {
|
|
|
27
29
|
ptOptions?: PrimeDialogProps['ptOptions'];
|
|
28
30
|
unstyled?: boolean;
|
|
29
31
|
}
|
|
30
|
-
export declare const Dialog: ({ title, visible, onClose, onConfirm, onCancel, buttons, children, width, style, contentStyle, resizable, isValid, isBusy, okLabel, cancelLabel, yesLabel, noLabel, className, pt, ptOptions, unstyled }: DialogProps) => import("react").JSX.Element;
|
|
32
|
+
export declare const Dialog: ({ title, visible, onClose, onConfirm, onCancel, buttons, initialFocus, children, width, style, contentStyle, resizable, isValid, isBusy, okLabel, cancelLabel, yesLabel, noLabel, className, pt, ptOptions, unstyled }: DialogProps) => import("react").JSX.Element;
|
|
31
33
|
//# sourceMappingURL=Dialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../Dialogs/Dialog.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAyB,KAAK,WAAW,IAAI,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAEhG,OAAO,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C,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAC;IAGhD,SAAS,CAAC,EAAE,OAAO,CAAC;IAOpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAMlB,MAAM,CAAC,EAAE,OAAO,CAAC;IAGjB,OAAO,CAAC,EAAE,MAAM,CAAC;IAGjB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,OAAO,CAAC,EAAE,MAAM,CAAC;IAKjB,SAAS,CAAC,EAAE,MAAM,CAAC;IAQnB,EAAE,CAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAM5B,SAAS,CAAC,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC;IAO1C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAwGD,eAAO,MAAM,MAAM,GAAI,wNAuBpB,WAAW,gCAkJb,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { Dialog as Dialog$1 } from 'primereact/dialog';
|
|
3
3
|
import { Button } from 'primereact/button';
|
|
4
|
-
import { useDialogContext,
|
|
4
|
+
import { useDialogContext, DialogButtons, DialogResult } from '@cratis/arc.react/dialogs';
|
|
5
|
+
import { useRef } from 'react';
|
|
6
|
+
import { DialogInitialFocus } from './DialogInitialFocus.js';
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
9
|
* Cratis wrapper around PrimeReact's `Dialog` that adds the surface every Arc
|
|
@@ -23,6 +25,36 @@ import { useDialogContext, DialogResult, DialogButtons } from '@cratis/arc.react
|
|
|
23
25
|
* - **Validity gate** (`isValid`) that disables the confirm button without
|
|
24
26
|
* disabling the cancel button. Used by command-executing wrappers to
|
|
25
27
|
* block submission while form validation fails.
|
|
28
|
+
* - **Initial focus** (`initialFocus`) choosing which element inside the
|
|
29
|
+
* dialog the keyboard lands on when it opens.
|
|
30
|
+
*
|
|
31
|
+
* ## Initial focus
|
|
32
|
+
*
|
|
33
|
+
* By default the confirm button is focused when the dialog opens, so the
|
|
34
|
+
* common "read it, press Enter" flow costs one keystroke. That default also
|
|
35
|
+
* *arms* the confirm button: browsers fire `click` from the `keydown` of
|
|
36
|
+
* `Enter`, so the key still held down from opening the dialog — or the very
|
|
37
|
+
* ordinary habit of pressing `Enter` twice — confirms it immediately.
|
|
38
|
+
*
|
|
39
|
+
* A dialog whose confirm action is destructive **and** needs no input to
|
|
40
|
+
* become valid gets no protection from `isValid`, because there is nothing
|
|
41
|
+
* to fill in. Give those dialogs an explicit
|
|
42
|
+
* {@link DialogInitialFocus} instead:
|
|
43
|
+
*
|
|
44
|
+
* ```tsx
|
|
45
|
+
* <Dialog title="Delete personal data?"
|
|
46
|
+
* buttons={DialogButtons.YesNo}
|
|
47
|
+
* initialFocus={DialogInitialFocus.Cancel}
|
|
48
|
+
* onConfirm={...} onCancel={...}>
|
|
49
|
+
* This permanently removes the person and every record about them.
|
|
50
|
+
* </Dialog>
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* `Cancel` focuses the dismissing button (`Cancel`, or `No` when the set has
|
|
54
|
+
* no `Cancel`); `Content` focuses the dialog's title so nothing at all is
|
|
55
|
+
* armed and screen readers announce the dialog from the top. Both keep the
|
|
56
|
+
* footer, the close (X), `Escape`, and every callback intact — unlike
|
|
57
|
+
* replacing `buttons` with a custom node.
|
|
26
58
|
*
|
|
27
59
|
* ## Arc dialog host integration
|
|
28
60
|
*
|
|
@@ -75,7 +107,7 @@ import { useDialogContext, DialogResult, DialogButtons } from '@cratis/arc.react
|
|
|
75
107
|
*
|
|
76
108
|
* @param props - {@link DialogProps}.
|
|
77
109
|
*/
|
|
78
|
-
const Dialog = ({ title, visible = true, onClose, onConfirm, onCancel, buttons = DialogButtons.OkCancel, children, width = '450px', style, contentStyle, resizable = false, isValid, isBusy = false, okLabel = 'Ok', cancelLabel = 'Cancel', yesLabel = 'Yes', noLabel = 'No', className, pt, ptOptions, unstyled }) => {
|
|
110
|
+
const Dialog = ({ title, visible = true, onClose, onConfirm, onCancel, buttons = DialogButtons.OkCancel, initialFocus = DialogInitialFocus.Confirm, children, width = '450px', style, contentStyle, resizable = false, isValid, isBusy = false, okLabel = 'Ok', cancelLabel = 'Cancel', yesLabel = 'Yes', noLabel = 'No', className, pt, ptOptions, unstyled }) => {
|
|
79
111
|
// useDialogContext() is called unconditionally on every render — the try/catch only suppresses
|
|
80
112
|
// the exception when Dialog is used standalone (outside a provider). React's Rules of Hooks
|
|
81
113
|
// are not violated because the hook is always called; the try/catch never skips the call.
|
|
@@ -88,7 +120,29 @@ const Dialog = ({ title, visible = true, onClose, onConfirm, onCancel, buttons =
|
|
|
88
120
|
contextCloseDialog = undefined;
|
|
89
121
|
}
|
|
90
122
|
const isDialogValid = isValid !== false;
|
|
91
|
-
|
|
123
|
+
// A dismissing button only exists for the predefined sets that have one — Cancel for
|
|
124
|
+
// OkCancel / YesNoCancel, No for YesNo. Asking for Cancel focus without one (DialogButtons.Ok,
|
|
125
|
+
// a custom footer node, or no footer) degrades to focusing the title rather than silently
|
|
126
|
+
// leaving focus on document.body outside the modal.
|
|
127
|
+
const hasDismissingButton = typeof buttons === 'number' && buttons !== DialogButtons.Ok;
|
|
128
|
+
const resolvedInitialFocus = (initialFocus === DialogInitialFocus.Cancel && !hasDismissingButton)
|
|
129
|
+
? DialogInitialFocus.Content
|
|
130
|
+
: initialFocus;
|
|
131
|
+
const focusesConfirmButton = resolvedInitialFocus === DialogInitialFocus.Confirm;
|
|
132
|
+
const focusesDismissingButton = resolvedInitialFocus === DialogInitialFocus.Cancel;
|
|
133
|
+
const focusesTitle = resolvedInitialFocus === DialogInitialFocus.Content;
|
|
134
|
+
// PrimeReact's focus trap parks focus on the first focusable element inside the dialog while
|
|
135
|
+
// it transitions in, and its own onShow focus only fires when nothing in the dialog has focus.
|
|
136
|
+
// Moving focus to the title from onShow therefore runs last and wins, without having to fight
|
|
137
|
+
// the trap or turn focusOnShow off (which would leave focus outside the modal for the duration
|
|
138
|
+
// of the transition).
|
|
139
|
+
const titleRef = useRef(null);
|
|
140
|
+
const handleShow = () => {
|
|
141
|
+
if (focusesTitle) {
|
|
142
|
+
titleRef.current?.focus({ preventScroll: true });
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
const headerElement = (jsx("div", { className: "inline-flex items-center justify-center gap-2", children: jsx("span", { ref: titleRef, tabIndex: focusesTitle ? -1 : undefined, className: "font-bold whitespace-nowrap", children: title }) }));
|
|
92
146
|
const handleClose = async (result) => {
|
|
93
147
|
let shouldCloseThroughContext = true;
|
|
94
148
|
if (result === DialogResult.Ok || result === DialogResult.Yes) {
|
|
@@ -115,10 +169,10 @@ const Dialog = ({ title, visible = true, onClose, onConfirm, onCancel, buttons =
|
|
|
115
169
|
contextCloseDialog?.(result);
|
|
116
170
|
}
|
|
117
171
|
};
|
|
118
|
-
const okFooter = (jsx(Fragment, { children: jsx(Button, { label: okLabel, icon: "pi pi-check", onClick: () => handleClose(DialogResult.Ok), disabled: !isDialogValid || isBusy, loading: isBusy, autoFocus:
|
|
119
|
-
const okCancelFooter = (jsxs(Fragment, { children: [jsx(Button, { label: okLabel, icon: "pi pi-check", onClick: () => handleClose(DialogResult.Ok), disabled: !isDialogValid || isBusy, loading: isBusy, autoFocus:
|
|
120
|
-
const yesNoFooter = (jsxs(Fragment, { children: [jsx(Button, { label: yesLabel, icon: "pi pi-check", onClick: () => handleClose(DialogResult.Yes), disabled: !isDialogValid || isBusy, loading: isBusy, autoFocus:
|
|
121
|
-
const yesNoCancelFooter = (jsxs(Fragment, { children: [jsx(Button, { label: yesLabel, icon: "pi pi-check", onClick: () => handleClose(DialogResult.Yes), disabled: !isDialogValid || isBusy, loading: isBusy, autoFocus:
|
|
172
|
+
const okFooter = (jsx(Fragment, { children: jsx(Button, { label: okLabel, icon: "pi pi-check", onClick: () => handleClose(DialogResult.Ok), disabled: !isDialogValid || isBusy, loading: isBusy, autoFocus: focusesConfirmButton }) }));
|
|
173
|
+
const okCancelFooter = (jsxs(Fragment, { children: [jsx(Button, { label: okLabel, icon: "pi pi-check", onClick: () => handleClose(DialogResult.Ok), disabled: !isDialogValid || isBusy, loading: isBusy, autoFocus: focusesConfirmButton }), jsx(Button, { label: cancelLabel, icon: "pi pi-times", outlined: true, onClick: () => handleClose(DialogResult.Cancelled), disabled: isBusy, autoFocus: focusesDismissingButton })] }));
|
|
174
|
+
const yesNoFooter = (jsxs(Fragment, { children: [jsx(Button, { label: yesLabel, icon: "pi pi-check", onClick: () => handleClose(DialogResult.Yes), disabled: !isDialogValid || isBusy, loading: isBusy, autoFocus: focusesConfirmButton }), jsx(Button, { label: noLabel, icon: "pi pi-times", outlined: true, onClick: () => handleClose(DialogResult.No), disabled: isBusy, autoFocus: focusesDismissingButton })] }));
|
|
175
|
+
const yesNoCancelFooter = (jsxs(Fragment, { children: [jsx(Button, { label: yesLabel, icon: "pi pi-check", onClick: () => handleClose(DialogResult.Yes), disabled: !isDialogValid || isBusy, loading: isBusy, autoFocus: focusesConfirmButton }), jsx(Button, { label: noLabel, icon: "pi pi-times", outlined: true, onClick: () => handleClose(DialogResult.No), disabled: isBusy }), jsx(Button, { label: cancelLabel, icon: "pi pi-times", outlined: true, onClick: () => handleClose(DialogResult.Cancelled), disabled: isBusy, autoFocus: focusesDismissingButton })] }));
|
|
122
176
|
const getFooterInterior = () => {
|
|
123
177
|
// If buttons is a ReactNode (custom buttons), use it directly
|
|
124
178
|
if (typeof buttons !== 'number') {
|
|
@@ -140,7 +194,7 @@ const Dialog = ({ title, visible = true, onClose, onConfirm, onCancel, buttons =
|
|
|
140
194
|
const footer = (jsx("div", { className: "flex flex-wrap justify-start gap-3", children: getFooterInterior() }));
|
|
141
195
|
return (jsx(Dialog$1, { header: headerElement, modal: true, footer: footer,
|
|
142
196
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
143
|
-
onHide: typeof buttons === 'number' ? () => handleClose(DialogResult.Cancelled) : () => { }, visible: visible, style: { width, ...style }, contentStyle: contentStyle, resizable: resizable, closable: typeof buttons === 'number', className: className, pt: pt, ptOptions: ptOptions, unstyled: unstyled, children: children }));
|
|
197
|
+
onHide: typeof buttons === 'number' ? () => handleClose(DialogResult.Cancelled) : () => { }, onShow: handleShow, visible: visible, style: { width, ...style }, contentStyle: contentStyle, resizable: resizable, closable: typeof buttons === 'number', className: className, pt: pt, ptOptions: ptOptions, unstyled: unstyled, children: children }));
|
|
144
198
|
};
|
|
145
199
|
|
|
146
200
|
export { Dialog };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.js","sources":["../../../Dialogs/Dialog.tsx"],"sourcesContent":[null],"names":["_jsx","
|
|
1
|
+
{"version":3,"file":"Dialog.js","sources":["../../../Dialogs/Dialog.tsx"],"sourcesContent":[null],"names":["_jsx","_Fragment","_jsxs","PrimeDialog"],"mappings":";;;;;;;AAwJA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqGG;AACI,MAAM,MAAM,GAAG,CAAC,EACnB,KAAK,EACL,OAAO,GAAG,IAAI,EACd,OAAO,EACP,SAAS,EACT,QAAQ,EACR,OAAO,GAAG,aAAa,CAAC,QAAQ,EAChC,YAAY,GAAG,kBAAkB,CAAC,OAAO,EACzC,QAAQ,EACR,KAAK,GAAG,OAAO,EACf,KAAK,EACL,YAAY,EACZ,SAAS,GAAG,KAAK,EACjB,OAAO,EACP,MAAM,GAAG,KAAK,EACd,OAAO,GAAG,IAAI,EACd,WAAW,GAAG,QAAQ,EACtB,QAAQ,GAAG,KAAK,EAChB,OAAO,GAAG,IAAI,EACd,SAAS,EACT,EAAE,EACF,SAAS,EACT,QAAQ,EACE,KAAI;;;;AAId,IAAA,IAAI,kBAAgE;AACpE,IAAA,IAAI;AACA,QAAA,MAAM,OAAO,GAAG,gBAAgB,EAAE;AACl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AAK,EAAE,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAC1B,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,OAAO,OAAO,KAAK,QAAQ,EACrC,SAAS,EAAE,SAAS,EACpB,EAAE,EAAE,EAAE,EACN,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAAA,QAAA,EACjB,QAAQ,EAAA,CACC;AAEtB;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogInitialFocus.d.ts","sourceRoot":"","sources":["../../../Dialogs/DialogInitialFocus.ts"],"names":[],"mappings":"AAYA,oBAAY,kBAAkB;IAY1B,OAAO,IAAI;IAYX,MAAM,IAAI;IAWV,OAAO,IAAI;CACd"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
/**
|
|
4
|
+
* Defines where keyboard focus lands when a dialog becomes visible.
|
|
5
|
+
*
|
|
6
|
+
* A modal must move focus into itself when it opens — leaving focus on
|
|
7
|
+
* `document.body` strands keyboard and screen-reader users outside the
|
|
8
|
+
* content they were just interrupted with. Every member of this enum
|
|
9
|
+
* therefore names a real element inside the dialog; there is deliberately
|
|
10
|
+
* no "focus nothing" member.
|
|
11
|
+
*/
|
|
12
|
+
var DialogInitialFocus;
|
|
13
|
+
(function (DialogInitialFocus) {
|
|
14
|
+
/**
|
|
15
|
+
* Focus the confirming button (`Ok` / `Yes`). This is the default and
|
|
16
|
+
* the fastest path for a dialog whose expected answer is "go ahead".
|
|
17
|
+
*
|
|
18
|
+
* ⚠️ It also *arms* that button: a browser fires `click` on a native
|
|
19
|
+
* button from the `keydown` of `Enter` or `Space`, so a held key or a
|
|
20
|
+
* second press of the key that opened the dialog confirms it. For a
|
|
21
|
+
* destructive action that needs no input to become valid, prefer
|
|
22
|
+
* {@link DialogInitialFocus.Cancel} or {@link DialogInitialFocus.Content}.
|
|
23
|
+
*/
|
|
24
|
+
DialogInitialFocus[DialogInitialFocus["Confirm"] = 1] = "Confirm";
|
|
25
|
+
/**
|
|
26
|
+
* Focus the dismissing button — `Cancel` when the button set has one,
|
|
27
|
+
* otherwise `No`. This is the least destructive action, which is what
|
|
28
|
+
* the WAI-ARIA authoring practices recommend focusing for a dialog that
|
|
29
|
+
* confirms something irreversible.
|
|
30
|
+
*
|
|
31
|
+
* Falls back to {@link DialogInitialFocus.Content} when the button set
|
|
32
|
+
* has no dismissing button (`DialogButtons.Ok`), when the footer is a
|
|
33
|
+
* custom `ReactNode`, or when there is no footer at all.
|
|
34
|
+
*/
|
|
35
|
+
DialogInitialFocus[DialogInitialFocus["Cancel"] = 2] = "Cancel";
|
|
36
|
+
/**
|
|
37
|
+
* Focus the dialog's own title instead of any button, so nothing is
|
|
38
|
+
* armed. Screen readers announce the dialog and its title, and the
|
|
39
|
+
* first `Tab` walks the content from the top.
|
|
40
|
+
*
|
|
41
|
+
* This is the right choice for a dialog that should be *read* before it
|
|
42
|
+
* is answered, and the only sensible choice for a dialog with no footer
|
|
43
|
+
* buttons at all.
|
|
44
|
+
*/
|
|
45
|
+
DialogInitialFocus[DialogInitialFocus["Content"] = 3] = "Content";
|
|
46
|
+
})(DialogInitialFocus || (DialogInitialFocus = {}));
|
|
47
|
+
|
|
48
|
+
export { DialogInitialFocus };
|
|
49
|
+
//# sourceMappingURL=DialogInitialFocus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DialogInitialFocus.js","sources":["../../../Dialogs/DialogInitialFocus.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AAEA;;;;;;;;AAQG;IACS;AAAZ,CAAA,UAAY,kBAAkB,EAAA;AAE1B;;;;;;;;;AASG;AACH,IAAA,kBAAA,CAAA,kBAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAW;AAEX;;;;;;;;;AASG;AACH,IAAA,kBAAA,CAAA,kBAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QAAU;AAEV;;;;;;;;AAQG;AACH,IAAA,kBAAA,CAAA,kBAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAW;AACf,CAAC,EApCW,kBAAkB,KAAlB,kBAAkB,GAAA,EAAA,CAAA,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../Dialogs/index.ts"],"names":[],"mappings":"AAGA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../Dialogs/index.ts"],"names":[],"mappings":"AAGA,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,sBAAsB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { BusyIndicatorDialog } from './BusyIndicatorDialog.js';
|
|
2
2
|
export { ConfirmationDialog } from './ConfirmationDialog.js';
|
|
3
3
|
export { Dialog } from './Dialog.js';
|
|
4
|
+
export { DialogInitialFocus } from './DialogInitialFocus.js';
|
|
4
5
|
|
|
5
6
|
// Copyright (c) Cratis. All rights reserved.
|
|
6
7
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../Dialogs/index.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../Dialogs/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAAA;AACA"}
|