@vuetify/nightly 3.9.2-master.2025-07-23 → 3.9.2-master.2025-07-25
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/CHANGELOG.md +15 -3
- package/dist/_component-variables-labs.sass +3 -1
- package/dist/json/attributes.json +4029 -3617
- package/dist/json/importMap-labs.json +38 -14
- package/dist/json/importMap.json +148 -148
- package/dist/json/tags.json +133 -0
- package/dist/json/web-types.json +13484 -11867
- package/dist/vuetify-labs.cjs +1525 -126
- package/dist/vuetify-labs.css +5448 -5007
- package/dist/vuetify-labs.d.ts +7670 -974
- package/dist/vuetify-labs.esm.js +1526 -127
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +1525 -126
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.cjs +74 -34
- package/dist/vuetify.cjs.map +1 -1
- package/dist/vuetify.css +3415 -3415
- package/dist/vuetify.d.ts +86 -61
- package/dist/vuetify.esm.js +74 -34
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +74 -34
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +976 -977
- package/dist/vuetify.min.js.map +1 -1
- package/lib/components/VBottomSheet/VBottomSheet.d.ts +6 -6
- package/lib/components/VDialog/VDialog.d.ts +6 -6
- package/lib/components/VOverlay/VOverlay.js +1 -0
- package/lib/components/VOverlay/VOverlay.js.map +1 -1
- package/lib/components/VOverlay/locationStrategies.js +16 -10
- package/lib/components/VOverlay/locationStrategies.js.map +1 -1
- package/lib/components/VOverlay/scrollStrategies.d.ts +1 -0
- package/lib/components/VOverlay/scrollStrategies.js +6 -4
- package/lib/components/VOverlay/scrollStrategies.js.map +1 -1
- package/lib/components/VRangeSlider/VRangeSlider.d.ts +13 -0
- package/lib/components/VSlider/VSlider.d.ts +13 -0
- package/lib/components/VSlider/VSlider.js +3 -1
- package/lib/components/VSlider/VSlider.js.map +1 -1
- package/lib/components/VSlider/VSliderThumb.d.ts +13 -0
- package/lib/components/VSlider/VSliderThumb.js +2 -0
- package/lib/components/VSlider/VSliderThumb.js.map +1 -1
- package/lib/components/VSlider/slider.d.ts +6 -0
- package/lib/components/VSlider/slider.js +2 -0
- package/lib/components/VSlider/slider.js.map +1 -1
- package/lib/components/index.js +2 -2
- package/lib/components/index.js.map +1 -1
- package/lib/composables/goto.d.ts +3 -2
- package/lib/composables/goto.js +2 -16
- package/lib/composables/goto.js.map +1 -1
- package/lib/composables/reveal.d.ts +36 -0
- package/lib/composables/reveal.js +30 -0
- package/lib/composables/reveal.js.map +1 -0
- package/lib/entry-bundler.js +1 -1
- package/lib/framework.d.ts +142 -133
- package/lib/framework.js +1 -1
- package/lib/iconsets/fa.js +9 -1
- package/lib/iconsets/fa.js.map +1 -1
- package/lib/iconsets/fa4.js +9 -1
- package/lib/iconsets/fa4.js.map +1 -1
- package/lib/iconsets/md.js +9 -1
- package/lib/iconsets/md.js.map +1 -1
- package/lib/iconsets/mdi-svg.js +9 -1
- package/lib/iconsets/mdi-svg.js.map +1 -1
- package/lib/iconsets/mdi.js +9 -1
- package/lib/iconsets/mdi.js.map +1 -1
- package/lib/labs/VPie/VPie.css +105 -0
- package/lib/labs/VPie/VPie.d.ts +891 -0
- package/lib/labs/VPie/VPie.js +291 -0
- package/lib/labs/VPie/VPie.js.map +1 -0
- package/lib/labs/VPie/VPie.sass +109 -0
- package/lib/labs/VPie/VPieSegment.d.ts +310 -0
- package/lib/labs/VPie/VPieSegment.js +103 -0
- package/lib/labs/VPie/VPieSegment.js.map +1 -0
- package/lib/labs/VPie/VPieTooltip.d.ts +279 -0
- package/lib/labs/VPie/VPieTooltip.js +84 -0
- package/lib/labs/VPie/VPieTooltip.js.map +1 -0
- package/lib/labs/VPie/_variables.scss +11 -0
- package/lib/labs/VPie/index.d.ts +3 -0
- package/lib/labs/VPie/index.js +4 -0
- package/lib/labs/VPie/index.js.map +1 -0
- package/lib/labs/VPie/types.d.ts +16 -0
- package/lib/labs/VPie/types.js +2 -0
- package/lib/labs/VPie/types.js.map +1 -0
- package/lib/labs/VPie/utils.d.ts +23 -0
- package/lib/labs/VPie/utils.js +49 -0
- package/lib/labs/VPie/utils.js.map +1 -0
- package/lib/labs/VVideo/VVideo.css +322 -0
- package/lib/labs/VVideo/VVideo.d.ts +6932 -0
- package/lib/labs/VVideo/VVideo.js +424 -0
- package/lib/labs/VVideo/VVideo.js.map +1 -0
- package/lib/labs/VVideo/VVideo.sass +304 -0
- package/lib/labs/VVideo/VVideoControls.d.ts +3524 -0
- package/lib/labs/VVideo/VVideoControls.js +236 -0
- package/lib/labs/VVideo/VVideoControls.js.map +1 -0
- package/lib/labs/VVideo/VVideoVolume.d.ts +3088 -0
- package/lib/labs/VVideo/VVideoVolume.js +94 -0
- package/lib/labs/VVideo/VVideoVolume.js.map +1 -0
- package/lib/labs/VVideo/_variables.scss +58 -0
- package/lib/labs/VVideo/index.d.ts +3 -0
- package/lib/labs/VVideo/index.js +4 -0
- package/lib/labs/VVideo/index.js.map +1 -0
- package/lib/labs/components.d.ts +2 -0
- package/lib/labs/components.js +2 -0
- package/lib/labs/components.js.map +1 -1
- package/lib/locale/af.d.ts +11 -0
- package/lib/locale/af.js +11 -0
- package/lib/locale/af.js.map +1 -1
- package/lib/locale/ar.d.ts +11 -0
- package/lib/locale/ar.js +11 -0
- package/lib/locale/ar.js.map +1 -1
- package/lib/locale/az.d.ts +11 -0
- package/lib/locale/az.js +11 -0
- package/lib/locale/az.js.map +1 -1
- package/lib/locale/bg.d.ts +11 -0
- package/lib/locale/bg.js +11 -0
- package/lib/locale/bg.js.map +1 -1
- package/lib/locale/ca.d.ts +11 -0
- package/lib/locale/ca.js +11 -0
- package/lib/locale/ca.js.map +1 -1
- package/lib/locale/ckb.d.ts +11 -0
- package/lib/locale/ckb.js +11 -0
- package/lib/locale/ckb.js.map +1 -1
- package/lib/locale/cs.d.ts +11 -0
- package/lib/locale/cs.js +11 -0
- package/lib/locale/cs.js.map +1 -1
- package/lib/locale/da.d.ts +11 -0
- package/lib/locale/da.js +11 -0
- package/lib/locale/da.js.map +1 -1
- package/lib/locale/de.d.ts +11 -0
- package/lib/locale/de.js +11 -0
- package/lib/locale/de.js.map +1 -1
- package/lib/locale/el.d.ts +11 -0
- package/lib/locale/el.js +11 -0
- package/lib/locale/el.js.map +1 -1
- package/lib/locale/en.d.ts +11 -0
- package/lib/locale/en.js +11 -0
- package/lib/locale/en.js.map +1 -1
- package/lib/locale/es.d.ts +11 -0
- package/lib/locale/es.js +11 -0
- package/lib/locale/es.js.map +1 -1
- package/lib/locale/et.d.ts +11 -0
- package/lib/locale/et.js +11 -0
- package/lib/locale/et.js.map +1 -1
- package/lib/locale/fa.d.ts +11 -0
- package/lib/locale/fa.js +11 -0
- package/lib/locale/fa.js.map +1 -1
- package/lib/locale/fi.d.ts +11 -0
- package/lib/locale/fi.js +11 -0
- package/lib/locale/fi.js.map +1 -1
- package/lib/locale/fr.d.ts +11 -0
- package/lib/locale/fr.js +11 -0
- package/lib/locale/fr.js.map +1 -1
- package/lib/locale/he.d.ts +11 -0
- package/lib/locale/he.js +11 -0
- package/lib/locale/he.js.map +1 -1
- package/lib/locale/hr.d.ts +11 -0
- package/lib/locale/hr.js +11 -0
- package/lib/locale/hr.js.map +1 -1
- package/lib/locale/hu.d.ts +11 -0
- package/lib/locale/hu.js +11 -0
- package/lib/locale/hu.js.map +1 -1
- package/lib/locale/id.d.ts +11 -0
- package/lib/locale/id.js +11 -0
- package/lib/locale/id.js.map +1 -1
- package/lib/locale/it.d.ts +11 -0
- package/lib/locale/it.js +11 -0
- package/lib/locale/it.js.map +1 -1
- package/lib/locale/ja.d.ts +11 -0
- package/lib/locale/ja.js +11 -0
- package/lib/locale/ja.js.map +1 -1
- package/lib/locale/km.d.ts +11 -0
- package/lib/locale/km.js +11 -0
- package/lib/locale/km.js.map +1 -1
- package/lib/locale/ko.d.ts +11 -0
- package/lib/locale/ko.js +11 -0
- package/lib/locale/ko.js.map +1 -1
- package/lib/locale/lt.d.ts +11 -0
- package/lib/locale/lt.js +11 -0
- package/lib/locale/lt.js.map +1 -1
- package/lib/locale/lv.d.ts +11 -0
- package/lib/locale/lv.js +11 -0
- package/lib/locale/lv.js.map +1 -1
- package/lib/locale/nl.d.ts +11 -0
- package/lib/locale/nl.js +11 -0
- package/lib/locale/nl.js.map +1 -1
- package/lib/locale/no.d.ts +11 -0
- package/lib/locale/no.js +11 -0
- package/lib/locale/no.js.map +1 -1
- package/lib/locale/pl.d.ts +11 -0
- package/lib/locale/pl.js +11 -0
- package/lib/locale/pl.js.map +1 -1
- package/lib/locale/pt.d.ts +11 -0
- package/lib/locale/pt.js +11 -0
- package/lib/locale/pt.js.map +1 -1
- package/lib/locale/ro.d.ts +11 -0
- package/lib/locale/ro.js +11 -0
- package/lib/locale/ro.js.map +1 -1
- package/lib/locale/ru.d.ts +11 -0
- package/lib/locale/ru.js +11 -0
- package/lib/locale/ru.js.map +1 -1
- package/lib/locale/sk.d.ts +11 -0
- package/lib/locale/sk.js +11 -0
- package/lib/locale/sk.js.map +1 -1
- package/lib/locale/sl.d.ts +11 -0
- package/lib/locale/sl.js +11 -0
- package/lib/locale/sl.js.map +1 -1
- package/lib/locale/sr-Cyrl.d.ts +11 -0
- package/lib/locale/sr-Cyrl.js +11 -0
- package/lib/locale/sr-Cyrl.js.map +1 -1
- package/lib/locale/sr-Latn.d.ts +11 -0
- package/lib/locale/sr-Latn.js +11 -0
- package/lib/locale/sr-Latn.js.map +1 -1
- package/lib/locale/sv.d.ts +11 -0
- package/lib/locale/sv.js +11 -0
- package/lib/locale/sv.js.map +1 -1
- package/lib/locale/th.d.ts +11 -0
- package/lib/locale/th.js +11 -0
- package/lib/locale/th.js.map +1 -1
- package/lib/locale/tr.d.ts +11 -0
- package/lib/locale/tr.js +11 -0
- package/lib/locale/tr.js.map +1 -1
- package/lib/locale/uk.d.ts +11 -0
- package/lib/locale/uk.js +11 -0
- package/lib/locale/uk.js.map +1 -1
- package/lib/locale/vi.d.ts +11 -0
- package/lib/locale/vi.js +11 -0
- package/lib/locale/vi.js.map +1 -1
- package/lib/locale/zh-Hans.d.ts +11 -0
- package/lib/locale/zh-Hans.js +11 -0
- package/lib/locale/zh-Hans.js.map +1 -1
- package/lib/locale/zh-Hant.d.ts +11 -0
- package/lib/locale/zh-Hant.js +11 -0
- package/lib/locale/zh-Hant.js.map +1 -1
- package/lib/util/easing.d.ts +22 -0
- package/lib/util/easing.js +53 -0
- package/lib/util/easing.js.map +1 -1
- package/lib/util/index.d.ts +1 -0
- package/lib/util/index.js +1 -0
- package/lib/util/index.js.map +1 -1
- package/lib/util/svg-arc-corners.d.ts +4 -0
- package/lib/util/svg-arc-corners.js +73 -0
- package/lib/util/svg-arc-corners.js.map +1 -0
- package/lib/util/timeUtils.d.ts +1 -0
- package/lib/util/timeUtils.js +4 -0
- package/lib/util/timeUtils.js.map +1 -0
- package/package.json +1 -1
@@ -0,0 +1,279 @@
|
|
1
|
+
import type { PropType } from 'vue';
|
2
|
+
import type { PieItem, TextTemplate } from './types.js';
|
3
|
+
export type VPieTooltipSlots = {
|
4
|
+
default: {
|
5
|
+
item: PieItem;
|
6
|
+
};
|
7
|
+
prepend: {
|
8
|
+
item: PieItem;
|
9
|
+
};
|
10
|
+
};
|
11
|
+
export declare const makeVPieTooltipProps: <Defaults extends {
|
12
|
+
offset?: unknown;
|
13
|
+
transition?: unknown;
|
14
|
+
modelValue?: unknown;
|
15
|
+
item?: unknown;
|
16
|
+
titleFormat?: unknown;
|
17
|
+
subtitleFormat?: unknown;
|
18
|
+
} = {}>(defaults?: Defaults | undefined) => {
|
19
|
+
offset: unknown extends Defaults["offset"] ? {
|
20
|
+
type: PropType<string | number | number[] | undefined>;
|
21
|
+
default: NonNullable<string | number | number[] | undefined>;
|
22
|
+
} : Omit<{
|
23
|
+
type: PropType<string | number | number[] | undefined>;
|
24
|
+
default: NonNullable<string | number | number[] | undefined>;
|
25
|
+
}, "type" | "default"> & {
|
26
|
+
type: PropType<unknown extends Defaults["offset"] ? string | number | number[] | undefined : string | number | number[] | Defaults["offset"] | undefined>;
|
27
|
+
default: unknown extends Defaults["offset"] ? string | number | number[] | undefined : NonNullable<string | number | number[] | undefined> | Defaults["offset"];
|
28
|
+
};
|
29
|
+
transition: unknown extends Defaults["transition"] ? import("vue").Prop<string | boolean | (import("vue").TransitionProps & {
|
30
|
+
component?: import("vue").Component;
|
31
|
+
}) | null> : {
|
32
|
+
type: PropType<unknown extends Defaults["transition"] ? string | boolean | (import("vue").TransitionProps & {
|
33
|
+
component?: import("vue").Component;
|
34
|
+
}) | null : string | boolean | (import("vue").TransitionProps & {
|
35
|
+
component?: import("vue").Component;
|
36
|
+
}) | Defaults["transition"] | null>;
|
37
|
+
default: unknown extends Defaults["transition"] ? string | boolean | (import("vue").TransitionProps & {
|
38
|
+
component?: import("vue").Component;
|
39
|
+
}) | null : NonNullable<string | boolean | (import("vue").TransitionProps & {
|
40
|
+
component?: import("vue").Component;
|
41
|
+
}) | null> | Defaults["transition"];
|
42
|
+
};
|
43
|
+
modelValue: unknown extends Defaults["modelValue"] ? BooleanConstructor : {
|
44
|
+
type: PropType<unknown extends Defaults["modelValue"] ? boolean : boolean | Defaults["modelValue"]>;
|
45
|
+
default: unknown extends Defaults["modelValue"] ? boolean : boolean | Defaults["modelValue"];
|
46
|
+
};
|
47
|
+
item: unknown extends Defaults["item"] ? {
|
48
|
+
type: PropType<PieItem | null>;
|
49
|
+
default: null;
|
50
|
+
} : Omit<{
|
51
|
+
type: PropType<PieItem | null>;
|
52
|
+
default: null;
|
53
|
+
}, "type" | "default"> & {
|
54
|
+
type: PropType<unknown extends Defaults["item"] ? PieItem | null : PieItem | Defaults["item"] | null>;
|
55
|
+
default: unknown extends Defaults["item"] ? PieItem | null : PieItem | Defaults["item"];
|
56
|
+
};
|
57
|
+
titleFormat: unknown extends Defaults["titleFormat"] ? {
|
58
|
+
type: PropType<TextTemplate>;
|
59
|
+
default: string;
|
60
|
+
} : Omit<{
|
61
|
+
type: PropType<TextTemplate>;
|
62
|
+
default: string;
|
63
|
+
}, "type" | "default"> & {
|
64
|
+
type: PropType<unknown extends Defaults["titleFormat"] ? TextTemplate : TextTemplate | Defaults["titleFormat"]>;
|
65
|
+
default: unknown extends Defaults["titleFormat"] ? TextTemplate : Defaults["titleFormat"] | NonNullable<TextTemplate>;
|
66
|
+
};
|
67
|
+
subtitleFormat: unknown extends Defaults["subtitleFormat"] ? {
|
68
|
+
type: PropType<TextTemplate>;
|
69
|
+
default: string;
|
70
|
+
} : Omit<{
|
71
|
+
type: PropType<TextTemplate>;
|
72
|
+
default: string;
|
73
|
+
}, "type" | "default"> & {
|
74
|
+
type: PropType<unknown extends Defaults["subtitleFormat"] ? TextTemplate : TextTemplate | Defaults["subtitleFormat"]>;
|
75
|
+
default: unknown extends Defaults["subtitleFormat"] ? TextTemplate : NonNullable<TextTemplate> | Defaults["subtitleFormat"];
|
76
|
+
};
|
77
|
+
};
|
78
|
+
export declare const VPieTooltip: {
|
79
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<{
|
80
|
+
offset: string | number | number[] | undefined;
|
81
|
+
item: PieItem | null;
|
82
|
+
modelValue: boolean;
|
83
|
+
titleFormat: TextTemplate;
|
84
|
+
subtitleFormat: TextTemplate;
|
85
|
+
} & {
|
86
|
+
transition?: string | boolean | (import("vue").TransitionProps & {
|
87
|
+
component?: import("vue").Component;
|
88
|
+
}) | null | undefined;
|
89
|
+
} & {
|
90
|
+
$children?: import("vue").VNodeChild | {
|
91
|
+
$stable?: boolean;
|
92
|
+
} | ((arg: {
|
93
|
+
item: PieItem;
|
94
|
+
}) => import("vue").VNodeChild) | {
|
95
|
+
default?: ((arg: {
|
96
|
+
item: PieItem;
|
97
|
+
}) => import("vue").VNodeChild) | undefined;
|
98
|
+
prepend?: ((arg: {
|
99
|
+
item: PieItem;
|
100
|
+
}) => import("vue").VNodeChild) | undefined;
|
101
|
+
};
|
102
|
+
'v-slots'?: {
|
103
|
+
default?: false | ((arg: {
|
104
|
+
item: PieItem;
|
105
|
+
}) => import("vue").VNodeChild) | undefined;
|
106
|
+
prepend?: false | ((arg: {
|
107
|
+
item: PieItem;
|
108
|
+
}) => import("vue").VNodeChild) | undefined;
|
109
|
+
} | undefined;
|
110
|
+
} & {
|
111
|
+
"v-slot:default"?: false | ((arg: {
|
112
|
+
item: PieItem;
|
113
|
+
}) => import("vue").VNodeChild) | undefined;
|
114
|
+
"v-slot:prepend"?: false | ((arg: {
|
115
|
+
item: PieItem;
|
116
|
+
}) => import("vue").VNodeChild) | undefined;
|
117
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, {
|
118
|
+
offset: string | number | number[] | undefined;
|
119
|
+
item: PieItem | null;
|
120
|
+
modelValue: boolean;
|
121
|
+
titleFormat: TextTemplate;
|
122
|
+
subtitleFormat: TextTemplate;
|
123
|
+
}, true, {}, import("vue").SlotsType<Partial<{
|
124
|
+
default: (arg: {
|
125
|
+
item: PieItem;
|
126
|
+
}) => import("vue").VNode[];
|
127
|
+
prepend: (arg: {
|
128
|
+
item: PieItem;
|
129
|
+
}) => import("vue").VNode[];
|
130
|
+
}>>, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
131
|
+
P: {};
|
132
|
+
B: {};
|
133
|
+
D: {};
|
134
|
+
C: {};
|
135
|
+
M: {};
|
136
|
+
Defaults: {};
|
137
|
+
}, {
|
138
|
+
offset: string | number | number[] | undefined;
|
139
|
+
item: PieItem | null;
|
140
|
+
modelValue: boolean;
|
141
|
+
titleFormat: TextTemplate;
|
142
|
+
subtitleFormat: TextTemplate;
|
143
|
+
} & {
|
144
|
+
transition?: string | boolean | (import("vue").TransitionProps & {
|
145
|
+
component?: import("vue").Component;
|
146
|
+
}) | null | undefined;
|
147
|
+
} & {
|
148
|
+
$children?: import("vue").VNodeChild | {
|
149
|
+
$stable?: boolean;
|
150
|
+
} | ((arg: {
|
151
|
+
item: PieItem;
|
152
|
+
}) => import("vue").VNodeChild) | {
|
153
|
+
default?: ((arg: {
|
154
|
+
item: PieItem;
|
155
|
+
}) => import("vue").VNodeChild) | undefined;
|
156
|
+
prepend?: ((arg: {
|
157
|
+
item: PieItem;
|
158
|
+
}) => import("vue").VNodeChild) | undefined;
|
159
|
+
};
|
160
|
+
'v-slots'?: {
|
161
|
+
default?: false | ((arg: {
|
162
|
+
item: PieItem;
|
163
|
+
}) => import("vue").VNodeChild) | undefined;
|
164
|
+
prepend?: false | ((arg: {
|
165
|
+
item: PieItem;
|
166
|
+
}) => import("vue").VNodeChild) | undefined;
|
167
|
+
} | undefined;
|
168
|
+
} & {
|
169
|
+
"v-slot:default"?: false | ((arg: {
|
170
|
+
item: PieItem;
|
171
|
+
}) => import("vue").VNodeChild) | undefined;
|
172
|
+
"v-slot:prepend"?: false | ((arg: {
|
173
|
+
item: PieItem;
|
174
|
+
}) => import("vue").VNodeChild) | undefined;
|
175
|
+
}, () => JSX.Element, {}, {}, {}, {
|
176
|
+
offset: string | number | number[] | undefined;
|
177
|
+
item: PieItem | null;
|
178
|
+
modelValue: boolean;
|
179
|
+
titleFormat: TextTemplate;
|
180
|
+
subtitleFormat: TextTemplate;
|
181
|
+
}>;
|
182
|
+
__isFragment?: never;
|
183
|
+
__isTeleport?: never;
|
184
|
+
__isSuspense?: never;
|
185
|
+
} & import("vue").ComponentOptionsBase<{
|
186
|
+
offset: string | number | number[] | undefined;
|
187
|
+
item: PieItem | null;
|
188
|
+
modelValue: boolean;
|
189
|
+
titleFormat: TextTemplate;
|
190
|
+
subtitleFormat: TextTemplate;
|
191
|
+
} & {
|
192
|
+
transition?: string | boolean | (import("vue").TransitionProps & {
|
193
|
+
component?: import("vue").Component;
|
194
|
+
}) | null | undefined;
|
195
|
+
} & {
|
196
|
+
$children?: import("vue").VNodeChild | {
|
197
|
+
$stable?: boolean;
|
198
|
+
} | ((arg: {
|
199
|
+
item: PieItem;
|
200
|
+
}) => import("vue").VNodeChild) | {
|
201
|
+
default?: ((arg: {
|
202
|
+
item: PieItem;
|
203
|
+
}) => import("vue").VNodeChild) | undefined;
|
204
|
+
prepend?: ((arg: {
|
205
|
+
item: PieItem;
|
206
|
+
}) => import("vue").VNodeChild) | undefined;
|
207
|
+
};
|
208
|
+
'v-slots'?: {
|
209
|
+
default?: false | ((arg: {
|
210
|
+
item: PieItem;
|
211
|
+
}) => import("vue").VNodeChild) | undefined;
|
212
|
+
prepend?: false | ((arg: {
|
213
|
+
item: PieItem;
|
214
|
+
}) => import("vue").VNodeChild) | undefined;
|
215
|
+
} | undefined;
|
216
|
+
} & {
|
217
|
+
"v-slot:default"?: false | ((arg: {
|
218
|
+
item: PieItem;
|
219
|
+
}) => import("vue").VNodeChild) | undefined;
|
220
|
+
"v-slot:prepend"?: false | ((arg: {
|
221
|
+
item: PieItem;
|
222
|
+
}) => import("vue").VNodeChild) | undefined;
|
223
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
|
224
|
+
offset: string | number | number[] | undefined;
|
225
|
+
item: PieItem | null;
|
226
|
+
modelValue: boolean;
|
227
|
+
titleFormat: TextTemplate;
|
228
|
+
subtitleFormat: TextTemplate;
|
229
|
+
}, {}, string, import("vue").SlotsType<Partial<{
|
230
|
+
default: (arg: {
|
231
|
+
item: PieItem;
|
232
|
+
}) => import("vue").VNode[];
|
233
|
+
prepend: (arg: {
|
234
|
+
item: PieItem;
|
235
|
+
}) => import("vue").VNode[];
|
236
|
+
}>>, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("../../util/index.js").FilterPropsOptions<{
|
237
|
+
offset: {
|
238
|
+
type: PropType<string | number | number[] | undefined>;
|
239
|
+
default: NonNullable<string | number | number[] | undefined>;
|
240
|
+
};
|
241
|
+
transition: import("vue").Prop<null | string | boolean | (import("vue").TransitionProps & {
|
242
|
+
component?: import("vue").Component;
|
243
|
+
})>;
|
244
|
+
modelValue: BooleanConstructor;
|
245
|
+
item: {
|
246
|
+
type: PropType<PieItem | null>;
|
247
|
+
default: null;
|
248
|
+
};
|
249
|
+
titleFormat: {
|
250
|
+
type: PropType<TextTemplate>;
|
251
|
+
default: string;
|
252
|
+
};
|
253
|
+
subtitleFormat: {
|
254
|
+
type: PropType<TextTemplate>;
|
255
|
+
default: string;
|
256
|
+
};
|
257
|
+
}, import("vue").ExtractPropTypes<{
|
258
|
+
offset: {
|
259
|
+
type: PropType<string | number | number[] | undefined>;
|
260
|
+
default: NonNullable<string | number | number[] | undefined>;
|
261
|
+
};
|
262
|
+
transition: import("vue").Prop<null | string | boolean | (import("vue").TransitionProps & {
|
263
|
+
component?: import("vue").Component;
|
264
|
+
})>;
|
265
|
+
modelValue: BooleanConstructor;
|
266
|
+
item: {
|
267
|
+
type: PropType<PieItem | null>;
|
268
|
+
default: null;
|
269
|
+
};
|
270
|
+
titleFormat: {
|
271
|
+
type: PropType<TextTemplate>;
|
272
|
+
default: string;
|
273
|
+
};
|
274
|
+
subtitleFormat: {
|
275
|
+
type: PropType<TextTemplate>;
|
276
|
+
default: string;
|
277
|
+
};
|
278
|
+
}>>;
|
279
|
+
export type VPieTooltip = InstanceType<typeof VPieTooltip>;
|
@@ -0,0 +1,84 @@
|
|
1
|
+
import { createVNode as _createVNode } from "vue";
|
2
|
+
// Components
|
3
|
+
import { VListItem } from "../../components/VList/VListItem.js";
|
4
|
+
import { makeVTooltipProps, VTooltip } from "../../components/VTooltip/VTooltip.js"; // Composables
|
5
|
+
import { makeTransitionProps, MaybeTransition } from "../../composables/transition.js"; // Utilities
|
6
|
+
import { onBeforeUnmount, onMounted, shallowRef, toRef } from 'vue';
|
7
|
+
import { formatTextTemplate } from "./utils.js";
|
8
|
+
import { genericComponent, getCurrentInstance, pick, propsFactory } from "../../util/index.js"; // Types
|
9
|
+
export const makeVPieTooltipProps = propsFactory({
|
10
|
+
modelValue: Boolean,
|
11
|
+
item: {
|
12
|
+
type: Object,
|
13
|
+
default: null
|
14
|
+
},
|
15
|
+
titleFormat: {
|
16
|
+
type: [String, Function],
|
17
|
+
default: '[title]'
|
18
|
+
},
|
19
|
+
subtitleFormat: {
|
20
|
+
type: [String, Function],
|
21
|
+
default: '[value]'
|
22
|
+
},
|
23
|
+
...makeTransitionProps(),
|
24
|
+
...pick(makeVTooltipProps(), ['offset'])
|
25
|
+
}, 'VPieTooltip');
|
26
|
+
export const VPieTooltip = genericComponent()({
|
27
|
+
name: 'VPieTooltip',
|
28
|
+
props: makeVPieTooltipProps(),
|
29
|
+
setup(props, _ref) {
|
30
|
+
let {
|
31
|
+
slots
|
32
|
+
} = _ref;
|
33
|
+
const target = shallowRef([0, 0]);
|
34
|
+
const vm = getCurrentInstance('VPieTooltip');
|
35
|
+
let frame = -1;
|
36
|
+
function onMouseMove(_ref2) {
|
37
|
+
let {
|
38
|
+
clientX,
|
39
|
+
clientY
|
40
|
+
} = _ref2;
|
41
|
+
cancelAnimationFrame(frame);
|
42
|
+
frame = requestAnimationFrame(() => {
|
43
|
+
target.value = [clientX, clientY];
|
44
|
+
});
|
45
|
+
}
|
46
|
+
onMounted(() => {
|
47
|
+
vm.proxy.$el.parentNode.addEventListener('mousemove', onMouseMove);
|
48
|
+
});
|
49
|
+
onBeforeUnmount(() => {
|
50
|
+
vm.proxy.$el.parentNode.removeEventListener('mousemove', onMouseMove);
|
51
|
+
});
|
52
|
+
const tooltipTitleFormatFunction = toRef(() => segment => {
|
53
|
+
return typeof props.titleFormat === 'function' ? props.titleFormat(segment) : formatTextTemplate(props.titleFormat, segment);
|
54
|
+
});
|
55
|
+
const tooltipSubtitleFormatFunction = toRef(() => segment => {
|
56
|
+
return typeof props.subtitleFormat === 'function' ? props.subtitleFormat(segment) : formatTextTemplate(props.subtitleFormat, segment);
|
57
|
+
});
|
58
|
+
return () => _createVNode(VTooltip, {
|
59
|
+
"offset": props.offset,
|
60
|
+
"modelValue": props.modelValue,
|
61
|
+
"target": target.value,
|
62
|
+
"contentClass": "v-pie__tooltip-content"
|
63
|
+
}, {
|
64
|
+
default: () => [!!props.item && (slots.default?.({
|
65
|
+
item: props.item
|
66
|
+
}) ?? _createVNode(MaybeTransition, {
|
67
|
+
"transition": props.transition,
|
68
|
+
"mode": "out-in"
|
69
|
+
}, {
|
70
|
+
default: () => [_createVNode(VListItem, {
|
71
|
+
"key": props.item.key,
|
72
|
+
"density": "compact",
|
73
|
+
"title": tooltipTitleFormatFunction.value(props.item),
|
74
|
+
"subtitle": tooltipSubtitleFormatFunction.value(props.item)
|
75
|
+
}, {
|
76
|
+
prepend: slots.prepend ? () => slots.prepend({
|
77
|
+
item: props.item
|
78
|
+
}) : undefined
|
79
|
+
})]
|
80
|
+
}))]
|
81
|
+
});
|
82
|
+
}
|
83
|
+
});
|
84
|
+
//# sourceMappingURL=VPieTooltip.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"VPieTooltip.js","names":["VListItem","makeVTooltipProps","VTooltip","makeTransitionProps","MaybeTransition","onBeforeUnmount","onMounted","shallowRef","toRef","formatTextTemplate","genericComponent","getCurrentInstance","pick","propsFactory","makeVPieTooltipProps","modelValue","Boolean","item","type","Object","default","titleFormat","String","Function","subtitleFormat","VPieTooltip","name","props","setup","_ref","slots","target","vm","frame","onMouseMove","_ref2","clientX","clientY","cancelAnimationFrame","requestAnimationFrame","value","proxy","$el","parentNode","addEventListener","removeEventListener","tooltipTitleFormatFunction","segment","tooltipSubtitleFormatFunction","_createVNode","offset","transition","key","prepend","undefined"],"sources":["../../../src/labs/VPie/VPieTooltip.tsx"],"sourcesContent":["// Components\nimport { VListItem } from '@/components/VList/VListItem'\nimport { makeVTooltipProps, VTooltip } from '@/components/VTooltip/VTooltip'\n\n// Composables\nimport { makeTransitionProps, MaybeTransition } from '@/composables/transition'\n\n// Utilities\nimport { onBeforeUnmount, onMounted, shallowRef, toRef } from 'vue'\nimport { formatTextTemplate } from './utils'\nimport { genericComponent, getCurrentInstance, pick, propsFactory } from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\nimport type { PieItem, TextTemplate } from './types'\n\nexport type VPieTooltipSlots = {\n default: { item: PieItem }\n prepend: { item: PieItem }\n}\n\nexport const makeVPieTooltipProps = propsFactory({\n modelValue: Boolean,\n item: {\n type: Object as PropType<PieItem | null>,\n default: null,\n },\n titleFormat: {\n type: [String, Function] as PropType<TextTemplate>,\n default: '[title]',\n },\n subtitleFormat: {\n type: [String, Function] as PropType<TextTemplate>,\n default: '[value]',\n },\n ...makeTransitionProps(),\n ...pick(makeVTooltipProps(), ['offset']),\n}, 'VPieTooltip')\n\nexport const VPieTooltip = genericComponent<VPieTooltipSlots>()({\n name: 'VPieTooltip',\n\n props: makeVPieTooltipProps(),\n\n setup (props, { slots }) {\n const target = shallowRef<[x: number, y: number]>([0, 0])\n const vm = getCurrentInstance('VPieTooltip')\n\n let frame = -1\n function onMouseMove ({ clientX, clientY }: MouseEvent) {\n cancelAnimationFrame(frame)\n frame = requestAnimationFrame(() => {\n target.value = [clientX, clientY]\n })\n }\n\n onMounted(() => {\n vm.proxy!.$el.parentNode.addEventListener('mousemove', onMouseMove)\n })\n\n onBeforeUnmount(() => {\n vm.proxy!.$el.parentNode.removeEventListener('mousemove', onMouseMove)\n })\n\n const tooltipTitleFormatFunction = toRef(() => (segment: PieItem) => {\n return typeof props.titleFormat === 'function'\n ? props.titleFormat(segment)\n : formatTextTemplate(props.titleFormat, segment)\n })\n\n const tooltipSubtitleFormatFunction = toRef(() => (segment: PieItem) => {\n return typeof props.subtitleFormat === 'function'\n ? props.subtitleFormat(segment)\n : formatTextTemplate(props.subtitleFormat, segment)\n })\n\n return () => (\n <VTooltip\n offset={ props.offset }\n modelValue={ props.modelValue }\n target={ target.value }\n contentClass=\"v-pie__tooltip-content\"\n >\n { !!props.item && (\n slots.default?.({ item: props.item }) ?? (\n <MaybeTransition transition={ props.transition } mode=\"out-in\">\n <VListItem\n key={ props.item.key }\n density=\"compact\"\n title={ tooltipTitleFormatFunction.value(props.item) }\n subtitle={ tooltipSubtitleFormatFunction.value(props.item) }\n v-slots={{\n prepend: slots.prepend\n ? () => slots.prepend!({ item: props.item! })\n : undefined,\n }}\n />\n </MaybeTransition>\n )\n )}\n </VTooltip>\n )\n },\n})\n\nexport type VPieTooltip = InstanceType<typeof VPieTooltip>\n"],"mappings":";AAAA;AAAA,SACSA,SAAS;AAAA,SACTC,iBAAiB,EAAEC,QAAQ,iDAEpC;AAAA,SACSC,mBAAmB,EAAEC,eAAe,2CAE7C;AACA,SAASC,eAAe,EAAEC,SAAS,EAAEC,UAAU,EAAEC,KAAK,QAAQ,KAAK;AAAA,SAC1DC,kBAAkB;AAAA,SAClBC,gBAAgB,EAAEC,kBAAkB,EAAEC,IAAI,EAAEC,YAAY,+BAEjE;AASA,OAAO,MAAMC,oBAAoB,GAAGD,YAAY,CAAC;EAC/CE,UAAU,EAAEC,OAAO;EACnBC,IAAI,EAAE;IACJC,IAAI,EAAEC,MAAkC;IACxCC,OAAO,EAAE;EACX,CAAC;EACDC,WAAW,EAAE;IACXH,IAAI,EAAE,CAACI,MAAM,EAAEC,QAAQ,CAA2B;IAClDH,OAAO,EAAE;EACX,CAAC;EACDI,cAAc,EAAE;IACdN,IAAI,EAAE,CAACI,MAAM,EAAEC,QAAQ,CAA2B;IAClDH,OAAO,EAAE;EACX,CAAC;EACD,GAAGjB,mBAAmB,CAAC,CAAC;EACxB,GAAGS,IAAI,CAACX,iBAAiB,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC;AACzC,CAAC,EAAE,aAAa,CAAC;AAEjB,OAAO,MAAMwB,WAAW,GAAGf,gBAAgB,CAAmB,CAAC,CAAC;EAC9DgB,IAAI,EAAE,aAAa;EAEnBC,KAAK,EA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AAC,GAC7BtC,kBAAkB,CAACkB,KAAK,CAACH,cAAc,EAAEuB,OAAO,CAAC;IACvD,CAAC,CAAC;IAEF,OAAO,MAAAE,YAAA,CAAA/C,QAAA;MAAA,UAEMyB,KAAK,CAACuB,MAAM;MAAA,cACRvB,KAAK,CAACZ,UAAU;MAAA,UACpBgB,MAAM,CAACS,KAAK;MAAA;IAAA;MAAApB,OAAA,EAAAA,CAAA,MAGnB,CAAC,CAACO,KAAK,CAACV,IAAI,KACZa,KAAK,CAACV,OAAO,GAAG;QAAEH,IAAI,EAAEU,KAAK,CAACV;MAAK,CAAC,CAAC,IAAAgC,YAAA,CAAA7C,eAAA;QAAA,cACLuB,KAAK,CAACwB,UAAU;QAAA;MAAA;QAAA/B,OAAA,EAAAA,CAAA,MAAA6B,YAAA,CAAAjD,SAAA;UAAA,OAEpC2B,KAAK,CAACV,IAAI,CAACmC,GAAG;UAAA;UAAA,SAEZN,0BAA0B,CAACN,KAAK,CAACb,KAAK,CAACV,IAAI,CAAC;UAAA,YACzC+B,6BAA6B,CAACR,KAAK,CAACb,KAAK,CAACV,IAAI;QAAC,GACjD;UACPoC,OAAO,EAAEvB,KAAK,CAACuB,OAAO,GAClB,MAAMvB,KAAK,CAACuB,OAAO,CAAE;YAAEpC,IAAI,EAAEU,KAAK,CAACV;UAAM,CAAC,CAAC,GAC3CqC;QACN,CAAC;MAAA,EAGN,CACF;IAAA,EAEJ;EACH;AACF,CAAC,CAAC","ignoreList":[]}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
@use '../../styles/settings';
|
2
|
+
|
3
|
+
$pie-underlay-inset: -8px !default;
|
4
|
+
$pie-title-padding-bottom: 12px !default;
|
5
|
+
$pie-legend-padding-block: 12px !default;
|
6
|
+
$pie-legend-chip-default-font-size: 0.8125rem !default;
|
7
|
+
$pie-legend-chip-compact-font-size: 0.66rem !default;
|
8
|
+
$pie-legend-chip-disabled-opacity: .4 !default;
|
9
|
+
$pie-legend-avatar-border: thin solid rgba(var(--v-theme-on-surface), .2) !default;
|
10
|
+
$pie-tooltip-min-width: 100px !default;
|
11
|
+
$pie-tooltip-avatar-border: thin solid rgba(var(--v-theme-on-surface-variant), .2) !default;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","names":["VPie","VPieSegment","VPieTooltip"],"sources":["../../../src/labs/VPie/index.ts"],"sourcesContent":["export { VPie } from './VPie'\nexport { VPieSegment } from './VPieSegment'\nexport { VPieTooltip } from './VPieTooltip'\n"],"mappings":"SAASA,IAAI;AAAA,SACJC,WAAW;AAAA,SACXC,WAAW","ignoreList":[]}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
export interface PieItem {
|
2
|
+
key: string | number | symbol;
|
3
|
+
color: string;
|
4
|
+
value: number;
|
5
|
+
title: string;
|
6
|
+
pattern?: string;
|
7
|
+
raw?: Record<string, any>;
|
8
|
+
}
|
9
|
+
export interface PieSegmentProps {
|
10
|
+
gap?: number | string;
|
11
|
+
hoverScale?: number | string;
|
12
|
+
innerCut?: number | string;
|
13
|
+
rounded?: number | string;
|
14
|
+
value: number;
|
15
|
+
}
|
16
|
+
export type TextTemplate = string | ((v: PieItem) => string);
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../src/labs/VPie/types.ts"],"sourcesContent":["export interface PieItem {\n key: string | number | symbol\n color: string\n value: number\n title: string\n pattern?: string\n raw?: Record<string, any>\n}\n\nexport interface PieSegmentProps {\n gap?: number | string\n hoverScale?: number | string\n innerCut?: number | string\n rounded?: number | string\n value: number\n}\n\nexport type TextTemplate = string | ((v: PieItem) => string)\n"],"mappings":"","ignoreList":[]}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import type { MaybeRefOrGetter, Ref } from 'vue';
|
2
|
+
import type { PieItem, PieSegmentProps } from './types.js';
|
3
|
+
export declare function formatTextTemplate(template: string, item?: PieItem): string | undefined;
|
4
|
+
export declare function usePieArc(props: PieSegmentProps, isHovering: Ref<boolean>): {
|
5
|
+
hoverZoomRatio: Readonly<Ref<number, number>>;
|
6
|
+
normalizedValue: Readonly<Ref<number, number>>;
|
7
|
+
normalizedInnerCut: Readonly<Ref<number, number>>;
|
8
|
+
outerX: Readonly<Ref<number, number>>;
|
9
|
+
outerY: Readonly<Ref<number, number>>;
|
10
|
+
arcWidth: import("vue").ComputedRef<number>;
|
11
|
+
};
|
12
|
+
export declare function useOuterSlicePath({ angle, radius, size, width, rounded, }: {
|
13
|
+
angle: MaybeRefOrGetter<number>;
|
14
|
+
radius: MaybeRefOrGetter<number>;
|
15
|
+
size: MaybeRefOrGetter<number>;
|
16
|
+
width: MaybeRefOrGetter<number>;
|
17
|
+
rounded: MaybeRefOrGetter<number>;
|
18
|
+
}): import("vue").ComputedRef<string>;
|
19
|
+
export declare function useInnerSlicePath({ angle, radius, size, }: {
|
20
|
+
angle: MaybeRefOrGetter<number>;
|
21
|
+
radius: MaybeRefOrGetter<number>;
|
22
|
+
size: MaybeRefOrGetter<number>;
|
23
|
+
}): import("vue").ComputedRef<string>;
|
@@ -0,0 +1,49 @@
|
|
1
|
+
// Utilities
|
2
|
+
import { computed, toRef, toValue } from 'vue';
|
3
|
+
import { clamp } from "../../util/index.js";
|
4
|
+
import { roundedArc, simpleArc } from "../../util/svg-arc-corners.js"; // Types
|
5
|
+
export function formatTextTemplate(template, item) {
|
6
|
+
return item ? template.replaceAll('[title]', item.title).replaceAll('[value]', String(item.value)) : undefined;
|
7
|
+
}
|
8
|
+
export function usePieArc(props, isHovering) {
|
9
|
+
const hoverZoomRatio = toRef(() => clamp(Number(props.hoverScale ?? 0), 0, 0.25));
|
10
|
+
const normalizedValue = toRef(() => clamp(props.value - 100 * Number(props.gap ?? 0) / 360, 0.01, 99.99));
|
11
|
+
const normalizedInnerCut = toRef(() => {
|
12
|
+
const min = Number(props.rounded ?? 0) > 0 ? 0.2 : 0;
|
13
|
+
return clamp(Number(props.innerCut ?? 0) / 100, min, 1);
|
14
|
+
});
|
15
|
+
const radians = computed(() => (360 * (-normalizedValue.value / 100) + 90) * (Math.PI / 180));
|
16
|
+
const arcWidth = computed(() => 50 * (1 - normalizedInnerCut.value) * (isHovering.value ? 1 : 1 - hoverZoomRatio.value));
|
17
|
+
const outerX = toRef(() => 50 + 50 * Math.cos(radians.value));
|
18
|
+
const outerY = toRef(() => 50 - 50 * Math.sin(radians.value));
|
19
|
+
return {
|
20
|
+
hoverZoomRatio,
|
21
|
+
normalizedValue,
|
22
|
+
normalizedInnerCut,
|
23
|
+
outerX,
|
24
|
+
outerY,
|
25
|
+
arcWidth
|
26
|
+
};
|
27
|
+
}
|
28
|
+
export function useOuterSlicePath(_ref) {
|
29
|
+
let {
|
30
|
+
angle,
|
31
|
+
radius,
|
32
|
+
size,
|
33
|
+
width,
|
34
|
+
rounded
|
35
|
+
} = _ref;
|
36
|
+
return computed(() => roundedArc([50, 50], toValue(radius), toValue(angle), toValue(angle) + 360 * toValue(size) / 100,
|
37
|
+
// angle end,
|
38
|
+
toValue(width), toValue(rounded)));
|
39
|
+
}
|
40
|
+
export function useInnerSlicePath(_ref2) {
|
41
|
+
let {
|
42
|
+
angle,
|
43
|
+
radius,
|
44
|
+
size
|
45
|
+
} = _ref2;
|
46
|
+
return computed(() => simpleArc([50, 50], toValue(radius), toValue(angle), toValue(angle) + 360 * toValue(size) / 100 // angle end,
|
47
|
+
));
|
48
|
+
}
|
49
|
+
//# sourceMappingURL=utils.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"utils.js","names":["computed","toRef","toValue","clamp","roundedArc","simpleArc","formatTextTemplate","template","item","replaceAll","title","String","value","undefined","usePieArc","props","isHovering","hoverZoomRatio","Number","hoverScale","normalizedValue","gap","normalizedInnerCut","min","rounded","innerCut","radians","Math","PI","arcWidth","outerX","cos","outerY","sin","useOuterSlicePath","_ref","angle","radius","size","width","useInnerSlicePath","_ref2"],"sources":["../../../src/labs/VPie/utils.ts"],"sourcesContent":["// Utilities\nimport { computed, toRef, toValue } from 'vue'\nimport { clamp } from '@/util'\nimport { roundedArc, simpleArc } from '@/util/svg-arc-corners'\n\n// Types\nimport type { MaybeRefOrGetter, Ref } from 'vue'\nimport type { PieItem, PieSegmentProps } from './types'\n\nexport function formatTextTemplate (template: string, item?: PieItem) {\n return item\n ? template\n .replaceAll('[title]', item.title)\n .replaceAll('[value]', String(item.value))\n : undefined\n}\n\nexport function usePieArc (props: PieSegmentProps, isHovering: Ref<boolean>) {\n const hoverZoomRatio = toRef(() => clamp(Number(props.hoverScale ?? 0), 0, 0.25))\n const normalizedValue = toRef(() => clamp(props.value - 100 * Number(props.gap ?? 0) / 360, 0.01, 99.99))\n const normalizedInnerCut = toRef(() => {\n const min = Number(props.rounded ?? 0) > 0 ? 0.2 : 0\n return clamp(Number(props.innerCut ?? 0) / 100, min, 1)\n })\n\n const radians = computed(() => (360 * (-normalizedValue.value / 100) + 90) * (Math.PI / 180))\n const arcWidth = computed(() => 50 * (1 - normalizedInnerCut.value) * (isHovering.value ? 1 : (1 - hoverZoomRatio.value)))\n\n const outerX = toRef(() => 50 + 50 * Math.cos(radians.value))\n const outerY = toRef(() => 50 - 50 * Math.sin(radians.value))\n\n return {\n hoverZoomRatio,\n normalizedValue,\n normalizedInnerCut,\n outerX,\n outerY,\n arcWidth,\n }\n}\n\nexport function useOuterSlicePath ({\n angle,\n radius,\n size,\n width,\n rounded,\n}: {\n angle: MaybeRefOrGetter<number>\n radius: MaybeRefOrGetter<number>\n size: MaybeRefOrGetter<number>\n width: MaybeRefOrGetter<number>\n rounded: MaybeRefOrGetter<number>\n}) {\n return computed(() =>\n roundedArc(\n [50, 50],\n toValue(radius),\n toValue(angle),\n toValue(angle) + 360 * toValue(size) / 100, // angle end,\n toValue(width),\n toValue(rounded),\n )\n )\n}\n\nexport function useInnerSlicePath ({\n angle,\n radius,\n size,\n}: {\n angle: MaybeRefOrGetter<number>\n radius: MaybeRefOrGetter<number>\n size: MaybeRefOrGetter<number>\n}) {\n return computed(() =>\n simpleArc(\n [50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