@mintplayer/react-bootstrap 19.27.0 → 19.28.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/accordion/index.mjs +64 -35
- package/accordion/src/BsAccordion.d.ts +19 -19
- package/accordion/src/index.d.ts +1 -0
- package/calendar/index.mjs +107 -9
- package/calendar/src/generated/BsCalendar.generated.d.ts +24 -0
- package/calendar/src/generated/calendar.view.generated.d.ts +14 -0
- package/calendar/src/generated/index.d.ts +1 -0
- package/calendar/src/index.d.ts +2 -1
- package/card/index.mjs +69 -71
- package/card/src/BsCard.d.ts +15 -6
- package/card/src/BsCardBody.d.ts +1 -3
- package/card/src/BsCardFooter.d.ts +4 -5
- package/card/src/BsCardGroup.d.ts +1 -2
- package/card/src/BsCardHeader.d.ts +5 -9
- package/card/src/BsCardImg.d.ts +2 -3
- package/card/src/BsCardLink.d.ts +1 -3
- package/card/src/BsCardSubtitle.d.ts +2 -3
- package/card/src/BsCardText.d.ts +1 -3
- package/card/src/BsCardTitle.d.ts +1 -3
- package/carousel/index.mjs +150 -24
- package/carousel/src/carousel.react.d.ts +5 -0
- package/carousel/src/generated/BsCarousel.generated.d.ts +30 -0
- package/carousel/src/generated/BsCarouselItem.generated.d.ts +6 -0
- package/carousel/src/generated/carousel-item.view.generated.d.ts +14 -0
- package/carousel/src/generated/carousel.view.generated.d.ts +14 -0
- package/carousel/src/generated/index.d.ts +2 -0
- package/carousel/src/index.d.ts +2 -3
- package/charts/hierarchy/index.mjs +178 -15
- package/charts/hierarchy/src/generated/BsHierarchyChart.generated.d.ts +52 -0
- package/charts/hierarchy/src/generated/hierarchy-chart.view.generated.d.ts +14 -0
- package/charts/hierarchy/src/generated/index.d.ts +1 -0
- package/charts/hierarchy/src/index.d.ts +2 -2
- package/charts/sparkline/index.mjs +35 -8
- package/charts/sparkline/src/BsSparkline.d.ts +21 -3
- package/charts/trend/index.mjs +124 -13
- package/charts/trend/src/generated/BsTrendChart.generated.d.ts +28 -0
- package/charts/trend/src/generated/index.d.ts +1 -0
- package/charts/trend/src/generated/trend-chart.view.generated.d.ts +14 -0
- package/charts/trend/src/index.d.ts +2 -2
- package/checkbox/index.mjs +1 -12
- package/checkbox/src/BsCheckbox.d.ts +29 -9
- package/checkbox/src/index.d.ts +1 -0
- package/chunks/BsCheckbox-Bl9Ug6k4.mjs +57 -0
- package/chunks/BsDatatable.generated-JLTLAK_N.mjs +451 -0
- package/chunks/BsDatetimePicker.generated-DI3dZWLN.mjs +206 -0
- package/chunks/BsRadio-C4oy_AGR.mjs +48 -0
- package/chunks/BsSplitterPanel.generated-C0d-JT2N.mjs +87 -0
- package/chunks/BsTreeview.generated-AIvwYLE2.mjs +100 -0
- package/chunks/react-props-D_6lU2Wh.mjs +29 -0
- package/chunks/useMachine-CpK1VckL.mjs +12 -0
- package/code-snippet/index.mjs +118 -13
- package/code-snippet/src/generated/BsCodeSnippet.generated.d.ts +27 -0
- package/code-snippet/src/generated/code-snippet.view.generated.d.ts +14 -0
- package/code-snippet/src/generated/index.d.ts +1 -0
- package/code-snippet/src/index.d.ts +2 -1
- package/datatable/index.mjs +3 -35
- package/datatable/src/generated/BsDatatable.generated.d.ts +79 -0
- package/datatable/src/generated/datatable.view.generated.d.ts +32 -0
- package/datatable/src/generated/index.d.ts +1 -0
- package/datatable/src/index.d.ts +3 -1
- package/datepicker/index.mjs +148 -15
- package/datepicker/src/generated/BsDatepicker.generated.d.ts +35 -0
- package/datepicker/src/generated/datepicker.view.generated.d.ts +14 -0
- package/datepicker/src/generated/index.d.ts +1 -0
- package/datepicker/src/index.d.ts +3 -1
- package/datetime-picker/index.mjs +1 -16
- package/datetime-picker/src/generated/BsDatetimePicker.generated.d.ts +36 -0
- package/datetime-picker/src/generated/datetime-picker.view.generated.d.ts +14 -0
- package/datetime-picker/src/generated/index.d.ts +1 -0
- package/datetime-picker/src/index.d.ts +2 -1
- package/dock/index.mjs +171 -10
- package/dock/src/generated/BsDockManager.generated.d.ts +20 -0
- package/dock/src/generated/dock-manager.view.generated.d.ts +18 -0
- package/dock/src/generated/dock-node.view.generated.d.ts +13 -0
- package/dock/src/generated/index.d.ts +1 -0
- package/dock/src/index.d.ts +3 -1
- package/dropdown-menu/index.mjs +52 -38
- package/dropdown-menu/src/BsDropdownDivider.d.ts +1 -1
- package/dropdown-menu/src/BsDropdownHeader.d.ts +2 -2
- package/dropdown-menu/src/BsDropdownItem.d.ts +7 -10
- package/dropdown-menu/src/BsDropdownMenu.d.ts +15 -17
- package/dropdown-menu/src/index.d.ts +1 -1
- package/file-manager/index.mjs +238 -18
- package/file-manager/src/generated/BsFileManager.generated.d.ts +52 -0
- package/file-manager/src/generated/file-manager.view.generated.d.ts +14 -0
- package/file-manager/src/generated/index.d.ts +1 -0
- package/file-manager/src/index.d.ts +3 -1
- package/input-group/index.mjs +16 -9
- package/input-group/src/BsInputGroup.d.ts +15 -8
- package/machine/index.mjs +65 -1
- package/machine/src/content.d.ts +14 -0
- package/machine/src/core.d.ts +24 -0
- package/machine/src/index.d.ts +2 -0
- package/machine/src/react-props.d.ts +16 -2
- package/multi-range/index.mjs +73 -13
- package/multi-range/src/generated/BsMultiRange.generated.d.ts +28 -0
- package/multi-range/src/generated/index.d.ts +1 -0
- package/multi-range/src/generated/multi-range.view.generated.d.ts +14 -0
- package/multi-range/src/index.d.ts +2 -1
- package/navbar/index.mjs +204 -36
- package/navbar/src/generated/BsNavbar.generated.d.ts +24 -0
- package/navbar/src/generated/BsNavbarDropdown.generated.d.ts +11 -0
- package/navbar/src/generated/BsNavbarItem.generated.d.ts +9 -0
- package/navbar/src/generated/BsNavbarNav.generated.d.ts +8 -0
- package/navbar/src/generated/index.d.ts +4 -0
- package/navbar/src/generated/navbar-dropdown.view.generated.d.ts +17 -0
- package/navbar/src/generated/navbar-item.view.generated.d.ts +14 -0
- package/navbar/src/generated/navbar-nav.view.generated.d.ts +14 -0
- package/navbar/src/generated/navbar.view.generated.d.ts +18 -0
- package/navbar/src/index.d.ts +2 -9
- package/otp-input/index.mjs +83 -13
- package/otp-input/src/generated/BsOtpInput.generated.d.ts +28 -0
- package/otp-input/src/generated/index.d.ts +1 -0
- package/otp-input/src/generated/otp-input.view.generated.d.ts +14 -0
- package/otp-input/src/index.d.ts +2 -1
- package/package.json +7 -6
- package/pagination/index.mjs +43 -9
- package/pagination/src/BsPagination.d.ts +23 -9
- package/phone-input/index.mjs +124 -13
- package/phone-input/src/generated/BsPhoneInput.generated.d.ts +34 -0
- package/phone-input/src/generated/index.d.ts +1 -0
- package/phone-input/src/generated/phone-input.view.generated.d.ts +14 -0
- package/phone-input/src/index.d.ts +2 -1
- package/query-builder/index.mjs +365 -18
- package/query-builder/src/generated/BsQueryBuilder.generated.d.ts +42 -0
- package/query-builder/src/generated/index.d.ts +1 -0
- package/query-builder/src/generated/query-builder-item.view.generated.d.ts +18 -0
- package/query-builder/src/generated/query-builder.view.generated.d.ts +18 -0
- package/query-builder/src/index.d.ts +3 -1
- package/radio/index.mjs +1 -12
- package/radio/src/BsRadio.d.ts +37 -8
- package/radio-group/index.mjs +36 -9
- package/radio-group/src/BsRadioGroup.d.ts +19 -11
- package/ribbon/index.mjs +1048 -99
- package/ribbon/src/generated/BsQuickAccessToolbar.generated.d.ts +8 -0
- package/ribbon/src/generated/BsRibbon.generated.d.ts +30 -0
- package/ribbon/src/generated/BsRibbonButton.generated.d.ts +21 -0
- package/ribbon/src/generated/BsRibbonCheckBox.generated.d.ts +20 -0
- package/ribbon/src/generated/BsRibbonColorPicker.generated.d.ts +20 -0
- package/ribbon/src/generated/BsRibbonComboBox.generated.d.ts +21 -0
- package/ribbon/src/generated/BsRibbonContextualTabSet.generated.d.ts +10 -0
- package/ribbon/src/generated/BsRibbonDropdownButton.generated.d.ts +21 -0
- package/ribbon/src/generated/BsRibbonGallery.generated.d.ts +18 -0
- package/ribbon/src/generated/BsRibbonGalleryItem.generated.d.ts +16 -0
- package/ribbon/src/generated/BsRibbonGroup.generated.d.ts +19 -0
- package/ribbon/src/generated/BsRibbonGroupButton.generated.d.ts +21 -0
- package/ribbon/src/generated/BsRibbonMenuItem.generated.d.ts +19 -0
- package/ribbon/src/generated/BsRibbonMenuSeparator.generated.d.ts +6 -0
- package/ribbon/src/generated/BsRibbonSplitButton.generated.d.ts +25 -0
- package/ribbon/src/generated/BsRibbonTab.generated.d.ts +14 -0
- package/ribbon/src/generated/BsRibbonTemplateItem.generated.d.ts +8 -0
- package/ribbon/src/generated/BsRibbonToggleButton.generated.d.ts +22 -0
- package/ribbon/src/generated/index.d.ts +18 -0
- package/ribbon/src/generated/quick-access-toolbar.view.generated.d.ts +14 -0
- package/ribbon/src/generated/ribbon-button.view.generated.d.ts +16 -0
- package/ribbon/src/generated/ribbon-check-box.view.generated.d.ts +14 -0
- package/ribbon/src/generated/ribbon-color-picker.view.generated.d.ts +14 -0
- package/ribbon/src/generated/ribbon-combo-box.view.generated.d.ts +15 -0
- package/ribbon/src/generated/ribbon-contextual-tab-set.view.generated.d.ts +14 -0
- package/ribbon/src/generated/ribbon-dropdown-button.view.generated.d.ts +16 -0
- package/ribbon/src/generated/ribbon-gallery-item.view.generated.d.ts +16 -0
- package/ribbon/src/generated/ribbon-gallery.view.generated.d.ts +15 -0
- package/ribbon/src/generated/ribbon-group-button.view.generated.d.ts +15 -0
- package/ribbon/src/generated/ribbon-group.view.generated.d.ts +14 -0
- package/ribbon/src/generated/ribbon-menu-item.view.generated.d.ts +16 -0
- package/ribbon/src/generated/ribbon-menu-separator.view.generated.d.ts +14 -0
- package/ribbon/src/generated/ribbon-split-button.view.generated.d.ts +16 -0
- package/ribbon/src/generated/ribbon-tab.view.generated.d.ts +14 -0
- package/ribbon/src/generated/ribbon-template-item.view.generated.d.ts +14 -0
- package/ribbon/src/generated/ribbon-toggle-button.view.generated.d.ts +16 -0
- package/ribbon/src/generated/ribbon.view.generated.d.ts +16 -0
- package/ribbon/src/index.d.ts +3 -1
- package/scheduler/index.mjs +751 -23
- package/scheduler/src/generated/BsScheduler.generated.d.ts +55 -0
- package/scheduler/src/generated/index.d.ts +1 -0
- package/scheduler/src/generated/sched-editor.view.generated.d.ts +13 -0
- package/scheduler/src/generated/sched-month.view.generated.d.ts +13 -0
- package/scheduler/src/generated/sched-popover-event.view.generated.d.ts +13 -0
- package/scheduler/src/generated/sched-popover.view.generated.d.ts +13 -0
- package/scheduler/src/generated/sched-row-panel.view.generated.d.ts +13 -0
- package/scheduler/src/generated/sched-time-grid.view.generated.d.ts +13 -0
- package/scheduler/src/generated/sched-timeline.view.generated.d.ts +13 -0
- package/scheduler/src/generated/sched-year.view.generated.d.ts +13 -0
- package/scheduler/src/generated/scheduler.view.generated.d.ts +14 -0
- package/scheduler/src/index.d.ts +4 -1
- package/select/index.mjs +83 -10
- package/select/src/generated/BsSelect.generated.d.ts +29 -0
- package/select/src/generated/index.d.ts +1 -0
- package/select/src/generated/select.view.generated.d.ts +18 -0
- package/select/src/index.d.ts +2 -1
- package/shell/index.mjs +75 -16
- package/shell/src/BsShell.d.ts +30 -20
- package/shell/src/index.d.ts +2 -2
- package/signature-pad/index.mjs +81 -10
- package/signature-pad/src/generated/BsSignaturePad.generated.d.ts +25 -0
- package/signature-pad/src/generated/index.d.ts +1 -0
- package/signature-pad/src/generated/signature-pad.view.generated.d.ts +14 -0
- package/signature-pad/src/index.d.ts +2 -2
- package/splitter/index.mjs +1 -16
- package/splitter/src/generated/BsSplitter.generated.d.ts +21 -0
- package/splitter/src/generated/BsSplitterPanel.generated.d.ts +6 -0
- package/splitter/src/generated/index.d.ts +2 -0
- package/splitter/src/generated/splitter-panel.view.generated.d.ts +14 -0
- package/splitter/src/generated/splitter.view.generated.d.ts +14 -0
- package/splitter/src/index.d.ts +2 -1
- package/src/index.d.ts +4 -5
- package/tab-control/index.mjs +88 -13
- package/tab-control/src/BsTabControl.d.ts +40 -11
- package/theming/index.mjs +73 -29
- package/theming/src/generated/BsThemeToggle.generated.d.ts +14 -0
- package/theming/src/generated/index.d.ts +1 -0
- package/theming/src/generated/theme-toggle.view.generated.d.ts +14 -0
- package/theming/src/index.d.ts +2 -2
- package/theming/src/useBsTheme.d.ts +2 -2
- package/tile-manager/index.mjs +42 -41
- package/timeline/index.mjs +209 -80
- package/timeline/src/generated/BsTimeline.generated.d.ts +36 -0
- package/timeline/src/generated/BsTimelineItem.generated.d.ts +23 -0
- package/timeline/src/generated/index.d.ts +2 -0
- package/timeline/src/generated/timeline-item.view.generated.d.ts +19 -0
- package/timeline/src/generated/timeline.view.generated.d.ts +39 -0
- package/timeline/src/index.d.ts +3 -4
- package/timepicker/index.mjs +156 -15
- package/timepicker/src/generated/BsTimeList.generated.d.ts +20 -0
- package/timepicker/src/generated/BsTimepicker.generated.d.ts +31 -0
- package/timepicker/src/generated/index.d.ts +2 -0
- package/timepicker/src/generated/time-list.view.generated.d.ts +14 -0
- package/timepicker/src/generated/timepicker.view.generated.d.ts +14 -0
- package/timepicker/src/index.d.ts +2 -2
- package/toggle-button/index.mjs +9 -8
- package/toggle-button/src/BsToggleButton.d.ts +6 -8
- package/toggle-button/src/index.d.ts +1 -1
- package/tree-select/index.mjs +253 -17
- package/tree-select/src/generated/BsTreeSelect.generated.d.ts +46 -0
- package/tree-select/src/generated/index.d.ts +1 -0
- package/tree-select/src/generated/tree-select.view.generated.d.ts +31 -0
- package/tree-select/src/index.d.ts +3 -3
- package/treeview/index.mjs +1 -16
- package/treeview/src/generated/BsTreeview.generated.d.ts +36 -0
- package/treeview/src/generated/index.d.ts +1 -0
- package/treeview/src/generated/treeview.view.generated.d.ts +20 -0
- package/treeview/src/index.d.ts +2 -1
- package/typeahead/index.mjs +87 -76
- package/calendar/src/BsCalendar.d.ts +0 -8
- package/carousel/src/BsCarousel.d.ts +0 -25
- package/charts/hierarchy/src/BsHierarchyChart.d.ts +0 -13
- package/charts/trend/src/BsTrendChart.d.ts +0 -7
- package/chunks/react-props-iXE6Az5D.mjs +0 -27
- package/code-snippet/src/BsCodeSnippet.d.ts +0 -21
- package/datatable/src/BsDatatable.d.ts +0 -85
- package/datepicker/src/BsDatepicker.d.ts +0 -17
- package/datetime-picker/src/BsDatetimePicker.d.ts +0 -13
- package/dock/src/BsDockManager.d.ts +0 -17
- package/file-manager/src/BsFileManager.d.ts +0 -20
- package/multi-range/src/BsMultiRange.d.ts +0 -12
- package/navbar/src/BsNavbar.d.ts +0 -33
- package/navbar/src/BsNavbarBrand.d.ts +0 -17
- package/navbar/src/BsNavbarDropdown.d.ts +0 -23
- package/navbar/src/BsNavbarItem.d.ts +0 -21
- package/otp-input/src/BsOtpInput.d.ts +0 -11
- package/phone-input/src/BsPhoneInput.d.ts +0 -22
- package/query-builder/src/BsQueryBuilder.d.ts +0 -29
- package/react-bootstrap.css +0 -2
- package/ribbon/src/BsRibbon.d.ts +0 -82
- package/scheduler/src/BsScheduler.d.ts +0 -35
- package/select/src/BsSelect.d.ts +0 -15
- package/signature-pad/src/BsSignaturePad.d.ts +0 -11
- package/splitter/src/BsSplitter.d.ts +0 -18
- package/theming/src/BsThemeToggle.d.ts +0 -22
- package/timeline/src/BsTimeline.d.ts +0 -33
- package/timeline/src/BsTimelineItem.d.ts +0 -11
- package/timepicker/src/BsTimeList.d.ts +0 -11
- package/timepicker/src/BsTimepicker.d.ts +0 -11
- package/tree-select/src/BsTreeSelect.d.ts +0 -24
- package/treeview/src/BsTreeview.d.ts +0 -14
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { r as e } from "./react-props-D_6lU2Wh.mjs";
|
|
2
|
+
import { createContext as t, forwardRef as n, useContext as r, useId as i, useState as a } from "react";
|
|
3
|
+
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
4
|
+
import { connectRadio as l, radioClasses as u } from "@mintplayer/ui-core/radio";
|
|
5
|
+
//#region libs/mintplayer-react-bootstrap/radio/src/BsRadio.tsx
|
|
6
|
+
var d = t(null), f = n(function(t, n) {
|
|
7
|
+
let { type: f = "radio", color: p = "secondary", value: m, checked: h, defaultChecked: g, name: _, disabled: v, required: y, invalid: b = !1, errorText: x, onCheckedChange: S, onChange: C, className: w, children: T, id: E, "aria-describedby": D, ...O } = t, k = r(d), A = `bs-radio-${i().replace(/[^a-zA-Z0-9_-]/g, "")}`, [j, M] = a(!!g), N = (k && k.value !== void 0 ? k.value !== null && k.value === m : void 0) ?? h ?? (k ? void 0 : j), P = {
|
|
8
|
+
type: f,
|
|
9
|
+
checked: !!N,
|
|
10
|
+
disabled: !!v || !!k?.disabled,
|
|
11
|
+
required: !!y || !!k?.required,
|
|
12
|
+
invalid: b,
|
|
13
|
+
name: k?.name ?? _ ?? null,
|
|
14
|
+
value: m ?? null,
|
|
15
|
+
errorText: x ?? null
|
|
16
|
+
}, F = l(P, A, D), I = u(f, p, b), L = E ?? String(F.input.id), R = N === void 0 ? { defaultChecked: k?.defaultValue != null && k.defaultValue === m } : { checked: N }, z = /* @__PURE__ */ s("input", {
|
|
17
|
+
ref: n,
|
|
18
|
+
className: [I.input, w].filter(Boolean).join(" "),
|
|
19
|
+
...e(F.input),
|
|
20
|
+
...O,
|
|
21
|
+
id: L,
|
|
22
|
+
type: "radio",
|
|
23
|
+
...R,
|
|
24
|
+
onChange: (e) => {
|
|
25
|
+
C?.(e), k && m !== void 0 && k.select(m), !k && h === void 0 && M(e.target.checked), S?.(e.target.checked);
|
|
26
|
+
}
|
|
27
|
+
}), B = F.feedback && /* @__PURE__ */ s("div", {
|
|
28
|
+
...e(F.feedback.attrs),
|
|
29
|
+
children: F.feedback.text
|
|
30
|
+
});
|
|
31
|
+
return I.root === null ? /* @__PURE__ */ c(o, { children: [
|
|
32
|
+
z,
|
|
33
|
+
/* @__PURE__ */ s("label", {
|
|
34
|
+
className: I.label,
|
|
35
|
+
htmlFor: L,
|
|
36
|
+
children: T
|
|
37
|
+
}),
|
|
38
|
+
B
|
|
39
|
+
] }) : /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ c("label", {
|
|
40
|
+
className: I.root,
|
|
41
|
+
children: [z, /* @__PURE__ */ s("span", {
|
|
42
|
+
className: I.label,
|
|
43
|
+
children: T
|
|
44
|
+
})]
|
|
45
|
+
}), B] });
|
|
46
|
+
});
|
|
47
|
+
//#endregion
|
|
48
|
+
export { d as n, f as t };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { r as e } from "./react-props-D_6lU2Wh.mjs";
|
|
2
|
+
import { useCore as t } from "../machine/index.mjs";
|
|
3
|
+
import { forwardRef as n, useImperativeHandle as r, useRef as i } from "react";
|
|
4
|
+
import { installLightStyles as a } from "@mintplayer/ui-core/scoped-styles";
|
|
5
|
+
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
6
|
+
import { splitterCore as l, splitterPanelCore as u, splitterScopedStyles as d } from "@mintplayer/ui-core/splitter";
|
|
7
|
+
//#region libs/mintplayer-react-bootstrap/splitter/src/generated/splitter.view.generated.tsx
|
|
8
|
+
function f({ view: t, slots: n = {}, children: r, className: i, attrs: a, rootRef: c }) {
|
|
9
|
+
return /* @__PURE__ */ s(o, { children: /* @__PURE__ */ s("div", {
|
|
10
|
+
"data-mps": "splitter",
|
|
11
|
+
...e(t.root),
|
|
12
|
+
ref: c,
|
|
13
|
+
...a,
|
|
14
|
+
role: t.root.role ?? a?.role,
|
|
15
|
+
className: [t.root.class, i].filter(Boolean).join(" ") || void 0,
|
|
16
|
+
children: r ?? null
|
|
17
|
+
}) });
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region libs/mintplayer-react-bootstrap/splitter/src/generated/BsSplitter.generated.tsx
|
|
21
|
+
var p = n(function({ orientation: e = "horizontal", minPanelSize: n = 50, touchMode: o = !1, labels: c = null, onResizeStart: u, onResizing: p, onResizeEnd: m, className: h, children: g, ..._ }, v) {
|
|
22
|
+
a("splitter", d);
|
|
23
|
+
let y = i(null);
|
|
24
|
+
r(v, () => y.current);
|
|
25
|
+
let b = t(l, {
|
|
26
|
+
orientation: e,
|
|
27
|
+
minPanelSize: n,
|
|
28
|
+
touchMode: o,
|
|
29
|
+
labels: c
|
|
30
|
+
}, {
|
|
31
|
+
idPrefix: "bs-splitter",
|
|
32
|
+
label: _["aria-label"],
|
|
33
|
+
rootRef: y,
|
|
34
|
+
emit: (e, t) => {
|
|
35
|
+
e === "resizeStart" && u?.(t), e === "resizing" && p?.(t), e === "resizeEnd" && m?.(t);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
return /* @__PURE__ */ s(f, {
|
|
39
|
+
...b.props,
|
|
40
|
+
className: h,
|
|
41
|
+
attrs: _,
|
|
42
|
+
rootRef: y,
|
|
43
|
+
children: g
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region libs/mintplayer-react-bootstrap/splitter/src/generated/splitter-panel.view.generated.tsx
|
|
48
|
+
function m({ view: t, slots: n = {}, children: r, className: i, attrs: a, rootRef: l }) {
|
|
49
|
+
return /* @__PURE__ */ s(o, { children: /* @__PURE__ */ c("div", {
|
|
50
|
+
"data-mps": "splitter",
|
|
51
|
+
...e(t.root),
|
|
52
|
+
ref: l,
|
|
53
|
+
...a,
|
|
54
|
+
role: t.root.role ?? a?.role,
|
|
55
|
+
className: [t.root.class, i].filter(Boolean).join(" ") || void 0,
|
|
56
|
+
children: [/* @__PURE__ */ s("div", {
|
|
57
|
+
"data-mps": "splitter",
|
|
58
|
+
...e(t.divider)
|
|
59
|
+
}), /* @__PURE__ */ s("div", {
|
|
60
|
+
"data-mps": "splitter",
|
|
61
|
+
...e(t.pane),
|
|
62
|
+
children: r ?? null
|
|
63
|
+
})]
|
|
64
|
+
}) });
|
|
65
|
+
}
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region libs/mintplayer-react-bootstrap/splitter/src/generated/BsSplitterPanel.generated.tsx
|
|
68
|
+
var h = n(function({ className: e, children: n, ...o }, c) {
|
|
69
|
+
a("splitter", d);
|
|
70
|
+
let l = i(null);
|
|
71
|
+
r(c, () => l.current);
|
|
72
|
+
let f = t(u, {}, {
|
|
73
|
+
idPrefix: "bs-splitter-panel",
|
|
74
|
+
label: o["aria-label"],
|
|
75
|
+
rootRef: l,
|
|
76
|
+
emit: () => void 0
|
|
77
|
+
});
|
|
78
|
+
return /* @__PURE__ */ s(m, {
|
|
79
|
+
...f.props,
|
|
80
|
+
className: e,
|
|
81
|
+
attrs: o,
|
|
82
|
+
rootRef: l,
|
|
83
|
+
children: n
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
//#endregion
|
|
87
|
+
export { p as n, h as t };
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { i as e, r as t } from "./react-props-D_6lU2Wh.mjs";
|
|
2
|
+
import { useCore as n } from "../machine/index.mjs";
|
|
3
|
+
import * as r from "react";
|
|
4
|
+
import { forwardRef as i, useImperativeHandle as a, useRef as o } from "react";
|
|
5
|
+
import { installLightStyles as s } from "@mintplayer/ui-core/scoped-styles";
|
|
6
|
+
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
7
|
+
import { treeviewCore as d, treeviewScopedStyles as f } from "@mintplayer/ui-core/treeview";
|
|
8
|
+
//#region libs/mintplayer-react-bootstrap/treeview/src/generated/treeview.view.generated.tsx
|
|
9
|
+
function p(e, t) {
|
|
10
|
+
return typeof e == "function" ? e(t) : e;
|
|
11
|
+
}
|
|
12
|
+
function m({ view: n, slots: i = {}, children: a, className: o, attrs: s, rootRef: d }) {
|
|
13
|
+
return /* @__PURE__ */ l(c, { children: /* @__PURE__ */ u("div", {
|
|
14
|
+
"data-mps": "treeview",
|
|
15
|
+
...t(n.root),
|
|
16
|
+
ref: d,
|
|
17
|
+
className: [n.root.class, o].filter(Boolean).join(" ") || void 0,
|
|
18
|
+
children: [/* @__PURE__ */ l("ul", {
|
|
19
|
+
"data-mps": "treeview",
|
|
20
|
+
...t(n.tree),
|
|
21
|
+
...s,
|
|
22
|
+
role: n.tree.role ?? s?.role,
|
|
23
|
+
children: n.rows.map((a, o) => /* @__PURE__ */ l(r.Fragment, { children: /* @__PURE__ */ u("li", {
|
|
24
|
+
"data-mps": "treeview",
|
|
25
|
+
...t(a.item),
|
|
26
|
+
style: e(a.style),
|
|
27
|
+
children: [
|
|
28
|
+
a.error ? /* @__PURE__ */ l(c, { children: /* @__PURE__ */ l("span", {
|
|
29
|
+
"data-mps": "treeview",
|
|
30
|
+
...t(a.errorBag),
|
|
31
|
+
children: a.error
|
|
32
|
+
}) }) : null,
|
|
33
|
+
/* @__PURE__ */ l("span", {
|
|
34
|
+
"data-mps": "treeview",
|
|
35
|
+
...t(a.chevron),
|
|
36
|
+
children: a.loading ? /* @__PURE__ */ l(c, { children: /* @__PURE__ */ l("span", {
|
|
37
|
+
"data-mps": "treeview",
|
|
38
|
+
...t(n.spinner)
|
|
39
|
+
}) }) : null
|
|
40
|
+
}),
|
|
41
|
+
/* @__PURE__ */ l("span", {
|
|
42
|
+
"data-mps": "treeview",
|
|
43
|
+
...t(n.body),
|
|
44
|
+
children: i.node === void 0 ? /* @__PURE__ */ u(c, { children: [a.icon ? /* @__PURE__ */ l(c, { children: /* @__PURE__ */ l("span", {
|
|
45
|
+
"data-mps": "treeview",
|
|
46
|
+
...t(n.icon),
|
|
47
|
+
dangerouslySetInnerHTML: { __html: a.icon }
|
|
48
|
+
}) }) : null, /* @__PURE__ */ l("span", {
|
|
49
|
+
"data-mps": "treeview",
|
|
50
|
+
...t(n.label),
|
|
51
|
+
children: a.node.label
|
|
52
|
+
})] }) : p(i.node, {
|
|
53
|
+
node: a.node,
|
|
54
|
+
ctx: a.ctx
|
|
55
|
+
})
|
|
56
|
+
})
|
|
57
|
+
]
|
|
58
|
+
}) }, a.key))
|
|
59
|
+
}), /* @__PURE__ */ l("div", {
|
|
60
|
+
"data-mps": "treeview",
|
|
61
|
+
...t(n.live),
|
|
62
|
+
children: n.announcement
|
|
63
|
+
})]
|
|
64
|
+
}) });
|
|
65
|
+
}
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region libs/mintplayer-react-bootstrap/treeview/src/generated/BsTreeview.generated.tsx
|
|
68
|
+
var h = [], g = [], _ = [], v = i(function({ items: e = h, expandedIds: t = g, selectedIds: r = _, selectionMode: i = "single", hideBorders: c = !1, iconResolver: u, loadChildren: p, inputLabel: v = null, labels: y, onNodeSelect: b, onNodeExpand: x, onNodeCollapse: S, onNodeLoadError: C, onSelectedIdsChange: w, onExpandedIdsChange: T, node: E, className: D, children: O, ...k }, A) {
|
|
69
|
+
s("treeview", f);
|
|
70
|
+
let j = o(null);
|
|
71
|
+
a(A, () => j.current);
|
|
72
|
+
let M = n(d, {
|
|
73
|
+
items: e,
|
|
74
|
+
expandedIds: t,
|
|
75
|
+
selectedIds: r,
|
|
76
|
+
selectionMode: i,
|
|
77
|
+
hideBorders: c,
|
|
78
|
+
iconResolver: u,
|
|
79
|
+
loadChildren: p,
|
|
80
|
+
inputLabel: v,
|
|
81
|
+
labels: y
|
|
82
|
+
}, {
|
|
83
|
+
idPrefix: "bs-treeview",
|
|
84
|
+
label: k["aria-label"],
|
|
85
|
+
rootRef: j,
|
|
86
|
+
emit: (e, t) => {
|
|
87
|
+
e === "nodeSelect" && b?.(t), e === "nodeExpand" && x?.(t), e === "nodeCollapse" && S?.(t), e === "nodeLoadError" && C?.(t), e === "selectedIdsChange" && w?.(t), e === "expandedIdsChange" && T?.(t);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
return /* @__PURE__ */ l(m, {
|
|
91
|
+
...M.props,
|
|
92
|
+
slots: { node: E },
|
|
93
|
+
className: D,
|
|
94
|
+
attrs: k,
|
|
95
|
+
rootRef: j,
|
|
96
|
+
children: O
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
//#endregion
|
|
100
|
+
export { v as t };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region libs/mintplayer-react-bootstrap/machine/src/react-props.ts
|
|
2
|
+
var e = {
|
|
3
|
+
autocomplete: "autoComplete",
|
|
4
|
+
class: "className",
|
|
5
|
+
for: "htmlFor",
|
|
6
|
+
popovertarget: "popoverTarget",
|
|
7
|
+
popovertargetaction: "popoverTargetAction",
|
|
8
|
+
tabindex: "tabIndex",
|
|
9
|
+
readonly: "readOnly"
|
|
10
|
+
};
|
|
11
|
+
function t(t) {
|
|
12
|
+
return Object.fromEntries(Object.entries(t).filter((e) => e[1] !== null).map(([t, n]) => [e[t] ?? t, n === !0 && t.includes("-") ? "" : n]));
|
|
13
|
+
}
|
|
14
|
+
var n = {
|
|
15
|
+
checked: "defaultChecked",
|
|
16
|
+
value: "defaultValue"
|
|
17
|
+
};
|
|
18
|
+
function r(e) {
|
|
19
|
+
return Object.fromEntries(Object.entries(t(e)).map(([e, t]) => [n[e] ?? e, t]));
|
|
20
|
+
}
|
|
21
|
+
function i(e) {
|
|
22
|
+
let { selected: n, ...r } = e;
|
|
23
|
+
return t(r);
|
|
24
|
+
}
|
|
25
|
+
function a(e) {
|
|
26
|
+
return Object.fromEntries(Object.entries(e).filter((e) => e[1] !== null).map(([e, t]) => [e.startsWith("--") ? e : e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()), t]));
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { a as i, i as n, t as r, r as t };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useCallback as e, useEffect as t, useState as n, useSyncExternalStore as r } from "react";
|
|
2
|
+
//#region libs/mintplayer-react-bootstrap/machine/src/useMachine.ts
|
|
3
|
+
function i(t) {
|
|
4
|
+
let n = e((e) => t.subscribe(e), [t]), i = e(() => t.snapshot, [t]);
|
|
5
|
+
return r(n, i, i);
|
|
6
|
+
}
|
|
7
|
+
function a(e) {
|
|
8
|
+
let [r] = n(e);
|
|
9
|
+
return t(() => () => r.destroy(), [r]), [r, i(r)];
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { i as n, a as t };
|
package/code-snippet/index.mjs
CHANGED
|
@@ -1,15 +1,120 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { r as e } from "../chunks/react-props-D_6lU2Wh.mjs";
|
|
2
|
+
import { useCore as t } from "../machine/index.mjs";
|
|
3
|
+
import * as n from "react";
|
|
4
|
+
import { forwardRef as r, useImperativeHandle as i, useRef as a } from "react";
|
|
5
|
+
import { installLightStyles as o } from "@mintplayer/ui-core/scoped-styles";
|
|
6
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
7
|
+
import { CODE_SNIPPET_LABELS as u, canHighlight as d, codeSnippetCore as f, codeSnippetScopedStyles as p, registerLanguage as m } from "@mintplayer/ui-core/code-snippet";
|
|
8
|
+
//#region libs/mintplayer-react-bootstrap/code-snippet/src/generated/code-snippet.view.generated.tsx
|
|
9
|
+
function h({ view: t, slots: r = {}, children: i, className: a, attrs: o, rootRef: u }) {
|
|
10
|
+
return /* @__PURE__ */ c(s, { children: /* @__PURE__ */ l("div", {
|
|
11
|
+
"data-mps": "code-snippet",
|
|
12
|
+
...e(t.root),
|
|
13
|
+
ref: u,
|
|
14
|
+
...o,
|
|
15
|
+
role: t.root.role ?? o?.role,
|
|
16
|
+
className: [t.root.class, a].filter(Boolean).join(" ") || void 0,
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ c("button", {
|
|
19
|
+
"data-mps": "code-snippet",
|
|
20
|
+
...e(t.copy),
|
|
21
|
+
children: t.copyText
|
|
22
|
+
}),
|
|
23
|
+
/* @__PURE__ */ c("pre", {
|
|
24
|
+
"data-mps": "code-snippet",
|
|
25
|
+
...e(t.pre),
|
|
26
|
+
children: /* @__PURE__ */ c("code", {
|
|
27
|
+
"data-mps": "code-snippet",
|
|
28
|
+
...e(t.code),
|
|
29
|
+
children: t.rows.map((t, r) => /* @__PURE__ */ c(n.Fragment, { children: /* @__PURE__ */ l("span", {
|
|
30
|
+
"data-mps": "code-snippet",
|
|
31
|
+
...e(t.row),
|
|
32
|
+
children: [
|
|
33
|
+
t.link ? /* @__PURE__ */ c(s, { children: /* @__PURE__ */ c("a", {
|
|
34
|
+
"data-mps": "code-snippet",
|
|
35
|
+
...e(t.link),
|
|
36
|
+
href: t.href,
|
|
37
|
+
children: t.number
|
|
38
|
+
}) }) : t.gutter ? /* @__PURE__ */ c(s, { children: /* @__PURE__ */ c("span", {
|
|
39
|
+
"data-mps": "code-snippet",
|
|
40
|
+
...e(t.gutter),
|
|
41
|
+
children: t.number
|
|
42
|
+
}) }) : null,
|
|
43
|
+
t.mark ? /* @__PURE__ */ c(s, { children: /* @__PURE__ */ c("span", {
|
|
44
|
+
"data-mps": "code-snippet",
|
|
45
|
+
...e(t.mark),
|
|
46
|
+
children: t.markText
|
|
47
|
+
}) }) : null,
|
|
48
|
+
t.secondary ? /* @__PURE__ */ c(s, { children: /* @__PURE__ */ c("span", {
|
|
49
|
+
"data-mps": "code-snippet",
|
|
50
|
+
...e(t.secondary),
|
|
51
|
+
children: t.secondaryText
|
|
52
|
+
}) }) : null,
|
|
53
|
+
/* @__PURE__ */ c("span", {
|
|
54
|
+
"data-mps": "code-snippet",
|
|
55
|
+
...e(t.text),
|
|
56
|
+
dangerouslySetInnerHTML: { __html: t.html }
|
|
57
|
+
}),
|
|
58
|
+
t.description ? /* @__PURE__ */ c(s, { children: /* @__PURE__ */ c("span", {
|
|
59
|
+
"data-mps": "code-snippet",
|
|
60
|
+
...e(t.description),
|
|
61
|
+
children: t.descriptionText
|
|
62
|
+
}) }) : null
|
|
63
|
+
]
|
|
64
|
+
}) }, t.number))
|
|
65
|
+
})
|
|
66
|
+
}),
|
|
67
|
+
t.keymap ? /* @__PURE__ */ c(s, { children: /* @__PURE__ */ c("div", {
|
|
68
|
+
"data-mps": "code-snippet",
|
|
69
|
+
...e(t.keymap),
|
|
70
|
+
children: t.keymapText
|
|
71
|
+
}) }) : null,
|
|
72
|
+
/* @__PURE__ */ c("div", {
|
|
73
|
+
"data-mps": "code-snippet",
|
|
74
|
+
...e(t.toast),
|
|
75
|
+
children: t.toastText
|
|
76
|
+
}),
|
|
77
|
+
/* @__PURE__ */ c("div", {
|
|
78
|
+
"data-mps": "code-snippet",
|
|
79
|
+
...e(t.live),
|
|
80
|
+
children: t.liveText
|
|
81
|
+
})
|
|
82
|
+
]
|
|
83
|
+
}) });
|
|
84
|
+
}
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region libs/mintplayer-react-bootstrap/code-snippet/src/generated/BsCodeSnippet.generated.tsx
|
|
87
|
+
var g = r(function({ code: e = "", language: n = "", theme: r = "auto", wrap: s = !1, lineNumbers: l = !1, startLine: u = 1, annotations: d = null, activeLine: m = null, lineHref: g = null, label: _ = "", labels: v = null, onLanguageDetected: y, onLineActivate: b, className: x, children: S, ...C }, w) {
|
|
88
|
+
o("code-snippet", p);
|
|
89
|
+
let T = a(null);
|
|
90
|
+
i(w, () => T.current);
|
|
91
|
+
let E = t(f, {
|
|
92
|
+
code: e,
|
|
93
|
+
language: n,
|
|
94
|
+
theme: r,
|
|
95
|
+
wrap: s,
|
|
96
|
+
lineNumbers: l,
|
|
97
|
+
startLine: u,
|
|
98
|
+
annotations: d,
|
|
99
|
+
activeLine: m,
|
|
100
|
+
lineHref: g,
|
|
101
|
+
label: _,
|
|
102
|
+
labels: v
|
|
103
|
+
}, {
|
|
104
|
+
idPrefix: "bs-code-snippet",
|
|
105
|
+
label: C["aria-label"],
|
|
106
|
+
rootRef: T,
|
|
107
|
+
emit: (e, t) => {
|
|
108
|
+
e === "languageDetected" && y?.(t), e === "lineActivate" && b?.(t);
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
return /* @__PURE__ */ c(h, {
|
|
112
|
+
...E.props,
|
|
113
|
+
className: x,
|
|
114
|
+
attrs: C,
|
|
115
|
+
rootRef: T,
|
|
116
|
+
children: S
|
|
117
|
+
});
|
|
13
118
|
});
|
|
14
119
|
//#endregion
|
|
15
|
-
export {
|
|
120
|
+
export { g as BsCodeSnippet, u as CODE_SNIPPET_LABELS, d as canHighlight, m as registerLanguage };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CodeLineActivation, CodeSnippetInputs } from '@mintplayer/ui-core/code-snippet';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export interface BsCodeSnippetProps extends Omit<React.HTMLAttributes<HTMLElementTagNameMap['div']>, 'code' | 'language' | 'theme' | 'wrap' | 'lineNumbers' | 'startLine' | 'annotations' | 'activeLine' | 'lineHref' | 'label' | 'labels' | 'onLanguageDetected' | 'onLineActivate'> {
|
|
4
|
+
code?: CodeSnippetInputs['code'];
|
|
5
|
+
language?: CodeSnippetInputs['language'];
|
|
6
|
+
theme?: CodeSnippetInputs['theme'];
|
|
7
|
+
wrap?: CodeSnippetInputs['wrap'];
|
|
8
|
+
lineNumbers?: CodeSnippetInputs['lineNumbers'];
|
|
9
|
+
startLine?: CodeSnippetInputs['startLine'];
|
|
10
|
+
annotations?: CodeSnippetInputs['annotations'];
|
|
11
|
+
activeLine?: CodeSnippetInputs['activeLine'];
|
|
12
|
+
lineHref?: CodeSnippetInputs['lineHref'];
|
|
13
|
+
label?: CodeSnippetInputs['label'];
|
|
14
|
+
labels?: CodeSnippetInputs['labels'];
|
|
15
|
+
/** The resolved grammar changed (`code` when the source stays plain). */
|
|
16
|
+
onLanguageDetected?: (detail: string) => void;
|
|
17
|
+
/** A line link was clicked; call `preventDefault()` on it to navigate yourself. */
|
|
18
|
+
onLineActivate?: (detail: CodeLineActivation) => void;
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A code listing with lazy syntax highlighting, a copy button, optional line numbers and per-line annotations.
|
|
23
|
+
*
|
|
24
|
+
* The server renders the escaped source, so it reads with JavaScript off; highlighting follows hydration
|
|
25
|
+
* and the copy button is disabled until then. Annotation kinds are classes (`annotation-<kind>`) on the row.
|
|
26
|
+
*/
|
|
27
|
+
export declare const BsCodeSnippet: React.ForwardRefExoticComponent<BsCodeSnippetProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CodeSnippetView } from '@mintplayer/ui-core/code-snippet';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export type CodeSnippetTemplateProps = {
|
|
4
|
+
view: CodeSnippetView;
|
|
5
|
+
} & {
|
|
6
|
+
slots?: {};
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
/** Merged onto the root element after the bag. */
|
|
9
|
+
className?: string;
|
|
10
|
+
/** The consumer's remaining attributes, spread onto the root element. */
|
|
11
|
+
attrs?: Record<string, unknown>;
|
|
12
|
+
rootRef?: React.Ref<HTMLElementTagNameMap['div']>;
|
|
13
|
+
};
|
|
14
|
+
export declare function CodeSnippetTemplate({ view, slots, children, className, attrs, rootRef }: CodeSnippetTemplateProps): React.ReactElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BsCodeSnippet, type BsCodeSnippetProps } from './BsCodeSnippet.generated';
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './generated';
|
|
2
|
+
export { CODE_SNIPPET_LABELS, canHighlight, registerLanguage, type CodeLineActivation, type CodeLineAnnotation, type CodeSnippetLabels, type CodeSnippetTheme, } from '@mintplayer/ui-core/code-snippet';
|
package/datatable/index.mjs
CHANGED
|
@@ -1,35 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { MpDatatable as r } from "@mintplayer/web-components/datatable";
|
|
5
|
-
//#region libs/mintplayer-react-bootstrap/datatable/src/BsDatatable.tsx
|
|
6
|
-
var i = t({
|
|
7
|
-
react: e,
|
|
8
|
-
tagName: "mp-datatable",
|
|
9
|
-
elementClass: r,
|
|
10
|
-
events: {
|
|
11
|
-
onPageChange: "mp-datatable-page-change",
|
|
12
|
-
onPerPageChange: "mp-datatable-per-page-change",
|
|
13
|
-
onSortChange: "mp-datatable-sort-change",
|
|
14
|
-
onRowClick: "mp-datatable-row-click",
|
|
15
|
-
onRowDblClick: "mp-datatable-row-dblclick",
|
|
16
|
-
onRowContextMenu: "mp-datatable-row-contextmenu",
|
|
17
|
-
onSelectionChange: "mp-datatable-selection-change",
|
|
18
|
-
onRowExpand: "mp-datatable-row-expand",
|
|
19
|
-
onRowCollapse: "mp-datatable-row-collapse",
|
|
20
|
-
onExpandedIdsChange: "mp-datatable-expanded-ids-change",
|
|
21
|
-
onFilterOpen: "mp-datatable-filter-open",
|
|
22
|
-
onFilterClose: "mp-datatable-filter-close",
|
|
23
|
-
onFilterChange: "mp-datatable-filter-change"
|
|
24
|
-
}
|
|
25
|
-
}), a = e.forwardRef(function({ selectedRows: t, ...r }, a) {
|
|
26
|
-
let o = e.useRef(null);
|
|
27
|
-
return e.useImperativeHandle(a, () => o.current), e.useLayoutEffect(() => {
|
|
28
|
-
o.current && t !== void 0 && (o.current.selectedRows = t);
|
|
29
|
-
}, [t]), /* @__PURE__ */ n(i, {
|
|
30
|
-
ref: o,
|
|
31
|
-
...r
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
//#endregion
|
|
35
|
-
export { a as BsDatatable };
|
|
1
|
+
import { t as e } from "../chunks/BsDatatable.generated-JLTLAK_N.mjs";
|
|
2
|
+
import { DEFAULT_DATATABLE_LABELS as t, cellText as n, computeNextSort as r, sortRows as i } from "@mintplayer/ui-core/datatable";
|
|
3
|
+
export { e as BsDatatable, t as DEFAULT_DATATABLE_LABELS, n as cellText, r as computeNextSort, i as sortRows };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { DatatableInputs, DatatableLoadErrorDetail, FilterChangeDetail, RowEventDetail, SelectionChangeEventDetail, SortColumn, TreeRowExpandDetail } from '@mintplayer/ui-core/datatable';
|
|
2
|
+
import { DatatableTemplateProps } from './datatable.view.generated';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
export interface BsDatatableProps extends Omit<React.HTMLAttributes<HTMLElementTagNameMap['div']>, 'columns' | 'data' | 'fetch' | 'caption' | 'labels' | 'inputLabel' | 'sortColumns' | 'page' | 'perPage' | 'perPageOptions' | 'pagination' | 'autoSort' | 'selectionMode' | 'selectedIds' | 'cutIds' | 'focusedRowKey' | 'rowLabel' | 'rowKey' | 'tree' | 'idKey' | 'childCountKey' | 'treeIndent' | 'expandedIds' | 'selectionStrategy' | 'loading' | 'emptyMessage' | 'virtualScroll' | 'itemSize' | 'virtualBuffer' | 'fill' | 'resizableColumns' | 'hrefFor' | 'distincts' | 'onSortColumnsChange' | 'onPageChange' | 'onPerPageChange' | 'onSelectedIdsChange' | 'onExpandedIdsChange' | 'onRowClick' | 'onRowDblClick' | 'onRowContextMenu' | 'onSelectionChanged' | 'onRowExpand' | 'onRowCollapse' | 'onLoadError' | 'onFilterChange' | 'header' | 'cell' | 'row' | 'filter'> {
|
|
5
|
+
columns?: DatatableInputs['columns'];
|
|
6
|
+
data?: DatatableInputs['data'];
|
|
7
|
+
fetch?: DatatableInputs['fetch'];
|
|
8
|
+
caption?: DatatableInputs['caption'];
|
|
9
|
+
labels?: DatatableInputs['labels'];
|
|
10
|
+
inputLabel?: DatatableInputs['inputLabel'];
|
|
11
|
+
sortColumns?: DatatableInputs['sortColumns'];
|
|
12
|
+
page?: DatatableInputs['page'];
|
|
13
|
+
perPage?: DatatableInputs['perPage'];
|
|
14
|
+
perPageOptions?: DatatableInputs['perPageOptions'];
|
|
15
|
+
pagination?: DatatableInputs['pagination'];
|
|
16
|
+
autoSort?: DatatableInputs['autoSort'];
|
|
17
|
+
selectionMode?: DatatableInputs['selectionMode'];
|
|
18
|
+
selectedIds?: DatatableInputs['selectedIds'];
|
|
19
|
+
cutIds?: DatatableInputs['cutIds'];
|
|
20
|
+
focusedRowKey?: DatatableInputs['focusedRowKey'];
|
|
21
|
+
rowLabel?: DatatableInputs['rowLabel'];
|
|
22
|
+
rowKey?: DatatableInputs['rowKey'];
|
|
23
|
+
tree?: DatatableInputs['tree'];
|
|
24
|
+
idKey?: DatatableInputs['idKey'];
|
|
25
|
+
childCountKey?: DatatableInputs['childCountKey'];
|
|
26
|
+
treeIndent?: DatatableInputs['treeIndent'];
|
|
27
|
+
expandedIds?: DatatableInputs['expandedIds'];
|
|
28
|
+
selectionStrategy?: DatatableInputs['selectionStrategy'];
|
|
29
|
+
loading?: DatatableInputs['loading'];
|
|
30
|
+
emptyMessage?: DatatableInputs['emptyMessage'];
|
|
31
|
+
virtualScroll?: DatatableInputs['virtualScroll'];
|
|
32
|
+
itemSize?: DatatableInputs['itemSize'];
|
|
33
|
+
virtualBuffer?: DatatableInputs['virtualBuffer'];
|
|
34
|
+
fill?: DatatableInputs['fill'];
|
|
35
|
+
resizableColumns?: DatatableInputs['resizableColumns'];
|
|
36
|
+
hrefFor?: DatatableInputs['hrefFor'];
|
|
37
|
+
distincts?: DatatableInputs['distincts'];
|
|
38
|
+
/** The sort, after the user changed it. */
|
|
39
|
+
onSortColumnsChange?: (detail: SortColumn[]) => void;
|
|
40
|
+
/** The page, after the user changed it. */
|
|
41
|
+
onPageChange?: (detail: number) => void;
|
|
42
|
+
/** The page size, after the user changed it. */
|
|
43
|
+
onPerPageChange?: (detail: number) => void;
|
|
44
|
+
/** The selected row keys, after the user changed them. */
|
|
45
|
+
onSelectedIdsChange?: (detail: string[]) => void;
|
|
46
|
+
/** The expanded row ids, after the user changed them. */
|
|
47
|
+
onExpandedIdsChange?: (detail: unknown[]) => void;
|
|
48
|
+
/** A row was clicked, or opened with Enter. */
|
|
49
|
+
onRowClick?: (detail: RowEventDetail) => void;
|
|
50
|
+
/** A row was double-clicked. */
|
|
51
|
+
onRowDblClick?: (detail: RowEventDetail) => void;
|
|
52
|
+
/** A row's context menu; `originalEvent.preventDefault()` suppresses the browser's. */
|
|
53
|
+
onRowContextMenu?: (detail: RowEventDetail) => void;
|
|
54
|
+
/** The user changed the selection: the keys and their rows. */
|
|
55
|
+
onSelectionChanged?: (detail: SelectionChangeEventDetail) => void;
|
|
56
|
+
/** A tree row expanded. */
|
|
57
|
+
onRowExpand?: (detail: TreeRowExpandDetail) => void;
|
|
58
|
+
/** A tree row collapsed. */
|
|
59
|
+
onRowCollapse?: (detail: TreeRowExpandDetail) => void;
|
|
60
|
+
/** A `fetch` call rejected. */
|
|
61
|
+
onLoadError?: (detail: DatatableLoadErrorDetail) => void;
|
|
62
|
+
/** A column's filter changed; the consumer decides which rows it removes. */
|
|
63
|
+
onFilterChange?: (detail: FilterChangeDetail) => void;
|
|
64
|
+
header?: NonNullable<DatatableTemplateProps['slots']>['header'];
|
|
65
|
+
cell?: NonNullable<DatatableTemplateProps['slots']>['cell'];
|
|
66
|
+
row?: NonNullable<DatatableTemplateProps['slots']>['row'];
|
|
67
|
+
filter?: NonNullable<DatatableTemplateProps['slots']>['filter'];
|
|
68
|
+
children?: React.ReactNode;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* A sortable, pageable, selectable table (#437), over local `data` or a server `fetch`;
|
|
72
|
+
* virtual scrolling, a lazy tree (`tree` + `idKey` + `childCountKey`) and resizable columns.
|
|
73
|
+
*
|
|
74
|
+
* Columns are data (`DatatableColumnDef`). Slots: `header {column}` (a header label),
|
|
75
|
+
* `cell {row, column, rowIndex}` (one cell) and `row {row, rowIndex, ctx}` (all of a
|
|
76
|
+
* row's data cells) and `filter {column, ctx}` (the panel of a column with `filterMode: 'custom'`). Two-way: `sortColumns`, `page`, `perPage`, `selectedIds`, `expandedIds`.
|
|
77
|
+
* An `aria-label` names the table.
|
|
78
|
+
*/
|
|
79
|
+
export declare const BsDatatable: React.ForwardRefExoticComponent<BsDatatableProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { DatatableColumnDef, DatatableView, FilterContext, RowRenderContext } from '@mintplayer/ui-core/datatable';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export type DatatableTemplateProps = {
|
|
4
|
+
view: DatatableView;
|
|
5
|
+
} & {
|
|
6
|
+
slots?: {
|
|
7
|
+
header?: React.ReactNode | ((args: {
|
|
8
|
+
column: DatatableColumnDef;
|
|
9
|
+
}) => React.ReactNode);
|
|
10
|
+
cell?: React.ReactNode | ((args: {
|
|
11
|
+
row: unknown;
|
|
12
|
+
column: DatatableColumnDef;
|
|
13
|
+
rowIndex: number;
|
|
14
|
+
}) => React.ReactNode);
|
|
15
|
+
row?: React.ReactNode | ((args: {
|
|
16
|
+
row: unknown;
|
|
17
|
+
rowIndex: number;
|
|
18
|
+
ctx: RowRenderContext;
|
|
19
|
+
}) => React.ReactNode);
|
|
20
|
+
filter?: React.ReactNode | ((args: {
|
|
21
|
+
column: DatatableColumnDef;
|
|
22
|
+
ctx: FilterContext;
|
|
23
|
+
}) => React.ReactNode);
|
|
24
|
+
};
|
|
25
|
+
children?: React.ReactNode;
|
|
26
|
+
/** Merged onto the root element after the bag. */
|
|
27
|
+
className?: string;
|
|
28
|
+
/** The consumer's remaining attributes, spread onto the root element. */
|
|
29
|
+
attrs?: Record<string, unknown>;
|
|
30
|
+
rootRef?: React.Ref<HTMLElementTagNameMap['div']>;
|
|
31
|
+
};
|
|
32
|
+
export declare function DatatableTemplate({ view, slots, children, className, attrs, rootRef }: DatatableTemplateProps): React.ReactElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BsDatatable, type BsDatatableProps } from './BsDatatable.generated';
|
package/datatable/src/index.d.ts
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './generated';
|
|
2
|
+
export { DEFAULT_DATATABLE_LABELS, cellText, computeNextSort, sortRows } from '@mintplayer/ui-core/datatable';
|
|
3
|
+
export type { ComparisonFilterChangeDetail, DatatableColumnDef, DatatableDistincts, DatatableFetch, DatatableFetchRequest, DatatableFetchResponse, DatatableHrefFor, DatatableHrefState, DatatableLabels, DatatableLoadErrorDetail, DatatableReloadOptions, DatatableSelectionMode, DistinctValue, DistinctValues, DistinctsRequest, FilterChangeDetail, FilterContext, FilterInputType, FilterMode, FilterOperator, FilterSelection, RowEventDetail, RowKey, RowRenderContext, SelectionChangeEventDetail, SortColumn, SortDirection, TreeIdKey, TreeRowExpandDetail, TreeSelectionStrategy, ValuesFilterChangeDetail, } from '@mintplayer/ui-core/datatable';
|