@poveste/controls 0.15.0 → 0.16.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.
@@ -0,0 +1,183 @@
1
+ import { d as e, s as t } from "./HstWrapper-Bm5H3_to.es.js";
2
+ import { o as n } from "./PopoverTrigger-BVAfE9fE.es.js";
3
+ import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, defineComponent as c, h as l, inject as u, markRaw as d, mergeProps as f, openBlock as p, provide as m, ref as h, renderList as g, toValue as _, watch as v, watchEffect as y } from "@poveste/vendors/vue";
4
+ import { unrefElement as b } from "@poveste/vendors/vue-use";
5
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.5_vue@3.5.43_typescript@6.0.3_/node_modules/reka-ui/dist/shared/useFormControl.js
6
+ function x(e) {
7
+ return i(() => !_(e) || !!b(e)?.closest("form"));
8
+ }
9
+ //#endregion
10
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.5_vue@3.5.43_typescript@6.0.3_/node_modules/reka-ui/dist/Collection/Collection.js
11
+ var S = "data-reka-collection-item";
12
+ function C(t = {}) {
13
+ let { key: r = "", isProvider: a = !1 } = t, o = `${r}CollectionProvider`, s;
14
+ if (a) {
15
+ let e = h(/* @__PURE__ */ new Map());
16
+ s = {
17
+ collectionRef: h(),
18
+ itemMap: e
19
+ }, m(o, s);
20
+ } else s = u(o);
21
+ let f = (e, t = !1) => {
22
+ if (!s.collectionRef.value) return;
23
+ let n = s.itemMap.value.get(e);
24
+ return n && (t || n.ref.dataset.disabled !== "") ? n : void 0;
25
+ }, p = (e = !1) => {
26
+ let t = s.collectionRef.value;
27
+ if (!t) return [];
28
+ let n = Array.from(t.querySelectorAll(`[${S}]`)), r = new Map(n.map((e, t) => [e, t])), i = Array.from(s.itemMap.value.values()).sort((e, t) => (r.get(e.ref) ?? -1) - (r.get(t.ref) ?? -1));
29
+ return e ? i : i.filter((e) => e.ref.dataset.disabled !== "");
30
+ }, g = /*#__PURE__*/ c({
31
+ name: "CollectionSlot",
32
+ inheritAttrs: !1,
33
+ setup(t, { slots: r, attrs: i }) {
34
+ let { primitiveElement: a, currentElement: o } = n();
35
+ return v(o, () => {
36
+ s.collectionRef.value = o.value;
37
+ }), () => l(e, {
38
+ ref: a,
39
+ ...i
40
+ }, r);
41
+ }
42
+ }), _ = /*#__PURE__*/ c({
43
+ name: "CollectionItem",
44
+ inheritAttrs: !1,
45
+ props: { value: { validator: () => !0 } },
46
+ setup(t, { slots: r, attrs: i }) {
47
+ let { primitiveElement: a, currentElement: o } = n();
48
+ return y((e) => {
49
+ if (o.value) {
50
+ let n = d(o.value);
51
+ s.itemMap.value.set(n, {
52
+ ref: o.value,
53
+ value: t.value
54
+ }), e(() => s.itemMap.value.delete(n));
55
+ }
56
+ }), () => l(e, {
57
+ ...i,
58
+ [S]: "",
59
+ ref: a
60
+ }, r);
61
+ }
62
+ });
63
+ return {
64
+ getItems: p,
65
+ getItem: f,
66
+ reactiveItems: i(() => Array.from(s.itemMap.value.values())),
67
+ itemMapSize: i(() => s.itemMap.value.size),
68
+ CollectionSlot: g,
69
+ CollectionItem: _
70
+ };
71
+ }
72
+ //#endregion
73
+ //#region ../../node_modules/.pnpm/reka-ui@2.10.5_vue@3.5.43_typescript@6.0.3_/node_modules/reka-ui/dist/VisuallyHidden/VisuallyHiddenInputBubble.js
74
+ var w = /* @__PURE__ */ c({
75
+ inheritAttrs: !1,
76
+ __name: "VisuallyHiddenInputBubble",
77
+ props: {
78
+ name: {
79
+ type: String,
80
+ required: !0
81
+ },
82
+ value: {
83
+ type: null,
84
+ required: !0
85
+ },
86
+ checked: {
87
+ type: Boolean,
88
+ required: !1,
89
+ default: void 0
90
+ },
91
+ required: {
92
+ type: Boolean,
93
+ required: !1
94
+ },
95
+ disabled: {
96
+ type: Boolean,
97
+ required: !1
98
+ },
99
+ feature: {
100
+ type: String,
101
+ required: !1,
102
+ default: "fully-hidden"
103
+ }
104
+ },
105
+ setup(e) {
106
+ let r = e, { primitiveElement: o, currentElement: s } = n(), c = i(() => r.checked ?? r.value);
107
+ return v(c, (e, t) => {
108
+ if (!s.value) return;
109
+ let n = s.value, r = window.HTMLInputElement.prototype, i = Object.getOwnPropertyDescriptor(r, "value").set;
110
+ if (i && e !== t) {
111
+ let t = new Event("input", { bubbles: !0 }), r = new Event("change", { bubbles: !0 });
112
+ i.call(n, e), n.dispatchEvent(t), n.dispatchEvent(r);
113
+ }
114
+ }), (e, n) => (p(), a(t, f({
115
+ ref_key: "primitiveElement",
116
+ ref: o
117
+ }, {
118
+ ...r,
119
+ ...e.$attrs
120
+ }, { as: "input" }), null, 16));
121
+ }
122
+ }), T = /* @__PURE__ */ c({
123
+ inheritAttrs: !1,
124
+ __name: "VisuallyHiddenInput",
125
+ props: {
126
+ name: {
127
+ type: String,
128
+ required: !0
129
+ },
130
+ value: {
131
+ type: null,
132
+ required: !0
133
+ },
134
+ checked: {
135
+ type: Boolean,
136
+ required: !1,
137
+ default: void 0
138
+ },
139
+ required: {
140
+ type: Boolean,
141
+ required: !1
142
+ },
143
+ disabled: {
144
+ type: Boolean,
145
+ required: !1
146
+ },
147
+ feature: {
148
+ type: String,
149
+ required: !1,
150
+ default: "fully-hidden"
151
+ }
152
+ },
153
+ setup(e) {
154
+ let t = e, n = i(() => typeof t.value == "object" && Array.isArray(t.value) && t.value.length === 0 && t.required), c = i(() => typeof t.value == "string" || typeof t.value == "number" || typeof t.value == "boolean" || t.value === null || t.value === void 0 ? [{
155
+ name: t.name,
156
+ value: t.value
157
+ }] : typeof t.value == "object" && Array.isArray(t.value) ? t.value.flatMap((e, n) => typeof e == "object" ? Object.entries(e).map(([e, r]) => ({
158
+ name: `${t.name}[${n}][${e}]`,
159
+ value: r
160
+ })) : {
161
+ name: `${t.name}[${n}]`,
162
+ value: e
163
+ }) : t.value !== null && typeof t.value == "object" && !Array.isArray(t.value) ? Object.entries(t.value).map(([e, n]) => ({
164
+ name: `${t.name}[${e}]`,
165
+ value: n
166
+ })) : []);
167
+ return (e, i) => (p(), s(r, null, [o(" We render single input if it's required "), n.value ? (p(), a(w, f({ key: e.name }, {
168
+ ...t,
169
+ ...e.$attrs
170
+ }, {
171
+ name: e.name,
172
+ value: e.value
173
+ }), null, 16, ["name", "value"])) : (p(!0), s(r, { key: 1 }, g(c.value, (n) => (p(), a(w, f({ key: n.name }, { ref_for: !0 }, {
174
+ ...t,
175
+ ...e.$attrs
176
+ }, {
177
+ name: n.name,
178
+ value: n.value
179
+ }), null, 16, ["name", "value"]))), 128))], 2112));
180
+ }
181
+ });
182
+ //#endregion
183
+ export { C as n, x as r, T as t };
@@ -0,0 +1,39 @@
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
3
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
4
+ /**
5
+ * Nothing renders without one, which is how the truncation tooltips opt out.
6
+ * `null` counts as nothing, since that is what a `x ? 'Label' : null` reads as.
7
+ */
8
+ content?: string | null | undefined;
9
+ side?: "top" | "right" | "bottom" | "left";
10
+ /** Gap from the trigger — floating-vue's `distance`. */
11
+ offset?: number;
12
+ /** Held open by the caller, which is what `triggers: []` with `shown` did. */
13
+ open?: boolean | undefined;
14
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
15
+ /**
16
+ * Nothing renders without one, which is how the truncation tooltips opt out.
17
+ * `null` counts as nothing, since that is what a `x ? 'Label' : null` reads as.
18
+ */
19
+ content?: string | null | undefined;
20
+ side?: "top" | "right" | "bottom" | "left";
21
+ /** Gap from the trigger — floating-vue's `distance`. */
22
+ offset?: number;
23
+ /** Held open by the caller, which is what `triggers: []` with `shown` did. */
24
+ open?: boolean | undefined;
25
+ }> & Readonly<{}>, {
26
+ content: string | null | undefined;
27
+ side: "top" | "right" | "bottom" | "left";
28
+ offset: number;
29
+ open: boolean | undefined;
30
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
31
+ default?: (props: {}) => any;
32
+ } & {
33
+ content?: (props: {}) => any;
34
+ }>;
35
+ type __VLS_WithSlots<T, S> = T & {
36
+ new (): {
37
+ $slots: S;
38
+ };
39
+ };
@@ -1,9 +1,9 @@
1
1
  declare const _default: typeof __VLS_export;
2
2
  export default _default;
3
3
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
4
- color?: "flat" | "default" | "primary";
4
+ color?: "default" | "primary" | "flat";
5
5
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
6
- color?: "flat" | "default" | "primary";
6
+ color?: "default" | "primary" | "flat";
7
7
  }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
8
8
  default?: (props: {}) => any;
9
9
  }>;
@@ -0,0 +1,7 @@
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
3
+ declare const __VLS_export: import("vue").DefineComponent<{
4
+ modelValue?: boolean | undefined;
5
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
6
+ modelValue?: boolean | undefined;
7
+ }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,25 @@
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
3
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
4
+ title?: string | undefined;
5
+ /** A hex string — `#3366ff`. */
6
+ modelValue?: string | null | undefined;
7
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
8
+ "update:modelValue": (value: string) => any;
9
+ }, string, import("vue").PublicProps, Readonly<{
10
+ title?: string | undefined;
11
+ /** A hex string — `#3366ff`. */
12
+ modelValue?: string | null | undefined;
13
+ }> & Readonly<{
14
+ "onUpdate:modelValue"?: (value: string) => any;
15
+ }>, {
16
+ title: string | undefined;
17
+ modelValue: string | null | undefined;
18
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
19
+ actions?: (props: {}) => any;
20
+ }>;
21
+ type __VLS_WithSlots<T, S> = T & {
22
+ new (): {
23
+ $slots: S;
24
+ };
25
+ };
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,30 @@
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
3
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
4
+ title?: string | undefined;
5
+ /** ISO — `2026-09-20`, or `2026-09-20T14:30` when `time` is set. */
6
+ modelValue?: string | null | undefined;
7
+ /** Adds the hour and minute segments, and puts them in the value. */
8
+ time?: boolean;
9
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
10
+ "update:modelValue": (value: string) => any;
11
+ }, string, import("vue").PublicProps, Readonly<{
12
+ title?: string | undefined;
13
+ /** ISO — `2026-09-20`, or `2026-09-20T14:30` when `time` is set. */
14
+ modelValue?: string | null | undefined;
15
+ /** Adds the hour and minute segments, and puts them in the value. */
16
+ time?: boolean;
17
+ }> & Readonly<{
18
+ "onUpdate:modelValue"?: (value: string) => any;
19
+ }>, {
20
+ time: boolean;
21
+ title: string | undefined;
22
+ modelValue: string | null | undefined;
23
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
24
+ actions?: (props: {}) => any;
25
+ }>;
26
+ type __VLS_WithSlots<T, S> = T & {
27
+ new (): {
28
+ $slots: S;
29
+ };
30
+ };
@@ -0,0 +1,5 @@
1
+ import { CalendarDate, Time } from '@internationalized/date';
2
+ export declare function dateOf(value: string | null | undefined): CalendarDate | undefined;
3
+ export declare function timeOf(value: string | null | undefined): Time | undefined;
4
+ /** Minutes, not seconds: the control has no segment finer than that. */
5
+ export declare function isoOf(date: CalendarDate | undefined, time: Time | undefined, withTime: boolean): string;
@@ -1,9 +1,13 @@
1
1
  export declare function stringifyState(value: unknown, space?: number): string;
2
2
  /**
3
- * `stringifyState`, and whether the budget cut the document short. A truncated
4
- * document is not the value, so nothing may parse it back into the model.
3
+ * `stringifyState`, and whether the document *is* the value.
4
+ *
5
+ * `faithful` is false as soon as anything was named rather than written out —
6
+ * a marker, or the budget cutting the rest short. Such a document is a view of
7
+ * the value and not the value, so nothing may parse it back into the model:
8
+ * doing so replaces whatever each marker stands for with its label.
5
9
  */
6
10
  export declare function serializeState(value: unknown, space?: number): {
7
11
  doc: string;
8
- truncated: boolean;
12
+ faithful: boolean;
9
13
  };