@sprawlify/vue 0.0.106 → 0.0.108
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/{alert-dialog-anatomy-CxUYPzIq.d.ts → alert-dialog-anatomy-DSacTNC1.d.ts} +1 -1
- package/dist/{carousel-anatomy-oV_FEGcZ.d.ts → carousel-anatomy-DO7fGwTi.d.ts} +1 -1
- package/dist/{collapsible-wm-f_tLg.js → collapsible-CU8jdmsD.js} +4 -4
- package/dist/{collection-cCQbkbJc.js → collection-CMkl1XB0.js} +2 -2
- package/dist/{color-picker-anatomy-DYoNbWSo.d.ts → color-picker-anatomy-09BXGqLT.d.ts} +1 -1
- package/dist/{combobox-anatomy-DqU2HEkd.d.ts → combobox-anatomy-BqTvPmc0.d.ts} +1 -1
- package/dist/components/accordion/index.d.ts +8 -8
- package/dist/components/accordion/index.js +7 -7
- package/dist/components/alert-dialog/index.d.ts +14 -15
- package/dist/components/alert-dialog/index.js +6 -6
- package/dist/components/anatomy.d.ts +8 -8
- package/dist/components/angle-slider/index.d.ts +9 -9
- package/dist/components/angle-slider/index.js +4 -4
- package/dist/components/aspect-ratio/index.d.ts +2 -2
- package/dist/components/aspect-ratio/index.js +4 -4
- package/dist/components/avatar/index.d.ts +2 -2
- package/dist/components/avatar/index.js +4 -4
- package/dist/components/bottom-sheet/index.d.ts +7 -7
- package/dist/components/bottom-sheet/index.js +7 -7
- package/dist/components/carousel/index.d.ts +11 -11
- package/dist/components/carousel/index.js +4 -4
- package/dist/components/checkbox/index.d.ts +7 -7
- package/dist/components/checkbox/index.js +7 -7
- package/dist/components/clipboard/index.d.ts +6 -6
- package/dist/components/clipboard/index.js +4 -4
- package/dist/components/collapsible/index.d.ts +3 -3
- package/dist/components/collapsible/index.js +4 -4
- package/dist/components/collection/index.d.ts +1 -1
- package/dist/components/collection/index.js +2 -2
- package/dist/components/color-picker/index.d.ts +18 -18
- package/dist/components/color-picker/index.js +7 -7
- package/dist/components/combobox/index.d.ts +20 -20
- package/dist/components/combobox/index.js +8 -8
- package/dist/components/date-picker/index.d.ts +18 -15
- package/dist/components/date-picker/index.js +16 -7
- package/dist/components/dialog/index.d.ts +14 -15
- package/dist/components/dialog/index.js +6 -6
- package/dist/components/download-trigger/index.d.ts +1 -1
- package/dist/components/download-trigger/index.js +3 -3
- package/dist/components/dropdown-menu/index.d.ts +23 -23
- package/dist/components/dropdown-menu/index.js +6 -6
- package/dist/components/editable/index.d.ts +16 -16
- package/dist/components/editable/index.js +5 -5
- package/dist/components/field/index.d.ts +31 -31
- package/dist/components/field/index.js +4 -4
- package/dist/components/fieldset/index.d.ts +5 -5
- package/dist/components/fieldset/index.js +4 -4
- package/dist/components/file-upload/index.d.ts +5 -5
- package/dist/components/file-upload/index.js +5 -5
- package/dist/components/floating-panel/index.d.ts +10 -10
- package/dist/components/floating-panel/index.js +5 -5
- package/dist/components/focus-trap/index.d.ts +2 -2
- package/dist/components/focus-trap/index.js +3 -3
- package/dist/components/format/index.d.ts +7 -7
- package/dist/components/format/index.js +1 -1
- package/dist/components/frame/index.js +1 -1
- package/dist/components/highlight/index.js +1 -1
- package/dist/components/hover-card/index.d.ts +10 -10
- package/dist/components/hover-card/index.js +6 -6
- package/dist/components/image-cropper/index.d.ts +7 -7
- package/dist/components/image-cropper/index.js +4 -4
- package/dist/components/json-tree-view/index.d.ts +3 -3
- package/dist/components/json-tree-view/index.js +8 -8
- package/dist/components/listbox/index.d.ts +7 -7
- package/dist/components/listbox/index.js +5 -5
- package/dist/components/marquee/index.d.ts +3 -3
- package/dist/components/marquee/index.js +4 -4
- package/dist/components/navigation-menu/index.d.ts +8 -8
- package/dist/components/navigation-menu/index.js +6 -6
- package/dist/components/number-input/index.d.ts +11 -11
- package/dist/components/number-input/index.js +5 -5
- package/dist/components/pagination/index.d.ts +8 -8
- package/dist/components/pagination/index.js +4 -4
- package/dist/components/password-input/index.d.ts +6 -6
- package/dist/components/password-input/index.js +5 -5
- package/dist/components/pin-input/index.d.ts +10 -10
- package/dist/components/pin-input/index.js +5 -5
- package/dist/components/popover/index.d.ts +12 -12
- package/dist/components/popover/index.js +6 -6
- package/dist/components/presence/index.d.ts +1 -1
- package/dist/components/presence/index.js +3 -3
- package/dist/components/progress/index.d.ts +5 -5
- package/dist/components/progress/index.js +4 -4
- package/dist/components/qr-code/index.d.ts +4 -4
- package/dist/components/qr-code/index.js +4 -4
- package/dist/components/radio-group/index.d.ts +6 -6
- package/dist/components/radio-group/index.js +6 -6
- package/dist/components/rating-group/index.d.ts +8 -8
- package/dist/components/rating-group/index.js +5 -5
- package/dist/components/scroll-area/index.d.ts +3 -3
- package/dist/components/scroll-area/index.js +4 -4
- package/dist/components/segment-group/index.d.ts +6 -6
- package/dist/components/segment-group/index.js +4 -4
- package/dist/components/select/index.d.ts +14 -14
- package/dist/components/select/index.js +8 -8
- package/dist/components/separator/index.d.ts +2 -2
- package/dist/components/separator/index.js +4 -4
- package/dist/components/signature-pad/index.d.ts +4 -4
- package/dist/components/signature-pad/index.js +5 -5
- package/dist/components/slider/index.d.ts +16 -16
- package/dist/components/slider/index.js +4 -4
- package/dist/components/splitter/index.d.ts +8 -8
- package/dist/components/splitter/index.js +4 -4
- package/dist/components/steps/index.d.ts +4 -4
- package/dist/components/steps/index.js +4 -4
- package/dist/components/switch/index.d.ts +5 -5
- package/dist/components/switch/index.js +5 -5
- package/dist/components/tabs/index.d.ts +10 -10
- package/dist/components/tabs/index.js +6 -6
- package/dist/components/tags-input/index.d.ts +18 -18
- package/dist/components/tags-input/index.js +5 -5
- package/dist/components/timer/index.d.ts +2 -2
- package/dist/components/timer/index.js +4 -4
- package/dist/components/toast/index.d.ts +2 -2
- package/dist/components/toast/index.js +3 -3
- package/dist/components/toggle/index.d.ts +3 -3
- package/dist/components/toggle/index.js +3 -3
- package/dist/components/toggle-group/index.d.ts +6 -6
- package/dist/components/toggle-group/index.js +4 -4
- package/dist/components/tooltip/index.d.ts +4 -4
- package/dist/components/tooltip/index.js +6 -6
- package/dist/components/tour/index.d.ts +12 -12
- package/dist/components/tour/index.js +7 -7
- package/dist/components/tree-view/index.d.ts +2 -2
- package/dist/components/tree-view/index.js +7 -7
- package/dist/{core-BW88ya4i.js → core-DFdl8jS7.js} +1 -1
- package/dist/{date-picker-anatomy-nNssWoU2.d.ts → date-picker-anatomy-BpW_VPuT.d.ts} +1 -1
- package/dist/{factory-DNG1el63.js → factory-Bd0Y5x-7.js} +1 -1
- package/dist/{factory-bfEpUaB3.d.ts → factory-Go0oxO3B.d.ts} +1 -1
- package/dist/{field-C7VkjIIx.js → field-D3G8FJDB.js} +2 -2
- package/dist/{fieldset-OP0qxlKh.js → fieldset-DKOqYr6u.js} +2 -2
- package/dist/{index-CODK2VY0.d.ts → index-C7sz_n_w.d.ts} +8 -8
- package/dist/{index-aJnwDHff.d.ts → index-CYO47ggW.d.ts} +27 -1
- package/dist/{index-DuD8fQUF.d.ts → index-DK-1mwjg.d.ts} +2 -2
- package/dist/{index-B4l20i3i.d.ts → index-DUPPuJYr.d.ts} +4 -4
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -4
- package/dist/{listbox-anatomy-CP_1jra6.d.ts → listbox-anatomy-ov6dp5kT.d.ts} +1 -1
- package/dist/{presence-L1LxnRj5.js → presence-B6FmKP5l.js} +2 -2
- package/dist/providers-CicBbUXG.js +204 -0
- package/dist/{segment-group-anatomy-8sdDQVPl.d.ts → segment-group-anatomy-Cu3IiheY.d.ts} +1 -1
- package/dist/{tour-anatomy-CTaLz0Eb.d.ts → tour-anatomy-o5VZ2vDT.d.ts} +1 -1
- package/dist/{tree-view-D_hrmWRQ.js → tree-view-BMIatAXN.js} +7 -7
- package/package.json +9 -8
- package/dist/providers-Cm-xBdVY.js +0 -92
- /package/dist/{boolean-D3BnFnrK.js → boolean-ClZYREcr.js} +0 -0
- /package/dist/{clean-props-qyW2RH6G.js → clean-props-C5aydRx_.js} +0 -0
- /package/dist/{create-split-props-Cz6On1aq.js → create-split-props-D32I38aE.js} +0 -0
- /package/dist/{use-render-strategy-Cq147Bb0.js → use-render-strategy-QgtvU85q.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _sprawlify_primitives_anatomy0 from "@sprawlify/primitives/anatomy";
|
|
2
2
|
|
|
3
3
|
//#region src/components/date-picker/date-picker-anatomy.d.ts
|
|
4
|
-
declare const datePickerAnatomy: _sprawlify_primitives_anatomy0.AnatomyInstance<"input" | "label" | "table" | "view" | "trigger" | "
|
|
4
|
+
declare const datePickerAnatomy: _sprawlify_primitives_anatomy0.AnatomyInstance<"input" | "label" | "table" | "view" | "trigger" | "content" | "positioner" | "root" | "control" | "clearTrigger" | "nextTrigger" | "prevTrigger" | "valueText" | "monthSelect" | "presetTrigger" | "rangeText" | "tableBody" | "tableCell" | "tableCellTrigger" | "tableHead" | "tableHeader" | "tableRow" | "viewControl" | "viewTrigger" | "yearSelect">;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { datePickerAnatomy as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as mergeProps$1 } from "./core-
|
|
1
|
+
import { t as mergeProps$1 } from "./core-DFdl8jS7.js";
|
|
2
2
|
import { Fragment, cloneVNode, computed, defineComponent, getCurrentInstance, h, ref, toValue } from "vue";
|
|
3
3
|
//#region src/utils/unref-element.ts
|
|
4
4
|
function unrefElement(elRef) {
|
|
@@ -12,7 +12,7 @@ type AsChildComponent<Component extends ElementType, P extends Record<string, un
|
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
type HTMLPolymorphicComponents = { [E in DOMElements]: AsChildComponent<E> };
|
|
15
|
-
type HTMLPolymorphicProps<T extends ElementType> = Omit<ExtractPropTypes<T extends DOMElements ? IntrinsicElementAttributes[T] : T>,
|
|
15
|
+
type HTMLPolymorphicProps<T extends ElementType> = Omit<ExtractPropTypes<T extends DOMElements ? IntrinsicElementAttributes[T] : T>, "ref"> & {
|
|
16
16
|
asChild?: boolean;
|
|
17
17
|
};
|
|
18
18
|
type HTMLSprawlifyProps<T extends DOMElements> = HTMLPolymorphicProps<T>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./chunk-pbuEa-1d.js";
|
|
2
|
-
import { c as
|
|
2
|
+
import { c as DEFAULT_ENVIRONMENT, l as useEnvironmentContext } from "./providers-CicBbUXG.js";
|
|
3
3
|
import { t as createContext } from "./create-context-BqbKqBMN.js";
|
|
4
|
-
import { i as unrefElement, n as sprawlify, r as useForwardExpose } from "./factory-
|
|
4
|
+
import { i as unrefElement, n as sprawlify, r as useForwardExpose } from "./factory-Bd0Y5x-7.js";
|
|
5
5
|
import { n as parts } from "./field-anatomy-BloFzq7T.js";
|
|
6
6
|
import { computed, createBlock, createCommentVNode, createTextVNode, defineComponent, guardReactiveProps, mergeDefaults, mergeProps, normalizeProps, onBeforeUnmount, onMounted, openBlock, reactive, ref, renderSlot, toValue, unref, useId, withCtx } from "vue";
|
|
7
7
|
import { ariaAttr, dataAttr } from "@sprawlify/primitives/dom-query";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./chunk-pbuEa-1d.js";
|
|
2
|
-
import { c as
|
|
2
|
+
import { c as DEFAULT_ENVIRONMENT, l as useEnvironmentContext } from "./providers-CicBbUXG.js";
|
|
3
3
|
import { t as createContext } from "./create-context-BqbKqBMN.js";
|
|
4
|
-
import { i as unrefElement, n as sprawlify, r as useForwardExpose } from "./factory-
|
|
4
|
+
import { i as unrefElement, n as sprawlify, r as useForwardExpose } from "./factory-Bd0Y5x-7.js";
|
|
5
5
|
import { n as parts } from "./fieldset-anatomy-DBAg0hLg.js";
|
|
6
6
|
import { computed, createBlock, createCommentVNode, defineComponent, guardReactiveProps, mergeDefaults, mergeProps, normalizeProps, onBeforeUnmount, onMounted, openBlock, reactive, ref, renderSlot, toValue, unref, useId, withCtx } from "vue";
|
|
7
7
|
import { dataAttr } from "@sprawlify/primitives/dom-query";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as PolymorphicProps } from "./factory-
|
|
1
|
+
import { a as PolymorphicProps } from "./factory-Go0oxO3B.js";
|
|
2
2
|
import { a as Optional, r as EmitFn$1, t as Assign } from "./types-CcpL2F4P.js";
|
|
3
3
|
import { r as PropTypes } from "./index-ga2m_BD2.js";
|
|
4
4
|
import { t as RenderStrategyProps } from "./use-render-strategy-CIHTgh6L.js";
|
|
5
|
-
import { f as TreeCollection, m as TreeNode } from "./index-
|
|
5
|
+
import { f as TreeCollection, m as TreeNode } from "./index-DK-1mwjg.js";
|
|
6
6
|
import * as vue from "vue";
|
|
7
7
|
import { ComputedRef, HTMLAttributes, InputHTMLAttributes, MaybeRef, SlotsType, UnwrapRef } from "vue";
|
|
8
8
|
import * as treeView from "@sprawlify/primitives/machines/tree-view";
|
|
@@ -146,7 +146,7 @@ interface RootProps<T extends TreeNode> {
|
|
|
146
146
|
node(value: string): string;
|
|
147
147
|
}>;
|
|
148
148
|
selectedValue?: string[];
|
|
149
|
-
selectionMode?:
|
|
149
|
+
selectionMode?: "single" | "multiple";
|
|
150
150
|
typeahead?: boolean;
|
|
151
151
|
loadChildren?: (details: treeView.LoadChildrenDetails<T>) => Promise<T[]>;
|
|
152
152
|
canRename?: (node: T, indexPath: number[]) => boolean;
|
|
@@ -161,14 +161,14 @@ type RootEmits<T extends TreeNode> = {
|
|
|
161
161
|
renameStart: [details: treeView.RenameStartDetails<T>];
|
|
162
162
|
beforeRename: [details: treeView.RenameCompleteDetails];
|
|
163
163
|
renameComplete: [details: treeView.RenameCompleteDetails];
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
164
|
+
"update:expandedValue": [value: string[]];
|
|
165
|
+
"update:focusedValue": [value: string | null];
|
|
166
|
+
"update:selectedValue": [value: string[]];
|
|
167
|
+
"update:checkedValue": [value: string[]];
|
|
168
168
|
};
|
|
169
169
|
//#endregion
|
|
170
170
|
//#region src/components/tree-view/use-tree-view.d.ts
|
|
171
|
-
interface UseTreeViewProps<T extends TreeNode> extends Optional<Omit<treeView.Props,
|
|
171
|
+
interface UseTreeViewProps<T extends TreeNode> extends Optional<Omit<treeView.Props, "dir" | "getRootNode" | "collection">, "id"> {
|
|
172
172
|
/**
|
|
173
173
|
* The collection of tree nodes
|
|
174
174
|
*/
|
|
@@ -59,6 +59,32 @@ interface UseCollatorProps extends Intl.CollatorOptions {
|
|
|
59
59
|
interface UseCollatorReturn extends ComputedRef<Intl.Collator> {}
|
|
60
60
|
declare function useCollator(propsOrFn?: MaybeRef<UseCollatorProps>): UseCollatorReturn;
|
|
61
61
|
//#endregion
|
|
62
|
+
//#region ../../node_modules/.pnpm/@internationalized+date@3.12.0/node_modules/@internationalized/date/dist/types.d.ts
|
|
63
|
+
interface DateRangeFormatPart extends Intl.DateTimeFormatPart {
|
|
64
|
+
source: 'startRange' | 'endRange' | 'shared';
|
|
65
|
+
}
|
|
66
|
+
/** A wrapper around Intl.DateTimeFormat that fixes various browser bugs, and polyfills new features. */
|
|
67
|
+
declare class DateFormatter implements Intl.DateTimeFormat {
|
|
68
|
+
constructor(locale: string, options?: Intl.DateTimeFormatOptions);
|
|
69
|
+
/** Formats a date as a string according to the locale and format options passed to the constructor. */
|
|
70
|
+
format(value: Date): string;
|
|
71
|
+
/** Formats a date to an array of parts such as separators, numbers, punctuation, and more. */
|
|
72
|
+
formatToParts(value: Date): Intl.DateTimeFormatPart[];
|
|
73
|
+
/** Formats a date range as a string. */
|
|
74
|
+
formatRange(start: Date, end: Date): string;
|
|
75
|
+
/** Formats a date range as an array of parts. */
|
|
76
|
+
formatRangeToParts(start: Date, end: Date): DateRangeFormatPart[];
|
|
77
|
+
/** Returns the resolved formatting options based on the values passed to the constructor. */
|
|
78
|
+
resolvedOptions(): Intl.ResolvedDateTimeFormatOptions;
|
|
79
|
+
}
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/providers/locale/use-date-formatter.d.ts
|
|
82
|
+
interface UseDateFormatterProps extends Intl.DateTimeFormatOptions {
|
|
83
|
+
locale?: string;
|
|
84
|
+
}
|
|
85
|
+
interface UseDateFormatterReturn extends ComputedRef<DateFormatter> {}
|
|
86
|
+
declare function useDateFormatter(propsOrFn?: MaybeRef<UseDateFormatterProps>): UseDateFormatterReturn;
|
|
87
|
+
//#endregion
|
|
62
88
|
//#region src/providers/locale/use-filter.d.ts
|
|
63
89
|
interface UseFilterProps extends FilterOptions {}
|
|
64
90
|
declare function useFilter(props: UseFilterProps): UseFilterReturn;
|
|
@@ -88,4 +114,4 @@ declare function useForwardProps<T extends MaybeRefOrGetter<Record<string, any>>
|
|
|
88
114
|
//#region src/utils/use-forward-props-emits.d.ts
|
|
89
115
|
declare function useForwardPropsEmits<T extends Parameters<typeof useForwardProps>[0], Name extends string>(props: T, emit?: (name: Name, ...args: any[]) => void): vue.ComputedRef<any>;
|
|
90
116
|
//#endregion
|
|
91
|
-
export {
|
|
117
|
+
export { RootNode as C, DEFAULT_ENVIRONMENT as S, useEnvironmentContext as T, useCollator as _, createContext as a, EnvironmentProviderProps as b, useLocaleContext as c, useFilter as d, UseDateFormatterProps as f, UseCollatorReturn as g, UseCollatorProps as h, useEmitAsProps as i, UseFilterProps as l, useDateFormatter as m, useForwardProps as n, DEFAULT_LOCALE as o, UseDateFormatterReturn as p, useForwardExpose as r, LocaleContext as s, useForwardPropsEmits as t, UseFilterReturn as u, LocaleProviderProps as v, UseEnvironmentContext as w, _default$1 as x, _default as y };
|
|
@@ -18,7 +18,7 @@ interface UseAsyncListReturn<T, C = string> extends ComputedRef<asyncList.Api<T,
|
|
|
18
18
|
declare const useAsyncList: <T, C = string>(props?: MaybeRef<UseAsyncListProps<T, C>>) => UseAsyncListReturn<T, C>;
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region src/components/collection/use-list-collection.d.ts
|
|
21
|
-
interface UseListCollectionProps<T> extends Omit<CollectionOptions<T>,
|
|
21
|
+
interface UseListCollectionProps<T> extends Omit<CollectionOptions<T>, "items"> {
|
|
22
22
|
/**
|
|
23
23
|
* The initial items to display in the collection.
|
|
24
24
|
*/
|
|
@@ -94,7 +94,7 @@ interface UseListCollectionReturn<T> {
|
|
|
94
94
|
/**
|
|
95
95
|
* The function to upsert an item.
|
|
96
96
|
*/
|
|
97
|
-
upsert: (value: string, item: T, mode?:
|
|
97
|
+
upsert: (value: string, item: T, mode?: "append" | "prepend") => void;
|
|
98
98
|
/**
|
|
99
99
|
* The function to prepend items.
|
|
100
100
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as PolymorphicProps } from "./factory-
|
|
1
|
+
import { a as PolymorphicProps } from "./factory-Go0oxO3B.js";
|
|
2
2
|
import { n as RootProps, t as RootEmits } from "./presence-types-D-XuGmDH.js";
|
|
3
3
|
import { a as Optional, r as EmitFn$1 } from "./types-CcpL2F4P.js";
|
|
4
4
|
import * as vue from "vue";
|
|
@@ -21,8 +21,8 @@ declare const __VLS_export: __VLS_WithSlots<vue.DefineComponent<PresenceProps, {
|
|
|
21
21
|
}>, {
|
|
22
22
|
lazyMount: boolean;
|
|
23
23
|
unmountOnExit: boolean;
|
|
24
|
-
present: boolean;
|
|
25
24
|
immediate: boolean;
|
|
25
|
+
present: boolean;
|
|
26
26
|
skipAnimationOnMount: boolean;
|
|
27
27
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>, {
|
|
28
28
|
default?: (props: {}) => any;
|
|
@@ -34,7 +34,7 @@ type __VLS_WithSlots<T, S> = T & {
|
|
|
34
34
|
};
|
|
35
35
|
//#endregion
|
|
36
36
|
//#region src/components/presence/use-presence.d.ts
|
|
37
|
-
interface UsePresenceProps extends Optional<presence.Props,
|
|
37
|
+
interface UsePresenceProps extends Optional<presence.Props, "present"> {
|
|
38
38
|
lazyMount?: boolean;
|
|
39
39
|
unmountOnExit?: boolean;
|
|
40
40
|
skipAnimationOnMount?: boolean;
|
|
@@ -46,7 +46,7 @@ declare const usePresence: (props: MaybeRef<UsePresenceProps>, emit?: EmitFn$1<R
|
|
|
46
46
|
presenceProps: {
|
|
47
47
|
ref: vue.Ref<any, any>;
|
|
48
48
|
hidden: boolean;
|
|
49
|
-
|
|
49
|
+
"data-state": string | undefined;
|
|
50
50
|
};
|
|
51
51
|
}>;
|
|
52
52
|
//#endregion
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as PolymorphicProps, i as HTMLSprawlifyProps, n as HTMLPolymorphicComponents, o as jsxFactory, r as HTMLPolymorphicProps, s as sprawlify, t as AsChildComponent } from "./factory-
|
|
1
|
+
import { a as PolymorphicProps, i as HTMLSprawlifyProps, n as HTMLPolymorphicComponents, o as jsxFactory, r as HTMLPolymorphicProps, s as sprawlify, t as AsChildComponent } from "./factory-Go0oxO3B.js";
|
|
2
2
|
import { a as Optional, i as MaybePromise, n as BooleanDefaults, r as EmitFn, t as Assign } from "./types-CcpL2F4P.js";
|
|
3
3
|
import { i as normalizeProps, n as useMachine, r as PropTypes, t as mergeProps } from "./index-ga2m_BD2.js";
|
|
4
|
-
import { S as useEnvironmentContext, _ as
|
|
5
|
-
export { AsChildComponent, Assign, BooleanDefaults, DEFAULT_ENVIRONMENT, DEFAULT_LOCALE, EmitFn, _default as EnvironmentProvider, EnvironmentProviderProps, HTMLPolymorphicComponents, HTMLPolymorphicProps, HTMLSprawlifyProps, LocaleContext, _default$1 as LocaleProvider, LocaleProviderProps, MaybePromise, Optional, PolymorphicProps, PropTypes, RootNode, UseCollatorProps, UseCollatorReturn, UseEnvironmentContext, UseFilterProps, UseFilterReturn, createContext, jsxFactory, mergeProps, normalizeProps, sprawlify, useCollator, useEmitAsProps, useEnvironmentContext, useFilter, useForwardExpose, useForwardProps, useForwardPropsEmits, useLocaleContext, useMachine };
|
|
4
|
+
import { C as RootNode, S as DEFAULT_ENVIRONMENT, T as useEnvironmentContext, _ as useCollator, a as createContext, b as EnvironmentProviderProps, c as useLocaleContext, d as useFilter, f as UseDateFormatterProps, g as UseCollatorReturn, h as UseCollatorProps, i as useEmitAsProps, l as UseFilterProps, m as useDateFormatter, n as useForwardProps, o as DEFAULT_LOCALE, p as UseDateFormatterReturn, r as useForwardExpose, s as LocaleContext, t as useForwardPropsEmits, u as UseFilterReturn, v as LocaleProviderProps, w as UseEnvironmentContext, x as _default, y as _default$1 } from "./index-CYO47ggW.js";
|
|
5
|
+
export { AsChildComponent, Assign, BooleanDefaults, DEFAULT_ENVIRONMENT, DEFAULT_LOCALE, EmitFn, _default as EnvironmentProvider, EnvironmentProviderProps, HTMLPolymorphicComponents, HTMLPolymorphicProps, HTMLSprawlifyProps, LocaleContext, _default$1 as LocaleProvider, LocaleProviderProps, MaybePromise, Optional, PolymorphicProps, PropTypes, RootNode, UseCollatorProps, UseCollatorReturn, UseDateFormatterProps, UseDateFormatterReturn, UseEnvironmentContext, UseFilterProps, UseFilterReturn, createContext, jsxFactory, mergeProps, normalizeProps, sprawlify, useCollator, useDateFormatter, useEmitAsProps, useEnvironmentContext, useFilter, useForwardExpose, useForwardProps, useForwardPropsEmits, useLocaleContext, useMachine };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as useMachine, r as normalizeProps, t as mergeProps } from "./core-
|
|
2
|
-
import { a as
|
|
1
|
+
import { n as useMachine, r as normalizeProps, t as mergeProps } from "./core-DFdl8jS7.js";
|
|
2
|
+
import { a as DEFAULT_LOCALE, c as DEFAULT_ENVIRONMENT, i as locale_provider_default, l as useEnvironmentContext, n as useDateFormatter, o as useLocaleContext, r as useCollator, s as environment_provider_default, t as useFilter } from "./providers-CicBbUXG.js";
|
|
3
3
|
import { t as createContext } from "./create-context-BqbKqBMN.js";
|
|
4
4
|
import { n as useForwardProps, r as useEmitAsProps, t as useForwardPropsEmits } from "./utils-BL0VqhHN.js";
|
|
5
|
-
import { n as sprawlify, r as useForwardExpose, t as jsxFactory } from "./factory-
|
|
6
|
-
export { DEFAULT_ENVIRONMENT, DEFAULT_LOCALE, environment_provider_default as EnvironmentProvider, locale_provider_default as LocaleProvider, createContext, jsxFactory, mergeProps, normalizeProps, sprawlify, useCollator, useEmitAsProps, useEnvironmentContext, useFilter, useForwardExpose, useForwardProps, useForwardPropsEmits, useLocaleContext, useMachine };
|
|
5
|
+
import { n as sprawlify, r as useForwardExpose, t as jsxFactory } from "./factory-Bd0Y5x-7.js";
|
|
6
|
+
export { DEFAULT_ENVIRONMENT, DEFAULT_LOCALE, environment_provider_default as EnvironmentProvider, locale_provider_default as LocaleProvider, createContext, jsxFactory, mergeProps, normalizeProps, sprawlify, useCollator, useDateFormatter, useEmitAsProps, useEnvironmentContext, useFilter, useForwardExpose, useForwardProps, useForwardPropsEmits, useLocaleContext, useMachine };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _sprawlify_primitives_anatomy0 from "@sprawlify/primitives/anatomy";
|
|
2
2
|
|
|
3
3
|
//#region src/components/listbox/listbox-anatomy.d.ts
|
|
4
|
-
declare const listboxAnatomy: _sprawlify_primitives_anatomy0.AnatomyInstance<"input" | "label" | "content" | "root" | "
|
|
4
|
+
declare const listboxAnatomy: _sprawlify_primitives_anatomy0.AnatomyInstance<"input" | "label" | "content" | "root" | "item" | "itemIndicator" | "itemText" | "itemGroup" | "itemGroupLabel" | "empty" | "valueText">;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { listboxAnatomy as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as useMachine, r as normalizeProps$1 } from "./core-
|
|
1
|
+
import { n as useMachine, r as normalizeProps$1 } from "./core-DFdl8jS7.js";
|
|
2
2
|
import { t as createContext } from "./create-context-BqbKqBMN.js";
|
|
3
|
-
import { n as sprawlify, r as useForwardExpose } from "./factory-
|
|
3
|
+
import { n as sprawlify, r as useForwardExpose } from "./factory-Bd0Y5x-7.js";
|
|
4
4
|
import { computed, createBlock, createCommentVNode, defineComponent, mergeDefaults, mergeProps, openBlock, ref, renderSlot, toValue, unref, watch, withCtx } from "vue";
|
|
5
5
|
import * as presence from "@sprawlify/primitives/machines/presence";
|
|
6
6
|
//#region src/components/presence/use-presence.ts
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { t as createContext } from "./create-context-BqbKqBMN.js";
|
|
2
|
+
import { Fragment, computed, createCommentVNode, createElementBlock, defineComponent, openBlock, ref, renderSlot, toValue } from "vue";
|
|
3
|
+
import { getDocument, getWindow } from "@sprawlify/primitives/dom-query";
|
|
4
|
+
import { createCollator, createFilter, isRTL } from "@sprawlify/primitives/i18n-utils";
|
|
5
|
+
//#region src/utils/run-if-fn.ts
|
|
6
|
+
const isFunction = (value) => typeof value === "function";
|
|
7
|
+
const runIfFn = (valueOrFn, ...args) => isFunction(valueOrFn) ? valueOrFn(...args) : valueOrFn;
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/providers/environment/use-environment-context.ts
|
|
10
|
+
const [EnvironmentContextProvider, useEnvironmentContext] = createContext("EnvironmentContext");
|
|
11
|
+
const DEFAULT_ENVIRONMENT = computed(() => ({
|
|
12
|
+
getRootNode: () => document,
|
|
13
|
+
getDocument: () => document,
|
|
14
|
+
getWindow: () => window
|
|
15
|
+
}));
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/providers/environment/environment-provider.vue
|
|
18
|
+
var environment_provider_default = /* @__PURE__ */ defineComponent({
|
|
19
|
+
__name: "environment-provider",
|
|
20
|
+
props: { value: {
|
|
21
|
+
type: Function,
|
|
22
|
+
required: false,
|
|
23
|
+
skipCheck: true
|
|
24
|
+
} },
|
|
25
|
+
setup(__props) {
|
|
26
|
+
const props = __props;
|
|
27
|
+
const spanRef = ref(null);
|
|
28
|
+
const getRootNode = () => runIfFn(props.value) ?? spanRef.value?.getRootNode() ?? document;
|
|
29
|
+
EnvironmentContextProvider(computed(() => ({
|
|
30
|
+
getRootNode,
|
|
31
|
+
getDocument: () => getDocument(getRootNode()),
|
|
32
|
+
getWindow: () => getWindow(getRootNode())
|
|
33
|
+
})));
|
|
34
|
+
return (_ctx, _cache) => {
|
|
35
|
+
return openBlock(), createElementBlock(Fragment, null, [renderSlot(_ctx.$slots, "default"), !props.value ? (openBlock(), createElementBlock("span", {
|
|
36
|
+
key: 0,
|
|
37
|
+
hidden: "",
|
|
38
|
+
ref_key: "spanRef",
|
|
39
|
+
ref: spanRef
|
|
40
|
+
}, null, 512)) : createCommentVNode("v-if", true)], 64);
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/providers/locale/use-locale-context.ts
|
|
46
|
+
const DEFAULT_LOCALE = computed(() => ({
|
|
47
|
+
dir: "ltr",
|
|
48
|
+
locale: "en-US"
|
|
49
|
+
}));
|
|
50
|
+
const [LocaleContextProvider, useLocaleContext] = createContext("LocaleContext");
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/providers/locale/locale-provider.vue
|
|
53
|
+
var locale_provider_default = /* @__PURE__ */ defineComponent({
|
|
54
|
+
__name: "locale-provider",
|
|
55
|
+
props: { locale: {
|
|
56
|
+
type: String,
|
|
57
|
+
required: true
|
|
58
|
+
} },
|
|
59
|
+
setup(__props) {
|
|
60
|
+
const props = __props;
|
|
61
|
+
LocaleContextProvider(computed(() => ({
|
|
62
|
+
locale: props.locale,
|
|
63
|
+
dir: isRTL(props.locale) ? "rtl" : "ltr"
|
|
64
|
+
})));
|
|
65
|
+
return (_ctx, _cache) => {
|
|
66
|
+
return renderSlot(_ctx.$slots, "default");
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region src/providers/locale/use-collator.ts
|
|
72
|
+
function useCollator(propsOrFn = {}) {
|
|
73
|
+
const env = useLocaleContext();
|
|
74
|
+
return computed(() => {
|
|
75
|
+
const props = toValue(propsOrFn);
|
|
76
|
+
const locale = props.locale ?? env.value.locale;
|
|
77
|
+
const { locale: _, ...options } = props;
|
|
78
|
+
return createCollator(locale, options);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region ../../node_modules/.pnpm/@internationalized+date@3.12.0/node_modules/@internationalized/date/dist/DateFormatter.mjs
|
|
83
|
+
let $fb18d541ea1ad717$var$formatterCache = /* @__PURE__ */ new Map();
|
|
84
|
+
var $fb18d541ea1ad717$export$ad991b66133851cf = class {
|
|
85
|
+
/** Formats a date as a string according to the locale and format options passed to the constructor. */ format(value) {
|
|
86
|
+
return this.formatter.format(value);
|
|
87
|
+
}
|
|
88
|
+
/** Formats a date to an array of parts such as separators, numbers, punctuation, and more. */ formatToParts(value) {
|
|
89
|
+
return this.formatter.formatToParts(value);
|
|
90
|
+
}
|
|
91
|
+
/** Formats a date range as a string. */ formatRange(start, end) {
|
|
92
|
+
if (typeof this.formatter.formatRange === "function") return this.formatter.formatRange(start, end);
|
|
93
|
+
if (end < start) throw new RangeError("End date must be >= start date");
|
|
94
|
+
return `${this.formatter.format(start)} \u{2013} ${this.formatter.format(end)}`;
|
|
95
|
+
}
|
|
96
|
+
/** Formats a date range as an array of parts. */ formatRangeToParts(start, end) {
|
|
97
|
+
if (typeof this.formatter.formatRangeToParts === "function") return this.formatter.formatRangeToParts(start, end);
|
|
98
|
+
if (end < start) throw new RangeError("End date must be >= start date");
|
|
99
|
+
let startParts = this.formatter.formatToParts(start);
|
|
100
|
+
let endParts = this.formatter.formatToParts(end);
|
|
101
|
+
return [
|
|
102
|
+
...startParts.map((p) => ({
|
|
103
|
+
...p,
|
|
104
|
+
source: "startRange"
|
|
105
|
+
})),
|
|
106
|
+
{
|
|
107
|
+
type: "literal",
|
|
108
|
+
value: " – ",
|
|
109
|
+
source: "shared"
|
|
110
|
+
},
|
|
111
|
+
...endParts.map((p) => ({
|
|
112
|
+
...p,
|
|
113
|
+
source: "endRange"
|
|
114
|
+
}))
|
|
115
|
+
];
|
|
116
|
+
}
|
|
117
|
+
/** Returns the resolved formatting options based on the values passed to the constructor. */ resolvedOptions() {
|
|
118
|
+
let resolvedOptions = this.formatter.resolvedOptions();
|
|
119
|
+
if ($fb18d541ea1ad717$var$hasBuggyResolvedHourCycle()) {
|
|
120
|
+
if (!this.resolvedHourCycle) this.resolvedHourCycle = $fb18d541ea1ad717$var$getResolvedHourCycle(resolvedOptions.locale, this.options);
|
|
121
|
+
resolvedOptions.hourCycle = this.resolvedHourCycle;
|
|
122
|
+
resolvedOptions.hour12 = this.resolvedHourCycle === "h11" || this.resolvedHourCycle === "h12";
|
|
123
|
+
}
|
|
124
|
+
if (resolvedOptions.calendar === "ethiopic-amete-alem") resolvedOptions.calendar = "ethioaa";
|
|
125
|
+
return resolvedOptions;
|
|
126
|
+
}
|
|
127
|
+
constructor(locale, options = {}) {
|
|
128
|
+
this.formatter = $fb18d541ea1ad717$var$getCachedDateFormatter(locale, options);
|
|
129
|
+
this.options = options;
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
const $fb18d541ea1ad717$var$hour12Preferences = {
|
|
133
|
+
true: { ja: "h11" },
|
|
134
|
+
false: {}
|
|
135
|
+
};
|
|
136
|
+
function $fb18d541ea1ad717$var$getCachedDateFormatter(locale, options = {}) {
|
|
137
|
+
if (typeof options.hour12 === "boolean" && $fb18d541ea1ad717$var$hasBuggyHour12Behavior()) {
|
|
138
|
+
options = { ...options };
|
|
139
|
+
let pref = $fb18d541ea1ad717$var$hour12Preferences[String(options.hour12)][locale.split("-")[0]];
|
|
140
|
+
let defaultHourCycle = options.hour12 ? "h12" : "h23";
|
|
141
|
+
options.hourCycle = pref !== null && pref !== void 0 ? pref : defaultHourCycle;
|
|
142
|
+
delete options.hour12;
|
|
143
|
+
}
|
|
144
|
+
let cacheKey = locale + (options ? Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join() : "");
|
|
145
|
+
if ($fb18d541ea1ad717$var$formatterCache.has(cacheKey)) return $fb18d541ea1ad717$var$formatterCache.get(cacheKey);
|
|
146
|
+
let numberFormatter = new Intl.DateTimeFormat(locale, options);
|
|
147
|
+
$fb18d541ea1ad717$var$formatterCache.set(cacheKey, numberFormatter);
|
|
148
|
+
return numberFormatter;
|
|
149
|
+
}
|
|
150
|
+
let $fb18d541ea1ad717$var$_hasBuggyHour12Behavior = null;
|
|
151
|
+
function $fb18d541ea1ad717$var$hasBuggyHour12Behavior() {
|
|
152
|
+
if ($fb18d541ea1ad717$var$_hasBuggyHour12Behavior == null) $fb18d541ea1ad717$var$_hasBuggyHour12Behavior = new Intl.DateTimeFormat("en-US", {
|
|
153
|
+
hour: "numeric",
|
|
154
|
+
hour12: false
|
|
155
|
+
}).format(new Date(2020, 2, 3, 0)) === "24";
|
|
156
|
+
return $fb18d541ea1ad717$var$_hasBuggyHour12Behavior;
|
|
157
|
+
}
|
|
158
|
+
let $fb18d541ea1ad717$var$_hasBuggyResolvedHourCycle = null;
|
|
159
|
+
function $fb18d541ea1ad717$var$hasBuggyResolvedHourCycle() {
|
|
160
|
+
if ($fb18d541ea1ad717$var$_hasBuggyResolvedHourCycle == null) $fb18d541ea1ad717$var$_hasBuggyResolvedHourCycle = new Intl.DateTimeFormat("fr", {
|
|
161
|
+
hour: "numeric",
|
|
162
|
+
hour12: false
|
|
163
|
+
}).resolvedOptions().hourCycle === "h12";
|
|
164
|
+
return $fb18d541ea1ad717$var$_hasBuggyResolvedHourCycle;
|
|
165
|
+
}
|
|
166
|
+
function $fb18d541ea1ad717$var$getResolvedHourCycle(locale, options) {
|
|
167
|
+
if (!options.timeStyle && !options.hour) return void 0;
|
|
168
|
+
locale = locale.replace(/(-u-)?-nu-[a-zA-Z0-9]+/, "");
|
|
169
|
+
locale += (locale.includes("-u-") ? "" : "-u") + "-nu-latn";
|
|
170
|
+
let formatter = $fb18d541ea1ad717$var$getCachedDateFormatter(locale, {
|
|
171
|
+
...options,
|
|
172
|
+
timeZone: void 0
|
|
173
|
+
});
|
|
174
|
+
let min = parseInt(formatter.formatToParts(new Date(2020, 2, 3, 0)).find((p) => p.type === "hour").value, 10);
|
|
175
|
+
let max = parseInt(formatter.formatToParts(new Date(2020, 2, 3, 23)).find((p) => p.type === "hour").value, 10);
|
|
176
|
+
if (min === 0 && max === 23) return "h23";
|
|
177
|
+
if (min === 24 && max === 23) return "h24";
|
|
178
|
+
if (min === 0 && max === 11) return "h11";
|
|
179
|
+
if (min === 12 && max === 11) return "h12";
|
|
180
|
+
throw new Error("Unexpected hour cycle result");
|
|
181
|
+
}
|
|
182
|
+
//#endregion
|
|
183
|
+
//#region src/providers/locale/use-date-formatter.ts
|
|
184
|
+
function useDateFormatter(propsOrFn = {}) {
|
|
185
|
+
const env = useLocaleContext();
|
|
186
|
+
return computed(() => {
|
|
187
|
+
const props = toValue(propsOrFn);
|
|
188
|
+
const locale = props.locale ?? env.value.locale;
|
|
189
|
+
const { locale: _, ...options } = props;
|
|
190
|
+
return new $fb18d541ea1ad717$export$ad991b66133851cf(locale, options);
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
//#endregion
|
|
194
|
+
//#region src/providers/locale/use-filter.ts
|
|
195
|
+
function useFilter(props) {
|
|
196
|
+
const env = useLocaleContext(DEFAULT_LOCALE);
|
|
197
|
+
const locale = computed(() => props.locale ?? env.value.locale);
|
|
198
|
+
return computed(() => createFilter({
|
|
199
|
+
...props,
|
|
200
|
+
locale: locale.value
|
|
201
|
+
}));
|
|
202
|
+
}
|
|
203
|
+
//#endregion
|
|
204
|
+
export { DEFAULT_LOCALE as a, DEFAULT_ENVIRONMENT as c, locale_provider_default as i, useEnvironmentContext as l, useDateFormatter as n, useLocaleContext as o, useCollator as r, environment_provider_default as s, useFilter as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _sprawlify_primitives_anatomy0 from "@sprawlify/primitives/anatomy";
|
|
2
2
|
|
|
3
3
|
//#region src/components/segment-group/segment-group-anatomy.d.ts
|
|
4
|
-
declare const segmentGroupAnatomy: _sprawlify_primitives_anatomy0.Anatomy<"label" | "root" | "
|
|
4
|
+
declare const segmentGroupAnatomy: _sprawlify_primitives_anatomy0.Anatomy<"label" | "root" | "item" | "itemText" | "indicator" | "itemControl">;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { segmentGroupAnatomy as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _sprawlify_primitives_anatomy0 from "@sprawlify/primitives/anatomy";
|
|
2
2
|
|
|
3
3
|
//#region src/components/tour/tour-anatomy.d.ts
|
|
4
|
-
declare const tourAnatomy: _sprawlify_primitives_anatomy0.AnatomyInstance<"title" | "backdrop" | "
|
|
4
|
+
declare const tourAnatomy: _sprawlify_primitives_anatomy0.AnatomyInstance<"title" | "backdrop" | "content" | "closeTrigger" | "positioner" | "description" | "control" | "progressText" | "arrow" | "arrowTip" | "actionTrigger" | "spotlight">;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { tourAnatomy as t };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { t as __exportAll } from "./chunk-pbuEa-1d.js";
|
|
2
|
-
import { n as useMachine, r as normalizeProps$1 } from "./core-
|
|
3
|
-
import { a as
|
|
2
|
+
import { n as useMachine, r as normalizeProps$1 } from "./core-DFdl8jS7.js";
|
|
3
|
+
import { a as DEFAULT_LOCALE, c as DEFAULT_ENVIRONMENT, l as useEnvironmentContext, o as useLocaleContext } from "./providers-CicBbUXG.js";
|
|
4
4
|
import { t as createContext } from "./create-context-BqbKqBMN.js";
|
|
5
|
-
import { n as sprawlify, r as useForwardExpose } from "./factory-
|
|
6
|
-
import { t as
|
|
7
|
-
import {
|
|
8
|
-
import { t as createSplitProps } from "./create-split-props-
|
|
9
|
-
import { t as
|
|
5
|
+
import { n as sprawlify, r as useForwardExpose } from "./factory-Bd0Y5x-7.js";
|
|
6
|
+
import { t as collapsible_exports } from "./collapsible-CU8jdmsD.js";
|
|
7
|
+
import { t as cleanProps } from "./clean-props-C5aydRx_.js";
|
|
8
|
+
import { t as createSplitProps } from "./create-split-props-D32I38aE.js";
|
|
9
|
+
import { n as useRenderStrategyProps, t as RenderStrategyPropsProvider } from "./use-render-strategy-QgtvU85q.js";
|
|
10
10
|
import { computed, createBlock, defineComponent, guardReactiveProps, mergeDefaults, mergeProps, normalizeProps, openBlock, renderSlot, toValue, unref, useId, withCtx } from "vue";
|
|
11
11
|
import * as treeView from "@sprawlify/primitives/machines/tree-view";
|
|
12
12
|
//#region src/components/tree-view/use-tree-view-context.ts
|
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sprawlify/vue",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"type": "module",
|
|
3
|
+
"version": "0.0.108",
|
|
5
4
|
"description": "Vue wrapper for primitives.",
|
|
5
|
+
"license": "MIT",
|
|
6
6
|
"author": "sprawlify <npm@sprawlify.com>",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"type": "module",
|
|
7
11
|
"main": "./dist/index.js",
|
|
8
12
|
"module": "./dist/index.js",
|
|
9
13
|
"types": "./dist/index.d.ts",
|
|
@@ -261,14 +265,11 @@
|
|
|
261
265
|
"default": "./dist/components/tree-view/index.js"
|
|
262
266
|
}
|
|
263
267
|
},
|
|
264
|
-
"files": [
|
|
265
|
-
"dist"
|
|
266
|
-
],
|
|
267
268
|
"publishConfig": {
|
|
268
269
|
"access": "public"
|
|
269
270
|
},
|
|
270
271
|
"dependencies": {
|
|
271
|
-
"@sprawlify/primitives": "0.0.
|
|
272
|
+
"@sprawlify/primitives": "0.0.108"
|
|
272
273
|
},
|
|
273
274
|
"peerDependencies": {
|
|
274
275
|
"vue": ">=3.0.0"
|
|
@@ -276,10 +277,10 @@
|
|
|
276
277
|
"engines": {
|
|
277
278
|
"node": ">=24"
|
|
278
279
|
},
|
|
279
|
-
"license": "MIT",
|
|
280
280
|
"scripts": {
|
|
281
281
|
"build": "tsdown",
|
|
282
282
|
"typecheck": "vue-tsc --noEmit",
|
|
283
|
-
"lint": "
|
|
283
|
+
"lint": "oxlint --fix",
|
|
284
|
+
"format": "oxfmt"
|
|
284
285
|
}
|
|
285
286
|
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { t as createContext } from "./create-context-BqbKqBMN.js";
|
|
2
|
-
import { Fragment, computed, createCommentVNode, createElementBlock, defineComponent, openBlock, ref, renderSlot, toValue } from "vue";
|
|
3
|
-
import { getDocument, getWindow } from "@sprawlify/primitives/dom-query";
|
|
4
|
-
import { createCollator, createFilter, isRTL } from "@sprawlify/primitives/i18n-utils";
|
|
5
|
-
//#region src/utils/run-if-fn.ts
|
|
6
|
-
const isFunction = (value) => typeof value === "function";
|
|
7
|
-
const runIfFn = (valueOrFn, ...args) => isFunction(valueOrFn) ? valueOrFn(...args) : valueOrFn;
|
|
8
|
-
//#endregion
|
|
9
|
-
//#region src/providers/environment/use-environment-context.ts
|
|
10
|
-
const [EnvironmentContextProvider, useEnvironmentContext] = createContext("EnvironmentContext");
|
|
11
|
-
const DEFAULT_ENVIRONMENT = computed(() => ({
|
|
12
|
-
getRootNode: () => document,
|
|
13
|
-
getDocument: () => document,
|
|
14
|
-
getWindow: () => window
|
|
15
|
-
}));
|
|
16
|
-
//#endregion
|
|
17
|
-
//#region src/providers/environment/environment-provider.vue
|
|
18
|
-
var environment_provider_default = /* @__PURE__ */ defineComponent({
|
|
19
|
-
__name: "environment-provider",
|
|
20
|
-
props: { value: {
|
|
21
|
-
type: Function,
|
|
22
|
-
required: false,
|
|
23
|
-
skipCheck: true
|
|
24
|
-
} },
|
|
25
|
-
setup(__props) {
|
|
26
|
-
const props = __props;
|
|
27
|
-
const spanRef = ref(null);
|
|
28
|
-
const getRootNode = () => runIfFn(props.value) ?? spanRef.value?.getRootNode() ?? document;
|
|
29
|
-
EnvironmentContextProvider(computed(() => ({
|
|
30
|
-
getRootNode,
|
|
31
|
-
getDocument: () => getDocument(getRootNode()),
|
|
32
|
-
getWindow: () => getWindow(getRootNode())
|
|
33
|
-
})));
|
|
34
|
-
return (_ctx, _cache) => {
|
|
35
|
-
return openBlock(), createElementBlock(Fragment, null, [renderSlot(_ctx.$slots, "default"), !props.value ? (openBlock(), createElementBlock("span", {
|
|
36
|
-
key: 0,
|
|
37
|
-
hidden: "",
|
|
38
|
-
ref_key: "spanRef",
|
|
39
|
-
ref: spanRef
|
|
40
|
-
}, null, 512)) : createCommentVNode("v-if", true)], 64);
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
//#endregion
|
|
45
|
-
//#region src/providers/locale/use-locale-context.ts
|
|
46
|
-
const DEFAULT_LOCALE = computed(() => ({
|
|
47
|
-
dir: "ltr",
|
|
48
|
-
locale: "en-US"
|
|
49
|
-
}));
|
|
50
|
-
const [LocaleContextProvider, useLocaleContext] = createContext("LocaleContext");
|
|
51
|
-
//#endregion
|
|
52
|
-
//#region src/providers/locale/locale-provider.vue
|
|
53
|
-
var locale_provider_default = /* @__PURE__ */ defineComponent({
|
|
54
|
-
__name: "locale-provider",
|
|
55
|
-
props: { locale: {
|
|
56
|
-
type: String,
|
|
57
|
-
required: true
|
|
58
|
-
} },
|
|
59
|
-
setup(__props) {
|
|
60
|
-
const props = __props;
|
|
61
|
-
LocaleContextProvider(computed(() => ({
|
|
62
|
-
locale: props.locale,
|
|
63
|
-
dir: isRTL(props.locale) ? "rtl" : "ltr"
|
|
64
|
-
})));
|
|
65
|
-
return (_ctx, _cache) => {
|
|
66
|
-
return renderSlot(_ctx.$slots, "default");
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
//#endregion
|
|
71
|
-
//#region src/providers/locale/use-collator.ts
|
|
72
|
-
function useCollator(propsOrFn = {}) {
|
|
73
|
-
const env = useLocaleContext();
|
|
74
|
-
return computed(() => {
|
|
75
|
-
const props = toValue(propsOrFn);
|
|
76
|
-
const locale = props.locale ?? env.value.locale;
|
|
77
|
-
const { locale: _, ...options } = props;
|
|
78
|
-
return createCollator(locale, options);
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
//#endregion
|
|
82
|
-
//#region src/providers/locale/use-filter.ts
|
|
83
|
-
function useFilter(props) {
|
|
84
|
-
const env = useLocaleContext(DEFAULT_LOCALE);
|
|
85
|
-
const locale = computed(() => props.locale ?? env.value.locale);
|
|
86
|
-
return computed(() => createFilter({
|
|
87
|
-
...props,
|
|
88
|
-
locale: locale.value
|
|
89
|
-
}));
|
|
90
|
-
}
|
|
91
|
-
//#endregion
|
|
92
|
-
export { useLocaleContext as a, useEnvironmentContext as c, DEFAULT_LOCALE as i, useCollator as n, environment_provider_default as o, locale_provider_default as r, DEFAULT_ENVIRONMENT as s, useFilter as t };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|