@mintplayer/react-bootstrap 19.4.0 → 19.6.0
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/datatable/index.mjs +0 -1
- package/datatable/src/BsDatatable.d.ts +7 -7
- package/package.json +2 -2
- package/shell/index.mjs +25 -0
- package/shell/src/BsShell.d.ts +35 -0
- package/shell/src/index.d.ts +3 -0
package/datatable/index.mjs
CHANGED
|
@@ -13,7 +13,6 @@ const l = e({
|
|
|
13
13
|
onRowDblClick: "mp-datatable-row-dblclick",
|
|
14
14
|
onRowContextMenu: "mp-datatable-row-contextmenu",
|
|
15
15
|
onSelectionChange: "mp-datatable-selection-change",
|
|
16
|
-
onFetchRequest: "mp-datatable-fetch-request",
|
|
17
16
|
onRowExpand: "mp-datatable-row-expand",
|
|
18
17
|
onRowCollapse: "mp-datatable-row-collapse",
|
|
19
18
|
onExpandedIdsChange: "mp-datatable-expanded-ids-change"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventName } from '@lit/react';
|
|
2
|
-
import { MpDatatable, RowEventDetail, SortChangeEventDetail, SelectionChangeEventDetail,
|
|
2
|
+
import { MpDatatable, RowEventDetail, SortChangeEventDetail, SelectionChangeEventDetail, TreeRowExpandDetail, TreeExpandedIdsChangeDetail } from '@mintplayer/web-components/datatable';
|
|
3
3
|
/**
|
|
4
4
|
* React wrapper for `<mp-datatable>`. Side-effect-registers the WC via
|
|
5
5
|
* the import above. The `events` map surfaces each CustomEvent the WC
|
|
@@ -11,11 +11,12 @@ import { MpDatatable, RowEventDetail, SortChangeEventDetail, SelectionChangeEven
|
|
|
11
11
|
* properties (not attributes) so Sets/arrays/functions round-trip
|
|
12
12
|
* correctly.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* `
|
|
17
|
-
*
|
|
18
|
-
*
|
|
14
|
+
* Server paging: set the `fetch` prop to a callback returning
|
|
15
|
+
* `{ data, totalRecords }`. `createComponent` forwards it to the element's
|
|
16
|
+
* `fetch` property, and the web component owns the whole loop — initial page,
|
|
17
|
+
* on-demand windows, tree children, pagination, sort/perPage reloads. The
|
|
18
|
+
* consumer wires nothing else (no `totalRecords`, no event bridge). Selected
|
|
19
|
+
* row objects arrive on `onSelectionChange`'s `detail.selectedRows`.
|
|
19
20
|
*/
|
|
20
21
|
export declare const BsDatatable: import('@lit/react').ReactWebComponent<MpDatatable, {
|
|
21
22
|
onPageChange: EventName<CustomEvent<{
|
|
@@ -29,7 +30,6 @@ export declare const BsDatatable: import('@lit/react').ReactWebComponent<MpDatat
|
|
|
29
30
|
onRowDblClick: EventName<CustomEvent<RowEventDetail>>;
|
|
30
31
|
onRowContextMenu: EventName<CustomEvent<RowEventDetail>>;
|
|
31
32
|
onSelectionChange: EventName<CustomEvent<SelectionChangeEventDetail>>;
|
|
32
|
-
onFetchRequest: EventName<CustomEvent<TreeFetchRequestDetail>>;
|
|
33
33
|
onRowExpand: EventName<CustomEvent<TreeRowExpandDetail>>;
|
|
34
34
|
onRowCollapse: EventName<CustomEvent<TreeRowExpandDetail>>;
|
|
35
35
|
onExpandedIdsChange: EventName<CustomEvent<TreeExpandedIdsChangeDetail>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintplayer/react-bootstrap",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.6.0",
|
|
4
4
|
"description": "React 19 wrappers around @mintplayer/web-components. Each sub-entry maps one-to-one with a WC sub-entry and exposes typed React components via @lit/react's createComponent.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"react": "^19.0.0",
|
|
29
29
|
"react-dom": "^19.0.0",
|
|
30
30
|
"@lit/react": "^1.0.0",
|
|
31
|
-
"@mintplayer/web-components": "^
|
|
31
|
+
"@mintplayer/web-components": "^2.0.0"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"tslib": "^2.3.0"
|
package/shell/index.mjs
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import * as e from "react";
|
|
3
|
+
import { createComponent as l } from "@lit/react";
|
|
4
|
+
import { MpShell as m } from "@mintplayer/web-components/shell";
|
|
5
|
+
const s = l({
|
|
6
|
+
react: e,
|
|
7
|
+
tagName: "mp-shell",
|
|
8
|
+
elementClass: m,
|
|
9
|
+
events: {
|
|
10
|
+
onStatechange: "statechange"
|
|
11
|
+
}
|
|
12
|
+
}), h = e.forwardRef(function({ externalToggle: t, dismissOnNavigate: o, ...n }, r) {
|
|
13
|
+
return /* @__PURE__ */ a(
|
|
14
|
+
s,
|
|
15
|
+
{
|
|
16
|
+
ref: r,
|
|
17
|
+
...t ? { "external-toggle": "" } : {},
|
|
18
|
+
...o ? { "dismiss-on-navigate": "" } : {},
|
|
19
|
+
...n
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
});
|
|
23
|
+
export {
|
|
24
|
+
h as BsShell
|
|
25
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { MpShell, ShellState, ShellStateChangeEventDetail } from '@mintplayer/web-components/shell';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
/** Bootstrap breakpoint names accepted by `breakpoint`. */
|
|
4
|
+
export type ShellBreakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
5
|
+
export interface BsShellProps {
|
|
6
|
+
/** `auto` (default, responsive) | `show` (force open) | `hide` (force closed). */
|
|
7
|
+
state?: ShellState;
|
|
8
|
+
/** Breakpoint below which the sidebar starts collapsed. Default `md`. */
|
|
9
|
+
breakpoint?: ShellBreakpoint;
|
|
10
|
+
/** Expanded sidebar width (any CSS length), e.g. `"15rem"`. */
|
|
11
|
+
size?: string;
|
|
12
|
+
/** Hide the built-in hamburger and drive the toggle from a consumer-supplied control. */
|
|
13
|
+
externalToggle?: boolean;
|
|
14
|
+
/** Auto-close the overlay drawer when a sidebar link is clicked (narrow mode only). */
|
|
15
|
+
dismissOnNavigate?: boolean;
|
|
16
|
+
/** Fires when the sidebar toggle flips. */
|
|
17
|
+
onStatechange?: (event: CustomEvent<ShellStateChangeEventDetail>) => void;
|
|
18
|
+
className?: string;
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* React wrapper for `<mp-shell>` — the responsive sidebar layout shell.
|
|
23
|
+
* Side-effect-registers the WC on import.
|
|
24
|
+
*
|
|
25
|
+
* The layout is server-rendered as Declarative Shadow DOM (see
|
|
26
|
+
* `injectMpShellDsd` in `@mintplayer/web-components/shell/ssr`), so the sidebar
|
|
27
|
+
* and its hamburger toggle work with JavaScript disabled. Place the sidebar as
|
|
28
|
+
* a child with `slot="sidebar"`; any other children are the main content.
|
|
29
|
+
*
|
|
30
|
+
* <BsShell breakpoint="md">
|
|
31
|
+
* <nav slot="sidebar">…</nav>
|
|
32
|
+
* <main>…</main>
|
|
33
|
+
* </BsShell>
|
|
34
|
+
*/
|
|
35
|
+
export declare const BsShell: React.ForwardRefExoticComponent<BsShellProps & React.RefAttributes<MpShell>>;
|