@mintplayer/react-bootstrap 19.30.0 → 19.31.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.
Files changed (56) hide show
  1. package/README.md +12 -11
  2. package/accordion/index.mjs +48 -46
  3. package/card/index.mjs +90 -76
  4. package/card/src/BsCard.d.ts +1 -1
  5. package/card/src/BsCardBody.d.ts +1 -1
  6. package/card/src/BsCardFooter.d.ts +1 -1
  7. package/card/src/BsCardLink.d.ts +1 -1
  8. package/card/src/BsCardSubtitle.d.ts +2 -2
  9. package/card/src/BsCardText.d.ts +1 -1
  10. package/card/src/BsCardTitle.d.ts +1 -1
  11. package/carousel/index.mjs +26 -25
  12. package/checkbox/index.mjs +1 -1
  13. package/chunks/BsCheckbox-BZkPJ13E.mjs +66 -0
  14. package/chunks/{BsDatatable.generated-DCwT6fdk.mjs → BsDatatable.generated-DqNW60JA.mjs} +54 -52
  15. package/chunks/{BsDatetimePicker.generated-B4WBEiCo.mjs → BsDatetimePicker.generated-CxaiRt79.mjs} +32 -31
  16. package/chunks/BsRadio-Bw_MhAOq.mjs +57 -0
  17. package/datatable/index.mjs +1 -1
  18. package/datepicker/index.mjs +28 -27
  19. package/datetime-picker/index.mjs +1 -1
  20. package/dropdown-menu/index.mjs +43 -38
  21. package/file-manager/index.mjs +21 -20
  22. package/input-group/index.mjs +17 -15
  23. package/machine/index.mjs +48 -39
  24. package/machine/src/index.d.ts +1 -0
  25. package/machine/src/mark-links.d.ts +8 -0
  26. package/nav/index.mjs +85 -0
  27. package/nav/src/generated/BsNav.generated.d.ts +15 -0
  28. package/nav/src/generated/BsNavItem.generated.d.ts +6 -0
  29. package/nav/src/generated/index.d.ts +2 -0
  30. package/nav/src/generated/nav-item.view.generated.d.ts +14 -0
  31. package/nav/src/generated/nav.view.generated.d.ts +14 -0
  32. package/nav/src/index.d.ts +1 -0
  33. package/nav/src/nav-item.react.d.ts +4 -0
  34. package/navbar/index.mjs +87 -77
  35. package/navbar/src/navbar-item.react.d.ts +4 -0
  36. package/otp-input/index.mjs +24 -23
  37. package/package.json +10 -2
  38. package/pagination/index.mjs +37 -27
  39. package/phone-input/index.mjs +26 -25
  40. package/query-builder/index.mjs +30 -28
  41. package/radio/index.mjs +1 -1
  42. package/radio-group/index.mjs +1 -1
  43. package/scheduler/index.mjs +42 -41
  44. package/select/index.mjs +27 -26
  45. package/signature-pad/index.mjs +23 -22
  46. package/spinner/index.mjs +50 -0
  47. package/spinner/src/generated/BsSpinner.generated.d.ts +11 -0
  48. package/spinner/src/generated/index.d.ts +1 -0
  49. package/spinner/src/generated/spinner.view.generated.d.ts +15 -0
  50. package/spinner/src/index.d.ts +1 -0
  51. package/tab-control/index.mjs +56 -54
  52. package/timepicker/index.mjs +42 -41
  53. package/toggle-button/index.mjs +1 -1
  54. package/typeahead/index.mjs +90 -87
  55. package/chunks/BsCheckbox-BWU2Hrhf.mjs +0 -57
  56. package/chunks/BsRadio-D1C6Aqjv.mjs +0 -48
@@ -1,118 +1,121 @@
1
1
  import { r as e } from "../chunks/react-props-C2O2_2V2.mjs";
2
2
  import { t } from "../chunks/useMachine-CpK1VckL.mjs";
3
- import { useEffect as n, useId as r, useRef as i, useState as a } from "react";
4
- import { installLightStyles as o } from "@mintplayer/ui-core/scoped-styles";
5
- import { jsx as s, jsxs as c } from "react/jsx-runtime";
6
- import { trackOpenSide as l } from "@mintplayer/ui-core/overlay";
7
- import { TYPEAHEAD_SCOPE as u, TypeaheadMachine as d, connect as f, inMemoryTypeaheadProvider as p, typeaheadScopedStyles as m } from "@mintplayer/ui-core/typeahead";
3
+ import { installBootstrap as n } from "@mintplayer/ui-core/bootstrap";
4
+ import { useEffect as r, useId as i, useRef as a, useState as o } from "react";
5
+ import { installLightStyles as s } from "@mintplayer/ui-core/scoped-styles";
6
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
7
+ import { bootstrapForms as u } from "@mintplayer/ui-core/bootstrap/forms";
8
+ import { bootstrapDropdown as d } from "@mintplayer/ui-core/bootstrap/dropdown";
9
+ import { trackOpenSide as f } from "@mintplayer/ui-core/overlay";
10
+ import { TYPEAHEAD_SCOPE as p, TypeaheadMachine as m, connect as h, inMemoryTypeaheadProvider as g, typeaheadScopedStyles as _ } from "@mintplayer/ui-core/typeahead";
8
11
  //#region libs/mintplayer-react-bootstrap/typeahead/src/BsTypeahead.tsx
9
- function h(p) {
10
- let { provider: h, debounceMs: g, minLength: _, itemText: v, itemKey: y, renderItem: b, value: x, defaultValue: S, onValueChange: C, onSelect: w, onSubmit: T, onOpen: E, onClose: D, onLoadError: O, inputLabel: k, loadingLabel: A, noResultsLabel: j, resultsLabel: M, errorText: N, disabled: P, name: F, onKeyDown: I, onBlur: L, ...R } = p, z = i({
11
- onValueChange: C,
12
- onSelect: w,
13
- onSubmit: T,
14
- onOpen: E,
15
- onClose: D,
16
- onLoadError: O
12
+ function v(g) {
13
+ let { provider: v, debounceMs: y, minLength: b, itemText: x, itemKey: S, renderItem: C, value: w, defaultValue: T, onValueChange: E, onSelect: D, onSubmit: O, onOpen: k, onClose: A, onLoadError: j, inputLabel: M, loadingLabel: N, noResultsLabel: P, resultsLabel: F, errorText: I, disabled: L, name: R, onKeyDown: z, onBlur: B, ...V } = g, H = a({
14
+ onValueChange: E,
15
+ onSelect: D,
16
+ onSubmit: O,
17
+ onOpen: k,
18
+ onClose: A,
19
+ onLoadError: j
17
20
  });
18
- z.current = {
19
- onValueChange: C,
20
- onSelect: w,
21
- onSubmit: T,
22
- onOpen: E,
23
- onClose: D,
24
- onLoadError: O
21
+ H.current = {
22
+ onValueChange: E,
23
+ onSelect: D,
24
+ onSubmit: O,
25
+ onOpen: k,
26
+ onClose: A,
27
+ onLoadError: j
25
28
  };
26
- let B = `bs-typeahead-${r().replace(/[^a-zA-Z0-9_-]/g, "")}`, [V, H] = t(() => new d({
27
- id: B,
28
- value: x ?? S ?? "",
29
- onChange: (e) => z.current.onValueChange?.(e),
30
- onSelect: (e, t) => z.current.onSelect?.(e, t),
31
- onSubmit: (e) => z.current.onSubmit?.(e),
32
- onOpen: () => z.current.onOpen?.(),
33
- onClose: () => z.current.onClose?.(),
34
- onError: (e) => z.current.onLoadError?.(e)
29
+ let U = `bs-typeahead-${i().replace(/[^a-zA-Z0-9_-]/g, "")}`, [W, G] = t(() => new m({
30
+ id: U,
31
+ value: w ?? T ?? "",
32
+ onChange: (e) => H.current.onValueChange?.(e),
33
+ onSelect: (e, t) => H.current.onSelect?.(e, t),
34
+ onSubmit: (e) => H.current.onSubmit?.(e),
35
+ onOpen: () => H.current.onOpen?.(),
36
+ onClose: () => H.current.onClose?.(),
37
+ onError: (e) => H.current.onLoadError?.(e)
35
38
  }));
36
- o(u, m), n(() => {
37
- V.provider = h ?? null;
38
- }, [V, h]), n(() => {
39
- V.debounceMs = g;
40
- }, [V, g]), n(() => {
41
- V.minLength = _;
42
- }, [V, _]), n(() => {
43
- V.itemText = v, V.itemKey = y;
39
+ n(u, d), s(p, _), r(() => {
40
+ W.provider = v ?? null;
41
+ }, [W, v]), r(() => {
42
+ W.debounceMs = y;
43
+ }, [W, y]), r(() => {
44
+ W.minLength = b;
45
+ }, [W, b]), r(() => {
46
+ W.itemText = x, W.itemKey = S;
44
47
  }, [
45
- V,
46
- v,
47
- y
48
- ]), n(() => V.setDisabled(!!P), [V, P]), n(() => V.setErrorText(N), [V, N]), n(() => {
49
- let e = { input: k ?? null };
50
- A !== void 0 && (e.loading = A), j !== void 0 && (e.noResults = j), M !== void 0 && (e.results = M), V.setLabels(e);
48
+ W,
49
+ x,
50
+ S
51
+ ]), r(() => W.setDisabled(!!L), [W, L]), r(() => W.setErrorText(I), [W, I]), r(() => {
52
+ let e = { input: M ?? null };
53
+ N !== void 0 && (e.loading = N), P !== void 0 && (e.noResults = P), F !== void 0 && (e.results = F), W.setLabels(e);
51
54
  }, [
52
- V,
53
- k,
54
- A,
55
- j,
56
- M
57
- ]), n(() => {
58
- x !== void 0 && x !== V.snapshot.term && V.setValue(x);
59
- }, [V, x]);
60
- let U = i(null), W = i(null);
61
- n(() => l(V, () => U.current, () => W.current), [V]);
62
- let [G, K] = a(!1);
63
- n(() => K(!0), []);
64
- let q = f(H, B, {
65
- name: F ?? null,
66
- hydrated: G
67
- }), { value: J, ...Y } = e(q.input);
68
- return /* @__PURE__ */ c("div", {
55
+ W,
56
+ M,
57
+ N,
58
+ P,
59
+ F
60
+ ]), r(() => {
61
+ w !== void 0 && w !== W.snapshot.term && W.setValue(w);
62
+ }, [W, w]);
63
+ let K = a(null), q = a(null);
64
+ r(() => f(W, () => K.current, () => q.current), [W]);
65
+ let [J, Y] = o(!1);
66
+ r(() => Y(!0), []);
67
+ let X = h(G, U, {
68
+ name: R ?? null,
69
+ hydrated: J
70
+ }), { value: Z, ...Q } = e(X.input);
71
+ return /* @__PURE__ */ l("div", {
69
72
  className: "mp-typeahead",
70
- ...e(q.root),
73
+ ...e(X.root),
71
74
  children: [
72
- /* @__PURE__ */ s("input", {
73
- ref: U,
75
+ /* @__PURE__ */ c("input", {
76
+ ref: K,
74
77
  className: "form-control",
75
78
  type: "text",
76
- ...Y,
77
- ...R,
79
+ ...Q,
80
+ ...V,
78
81
  role: "combobox",
79
- value: String(J ?? ""),
80
- onChange: (e) => V.setTerm(e.target.value),
82
+ value: String(Z ?? ""),
83
+ onChange: (e) => W.setTerm(e.target.value),
81
84
  onKeyDown: (e) => {
82
- I?.(e), !e.defaultPrevented && V.keydown(e.key, e) && e.preventDefault();
85
+ z?.(e), !e.defaultPrevented && W.keydown(e.key, e) && e.preventDefault();
83
86
  },
84
87
  onBlur: (e) => {
85
- L?.(e), V.blur();
88
+ B?.(e), W.blur();
86
89
  }
87
90
  }),
88
- /* @__PURE__ */ c("ul", {
89
- ref: W,
91
+ /* @__PURE__ */ l("ul", {
92
+ ref: q,
90
93
  className: "dropdown-menu",
91
- ...e(q.listbox),
92
- children: [q.status && /* @__PURE__ */ s("li", {
94
+ ...e(X.listbox),
95
+ children: [X.status && /* @__PURE__ */ c("li", {
93
96
  className: "ta-status",
94
- ...e(q.status.attrs),
95
- children: q.status.text
96
- }), H.items.map((t, n) => /* @__PURE__ */ s("li", {
97
+ ...e(X.status.attrs),
98
+ children: X.status.text
99
+ }), G.items.map((t, n) => /* @__PURE__ */ c("li", {
97
100
  className: "dropdown-item",
98
- ...e(q.option(n)),
101
+ ...e(X.option(n)),
99
102
  onMouseDown: (e) => e.preventDefault(),
100
- onClick: () => V.pick(n),
101
- children: b ? b(t, H.term) : V.itemTextOf(t)
102
- }, (y ? y(t) : V.itemTextOf(t)) || n))]
103
+ onClick: () => W.pick(n),
104
+ children: C ? C(t, G.term) : W.itemTextOf(t)
105
+ }, (S ? S(t) : W.itemTextOf(t)) || n))]
103
106
  }),
104
- /* @__PURE__ */ s("span", {
107
+ /* @__PURE__ */ c("span", {
105
108
  className: "visually-hidden",
106
- ...e(q.live.attrs),
107
- children: q.live.text
109
+ ...e(X.live.attrs),
110
+ children: X.live.text
108
111
  }),
109
- q.error && /* @__PURE__ */ s("div", {
112
+ X.error && /* @__PURE__ */ c("div", {
110
113
  className: "ta-error",
111
- ...e(q.error.attrs),
112
- children: q.error.text
114
+ ...e(X.error.attrs),
115
+ children: X.error.text
113
116
  })
114
117
  ]
115
118
  });
116
119
  }
117
120
  //#endregion
118
- export { h as BsTypeahead, p as inMemoryTypeaheadProvider };
121
+ export { v as BsTypeahead, g as inMemoryTypeaheadProvider };
@@ -1,57 +0,0 @@
1
- import { r as e } from "./react-props-C2O2_2V2.mjs";
2
- import { forwardRef as t, useEffect as n, useId as r, useImperativeHandle as i, useRef as a, useState as o } from "react";
3
- import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
4
- import { checkboxClasses as u, connectCheckbox as d, effectiveIndeterminate as f } from "@mintplayer/ui-core/checkbox";
5
- //#region libs/mintplayer-react-bootstrap/checkbox/src/BsCheckbox.tsx
6
- var p = t(function(t, p) {
7
- let { type: m = "checkbox", color: h = "primary", checked: g, defaultChecked: _, indeterminate: v = !1, value: y, name: b, disabled: x, required: S, invalid: C = !1, errorText: w, onCheckedChange: T, onChange: E, className: D, children: O, id: k, "aria-describedby": A, ...j } = t, M = `bs-checkbox-${r().replace(/[^a-zA-Z0-9_-]/g, "")}`, [N, P] = o(!!_), F = g ?? N, I = {
8
- type: m,
9
- checked: F,
10
- indeterminate: f({
11
- type: m,
12
- indeterminate: v
13
- }),
14
- disabled: !!x,
15
- required: !!S,
16
- invalid: C,
17
- name: b ?? null,
18
- value: y ?? null,
19
- errorText: w ?? null
20
- }, L = d(I, M, A), R = u(m, h, C), z = k ?? String(L.input.id), B = a(null);
21
- i(p, () => B.current), n(() => {
22
- B.current && (B.current.indeterminate = I.indeterminate);
23
- }, [I.indeterminate]);
24
- let V = /* @__PURE__ */ c("input", {
25
- ref: B,
26
- className: [R.input, D].filter(Boolean).join(" "),
27
- ...e(L.input),
28
- ...j,
29
- role: L.input.role === null ? j.role : String(L.input.role),
30
- id: z,
31
- type: "checkbox",
32
- checked: F,
33
- onChange: (e) => {
34
- E?.(e), g === void 0 && P(e.target.checked), T?.(e.target.checked);
35
- }
36
- }), H = L.feedback && /* @__PURE__ */ c("div", {
37
- ...e(L.feedback.attrs),
38
- children: L.feedback.text
39
- });
40
- return R.root === null ? /* @__PURE__ */ l(s, { children: [
41
- V,
42
- /* @__PURE__ */ c("label", {
43
- className: R.label,
44
- htmlFor: z,
45
- children: O
46
- }),
47
- H
48
- ] }) : /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ l("label", {
49
- className: R.root,
50
- children: [V, /* @__PURE__ */ c("span", {
51
- className: R.label,
52
- children: O
53
- })]
54
- }), H] });
55
- });
56
- //#endregion
57
- export { p as t };
@@ -1,48 +0,0 @@
1
- import { r as e } from "./react-props-C2O2_2V2.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 };