@vuetify/nightly 3.8.9-master.2025-06-11 → 3.8.9-master.2025-06-13
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 +19 -3
- package/dist/json/attributes.json +3262 -3262
- package/dist/json/importMap-labs.json +22 -22
- package/dist/json/importMap.json +176 -176
- package/dist/json/web-types.json +6344 -6344
- package/dist/vuetify-labs.cjs +43 -22
- package/dist/vuetify-labs.css +4907 -4905
- package/dist/vuetify-labs.d.ts +60 -60
- package/dist/vuetify-labs.esm.js +43 -22
- package/dist/vuetify-labs.esm.js.map +1 -1
- package/dist/vuetify-labs.js +43 -22
- package/dist/vuetify-labs.min.css +2 -2
- package/dist/vuetify.cjs +41 -22
- package/dist/vuetify.cjs.map +1 -1
- package/dist/vuetify.css +3650 -3648
- package/dist/vuetify.d.ts +60 -60
- package/dist/vuetify.esm.js +41 -22
- package/dist/vuetify.esm.js.map +1 -1
- package/dist/vuetify.js +41 -22
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +19 -17
- package/dist/vuetify.min.js.map +1 -1
- package/lib/components/VDatePicker/VDatePicker.js +19 -13
- package/lib/components/VDatePicker/VDatePicker.js.map +1 -1
- package/lib/components/VDatePicker/VDatePickerYears.js +1 -3
- package/lib/components/VDatePicker/VDatePickerYears.js.map +1 -1
- package/lib/components/VField/VField.js +10 -2
- package/lib/components/VField/VField.js.map +1 -1
- package/lib/components/VList/VListItem.css +2 -0
- package/lib/components/VList/VListItem.sass +2 -0
- package/lib/components/VList/_variables.scss +1 -0
- package/lib/components/VSpeedDial/VSpeedDial.css +1 -1
- package/lib/components/VSpeedDial/VSpeedDial.sass +3 -1
- package/lib/composables/hotkey.d.ts +9 -0
- package/lib/composables/hotkey.js +131 -0
- package/lib/composables/hotkey.js.map +1 -0
- package/lib/composables/transition.js +3 -3
- package/lib/composables/transition.js.map +1 -1
- package/lib/entry-bundler.js +1 -1
- package/lib/framework.d.ts +60 -60
- package/lib/framework.js +1 -1
- package/lib/labs/VTimePicker/VTimePickerClock.js +3 -1
- package/lib/labs/VTimePicker/VTimePickerClock.js.map +1 -1
- package/lib/util/helpers.d.ts +3 -0
- package/lib/util/helpers.js +7 -0
- package/lib/util/helpers.js.map +1 -1
- package/package.json +1 -1
@@ -0,0 +1,131 @@
|
|
1
|
+
// Utilities
|
2
|
+
import { onBeforeUnmount, shallowRef, toValue, watch } from 'vue';
|
3
|
+
import { IN_BROWSER } from "../util/index.js";
|
4
|
+
import { getCurrentInstance } from "../util/getCurrentInstance.js"; // Types
|
5
|
+
export function useHotkey(keys, callback) {
|
6
|
+
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
7
|
+
if (!IN_BROWSER) return function () {};
|
8
|
+
const {
|
9
|
+
event = 'keydown',
|
10
|
+
inputs = false,
|
11
|
+
preventDefault = true,
|
12
|
+
sequenceTimeout = 1000
|
13
|
+
} = options;
|
14
|
+
const isMac = navigator?.userAgent?.includes('Macintosh');
|
15
|
+
const timer = shallowRef();
|
16
|
+
const keyGroups = shallowRef([]);
|
17
|
+
const isSequence = shallowRef(false);
|
18
|
+
const groupIndex = shallowRef(0);
|
19
|
+
function clearTimer() {
|
20
|
+
if (!timer.value) return;
|
21
|
+
clearTimeout(timer.value);
|
22
|
+
timer.value = undefined;
|
23
|
+
}
|
24
|
+
function isInputFocused() {
|
25
|
+
if (inputs) return false;
|
26
|
+
const activeElement = document.activeElement;
|
27
|
+
return activeElement && (activeElement.tagName === 'INPUT' || activeElement.tagName === 'TEXTAREA' || activeElement.isContentEditable || activeElement.contentEditable === 'true');
|
28
|
+
}
|
29
|
+
function resetSequence() {
|
30
|
+
groupIndex.value = 0;
|
31
|
+
clearTimer();
|
32
|
+
}
|
33
|
+
function handler(e) {
|
34
|
+
const group = keyGroups.value[groupIndex.value];
|
35
|
+
if (!group || isInputFocused()) return;
|
36
|
+
if (!matchesKeyGroup(e, group)) {
|
37
|
+
if (isSequence.value) resetSequence();
|
38
|
+
return;
|
39
|
+
}
|
40
|
+
if (preventDefault) e.preventDefault();
|
41
|
+
if (!isSequence.value) {
|
42
|
+
callback(e);
|
43
|
+
return;
|
44
|
+
}
|
45
|
+
clearTimer();
|
46
|
+
groupIndex.value++;
|
47
|
+
if (groupIndex.value === keyGroups.value.length) {
|
48
|
+
callback(e);
|
49
|
+
resetSequence();
|
50
|
+
return;
|
51
|
+
}
|
52
|
+
timer.value = setTimeout(resetSequence, sequenceTimeout);
|
53
|
+
}
|
54
|
+
function cleanup() {
|
55
|
+
window.removeEventListener(event, handler);
|
56
|
+
clearTimer();
|
57
|
+
}
|
58
|
+
function splitKeySequence(str) {
|
59
|
+
const groups = [];
|
60
|
+
let current = '';
|
61
|
+
for (let i = 0; i < str.length; i++) {
|
62
|
+
const char = str[i];
|
63
|
+
if (char === '-') {
|
64
|
+
const next = str[i + 1];
|
65
|
+
// Treat '-' as a sequence delimiter only if the next character exists
|
66
|
+
// and is NOT one of '-', '+', or '_' (these indicate the '-' belongs to the key itself)
|
67
|
+
if (next && !['-', '+', '_'].includes(next)) {
|
68
|
+
groups.push(current);
|
69
|
+
current = '';
|
70
|
+
continue;
|
71
|
+
}
|
72
|
+
}
|
73
|
+
current += char;
|
74
|
+
}
|
75
|
+
groups.push(current);
|
76
|
+
return groups;
|
77
|
+
}
|
78
|
+
watch(() => toValue(keys), function (unrefKeys) {
|
79
|
+
cleanup();
|
80
|
+
if (unrefKeys) {
|
81
|
+
const groups = splitKeySequence(unrefKeys.toLowerCase());
|
82
|
+
isSequence.value = groups.length > 1;
|
83
|
+
keyGroups.value = groups;
|
84
|
+
resetSequence();
|
85
|
+
window.addEventListener(event, handler);
|
86
|
+
}
|
87
|
+
}, {
|
88
|
+
immediate: true
|
89
|
+
});
|
90
|
+
try {
|
91
|
+
getCurrentInstance('useHotkey');
|
92
|
+
onBeforeUnmount(cleanup);
|
93
|
+
} catch {
|
94
|
+
// Not in Vue setup context
|
95
|
+
}
|
96
|
+
function parseKeyGroup(group) {
|
97
|
+
const MODIFIERS = ['ctrl', 'shift', 'alt', 'meta', 'cmd'];
|
98
|
+
|
99
|
+
// Split on +, -, or _ but keep empty strings which indicate consecutive separators (e.g. alt--)
|
100
|
+
const parts = group.toLowerCase().split(/[+_-]/);
|
101
|
+
const modifiers = Object.fromEntries(MODIFIERS.map(m => [m, false]));
|
102
|
+
let actualKey;
|
103
|
+
for (const part of parts) {
|
104
|
+
if (!part) continue; // Skip empty tokens
|
105
|
+
if (MODIFIERS.includes(part)) {
|
106
|
+
modifiers[part] = true;
|
107
|
+
} else {
|
108
|
+
actualKey = part;
|
109
|
+
}
|
110
|
+
}
|
111
|
+
|
112
|
+
// Fallback for cases where actualKey is a literal '+' or '-' (e.g. alt--, alt++ , alt+-, alt-+)
|
113
|
+
if (!actualKey) {
|
114
|
+
const lastChar = group.slice(-1);
|
115
|
+
if (['+', '-', '_'].includes(lastChar)) actualKey = lastChar;
|
116
|
+
}
|
117
|
+
return {
|
118
|
+
modifiers,
|
119
|
+
actualKey
|
120
|
+
};
|
121
|
+
}
|
122
|
+
function matchesKeyGroup(e, group) {
|
123
|
+
const {
|
124
|
+
modifiers,
|
125
|
+
actualKey
|
126
|
+
} = parseKeyGroup(group);
|
127
|
+
return e.ctrlKey === (isMac && modifiers.cmd ? false : modifiers.ctrl) && e.metaKey === (isMac && modifiers.cmd ? true : modifiers.meta) && e.shiftKey === modifiers.shift && e.altKey === modifiers.alt && e.key.toLowerCase() === actualKey?.toLowerCase();
|
128
|
+
}
|
129
|
+
return cleanup;
|
130
|
+
}
|
131
|
+
//# sourceMappingURL=hotkey.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"hotkey.js","names":["onBeforeUnmount","shallowRef","toValue","watch","IN_BROWSER","getCurrentInstance","useHotkey","keys","callback","options","arguments","length","undefined","event","inputs","preventDefault","sequenceTimeout","isMac","navigator","userAgent","includes","timer","keyGroups","isSequence","groupIndex","clearTimer","value","clearTimeout","isInputFocused","activeElement","document","tagName","isContentEditable","contentEditable","resetSequence","handler","e","group","matchesKeyGroup","setTimeout","cleanup","window","removeEventListener","splitKeySequence","str","groups","current","i","char","next","push","unrefKeys","toLowerCase","addEventListener","immediate","parseKeyGroup","MODIFIERS","parts","split","modifiers","Object","fromEntries","map","m","actualKey","part","lastChar","slice","ctrlKey","cmd","ctrl","metaKey","meta","shiftKey","shift","altKey","alt","key"],"sources":["../../src/composables/hotkey.ts"],"sourcesContent":["// Utilities\nimport { onBeforeUnmount, shallowRef, toValue, watch } from 'vue'\nimport { IN_BROWSER } from '@/util'\nimport { getCurrentInstance } from '@/util/getCurrentInstance'\n\n// Types\nimport type { MaybeRef } from '@/util'\n\ninterface HotkeyOptions {\n event?: 'keydown' | 'keyup'\n inputs?: boolean\n preventDefault?: boolean\n sequenceTimeout?: number\n}\n\nexport function useHotkey (\n keys: MaybeRef<string | undefined>,\n callback: (e: KeyboardEvent) => void,\n options: HotkeyOptions = {}\n) {\n if (!IN_BROWSER) return function () {}\n\n const {\n event = 'keydown',\n inputs = false,\n preventDefault = true,\n sequenceTimeout = 1000,\n } = options\n\n const isMac = navigator?.userAgent?.includes('Macintosh')\n const timer = shallowRef<ReturnType<typeof setTimeout> | undefined>()\n const keyGroups = shallowRef<string[]>([])\n const isSequence = shallowRef(false)\n const groupIndex = shallowRef(0)\n\n function clearTimer () {\n if (!timer.value) return\n\n clearTimeout(timer.value)\n timer.value = undefined\n }\n\n function isInputFocused () {\n if (inputs) return false\n\n const activeElement = document.activeElement as HTMLElement\n\n return activeElement && (\n activeElement.tagName === 'INPUT' ||\n activeElement.tagName === 'TEXTAREA' ||\n activeElement.isContentEditable ||\n activeElement.contentEditable === 'true'\n )\n }\n\n function resetSequence () {\n groupIndex.value = 0\n clearTimer()\n }\n\n function handler (e: KeyboardEvent) {\n const group = keyGroups.value[groupIndex.value]\n\n if (!group || isInputFocused()) return\n\n if (!matchesKeyGroup(e, group)) {\n if (isSequence.value) resetSequence()\n return\n }\n\n if (preventDefault) e.preventDefault()\n\n if (!isSequence.value) {\n callback(e)\n return\n }\n\n clearTimer()\n groupIndex.value++\n\n if (groupIndex.value === keyGroups.value.length) {\n callback(e)\n resetSequence()\n return\n }\n\n timer.value = setTimeout(resetSequence, sequenceTimeout)\n }\n\n function cleanup () {\n window.removeEventListener(event, handler)\n clearTimer()\n }\n\n function splitKeySequence (str: string) {\n const groups: string[] = []\n let current = ''\n for (let i = 0; i < str.length; i++) {\n const char = str[i]\n if (char === '-') {\n const next = str[i + 1]\n // Treat '-' as a sequence delimiter only if the next character exists\n // and is NOT one of '-', '+', or '_' (these indicate the '-' belongs to the key itself)\n if (next && !['-', '+', '_'].includes(next)) {\n groups.push(current)\n current = ''\n continue\n }\n }\n current += char\n }\n groups.push(current)\n\n return groups\n }\n\n watch(() => toValue(keys), function (unrefKeys) {\n cleanup()\n\n if (unrefKeys) {\n const groups = splitKeySequence(unrefKeys.toLowerCase())\n isSequence.value = groups.length > 1\n keyGroups.value = groups\n resetSequence()\n window.addEventListener(event, handler)\n }\n }, { immediate: true })\n\n try {\n getCurrentInstance('useHotkey')\n onBeforeUnmount(cleanup)\n } catch {\n // Not in Vue setup context\n }\n\n function parseKeyGroup (group: string) {\n const MODIFIERS = ['ctrl', 'shift', 'alt', 'meta', 'cmd']\n\n // Split on +, -, or _ but keep empty strings which indicate consecutive separators (e.g. alt--)\n const parts = group.toLowerCase().split(/[+_-]/)\n\n const modifiers = Object.fromEntries(MODIFIERS.map(m => [m, false])) as Record<string, boolean>\n let actualKey: string | undefined\n\n for (const part of parts) {\n if (!part) continue // Skip empty tokens\n if (MODIFIERS.includes(part)) {\n modifiers[part] = true\n } else {\n actualKey = part\n }\n }\n\n // Fallback for cases where actualKey is a literal '+' or '-' (e.g. alt--, alt++ , alt+-, alt-+)\n if (!actualKey) {\n const lastChar = group.slice(-1)\n if (['+', '-', '_'].includes(lastChar)) actualKey = lastChar\n }\n\n return { modifiers, actualKey }\n }\n\n function matchesKeyGroup (e: KeyboardEvent, group: string) {\n const { modifiers, actualKey } = parseKeyGroup(group)\n\n return (\n e.ctrlKey === (isMac && modifiers.cmd ? false : modifiers.ctrl) &&\n e.metaKey === (isMac && modifiers.cmd ? true : modifiers.meta) &&\n e.shiftKey === modifiers.shift &&\n e.altKey === modifiers.alt &&\n e.key.toLowerCase() === actualKey?.toLowerCase()\n )\n }\n\n return cleanup\n}\n"],"mappings":"AAAA;AACA,SAASA,eAAe,EAAEC,UAAU,EAAEC,OAAO,EAAEC,KAAK,QAAQ,KAAK;AAAA,SACxDC,UAAU;AAAA,SACVC,kBAAkB,yCAE3B;AAUA,OAAO,SAASC,SAASA,CACvBC,IAAkC,EAClCC,QAAoC,EAEpC;EAAA,IADAC,OAAsB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAE3B,IAAI,CAACN,UAAU,EAAE,OAAO,YAAY,CAAC,CAAC;EAEtC,MAAM;IACJS,KAAK,GAAG,SAAS;IACjBC,MAAM,GAAG,KAAK;IACdC,cAAc,GAAG,IAAI;IACrBC,eAAe,GAAG;EACpB,CAAC,GAAGP,OAAO;EAEX,MAAMQ,KAAK,GAAGC,SAAS,EAAEC,SAAS,EAAEC,QAAQ,CAAC,WAAW,CAAC;EACzD,MAAMC,KAAK,GAAGpB,UAAU,CAA4C,CAAC;EACrE,MAAMqB,SAAS,GAAGrB,UAAU,CAAW,EAAE,CAAC;EAC1C,MAAMsB,UAAU,GAAGtB,UAAU,CAAC,KAAK,CAAC;EACpC,MAAMuB,UAAU,GAAGvB,UAAU,CAAC,CAAC,CAAC;EAEhC,SAASwB,UAAUA,CAAA,EAAI;IACrB,IAAI,CAACJ,KAAK,CAACK,KAAK,EAAE;IAElBC,YAAY,CAACN,KAAK,CAACK,KAAK,CAAC;IACzBL,KAAK,CAACK,KAAK,GAAGd,SAAS;EACzB;EAEA,SAASgB,cAAcA,CAAA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GAAG,IAAI,GAAGV,SAAS,CAACa,IAAI,CAAC,IAC9DpC,CAAC,CAACqC,QAAQ,KAAKd,SAAS,CAACe,KAAK,IAC9BtC,CAAC,CAACuC,MAAM,KAAKhB,SAAS,CAACiB,GAAG,IAC1BxC,CAAC,CAACyC,GAAG,CAACzB,WAAW,CAAC,CAAC,KAAKY,SAAS,EAAEZ,WAAW,CAAC,CAAC;EAEpD;EAEA,OAAOZ,OAAO;AAChB","ignoreList":[]}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
// Utilities
|
2
2
|
import { h, mergeProps, Transition, TransitionGroup } from 'vue';
|
3
|
-
import { isObject, propsFactory } from "../util/index.js"; // Types
|
3
|
+
import { isObject, onlyDefinedProps, propsFactory } from "../util/index.js"; // Types
|
4
4
|
export const makeTransitionProps = propsFactory({
|
5
5
|
transition: {
|
6
6
|
type: null,
|
@@ -24,10 +24,10 @@ export const MaybeTransition = (props, _ref) => {
|
|
24
24
|
} = isObject(transition) ? transition : {};
|
25
25
|
let transitionProps;
|
26
26
|
if (isObject(transition)) {
|
27
|
-
transitionProps = mergeProps(customProps,
|
27
|
+
transitionProps = mergeProps(customProps, onlyDefinedProps({
|
28
28
|
disabled,
|
29
29
|
group
|
30
|
-
})
|
30
|
+
}), rest);
|
31
31
|
} else {
|
32
32
|
transitionProps = mergeProps({
|
33
33
|
name: disabled || !transition ? '' : transition
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transition.js","names":["h","mergeProps","Transition","TransitionGroup","isObject","propsFactory","makeTransitionProps","transition","type","default","validator","val","MaybeTransition","props","_ref","slots","disabled","group","rest","component","customProps","transitionProps","
|
1
|
+
{"version":3,"file":"transition.js","names":["h","mergeProps","Transition","TransitionGroup","isObject","onlyDefinedProps","propsFactory","makeTransitionProps","transition","type","default","validator","val","MaybeTransition","props","_ref","slots","disabled","group","rest","component","customProps","transitionProps","name"],"sources":["../../src/composables/transition.ts"],"sourcesContent":["// Utilities\nimport { h, mergeProps, Transition, TransitionGroup } from 'vue'\nimport { isObject, onlyDefinedProps, propsFactory } from '@/util'\n\n// Types\nimport type { Component, FunctionalComponent, Prop, TransitionProps } from 'vue'\n\nexport const makeTransitionProps = propsFactory({\n transition: {\n type: null,\n default: 'fade-transition',\n validator: val => val !== true,\n } as Prop<null | string | boolean | TransitionProps & { component?: Component }>,\n}, 'transition')\n\ninterface MaybeTransitionProps extends TransitionProps {\n transition?: null | string | boolean | TransitionProps & { component?: any }\n disabled?: boolean\n group?: boolean\n}\n\nexport const MaybeTransition: FunctionalComponent<MaybeTransitionProps> = (props, { slots }) => {\n const { transition, disabled, group, ...rest } = props\n\n const {\n component = group ? TransitionGroup : Transition,\n ...customProps\n } = isObject(transition) ? transition : {}\n\n let transitionProps\n if (isObject(transition)) {\n transitionProps = mergeProps(\n customProps,\n onlyDefinedProps({ disabled, group }),\n rest,\n )\n } else {\n transitionProps = mergeProps(\n { name: disabled || !transition ? '' : transition },\n rest,\n )\n }\n\n return h(\n component,\n transitionProps,\n slots\n )\n}\n"],"mappings":"AAAA;AACA,SAASA,CAAC,EAAEC,UAAU,EAAEC,UAAU,EAAEC,eAAe,QAAQ,KAAK;AAAA,SACvDC,QAAQ,EAAEC,gBAAgB,EAAEC,YAAY,4BAEjD;AAGA,OAAO,MAAMC,mBAAmB,GAAGD,YAAY,CAAC;EAC9CE,UAAU,EAAE;IACVC,IAAI,EAAE,IAAI;IACVC,OAAO,EAAE,iBAAiB;IAC1BC,SAAS,EAAEC,GAAG,IAAIA,GAAG,KAAK;EAC5B;AACF,CAAC,EAAE,YAAY,CAAC;AAQhB,OAAO,MAAMC,eAA0D,GAAGA,CAACC,KAAK,EAAAC,IAAA,KAAgB;EAAA,IAAd;IAAEC;EAAM,CAAC,GAAAD,IAAA;EACzF,MAAM;IAAEP,UAAU;IAAES,QAAQ;IAAEC,KAAK;IAAE,GAAGC;EAAK,CAAC,GAAGL,KAAK;EAEtD,MAAM;IACJM,SAAS,GAAGF,KAAK,GAAGf,eAAe,GAAGD,UAAU;IAChD,GAAGmB;EACL,CAAC,GAAGjB,QAAQ,CAACI,UAAU,CAAC,GAAGA,UAAU,GAAG,CAAC,CAAC;EAE1C,IAAIc,eAAe;EACnB,IAAIlB,QAAQ,CAACI,UAAU,CAAC,EAAE;IACxBc,eAAe,GAAGrB,UAAU,CAC1BoB,WAAW,EACXhB,gBAAgB,CAAC;MAAEY,QAAQ;MAAEC;IAAM,CAAC,CAAC,EACrCC,IACF,CAAC;EACH,CAAC,MAAM;IACLG,eAAe,GAAGrB,UAAU,CAC1B;MAAEsB,IAAI,EAAEN,QAAQ,IAAI,CAACT,UAAU,GAAG,EAAE,GAAGA;IAAW,CAAC,EACnDW,IACF,CAAC;EACH;EAEA,OAAOnB,CAAC,CACNoB,SAAS,EACTE,eAAe,EACfN,KACF,CAAC;AACH,CAAC","ignoreList":[]}
|
package/lib/entry-bundler.js
CHANGED
@@ -16,7 +16,7 @@ export const createVuetify = function () {
|
|
16
16
|
...options
|
17
17
|
});
|
18
18
|
};
|
19
|
-
export const version = "3.8.9-master.2025-06-
|
19
|
+
export const version = "3.8.9-master.2025-06-13";
|
20
20
|
createVuetify.version = version;
|
21
21
|
export { blueprints, components, directives };
|
22
22
|
export * from "./composables/index.js";
|
package/lib/framework.d.ts
CHANGED
@@ -2545,61 +2545,64 @@ declare module 'vue' {
|
|
2545
2545
|
$children?: VNodeChild
|
2546
2546
|
}
|
2547
2547
|
export interface GlobalComponents {
|
2548
|
-
VApp: typeof import('vuetify/components')['VApp']
|
2549
2548
|
VAppBar: typeof import('vuetify/components')['VAppBar']
|
2550
2549
|
VAppBarNavIcon: typeof import('vuetify/components')['VAppBarNavIcon']
|
2551
2550
|
VAppBarTitle: typeof import('vuetify/components')['VAppBarTitle']
|
2552
|
-
|
2553
|
-
VAvatar: typeof import('vuetify/components')['VAvatar']
|
2554
|
-
VAutocomplete: typeof import('vuetify/components')['VAutocomplete']
|
2555
|
-
VBanner: typeof import('vuetify/components')['VBanner']
|
2556
|
-
VBannerActions: typeof import('vuetify/components')['VBannerActions']
|
2557
|
-
VBannerText: typeof import('vuetify/components')['VBannerText']
|
2551
|
+
VApp: typeof import('vuetify/components')['VApp']
|
2558
2552
|
VAlert: typeof import('vuetify/components')['VAlert']
|
2559
2553
|
VAlertTitle: typeof import('vuetify/components')['VAlertTitle']
|
2560
|
-
|
2561
|
-
|
2554
|
+
VAvatar: typeof import('vuetify/components')['VAvatar']
|
2555
|
+
VAutocomplete: typeof import('vuetify/components')['VAutocomplete']
|
2562
2556
|
VBreadcrumbs: typeof import('vuetify/components')['VBreadcrumbs']
|
2563
2557
|
VBreadcrumbsItem: typeof import('vuetify/components')['VBreadcrumbsItem']
|
2564
2558
|
VBreadcrumbsDivider: typeof import('vuetify/components')['VBreadcrumbsDivider']
|
2559
|
+
VBadge: typeof import('vuetify/components')['VBadge']
|
2565
2560
|
VBottomSheet: typeof import('vuetify/components')['VBottomSheet']
|
2561
|
+
VBottomNavigation: typeof import('vuetify/components')['VBottomNavigation']
|
2562
|
+
VBtnToggle: typeof import('vuetify/components')['VBtnToggle']
|
2563
|
+
VBtn: typeof import('vuetify/components')['VBtn']
|
2566
2564
|
VCard: typeof import('vuetify/components')['VCard']
|
2567
2565
|
VCardActions: typeof import('vuetify/components')['VCardActions']
|
2568
2566
|
VCardItem: typeof import('vuetify/components')['VCardItem']
|
2569
2567
|
VCardSubtitle: typeof import('vuetify/components')['VCardSubtitle']
|
2570
2568
|
VCardText: typeof import('vuetify/components')['VCardText']
|
2571
2569
|
VCardTitle: typeof import('vuetify/components')['VCardTitle']
|
2570
|
+
VBtnGroup: typeof import('vuetify/components')['VBtnGroup']
|
2572
2571
|
VCheckbox: typeof import('vuetify/components')['VCheckbox']
|
2573
2572
|
VCheckboxBtn: typeof import('vuetify/components')['VCheckboxBtn']
|
2574
|
-
VBtnGroup: typeof import('vuetify/components')['VBtnGroup']
|
2575
|
-
VBtnToggle: typeof import('vuetify/components')['VBtnToggle']
|
2576
|
-
VCarousel: typeof import('vuetify/components')['VCarousel']
|
2577
|
-
VCarouselItem: typeof import('vuetify/components')['VCarouselItem']
|
2578
2573
|
VChip: typeof import('vuetify/components')['VChip']
|
2574
|
+
VCombobox: typeof import('vuetify/components')['VCombobox']
|
2579
2575
|
VChipGroup: typeof import('vuetify/components')['VChipGroup']
|
2580
|
-
|
2576
|
+
VCode: typeof import('vuetify/components')['VCode']
|
2577
|
+
VCarousel: typeof import('vuetify/components')['VCarousel']
|
2578
|
+
VCarouselItem: typeof import('vuetify/components')['VCarouselItem']
|
2581
2579
|
VDatePicker: typeof import('vuetify/components')['VDatePicker']
|
2582
2580
|
VDatePickerControls: typeof import('vuetify/components')['VDatePickerControls']
|
2583
2581
|
VDatePickerHeader: typeof import('vuetify/components')['VDatePickerHeader']
|
2584
2582
|
VDatePickerMonth: typeof import('vuetify/components')['VDatePickerMonth']
|
2585
2583
|
VDatePickerMonths: typeof import('vuetify/components')['VDatePickerMonths']
|
2586
2584
|
VDatePickerYears: typeof import('vuetify/components')['VDatePickerYears']
|
2587
|
-
|
2588
|
-
|
2589
|
-
|
2585
|
+
VDataTable: typeof import('vuetify/components')['VDataTable']
|
2586
|
+
VDataTableHeaders: typeof import('vuetify/components')['VDataTableHeaders']
|
2587
|
+
VDataTableFooter: typeof import('vuetify/components')['VDataTableFooter']
|
2588
|
+
VDataTableRows: typeof import('vuetify/components')['VDataTableRows']
|
2589
|
+
VDataTableRow: typeof import('vuetify/components')['VDataTableRow']
|
2590
|
+
VDataTableVirtual: typeof import('vuetify/components')['VDataTableVirtual']
|
2591
|
+
VDataTableServer: typeof import('vuetify/components')['VDataTableServer']
|
2592
|
+
VColorPicker: typeof import('vuetify/components')['VColorPicker']
|
2590
2593
|
VCounter: typeof import('vuetify/components')['VCounter']
|
2594
|
+
VDialog: typeof import('vuetify/components')['VDialog']
|
2591
2595
|
VExpansionPanels: typeof import('vuetify/components')['VExpansionPanels']
|
2592
2596
|
VExpansionPanel: typeof import('vuetify/components')['VExpansionPanel']
|
2593
2597
|
VExpansionPanelText: typeof import('vuetify/components')['VExpansionPanelText']
|
2594
2598
|
VExpansionPanelTitle: typeof import('vuetify/components')['VExpansionPanelTitle']
|
2595
2599
|
VFab: typeof import('vuetify/components')['VFab']
|
2600
|
+
VEmptyState: typeof import('vuetify/components')['VEmptyState']
|
2596
2601
|
VField: typeof import('vuetify/components')['VField']
|
2597
2602
|
VFieldLabel: typeof import('vuetify/components')['VFieldLabel']
|
2598
|
-
VEmptyState: typeof import('vuetify/components')['VEmptyState']
|
2599
2603
|
VFooter: typeof import('vuetify/components')['VFooter']
|
2600
|
-
VFileInput: typeof import('vuetify/components')['VFileInput']
|
2601
2604
|
VInfiniteScroll: typeof import('vuetify/components')['VInfiniteScroll']
|
2602
|
-
|
2605
|
+
VFileInput: typeof import('vuetify/components')['VFileInput']
|
2603
2606
|
VIcon: typeof import('vuetify/components')['VIcon']
|
2604
2607
|
VComponentIcon: typeof import('vuetify/components')['VComponentIcon']
|
2605
2608
|
VSvgIcon: typeof import('vuetify/components')['VSvgIcon']
|
@@ -2607,11 +2610,9 @@ declare module 'vue' {
|
|
2607
2610
|
VClassIcon: typeof import('vuetify/components')['VClassIcon']
|
2608
2611
|
VImg: typeof import('vuetify/components')['VImg']
|
2609
2612
|
VKbd: typeof import('vuetify/components')['VKbd']
|
2610
|
-
VDialog: typeof import('vuetify/components')['VDialog']
|
2611
|
-
VMenu: typeof import('vuetify/components')['VMenu']
|
2612
|
-
VLabel: typeof import('vuetify/components')['VLabel']
|
2613
2613
|
VItemGroup: typeof import('vuetify/components')['VItemGroup']
|
2614
2614
|
VItem: typeof import('vuetify/components')['VItem']
|
2615
|
+
VInput: typeof import('vuetify/components')['VInput']
|
2615
2616
|
VList: typeof import('vuetify/components')['VList']
|
2616
2617
|
VListGroup: typeof import('vuetify/components')['VListGroup']
|
2617
2618
|
VListImg: typeof import('vuetify/components')['VListImg']
|
@@ -2621,68 +2622,78 @@ declare module 'vue' {
|
|
2621
2622
|
VListItemSubtitle: typeof import('vuetify/components')['VListItemSubtitle']
|
2622
2623
|
VListItemTitle: typeof import('vuetify/components')['VListItemTitle']
|
2623
2624
|
VListSubheader: typeof import('vuetify/components')['VListSubheader']
|
2625
|
+
VLabel: typeof import('vuetify/components')['VLabel']
|
2626
|
+
VMenu: typeof import('vuetify/components')['VMenu']
|
2624
2627
|
VMessages: typeof import('vuetify/components')['VMessages']
|
2625
2628
|
VMain: typeof import('vuetify/components')['VMain']
|
2626
2629
|
VNavigationDrawer: typeof import('vuetify/components')['VNavigationDrawer']
|
2627
|
-
VOverlay: typeof import('vuetify/components')['VOverlay']
|
2628
2630
|
VOtpInput: typeof import('vuetify/components')['VOtpInput']
|
2629
|
-
|
2631
|
+
VDivider: typeof import('vuetify/components')['VDivider']
|
2632
|
+
VOverlay: typeof import('vuetify/components')['VOverlay']
|
2630
2633
|
VNumberInput: typeof import('vuetify/components')['VNumberInput']
|
2631
|
-
|
2634
|
+
VPagination: typeof import('vuetify/components')['VPagination']
|
2635
|
+
VProgressCircular: typeof import('vuetify/components')['VProgressCircular']
|
2632
2636
|
VRadioGroup: typeof import('vuetify/components')['VRadioGroup']
|
2637
|
+
VProgressLinear: typeof import('vuetify/components')['VProgressLinear']
|
2638
|
+
VSelect: typeof import('vuetify/components')['VSelect']
|
2633
2639
|
VRating: typeof import('vuetify/components')['VRating']
|
2634
2640
|
VSelectionControl: typeof import('vuetify/components')['VSelectionControl']
|
2635
|
-
VPagination: typeof import('vuetify/components')['VPagination']
|
2636
2641
|
VSelectionControlGroup: typeof import('vuetify/components')['VSelectionControlGroup']
|
2637
|
-
VSelect: typeof import('vuetify/components')['VSelect']
|
2638
2642
|
VSlideGroup: typeof import('vuetify/components')['VSlideGroup']
|
2639
2643
|
VSlideGroupItem: typeof import('vuetify/components')['VSlideGroupItem']
|
2640
|
-
VSkeletonLoader: typeof import('vuetify/components')['VSkeletonLoader']
|
2641
|
-
VSheet: typeof import('vuetify/components')['VSheet']
|
2642
2644
|
VSnackbar: typeof import('vuetify/components')['VSnackbar']
|
2643
|
-
|
2645
|
+
VSheet: typeof import('vuetify/components')['VSheet']
|
2646
|
+
VSkeletonLoader: typeof import('vuetify/components')['VSkeletonLoader']
|
2644
2647
|
VStepper: typeof import('vuetify/components')['VStepper']
|
2645
2648
|
VStepperActions: typeof import('vuetify/components')['VStepperActions']
|
2646
2649
|
VStepperHeader: typeof import('vuetify/components')['VStepperHeader']
|
2647
2650
|
VStepperItem: typeof import('vuetify/components')['VStepperItem']
|
2648
2651
|
VStepperWindow: typeof import('vuetify/components')['VStepperWindow']
|
2649
2652
|
VStepperWindowItem: typeof import('vuetify/components')['VStepperWindowItem']
|
2653
|
+
VSlider: typeof import('vuetify/components')['VSlider']
|
2650
2654
|
VSwitch: typeof import('vuetify/components')['VSwitch']
|
2655
|
+
VSystemBar: typeof import('vuetify/components')['VSystemBar']
|
2656
|
+
VTable: typeof import('vuetify/components')['VTable']
|
2651
2657
|
VTab: typeof import('vuetify/components')['VTab']
|
2652
2658
|
VTabs: typeof import('vuetify/components')['VTabs']
|
2653
2659
|
VTabsWindow: typeof import('vuetify/components')['VTabsWindow']
|
2654
2660
|
VTabsWindowItem: typeof import('vuetify/components')['VTabsWindowItem']
|
2655
|
-
|
2661
|
+
VTextarea: typeof import('vuetify/components')['VTextarea']
|
2662
|
+
VTextField: typeof import('vuetify/components')['VTextField']
|
2656
2663
|
VTimeline: typeof import('vuetify/components')['VTimeline']
|
2657
2664
|
VTimelineItem: typeof import('vuetify/components')['VTimelineItem']
|
2658
|
-
VTextField: typeof import('vuetify/components')['VTextField']
|
2659
|
-
VTable: typeof import('vuetify/components')['VTable']
|
2660
|
-
VTooltip: typeof import('vuetify/components')['VTooltip']
|
2661
|
-
VTextarea: typeof import('vuetify/components')['VTextarea']
|
2662
2665
|
VToolbar: typeof import('vuetify/components')['VToolbar']
|
2663
2666
|
VToolbarTitle: typeof import('vuetify/components')['VToolbarTitle']
|
2664
2667
|
VToolbarItems: typeof import('vuetify/components')['VToolbarItems']
|
2665
2668
|
VWindow: typeof import('vuetify/components')['VWindow']
|
2666
2669
|
VWindowItem: typeof import('vuetify/components')['VWindowItem']
|
2670
|
+
VTooltip: typeof import('vuetify/components')['VTooltip']
|
2671
|
+
VDataIterator: typeof import('vuetify/components')['VDataIterator']
|
2667
2672
|
VConfirmEdit: typeof import('vuetify/components')['VConfirmEdit']
|
2668
2673
|
VDefaultsProvider: typeof import('vuetify/components')['VDefaultsProvider']
|
2669
|
-
VDataIterator: typeof import('vuetify/components')['VDataIterator']
|
2670
2674
|
VForm: typeof import('vuetify/components')['VForm']
|
2675
|
+
VContainer: typeof import('vuetify/components')['VContainer']
|
2676
|
+
VCol: typeof import('vuetify/components')['VCol']
|
2677
|
+
VRow: typeof import('vuetify/components')['VRow']
|
2678
|
+
VSpacer: typeof import('vuetify/components')['VSpacer']
|
2671
2679
|
VHover: typeof import('vuetify/components')['VHover']
|
2672
|
-
VLazy: typeof import('vuetify/components')['VLazy']
|
2673
2680
|
VLayout: typeof import('vuetify/components')['VLayout']
|
2674
2681
|
VLayoutItem: typeof import('vuetify/components')['VLayoutItem']
|
2682
|
+
VLazy: typeof import('vuetify/components')['VLazy']
|
2675
2683
|
VLocaleProvider: typeof import('vuetify/components')['VLocaleProvider']
|
2684
|
+
VNoSsr: typeof import('vuetify/components')['VNoSsr']
|
2676
2685
|
VParallax: typeof import('vuetify/components')['VParallax']
|
2677
|
-
|
2686
|
+
VRadio: typeof import('vuetify/components')['VRadio']
|
2678
2687
|
VResponsive: typeof import('vuetify/components')['VResponsive']
|
2679
2688
|
VSnackbarQueue: typeof import('vuetify/components')['VSnackbarQueue']
|
2680
2689
|
VSparkline: typeof import('vuetify/components')['VSparkline']
|
2681
2690
|
VSpeedDial: typeof import('vuetify/components')['VSpeedDial']
|
2691
|
+
VBanner: typeof import('vuetify/components')['VBanner']
|
2692
|
+
VBannerActions: typeof import('vuetify/components')['VBannerActions']
|
2693
|
+
VBannerText: typeof import('vuetify/components')['VBannerText']
|
2682
2694
|
VThemeProvider: typeof import('vuetify/components')['VThemeProvider']
|
2683
|
-
VVirtualScroll: typeof import('vuetify/components')['VVirtualScroll']
|
2684
|
-
VRadio: typeof import('vuetify/components')['VRadio']
|
2685
2695
|
VValidation: typeof import('vuetify/components')['VValidation']
|
2696
|
+
VVirtualScroll: typeof import('vuetify/components')['VVirtualScroll']
|
2686
2697
|
VFabTransition: typeof import('vuetify/components')['VFabTransition']
|
2687
2698
|
VDialogBottomTransition: typeof import('vuetify/components')['VDialogBottomTransition']
|
2688
2699
|
VDialogTopTransition: typeof import('vuetify/components')['VDialogTopTransition']
|
@@ -2699,40 +2710,29 @@ declare module 'vue' {
|
|
2699
2710
|
VExpandTransition: typeof import('vuetify/components')['VExpandTransition']
|
2700
2711
|
VExpandXTransition: typeof import('vuetify/components')['VExpandXTransition']
|
2701
2712
|
VDialogTransition: typeof import('vuetify/components')['VDialogTransition']
|
2702
|
-
|
2703
|
-
VCol: typeof import('vuetify/components')['VCol']
|
2704
|
-
VRow: typeof import('vuetify/components')['VRow']
|
2705
|
-
VSpacer: typeof import('vuetify/components')['VSpacer']
|
2706
|
-
VNoSsr: typeof import('vuetify/components')['VNoSsr']
|
2707
|
-
VDataTable: typeof import('vuetify/components')['VDataTable']
|
2708
|
-
VDataTableHeaders: typeof import('vuetify/components')['VDataTableHeaders']
|
2709
|
-
VDataTableFooter: typeof import('vuetify/components')['VDataTableFooter']
|
2710
|
-
VDataTableRows: typeof import('vuetify/components')['VDataTableRows']
|
2711
|
-
VDataTableRow: typeof import('vuetify/components')['VDataTableRow']
|
2712
|
-
VDataTableVirtual: typeof import('vuetify/components')['VDataTableVirtual']
|
2713
|
-
VDataTableServer: typeof import('vuetify/components')['VDataTableServer']
|
2713
|
+
VRangeSlider: typeof import('vuetify/components')['VRangeSlider']
|
2714
2714
|
VCalendar: typeof import('vuetify/labs/components')['VCalendar']
|
2715
2715
|
VCalendarDay: typeof import('vuetify/labs/components')['VCalendarDay']
|
2716
2716
|
VCalendarHeader: typeof import('vuetify/labs/components')['VCalendarHeader']
|
2717
2717
|
VCalendarInterval: typeof import('vuetify/labs/components')['VCalendarInterval']
|
2718
2718
|
VCalendarIntervalEvent: typeof import('vuetify/labs/components')['VCalendarIntervalEvent']
|
2719
2719
|
VCalendarMonthDay: typeof import('vuetify/labs/components')['VCalendarMonthDay']
|
2720
|
-
|
2721
|
-
|
2722
|
-
|
2720
|
+
VIconBtn: typeof import('vuetify/labs/components')['VIconBtn']
|
2721
|
+
VStepperVertical: typeof import('vuetify/labs/components')['VStepperVertical']
|
2722
|
+
VStepperVerticalItem: typeof import('vuetify/labs/components')['VStepperVerticalItem']
|
2723
|
+
VStepperVerticalActions: typeof import('vuetify/labs/components')['VStepperVerticalActions']
|
2723
2724
|
VPicker: typeof import('vuetify/labs/components')['VPicker']
|
2724
2725
|
VPickerTitle: typeof import('vuetify/labs/components')['VPickerTitle']
|
2725
2726
|
VTimePicker: typeof import('vuetify/labs/components')['VTimePicker']
|
2726
2727
|
VTimePickerClock: typeof import('vuetify/labs/components')['VTimePickerClock']
|
2727
2728
|
VTimePickerControls: typeof import('vuetify/labs/components')['VTimePickerControls']
|
2729
|
+
VFileUpload: typeof import('vuetify/labs/components')['VFileUpload']
|
2730
|
+
VFileUploadItem: typeof import('vuetify/labs/components')['VFileUploadItem']
|
2728
2731
|
VTreeview: typeof import('vuetify/labs/components')['VTreeview']
|
2729
2732
|
VTreeviewItem: typeof import('vuetify/labs/components')['VTreeviewItem']
|
2730
2733
|
VTreeviewGroup: typeof import('vuetify/labs/components')['VTreeviewGroup']
|
2731
|
-
VIconBtn: typeof import('vuetify/labs/components')['VIconBtn']
|
2732
|
-
VStepperVertical: typeof import('vuetify/labs/components')['VStepperVertical']
|
2733
|
-
VStepperVerticalItem: typeof import('vuetify/labs/components')['VStepperVerticalItem']
|
2734
|
-
VStepperVerticalActions: typeof import('vuetify/labs/components')['VStepperVerticalActions']
|
2735
2734
|
VDateInput: typeof import('vuetify/labs/components')['VDateInput']
|
2736
2735
|
VPullToRefresh: typeof import('vuetify/labs/components')['VPullToRefresh']
|
2736
|
+
VColorInput: typeof import('vuetify/labs/components')['VColorInput']
|
2737
2737
|
}
|
2738
2738
|
}
|
package/lib/framework.js
CHANGED
@@ -5,7 +5,7 @@ import "./VTimePickerClock.css";
|
|
5
5
|
// Composables
|
6
6
|
import { useBackgroundColor, useTextColor } from "../../composables/color.js"; // Utilities
|
7
7
|
import { computed, ref, watch } from 'vue';
|
8
|
-
import { genericComponent, propsFactory, useRender } from "../../util/index.js"; // Types
|
8
|
+
import { debounce, genericComponent, propsFactory, useRender } from "../../util/index.js"; // Types
|
9
9
|
export const makeVTimePickerClockProps = propsFactory({
|
10
10
|
allowedValues: Function,
|
11
11
|
ampm: Boolean,
|
@@ -56,6 +56,7 @@ export const VTimePickerClock = genericComponent()({
|
|
56
56
|
const isDragging = ref(false);
|
57
57
|
const valueOnMouseDown = ref(null);
|
58
58
|
const valueOnMouseUp = ref(null);
|
59
|
+
const emitChangeDebounced = debounce(value => emit('change', value), 750);
|
59
60
|
const {
|
60
61
|
textColorClasses,
|
61
62
|
textColorStyles
|
@@ -101,6 +102,7 @@ export const VTimePickerClock = genericComponent()({
|
|
101
102
|
if (value !== props.displayedValue) {
|
102
103
|
update(value);
|
103
104
|
}
|
105
|
+
emitChangeDebounced(value);
|
104
106
|
}
|
105
107
|
function isInner(value) {
|
106
108
|
return props.double && value - props.min >= roundCount.value;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"VTimePickerClock.js","names":["useBackgroundColor","useTextColor","computed","ref","watch","genericComponent","propsFactory","useRender","makeVTimePickerClockProps","allowedValues","Function","ampm","Boolean","color","String","disabled","displayedValue","double","format","type","default","val","max","Number","required","min","scrollable","readonly","rotate","step","modelValue","VTimePickerClock","name","props","emits","change","input","setup","_ref","emit","clockRef","innerClockRef","inputValue","undefined","isDragging","valueOnMouseDown","valueOnMouseUp","textColorClasses","textColorStyles","backgroundColorClasses","backgroundColorStyles","count","roundCount","value","degreesPerUnit","degrees","Math","PI","innerRadiusScale","genChildren","children","push","update","isAllowed","wheel","e","preventDefault","delta","sign","deltaY","isInner","handScale","getPosition","rotateRadians","x","sin","y","cos","angleToValue","angle","insideClick","round","getTransform","i","left","top","euclidean","p0","p1","dx","dy","sqrt","center","atan2","abs","setMouseDownValue","onDragMove","width","getBoundingClientRect","innerWidth","clientX","clientY","touches","coords","handAngle","checksCount","ceil","onMouseDown","window","addEventListener","onMouseUp","stopPropagation","removeEventListener","_createElementVNode","_normalizeClass","_normalizeStyle","transform","map","isActive"],"sources":["../../../src/labs/VTimePicker/VTimePickerClock.tsx"],"sourcesContent":["// Styles\nimport './VTimePickerClock.sass'\n\n// Composables\nimport { useBackgroundColor, useTextColor } from '@/composables/color'\n\n// Utilities\nimport { computed, ref, watch } from 'vue'\nimport { genericComponent, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\ninterface Point {\n x: number\n y: number\n}\n\nexport const makeVTimePickerClockProps = propsFactory({\n allowedValues: Function as PropType<(value: number) => boolean>,\n ampm: Boolean,\n color: String,\n disabled: Boolean,\n displayedValue: null,\n double: Boolean,\n format: {\n type: Function,\n default: (val: string | number) => val,\n },\n max: {\n type: Number,\n required: true,\n },\n min: {\n type: Number,\n required: true,\n },\n scrollable: Boolean,\n readonly: Boolean,\n rotate: {\n type: Number,\n default: 0,\n },\n step: {\n type: Number,\n default: 1,\n },\n modelValue: {\n type: Number,\n },\n}, 'VTimePickerClock')\n\nexport const VTimePickerClock = genericComponent()({\n name: 'VTimePickerClock',\n\n props: makeVTimePickerClockProps(),\n\n emits: {\n change: (val: number) => true,\n input: (val: number) => true,\n },\n\n setup (props, { emit }) {\n const clockRef = ref<HTMLElement | null>(null)\n const innerClockRef = ref<HTMLElement | null>(null)\n const inputValue = ref<number | undefined>(undefined)\n const isDragging = ref(false)\n const valueOnMouseDown = ref(null as number | null)\n const valueOnMouseUp = ref(null as number | null)\n\n const { textColorClasses, textColorStyles } = useTextColor(() => props.color)\n const { backgroundColorClasses, backgroundColorStyles } = useBackgroundColor(() => props.color)\n\n const count = computed(() => props.max - props.min + 1)\n const roundCount = computed(() => props.double ? (count.value / 2) : count.value)\n const degreesPerUnit = computed(() => 360 / roundCount.value)\n const degrees = computed(() => degreesPerUnit.value * Math.PI / 180)\n const displayedValue = computed(() => props.modelValue == null ? props.min : props.modelValue)\n const innerRadiusScale = computed(() => 0.62)\n\n const genChildren = computed(() => {\n const children = []\n for (let value = props.min; value <= props.max; value = value + props.step) {\n children.push(value)\n }\n return children\n })\n\n watch(() => props.modelValue, val => {\n inputValue.value = val\n })\n\n function update (value: number) {\n if (inputValue.value !== value) {\n inputValue.value = value\n }\n emit('input', value)\n }\n\n function isAllowed (value: number) {\n return !props.allowedValues || props.allowedValues(value)\n }\n\n function wheel (e: WheelEvent) {\n if (!props.scrollable || props.disabled) return\n\n e.preventDefault()\n\n const delta = Math.sign(-e.deltaY || 1)\n let value = displayedValue.value\n do {\n value = value + delta\n value = (value - props.min + count.value) % count.value + props.min\n } while (!isAllowed(value) && value !== displayedValue.value)\n\n if (value !== props.displayedValue) {\n update(value)\n }\n }\n\n function isInner (value: number) {\n return props.double && (value - props.min >= roundCount.value)\n }\n\n function handScale (value: number) {\n return isInner(value) ? innerRadiusScale.value : 1\n }\n\n function getPosition (value: number) {\n const rotateRadians = props.rotate * Math.PI / 180\n return {\n x: Math.sin((value - props.min) * degrees.value + rotateRadians) * handScale(value),\n y: -Math.cos((value - props.min) * degrees.value + rotateRadians) * handScale(value),\n }\n }\n\n function angleToValue (angle: number, insideClick: boolean): number {\n const value = (\n Math.round(angle / degreesPerUnit.value) +\n (insideClick ? roundCount.value : 0)\n ) % count.value + props.min\n\n // Necessary to fix edge case when selecting left part of the value(s) at 12 o'clock\n if (angle < (360 - degreesPerUnit.value / 2)) return value\n\n return insideClick ? props.max - roundCount.value + 1 : props.min\n }\n\n function getTransform (i: number) {\n const { x, y } = getPosition(i)\n return {\n left: `${Math.round(50 + x * 50)}%`,\n top: `${Math.round(50 + y * 50)}%`,\n }\n }\n\n function euclidean (p0: Point, p1: Point) {\n const dx = p1.x - p0.x\n const dy = p1.y - p0.y\n\n return Math.sqrt(dx * dx + dy * dy)\n }\n\n function angle (center: Point, p1: Point) {\n const value = 2 * Math.atan2(p1.y - center.y - euclidean(center, p1), p1.x - center.x)\n return Math.abs(value * 180 / Math.PI)\n }\n\n function setMouseDownValue (value: number) {\n if (valueOnMouseDown.value === null) {\n valueOnMouseDown.value = value\n }\n\n valueOnMouseUp.value = value\n update(value)\n }\n\n function onDragMove (e: MouseEvent | TouchEvent) {\n e.preventDefault()\n if ((!isDragging.value && e.type !== 'click') || !clockRef.value) return\n const { width, top, left } = clockRef.value?.getBoundingClientRect()\n const { width: innerWidth }: DOMRect = innerClockRef.value?.getBoundingClientRect() ?? { width: 0 } as DOMRect\n const { clientX, clientY } = 'touches' in e ? e.touches[0] : e\n const center = { x: width / 2, y: -width / 2 }\n const coords = { x: clientX - left, y: top - clientY }\n const handAngle = Math.round(angle(center, coords) - props.rotate + 360) % 360\n const insideClick = props.double && euclidean(center, coords) < (innerWidth as number + innerWidth * innerRadiusScale.value) / 4\n const checksCount = Math.ceil(15 / degreesPerUnit.value)\n let value\n\n for (let i = 0; i < checksCount; i++) {\n value = angleToValue(handAngle + i * degreesPerUnit.value, insideClick)\n if (isAllowed(value)) return setMouseDownValue(value)\n\n value = angleToValue(handAngle - i * degreesPerUnit.value, insideClick)\n if (isAllowed(value)) return setMouseDownValue(value)\n }\n }\n\n function onMouseDown (e: MouseEvent | TouchEvent) {\n if (props.disabled) return\n\n e.preventDefault()\n\n window.addEventListener('mousemove', onDragMove)\n window.addEventListener('touchmove', onDragMove)\n window.addEventListener('mouseup', onMouseUp)\n window.addEventListener('touchend', onMouseUp)\n valueOnMouseDown.value = null\n valueOnMouseUp.value = null\n isDragging.value = true\n onDragMove(e)\n }\n\n function onMouseUp (e: MouseEvent | TouchEvent) {\n e.stopPropagation()\n window.removeEventListener('mousemove', onDragMove)\n window.removeEventListener('touchmove', onDragMove)\n window.removeEventListener('mouseup', onMouseUp)\n window.removeEventListener('touchend', onMouseUp)\n\n isDragging.value = false\n if (valueOnMouseUp.value !== null && isAllowed(valueOnMouseUp.value)) {\n emit('change', valueOnMouseUp.value)\n }\n }\n\n useRender(() => {\n return (\n <div\n class={[\n {\n 'v-time-picker-clock': true,\n 'v-time-picker-clock--indeterminate': props.modelValue == null,\n 'v-time-picker-clock--readonly': props.readonly,\n },\n ]}\n onMousedown={ onMouseDown }\n onTouchstart={ onMouseDown }\n onWheel={ wheel }\n ref={ clockRef }\n >\n <div class=\"v-time-picker-clock__inner\" ref={ innerClockRef }>\n <div\n class={[\n {\n 'v-time-picker-clock__hand': true,\n 'v-time-picker-clock__hand--inner': isInner(props.modelValue as number),\n },\n textColorClasses.value,\n ]}\n style={[\n {\n transform: `rotate(${props.rotate + degreesPerUnit.value * (displayedValue.value - props.min)}deg) scaleY(${handScale(displayedValue.value)})`,\n },\n textColorStyles.value,\n ]}\n />\n\n {\n genChildren.value.map(value => {\n const isActive = value === displayedValue.value\n\n return (\n <div\n class={[\n {\n 'v-time-picker-clock__item': true,\n 'v-time-picker-clock__item--active': isActive,\n 'v-time-picker-clock__item--disabled': props.disabled || !isAllowed(value),\n },\n isActive && backgroundColorClasses.value,\n ]}\n style={[\n getTransform(value),\n isActive && backgroundColorStyles.value,\n ]}\n >\n <span>{ props.format(value) }</span>\n </div>\n )\n })\n }\n </div>\n </div>\n )\n })\n },\n})\n\nexport type VTimePickerClock = InstanceType<typeof VTimePickerClock>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,kBAAkB,EAAEC,YAAY,sCAEzC;AACA,SAASC,QAAQ,EAAEC,GAAG,EAAEC,KAAK,QAAQ,KAAK;AAAA,SACjCC,gBAAgB,EAAEC,YAAY,EAAEC,SAAS,+BAElD;AAOA,OAAO,MAAMC,yBAAyB,GAAGF,YAAY,CAAC;EACpDG,aA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,IAAI,CAACgD,SAAS,CAACV,KAAK;UAC3E,CAAC,EACDiE,QAAQ,IAAIrE,sBAAsB,CAACI,KAAK,CACzC;UAAA,SAAA8D,eAAA,CACM,CACLjC,YAAY,CAAC7B,KAAK,CAAC,EACnBiE,QAAQ,IAAIpE,qBAAqB,CAACG,KAAK,CACxC;QAAA,IAAA4D,mBAAA,gBAEOhF,KAAK,CAACf,MAAM,CAACmC,KAAK,CAAC;MAGjC,CAAC,CAAC;IAKZ,CAAC,CAAC;EACJ;AACF,CAAC,CAAC","ignoreList":[]}
|
1
|
+
{"version":3,"file":"VTimePickerClock.js","names":["useBackgroundColor","useTextColor","computed","ref","watch","debounce","genericComponent","propsFactory","useRender","makeVTimePickerClockProps","allowedValues","Function","ampm","Boolean","color","String","disabled","displayedValue","double","format","type","default","val","max","Number","required","min","scrollable","readonly","rotate","step","modelValue","VTimePickerClock","name","props","emits","change","input","setup","_ref","emit","clockRef","innerClockRef","inputValue","undefined","isDragging","valueOnMouseDown","valueOnMouseUp","emitChangeDebounced","value","textColorClasses","textColorStyles","backgroundColorClasses","backgroundColorStyles","count","roundCount","degreesPerUnit","degrees","Math","PI","innerRadiusScale","genChildren","children","push","update","isAllowed","wheel","e","preventDefault","delta","sign","deltaY","isInner","handScale","getPosition","rotateRadians","x","sin","y","cos","angleToValue","angle","insideClick","round","getTransform","i","left","top","euclidean","p0","p1","dx","dy","sqrt","center","atan2","abs","setMouseDownValue","onDragMove","width","getBoundingClientRect","innerWidth","clientX","clientY","touches","coords","handAngle","checksCount","ceil","onMouseDown","window","addEventListener","onMouseUp","stopPropagation","removeEventListener","_createElementVNode","_normalizeClass","_normalizeStyle","transform","map","isActive"],"sources":["../../../src/labs/VTimePicker/VTimePickerClock.tsx"],"sourcesContent":["// Styles\nimport './VTimePickerClock.sass'\n\n// Composables\nimport { useBackgroundColor, useTextColor } from '@/composables/color'\n\n// Utilities\nimport { computed, ref, watch } from 'vue'\nimport { debounce, genericComponent, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\ninterface Point {\n x: number\n y: number\n}\n\nexport const makeVTimePickerClockProps = propsFactory({\n allowedValues: Function as PropType<(value: number) => boolean>,\n ampm: Boolean,\n color: String,\n disabled: Boolean,\n displayedValue: null,\n double: Boolean,\n format: {\n type: Function,\n default: (val: string | number) => val,\n },\n max: {\n type: Number,\n required: true,\n },\n min: {\n type: Number,\n required: true,\n },\n scrollable: Boolean,\n readonly: Boolean,\n rotate: {\n type: Number,\n default: 0,\n },\n step: {\n type: Number,\n default: 1,\n },\n modelValue: {\n type: Number,\n },\n}, 'VTimePickerClock')\n\nexport const VTimePickerClock = genericComponent()({\n name: 'VTimePickerClock',\n\n props: makeVTimePickerClockProps(),\n\n emits: {\n change: (val: number) => true,\n input: (val: number) => true,\n },\n\n setup (props, { emit }) {\n const clockRef = ref<HTMLElement | null>(null)\n const innerClockRef = ref<HTMLElement | null>(null)\n const inputValue = ref<number | undefined>(undefined)\n const isDragging = ref(false)\n const valueOnMouseDown = ref(null as number | null)\n const valueOnMouseUp = ref(null as number | null)\n const emitChangeDebounced = debounce((value: number) => emit('change', value), 750)\n\n const { textColorClasses, textColorStyles } = useTextColor(() => props.color)\n const { backgroundColorClasses, backgroundColorStyles } = useBackgroundColor(() => props.color)\n\n const count = computed(() => props.max - props.min + 1)\n const roundCount = computed(() => props.double ? (count.value / 2) : count.value)\n const degreesPerUnit = computed(() => 360 / roundCount.value)\n const degrees = computed(() => degreesPerUnit.value * Math.PI / 180)\n const displayedValue = computed(() => props.modelValue == null ? props.min : props.modelValue)\n const innerRadiusScale = computed(() => 0.62)\n\n const genChildren = computed(() => {\n const children = []\n for (let value = props.min; value <= props.max; value = value + props.step) {\n children.push(value)\n }\n return children\n })\n\n watch(() => props.modelValue, val => {\n inputValue.value = val\n })\n\n function update (value: number) {\n if (inputValue.value !== value) {\n inputValue.value = value\n }\n emit('input', value)\n }\n\n function isAllowed (value: number) {\n return !props.allowedValues || props.allowedValues(value)\n }\n\n function wheel (e: WheelEvent) {\n if (!props.scrollable || props.disabled) return\n\n e.preventDefault()\n\n const delta = Math.sign(-e.deltaY || 1)\n let value = displayedValue.value\n do {\n value = value + delta\n value = (value - props.min + count.value) % count.value + props.min\n } while (!isAllowed(value) && value !== displayedValue.value)\n\n if (value !== props.displayedValue) {\n update(value)\n }\n\n emitChangeDebounced(value)\n }\n\n function isInner (value: number) {\n return props.double && (value - props.min >= roundCount.value)\n }\n\n function handScale (value: number) {\n return isInner(value) ? innerRadiusScale.value : 1\n }\n\n function getPosition (value: number) {\n const rotateRadians = props.rotate * Math.PI / 180\n return {\n x: Math.sin((value - props.min) * degrees.value + rotateRadians) * handScale(value),\n y: -Math.cos((value - props.min) * degrees.value + rotateRadians) * handScale(value),\n }\n }\n\n function angleToValue (angle: number, insideClick: boolean): number {\n const value = (\n Math.round(angle / degreesPerUnit.value) +\n (insideClick ? roundCount.value : 0)\n ) % count.value + props.min\n\n // Necessary to fix edge case when selecting left part of the value(s) at 12 o'clock\n if (angle < (360 - degreesPerUnit.value / 2)) return value\n\n return insideClick ? props.max - roundCount.value + 1 : props.min\n }\n\n function getTransform (i: number) {\n const { x, y } = getPosition(i)\n return {\n left: `${Math.round(50 + x * 50)}%`,\n top: `${Math.round(50 + y * 50)}%`,\n }\n }\n\n function euclidean (p0: Point, p1: Point) {\n const dx = p1.x - p0.x\n const dy = p1.y - p0.y\n\n return Math.sqrt(dx * dx + dy * dy)\n }\n\n function angle (center: Point, p1: Point) {\n const value = 2 * Math.atan2(p1.y - center.y - euclidean(center, p1), p1.x - center.x)\n return Math.abs(value * 180 / Math.PI)\n }\n\n function setMouseDownValue (value: number) {\n if (valueOnMouseDown.value === null) {\n valueOnMouseDown.value = value\n }\n\n valueOnMouseUp.value = value\n update(value)\n }\n\n function onDragMove (e: MouseEvent | TouchEvent) {\n e.preventDefault()\n if ((!isDragging.value && e.type !== 'click') || !clockRef.value) return\n const { width, top, left } = clockRef.value?.getBoundingClientRect()\n const { width: innerWidth }: DOMRect = innerClockRef.value?.getBoundingClientRect() ?? { width: 0 } as DOMRect\n const { clientX, clientY } = 'touches' in e ? e.touches[0] : e\n const center = { x: width / 2, y: -width / 2 }\n const coords = { x: clientX - left, y: top - clientY }\n const handAngle = Math.round(angle(center, coords) - props.rotate + 360) % 360\n const insideClick = props.double && euclidean(center, coords) < (innerWidth as number + innerWidth * innerRadiusScale.value) / 4\n const checksCount = Math.ceil(15 / degreesPerUnit.value)\n let value\n\n for (let i = 0; i < checksCount; i++) {\n value = angleToValue(handAngle + i * degreesPerUnit.value, insideClick)\n if (isAllowed(value)) return setMouseDownValue(value)\n\n value = angleToValue(handAngle - i * degreesPerUnit.value, insideClick)\n if (isAllowed(value)) return setMouseDownValue(value)\n }\n }\n\n function onMouseDown (e: MouseEvent | TouchEvent) {\n if (props.disabled) return\n\n e.preventDefault()\n\n window.addEventListener('mousemove', onDragMove)\n window.addEventListener('touchmove', onDragMove)\n window.addEventListener('mouseup', onMouseUp)\n window.addEventListener('touchend', onMouseUp)\n valueOnMouseDown.value = null\n valueOnMouseUp.value = null\n isDragging.value = true\n onDragMove(e)\n }\n\n function onMouseUp (e: MouseEvent | TouchEvent) {\n e.stopPropagation()\n window.removeEventListener('mousemove', onDragMove)\n window.removeEventListener('touchmove', onDragMove)\n window.removeEventListener('mouseup', onMouseUp)\n window.removeEventListener('touchend', onMouseUp)\n\n isDragging.value = false\n if (valueOnMouseUp.value !== null && isAllowed(valueOnMouseUp.value)) {\n emit('change', valueOnMouseUp.value)\n }\n }\n\n useRender(() => {\n return (\n <div\n class={[\n {\n 'v-time-picker-clock': true,\n 'v-time-picker-clock--indeterminate': props.modelValue == null,\n 'v-time-picker-clock--readonly': props.readonly,\n },\n ]}\n onMousedown={ onMouseDown }\n onTouchstart={ onMouseDown }\n onWheel={ wheel }\n ref={ clockRef }\n >\n <div class=\"v-time-picker-clock__inner\" ref={ innerClockRef }>\n <div\n class={[\n {\n 'v-time-picker-clock__hand': true,\n 'v-time-picker-clock__hand--inner': isInner(props.modelValue as number),\n },\n textColorClasses.value,\n ]}\n style={[\n {\n transform: `rotate(${props.rotate + degreesPerUnit.value * (displayedValue.value - props.min)}deg) scaleY(${handScale(displayedValue.value)})`,\n },\n textColorStyles.value,\n ]}\n />\n\n {\n genChildren.value.map(value => {\n const isActive = value === displayedValue.value\n\n return (\n <div\n class={[\n {\n 'v-time-picker-clock__item': true,\n 'v-time-picker-clock__item--active': isActive,\n 'v-time-picker-clock__item--disabled': props.disabled || !isAllowed(value),\n },\n isActive && backgroundColorClasses.value,\n ]}\n style={[\n getTransform(value),\n isActive && backgroundColorStyles.value,\n ]}\n >\n <span>{ props.format(value) }</span>\n </div>\n )\n })\n }\n </div>\n </div>\n )\n })\n },\n})\n\nexport type VTimePickerClock = InstanceType<typeof VTimePickerClock>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,kBAAkB,EAAEC,YAAY,sCAEzC;AACA,SAASC,QAAQ,EAAEC,GAAG,EAAEC,KAAK,QAAQ,KAAK;AAAA,SACjCC,QAAQ,EAAEC,gBAAgB,EAAEC,YAAY,EAAEC,SAAS,+BAE5D;AAOA,OAAO,MAAMC,yBAAyB,GAAGF,YAAY,CAAC;EACpDG,aAAa,EAAEC,QAAgD;EAC/DC,IAAI,EAAEC,OAAO;EACbC,KAAK,EAAEC,MAAM;EACbC,QAAQ,EAAEH,OAAO;EACjBI,cAAc,EAAE,IAAI;EACpBC,MAAM,EAAEL,OAAO;EACfM,MAAM,EAAE;IACNC,IAAI,EAAET,QAAQ;IACdU,OAAO,EAAGC,GAAoB,IAAKA;EACrC,CAAC;EACDC,GAAG,EAAE;IACHH,IAAI,EAAEI,MAAM;IACZC,QAAQ,EAAE;EACZ,CAAC;EACDC,GAAG,EAAE;IACHN,IAAI,EAAEI,MAAM;IACZC,QAAQ,EAAE;EACZ,CAAC;EACDE,UAAU,EAAEd,OAAO;EACnBe,QAAQ,EAAEf,OAAO;EACjBgB,MAAM,EAAE;IACNT,IAAI,E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CAAC,CAAC","ignoreList":[]}
|
package/lib/util/helpers.d.ts
CHANGED
@@ -126,4 +126,7 @@ export type Primitive = string | number | boolean | symbol | bigint;
|
|
126
126
|
export declare function isPrimitive(value: unknown): value is Primitive;
|
127
127
|
export declare function extractNumber(text: string, decimalDigitsLimit: number | null): string;
|
128
128
|
export declare function camelizeProps<T extends Record<string, unknown>>(props: T | null): T;
|
129
|
+
export declare function onlyDefinedProps(props: Record<string, any>): {
|
130
|
+
[k: string]: any;
|
131
|
+
};
|
129
132
|
|
package/lib/util/helpers.js
CHANGED
@@ -555,4 +555,11 @@ export function camelizeProps(props) {
|
|
555
555
|
}
|
556
556
|
return out;
|
557
557
|
}
|
558
|
+
export function onlyDefinedProps(props) {
|
559
|
+
const booleanAttributes = ['checked', 'disabled'];
|
560
|
+
return Object.fromEntries(Object.entries(props).filter(_ref => {
|
561
|
+
let [key, v] = _ref;
|
562
|
+
return booleanAttributes.includes(key) ? !!v : v !== undefined;
|
563
|
+
}));
|
564
|
+
}
|
558
565
|
//# sourceMappingURL=helpers.js.map
|