@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.
- package/README.md +12 -11
- package/accordion/index.mjs +48 -46
- package/card/index.mjs +90 -76
- package/card/src/BsCard.d.ts +1 -1
- package/card/src/BsCardBody.d.ts +1 -1
- package/card/src/BsCardFooter.d.ts +1 -1
- package/card/src/BsCardLink.d.ts +1 -1
- package/card/src/BsCardSubtitle.d.ts +2 -2
- package/card/src/BsCardText.d.ts +1 -1
- package/card/src/BsCardTitle.d.ts +1 -1
- package/carousel/index.mjs +26 -25
- package/checkbox/index.mjs +1 -1
- package/chunks/BsCheckbox-BZkPJ13E.mjs +66 -0
- package/chunks/{BsDatatable.generated-DCwT6fdk.mjs → BsDatatable.generated-DqNW60JA.mjs} +54 -52
- package/chunks/{BsDatetimePicker.generated-B4WBEiCo.mjs → BsDatetimePicker.generated-CxaiRt79.mjs} +32 -31
- package/chunks/BsRadio-Bw_MhAOq.mjs +57 -0
- package/datatable/index.mjs +1 -1
- package/datepicker/index.mjs +28 -27
- package/datetime-picker/index.mjs +1 -1
- package/dropdown-menu/index.mjs +43 -38
- package/file-manager/index.mjs +21 -20
- package/input-group/index.mjs +17 -15
- package/machine/index.mjs +48 -39
- package/machine/src/index.d.ts +1 -0
- package/machine/src/mark-links.d.ts +8 -0
- package/nav/index.mjs +85 -0
- package/nav/src/generated/BsNav.generated.d.ts +15 -0
- package/nav/src/generated/BsNavItem.generated.d.ts +6 -0
- package/nav/src/generated/index.d.ts +2 -0
- package/nav/src/generated/nav-item.view.generated.d.ts +14 -0
- package/nav/src/generated/nav.view.generated.d.ts +14 -0
- package/nav/src/index.d.ts +1 -0
- package/nav/src/nav-item.react.d.ts +4 -0
- package/navbar/index.mjs +87 -77
- package/navbar/src/navbar-item.react.d.ts +4 -0
- package/otp-input/index.mjs +24 -23
- package/package.json +10 -2
- package/pagination/index.mjs +37 -27
- package/phone-input/index.mjs +26 -25
- package/query-builder/index.mjs +30 -28
- package/radio/index.mjs +1 -1
- package/radio-group/index.mjs +1 -1
- package/scheduler/index.mjs +42 -41
- package/select/index.mjs +27 -26
- package/signature-pad/index.mjs +23 -22
- package/spinner/index.mjs +50 -0
- package/spinner/src/generated/BsSpinner.generated.d.ts +11 -0
- package/spinner/src/generated/index.d.ts +1 -0
- package/spinner/src/generated/spinner.view.generated.d.ts +15 -0
- package/spinner/src/index.d.ts +1 -0
- package/tab-control/index.mjs +56 -54
- package/timepicker/index.mjs +42 -41
- package/toggle-button/index.mjs +1 -1
- package/typeahead/index.mjs +90 -87
- package/chunks/BsCheckbox-BWU2Hrhf.mjs +0 -57
- package/chunks/BsRadio-D1C6Aqjv.mjs +0 -48
package/typeahead/index.mjs
CHANGED
|
@@ -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 {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
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
|
|
10
|
-
let { provider:
|
|
11
|
-
onValueChange:
|
|
12
|
-
onSelect:
|
|
13
|
-
onSubmit:
|
|
14
|
-
onOpen:
|
|
15
|
-
onClose:
|
|
16
|
-
onLoadError:
|
|
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
|
-
|
|
19
|
-
onValueChange:
|
|
20
|
-
onSelect:
|
|
21
|
-
onSubmit:
|
|
22
|
-
onOpen:
|
|
23
|
-
onClose:
|
|
24
|
-
onLoadError:
|
|
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
|
|
27
|
-
id:
|
|
28
|
-
value:
|
|
29
|
-
onChange: (e) =>
|
|
30
|
-
onSelect: (e, t) =>
|
|
31
|
-
onSubmit: (e) =>
|
|
32
|
-
onOpen: () =>
|
|
33
|
-
onClose: () =>
|
|
34
|
-
onError: (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
|
-
|
|
37
|
-
|
|
38
|
-
}, [
|
|
39
|
-
|
|
40
|
-
}, [
|
|
41
|
-
|
|
42
|
-
}, [
|
|
43
|
-
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
]),
|
|
49
|
-
let e = { input:
|
|
50
|
-
|
|
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
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
]),
|
|
58
|
-
|
|
59
|
-
}, [
|
|
60
|
-
let
|
|
61
|
-
|
|
62
|
-
let [
|
|
63
|
-
|
|
64
|
-
let
|
|
65
|
-
name:
|
|
66
|
-
hydrated:
|
|
67
|
-
}), { value:
|
|
68
|
-
return /* @__PURE__ */
|
|
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(
|
|
73
|
+
...e(X.root),
|
|
71
74
|
children: [
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
ref:
|
|
75
|
+
/* @__PURE__ */ c("input", {
|
|
76
|
+
ref: K,
|
|
74
77
|
className: "form-control",
|
|
75
78
|
type: "text",
|
|
76
|
-
...
|
|
77
|
-
...
|
|
79
|
+
...Q,
|
|
80
|
+
...V,
|
|
78
81
|
role: "combobox",
|
|
79
|
-
value: String(
|
|
80
|
-
onChange: (e) =>
|
|
82
|
+
value: String(Z ?? ""),
|
|
83
|
+
onChange: (e) => W.setTerm(e.target.value),
|
|
81
84
|
onKeyDown: (e) => {
|
|
82
|
-
|
|
85
|
+
z?.(e), !e.defaultPrevented && W.keydown(e.key, e) && e.preventDefault();
|
|
83
86
|
},
|
|
84
87
|
onBlur: (e) => {
|
|
85
|
-
|
|
88
|
+
B?.(e), W.blur();
|
|
86
89
|
}
|
|
87
90
|
}),
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
-
ref:
|
|
91
|
+
/* @__PURE__ */ l("ul", {
|
|
92
|
+
ref: q,
|
|
90
93
|
className: "dropdown-menu",
|
|
91
|
-
...e(
|
|
92
|
-
children: [
|
|
94
|
+
...e(X.listbox),
|
|
95
|
+
children: [X.status && /* @__PURE__ */ c("li", {
|
|
93
96
|
className: "ta-status",
|
|
94
|
-
...e(
|
|
95
|
-
children:
|
|
96
|
-
}),
|
|
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(
|
|
101
|
+
...e(X.option(n)),
|
|
99
102
|
onMouseDown: (e) => e.preventDefault(),
|
|
100
|
-
onClick: () =>
|
|
101
|
-
children:
|
|
102
|
-
}, (
|
|
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__ */
|
|
107
|
+
/* @__PURE__ */ c("span", {
|
|
105
108
|
className: "visually-hidden",
|
|
106
|
-
...e(
|
|
107
|
-
children:
|
|
109
|
+
...e(X.live.attrs),
|
|
110
|
+
children: X.live.text
|
|
108
111
|
}),
|
|
109
|
-
|
|
112
|
+
X.error && /* @__PURE__ */ c("div", {
|
|
110
113
|
className: "ta-error",
|
|
111
|
-
...e(
|
|
112
|
-
children:
|
|
114
|
+
...e(X.error.attrs),
|
|
115
|
+
children: X.error.text
|
|
113
116
|
})
|
|
114
117
|
]
|
|
115
118
|
});
|
|
116
119
|
}
|
|
117
120
|
//#endregion
|
|
118
|
-
export {
|
|
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 };
|