@flux-ui/internals 3.0.0-next.6 → 3.0.0-next.60

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.
Files changed (88) hide show
  1. package/README.md +36 -0
  2. package/dist/composable/index.d.ts +2 -17
  3. package/dist/composable/index.js +1 -0
  4. package/dist/composable-Cp0PgZry.js +2 -0
  5. package/dist/composable-Cp0PgZry.js.map +1 -0
  6. package/dist/data/index.d.ts +246 -1
  7. package/dist/data/index.d.ts.map +1 -0
  8. package/dist/data/index.js +2 -0
  9. package/dist/data/index.js.map +1 -0
  10. package/dist/directive/index.d.ts +2 -3
  11. package/dist/directive/index.js +1 -0
  12. package/dist/directive-Dprka-AO.js +2 -0
  13. package/dist/directive-Dprka-AO.js.map +1 -0
  14. package/dist/index-4qwf2pQQ.d.ts +136 -0
  15. package/dist/index-4qwf2pQQ.d.ts.map +1 -0
  16. package/dist/index-B79OP5Th.d.ts +70 -0
  17. package/dist/index-B79OP5Th.d.ts.map +1 -0
  18. package/dist/index-BRS2s2tX.d.ts +14 -0
  19. package/dist/index-BRS2s2tX.d.ts.map +1 -0
  20. package/dist/index.d.ts +5 -4
  21. package/dist/index.js +1 -0
  22. package/dist/util/index.d.ts +2 -13
  23. package/dist/util/index.js +1 -0
  24. package/dist/util-CwaOsSvo.js +2 -0
  25. package/dist/util-CwaOsSvo.js.map +1 -0
  26. package/package.json +33 -18
  27. package/src/composable/index.ts +3 -5
  28. package/src/composable/useCalendar.ts +1 -1
  29. package/src/composable/useCalendarMonthSwitcher.ts +1 -2
  30. package/src/composable/useCalendarTimeGrid.ts +103 -0
  31. package/src/composable/useCalendarYearSwitcher.ts +1 -2
  32. package/src/composable/useFocusTrap.ts +3 -5
  33. package/src/composable/useFocusTrapLock.ts +1 -2
  34. package/src/composable/useFocusTrapReturn.ts +11 -7
  35. package/src/composable/useFocusTrapSubscription.ts +1 -2
  36. package/src/composable/useFocusZone.ts +10 -9
  37. package/src/composable/useInView.ts +2 -4
  38. package/src/composable/useKeyboardGrab.ts +152 -0
  39. package/src/composable/useRemembered.ts +1 -2
  40. package/src/composable/useScrollEdges.ts +68 -0
  41. package/src/composable/useScrollPosition.ts +1 -2
  42. package/src/directive/focusTrap.ts +4 -0
  43. package/src/directive/heightTransition.ts +6 -2
  44. package/src/directive/index.ts +1 -1
  45. package/src/util/animationFrameDebounce.ts +15 -0
  46. package/src/util/flattenVNodeTree.ts +1 -2
  47. package/src/util/focusTrap.ts +2 -1
  48. package/src/util/index.ts +2 -1
  49. package/src/util/unrefTemplateElement.ts +1 -1
  50. package/dist/composable/useCalendar.d.ts +0 -20
  51. package/dist/composable/useCalendarMonthSwitcher.d.ts +0 -10
  52. package/dist/composable/useCalendarYearSwitcher.d.ts +0 -8
  53. package/dist/composable/useClickOutside.d.ts +0 -4
  54. package/dist/composable/useComponentId.d.ts +0 -2
  55. package/dist/composable/useDebouncedRef.d.ts +0 -2
  56. package/dist/composable/useEventListener.d.ts +0 -2
  57. package/dist/composable/useFocusTrap.d.ts +0 -8
  58. package/dist/composable/useFocusTrapLock.d.ts +0 -2
  59. package/dist/composable/useFocusTrapReturn.d.ts +0 -2
  60. package/dist/composable/useFocusTrapSubscription.d.ts +0 -2
  61. package/dist/composable/useFocusZone.d.ts +0 -6
  62. package/dist/composable/useInView.d.ts +0 -6
  63. package/dist/composable/useInterval.d.ts +0 -2
  64. package/dist/composable/useMutationObserver.d.ts +0 -2
  65. package/dist/composable/useRemembered.d.ts +0 -2
  66. package/dist/composable/useScrollPosition.d.ts +0 -7
  67. package/dist/data/color.d.ts +0 -242
  68. package/dist/directive/focusTrap.d.ts +0 -5
  69. package/dist/directive/heightTransition.d.ts +0 -5
  70. package/dist/flux-internals.js +0 -4
  71. package/dist/flux-internals.js.map +0 -42
  72. package/dist/util/flattenVNodeTree.d.ts +0 -2
  73. package/dist/util/focusTrap.d.ts +0 -8
  74. package/dist/util/getBidirectionalFocusElement.d.ts +0 -1
  75. package/dist/util/getComponentName.d.ts +0 -7
  76. package/dist/util/getComponentProps.d.ts +0 -1
  77. package/dist/util/getExposedRef.d.ts +0 -2
  78. package/dist/util/getFocusableElement.d.ts +0 -1
  79. package/dist/util/getFocusableElements.d.ts +0 -1
  80. package/dist/util/getKeyboardFocusableElements.d.ts +0 -1
  81. package/dist/util/unrefTemplateElement.d.ts +0 -4
  82. package/dist/util/warn.d.ts +0 -1
  83. package/dist/util/wrapFocus.d.ts +0 -1
  84. package/src/composable/useClickOutside.ts +0 -38
  85. package/src/composable/useComponentId.ts +0 -8
  86. package/src/composable/useDebouncedRef.ts +0 -38
  87. package/src/composable/useInterval.ts +0 -23
  88. package/src/composable/useMutationObserver.ts +0 -38
@@ -1,38 +0,0 @@
1
- import type { Ref } from 'vue';
2
- import { customRef, isRef, ref, watch } from 'vue';
3
-
4
- export default function <T>(initialValue: Ref<T> | T, delay: number, immediate: boolean = false): Ref<T> {
5
- const state = ref(isRef(initialValue) ? initialValue.value : initialValue);
6
-
7
- const debounced = customRef((track, trigger) => ({
8
- get() {
9
- track();
10
- return state.value;
11
- },
12
-
13
- set: debounce(value => {
14
- state.value = value;
15
- trigger();
16
- }, delay, immediate)
17
- })) as Ref<T>;
18
-
19
- if (isRef(initialValue)) {
20
- watch(initialValue, value => debounced.value = value);
21
- }
22
-
23
- return debounced;
24
- }
25
-
26
- function debounce<TFunc extends (...args: any[]) => any>(fn: TFunc, delay: number, immediate: boolean = false): VoidFunction {
27
- let timeout: any;
28
-
29
- return (...args: any[]) => {
30
- if (immediate && !timeout) {
31
- fn(...args);
32
- }
33
-
34
- clearTimeout(timeout);
35
-
36
- timeout = setTimeout(() => requestAnimationFrame(() => fn(...args)), delay);
37
- };
38
- }
@@ -1,23 +0,0 @@
1
- import type { Ref } from 'vue';
2
- import { onMounted, onUnmounted, ref, unref } from 'vue';
3
-
4
- export default function (interval: Ref<number> | number, fn: Function): void {
5
- const intervalRef = ref<any>();
6
-
7
- onMounted(() => {
8
- tick();
9
- });
10
-
11
- onUnmounted(() => {
12
- clearTimeout(intervalRef.value);
13
- });
14
-
15
- function schedule(): void {
16
- intervalRef.value = setTimeout(() => requestAnimationFrame(tick), unref(interval));
17
- }
18
-
19
- function tick(): void {
20
- schedule();
21
- fn();
22
- }
23
- }
@@ -1,38 +0,0 @@
1
- import { onScopeDispose, watch } from 'vue';
2
- import type { TemplateRef } from '../util';
3
- import { unrefTemplateElement } from '../util';
4
-
5
- export default function <TElement extends HTMLElement>(elementRef: TemplateRef<TElement>, callback: MutationCallback, options?: MutationObserverInit): void {
6
- options ??= {
7
- attributes: true
8
- };
9
-
10
- let observer: MutationObserver | undefined;
11
-
12
- const stop = watch(() => unrefTemplateElement(elementRef), element => {
13
- cleanup();
14
-
15
- if (!element) {
16
- return;
17
- }
18
-
19
- observer = new MutationObserver(callback);
20
- observer.observe(element, options);
21
- }, {immediate: true});
22
-
23
- function cleanup(): void {
24
- if (!observer) {
25
- return;
26
- }
27
-
28
- observer.disconnect();
29
- observer = undefined;
30
- }
31
-
32
- function dispose(): void {
33
- cleanup();
34
- stop();
35
- }
36
-
37
- onScopeDispose(dispose);
38
- }