@mintplayer/vue-bootstrap 3.25.0 → 3.27.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/chunks/useMachine-DLZ7g_H3.mjs +14 -0
- package/chunks/vue-props-NyhME1Ba.mjs +9 -0
- package/dropdown-menu/index.mjs +3 -9
- package/dropdown-menu/src/BsDropdownItem.vue.d.ts +1 -1
- package/dropdown-menu/src/BsDropdownMenu.vue.d.ts +2 -6
- package/dropdown-menu/src/index.d.ts +1 -1
- package/machine/index.mjs +3 -0
- package/machine/src/index.d.ts +2 -0
- package/machine/src/useMachine.d.ts +13 -0
- package/machine/src/useMachine.spec.d.ts +1 -0
- package/machine/src/vue-props.d.ts +13 -0
- package/package.json +11 -2
- package/tile-manager/index.mjs +180 -14
- package/tile-manager/src/BsTileManager.vue.d.ts +67 -22
- package/tile-manager/src/index.d.ts +3 -0
- package/tile-manager/src/types.d.ts +18 -0
- package/typeahead/index.mjs +119 -0
- package/typeahead/src/BsTypeahead.vue.d.ts +46 -0
- package/typeahead/src/index.d.ts +3 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { onScopeDispose as e, shallowRef as t } from "vue";
|
|
2
|
+
//#region libs/mintplayer-vue-bootstrap/machine/src/useMachine.ts
|
|
3
|
+
function n(n) {
|
|
4
|
+
let r = t(n.snapshot), i = n.subscribe((e) => {
|
|
5
|
+
r.value = e;
|
|
6
|
+
});
|
|
7
|
+
return e(i), r;
|
|
8
|
+
}
|
|
9
|
+
function r(t) {
|
|
10
|
+
let r = t();
|
|
11
|
+
return e(() => r.destroy()), [r, n(r)];
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { n, r as t };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region libs/mintplayer-vue-bootstrap/machine/src/vue-props.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
return Object.fromEntries(Object.entries(e).map(([e, t]) => [e, t === !0 ? "" : t]));
|
|
4
|
+
}
|
|
5
|
+
function t(e) {
|
|
6
|
+
return Object.fromEntries(Object.entries(e).filter((e) => e[1] !== null));
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { t as n, e as t };
|
package/dropdown-menu/index.mjs
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { createElementBlock as e, defineComponent as t, mergeProps as n, onBeforeUnmount as r, onMounted as i, openBlock as a, ref as o, renderSlot as s, watch as c } from "vue";
|
|
2
2
|
import "@mintplayer/web-components/dropdown-menu";
|
|
3
3
|
//#region libs/mintplayer-vue-bootstrap/dropdown-menu/src/BsDropdownMenu.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var l = ["
|
|
4
|
+
var l = ["max-height"], u = /* @__PURE__ */ t({
|
|
5
5
|
inheritAttrs: !1,
|
|
6
6
|
__name: "BsDropdownMenu",
|
|
7
|
-
props: {
|
|
8
|
-
mode: { default: "menu" },
|
|
9
|
-
maxHeight: {}
|
|
10
|
-
},
|
|
7
|
+
props: { maxHeight: {} },
|
|
11
8
|
emits: ["select"],
|
|
12
9
|
setup(t, { emit: c }) {
|
|
13
10
|
let u = c, d = o(null);
|
|
@@ -17,10 +14,7 @@ var l = ["mode", "max-height"], u = /* @__PURE__ */ t({
|
|
|
17
14
|
return i(() => d.value?.addEventListener("select", f)), r(() => d.value?.removeEventListener("select", f)), (r, i) => (a(), e("mp-dropdown-menu", n({
|
|
18
15
|
ref_key: "el",
|
|
19
16
|
ref: d
|
|
20
|
-
}, r.$attrs, {
|
|
21
|
-
mode: t.mode,
|
|
22
|
-
"max-height": t.maxHeight
|
|
23
|
-
}), [s(r.$slots, "default")], 16, l));
|
|
17
|
+
}, r.$attrs, { "max-height": t.maxHeight }), [s(r.$slots, "default")], 16, l));
|
|
24
18
|
}
|
|
25
19
|
}), d = ["aria-disabled"], f = /* @__PURE__ */ t({
|
|
26
20
|
inheritAttrs: !1,
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DropdownSelectEventDetail } from '@mintplayer/web-components/dropdown-menu';
|
|
2
2
|
type __VLS_Props = {
|
|
3
|
-
/** `menu` (default) exposes roving-tabindex menu semantics | `listbox`. */
|
|
4
|
-
mode?: DropdownMode;
|
|
5
3
|
/** Max panel height in px before the item list scrolls. */
|
|
6
4
|
maxHeight?: number;
|
|
7
5
|
};
|
|
@@ -20,9 +18,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
20
18
|
select: (detail: DropdownSelectEventDetail) => any;
|
|
21
19
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
22
20
|
onSelect?: ((detail: DropdownSelectEventDetail) => any) | undefined;
|
|
23
|
-
}>, {
|
|
24
|
-
mode: DropdownMode;
|
|
25
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
21
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
26
22
|
el: unknown;
|
|
27
23
|
}, any>;
|
|
28
24
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -2,4 +2,4 @@ export { default as BsDropdownMenu } from './BsDropdownMenu.vue';
|
|
|
2
2
|
export { default as BsDropdownItem } from './BsDropdownItem.vue';
|
|
3
3
|
export { default as BsDropdownDivider } from './BsDropdownDivider.vue';
|
|
4
4
|
export { default as BsDropdownHeader } from './BsDropdownHeader.vue';
|
|
5
|
-
export type {
|
|
5
|
+
export type { DropdownSelectEventDetail } from '@mintplayer/web-components/dropdown-menu';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ShallowRef } from 'vue';
|
|
2
|
+
import { SnapshotOf, Store } from '@mintplayer/ui-core/store';
|
|
3
|
+
/**
|
|
4
|
+
* Read a `@mintplayer/ui-core` store from a Vue component: a `shallowRef` of
|
|
5
|
+
* the snapshot, set from `subscribe` and released with the effect scope.
|
|
6
|
+
* Shallow on purpose — the snapshot is replaced wholesale and never mutated,
|
|
7
|
+
* so deep reactivity would only cost proxies (spike S1, `useMachine.spec.ts`).
|
|
8
|
+
*/
|
|
9
|
+
export declare function useSnapshot<S extends object>(store: Store<S>): Readonly<ShallowRef<S>>;
|
|
10
|
+
/** Own a machine for the component's lifetime: created in `setup`, destroyed with the scope. */
|
|
11
|
+
export declare function useMachine<M extends Store<object> & {
|
|
12
|
+
destroy(): void;
|
|
13
|
+
}>(create: () => M): [M, Readonly<ShallowRef<SnapshotOf<M>>>];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** An attribute bag as a `@mintplayer/ui-core` `connect()` returns it. */
|
|
2
|
+
export type AttrBag = Record<string, string | boolean | null>;
|
|
3
|
+
/**
|
|
4
|
+
* Turn a core's attribute bag into `v-bind` input. In a bag `true` means "present and empty",
|
|
5
|
+
* but Vue renders a non-boolean attribute bound to `true` as `"true"`, so it becomes `''`;
|
|
6
|
+
* `null` (absent) Vue already removes. The Vue counterpart of React's `reactProps()`, so every
|
|
7
|
+
* front writes the same DOM.
|
|
8
|
+
*/
|
|
9
|
+
export declare function vueProps(bag: AttrBag): Record<string, string | false | null>;
|
|
10
|
+
/** A style bag as a core's `connect()` returns it: CSS property names, `null` for unset. */
|
|
11
|
+
export type StyleBag = Record<string, string | null>;
|
|
12
|
+
/** Turn a core's style bag into a `:style` object: `null` is dropped, names (custom properties too) are kept as they are. */
|
|
13
|
+
export declare function vueStyle(bag: StyleBag): Record<string, string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintplayer/vue-bootstrap",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.27.0",
|
|
4
4
|
"description": "Vue 3.5 SFC adapters around @mintplayer/web-components. Each sub-entry maps one-to-one with a WC sub-entry and exposes typed Vue components with v-model support for input WCs.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -90,6 +90,10 @@
|
|
|
90
90
|
"types": "./input-group/src/index.d.ts",
|
|
91
91
|
"import": "./input-group/index.mjs"
|
|
92
92
|
},
|
|
93
|
+
"./machine": {
|
|
94
|
+
"types": "./machine/src/index.d.ts",
|
|
95
|
+
"import": "./machine/index.mjs"
|
|
96
|
+
},
|
|
93
97
|
"./multi-range": {
|
|
94
98
|
"types": "./multi-range/src/index.d.ts",
|
|
95
99
|
"import": "./multi-range/index.mjs"
|
|
@@ -177,11 +181,16 @@
|
|
|
177
181
|
"./treeview": {
|
|
178
182
|
"types": "./treeview/src/index.d.ts",
|
|
179
183
|
"import": "./treeview/index.mjs"
|
|
184
|
+
},
|
|
185
|
+
"./typeahead": {
|
|
186
|
+
"types": "./typeahead/src/index.d.ts",
|
|
187
|
+
"import": "./typeahead/index.mjs"
|
|
180
188
|
}
|
|
181
189
|
},
|
|
182
190
|
"peerDependencies": {
|
|
191
|
+
"@mintplayer/ui-core": "^1.1.0",
|
|
183
192
|
"vue": "^3.5.0",
|
|
184
|
-
"@mintplayer/web-components": "^
|
|
193
|
+
"@mintplayer/web-components": "^3.0.0"
|
|
185
194
|
},
|
|
186
195
|
"dependencies": {
|
|
187
196
|
"tslib": "^2.3.0"
|
package/tile-manager/index.mjs
CHANGED
|
@@ -1,20 +1,186 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { t as e } from "../chunks/useMachine-DLZ7g_H3.mjs";
|
|
2
|
+
import { n as t, t as n } from "../chunks/vue-props-NyhME1Ba.mjs";
|
|
3
|
+
import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, defineComponent as u, mergeModels as d, mergeProps as f, onBeforeUnmount as ee, onMounted as p, openBlock as m, ref as h, renderList as g, renderSlot as _, resolveDynamicComponent as te, toDisplayString as v, unref as y, useAttrs as b, useId as x, useModel as ne, watch as S, withCtx as re } from "vue";
|
|
4
|
+
import { installLightStyles as ie } from "@mintplayer/ui-core/scoped-styles";
|
|
5
|
+
import { DEFAULT_GAP as C, DEFAULT_MIN_COLUMN_WIDTH as w, TILE_MANAGER_SCOPE as T, TileFlip as E, TileManagerMachine as D, breakpointCss as O, connect as k, gridPointer as A, readCellMetrics as j, tileManagerScopedStyles as M, withoutNarrowerLayouts as N } from "@mintplayer/ui-core/tile-manager";
|
|
6
|
+
//#region libs/mintplayer-vue-bootstrap/tile-manager/src/BsTileManager.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
+
var P = [
|
|
8
|
+
"onPointerdown",
|
|
9
|
+
"onKeydown",
|
|
10
|
+
"onFocus",
|
|
11
|
+
"onBlur"
|
|
12
|
+
], ae = ["onPointerdown"], oe = ["onPointerdown"], F = /* @__PURE__ */ u({
|
|
6
13
|
inheritAttrs: !1,
|
|
7
14
|
__name: "BsTileManager",
|
|
8
|
-
props:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
15
|
+
props: /*@__PURE__*/ d({
|
|
16
|
+
tiles: { default: () => [] },
|
|
17
|
+
breakpoints: { default: null },
|
|
18
|
+
stackBelow: { default: null },
|
|
19
|
+
maxColumns: { default: 6 },
|
|
20
|
+
minColumnWidth: { default: w },
|
|
21
|
+
minRowHeight: { default: "8rem" },
|
|
22
|
+
gap: { default: C },
|
|
23
|
+
dragMode: { default: "header" },
|
|
24
|
+
resizeMode: { default: "hover" },
|
|
25
|
+
animateReflow: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: !0
|
|
28
|
+
},
|
|
29
|
+
label: { default: null },
|
|
30
|
+
messages: { default: () => ({}) }
|
|
31
|
+
}, {
|
|
32
|
+
layouts: { default: () => ({}) },
|
|
33
|
+
layoutsModifiers: {}
|
|
34
|
+
}),
|
|
35
|
+
emits: /*@__PURE__*/ d([
|
|
36
|
+
"layoutPreview",
|
|
37
|
+
"layoutChange",
|
|
38
|
+
"columnCountChange",
|
|
39
|
+
"gestureBlocked"
|
|
40
|
+
], ["update:layouts"]),
|
|
41
|
+
setup(u, { expose: d, emit: C }) {
|
|
42
|
+
let w = u, N = ne(u, "layouts"), F = C, I = `bs-tile-manager-${x().replace(/[^a-zA-Z0-9_-]/g, "")}`, [L, R] = e(() => {
|
|
43
|
+
let e = new D({ vibrate: (e) => navigator.vibrate?.(e) });
|
|
44
|
+
return e.setInputs({
|
|
45
|
+
tiles: w.tiles,
|
|
46
|
+
layouts: N.value,
|
|
47
|
+
breakpoints: w.breakpoints,
|
|
48
|
+
stackBelow: w.stackBelow,
|
|
49
|
+
maxColumns: w.maxColumns,
|
|
50
|
+
minColumnWidth: w.minColumnWidth,
|
|
51
|
+
minRowHeight: w.minRowHeight,
|
|
52
|
+
gap: w.gap,
|
|
53
|
+
dragMode: w.dragMode,
|
|
54
|
+
resizeMode: w.resizeMode,
|
|
55
|
+
label: w.label,
|
|
56
|
+
messages: w.messages
|
|
57
|
+
}), e;
|
|
58
|
+
});
|
|
59
|
+
ie(T, M), S(() => w.tiles, (e) => L.setInputs({ tiles: e })), S(() => w.breakpoints, (e) => L.setInputs({ breakpoints: e })), S(() => w.stackBelow, (e) => L.setInputs({ stackBelow: e })), S(() => w.maxColumns, (e) => L.setInputs({ maxColumns: e })), S(() => w.minColumnWidth, (e) => L.setInputs({ minColumnWidth: e })), S(() => w.minRowHeight, (e) => L.setInputs({ minRowHeight: e })), S(() => w.gap, (e) => L.setInputs({ gap: e })), S(() => w.dragMode, (e) => L.setInputs({ dragMode: e })), S(() => w.resizeMode, (e) => L.setInputs({ resizeMode: e })), S(() => w.label, (e) => L.setInputs({ label: e })), S(() => w.messages, (e) => L.setInputs({ messages: e })), S(N, (e) => {
|
|
60
|
+
e !== L.snapshot.layouts && L.setInputs({ layouts: e });
|
|
61
|
+
});
|
|
62
|
+
let z = L.onEvent((e) => {
|
|
63
|
+
let { type: t, ...n } = e;
|
|
64
|
+
switch (t) {
|
|
65
|
+
case "layoutchange": {
|
|
66
|
+
let e = n;
|
|
67
|
+
N.value = e.layouts, F("layoutChange", e);
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
case "layoutpreview":
|
|
71
|
+
F("layoutPreview", n);
|
|
72
|
+
break;
|
|
73
|
+
case "columncountchange":
|
|
74
|
+
F("columnCountChange", n);
|
|
75
|
+
break;
|
|
76
|
+
case "gestureblocked": F("gestureBlocked", n);
|
|
77
|
+
}
|
|
78
|
+
}), B = h(null), V = h(null), H = new E(), U = !1, W = 0, G = null, K = L.subscribe(() => {
|
|
79
|
+
let e = L.rendered;
|
|
80
|
+
e !== G && (G = e, V.value && w.animateReflow && L.snapshot.measured && (H.first(V.value), U = !0));
|
|
81
|
+
});
|
|
82
|
+
S(R, (e) => {
|
|
83
|
+
if (U && V.value && (U = !1, H.play(V.value, e.gesture.kind === "drag" ? e.gesture.tileId : null)), e.focusRequest && e.focusRequest.seq !== W) {
|
|
84
|
+
W = e.focusRequest.seq;
|
|
85
|
+
let t = e.focusRequest.tileId;
|
|
86
|
+
Array.from(B.value?.querySelectorAll("[data-tile-id]") ?? []).find((e) => e.dataset.tileId === t)?.focus();
|
|
87
|
+
}
|
|
88
|
+
}, { flush: "post" });
|
|
89
|
+
let q = null, J = 0, Y = () => {
|
|
90
|
+
document.visibilityState === "hidden" && L.cancelGesture();
|
|
12
91
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
92
|
+
p(() => {
|
|
93
|
+
let e = V.value;
|
|
94
|
+
if (!e || typeof ResizeObserver > "u") return;
|
|
95
|
+
let t = 0;
|
|
96
|
+
q = new ResizeObserver((e) => {
|
|
97
|
+
let n = e[e.length - 1];
|
|
98
|
+
t = n.contentBoxSize?.[0]?.inlineSize ?? n.contentRect.width, !J && (J = requestAnimationFrame(() => {
|
|
99
|
+
J = 0, L.measure(t);
|
|
100
|
+
}));
|
|
101
|
+
}), q.observe(e), document.addEventListener("visibilitychange", Y);
|
|
102
|
+
}), ee(() => {
|
|
103
|
+
z(), K(), q?.disconnect(), cancelAnimationFrame(J), document.removeEventListener("visibilitychange", Y);
|
|
104
|
+
});
|
|
105
|
+
function X(e, t, n) {
|
|
106
|
+
let r = V.value;
|
|
107
|
+
r && L.pointerDown(t, n, A(e, r), j(r, L.snapshot.columnCount)) === "capture" && (e.preventDefault(), e.currentTarget.closest("[data-tile-id]")?.setPointerCapture(e.pointerId));
|
|
108
|
+
}
|
|
109
|
+
function se(e) {
|
|
110
|
+
let t = V.value;
|
|
111
|
+
t && L.pointerMove(A(e, t)) === "capture" && e.currentTarget.setPointerCapture(e.pointerId);
|
|
112
|
+
}
|
|
113
|
+
function ce(e, t) {
|
|
114
|
+
L.keydown(t, e.key, { shift: e.shiftKey }) && e.preventDefault();
|
|
115
|
+
}
|
|
116
|
+
let Z = i(() => (R.value, k(L, I))), Q = i(() => new Map(w.tiles.map((e) => [e.id, e]))), $ = i(() => R.value.measured ? null : O(R.value.layouts, R.value.tiles, R.value, I)), le = b();
|
|
117
|
+
function ue() {
|
|
118
|
+
let { role: e, class: r, style: i, "aria-describedby": a, ...o } = le, { class: s, "aria-describedby": c, ...l } = Z.value.board.attrs;
|
|
119
|
+
return {
|
|
120
|
+
...n(l),
|
|
121
|
+
...o,
|
|
122
|
+
class: [
|
|
123
|
+
"mp-tile-manager",
|
|
124
|
+
s,
|
|
125
|
+
r
|
|
126
|
+
],
|
|
127
|
+
style: [t(Z.value.board.style), i],
|
|
128
|
+
"aria-describedby": [c, a].filter(Boolean).join(" ") || void 0
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
return d({
|
|
132
|
+
captureLayout: () => ({
|
|
133
|
+
columnCount: L.snapshot.columnCount,
|
|
134
|
+
layout: L.rendered.map((e) => ({
|
|
135
|
+
id: e.id,
|
|
136
|
+
position: { ...e.position }
|
|
137
|
+
}))
|
|
138
|
+
}),
|
|
139
|
+
resetLayout: (e) => L.resetLayout(e),
|
|
140
|
+
isGestureActive: () => {
|
|
141
|
+
let e = L.snapshot.gesture.kind;
|
|
142
|
+
return e === "drag" || e === "resize";
|
|
143
|
+
}
|
|
144
|
+
}), (e, i) => (m(), s("div", f({
|
|
145
|
+
ref_key: "boardRef",
|
|
146
|
+
ref: B
|
|
147
|
+
}, ue(), { role: "region" }), [
|
|
148
|
+
$.value ? (m(), a(te("style"), { key: 0 }, {
|
|
149
|
+
default: re(() => [l(v($.value), 1)]),
|
|
150
|
+
_: 1
|
|
151
|
+
})) : o("", !0),
|
|
152
|
+
c("div", f({ class: "tile-container" }, y(n)(Z.value.container)), [c("div", f({
|
|
153
|
+
ref_key: "gridRef",
|
|
154
|
+
ref: V,
|
|
155
|
+
class: "tile-grid"
|
|
156
|
+
}, y(n)(Z.value.grid.attrs), { style: y(t)(Z.value.grid.style) }), [(m(!0), s(r, null, g(Z.value.tiles, (a) => (m(), s("div", f({
|
|
157
|
+
key: a.id,
|
|
158
|
+
class: "tile"
|
|
159
|
+
}, { ref_for: !0 }, y(n)(a.attrs), {
|
|
160
|
+
style: y(t)(a.style),
|
|
161
|
+
onPointerdown: (e) => X(e, a.id, "body"),
|
|
162
|
+
onPointermove: se,
|
|
163
|
+
onPointerup: i[0] ||= (e) => y(L).pointerUp(e),
|
|
164
|
+
onPointercancel: i[1] ||= (e) => y(L).pointerCancel(e),
|
|
165
|
+
onLostpointercapture: i[2] ||= (e) => y(L).pointerCancel(e),
|
|
166
|
+
onKeydown: (e) => ce(e, a.id),
|
|
167
|
+
onFocus: (e) => y(L).focus(a.id),
|
|
168
|
+
onBlur: (e) => y(L).blur(a.id)
|
|
169
|
+
}), [
|
|
170
|
+
c("div", f({ class: "tile-header" }, { ref_for: !0 }, y(n)(a.header), { onPointerdown: (e) => X(e, a.id, "header") }), [Q.value.get(a.id) ? _(e.$slots, "header", { tile: Q.value.get(a.id) }, void 0, void 0, 0) : o("", !0)], 16, ae),
|
|
171
|
+
c("div", f({ class: "tile-content" }, { ref_for: !0 }, y(n)(a.content)), [Q.value.get(a.id) ? _(e.$slots, "content", { tile: Q.value.get(a.id) }, void 0, void 0, 0) : o("", !0)], 16),
|
|
172
|
+
(m(!0), s(r, null, g(a.grips, (e) => (m(), s("span", f({
|
|
173
|
+
key: e.handle,
|
|
174
|
+
class: "tile-grip"
|
|
175
|
+
}, { ref_for: !0 }, y(n)(e.attrs), { onPointerdown: (t) => X(t, a.id, e.handle) }), null, 16, oe))), 128))
|
|
176
|
+
], 16, P))), 128))], 16)], 16),
|
|
177
|
+
(m(!0), s(r, null, g(Z.value.descriptions, (e) => (m(), s("div", f({
|
|
178
|
+
key: e.key,
|
|
179
|
+
class: "tile-sr-only"
|
|
180
|
+
}, { ref_for: !0 }, y(n)(e.attrs)), v(e.text), 17))), 128)),
|
|
181
|
+
c("span", f({ class: "tile-sr-only" }, y(n)(Z.value.live.attrs)), v(Z.value.live.text), 17)
|
|
182
|
+
], 16));
|
|
17
183
|
}
|
|
18
184
|
});
|
|
19
185
|
//#endregion
|
|
20
|
-
export {
|
|
186
|
+
export { F as BsTileManager, N as withoutNarrowerLayouts };
|
|
@@ -1,25 +1,70 @@
|
|
|
1
|
-
import { MintTile } from '@mintplayer/
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { MintTile, TileBreakpoint, TileDragMode, TileGestureBlocked, TileLayoutChange, TileLayouts, TileLayoutSnapshot, TileManagerMessages, TileResizeMode } from '@mintplayer/ui-core/tile-manager';
|
|
2
|
+
import { BsTileColumnCountChange } from './types';
|
|
3
|
+
declare const _default: <T extends MintTile>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
5
|
+
readonly onGestureBlocked?: ((blocked: TileGestureBlocked) => any) | undefined;
|
|
6
|
+
readonly "onUpdate:layouts"?: ((value: Readonly<Record<number, TileLayoutSnapshot>>) => any) | undefined;
|
|
7
|
+
readonly onLayoutPreview?: ((change: TileLayoutChange) => any) | undefined;
|
|
8
|
+
readonly onLayoutChange?: ((change: TileLayoutChange) => any) | undefined;
|
|
9
|
+
readonly onColumnCountChange?: ((change: BsTileColumnCountChange) => any) | undefined;
|
|
10
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onGestureBlocked" | "onUpdate:layouts" | "onLayoutPreview" | "onLayoutChange" | "onColumnCountChange"> & ({
|
|
11
|
+
layouts?: TileLayouts;
|
|
12
|
+
} & {
|
|
13
|
+
/** The visible tiles, in DOM order. */
|
|
14
|
+
tiles?: readonly T[];
|
|
15
|
+
/** Explicit `{ minWidth, columns }` map. Wins over `stackBelow` and the generated map. */
|
|
16
|
+
breakpoints?: readonly TileBreakpoint[] | null;
|
|
17
|
+
/** px. Below this width the tiles stack in one column. */
|
|
18
|
+
stackBelow?: number | null;
|
|
19
|
+
/** Upper bound of the generated map when `layouts` is empty. */
|
|
20
|
+
maxColumns?: number;
|
|
21
|
+
/** px. No column is narrower than this, except at one column. */
|
|
22
|
+
minColumnWidth?: number;
|
|
23
|
+
/** CSS length of one grid row. */
|
|
24
|
+
minRowHeight?: string;
|
|
25
|
+
/** px between tiles. */
|
|
26
|
+
gap?: number;
|
|
27
|
+
dragMode?: TileDragMode;
|
|
28
|
+
resizeMode?: TileResizeMode;
|
|
29
|
+
/** Animate tiles to their new place when the layout reflows. Off under reduced motion. */
|
|
30
|
+
animateReflow?: boolean;
|
|
31
|
+
/** Accessible name of the board. An `aria-label` / `aria-labelledby` attribute wins. */
|
|
32
|
+
label?: string | null;
|
|
33
|
+
/** Localized strings for the board's descriptions and announcements. */
|
|
34
|
+
messages?: Partial<TileManagerMessages>;
|
|
35
|
+
}) & Partial<{}>> & import('vue').PublicProps;
|
|
36
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{
|
|
37
|
+
/** What is rendered: the resolved column count and its layout (the preview while editing). */
|
|
38
|
+
captureLayout: () => {
|
|
39
|
+
columnCount: number;
|
|
40
|
+
layout: TileLayoutSnapshot;
|
|
41
|
+
};
|
|
42
|
+
/** Drops `layouts[count]` and commits, so that count derives again (D15). */
|
|
43
|
+
resetLayout: (count: number) => void;
|
|
44
|
+
/** True while a pointer drag or resize is in flight. */
|
|
45
|
+
isGestureActive: () => boolean;
|
|
46
|
+
}>): void;
|
|
47
|
+
attrs: any;
|
|
48
|
+
slots: Readonly<{
|
|
49
|
+
header?(props: {
|
|
50
|
+
tile: T;
|
|
51
|
+
}): unknown;
|
|
52
|
+
content?(props: {
|
|
53
|
+
tile: T;
|
|
54
|
+
}): unknown;
|
|
55
|
+
}> & {
|
|
56
|
+
header?(props: {
|
|
57
|
+
tile: T;
|
|
58
|
+
}): unknown;
|
|
59
|
+
content?(props: {
|
|
60
|
+
tile: T;
|
|
61
|
+
}): unknown;
|
|
12
62
|
};
|
|
13
|
-
|
|
63
|
+
emit: (((evt: "gestureBlocked", blocked: TileGestureBlocked) => void) & ((evt: "layoutPreview", change: TileLayoutChange) => void) & ((evt: "layoutChange", change: TileLayoutChange) => void) & ((evt: "columnCountChange", change: BsTileColumnCountChange) => void)) & ((evt: "update:layouts", value: Readonly<Record<number, TileLayoutSnapshot>>) => void);
|
|
64
|
+
}>) => import('vue').VNode & {
|
|
65
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
14
66
|
};
|
|
15
|
-
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
16
|
-
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
17
|
-
el: unknown;
|
|
18
|
-
}, any>;
|
|
19
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
20
67
|
export default _default;
|
|
21
|
-
type
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
25
|
-
};
|
|
68
|
+
type __VLS_PrettifyLocal<T> = {
|
|
69
|
+
[K in keyof T]: T[K];
|
|
70
|
+
} & {};
|
|
@@ -1 +1,4 @@
|
|
|
1
1
|
export { default as BsTileManager } from './BsTileManager.vue';
|
|
2
|
+
export type { BsTileColumnCountChange, BsTileManagerExposed } from './types';
|
|
3
|
+
export type { MintTile, TileBreakpoint, TileDragMode, TileGestureBlocked, TileLayoutChange, TileLayouts, TileLayoutSnapshot, TileManagerMessages, TilePosition, TileResizeMode, TileSize, } from '@mintplayer/ui-core/tile-manager';
|
|
4
|
+
export { withoutNarrowerLayouts } from '@mintplayer/ui-core/tile-manager';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TileLayoutSnapshot } from '@mintplayer/ui-core/tile-manager';
|
|
2
|
+
/** Payload of `columnCountChange`. */
|
|
3
|
+
export interface BsTileColumnCountChange {
|
|
4
|
+
columnCount: number;
|
|
5
|
+
previous: number | null;
|
|
6
|
+
}
|
|
7
|
+
/** What a template ref on `<BsTileManager>` exposes. */
|
|
8
|
+
export interface BsTileManagerExposed {
|
|
9
|
+
/** What is rendered: the resolved column count and its layout (the preview while editing). */
|
|
10
|
+
captureLayout(): {
|
|
11
|
+
columnCount: number;
|
|
12
|
+
layout: TileLayoutSnapshot;
|
|
13
|
+
};
|
|
14
|
+
/** Drops `layouts[count]` and commits, so that count derives again (D15). */
|
|
15
|
+
resetLayout(count: number): void;
|
|
16
|
+
/** True while a pointer drag or resize is in flight. */
|
|
17
|
+
isGestureActive(): boolean;
|
|
18
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { t as e } from "../chunks/useMachine-DLZ7g_H3.mjs";
|
|
2
|
+
import { Fragment as t, computed as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, defineComponent as s, getCurrentInstance as c, mergeModels as l, mergeProps as u, openBlock as d, renderList as f, renderSlot as p, toDisplayString as m, unref as h, useAttrs as g, useModel as _, watch as v, withModifiers as y } from "vue";
|
|
3
|
+
import { installLightStyles as b } from "@mintplayer/ui-core/scoped-styles";
|
|
4
|
+
import { TYPEAHEAD_SCOPE as x, TypeaheadMachine as S, connect as C, inMemoryTypeaheadProvider as w, typeaheadScopedStyles as T } from "@mintplayer/ui-core/typeahead";
|
|
5
|
+
//#region libs/mintplayer-vue-bootstrap/typeahead/src/BsTypeahead.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var E = ["value"], D = ["onClick"], O = /* @__PURE__ */ s({
|
|
7
|
+
inheritAttrs: !1,
|
|
8
|
+
__name: "BsTypeahead",
|
|
9
|
+
props: /*@__PURE__*/ l({
|
|
10
|
+
provider: {
|
|
11
|
+
type: [Function, null],
|
|
12
|
+
default: null
|
|
13
|
+
},
|
|
14
|
+
debounceMs: { default: 200 },
|
|
15
|
+
minLength: { default: 1 },
|
|
16
|
+
itemText: {},
|
|
17
|
+
itemKey: {},
|
|
18
|
+
disabled: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: !1
|
|
21
|
+
},
|
|
22
|
+
name: { default: null },
|
|
23
|
+
inputLabel: { default: null },
|
|
24
|
+
loadingLabel: {},
|
|
25
|
+
noResultsLabel: {},
|
|
26
|
+
resultsLabel: {},
|
|
27
|
+
errorText: { default: null }
|
|
28
|
+
}, {
|
|
29
|
+
modelValue: { default: "" },
|
|
30
|
+
modelModifiers: {}
|
|
31
|
+
}),
|
|
32
|
+
emits: /*@__PURE__*/ l([
|
|
33
|
+
"select",
|
|
34
|
+
"submit",
|
|
35
|
+
"open",
|
|
36
|
+
"close",
|
|
37
|
+
"loadError"
|
|
38
|
+
], ["update:modelValue"]),
|
|
39
|
+
setup(s, { emit: l }) {
|
|
40
|
+
let w = s, O = _(s, "modelValue"), k = l, A = `bs-typeahead-${c()?.uid ?? Math.random().toString(36).slice(2)}`, [j, M] = e(() => new S({
|
|
41
|
+
id: A,
|
|
42
|
+
value: O.value,
|
|
43
|
+
onChange: (e) => {
|
|
44
|
+
O.value = e;
|
|
45
|
+
},
|
|
46
|
+
onSelect: (e, t) => k("select", e, t),
|
|
47
|
+
onSubmit: (e) => k("submit", e),
|
|
48
|
+
onOpen: () => k("open"),
|
|
49
|
+
onClose: () => k("close"),
|
|
50
|
+
onError: (e) => k("loadError", e)
|
|
51
|
+
}));
|
|
52
|
+
b(x, T), v(() => w.provider, (e) => j.provider = e, { immediate: !0 }), v(() => w.debounceMs, (e) => j.debounceMs = e, { immediate: !0 }), v(() => w.minLength, (e) => j.minLength = e, { immediate: !0 }), v(() => [w.itemText, w.itemKey], ([e, t]) => {
|
|
53
|
+
j.itemText = e, j.itemKey = t;
|
|
54
|
+
}, { immediate: !0 }), v(() => w.disabled, (e) => j.setDisabled(e), { immediate: !0 }), v(() => w.errorText, (e) => j.setErrorText(e), { immediate: !0 }), v(() => [
|
|
55
|
+
w.inputLabel,
|
|
56
|
+
w.loadingLabel,
|
|
57
|
+
w.noResultsLabel,
|
|
58
|
+
w.resultsLabel
|
|
59
|
+
], ([e, t, n, r]) => {
|
|
60
|
+
let i = { input: e ?? null };
|
|
61
|
+
t !== void 0 && (i.loading = t), n !== void 0 && (i.noResults = n), r !== void 0 && (i.results = r), j.setLabels(i);
|
|
62
|
+
}, { immediate: !0 }), v(O, (e) => {
|
|
63
|
+
e !== j.snapshot.term && j.setValue(e);
|
|
64
|
+
});
|
|
65
|
+
let N = n(() => C(M.value, A, { name: w.name })), P = n(() => {
|
|
66
|
+
let { value: e, ...t } = N.value.input;
|
|
67
|
+
return t;
|
|
68
|
+
});
|
|
69
|
+
function F(e, t) {
|
|
70
|
+
return w.itemKey ? w.itemKey(e) : j.itemTextOf(e) || t;
|
|
71
|
+
}
|
|
72
|
+
function I(e) {
|
|
73
|
+
j.setTerm(e.target.value);
|
|
74
|
+
}
|
|
75
|
+
function L(e) {
|
|
76
|
+
j.keydown(e.key, e) && e.preventDefault();
|
|
77
|
+
}
|
|
78
|
+
let R = g();
|
|
79
|
+
function z() {
|
|
80
|
+
let { role: e, ...t } = R;
|
|
81
|
+
return t;
|
|
82
|
+
}
|
|
83
|
+
return (e, n) => (d(), i("div", u({ class: "mp-typeahead" }, N.value.root), [
|
|
84
|
+
a("input", u({
|
|
85
|
+
class: "form-control",
|
|
86
|
+
type: "text"
|
|
87
|
+
}, {
|
|
88
|
+
...P.value,
|
|
89
|
+
...z()
|
|
90
|
+
}, {
|
|
91
|
+
role: "combobox",
|
|
92
|
+
value: h(M).term,
|
|
93
|
+
onInput: I,
|
|
94
|
+
onKeydown: L,
|
|
95
|
+
onBlur: n[0] ||= (e) => h(j).blur()
|
|
96
|
+
}), null, 16, E),
|
|
97
|
+
a("ul", u({ class: "dropdown-menu" }, N.value.listbox), [N.value.status ? (d(), i("li", u({
|
|
98
|
+
key: 0,
|
|
99
|
+
class: "ta-status"
|
|
100
|
+
}, N.value.status.attrs), m(N.value.status.text), 17)) : r("", !0), (d(!0), i(t, null, f(h(M).items, (t, r) => (d(), i("li", u({
|
|
101
|
+
key: F(t, r),
|
|
102
|
+
class: "dropdown-item"
|
|
103
|
+
}, { ref_for: !0 }, N.value.option(r), {
|
|
104
|
+
onMousedown: n[1] ||= y(() => {}, ["prevent"]),
|
|
105
|
+
onClick: (e) => h(j).pick(r)
|
|
106
|
+
}), [p(e.$slots, "item", {
|
|
107
|
+
item: t,
|
|
108
|
+
term: h(M).term
|
|
109
|
+
}, () => [o(m(h(j).itemTextOf(t)), 1)])], 16, D))), 128))], 16),
|
|
110
|
+
a("span", u({ class: "visually-hidden" }, N.value.live.attrs), m(N.value.live.text), 17),
|
|
111
|
+
N.value.error ? (d(), i("div", u({
|
|
112
|
+
key: 0,
|
|
113
|
+
class: "ta-error"
|
|
114
|
+
}, N.value.error.attrs), m(N.value.error.text), 17)) : r("", !0)
|
|
115
|
+
], 16));
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
//#endregion
|
|
119
|
+
export { O as BsTypeahead, w as inMemoryTypeaheadProvider };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { TypeaheadProvider } from '@mintplayer/ui-core/typeahead';
|
|
2
|
+
declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
4
|
+
readonly onSelect?: ((item: T, value: string) => any) | undefined;
|
|
5
|
+
readonly onOpen?: (() => any) | undefined;
|
|
6
|
+
readonly "onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
7
|
+
readonly onClose?: (() => any) | undefined;
|
|
8
|
+
readonly onSubmit?: ((value: string) => any) | undefined;
|
|
9
|
+
readonly onLoadError?: ((error: unknown) => any) | undefined;
|
|
10
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onSubmit" | "onSelect" | "onUpdate:modelValue" | "onClose" | "onOpen" | "onLoadError"> & ({
|
|
11
|
+
modelValue?: string;
|
|
12
|
+
} & {
|
|
13
|
+
provider?: TypeaheadProvider<T> | null;
|
|
14
|
+
debounceMs?: number;
|
|
15
|
+
minLength?: number;
|
|
16
|
+
itemText?: (item: T) => string;
|
|
17
|
+
itemKey?: (item: T) => string | number;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
name?: string | null;
|
|
20
|
+
inputLabel?: string | null;
|
|
21
|
+
loadingLabel?: string;
|
|
22
|
+
noResultsLabel?: string;
|
|
23
|
+
resultsLabel?: (count: number) => string;
|
|
24
|
+
errorText?: string | null;
|
|
25
|
+
}) & Partial<{}>> & import('vue').PublicProps;
|
|
26
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
27
|
+
attrs: any;
|
|
28
|
+
slots: Readonly<{
|
|
29
|
+
item?(props: {
|
|
30
|
+
item: T;
|
|
31
|
+
term: string;
|
|
32
|
+
}): unknown;
|
|
33
|
+
}> & {
|
|
34
|
+
item?(props: {
|
|
35
|
+
item: T;
|
|
36
|
+
term: string;
|
|
37
|
+
}): unknown;
|
|
38
|
+
};
|
|
39
|
+
emit: (((evt: "select", item: T, value: string) => void) & ((evt: "open") => void) & ((evt: "close") => void) & ((evt: "submit", value: string) => void) & ((evt: "loadError", error: unknown) => void)) & ((evt: "update:modelValue", value: string) => void);
|
|
40
|
+
}>) => import('vue').VNode & {
|
|
41
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
42
|
+
};
|
|
43
|
+
export default _default;
|
|
44
|
+
type __VLS_PrettifyLocal<T> = {
|
|
45
|
+
[K in keyof T]: T[K];
|
|
46
|
+
} & {};
|