@sprawlify/vue 0.0.65 → 0.0.67
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/dist/clean-props-BDv2zb5M.js +9 -0
- package/dist/collapsible-DQfAISmg.js +259 -0
- package/dist/collection-Ba0Aeh5P.js +218 -0
- package/dist/components/accordion/index.d.ts +195 -0
- package/dist/components/accordion/index.js +361 -0
- package/dist/components/angle-slider/index.d.ts +230 -0
- package/dist/components/angle-slider/index.js +371 -0
- package/dist/components/avatar/index.d.ts +116 -0
- package/dist/components/avatar/index.js +177 -0
- package/dist/components/bottom-sheet/index.d.ts +241 -0
- package/dist/components/bottom-sheet/index.js +429 -0
- package/dist/components/carousel/index.d.ts +306 -0
- package/dist/components/carousel/index.js +500 -0
- package/dist/components/checkbox/index.d.ts +273 -0
- package/dist/components/checkbox/index.js +500 -0
- package/dist/components/client-only/index.d.ts +20 -0
- package/dist/components/client-only/index.js +22 -0
- package/dist/components/clipboard/index.d.ts +204 -0
- package/dist/components/clipboard/index.js +297 -0
- package/dist/components/collapsible/index.d.ts +15 -23
- package/dist/components/collapsible/index.js +5 -325
- package/dist/components/collection/index.d.ts +2 -0
- package/dist/components/collection/index.js +4 -0
- package/dist/components/color-picker/index.d.ts +610 -0
- package/dist/components/color-picker/index.js +1127 -0
- package/dist/components/combobox/index.d.ts +618 -0
- package/dist/components/combobox/index.js +802 -0
- package/dist/components/date-picker/index.d.ts +597 -0
- package/dist/components/date-picker/index.js +1110 -0
- package/dist/components/dialog/index.d.ts +270 -0
- package/dist/components/dialog/index.js +433 -0
- package/dist/components/download-trigger/index.d.ts +29 -0
- package/dist/components/download-trigger/index.js +68 -0
- package/dist/components/editable/index.d.ts +288 -0
- package/dist/components/editable/index.js +459 -0
- package/dist/components/field/index.d.ts +326 -0
- package/dist/components/field/index.js +7 -0
- package/dist/components/fieldset/index.d.ts +161 -0
- package/dist/components/fieldset/index.js +7 -0
- package/dist/components/highlight/index.d.ts +35 -0
- package/dist/components/highlight/index.js +57 -0
- package/dist/components/menu/index.d.ts +498 -0
- package/dist/components/menu/index.js +885 -0
- package/dist/components/presence/index.d.ts +3 -0
- package/dist/components/presence/index.js +6 -0
- package/dist/components/select/index.d.ts +430 -0
- package/dist/components/select/index.js +769 -0
- package/dist/{use-forward-expose-BIk4OI3R.js → core-DNndr38p.js} +2 -170
- package/dist/create-split-props-YZ3qgXe_.js +11 -0
- package/dist/factory-BH3WrWd2.js +68 -0
- package/dist/factory-D_ge_w76.d.ts +8 -0
- package/dist/field-DnHnX3Tf.js +501 -0
- package/dist/fieldset-DzhN7Zrg.js +278 -0
- package/dist/{types-BQfkZGpL.d.ts → index-B66Om_3U.d.ts} +1 -9
- package/dist/index-BBHms9-0.d.ts +91 -0
- package/dist/index-CDQghZtv.d.ts +57 -0
- package/dist/index-DqRk-Yea.d.ts +199 -0
- package/dist/index.d.ts +4 -92
- package/dist/index.js +4 -50
- package/dist/presence-CvUnYMZQ.js +105 -0
- package/dist/presence-types-Bv1E60Cw.d.ts +13 -0
- package/dist/providers-B2CNPFg1.js +108 -0
- package/dist/types-Bj-dS2Hc.d.ts +9 -0
- package/dist/use-forward-expose-4p5AGAI3.js +67 -0
- package/dist/use-render-strategy-BkxoN6ll.js +7 -0
- package/dist/use-render-strategy-CHj_pCfT.d.ts +9 -0
- package/dist/utils-B4FuOOE-.js +51 -0
- package/package.json +86 -2
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import { t as __exportAll } from "./chunk-BN_g-Awi.js";
|
|
2
|
+
import { c as useEnvironmentContext, s as DEFAULT_ENVIRONMENT } from "./providers-B2CNPFg1.js";
|
|
3
|
+
import { n as unrefElement, r as createContext, t as useForwardExpose } from "./use-forward-expose-4p5AGAI3.js";
|
|
4
|
+
import { t as sprawlify } from "./factory-BH3WrWd2.js";
|
|
5
|
+
import { computed, createBlock, createCommentVNode, defineComponent, guardReactiveProps, mergeDefaults, mergeProps, normalizeProps, onBeforeUnmount, onMounted, openBlock, reactive, ref, renderSlot, toValue, unref, useId, withCtx } from "vue";
|
|
6
|
+
import { dataAttr } from "@sprawlify/primitives/dom-query";
|
|
7
|
+
import { createAnatomy } from "@sprawlify/primitives/anatomy";
|
|
8
|
+
|
|
9
|
+
//#region src/components/fieldset/use-fieldset-context.ts
|
|
10
|
+
const [FieldsetProvider, useFieldsetContext] = createContext("FieldsetContext");
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/components/fieldset/fieldset-context.vue?vue&type=script&setup=true&lang.ts
|
|
14
|
+
var fieldset_context_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
15
|
+
__name: "fieldset-context",
|
|
16
|
+
setup(__props) {
|
|
17
|
+
const fieldset = useFieldsetContext();
|
|
18
|
+
return (_ctx, _cache) => {
|
|
19
|
+
return renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(fieldset))));
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/components/fieldset/fieldset-context.vue
|
|
26
|
+
var fieldset_context_default = fieldset_context_vue_vue_type_script_setup_true_lang_default;
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/components/fieldset/fieldset-error-text.vue?vue&type=script&setup=true&lang.ts
|
|
30
|
+
var fieldset_error_text_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
31
|
+
__name: "fieldset-error-text",
|
|
32
|
+
props: { asChild: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
required: false
|
|
35
|
+
} },
|
|
36
|
+
setup(__props) {
|
|
37
|
+
const fieldset = useFieldsetContext();
|
|
38
|
+
useForwardExpose();
|
|
39
|
+
return (_ctx, _cache) => {
|
|
40
|
+
return unref(fieldset).invalid ? (openBlock(), createBlock(unref(sprawlify).span, mergeProps({ key: 0 }, unref(fieldset).getErrorTextProps(), { "as-child": __props.asChild }), {
|
|
41
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
42
|
+
_: 3
|
|
43
|
+
}, 16, ["as-child"])) : createCommentVNode("v-if", true);
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/components/fieldset/fieldset-error-text.vue
|
|
50
|
+
var fieldset_error_text_default = fieldset_error_text_vue_vue_type_script_setup_true_lang_default;
|
|
51
|
+
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/components/fieldset/fieldset-helper-text.vue?vue&type=script&setup=true&lang.ts
|
|
54
|
+
var fieldset_helper_text_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
55
|
+
__name: "fieldset-helper-text",
|
|
56
|
+
props: { asChild: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
required: false
|
|
59
|
+
} },
|
|
60
|
+
setup(__props) {
|
|
61
|
+
const fieldset = useFieldsetContext();
|
|
62
|
+
useForwardExpose();
|
|
63
|
+
return (_ctx, _cache) => {
|
|
64
|
+
return openBlock(), createBlock(unref(sprawlify).span, mergeProps(unref(fieldset).getHelperTextProps(), { "as-child": __props.asChild }), {
|
|
65
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
66
|
+
_: 3
|
|
67
|
+
}, 16, ["as-child"]);
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region src/components/fieldset/fieldset-helper-text.vue
|
|
74
|
+
var fieldset_helper_text_default = fieldset_helper_text_vue_vue_type_script_setup_true_lang_default;
|
|
75
|
+
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/components/fieldset/fieldset-legend.vue?vue&type=script&setup=true&lang.ts
|
|
78
|
+
var fieldset_legend_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
79
|
+
__name: "fieldset-legend",
|
|
80
|
+
props: { asChild: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
required: false
|
|
83
|
+
} },
|
|
84
|
+
setup(__props) {
|
|
85
|
+
const fieldset = useFieldsetContext();
|
|
86
|
+
useForwardExpose();
|
|
87
|
+
return (_ctx, _cache) => {
|
|
88
|
+
return openBlock(), createBlock(unref(sprawlify).legend, mergeProps(unref(fieldset).getLegendProps(), { "as-child": __props.asChild }), {
|
|
89
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
90
|
+
_: 3
|
|
91
|
+
}, 16, ["as-child"]);
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region src/components/fieldset/fieldset-legend.vue
|
|
98
|
+
var fieldset_legend_default = fieldset_legend_vue_vue_type_script_setup_true_lang_default;
|
|
99
|
+
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region src/components/fieldset/fieldset-root-provider.vue?vue&type=script&setup=true&lang.ts
|
|
102
|
+
var fieldset_root_provider_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
103
|
+
__name: "fieldset-root-provider",
|
|
104
|
+
props: {
|
|
105
|
+
value: {
|
|
106
|
+
type: null,
|
|
107
|
+
required: true
|
|
108
|
+
},
|
|
109
|
+
asChild: {
|
|
110
|
+
type: Boolean,
|
|
111
|
+
required: false
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
setup(__props) {
|
|
115
|
+
const props = __props;
|
|
116
|
+
const fieldset = computed(() => props.value);
|
|
117
|
+
FieldsetProvider(fieldset);
|
|
118
|
+
useForwardExpose();
|
|
119
|
+
return (_ctx, _cache) => {
|
|
120
|
+
return openBlock(), createBlock(unref(sprawlify).fieldset, mergeProps(fieldset.value.getRootProps(), { "as-child": __props.asChild }), {
|
|
121
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
122
|
+
_: 3
|
|
123
|
+
}, 16, ["as-child"]);
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region src/components/fieldset/fieldset-root-provider.vue
|
|
130
|
+
var fieldset_root_provider_default = fieldset_root_provider_vue_vue_type_script_setup_true_lang_default;
|
|
131
|
+
|
|
132
|
+
//#endregion
|
|
133
|
+
//#region src/components/fieldset/fieldset-anatomy.ts
|
|
134
|
+
const fieldsetAnatomy = createAnatomy("fieldset").parts("root", "errorText", "helperText", "legend");
|
|
135
|
+
const parts = fieldsetAnatomy.build();
|
|
136
|
+
|
|
137
|
+
//#endregion
|
|
138
|
+
//#region src/components/fieldset/use-fieldset.ts
|
|
139
|
+
const useFieldset = (props = {}) => {
|
|
140
|
+
const env = useEnvironmentContext(DEFAULT_ENVIRONMENT);
|
|
141
|
+
const state = reactive({
|
|
142
|
+
hasErrorText: false,
|
|
143
|
+
hasHelperText: false
|
|
144
|
+
});
|
|
145
|
+
const rootRef = ref(null);
|
|
146
|
+
const uuid = useId();
|
|
147
|
+
const ids = computed(() => {
|
|
148
|
+
const id = toValue(props).id ?? uuid;
|
|
149
|
+
return {
|
|
150
|
+
legendId: `fieldset::${id}::legend`,
|
|
151
|
+
errorTextId: `fieldset::${id}::error-text`,
|
|
152
|
+
helperTextId: `fieldset::${id}::helper-text`
|
|
153
|
+
};
|
|
154
|
+
});
|
|
155
|
+
onMounted(() => {
|
|
156
|
+
const rootNode = unrefElement(rootRef);
|
|
157
|
+
if (!rootNode) return;
|
|
158
|
+
const checkTextElements = () => {
|
|
159
|
+
const { errorTextId, helperTextId } = ids.value;
|
|
160
|
+
const docOrShadowRoot = env.value.getRootNode();
|
|
161
|
+
state.hasErrorText = !!docOrShadowRoot.getElementById(errorTextId);
|
|
162
|
+
state.hasHelperText = !!docOrShadowRoot.getElementById(helperTextId);
|
|
163
|
+
};
|
|
164
|
+
checkTextElements();
|
|
165
|
+
const observer = new (env.value.getWindow()).MutationObserver(checkTextElements);
|
|
166
|
+
observer.observe(rootNode, {
|
|
167
|
+
childList: true,
|
|
168
|
+
subtree: true
|
|
169
|
+
});
|
|
170
|
+
onBeforeUnmount(() => {
|
|
171
|
+
observer.disconnect();
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
return computed(() => {
|
|
175
|
+
const { disabled, invalid } = toValue(props);
|
|
176
|
+
const { legendId, errorTextId, helperTextId } = ids.value;
|
|
177
|
+
const describedByIds = [];
|
|
178
|
+
if (state.hasErrorText && invalid) describedByIds.push(errorTextId);
|
|
179
|
+
if (state.hasHelperText) describedByIds.push(helperTextId);
|
|
180
|
+
const describedBy = describedByIds.length > 0 ? describedByIds.join(" ") : void 0;
|
|
181
|
+
const getRootProps = () => ({
|
|
182
|
+
...parts.root.attrs,
|
|
183
|
+
disabled,
|
|
184
|
+
"data-disabled": dataAttr(!!disabled),
|
|
185
|
+
"data-invalid": dataAttr(invalid),
|
|
186
|
+
"aria-labelledby": legendId,
|
|
187
|
+
"aria-describedby": describedBy
|
|
188
|
+
});
|
|
189
|
+
const getLegendProps = () => ({
|
|
190
|
+
id: legendId,
|
|
191
|
+
...parts.legend.attrs,
|
|
192
|
+
"data-disabled": dataAttr(!!disabled),
|
|
193
|
+
"data-invalid": dataAttr(invalid)
|
|
194
|
+
});
|
|
195
|
+
const getHelperTextProps = () => ({
|
|
196
|
+
id: helperTextId,
|
|
197
|
+
...parts.helperText.attrs
|
|
198
|
+
});
|
|
199
|
+
const getErrorTextProps = () => ({
|
|
200
|
+
id: errorTextId,
|
|
201
|
+
...parts.errorText.attrs,
|
|
202
|
+
"aria-live": "polite"
|
|
203
|
+
});
|
|
204
|
+
return {
|
|
205
|
+
refs: { rootRef },
|
|
206
|
+
ids: {
|
|
207
|
+
legend: legendId,
|
|
208
|
+
errorText: errorTextId,
|
|
209
|
+
helperText: helperTextId
|
|
210
|
+
},
|
|
211
|
+
disabled,
|
|
212
|
+
invalid,
|
|
213
|
+
getRootProps,
|
|
214
|
+
getLegendProps,
|
|
215
|
+
getHelperTextProps,
|
|
216
|
+
getErrorTextProps
|
|
217
|
+
};
|
|
218
|
+
});
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
//#endregion
|
|
222
|
+
//#region src/components/fieldset/fieldset-root.vue?vue&type=script&setup=true&lang.ts
|
|
223
|
+
var fieldset_root_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
224
|
+
__name: "fieldset-root",
|
|
225
|
+
props: /* @__PURE__ */ mergeDefaults({
|
|
226
|
+
disabled: {
|
|
227
|
+
type: [Boolean, String],
|
|
228
|
+
required: false
|
|
229
|
+
},
|
|
230
|
+
id: {
|
|
231
|
+
type: String,
|
|
232
|
+
required: false
|
|
233
|
+
},
|
|
234
|
+
invalid: {
|
|
235
|
+
type: Boolean,
|
|
236
|
+
required: false
|
|
237
|
+
},
|
|
238
|
+
asChild: {
|
|
239
|
+
type: Boolean,
|
|
240
|
+
required: false
|
|
241
|
+
}
|
|
242
|
+
}, {
|
|
243
|
+
disabled: void 0,
|
|
244
|
+
invalid: void 0
|
|
245
|
+
}),
|
|
246
|
+
setup(__props) {
|
|
247
|
+
const fieldset = useFieldset(__props);
|
|
248
|
+
FieldsetProvider(fieldset);
|
|
249
|
+
useForwardExpose();
|
|
250
|
+
return (_ctx, _cache) => {
|
|
251
|
+
return openBlock(), createBlock(unref(sprawlify).fieldset, mergeProps(unref(fieldset).getRootProps(), {
|
|
252
|
+
ref: unref(fieldset).refs.rootRef,
|
|
253
|
+
"as-child": __props.asChild
|
|
254
|
+
}), {
|
|
255
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
256
|
+
_: 3
|
|
257
|
+
}, 16, ["as-child"]);
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
//#endregion
|
|
263
|
+
//#region src/components/fieldset/fieldset-root.vue
|
|
264
|
+
var fieldset_root_default = fieldset_root_vue_vue_type_script_setup_true_lang_default;
|
|
265
|
+
|
|
266
|
+
//#endregion
|
|
267
|
+
//#region src/components/fieldset/fieldset.ts
|
|
268
|
+
var fieldset_exports = /* @__PURE__ */ __exportAll({
|
|
269
|
+
Context: () => fieldset_context_default,
|
|
270
|
+
ErrorText: () => fieldset_error_text_default,
|
|
271
|
+
HelperText: () => fieldset_helper_text_default,
|
|
272
|
+
Legend: () => fieldset_legend_default,
|
|
273
|
+
Root: () => fieldset_root_default,
|
|
274
|
+
RootProvider: () => fieldset_root_provider_default
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
//#endregion
|
|
278
|
+
export { fieldset_root_provider_default as a, fieldset_error_text_default as c, fieldsetAnatomy as i, fieldset_context_default as l, fieldset_root_default as n, fieldset_legend_default as o, useFieldset as r, fieldset_helper_text_default as s, fieldset_exports as t, useFieldsetContext as u };
|
|
@@ -19,12 +19,4 @@ declare const normalizeProps$1: _sprawlify_primitives_types0.NormalizeProps<Prop
|
|
|
19
19
|
type MaybeRef$1<T> = T | Ref<T> | ComputedRef<T>;
|
|
20
20
|
declare function useMachine<T extends MachineSchema>(machine: Machine<T>, userProps?: MaybeRef$1<Partial<T["props"]>>): Service<T>;
|
|
21
21
|
//#endregion
|
|
22
|
-
|
|
23
|
-
type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
|
|
24
|
-
type Assign<T, U> = Omit<T, keyof U> & U;
|
|
25
|
-
type EmitFn<T> = <K extends keyof T>(event: K, ...args: T[K] extends any[] ? T[K] : never) => void;
|
|
26
|
-
type BooleanKey<T> = { [K in keyof T]: boolean extends NonNullable<T[K]> ? K : never }[keyof T];
|
|
27
|
-
type BooleanDefaults<T> = { [K in BooleanKey<T>]: undefined };
|
|
28
|
-
type MaybePromise<T> = T | Promise<T>;
|
|
29
|
-
//#endregion
|
|
30
|
-
export { Optional as a, PropTypes as c, MaybePromise as i, normalizeProps$1 as l, BooleanDefaults as n, mergeProps$1 as o, EmitFn as r, useMachine as s, Assign as t };
|
|
22
|
+
export { normalizeProps$1 as i, useMachine as n, PropTypes as r, mergeProps$1 as t };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import * as vue713 from "vue";
|
|
2
|
+
import { ComponentPublicInstance, ComputedRef, MaybeRef, MaybeRefOrGetter, UnwrapRef } from "vue";
|
|
3
|
+
import { FilterOptions, FilterReturn, Locale } from "@sprawlify/primitives/i18n-utils";
|
|
4
|
+
|
|
5
|
+
//#region src/providers/environment/use-environment-context.d.ts
|
|
6
|
+
type RootNode = ShadowRoot | Document | Node;
|
|
7
|
+
interface UseEnvironmentContext {
|
|
8
|
+
/**
|
|
9
|
+
* The root node of the application.
|
|
10
|
+
* This is used to determine the window and document objects.
|
|
11
|
+
*/
|
|
12
|
+
getRootNode(): RootNode;
|
|
13
|
+
/**
|
|
14
|
+
* The document context for the root node.
|
|
15
|
+
*/
|
|
16
|
+
getDocument(): Document;
|
|
17
|
+
/**
|
|
18
|
+
* The window context for the root node.
|
|
19
|
+
*/
|
|
20
|
+
getWindow(): Window & typeof globalThis;
|
|
21
|
+
}
|
|
22
|
+
declare const DEFAULT_ENVIRONMENT: ComputedRef<UseEnvironmentContext>;
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/providers/environment/environment-provider.vue.d.ts
|
|
25
|
+
interface EnvironmentProviderProps {
|
|
26
|
+
value?: RootNode | (() => RootNode);
|
|
27
|
+
}
|
|
28
|
+
declare var __VLS_1: {};
|
|
29
|
+
type __VLS_Slots = {} & {
|
|
30
|
+
default?: (props: typeof __VLS_1) => any;
|
|
31
|
+
};
|
|
32
|
+
declare const __VLS_base: vue713.DefineComponent<EnvironmentProviderProps, {}, {}, {}, {}, vue713.ComponentOptionsMixin, vue713.ComponentOptionsMixin, {}, string, vue713.PublicProps, Readonly<EnvironmentProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, vue713.ComponentProvideOptions, false, {}, any>;
|
|
33
|
+
declare const __VLS_export$1: __VLS_WithSlots$1<typeof __VLS_base, __VLS_Slots>;
|
|
34
|
+
declare const _default$1: typeof __VLS_export$1;
|
|
35
|
+
type __VLS_WithSlots$1<T, S> = T & {
|
|
36
|
+
new (): {
|
|
37
|
+
$slots: S;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/providers/locale/locale-provider.vue.d.ts
|
|
42
|
+
interface LocaleProviderProps {
|
|
43
|
+
locale: string;
|
|
44
|
+
}
|
|
45
|
+
declare const _default: typeof __VLS_export;
|
|
46
|
+
declare const __VLS_export: __VLS_WithSlots<vue713.DefineComponent<LocaleProviderProps, {}, {}, {}, {}, vue713.ComponentOptionsMixin, vue713.ComponentOptionsMixin, {}, string, vue713.PublicProps, Readonly<LocaleProviderProps> & Readonly<{}>, {}, {}, {}, {}, string, vue713.ComponentProvideOptions, false, {}, any>, {
|
|
47
|
+
default?: (props: {}) => any;
|
|
48
|
+
}>;
|
|
49
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
50
|
+
new (): {
|
|
51
|
+
$slots: S;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/providers/locale/use-collator.d.ts
|
|
56
|
+
interface UseCollatorProps extends Intl.CollatorOptions {
|
|
57
|
+
locale?: string;
|
|
58
|
+
}
|
|
59
|
+
interface UseCollatorReturn extends ComputedRef<Intl.Collator> {}
|
|
60
|
+
declare function useCollator(propsOrFn?: MaybeRef<UseCollatorProps>): UseCollatorReturn;
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region src/providers/locale/use-filter.d.ts
|
|
63
|
+
interface UseFilterProps extends FilterOptions {}
|
|
64
|
+
declare function useFilter(props: UseFilterProps): UseFilterReturn;
|
|
65
|
+
interface UseFilterReturn extends ComputedRef<FilterReturn> {}
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/providers/locale/use-locale-context.d.ts
|
|
68
|
+
interface LocaleContext extends Locale {}
|
|
69
|
+
declare const DEFAULT_LOCALE: ComputedRef<LocaleContext>;
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region src/utils/create-context.d.ts
|
|
72
|
+
type CreateContextReturn<T> = [(opts: T) => void, (fallback?: T) => T, symbol];
|
|
73
|
+
declare const createContext: <T>(id: string) => CreateContextReturn<T>;
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region src/utils/use-emits-as-props.d.ts
|
|
76
|
+
declare function useEmitAsProps<Name extends string>(emit: (name: Name, ...args: any[]) => void): Record<string, any>;
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/utils/use-forward-expose.d.ts
|
|
79
|
+
declare function useForwardExpose(): {
|
|
80
|
+
forwardRef: (ref: Element | ComponentPublicInstance | null) => void;
|
|
81
|
+
currentRef: vue713.Ref<Element | ComponentPublicInstance | null | undefined, Element | ComponentPublicInstance | null | undefined>;
|
|
82
|
+
currentElement: vue713.ComputedRef<HTMLElement>;
|
|
83
|
+
};
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region src/utils/use-forward-props.d.ts
|
|
86
|
+
declare function useForwardProps<T extends MaybeRefOrGetter<Record<string, any>>, U extends UnwrapRef<T>>(props: T): vue713.ComputedRef<U>;
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region src/utils/use-forward-props-emits.d.ts
|
|
89
|
+
declare function useForwardPropsEmits<T extends Parameters<typeof useForwardProps>[0], Name extends string>(props: T, emit?: (name: Name, ...args: any[]) => void): vue713.ComputedRef<any>;
|
|
90
|
+
//#endregion
|
|
91
|
+
export { useEnvironmentContext as S, EnvironmentProviderProps as _, createContext as a, RootNode as b, useLocaleContext as c, useFilter as d, UseCollatorProps as f, _default as g, LocaleProviderProps as h, useEmitAsProps as i, UseFilterProps as l, useCollator as m, useForwardProps as n, DEFAULT_LOCALE as o, UseCollatorReturn as p, useForwardExpose as r, LocaleContext as s, useForwardPropsEmits as t, UseFilterReturn as u, _default$1 as v, UseEnvironmentContext as x, DEFAULT_ENVIRONMENT as y };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { t as PolymorphicProps } from "./factory-D_ge_w76.js";
|
|
2
|
+
import { n as RootProps, t as RootEmits } from "./presence-types-Bv1E60Cw.js";
|
|
3
|
+
import { a as Optional, r as EmitFn$1 } from "./types-Bj-dS2Hc.js";
|
|
4
|
+
import * as vue718 from "vue";
|
|
5
|
+
import { HTMLAttributes, MaybeRef } from "vue";
|
|
6
|
+
import * as presence from "@sprawlify/primitives/machines/presence";
|
|
7
|
+
|
|
8
|
+
//#region src/components/presence/presence.vue.d.ts
|
|
9
|
+
interface PresenceBaseProps extends RootProps, PolymorphicProps {}
|
|
10
|
+
interface PresenceProps extends PresenceBaseProps,
|
|
11
|
+
/**
|
|
12
|
+
* @vue-ignore
|
|
13
|
+
*/
|
|
14
|
+
HTMLAttributes {}
|
|
15
|
+
interface PresenceEmits extends RootEmits {}
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
declare const __VLS_export: __VLS_WithSlots<vue718.DefineComponent<PresenceProps, {}, {}, {}, {}, vue718.ComponentOptionsMixin, vue718.ComponentOptionsMixin, {
|
|
18
|
+
exitComplete: () => any;
|
|
19
|
+
}, string, vue718.PublicProps, Readonly<PresenceProps> & Readonly<{
|
|
20
|
+
onExitComplete?: (() => any) | undefined;
|
|
21
|
+
}>, {
|
|
22
|
+
lazyMount: boolean;
|
|
23
|
+
unmountOnExit: boolean;
|
|
24
|
+
present: boolean;
|
|
25
|
+
immediate: boolean;
|
|
26
|
+
skipAnimationOnMount: boolean;
|
|
27
|
+
}, {}, {}, {}, string, vue718.ComponentProvideOptions, false, {}, any>, {
|
|
28
|
+
default?: (props: {}) => any;
|
|
29
|
+
}>;
|
|
30
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
31
|
+
new (): {
|
|
32
|
+
$slots: S;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/components/presence/use-presence.d.ts
|
|
37
|
+
interface UsePresenceProps extends Optional<presence.Props, 'present'> {
|
|
38
|
+
lazyMount?: boolean;
|
|
39
|
+
unmountOnExit?: boolean;
|
|
40
|
+
skipAnimationOnMount?: boolean;
|
|
41
|
+
}
|
|
42
|
+
type UsePresenceReturn = ReturnType<typeof usePresence>;
|
|
43
|
+
declare const usePresence: (props: MaybeRef<UsePresenceProps>, emit?: EmitFn$1<RootEmits>) => vue718.ComputedRef<{
|
|
44
|
+
present: boolean;
|
|
45
|
+
unmounted: boolean | undefined;
|
|
46
|
+
presenceProps: {
|
|
47
|
+
ref: vue718.Ref<any, any>;
|
|
48
|
+
hidden: boolean;
|
|
49
|
+
'data-state': string | undefined;
|
|
50
|
+
};
|
|
51
|
+
}>;
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/components/presence/use-presence-context.d.ts
|
|
54
|
+
interface UsePresenceContext extends UsePresenceReturn {}
|
|
55
|
+
declare const PresenceProvider: (opts: UsePresenceContext) => void, usePresenceContext: (fallback?: UsePresenceContext | undefined) => UsePresenceContext;
|
|
56
|
+
//#endregion
|
|
57
|
+
export { UsePresenceReturn as a, PresenceProps as c, UsePresenceProps as i, _default as l, UsePresenceContext as n, usePresence as o, usePresenceContext as r, PresenceEmits as s, PresenceProvider as t };
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { ComputedRef, MaybeRef, Ref } from "vue";
|
|
2
|
+
import { CollectionItem, CollectionItem as CollectionItem$1, CollectionOptions, FilePathTreeNode, FilePathTreeNode as FilePathTreeNode$1, FlatTreeNode, GridCollection as GridCollection$1, GridCollectionOptions, ListCollection as ListCollection$1, SelectionMode, TreeCollection, TreeCollection as TreeCollection$1, TreeCollectionOptions, TreeCollectionOptions as TreeCollectionOptions$1, TreeNode, TreeNode as TreeNode$1 } from "@sprawlify/primitives/collection";
|
|
3
|
+
import * as asyncList from "@sprawlify/primitives/machines/async-list";
|
|
4
|
+
|
|
5
|
+
//#region src/components/collection/grid-collection.d.ts
|
|
6
|
+
declare const createGridCollection: <T extends CollectionItem$1>(options: GridCollectionOptions<T>) => GridCollection$1<T>;
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/components/collection/list-collection.d.ts
|
|
9
|
+
declare const createListCollection: <T extends CollectionItem>(options: CollectionOptions<T>) => ListCollection$1<T>;
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/components/collection/tree-collection.d.ts
|
|
12
|
+
declare const createTreeCollection: <T extends TreeNode>(options: TreeCollectionOptions<T>) => TreeCollection<T>;
|
|
13
|
+
declare const createFileTreeCollection: (paths: string[]) => TreeCollection<FilePathTreeNode>;
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/components/collection/use-async-list.d.ts
|
|
16
|
+
interface UseAsyncListProps<T, C = string> extends asyncList.Props<T, C> {}
|
|
17
|
+
interface UseAsyncListReturn<T, C = string> extends ComputedRef<asyncList.Api<T, C>> {}
|
|
18
|
+
declare const useAsyncList: <T, C = string>(props?: MaybeRef<UseAsyncListProps<T, C>>) => UseAsyncListReturn<T, C>;
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/components/collection/use-list-collection.d.ts
|
|
21
|
+
interface UseListCollectionProps<T> extends Omit<CollectionOptions<T>, 'items'> {
|
|
22
|
+
/**
|
|
23
|
+
* The initial items to display in the collection.
|
|
24
|
+
*/
|
|
25
|
+
initialItems: T[] | readonly T[];
|
|
26
|
+
/**
|
|
27
|
+
* The filter function to use to filter the items.
|
|
28
|
+
*/
|
|
29
|
+
filter?: (itemText: string, filterText: string, item: T) => boolean;
|
|
30
|
+
/**
|
|
31
|
+
* The maximum number of items to display in the collection.
|
|
32
|
+
* Useful for performance when you have a large number of items.
|
|
33
|
+
*/
|
|
34
|
+
limit?: number;
|
|
35
|
+
}
|
|
36
|
+
declare function useListCollection<T>(props: MaybeRef<UseListCollectionProps<T>>): UseListCollectionReturn<T>;
|
|
37
|
+
interface UseListCollectionReturn<T> {
|
|
38
|
+
/**
|
|
39
|
+
* The collection of items.
|
|
40
|
+
*/
|
|
41
|
+
collection: Ref<ListCollection$1<T>>;
|
|
42
|
+
/**
|
|
43
|
+
* The function to filter the items.
|
|
44
|
+
*/
|
|
45
|
+
filter: (inputValue: string) => void;
|
|
46
|
+
/**
|
|
47
|
+
* The function to set the items.
|
|
48
|
+
*/
|
|
49
|
+
set: (items: T[]) => void;
|
|
50
|
+
/**
|
|
51
|
+
* The function to reset the items.
|
|
52
|
+
*/
|
|
53
|
+
reset: () => void;
|
|
54
|
+
/**
|
|
55
|
+
* The function to clear the items.
|
|
56
|
+
*/
|
|
57
|
+
clear: () => void;
|
|
58
|
+
/**
|
|
59
|
+
* The function to insert items at a specific index.
|
|
60
|
+
*/
|
|
61
|
+
insert: (index: number, ...items: T[]) => void;
|
|
62
|
+
/**
|
|
63
|
+
* The function to insert items before a specific value.
|
|
64
|
+
*/
|
|
65
|
+
insertBefore: (value: string, ...items: T[]) => void;
|
|
66
|
+
/**
|
|
67
|
+
* The function to insert items after a specific value.
|
|
68
|
+
*/
|
|
69
|
+
insertAfter: (value: string, ...items: T[]) => void;
|
|
70
|
+
/**
|
|
71
|
+
* The function to remove items.
|
|
72
|
+
*/
|
|
73
|
+
remove: (...itemOrValues: Array<T | string>) => void;
|
|
74
|
+
/**
|
|
75
|
+
* The function to move an item to a specific index.
|
|
76
|
+
*/
|
|
77
|
+
move: (value: string, to: number) => void;
|
|
78
|
+
/**
|
|
79
|
+
* The function to move an item before a specific value.
|
|
80
|
+
*/
|
|
81
|
+
moveBefore: (value: string, ...values: string[]) => void;
|
|
82
|
+
/**
|
|
83
|
+
* The function to move an item after a specific value.
|
|
84
|
+
*/
|
|
85
|
+
moveAfter: (value: string, ...values: string[]) => void;
|
|
86
|
+
/**
|
|
87
|
+
* The function to reorder items.
|
|
88
|
+
*/
|
|
89
|
+
reorder: (from: number, to: number) => void;
|
|
90
|
+
/**
|
|
91
|
+
* The function to append items.
|
|
92
|
+
*/
|
|
93
|
+
append: (...items: T[]) => void;
|
|
94
|
+
/**
|
|
95
|
+
* The function to upsert an item.
|
|
96
|
+
*/
|
|
97
|
+
upsert: (value: string, item: T, mode?: 'append' | 'prepend') => void;
|
|
98
|
+
/**
|
|
99
|
+
* The function to prepend items.
|
|
100
|
+
*/
|
|
101
|
+
prepend: (...items: T[]) => void;
|
|
102
|
+
/**
|
|
103
|
+
* The function to update an item.
|
|
104
|
+
*/
|
|
105
|
+
update: (value: string, item: T) => void;
|
|
106
|
+
}
|
|
107
|
+
//#endregion
|
|
108
|
+
//#region src/components/collection/use-list-selection.d.ts
|
|
109
|
+
interface UseListSelectionProps<T extends CollectionItem> {
|
|
110
|
+
/**
|
|
111
|
+
* The selection mode.
|
|
112
|
+
*/
|
|
113
|
+
selectionMode?: SelectionMode;
|
|
114
|
+
/**
|
|
115
|
+
* Whether the selection is deselectable.
|
|
116
|
+
*/
|
|
117
|
+
deselectable?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* The initial selected values.
|
|
120
|
+
*/
|
|
121
|
+
initialSelectedValues?: string[];
|
|
122
|
+
/**
|
|
123
|
+
* Whether to reset the selection when the collection changes.
|
|
124
|
+
*/
|
|
125
|
+
resetOnCollectionChange?: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* The collection to use.
|
|
128
|
+
*/
|
|
129
|
+
collection: ListCollection$1<T>;
|
|
130
|
+
}
|
|
131
|
+
declare function useListSelection<T extends CollectionItem>(props: MaybeRef<UseListSelectionProps<T>>): UseListSelectionReturn;
|
|
132
|
+
interface UseListSelectionReturn {
|
|
133
|
+
/**
|
|
134
|
+
* The selected values as an array.
|
|
135
|
+
*/
|
|
136
|
+
selectedValues: Ref<string[]>;
|
|
137
|
+
/**
|
|
138
|
+
* Whether the selection is empty.
|
|
139
|
+
*/
|
|
140
|
+
isEmpty: Ref<boolean>;
|
|
141
|
+
/**
|
|
142
|
+
* The first selected value.
|
|
143
|
+
*/
|
|
144
|
+
firstSelectedValue: Ref<string | null>;
|
|
145
|
+
/**
|
|
146
|
+
* The last selected value.
|
|
147
|
+
*/
|
|
148
|
+
lastSelectedValue: Ref<string | null>;
|
|
149
|
+
/**
|
|
150
|
+
* Check if a value is selected.
|
|
151
|
+
*/
|
|
152
|
+
isSelected: (value: string | null) => boolean;
|
|
153
|
+
/**
|
|
154
|
+
* Check if a value can be selected.
|
|
155
|
+
*/
|
|
156
|
+
canSelect: (value: string) => boolean;
|
|
157
|
+
/**
|
|
158
|
+
* Select a value.
|
|
159
|
+
*/
|
|
160
|
+
select: (value: string, forceToggle?: boolean) => void;
|
|
161
|
+
/**
|
|
162
|
+
* Deselect a value.
|
|
163
|
+
*/
|
|
164
|
+
deselect: (value: string) => void;
|
|
165
|
+
/**
|
|
166
|
+
* Toggle selection of a value.
|
|
167
|
+
*/
|
|
168
|
+
toggle: (value: string) => void;
|
|
169
|
+
/**
|
|
170
|
+
* Replace the selection with a single value.
|
|
171
|
+
*/
|
|
172
|
+
replace: (value: string | null) => void;
|
|
173
|
+
/**
|
|
174
|
+
* Extend the selection from anchor to target.
|
|
175
|
+
*/
|
|
176
|
+
extend: (anchorValue: string, targetValue: string) => void;
|
|
177
|
+
/**
|
|
178
|
+
* Set the selected values.
|
|
179
|
+
*/
|
|
180
|
+
setSelectedValues: (values: string[]) => void;
|
|
181
|
+
/**
|
|
182
|
+
* Clear the selection.
|
|
183
|
+
*/
|
|
184
|
+
clear: () => void;
|
|
185
|
+
/**
|
|
186
|
+
* Clear all selections.
|
|
187
|
+
*/
|
|
188
|
+
resetSelection: () => void;
|
|
189
|
+
/**
|
|
190
|
+
* Returns true if all items from the collection are selected.
|
|
191
|
+
*/
|
|
192
|
+
isAllSelected: () => boolean;
|
|
193
|
+
/**
|
|
194
|
+
* Returns true if at least one item from the collection is selected.
|
|
195
|
+
*/
|
|
196
|
+
isSomeSelected: () => boolean;
|
|
197
|
+
}
|
|
198
|
+
//#endregion
|
|
199
|
+
export { createGridCollection as C, GridCollectionOptions as S, CollectionItem as _, UseListCollectionReturn as a, createListCollection as b, UseAsyncListReturn as c, FlatTreeNode as d, TreeCollection$1 as f, createTreeCollection as g, createFileTreeCollection as h, UseListCollectionProps as i, useAsyncList as l, TreeNode$1 as m, UseListSelectionReturn as n, useListCollection as o, TreeCollectionOptions$1 as p, useListSelection as r, UseAsyncListProps as s, UseListSelectionProps as t, FilePathTreeNode$1 as u, CollectionOptions as v, GridCollection$1 as x, ListCollection$1 as y };
|