@mintplayer/react-bootstrap 19.29.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 (57) 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-am6uNreO.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/datatable/src/generated/BsDatatable.generated.d.ts +4 -2
  19. package/datepicker/index.mjs +28 -27
  20. package/datetime-picker/index.mjs +1 -1
  21. package/dropdown-menu/index.mjs +43 -38
  22. package/file-manager/index.mjs +21 -20
  23. package/input-group/index.mjs +17 -15
  24. package/machine/index.mjs +48 -39
  25. package/machine/src/index.d.ts +1 -0
  26. package/machine/src/mark-links.d.ts +8 -0
  27. package/nav/index.mjs +85 -0
  28. package/nav/src/generated/BsNav.generated.d.ts +15 -0
  29. package/nav/src/generated/BsNavItem.generated.d.ts +6 -0
  30. package/nav/src/generated/index.d.ts +2 -0
  31. package/nav/src/generated/nav-item.view.generated.d.ts +14 -0
  32. package/nav/src/generated/nav.view.generated.d.ts +14 -0
  33. package/nav/src/index.d.ts +1 -0
  34. package/nav/src/nav-item.react.d.ts +4 -0
  35. package/navbar/index.mjs +87 -77
  36. package/navbar/src/navbar-item.react.d.ts +4 -0
  37. package/otp-input/index.mjs +24 -23
  38. package/package.json +10 -2
  39. package/pagination/index.mjs +37 -27
  40. package/phone-input/index.mjs +26 -25
  41. package/query-builder/index.mjs +30 -28
  42. package/radio/index.mjs +1 -1
  43. package/radio-group/index.mjs +1 -1
  44. package/scheduler/index.mjs +42 -41
  45. package/select/index.mjs +27 -26
  46. package/signature-pad/index.mjs +23 -22
  47. package/spinner/index.mjs +50 -0
  48. package/spinner/src/generated/BsSpinner.generated.d.ts +11 -0
  49. package/spinner/src/generated/index.d.ts +1 -0
  50. package/spinner/src/generated/spinner.view.generated.d.ts +15 -0
  51. package/spinner/src/index.d.ts +1 -0
  52. package/tab-control/index.mjs +56 -54
  53. package/timepicker/index.mjs +42 -41
  54. package/toggle-button/index.mjs +1 -1
  55. package/typeahead/index.mjs +90 -87
  56. package/chunks/BsCheckbox-BWU2Hrhf.mjs +0 -57
  57. package/chunks/BsRadio-D1C6Aqjv.mjs +0 -48
@@ -1,20 +1,22 @@
1
1
  import { r as e } from "../chunks/react-props-C2O2_2V2.mjs";
2
- import * as t from "react";
3
- import { forwardRef as n, useEffect as r, useId as i, useImperativeHandle as a, useRef as o, useState as s } from "react";
4
- import { installLightStyles as c } from "@mintplayer/ui-core/scoped-styles";
5
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
6
- import { TAB_CONTROL_SCOPE as d, connectTabControl as f, resolveActiveTab as p, tabControlChanged as m, tabControlKeydown as h, tabControlScopedStyles as g, tabControlTabClick as _ } from "@mintplayer/ui-core/tab-control";
2
+ import { installBootstrap as t } from "@mintplayer/ui-core/bootstrap";
3
+ import * as n from "react";
4
+ import { forwardRef as r, useEffect as i, useId as a, useImperativeHandle as o, useRef as s, useState as c } from "react";
5
+ import { installLightStyles as l } from "@mintplayer/ui-core/scoped-styles";
6
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
7
+ import { bootstrapNav as f } from "@mintplayer/ui-core/bootstrap/nav";
8
+ import { TAB_CONTROL_SCOPE as p, connectTabControl as m, resolveActiveTab as h, tabControlChanged as g, tabControlKeydown as _, tabControlScopedStyles as v, tabControlTabClick as y } from "@mintplayer/ui-core/tab-control";
7
9
  //#region libs/mintplayer-react-bootstrap/tab-control/src/BsTabControl.tsx
8
- function v(e) {
10
+ function b(e) {
9
11
  return null;
10
12
  }
11
- var y = n(function({ activeTab: n, border: y, selectFirstTab: b = !0, tabsPosition: x, onTabActivate: S, className: C, children: w, ...T }, E) {
12
- c(d, g);
13
- let D = `bs-tab-control-${i().replace(/[^a-zA-Z0-9_-]/g, "")}`, O = o(null);
14
- a(E, () => O.current);
15
- let [k, A] = s(!1);
16
- r(() => A(!0), []);
17
- let j = t.Children.toArray(w).filter((e) => t.isValidElement(e) && e.type === v).map((e, t) => {
13
+ var x = r(function({ activeTab: r, border: x, selectFirstTab: S = !0, tabsPosition: C, onTabActivate: w, className: T, children: E, ...D }, O) {
14
+ t(f), l(p, v);
15
+ let k = `bs-tab-control-${a().replace(/[^a-zA-Z0-9_-]/g, "")}`, A = s(null);
16
+ o(O, () => A.current);
17
+ let [j, M] = c(!1);
18
+ i(() => M(!0), []);
19
+ let N = n.Children.toArray(E).filter((e) => n.isValidElement(e) && e.type === b).map((e, t) => {
18
20
  let { tabId: n, header: r, disabled: i, children: a, role: o, ...s } = e.props;
19
21
  return {
20
22
  key: n ?? String(t),
@@ -23,69 +25,69 @@ var y = n(function({ activeTab: n, border: y, selectFirstTab: b = !0, tabsPositi
23
25
  body: a,
24
26
  attrs: s
25
27
  };
26
- }), M = j.map((e) => ({ disabled: e.disabled })), [N, P] = s(null), F = n ?? N, I = F === null ? -1 : j.findIndex((e) => e.key === F), L = p(M, I < 0 ? null : I, b), R = (e) => {
27
- let t = j[e];
28
- t && !t.disabled && (P(t.key), S?.(t.key));
29
- }, z = f({
30
- id: D,
31
- tabsPosition: x,
32
- border: y,
33
- enhanced: k
34
- }, M, L), { class: B, ...V } = z.root, H = (e) => {
35
- let t = z.tabs[e].tab, n = j[e].attrs.id;
28
+ }), P = N.map((e) => ({ disabled: e.disabled })), [F, I] = c(null), L = r ?? F, R = L === null ? -1 : N.findIndex((e) => e.key === L), z = h(P, R < 0 ? null : R, S), B = (e) => {
29
+ let t = N[e];
30
+ t && !t.disabled && (I(t.key), w?.(t.key));
31
+ }, V = m({
32
+ id: k,
33
+ tabsPosition: C,
34
+ border: x,
35
+ enhanced: j
36
+ }, P, z), { class: H, ...U } = V.root, W = (e) => {
37
+ let t = V.tabs[e].tab, n = N[e].attrs.id;
36
38
  return n && t["aria-controls"] ? {
37
39
  ...t,
38
40
  "aria-controls": n
39
41
  } : t;
40
- }, U = (e) => {
41
- let { class: t, ...n } = z.tabs[e].pane;
42
+ }, G = (e) => {
43
+ let { class: t, ...n } = V.tabs[e].pane;
42
44
  return n;
43
- }, W = /* @__PURE__ */ l("div", {
44
- ...e(z.strip),
45
- children: /* @__PURE__ */ l("ul", {
46
- ...e(z.list),
47
- children: j.map((t, n) => /* @__PURE__ */ l("li", {
48
- ...e(z.item),
49
- children: /* @__PURE__ */ l("label", {
50
- ...e(H(n)),
51
- onClick: (e) => k && _(e.nativeEvent, !!t.disabled) && R(n),
45
+ }, K = /* @__PURE__ */ u("div", {
46
+ ...e(V.strip),
47
+ children: /* @__PURE__ */ u("ul", {
48
+ ...e(V.list),
49
+ children: N.map((t, n) => /* @__PURE__ */ u("li", {
50
+ ...e(V.item),
51
+ children: /* @__PURE__ */ u("label", {
52
+ ...e(W(n)),
53
+ onClick: (e) => j && y(e.nativeEvent, !!t.disabled) && B(n),
52
54
  onKeyDown: (e) => {
53
- let t = O.current && h(O.current, e.nativeEvent, n, M);
54
- t != null && R(t);
55
+ let t = A.current && _(A.current, e.nativeEvent, n, P);
56
+ t != null && B(t);
55
57
  },
56
58
  children: t.header
57
59
  })
58
60
  }, t.key))
59
61
  })
60
62
  });
61
- return /* @__PURE__ */ u("div", {
62
- ref: O,
63
- ...e(V),
64
- ...T,
65
- className: [String(B), C].filter(Boolean).join(" "),
63
+ return /* @__PURE__ */ d("div", {
64
+ ref: A,
65
+ ...e(U),
66
+ ...D,
67
+ className: [String(H), T].filter(Boolean).join(" "),
66
68
  onChange: (e) => {
67
- let t = O.current && m(O.current, e.nativeEvent);
68
- t != null && R(t);
69
+ let t = A.current && g(A.current, e.nativeEvent);
70
+ t != null && B(t);
69
71
  },
70
72
  children: [
71
- j.map((t, n) => /* @__PURE__ */ l("input", {
72
- ...e(z.tabs[n].radio),
73
- checked: n === L,
73
+ N.map((t, n) => /* @__PURE__ */ u("input", {
74
+ ...e(V.tabs[n].radio),
75
+ checked: n === z,
74
76
  onChange: () => void 0
75
77
  }, t.key)),
76
- x !== "bottom" && W,
77
- /* @__PURE__ */ l("div", {
78
- ...e(z.content),
79
- children: j.map((t, n) => /* @__PURE__ */ l("div", {
80
- ...e(U(n)),
78
+ C !== "bottom" && K,
79
+ /* @__PURE__ */ u("div", {
80
+ ...e(V.content),
81
+ children: N.map((t, n) => /* @__PURE__ */ u("div", {
82
+ ...e(G(n)),
81
83
  ...t.attrs,
82
- className: [String(z.tabs[n].pane.class), t.attrs.className].filter(Boolean).join(" "),
84
+ className: [String(V.tabs[n].pane.class), t.attrs.className].filter(Boolean).join(" "),
83
85
  children: t.body
84
86
  }, t.key))
85
87
  }),
86
- x === "bottom" && W
88
+ C === "bottom" && K
87
89
  ]
88
90
  });
89
91
  });
90
92
  //#endregion
91
- export { y as BsTabControl, v as BsTabPage };
93
+ export { x as BsTabControl, b as BsTabPage };
@@ -4,9 +4,10 @@ import * as r from "react";
4
4
  import { forwardRef as i, useImperativeHandle as a, useRef as o } from "react";
5
5
  import { installLightStyles as s } from "@mintplayer/ui-core/scoped-styles";
6
6
  import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
7
- import { timeListCore as d, timepickerCore as f, timepickerScopedStyles as p } from "@mintplayer/ui-core/timepicker";
7
+ import { bootstrapForms as d } from "@mintplayer/ui-core/bootstrap/forms";
8
+ import { timeListCore as f, timepickerCore as p, timepickerScopedStyles as m } from "@mintplayer/ui-core/timepicker";
8
9
  //#region libs/mintplayer-react-bootstrap/timepicker/src/generated/time-list.view.generated.tsx
9
- function m({ view: t, slots: n = {}, children: i, className: a, attrs: o, rootRef: s }) {
10
+ function h({ view: t, slots: n = {}, children: i, className: a, attrs: o, rootRef: s }) {
10
11
  return /* @__PURE__ */ l(c, { children: /* @__PURE__ */ l("div", {
11
12
  "data-mps": "timepicker",
12
13
  ...e(t.root),
@@ -31,37 +32,37 @@ function m({ view: t, slots: n = {}, children: i, className: a, attrs: o, rootRe
31
32
  }
32
33
  //#endregion
33
34
  //#region libs/mintplayer-react-bootstrap/timepicker/src/generated/BsTimeList.generated.tsx
34
- var h = i(function({ selectedTime: e = null, step: t = 15, minMinutes: r = null, maxMinutes: i = null, hour12: c = "auto", locale: u = null, labels: f = null, onSelectedTimeChange: h, className: g, children: _, ...v }, y) {
35
- s("timepicker", p);
36
- let b = o(null);
37
- a(y, () => b.current);
38
- let x = n(d, {
35
+ var g = i(function({ selectedTime: e = null, step: t = 15, minMinutes: r = null, maxMinutes: i = null, hour12: c = "auto", locale: u = null, labels: p = null, onSelectedTimeChange: g, className: _, children: v, ...y }, b) {
36
+ s(d.key, d.css, { order: d.order }), s("timepicker", m);
37
+ let x = o(null);
38
+ a(b, () => x.current);
39
+ let S = n(f, {
39
40
  selectedTime: e,
40
41
  step: t,
41
42
  minMinutes: r,
42
43
  maxMinutes: i,
43
44
  hour12: c,
44
45
  locale: u,
45
- labels: f
46
+ labels: p
46
47
  }, {
47
48
  idPrefix: "bs-time-list",
48
- label: v["aria-label"],
49
- rootRef: b,
49
+ label: y["aria-label"],
50
+ rootRef: x,
50
51
  emit: (e, t) => {
51
- e === "selectedTimeChange" && h?.(t);
52
+ e === "selectedTimeChange" && g?.(t);
52
53
  }
53
54
  });
54
- return /* @__PURE__ */ l(m, {
55
- ...x.props,
56
- className: g,
57
- attrs: v,
58
- rootRef: b,
59
- children: _
55
+ return /* @__PURE__ */ l(h, {
56
+ ...S.props,
57
+ className: _,
58
+ attrs: y,
59
+ rootRef: x,
60
+ children: v
60
61
  });
61
62
  });
62
63
  //#endregion
63
64
  //#region libs/mintplayer-react-bootstrap/timepicker/src/generated/timepicker.view.generated.tsx
64
- function g({ view: n, slots: i = {}, children: a, className: o, attrs: s, rootRef: d }) {
65
+ function _({ view: n, slots: i = {}, children: a, className: o, attrs: s, rootRef: d }) {
65
66
  return /* @__PURE__ */ l(c, { children: /* @__PURE__ */ u("div", {
66
67
  "data-mps": "timepicker",
67
68
  ...e(n.root),
@@ -119,40 +120,40 @@ function g({ view: n, slots: i = {}, children: a, className: o, attrs: s, rootRe
119
120
  }
120
121
  //#endregion
121
122
  //#region libs/mintplayer-react-bootstrap/timepicker/src/generated/BsTimepicker.generated.tsx
122
- var _ = i(function({ selectedTime: e = null, step: t = 15, min: r = null, max: i = null, hour12: c = "auto", locale: u = null, disabled: d = !1, placeholder: m = null, required: h = !1, invalid: _ = !1, errorText: v = null, inputLabel: y = null, name: b = null, labels: x = null, onSelectedTimeChange: S, onOpenChange: C, className: w, children: T, ...E }, D) {
123
- s("timepicker", p);
124
- let O = o(null);
125
- a(D, () => O.current);
126
- let k = n(f, {
123
+ var v = i(function({ selectedTime: e = null, step: t = 15, min: r = null, max: i = null, hour12: c = "auto", locale: u = null, disabled: f = !1, placeholder: h = null, required: g = !1, invalid: v = !1, errorText: y = null, inputLabel: b = null, name: x = null, labels: S = null, onSelectedTimeChange: C, onOpenChange: w, className: T, children: E, ...D }, O) {
124
+ s(d.key, d.css, { order: d.order }), s("timepicker", m);
125
+ let k = o(null);
126
+ a(O, () => k.current);
127
+ let A = n(p, {
127
128
  selectedTime: e,
128
129
  step: t,
129
130
  min: r,
130
131
  max: i,
131
132
  hour12: c,
132
133
  locale: u,
133
- disabled: d,
134
- placeholder: m,
135
- required: h,
136
- invalid: _,
137
- errorText: v,
138
- inputLabel: y,
139
- name: b,
140
- labels: x
134
+ disabled: f,
135
+ placeholder: h,
136
+ required: g,
137
+ invalid: v,
138
+ errorText: y,
139
+ inputLabel: b,
140
+ name: x,
141
+ labels: S
141
142
  }, {
142
143
  idPrefix: "bs-timepicker",
143
- label: E["aria-label"],
144
- rootRef: O,
144
+ label: D["aria-label"],
145
+ rootRef: k,
145
146
  emit: (e, t) => {
146
- e === "selectedTimeChange" && S?.(t), e === "openChange" && C?.(t);
147
+ e === "selectedTimeChange" && C?.(t), e === "openChange" && w?.(t);
147
148
  }
148
149
  });
149
- return /* @__PURE__ */ l(g, {
150
- ...k.props,
151
- className: w,
152
- attrs: E,
153
- rootRef: O,
154
- children: T
150
+ return /* @__PURE__ */ l(_, {
151
+ ...A.props,
152
+ className: T,
153
+ attrs: D,
154
+ rootRef: k,
155
+ children: E
155
156
  });
156
157
  });
157
158
  //#endregion
158
- export { h as BsTimeList, _ as BsTimepicker };
159
+ export { g as BsTimeList, v as BsTimepicker };
@@ -1,4 +1,4 @@
1
- import { t as e } from "../chunks/BsCheckbox-BWU2Hrhf.mjs";
1
+ import { t as e } from "../chunks/BsCheckbox-BZkPJ13E.mjs";
2
2
  import { forwardRef as t } from "react";
3
3
  import { jsx as n } from "react/jsx-runtime";
4
4
  //#region libs/mintplayer-react-bootstrap/toggle-button/src/BsToggleButton.tsx
@@ -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 };