directix 1.4.0 → 1.5.0
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/README.md +853 -8
- package/dist/index.cjs +6024 -511
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2587 -110
- package/dist/index.iife.js +6006 -513
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +2 -2
- package/dist/index.mjs +6007 -514
- package/dist/index.mjs.map +1 -1
- package/package.json +65 -5
package/dist/index.d.ts
CHANGED
|
@@ -78,6 +78,23 @@ export declare interface ComposableThrottledFunction<T extends (...args: any[])
|
|
|
78
78
|
cancel: () => void;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
/**
|
|
82
|
+
* Configure permission directive
|
|
83
|
+
*/
|
|
84
|
+
export declare function configurePermission(config: PermissionConfig): void;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Context menu item
|
|
88
|
+
*/
|
|
89
|
+
export declare interface ContextMenuItem {
|
|
90
|
+
label: string;
|
|
91
|
+
handler?: () => void;
|
|
92
|
+
disabled?: boolean;
|
|
93
|
+
divider?: boolean;
|
|
94
|
+
icon?: string;
|
|
95
|
+
class?: string;
|
|
96
|
+
}
|
|
97
|
+
|
|
81
98
|
/**
|
|
82
99
|
* Countdown complete callback
|
|
83
100
|
*/
|
|
@@ -105,6 +122,11 @@ export declare interface CountdownTime {
|
|
|
105
122
|
total: number;
|
|
106
123
|
}
|
|
107
124
|
|
|
125
|
+
/**
|
|
126
|
+
* Easing type
|
|
127
|
+
*/
|
|
128
|
+
export declare type CounterEasing = 'linear' | 'easeOut' | 'easeInOut' | 'easeOutQuart' | 'easeOutExpo';
|
|
129
|
+
|
|
108
130
|
/**
|
|
109
131
|
* Create a capitalizing function with preset options
|
|
110
132
|
*
|
|
@@ -448,6 +470,11 @@ export declare const Directix: Plugin_2;
|
|
|
448
470
|
*/
|
|
449
471
|
export declare type DraggableAxis = 'x' | 'y' | 'both';
|
|
450
472
|
|
|
473
|
+
/**
|
|
474
|
+
* Export format type
|
|
475
|
+
*/
|
|
476
|
+
export declare type ExportFormat = 'csv' | 'json' | 'txt' | 'html';
|
|
477
|
+
|
|
451
478
|
/**
|
|
452
479
|
* Format number to money string
|
|
453
480
|
*/
|
|
@@ -485,6 +512,11 @@ export declare function generateId(prefix?: string): string;
|
|
|
485
512
|
*/
|
|
486
513
|
export declare function get<T = any>(obj: Record<string, any>, path: string, defaultValue?: T): T;
|
|
487
514
|
|
|
515
|
+
/**
|
|
516
|
+
* Get current configuration
|
|
517
|
+
*/
|
|
518
|
+
export declare function getPermissionConfig(): PermissionConfig | null;
|
|
519
|
+
|
|
488
520
|
/**
|
|
489
521
|
* Get current Vue version
|
|
490
522
|
*/
|
|
@@ -599,11 +631,44 @@ export declare function isVue3(): boolean;
|
|
|
599
631
|
*/
|
|
600
632
|
export declare type ItemSizeFunction = (index: number) => number;
|
|
601
633
|
|
|
634
|
+
/**
|
|
635
|
+
* Lazy loading state
|
|
636
|
+
*/
|
|
637
|
+
export declare type LazyState = 'pending' | 'loading' | 'loaded' | 'error';
|
|
638
|
+
|
|
639
|
+
/**
|
|
640
|
+
* Lottie animation state
|
|
641
|
+
*/
|
|
642
|
+
export declare type LottieAnimationState = 'playing' | 'paused' | 'stopped';
|
|
643
|
+
|
|
602
644
|
/**
|
|
603
645
|
* Transform text to lowercase
|
|
604
646
|
*/
|
|
605
647
|
export declare function lowercaseText(text: string, firstOnly?: boolean): string;
|
|
606
648
|
|
|
649
|
+
/**
|
|
650
|
+
* Mutation change handler
|
|
651
|
+
*/
|
|
652
|
+
export declare type MutationHandler = (mutations: MutationRecord[], observer: MutationObserver) => void;
|
|
653
|
+
|
|
654
|
+
/**
|
|
655
|
+
* Pan gesture event data
|
|
656
|
+
*/
|
|
657
|
+
export declare interface PanEvent {
|
|
658
|
+
direction: 'left' | 'right' | 'up' | 'down';
|
|
659
|
+
deltaX: number;
|
|
660
|
+
deltaY: number;
|
|
661
|
+
distance: number;
|
|
662
|
+
x: number;
|
|
663
|
+
y: number;
|
|
664
|
+
startX: number;
|
|
665
|
+
startY: number;
|
|
666
|
+
isPanning: boolean;
|
|
667
|
+
isFirst: boolean;
|
|
668
|
+
isFinal: boolean;
|
|
669
|
+
velocity: number;
|
|
670
|
+
}
|
|
671
|
+
|
|
607
672
|
/**
|
|
608
673
|
* Parse formatted money string to number
|
|
609
674
|
*/
|
|
@@ -632,11 +697,37 @@ export declare function parseTargetTime(target: Date | number | string): number;
|
|
|
632
697
|
*/
|
|
633
698
|
export declare function parseTime(arg?: string): number | null;
|
|
634
699
|
|
|
700
|
+
/**
|
|
701
|
+
* Permission configuration
|
|
702
|
+
*/
|
|
703
|
+
declare interface PermissionConfig {
|
|
704
|
+
/** Get current user's permissions */
|
|
705
|
+
getPermissions: () => string[];
|
|
706
|
+
/** Get current user's roles */
|
|
707
|
+
getRoles?: () => string[];
|
|
708
|
+
/** Role to permission mapping */
|
|
709
|
+
roleMap?: Record<string, string[]>;
|
|
710
|
+
}
|
|
711
|
+
|
|
635
712
|
/**
|
|
636
713
|
* Permission check mode
|
|
637
714
|
*/
|
|
638
715
|
export declare type PermissionMode = 'some' | 'every';
|
|
639
716
|
|
|
717
|
+
/**
|
|
718
|
+
* Pinch gesture event data
|
|
719
|
+
*/
|
|
720
|
+
export declare interface PinchEvent {
|
|
721
|
+
scale: number;
|
|
722
|
+
distance: number;
|
|
723
|
+
initialDistance: number;
|
|
724
|
+
centerX: number;
|
|
725
|
+
centerY: number;
|
|
726
|
+
isPinching: boolean;
|
|
727
|
+
isFirst: boolean;
|
|
728
|
+
isFinal: boolean;
|
|
729
|
+
}
|
|
730
|
+
|
|
640
731
|
/**
|
|
641
732
|
* Position type
|
|
642
733
|
*/
|
|
@@ -702,6 +793,20 @@ export declare interface ResizeInfo {
|
|
|
702
793
|
contentRect: DOMRectReadOnly;
|
|
703
794
|
}
|
|
704
795
|
|
|
796
|
+
/**
|
|
797
|
+
* Rotate gesture event data
|
|
798
|
+
*/
|
|
799
|
+
export declare interface RotateGestureEvent {
|
|
800
|
+
angle: number;
|
|
801
|
+
radians: number;
|
|
802
|
+
rotation: number;
|
|
803
|
+
centerX: number;
|
|
804
|
+
centerY: number;
|
|
805
|
+
isRotating: boolean;
|
|
806
|
+
isFirst: boolean;
|
|
807
|
+
isFinal: boolean;
|
|
808
|
+
}
|
|
809
|
+
|
|
705
810
|
/**
|
|
706
811
|
* Scroll direction
|
|
707
812
|
*/
|
|
@@ -739,6 +844,11 @@ export declare function set(obj: Record<string, any>, path: string, value: any):
|
|
|
739
844
|
*/
|
|
740
845
|
export declare function setVueVersion(version: VueVersion): void;
|
|
741
846
|
|
|
847
|
+
/**
|
|
848
|
+
* Skeleton animation type
|
|
849
|
+
*/
|
|
850
|
+
export declare type SkeletonAnimation = 'wave' | 'pulse' | 'none';
|
|
851
|
+
|
|
742
852
|
/**
|
|
743
853
|
* Check if Clipboard API is supported
|
|
744
854
|
*/
|
|
@@ -800,6 +910,16 @@ export declare function throttleFn<T extends (...args: any[]) => any>(fn: T, wai
|
|
|
800
910
|
trailing?: boolean;
|
|
801
911
|
}): ComposableThrottledFunction<T>;
|
|
802
912
|
|
|
913
|
+
/**
|
|
914
|
+
* Tooltip placement
|
|
915
|
+
*/
|
|
916
|
+
export declare type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';
|
|
917
|
+
|
|
918
|
+
/**
|
|
919
|
+
* Tooltip trigger
|
|
920
|
+
*/
|
|
921
|
+
export declare type TooltipTrigger = 'hover' | 'click' | 'focus' | 'manual';
|
|
922
|
+
|
|
803
923
|
/**
|
|
804
924
|
* Touch gesture type
|
|
805
925
|
*/
|
|
@@ -832,6 +952,11 @@ export declare type TrimPosition = 'start' | 'end' | 'both';
|
|
|
832
952
|
*/
|
|
833
953
|
export declare function trimText(text: string, position?: TrimPosition, chars?: string): string;
|
|
834
954
|
|
|
955
|
+
/**
|
|
956
|
+
* Truncate position
|
|
957
|
+
*/
|
|
958
|
+
export declare type TruncatePosition = 'start' | 'middle' | 'end';
|
|
959
|
+
|
|
835
960
|
/**
|
|
836
961
|
* Utility function to truncate text to a specified length
|
|
837
962
|
*
|
|
@@ -855,6 +980,68 @@ export declare function truncateText(text: string, maxLength: number, ellipsis?:
|
|
|
855
980
|
*/
|
|
856
981
|
export declare function uppercaseText(text: string, firstOnly?: boolean): string;
|
|
857
982
|
|
|
983
|
+
/**
|
|
984
|
+
* Composable for blur overlay
|
|
985
|
+
*
|
|
986
|
+
* @param options - Configuration options
|
|
987
|
+
* @returns Blur utilities
|
|
988
|
+
*
|
|
989
|
+
* @example
|
|
990
|
+
* ```vue
|
|
991
|
+
* <script setup>
|
|
992
|
+
* import { ref } from 'vue'
|
|
993
|
+
* import { useBlur } from 'directix'
|
|
994
|
+
*
|
|
995
|
+
* const { isVisible, show, hide, toggle } = useBlur({ radius: 15 })
|
|
996
|
+
* </script>
|
|
997
|
+
*
|
|
998
|
+
* <template>
|
|
999
|
+
* <button @click="toggle">Toggle Blur</button>
|
|
1000
|
+
* </template>
|
|
1001
|
+
* ```
|
|
1002
|
+
*/
|
|
1003
|
+
export declare function useBlur(options?: UseBlurOptions): UseBlurReturn;
|
|
1004
|
+
|
|
1005
|
+
/**
|
|
1006
|
+
* Options for useBlur composable
|
|
1007
|
+
*/
|
|
1008
|
+
export declare interface UseBlurOptions {
|
|
1009
|
+
/** Blur radius in pixels */
|
|
1010
|
+
radius?: number | Ref<number>;
|
|
1011
|
+
/** Whether blur is visible */
|
|
1012
|
+
visible?: boolean | Ref<boolean>;
|
|
1013
|
+
/** Transition duration */
|
|
1014
|
+
duration?: number;
|
|
1015
|
+
/** Overlay color */
|
|
1016
|
+
overlayColor?: string;
|
|
1017
|
+
/** Z-index */
|
|
1018
|
+
zIndex?: number;
|
|
1019
|
+
/** Lock scroll */
|
|
1020
|
+
lockScroll?: boolean;
|
|
1021
|
+
/** Custom class */
|
|
1022
|
+
class?: string;
|
|
1023
|
+
/** Callback on show */
|
|
1024
|
+
onShow?: () => void;
|
|
1025
|
+
/** Callback on hide */
|
|
1026
|
+
onHide?: () => void;
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
/**
|
|
1030
|
+
* Return type for useBlur composable
|
|
1031
|
+
*/
|
|
1032
|
+
export declare interface UseBlurReturn {
|
|
1033
|
+
/** Whether blur is visible */
|
|
1034
|
+
isVisible: Ref<boolean>;
|
|
1035
|
+
/** Show blur */
|
|
1036
|
+
show: () => void;
|
|
1037
|
+
/** Hide blur */
|
|
1038
|
+
hide: () => void;
|
|
1039
|
+
/** Toggle blur */
|
|
1040
|
+
toggle: () => void;
|
|
1041
|
+
/** Bind blur to an element */
|
|
1042
|
+
bind: (element: HTMLElement) => () => void;
|
|
1043
|
+
}
|
|
1044
|
+
|
|
858
1045
|
/**
|
|
859
1046
|
* Composable for capitalizing text
|
|
860
1047
|
*
|
|
@@ -1058,6 +1245,128 @@ export declare interface UseClickOutsideReturn {
|
|
|
1058
1245
|
bind: (element: HTMLElement) => () => void;
|
|
1059
1246
|
}
|
|
1060
1247
|
|
|
1248
|
+
/**
|
|
1249
|
+
* Composable for creating click wave effects (simplified ripple)
|
|
1250
|
+
*
|
|
1251
|
+
* @param options - Configuration options
|
|
1252
|
+
* @returns Wave utilities
|
|
1253
|
+
*
|
|
1254
|
+
* @example
|
|
1255
|
+
* ```vue
|
|
1256
|
+
* <script setup>
|
|
1257
|
+
* import { ref } from 'vue'
|
|
1258
|
+
* import { useClickWave } from 'directix'
|
|
1259
|
+
*
|
|
1260
|
+
* const buttonRef = ref(null)
|
|
1261
|
+
* const { bind } = useClickWave({ color: 'rgba(255, 255, 255, 0.3)' })
|
|
1262
|
+
*
|
|
1263
|
+
* onMounted(() => bind(buttonRef.value))
|
|
1264
|
+
* </script>
|
|
1265
|
+
*
|
|
1266
|
+
* <template>
|
|
1267
|
+
* <button ref="buttonRef">Click for wave</button>
|
|
1268
|
+
* </template>
|
|
1269
|
+
* ```
|
|
1270
|
+
*/
|
|
1271
|
+
export declare function useClickWave(options?: UseClickWaveOptions): UseClickWaveReturn;
|
|
1272
|
+
|
|
1273
|
+
/**
|
|
1274
|
+
* Options for useClickWave composable
|
|
1275
|
+
*/
|
|
1276
|
+
export declare interface UseClickWaveOptions {
|
|
1277
|
+
/**
|
|
1278
|
+
* Wave color
|
|
1279
|
+
* @default 'currentColor'
|
|
1280
|
+
*/
|
|
1281
|
+
color?: string | Ref<string>;
|
|
1282
|
+
/**
|
|
1283
|
+
* Wave duration in milliseconds
|
|
1284
|
+
* @default 500
|
|
1285
|
+
*/
|
|
1286
|
+
duration?: number | Ref<number>;
|
|
1287
|
+
/**
|
|
1288
|
+
* Whether to disable wave
|
|
1289
|
+
* @default false
|
|
1290
|
+
*/
|
|
1291
|
+
disabled?: boolean | Ref<boolean>;
|
|
1292
|
+
/**
|
|
1293
|
+
* Wave size ratio
|
|
1294
|
+
* @default 1.5
|
|
1295
|
+
*/
|
|
1296
|
+
sizeRatio?: number;
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
/**
|
|
1300
|
+
* Return type for useClickWave composable
|
|
1301
|
+
*/
|
|
1302
|
+
export declare interface UseClickWaveReturn {
|
|
1303
|
+
/** Bind wave effect to an element */
|
|
1304
|
+
bind: (element: HTMLElement) => () => void;
|
|
1305
|
+
/** Trigger wave effect manually */
|
|
1306
|
+
trigger: (event?: {
|
|
1307
|
+
x?: number;
|
|
1308
|
+
y?: number;
|
|
1309
|
+
}) => void;
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
/**
|
|
1313
|
+
* Composable for creating context menus
|
|
1314
|
+
*
|
|
1315
|
+
* @param options - Configuration options
|
|
1316
|
+
* @returns Context menu utilities
|
|
1317
|
+
*
|
|
1318
|
+
* @example
|
|
1319
|
+
* ```vue
|
|
1320
|
+
* <script setup>
|
|
1321
|
+
* import { ref } from 'vue'
|
|
1322
|
+
* import { useContextMenu } from 'directix'
|
|
1323
|
+
*
|
|
1324
|
+
* const containerRef = ref(null)
|
|
1325
|
+
* const items = [
|
|
1326
|
+
* { label: 'Copy', handler: () => console.log('Copy') },
|
|
1327
|
+
* { label: 'Paste', handler: () => console.log('Paste') },
|
|
1328
|
+
* { divider: true, label: '' },
|
|
1329
|
+
* { label: 'Delete', handler: () => console.log('Delete') }
|
|
1330
|
+
* ]
|
|
1331
|
+
*
|
|
1332
|
+
* const { bind } = useContextMenu({ items })
|
|
1333
|
+
*
|
|
1334
|
+
* onMounted(() => bind(containerRef.value))
|
|
1335
|
+
* </script>
|
|
1336
|
+
*
|
|
1337
|
+
* <template>
|
|
1338
|
+
* <div ref="containerRef">Right click here</div>
|
|
1339
|
+
* </template>
|
|
1340
|
+
* ```
|
|
1341
|
+
*/
|
|
1342
|
+
export declare function useContextMenu(options: UseContextMenuOptions): UseContextMenuReturn;
|
|
1343
|
+
|
|
1344
|
+
/**
|
|
1345
|
+
* Options for useContextMenu composable
|
|
1346
|
+
*/
|
|
1347
|
+
export declare interface UseContextMenuOptions {
|
|
1348
|
+
/** Menu items */
|
|
1349
|
+
items: ContextMenuItem[] | Ref<ContextMenuItem[]>;
|
|
1350
|
+
/** Custom class for menu container */
|
|
1351
|
+
class?: string;
|
|
1352
|
+
/** Menu width */
|
|
1353
|
+
width?: number | string;
|
|
1354
|
+
/** Whether to disable */
|
|
1355
|
+
disabled?: boolean | Ref<boolean>;
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
/**
|
|
1359
|
+
* Return type for useContextMenu composable
|
|
1360
|
+
*/
|
|
1361
|
+
export declare interface UseContextMenuReturn {
|
|
1362
|
+
/** Bind context menu to an element */
|
|
1363
|
+
bind: (element: HTMLElement) => () => void;
|
|
1364
|
+
/** Show menu at position */
|
|
1365
|
+
show: (x: number, y: number) => void;
|
|
1366
|
+
/** Hide menu */
|
|
1367
|
+
hide: () => void;
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1061
1370
|
/**
|
|
1062
1371
|
* Composable for copying text to clipboard
|
|
1063
1372
|
*
|
|
@@ -1261,6 +1570,85 @@ export declare interface UseCountdownReturn {
|
|
|
1261
1570
|
reset: () => void;
|
|
1262
1571
|
}
|
|
1263
1572
|
|
|
1573
|
+
/**
|
|
1574
|
+
* Composable for animated number counter
|
|
1575
|
+
*
|
|
1576
|
+
* @param options - Configuration options
|
|
1577
|
+
* @returns Counter utilities
|
|
1578
|
+
*
|
|
1579
|
+
* @example
|
|
1580
|
+
* ```vue
|
|
1581
|
+
* <script setup>
|
|
1582
|
+
* import { ref } from 'vue'
|
|
1583
|
+
* import { useCounter } from 'directix'
|
|
1584
|
+
*
|
|
1585
|
+
* const containerRef = ref(null)
|
|
1586
|
+
* const { currentValue, formattedValue, setValue, bind } = useCounter({
|
|
1587
|
+
* value: 1000,
|
|
1588
|
+
* duration: 2000,
|
|
1589
|
+
* useGrouping: true
|
|
1590
|
+
* })
|
|
1591
|
+
*
|
|
1592
|
+
* onMounted(() => bind(containerRef.value))
|
|
1593
|
+
* </script>
|
|
1594
|
+
*
|
|
1595
|
+
* <template>
|
|
1596
|
+
* <span ref="containerRef">0</span>
|
|
1597
|
+
* </template>
|
|
1598
|
+
* ```
|
|
1599
|
+
*/
|
|
1600
|
+
export declare function useCounter(options: UseCounterOptions): UseCounterReturn;
|
|
1601
|
+
|
|
1602
|
+
/**
|
|
1603
|
+
* Options for useCounter composable
|
|
1604
|
+
*/
|
|
1605
|
+
export declare interface UseCounterOptions {
|
|
1606
|
+
/** Target value */
|
|
1607
|
+
value: number | Ref<number>;
|
|
1608
|
+
/** Starting value */
|
|
1609
|
+
startValue?: number;
|
|
1610
|
+
/** Animation duration */
|
|
1611
|
+
duration?: number;
|
|
1612
|
+
/** Decimal places */
|
|
1613
|
+
decimals?: number;
|
|
1614
|
+
/** Use grouping separator */
|
|
1615
|
+
useGrouping?: boolean;
|
|
1616
|
+
/** Locale */
|
|
1617
|
+
locale?: string;
|
|
1618
|
+
/** Custom formatter */
|
|
1619
|
+
formatter?: (value: number) => string;
|
|
1620
|
+
/** Easing function */
|
|
1621
|
+
easing?: CounterEasing;
|
|
1622
|
+
/** Custom easing function */
|
|
1623
|
+
customEasing?: (t: number) => number;
|
|
1624
|
+
/** Callback on update */
|
|
1625
|
+
onUpdate?: (value: number, formattedValue: string) => void;
|
|
1626
|
+
/** Callback on complete */
|
|
1627
|
+
onComplete?: (value: number) => void;
|
|
1628
|
+
/** Callback on start */
|
|
1629
|
+
onStart?: () => void;
|
|
1630
|
+
}
|
|
1631
|
+
|
|
1632
|
+
/**
|
|
1633
|
+
* Return type for useCounter composable
|
|
1634
|
+
*/
|
|
1635
|
+
export declare interface UseCounterReturn {
|
|
1636
|
+
/** Current value */
|
|
1637
|
+
currentValue: Ref<number>;
|
|
1638
|
+
/** Formatted value */
|
|
1639
|
+
formattedValue: Ref<string>;
|
|
1640
|
+
/** Whether animating */
|
|
1641
|
+
isAnimating: Ref<boolean>;
|
|
1642
|
+
/** Set target value */
|
|
1643
|
+
setValue: (value: number) => void;
|
|
1644
|
+
/** Start animation */
|
|
1645
|
+
start: () => void;
|
|
1646
|
+
/** Stop animation */
|
|
1647
|
+
stop: () => void;
|
|
1648
|
+
/** Bind counter to an element */
|
|
1649
|
+
bind: (element: HTMLElement) => () => void;
|
|
1650
|
+
}
|
|
1651
|
+
|
|
1264
1652
|
/**
|
|
1265
1653
|
* Composable for debouncing function calls
|
|
1266
1654
|
*
|
|
@@ -1509,107 +1897,416 @@ export declare interface UseEllipsisReturn {
|
|
|
1509
1897
|
}
|
|
1510
1898
|
|
|
1511
1899
|
/**
|
|
1512
|
-
* Composable for
|
|
1900
|
+
* Composable for emoji filtering
|
|
1513
1901
|
*
|
|
1514
1902
|
* @param options - Configuration options
|
|
1515
|
-
* @returns
|
|
1903
|
+
* @returns Emoji utilities
|
|
1516
1904
|
*
|
|
1517
1905
|
* @example
|
|
1518
1906
|
* ```vue
|
|
1519
1907
|
* <script setup>
|
|
1520
1908
|
* import { ref } from 'vue'
|
|
1521
|
-
* import {
|
|
1909
|
+
* import { useEmoji } from 'directix'
|
|
1522
1910
|
*
|
|
1523
|
-
* const
|
|
1524
|
-
* const {
|
|
1525
|
-
* onBlur: () => validate()
|
|
1526
|
-
* })
|
|
1911
|
+
* const inputRef = ref(null)
|
|
1912
|
+
* const { bind, stripEmojis } = useEmoji({ strip: true })
|
|
1527
1913
|
*
|
|
1528
|
-
* onMounted(() => bind(
|
|
1529
|
-
*
|
|
1530
|
-
* // Programmatically focus
|
|
1531
|
-
* function handleButtonClick() {
|
|
1532
|
-
* focus()
|
|
1533
|
-
* }
|
|
1914
|
+
* onMounted(() => bind(inputRef.value))
|
|
1534
1915
|
* </script>
|
|
1535
1916
|
*
|
|
1536
1917
|
* <template>
|
|
1537
|
-
* <input ref="
|
|
1538
|
-
* <button @click="focus">Focus Input</button>
|
|
1918
|
+
* <input ref="inputRef" type="text" />
|
|
1539
1919
|
* </template>
|
|
1540
1920
|
* ```
|
|
1541
1921
|
*/
|
|
1542
|
-
export declare function
|
|
1922
|
+
export declare function useEmoji(options?: UseEmojiOptions): UseEmojiReturn;
|
|
1543
1923
|
|
|
1544
1924
|
/**
|
|
1545
|
-
* Options for
|
|
1925
|
+
* Options for useEmoji composable
|
|
1546
1926
|
*/
|
|
1547
|
-
export declare interface
|
|
1548
|
-
/**
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
/**
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1927
|
+
export declare interface UseEmojiOptions {
|
|
1928
|
+
/** Whether to strip emoji */
|
|
1929
|
+
strip?: boolean | Ref<boolean>;
|
|
1930
|
+
/** Allowed emojis */
|
|
1931
|
+
allowList?: string[];
|
|
1932
|
+
/** Blocked emojis */
|
|
1933
|
+
blockList?: string[];
|
|
1934
|
+
/** Replacement character */
|
|
1935
|
+
replacement?: string;
|
|
1936
|
+
/** Callback when emoji is detected */
|
|
1937
|
+
onEmoji?: (emoji: string, position: number) => void;
|
|
1556
1938
|
}
|
|
1557
1939
|
|
|
1558
1940
|
/**
|
|
1559
|
-
* Return type for
|
|
1941
|
+
* Return type for useEmoji composable
|
|
1560
1942
|
*/
|
|
1561
|
-
export declare interface
|
|
1562
|
-
/**
|
|
1563
|
-
|
|
1564
|
-
/**
|
|
1565
|
-
|
|
1566
|
-
/**
|
|
1567
|
-
|
|
1568
|
-
/** Bind
|
|
1569
|
-
bind: (element:
|
|
1943
|
+
export declare interface UseEmojiReturn {
|
|
1944
|
+
/** Current input value */
|
|
1945
|
+
value: Ref<string>;
|
|
1946
|
+
/** Strip emojis from text */
|
|
1947
|
+
stripEmojis: (text: string) => string;
|
|
1948
|
+
/** Check if text contains emoji */
|
|
1949
|
+
hasEmoji: (text: string) => boolean;
|
|
1950
|
+
/** Bind emoji filter to an input element */
|
|
1951
|
+
bind: (element: HTMLInputElement | HTMLTextAreaElement) => () => void;
|
|
1570
1952
|
}
|
|
1571
1953
|
|
|
1572
1954
|
/**
|
|
1573
|
-
* Composable for
|
|
1955
|
+
* Composable for exporting data
|
|
1574
1956
|
*
|
|
1575
1957
|
* @param options - Configuration options
|
|
1576
|
-
* @returns
|
|
1958
|
+
* @returns Export utilities
|
|
1577
1959
|
*
|
|
1578
1960
|
* @example
|
|
1579
1961
|
* ```vue
|
|
1580
1962
|
* <script setup>
|
|
1581
|
-
* import {
|
|
1963
|
+
* import { useExport } from 'directix'
|
|
1582
1964
|
*
|
|
1583
|
-
* const
|
|
1584
|
-
*
|
|
1585
|
-
*
|
|
1586
|
-
*
|
|
1587
|
-
* ]
|
|
1588
|
-
* })
|
|
1965
|
+
* const data = [
|
|
1966
|
+
* { name: 'John', email: 'john@example.com' },
|
|
1967
|
+
* { name: 'Jane', email: 'jane@example.com' }
|
|
1968
|
+
* ]
|
|
1589
1969
|
*
|
|
1590
|
-
*
|
|
1591
|
-
* add({ key: 'esc', handler: (e) => closeModal() })
|
|
1970
|
+
* const { exportCSV, exportJSON } = useExport({ data, filename: 'users' })
|
|
1592
1971
|
* </script>
|
|
1972
|
+
*
|
|
1973
|
+
* <template>
|
|
1974
|
+
* <button @click="exportCSV">Export CSV</button>
|
|
1975
|
+
* <button @click="exportJSON">Export JSON</button>
|
|
1976
|
+
* </template>
|
|
1593
1977
|
* ```
|
|
1594
1978
|
*/
|
|
1595
|
-
export declare function
|
|
1979
|
+
export declare function useExport(options: UseExportOptions): UseExportReturn;
|
|
1980
|
+
|
|
1981
|
+
/**
|
|
1982
|
+
* Options for useExport composable
|
|
1983
|
+
*/
|
|
1984
|
+
export declare interface UseExportOptions {
|
|
1985
|
+
/** Data to export */
|
|
1986
|
+
data: any[] | object | string | Ref<any[] | object | string>;
|
|
1987
|
+
/** Export format */
|
|
1988
|
+
format?: ExportFormat | Ref<ExportFormat>;
|
|
1989
|
+
/** Filename (without extension) */
|
|
1990
|
+
filename?: string | Ref<string>;
|
|
1991
|
+
/** Whether to include headers (for CSV) */
|
|
1992
|
+
includeHeaders?: boolean;
|
|
1993
|
+
/** Custom delimiter for CSV */
|
|
1994
|
+
delimiter?: string;
|
|
1995
|
+
/** Columns to export */
|
|
1996
|
+
columns?: string[];
|
|
1997
|
+
/** Custom headers mapping */
|
|
1998
|
+
headers?: Record<string, string>;
|
|
1999
|
+
/** Callback before export */
|
|
2000
|
+
onBeforeExport?: () => boolean | void;
|
|
2001
|
+
/** Callback after export */
|
|
2002
|
+
onAfterExport?: () => void;
|
|
2003
|
+
/** Callback on error */
|
|
2004
|
+
onError?: (error: Error) => void;
|
|
2005
|
+
}
|
|
1596
2006
|
|
|
1597
2007
|
/**
|
|
1598
|
-
*
|
|
2008
|
+
* Return type for useExport composable
|
|
1599
2009
|
*/
|
|
1600
|
-
export declare interface
|
|
1601
|
-
/**
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
/**
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
/**
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
2010
|
+
export declare interface UseExportReturn {
|
|
2011
|
+
/** Export data */
|
|
2012
|
+
exportData: (format?: ExportFormat) => void;
|
|
2013
|
+
/** Export as CSV */
|
|
2014
|
+
exportCSV: () => void;
|
|
2015
|
+
/** Export as JSON */
|
|
2016
|
+
exportJSON: () => void;
|
|
2017
|
+
/** Export as HTML */
|
|
2018
|
+
exportHTML: () => void;
|
|
2019
|
+
/** Export as text */
|
|
2020
|
+
exportText: () => void;
|
|
2021
|
+
}
|
|
2022
|
+
|
|
2023
|
+
/**
|
|
2024
|
+
* Composable for fade transitions
|
|
2025
|
+
*
|
|
2026
|
+
* @param options - Configuration options
|
|
2027
|
+
* @returns Fade utilities
|
|
2028
|
+
*
|
|
2029
|
+
* @example
|
|
2030
|
+
* ```vue
|
|
2031
|
+
* <script setup>
|
|
2032
|
+
* import { ref } from 'vue'
|
|
2033
|
+
* import { useFade } from 'directix'
|
|
2034
|
+
*
|
|
2035
|
+
* const containerRef = ref(null)
|
|
2036
|
+
* const { isVisible, fadeIn, fadeOut, bind } = useFade({ duration: 500 })
|
|
2037
|
+
*
|
|
2038
|
+
* onMounted(() => bind(containerRef.value))
|
|
2039
|
+
* </script>
|
|
2040
|
+
*
|
|
2041
|
+
* <template>
|
|
2042
|
+
* <div ref="containerRef">
|
|
2043
|
+
* <button @click="toggle">Toggle</button>
|
|
2044
|
+
* </div>
|
|
2045
|
+
* </template>
|
|
2046
|
+
* ```
|
|
2047
|
+
*/
|
|
2048
|
+
export declare function useFade(options?: UseFadeOptions): UseFadeReturn;
|
|
2049
|
+
|
|
2050
|
+
/**
|
|
2051
|
+
* Options for useFade composable
|
|
2052
|
+
*/
|
|
2053
|
+
export declare interface UseFadeOptions {
|
|
2054
|
+
/** Whether element is visible */
|
|
2055
|
+
visible?: boolean | Ref<boolean>;
|
|
2056
|
+
/** Animation duration */
|
|
2057
|
+
duration?: number;
|
|
2058
|
+
/** Animation delay */
|
|
2059
|
+
delay?: number;
|
|
2060
|
+
/** Easing function */
|
|
2061
|
+
easing?: string;
|
|
2062
|
+
/** Minimum opacity */
|
|
2063
|
+
minOpacity?: number;
|
|
2064
|
+
/** Maximum opacity */
|
|
2065
|
+
maxOpacity?: number;
|
|
2066
|
+
/** Callback on start */
|
|
2067
|
+
onStart?: (direction: 'in' | 'out') => void;
|
|
2068
|
+
/** Callback on complete */
|
|
2069
|
+
onComplete?: (direction: 'in' | 'out') => void;
|
|
2070
|
+
}
|
|
2071
|
+
|
|
2072
|
+
/**
|
|
2073
|
+
* Return type for useFade composable
|
|
2074
|
+
*/
|
|
2075
|
+
export declare interface UseFadeReturn {
|
|
2076
|
+
/** Whether element is visible */
|
|
2077
|
+
isVisible: Ref<boolean>;
|
|
2078
|
+
/** Fade in */
|
|
2079
|
+
fadeIn: () => void;
|
|
2080
|
+
/** Fade out */
|
|
2081
|
+
fadeOut: () => void;
|
|
2082
|
+
/** Toggle fade */
|
|
2083
|
+
toggle: () => void;
|
|
2084
|
+
/** Bind fade to an element */
|
|
2085
|
+
bind: (element: HTMLElement) => () => void;
|
|
2086
|
+
}
|
|
2087
|
+
|
|
2088
|
+
/**
|
|
2089
|
+
* Composable for managing element focus
|
|
2090
|
+
*
|
|
2091
|
+
* @param options - Configuration options
|
|
2092
|
+
* @returns Focus utilities
|
|
2093
|
+
*
|
|
2094
|
+
* @example
|
|
2095
|
+
* ```vue
|
|
2096
|
+
* <script setup>
|
|
2097
|
+
* import { ref } from 'vue'
|
|
2098
|
+
* import { useFocus } from 'directix'
|
|
2099
|
+
*
|
|
2100
|
+
* const input = ref(null)
|
|
2101
|
+
* const { isFocused, focus, bind } = useFocus({
|
|
2102
|
+
* onBlur: () => validate()
|
|
2103
|
+
* })
|
|
2104
|
+
*
|
|
2105
|
+
* onMounted(() => bind(input.value))
|
|
2106
|
+
*
|
|
2107
|
+
* // Programmatically focus
|
|
2108
|
+
* function handleButtonClick() {
|
|
2109
|
+
* focus()
|
|
2110
|
+
* }
|
|
2111
|
+
* </script>
|
|
2112
|
+
*
|
|
2113
|
+
* <template>
|
|
2114
|
+
* <input ref="input" />
|
|
2115
|
+
* <button @click="focus">Focus Input</button>
|
|
2116
|
+
* </template>
|
|
2117
|
+
* ```
|
|
2118
|
+
*/
|
|
2119
|
+
export declare function useFocus(options?: UseFocusOptions): UseFocusReturn;
|
|
2120
|
+
|
|
2121
|
+
/**
|
|
2122
|
+
* Options for useFocus composable
|
|
2123
|
+
*/
|
|
2124
|
+
export declare interface UseFocusOptions {
|
|
2125
|
+
/**
|
|
2126
|
+
* Callback when element is focused
|
|
2127
|
+
*/
|
|
2128
|
+
onFocus?: (event: FocusEvent) => void;
|
|
2129
|
+
/**
|
|
2130
|
+
* Callback when element loses focus
|
|
2131
|
+
*/
|
|
2132
|
+
onBlur?: (event: FocusEvent) => void;
|
|
2133
|
+
}
|
|
2134
|
+
|
|
2135
|
+
/**
|
|
2136
|
+
* Return type for useFocus composable
|
|
2137
|
+
*/
|
|
2138
|
+
export declare interface UseFocusReturn {
|
|
2139
|
+
/** Whether the element is currently focused */
|
|
2140
|
+
isFocused: Readonly<Ref<boolean>>;
|
|
2141
|
+
/** Focus the element */
|
|
2142
|
+
focus: () => void;
|
|
2143
|
+
/** Blur the element */
|
|
2144
|
+
blur: () => void;
|
|
2145
|
+
/** Bind focus tracking to an element */
|
|
2146
|
+
bind: (element: HTMLElement) => () => void;
|
|
2147
|
+
}
|
|
2148
|
+
|
|
2149
|
+
/**
|
|
2150
|
+
* Composable for fullscreen functionality
|
|
2151
|
+
*
|
|
2152
|
+
* @param options - Configuration options
|
|
2153
|
+
* @returns Fullscreen utilities
|
|
2154
|
+
*
|
|
2155
|
+
* @example
|
|
2156
|
+
* ```vue
|
|
2157
|
+
* <script setup>
|
|
2158
|
+
* import { ref } from 'vue'
|
|
2159
|
+
* import { useFullscreen } from 'directix'
|
|
2160
|
+
*
|
|
2161
|
+
* const containerRef = ref(null)
|
|
2162
|
+
* const { isFullscreen, toggle, bind } = useFullscreen({
|
|
2163
|
+
* onEnter: () => console.log('Entered fullscreen'),
|
|
2164
|
+
* onExit: () => console.log('Exited fullscreen')
|
|
2165
|
+
* })
|
|
2166
|
+
*
|
|
2167
|
+
* onMounted(() => bind(containerRef.value))
|
|
2168
|
+
* </script>
|
|
2169
|
+
*
|
|
2170
|
+
* <template>
|
|
2171
|
+
* <div ref="containerRef">
|
|
2172
|
+
* <button @click="toggle">
|
|
2173
|
+
* {{ isFullscreen ? 'Exit' : 'Enter' }} Fullscreen
|
|
2174
|
+
* </button>
|
|
2175
|
+
* </div>
|
|
2176
|
+
* </template>
|
|
2177
|
+
* ```
|
|
2178
|
+
*/
|
|
2179
|
+
export declare function useFullscreen(options?: UseFullscreenOptions): UseFullscreenReturn;
|
|
2180
|
+
|
|
2181
|
+
/**
|
|
2182
|
+
* Options for useFullscreen composable
|
|
2183
|
+
*/
|
|
2184
|
+
export declare interface UseFullscreenOptions {
|
|
2185
|
+
/** Custom class when in fullscreen mode */
|
|
2186
|
+
fullscreenClass?: string;
|
|
2187
|
+
/** Callback when entering fullscreen */
|
|
2188
|
+
onEnter?: () => void;
|
|
2189
|
+
/** Callback when exiting fullscreen */
|
|
2190
|
+
onExit?: () => void;
|
|
2191
|
+
/** Callback when fullscreen state changes */
|
|
2192
|
+
onChange?: (isFullscreen: boolean) => void;
|
|
2193
|
+
}
|
|
2194
|
+
|
|
2195
|
+
/**
|
|
2196
|
+
* Return type for useFullscreen composable
|
|
2197
|
+
*/
|
|
2198
|
+
export declare interface UseFullscreenReturn {
|
|
2199
|
+
/** Whether currently in fullscreen mode */
|
|
2200
|
+
isFullscreen: Ref<boolean>;
|
|
2201
|
+
/** Enter fullscreen mode */
|
|
2202
|
+
enter: () => Promise<void>;
|
|
2203
|
+
/** Exit fullscreen mode */
|
|
2204
|
+
exit: () => Promise<void>;
|
|
2205
|
+
/** Toggle fullscreen mode */
|
|
2206
|
+
toggle: () => Promise<void>;
|
|
2207
|
+
/** Bind fullscreen to an element */
|
|
2208
|
+
bind: (element: HTMLElement) => () => void;
|
|
2209
|
+
}
|
|
2210
|
+
|
|
2211
|
+
/**
|
|
2212
|
+
* Composable for highlighting keywords
|
|
2213
|
+
*
|
|
2214
|
+
* @param options - Configuration options
|
|
2215
|
+
* @returns Highlight utilities
|
|
2216
|
+
*
|
|
2217
|
+
* @example
|
|
2218
|
+
* ```vue
|
|
2219
|
+
* <script setup>
|
|
2220
|
+
* import { ref } from 'vue'
|
|
2221
|
+
* import { useHighlight } from 'directix'
|
|
2222
|
+
*
|
|
2223
|
+
* const containerRef = ref(null)
|
|
2224
|
+
* const { count, bind } = useHighlight({
|
|
2225
|
+
* keywords: ['Vue', 'React'],
|
|
2226
|
+
* className: 'my-highlight'
|
|
2227
|
+
* })
|
|
2228
|
+
*
|
|
2229
|
+
* onMounted(() => bind(containerRef.value))
|
|
2230
|
+
* </script>
|
|
2231
|
+
*
|
|
2232
|
+
* <template>
|
|
2233
|
+
* <p ref="containerRef">Vue and React are popular frameworks.</p>
|
|
2234
|
+
* </template>
|
|
2235
|
+
* ```
|
|
2236
|
+
*/
|
|
2237
|
+
export declare function useHighlight(options: UseHighlightOptions): UseHighlightReturn;
|
|
2238
|
+
|
|
2239
|
+
/**
|
|
2240
|
+
* Options for useHighlight composable
|
|
2241
|
+
*/
|
|
2242
|
+
export declare interface UseHighlightOptions {
|
|
2243
|
+
/** Keywords to highlight */
|
|
2244
|
+
keywords: string | string[] | Ref<string | string[]>;
|
|
2245
|
+
/** Highlight class name */
|
|
2246
|
+
className?: string;
|
|
2247
|
+
/** Inline style */
|
|
2248
|
+
style?: string;
|
|
2249
|
+
/** Case sensitive */
|
|
2250
|
+
caseSensitive?: boolean;
|
|
2251
|
+
/** Whole word only */
|
|
2252
|
+
wholeWord?: boolean;
|
|
2253
|
+
/** Tag name for highlight */
|
|
2254
|
+
tag?: string;
|
|
2255
|
+
}
|
|
2256
|
+
|
|
2257
|
+
/**
|
|
2258
|
+
* Return type for useHighlight composable
|
|
2259
|
+
*/
|
|
2260
|
+
export declare interface UseHighlightReturn {
|
|
2261
|
+
/** Highlight count */
|
|
2262
|
+
count: Ref<number>;
|
|
2263
|
+
/** Update keywords */
|
|
2264
|
+
updateKeywords: (keywords: string | string[]) => void;
|
|
2265
|
+
/** Bind highlight to an element */
|
|
2266
|
+
bind: (element: HTMLElement) => () => void;
|
|
2267
|
+
}
|
|
2268
|
+
|
|
2269
|
+
/**
|
|
2270
|
+
* Composable for handling keyboard shortcuts
|
|
2271
|
+
*
|
|
2272
|
+
* @param options - Configuration options
|
|
2273
|
+
* @returns Hotkey utilities
|
|
2274
|
+
*
|
|
2275
|
+
* @example
|
|
2276
|
+
* ```vue
|
|
2277
|
+
* <script setup>
|
|
2278
|
+
* import { useHotkey } from 'directix'
|
|
2279
|
+
*
|
|
2280
|
+
* const { enable, disable, add, remove } = useHotkey({
|
|
2281
|
+
* hotkeys: [
|
|
2282
|
+
* { key: 'ctrl+s', handler: (e) => save() },
|
|
2283
|
+
* { key: 'ctrl+z', handler: (e) => undo() },
|
|
2284
|
+
* ]
|
|
2285
|
+
* })
|
|
2286
|
+
*
|
|
2287
|
+
* // Add dynamic hotkey
|
|
2288
|
+
* add({ key: 'esc', handler: (e) => closeModal() })
|
|
2289
|
+
* </script>
|
|
2290
|
+
* ```
|
|
2291
|
+
*/
|
|
2292
|
+
export declare function useHotkey(options?: UseHotkeyOptions): UseHotkeyReturn;
|
|
2293
|
+
|
|
2294
|
+
/**
|
|
2295
|
+
* Options for useHotkey composable
|
|
2296
|
+
*/
|
|
2297
|
+
export declare interface UseHotkeyOptions {
|
|
2298
|
+
/**
|
|
2299
|
+
* Single hotkey definition
|
|
2300
|
+
*/
|
|
2301
|
+
hotkey?: HotkeyDefinition;
|
|
2302
|
+
/**
|
|
2303
|
+
* Multiple hotkey definitions
|
|
2304
|
+
*/
|
|
2305
|
+
hotkeys?: HotkeyDefinition[];
|
|
2306
|
+
/**
|
|
2307
|
+
* Target element to bind events (defaults to document)
|
|
2308
|
+
*/
|
|
2309
|
+
target?: HTMLElement | Ref<HTMLElement | null>;
|
|
1613
2310
|
/**
|
|
1614
2311
|
* Whether to enable the hotkey(s)
|
|
1615
2312
|
* @default true
|
|
@@ -1805,6 +2502,91 @@ export declare interface UseImagePreviewReturn {
|
|
|
1805
2502
|
bind: (element: HTMLImageElement) => () => void;
|
|
1806
2503
|
}
|
|
1807
2504
|
|
|
2505
|
+
/**
|
|
2506
|
+
* Composable for infinite scrolling
|
|
2507
|
+
*
|
|
2508
|
+
* @param options - Configuration options
|
|
2509
|
+
* @returns Infinite scroll utilities
|
|
2510
|
+
*
|
|
2511
|
+
* @example
|
|
2512
|
+
* ```vue
|
|
2513
|
+
* <script setup>
|
|
2514
|
+
* import { ref } from 'vue'
|
|
2515
|
+
* import { useInfiniteScroll } from 'directix'
|
|
2516
|
+
*
|
|
2517
|
+
* const items = ref([])
|
|
2518
|
+
* const page = ref(1)
|
|
2519
|
+
*
|
|
2520
|
+
* const { bind, loading, finished } = useInfiniteScroll({
|
|
2521
|
+
* onLoad: async () => {
|
|
2522
|
+
* const newItems = await fetchItems(page.value++)
|
|
2523
|
+
* items.value.push(...newItems)
|
|
2524
|
+
* if (newItems.length === 0) finished.value = true
|
|
2525
|
+
* }
|
|
2526
|
+
* })
|
|
2527
|
+
*
|
|
2528
|
+
* onMounted(() => bind(containerRef.value))
|
|
2529
|
+
* </script>
|
|
2530
|
+
*
|
|
2531
|
+
* <template>
|
|
2532
|
+
* <div ref="containerRef" class="scroll-container">
|
|
2533
|
+
* <div v-for="item in items" :key="item.id">{{ item.name }}</div>
|
|
2534
|
+
* <div v-if="loading">Loading...</div>
|
|
2535
|
+
* </div>
|
|
2536
|
+
* </template>
|
|
2537
|
+
* ```
|
|
2538
|
+
*/
|
|
2539
|
+
export declare function useInfiniteScroll(options: UseInfiniteScrollOptions): UseInfiniteScrollReturn;
|
|
2540
|
+
|
|
2541
|
+
/**
|
|
2542
|
+
* Options for useInfiniteScroll composable
|
|
2543
|
+
*/
|
|
2544
|
+
export declare interface UseInfiniteScrollOptions {
|
|
2545
|
+
/**
|
|
2546
|
+
* Callback to load more items
|
|
2547
|
+
*/
|
|
2548
|
+
onLoad: () => void | Promise<void>;
|
|
2549
|
+
/**
|
|
2550
|
+
* Whether loading is in progress
|
|
2551
|
+
*/
|
|
2552
|
+
loading?: boolean | Ref<boolean>;
|
|
2553
|
+
/**
|
|
2554
|
+
* Whether all items are loaded
|
|
2555
|
+
*/
|
|
2556
|
+
finished?: boolean | Ref<boolean>;
|
|
2557
|
+
/**
|
|
2558
|
+
* Distance from bottom to trigger load (in pixels)
|
|
2559
|
+
* @default 0
|
|
2560
|
+
*/
|
|
2561
|
+
distance?: number | Ref<number>;
|
|
2562
|
+
/**
|
|
2563
|
+
* Whether to check immediately on mount
|
|
2564
|
+
* @default true
|
|
2565
|
+
*/
|
|
2566
|
+
immediate?: boolean;
|
|
2567
|
+
/**
|
|
2568
|
+
* Whether to disable
|
|
2569
|
+
* @default false
|
|
2570
|
+
*/
|
|
2571
|
+
disabled?: boolean | Ref<boolean>;
|
|
2572
|
+
}
|
|
2573
|
+
|
|
2574
|
+
/**
|
|
2575
|
+
* Return type for useInfiniteScroll composable
|
|
2576
|
+
*/
|
|
2577
|
+
export declare interface UseInfiniteScrollReturn {
|
|
2578
|
+
/** Whether loading is in progress */
|
|
2579
|
+
loading: Readonly<Ref<boolean>>;
|
|
2580
|
+
/** Whether all items are loaded */
|
|
2581
|
+
finished: Readonly<Ref<boolean>>;
|
|
2582
|
+
/** Manually trigger load */
|
|
2583
|
+
load: () => Promise<void>;
|
|
2584
|
+
/** Bind infinite scroll to an element */
|
|
2585
|
+
bind: (element: HTMLElement) => () => void;
|
|
2586
|
+
/** Stop observing */
|
|
2587
|
+
stop: () => void;
|
|
2588
|
+
}
|
|
2589
|
+
|
|
1808
2590
|
/**
|
|
1809
2591
|
* Composable for detecting element intersection with viewport
|
|
1810
2592
|
*
|
|
@@ -1900,6 +2682,186 @@ export declare interface UseIntersectReturn {
|
|
|
1900
2682
|
stop: () => void;
|
|
1901
2683
|
}
|
|
1902
2684
|
|
|
2685
|
+
/**
|
|
2686
|
+
* Composable for lazy loading images
|
|
2687
|
+
*
|
|
2688
|
+
* @param options - Configuration options
|
|
2689
|
+
* @returns Lazy loading utilities
|
|
2690
|
+
*
|
|
2691
|
+
* @example
|
|
2692
|
+
* ```vue
|
|
2693
|
+
* <script setup>
|
|
2694
|
+
* import { ref } from 'vue'
|
|
2695
|
+
* import { useLazy } from 'directix'
|
|
2696
|
+
*
|
|
2697
|
+
* const imageRef = ref(null)
|
|
2698
|
+
* const { state, isLoading, bind } = useLazy({
|
|
2699
|
+
* src: 'https://example.com/image.jpg',
|
|
2700
|
+
* placeholder: '/placeholder.jpg'
|
|
2701
|
+
* })
|
|
2702
|
+
*
|
|
2703
|
+
* onMounted(() => bind(imageRef.value))
|
|
2704
|
+
* </script>
|
|
2705
|
+
*
|
|
2706
|
+
* <template>
|
|
2707
|
+
* <img ref="imageRef" />
|
|
2708
|
+
* </template>
|
|
2709
|
+
* ```
|
|
2710
|
+
*/
|
|
2711
|
+
export declare function useLazy(options?: UseLazyOptions): UseLazyReturn;
|
|
2712
|
+
|
|
2713
|
+
/**
|
|
2714
|
+
* Options for useLazy composable
|
|
2715
|
+
*/
|
|
2716
|
+
export declare interface UseLazyOptions {
|
|
2717
|
+
/**
|
|
2718
|
+
* Image source URL
|
|
2719
|
+
*/
|
|
2720
|
+
src?: string | Ref<string>;
|
|
2721
|
+
/**
|
|
2722
|
+
* Placeholder image URL
|
|
2723
|
+
*/
|
|
2724
|
+
placeholder?: string;
|
|
2725
|
+
/**
|
|
2726
|
+
* Error image URL (shown when loading fails)
|
|
2727
|
+
*/
|
|
2728
|
+
error?: string;
|
|
2729
|
+
/**
|
|
2730
|
+
* Preload distance in pixels
|
|
2731
|
+
* @default 0
|
|
2732
|
+
*/
|
|
2733
|
+
preload?: number;
|
|
2734
|
+
/**
|
|
2735
|
+
* Callback when image loads successfully
|
|
2736
|
+
*/
|
|
2737
|
+
onLoad?: (el: HTMLElement) => void;
|
|
2738
|
+
/**
|
|
2739
|
+
* Callback when image fails to load
|
|
2740
|
+
*/
|
|
2741
|
+
onError?: (el: HTMLElement, error: Error) => void;
|
|
2742
|
+
/**
|
|
2743
|
+
* Number of retry attempts
|
|
2744
|
+
* @default 1
|
|
2745
|
+
*/
|
|
2746
|
+
attempt?: number;
|
|
2747
|
+
}
|
|
2748
|
+
|
|
2749
|
+
/**
|
|
2750
|
+
* Return type for useLazy composable
|
|
2751
|
+
*/
|
|
2752
|
+
export declare interface UseLazyReturn {
|
|
2753
|
+
/** Current loading state */
|
|
2754
|
+
state: Readonly<Ref<LazyState>>;
|
|
2755
|
+
/** Whether the image is currently loading */
|
|
2756
|
+
isLoading: Readonly<Ref<boolean>>;
|
|
2757
|
+
/** Whether the image has loaded successfully */
|
|
2758
|
+
isLoaded: Readonly<Ref<boolean>>;
|
|
2759
|
+
/** Whether the image failed to load */
|
|
2760
|
+
hasError: Readonly<Ref<boolean>>;
|
|
2761
|
+
/** Bind lazy loading to an element */
|
|
2762
|
+
bind: (element: HTMLElement) => () => void;
|
|
2763
|
+
/** Manually trigger load */
|
|
2764
|
+
load: () => void;
|
|
2765
|
+
/** Reset state */
|
|
2766
|
+
reset: () => void;
|
|
2767
|
+
}
|
|
2768
|
+
|
|
2769
|
+
/**
|
|
2770
|
+
* Composable for managing loading state
|
|
2771
|
+
*
|
|
2772
|
+
* @param options - Configuration options
|
|
2773
|
+
* @returns Loading utilities
|
|
2774
|
+
*
|
|
2775
|
+
* @example
|
|
2776
|
+
* ```vue
|
|
2777
|
+
* <script setup>
|
|
2778
|
+
* import { ref } from 'vue'
|
|
2779
|
+
* import { useLoading } from 'directix'
|
|
2780
|
+
*
|
|
2781
|
+
* const containerRef = ref(null)
|
|
2782
|
+
* const { loading, start, stop, bind } = useLoading({
|
|
2783
|
+
* text: 'Loading...',
|
|
2784
|
+
* lock: true
|
|
2785
|
+
* })
|
|
2786
|
+
*
|
|
2787
|
+
* onMounted(() => bind(containerRef.value))
|
|
2788
|
+
*
|
|
2789
|
+
* async function fetchData() {
|
|
2790
|
+
* start()
|
|
2791
|
+
* await api.getData()
|
|
2792
|
+
* stop()
|
|
2793
|
+
* }
|
|
2794
|
+
* </script>
|
|
2795
|
+
*
|
|
2796
|
+
* <template>
|
|
2797
|
+
* <div ref="containerRef">
|
|
2798
|
+
* <button @click="fetchData">Fetch Data</button>
|
|
2799
|
+
* </div>
|
|
2800
|
+
* </template>
|
|
2801
|
+
* ```
|
|
2802
|
+
*/
|
|
2803
|
+
export declare function useLoading(options?: UseLoadingOptions): UseLoadingReturn;
|
|
2804
|
+
|
|
2805
|
+
/**
|
|
2806
|
+
* Options for useLoading composable
|
|
2807
|
+
*/
|
|
2808
|
+
export declare interface UseLoadingOptions {
|
|
2809
|
+
/**
|
|
2810
|
+
* Initial loading state
|
|
2811
|
+
* @default false
|
|
2812
|
+
*/
|
|
2813
|
+
initial?: boolean | Ref<boolean>;
|
|
2814
|
+
/**
|
|
2815
|
+
* Loading text to display
|
|
2816
|
+
*/
|
|
2817
|
+
text?: string | Ref<string>;
|
|
2818
|
+
/**
|
|
2819
|
+
* CSS class for loading overlay
|
|
2820
|
+
* @default 'v-loading'
|
|
2821
|
+
*/
|
|
2822
|
+
loadingClass?: string;
|
|
2823
|
+
/**
|
|
2824
|
+
* CSS class for loading spinner
|
|
2825
|
+
* @default 'v-loading__spinner'
|
|
2826
|
+
*/
|
|
2827
|
+
spinnerClass?: string;
|
|
2828
|
+
/**
|
|
2829
|
+
* CSS class for loading text
|
|
2830
|
+
* @default 'v-loading__text'
|
|
2831
|
+
*/
|
|
2832
|
+
textClass?: string;
|
|
2833
|
+
/**
|
|
2834
|
+
* Custom spinner HTML
|
|
2835
|
+
*/
|
|
2836
|
+
spinner?: string;
|
|
2837
|
+
/**
|
|
2838
|
+
* Background color
|
|
2839
|
+
* @default 'rgba(255, 255, 255, 0.9)'
|
|
2840
|
+
*/
|
|
2841
|
+
background?: string;
|
|
2842
|
+
/**
|
|
2843
|
+
* Whether to lock scroll while loading
|
|
2844
|
+
* @default false
|
|
2845
|
+
*/
|
|
2846
|
+
lock?: boolean;
|
|
2847
|
+
}
|
|
2848
|
+
|
|
2849
|
+
/**
|
|
2850
|
+
* Return type for useLoading composable
|
|
2851
|
+
*/
|
|
2852
|
+
export declare interface UseLoadingReturn {
|
|
2853
|
+
/** Current loading state */
|
|
2854
|
+
loading: Ref<boolean>;
|
|
2855
|
+
/** Start loading */
|
|
2856
|
+
start: () => void;
|
|
2857
|
+
/** Stop loading */
|
|
2858
|
+
stop: () => void;
|
|
2859
|
+
/** Toggle loading state */
|
|
2860
|
+
toggle: () => void;
|
|
2861
|
+
/** Bind loading to an element */
|
|
2862
|
+
bind: (element: HTMLElement) => () => void;
|
|
2863
|
+
}
|
|
2864
|
+
|
|
1903
2865
|
/**
|
|
1904
2866
|
* Composable for detecting long press gestures
|
|
1905
2867
|
*
|
|
@@ -1997,6 +2959,88 @@ export declare interface UseLongPressReturn {
|
|
|
1997
2959
|
bind: (element: HTMLElement) => () => void;
|
|
1998
2960
|
}
|
|
1999
2961
|
|
|
2962
|
+
/**
|
|
2963
|
+
* Composable for Lottie animations
|
|
2964
|
+
*
|
|
2965
|
+
* @param options - Configuration options
|
|
2966
|
+
* @returns Lottie utilities
|
|
2967
|
+
*
|
|
2968
|
+
* @example
|
|
2969
|
+
* ```vue
|
|
2970
|
+
* <script setup>
|
|
2971
|
+
* import { ref } from 'vue'
|
|
2972
|
+
* import { useLottie } from 'directix'
|
|
2973
|
+
* import animationData from './animation.json'
|
|
2974
|
+
*
|
|
2975
|
+
* const containerRef = ref(null)
|
|
2976
|
+
* const { play, pause, bind } = useLottie({
|
|
2977
|
+
* animationData,
|
|
2978
|
+
* autoplay: true,
|
|
2979
|
+
* loop: true
|
|
2980
|
+
* })
|
|
2981
|
+
*
|
|
2982
|
+
* onMounted(() => bind(containerRef.value))
|
|
2983
|
+
* </script>
|
|
2984
|
+
*
|
|
2985
|
+
* <template>
|
|
2986
|
+
* <div ref="containerRef"></div>
|
|
2987
|
+
* <button @click="play">Play</button>
|
|
2988
|
+
* <button @click="pause">Pause</button>
|
|
2989
|
+
* </template>
|
|
2990
|
+
* ```
|
|
2991
|
+
*/
|
|
2992
|
+
export declare function useLottie(options: UseLottieOptions): UseLottieReturn;
|
|
2993
|
+
|
|
2994
|
+
/**
|
|
2995
|
+
* Options for useLottie composable
|
|
2996
|
+
*/
|
|
2997
|
+
export declare interface UseLottieOptions {
|
|
2998
|
+
/** Animation data or URL */
|
|
2999
|
+
animationData: object | string | Ref<object | string>;
|
|
3000
|
+
/** Autoplay */
|
|
3001
|
+
autoplay?: boolean;
|
|
3002
|
+
/** Loop */
|
|
3003
|
+
loop?: boolean;
|
|
3004
|
+
/** Speed */
|
|
3005
|
+
speed?: number | Ref<number>;
|
|
3006
|
+
/** Direction */
|
|
3007
|
+
direction?: 1 | -1;
|
|
3008
|
+
/** Renderer */
|
|
3009
|
+
renderer?: 'svg' | 'canvas' | 'html';
|
|
3010
|
+
/** Callback on ready */
|
|
3011
|
+
onReady?: (animation: any) => void;
|
|
3012
|
+
/** Callback on complete */
|
|
3013
|
+
onComplete?: () => void;
|
|
3014
|
+
/** Callback on loop */
|
|
3015
|
+
onLoopComplete?: () => void;
|
|
3016
|
+
}
|
|
3017
|
+
|
|
3018
|
+
/**
|
|
3019
|
+
* Return type for useLottie composable
|
|
3020
|
+
*/
|
|
3021
|
+
export declare interface UseLottieReturn {
|
|
3022
|
+
/** Animation state */
|
|
3023
|
+
state: Ref<LottieAnimationState>;
|
|
3024
|
+
/** Animation instance */
|
|
3025
|
+
animation: Ref<any>;
|
|
3026
|
+
/** Play animation */
|
|
3027
|
+
play: () => void;
|
|
3028
|
+
/** Pause animation */
|
|
3029
|
+
pause: () => void;
|
|
3030
|
+
/** Stop animation */
|
|
3031
|
+
stop: () => void;
|
|
3032
|
+
/** Set speed */
|
|
3033
|
+
setSpeed: (speed: number) => void;
|
|
3034
|
+
/** Set direction */
|
|
3035
|
+
setDirection: (direction: 1 | -1) => void;
|
|
3036
|
+
/** Go to frame */
|
|
3037
|
+
goToAndPlay: (frame: number, isFrame?: boolean) => void;
|
|
3038
|
+
/** Go to frame and stop */
|
|
3039
|
+
goToAndStop: (frame: number, isFrame?: boolean) => void;
|
|
3040
|
+
/** Bind lottie to an element */
|
|
3041
|
+
bind: (element: HTMLElement) => () => void;
|
|
3042
|
+
}
|
|
3043
|
+
|
|
2000
3044
|
/**
|
|
2001
3045
|
* Composable for transforming text to lowercase
|
|
2002
3046
|
*
|
|
@@ -2051,6 +3095,91 @@ export declare interface UseLowercaseReturn {
|
|
|
2051
3095
|
original: Ref<string>;
|
|
2052
3096
|
}
|
|
2053
3097
|
|
|
3098
|
+
/**
|
|
3099
|
+
* Composable for input masking
|
|
3100
|
+
*
|
|
3101
|
+
* @param options - Configuration options
|
|
3102
|
+
* @returns Mask utilities
|
|
3103
|
+
*
|
|
3104
|
+
* @example
|
|
3105
|
+
* ```vue
|
|
3106
|
+
* <script setup>
|
|
3107
|
+
* import { ref } from 'vue'
|
|
3108
|
+
* import { useMask } from 'directix'
|
|
3109
|
+
*
|
|
3110
|
+
* const inputRef = ref(null)
|
|
3111
|
+
* const { bind, getRawValue } = useMask({
|
|
3112
|
+
* mask: '###-##-####',
|
|
3113
|
+
* placeholder: '_'
|
|
3114
|
+
* })
|
|
3115
|
+
*
|
|
3116
|
+
* onMounted(() => bind(inputRef.value))
|
|
3117
|
+
* </script>
|
|
3118
|
+
*
|
|
3119
|
+
* <template>
|
|
3120
|
+
* <input ref="inputRef" type="text" />
|
|
3121
|
+
* </template>
|
|
3122
|
+
* ```
|
|
3123
|
+
*/
|
|
3124
|
+
export declare function useMask(options: UseMaskOptions): UseMaskReturn;
|
|
3125
|
+
|
|
3126
|
+
/**
|
|
3127
|
+
* Options for useMask composable
|
|
3128
|
+
*/
|
|
3129
|
+
export declare interface UseMaskOptions {
|
|
3130
|
+
/**
|
|
3131
|
+
* Mask pattern: # digit, A letter, N alphanumeric, X any, others as literals
|
|
3132
|
+
*/
|
|
3133
|
+
mask: string | Ref<string>;
|
|
3134
|
+
/**
|
|
3135
|
+
* Placeholder character
|
|
3136
|
+
* @default '_'
|
|
3137
|
+
*/
|
|
3138
|
+
placeholder?: string;
|
|
3139
|
+
/**
|
|
3140
|
+
* Show mask placeholder on focus
|
|
3141
|
+
* @default true
|
|
3142
|
+
*/
|
|
3143
|
+
showPlaceholder?: boolean;
|
|
3144
|
+
/**
|
|
3145
|
+
* Show mask on blur
|
|
3146
|
+
* @default false
|
|
3147
|
+
*/
|
|
3148
|
+
showMaskOnBlur?: boolean;
|
|
3149
|
+
/**
|
|
3150
|
+
* Clear incomplete on blur
|
|
3151
|
+
* @default false
|
|
3152
|
+
*/
|
|
3153
|
+
clearIncomplete?: boolean;
|
|
3154
|
+
/**
|
|
3155
|
+
* Disable
|
|
3156
|
+
* @default false
|
|
3157
|
+
*/
|
|
3158
|
+
disabled?: boolean | Ref<boolean>;
|
|
3159
|
+
/**
|
|
3160
|
+
* Callback when value changes
|
|
3161
|
+
*/
|
|
3162
|
+
onChange?: (value: string, rawValue: string) => void;
|
|
3163
|
+
/**
|
|
3164
|
+
* Callback when mask is complete
|
|
3165
|
+
*/
|
|
3166
|
+
onComplete?: (value: string) => void;
|
|
3167
|
+
}
|
|
3168
|
+
|
|
3169
|
+
/**
|
|
3170
|
+
* Return type for useMask composable
|
|
3171
|
+
*/
|
|
3172
|
+
export declare interface UseMaskReturn {
|
|
3173
|
+
/** Get formatted value */
|
|
3174
|
+
getFormattedValue: (value: string) => string;
|
|
3175
|
+
/** Get raw value (without mask literals) */
|
|
3176
|
+
getRawValue: (value: string) => string;
|
|
3177
|
+
/** Check if mask is complete */
|
|
3178
|
+
isComplete: (value: string) => boolean;
|
|
3179
|
+
/** Bind mask to an input element */
|
|
3180
|
+
bind: (element: HTMLInputElement | HTMLTextAreaElement) => () => void;
|
|
3181
|
+
}
|
|
3182
|
+
|
|
2054
3183
|
/**
|
|
2055
3184
|
* Composable for formatting numbers as money
|
|
2056
3185
|
*
|
|
@@ -2133,6 +3262,104 @@ export declare interface UseMoneyReturn {
|
|
|
2133
3262
|
parse: (formatted: string) => number;
|
|
2134
3263
|
}
|
|
2135
3264
|
|
|
3265
|
+
/**
|
|
3266
|
+
* Composable for observing DOM mutations
|
|
3267
|
+
*
|
|
3268
|
+
* @param options - Configuration options
|
|
3269
|
+
* @returns Mutation observer utilities
|
|
3270
|
+
*
|
|
3271
|
+
* @example
|
|
3272
|
+
* ```vue
|
|
3273
|
+
* <script setup>
|
|
3274
|
+
* import { ref } from 'vue'
|
|
3275
|
+
* import { useMutation } from 'directix'
|
|
3276
|
+
*
|
|
3277
|
+
* const containerRef = ref(null)
|
|
3278
|
+
* const { bind } = useMutation({
|
|
3279
|
+
* handler: (mutations) => {
|
|
3280
|
+
* mutations.forEach(mutation => {
|
|
3281
|
+
* console.log('Type:', mutation.type)
|
|
3282
|
+
* console.log('Target:', mutation.target)
|
|
3283
|
+
* })
|
|
3284
|
+
* },
|
|
3285
|
+
* childList: true,
|
|
3286
|
+
* subtree: true
|
|
3287
|
+
* })
|
|
3288
|
+
*
|
|
3289
|
+
* onMounted(() => bind(containerRef.value))
|
|
3290
|
+
* </script>
|
|
3291
|
+
*
|
|
3292
|
+
* <template>
|
|
3293
|
+
* <div ref="containerRef">
|
|
3294
|
+
* Content to observe
|
|
3295
|
+
* </div>
|
|
3296
|
+
* </template>
|
|
3297
|
+
* ```
|
|
3298
|
+
*/
|
|
3299
|
+
export declare function useMutation(options: UseMutationOptions): UseMutationReturn;
|
|
3300
|
+
|
|
3301
|
+
/**
|
|
3302
|
+
* Options for useMutation composable
|
|
3303
|
+
*/
|
|
3304
|
+
export declare interface UseMutationOptions {
|
|
3305
|
+
/**
|
|
3306
|
+
* Callback when mutations occur
|
|
3307
|
+
* @required
|
|
3308
|
+
*/
|
|
3309
|
+
handler: MutationHandler;
|
|
3310
|
+
/**
|
|
3311
|
+
* Whether to observe attribute changes
|
|
3312
|
+
* @default false
|
|
3313
|
+
*/
|
|
3314
|
+
attributes?: boolean;
|
|
3315
|
+
/**
|
|
3316
|
+
* Specific attributes to observe
|
|
3317
|
+
*/
|
|
3318
|
+
attributeFilter?: string[];
|
|
3319
|
+
/**
|
|
3320
|
+
* Whether to observe child node additions/removals
|
|
3321
|
+
* @default true
|
|
3322
|
+
*/
|
|
3323
|
+
childList?: boolean;
|
|
3324
|
+
/**
|
|
3325
|
+
* Whether to observe all descendants, not just direct children
|
|
3326
|
+
* @default false
|
|
3327
|
+
*/
|
|
3328
|
+
subtree?: boolean;
|
|
3329
|
+
/**
|
|
3330
|
+
* Whether to observe character data changes
|
|
3331
|
+
* @default false
|
|
3332
|
+
*/
|
|
3333
|
+
characterData?: boolean;
|
|
3334
|
+
/**
|
|
3335
|
+
* Whether to record old attribute values
|
|
3336
|
+
* @default false
|
|
3337
|
+
*/
|
|
3338
|
+
attributeOldValue?: boolean;
|
|
3339
|
+
/**
|
|
3340
|
+
* Whether to record old character data
|
|
3341
|
+
* @default false
|
|
3342
|
+
*/
|
|
3343
|
+
characterDataOldValue?: boolean;
|
|
3344
|
+
/**
|
|
3345
|
+
* Whether to disable
|
|
3346
|
+
* @default false
|
|
3347
|
+
*/
|
|
3348
|
+
disabled?: boolean | Ref<boolean>;
|
|
3349
|
+
}
|
|
3350
|
+
|
|
3351
|
+
/**
|
|
3352
|
+
* Return type for useMutation composable
|
|
3353
|
+
*/
|
|
3354
|
+
export declare interface UseMutationReturn {
|
|
3355
|
+
/** Bind mutation observer to an element */
|
|
3356
|
+
bind: (element: HTMLElement) => () => void;
|
|
3357
|
+
/** Stop observing */
|
|
3358
|
+
stop: () => void;
|
|
3359
|
+
/** Start observing */
|
|
3360
|
+
start: () => void;
|
|
3361
|
+
}
|
|
3362
|
+
|
|
2136
3363
|
/**
|
|
2137
3364
|
* Composable for formatting numbers
|
|
2138
3365
|
*
|
|
@@ -2213,6 +3440,122 @@ export declare interface UseNumberReturn {
|
|
|
2213
3440
|
parse: (formatted: string) => number;
|
|
2214
3441
|
}
|
|
2215
3442
|
|
|
3443
|
+
/**
|
|
3444
|
+
* Composable for pan gesture
|
|
3445
|
+
*
|
|
3446
|
+
* @param options - Configuration options
|
|
3447
|
+
* @returns Pan gesture utilities
|
|
3448
|
+
*
|
|
3449
|
+
* @example
|
|
3450
|
+
* ```vue
|
|
3451
|
+
* <script setup>
|
|
3452
|
+
* import { ref } from 'vue'
|
|
3453
|
+
* import { usePan } from 'directix'
|
|
3454
|
+
*
|
|
3455
|
+
* const containerRef = ref(null)
|
|
3456
|
+
* const { isPanning, direction, bind } = usePan({
|
|
3457
|
+
* onPan: (e) => console.log('Pan:', e.direction, e.distance)
|
|
3458
|
+
* })
|
|
3459
|
+
*
|
|
3460
|
+
* onMounted(() => bind(containerRef.value))
|
|
3461
|
+
* </script>
|
|
3462
|
+
*
|
|
3463
|
+
* <template>
|
|
3464
|
+
* <div ref="containerRef">Swipe me</div>
|
|
3465
|
+
* </template>
|
|
3466
|
+
* ```
|
|
3467
|
+
*/
|
|
3468
|
+
export declare function usePan(options?: UsePanOptions): UsePanReturn;
|
|
3469
|
+
|
|
3470
|
+
/**
|
|
3471
|
+
* Options for usePan composable
|
|
3472
|
+
*/
|
|
3473
|
+
export declare interface UsePanOptions {
|
|
3474
|
+
/** Callback when pan starts */
|
|
3475
|
+
onStart?: (e: PanEvent) => void;
|
|
3476
|
+
/** Callback during pan */
|
|
3477
|
+
onPan?: (e: PanEvent) => void;
|
|
3478
|
+
/** Callback when pan ends */
|
|
3479
|
+
onEnd?: (e: PanEvent) => void;
|
|
3480
|
+
/** Minimum distance to trigger */
|
|
3481
|
+
threshold?: number;
|
|
3482
|
+
/** Direction constraint */
|
|
3483
|
+
direction?: 'horizontal' | 'vertical' | 'all';
|
|
3484
|
+
/** Prevent default behavior */
|
|
3485
|
+
preventDefault?: boolean;
|
|
3486
|
+
/** Pointer types */
|
|
3487
|
+
pointers?: ('touch' | 'mouse')[];
|
|
3488
|
+
}
|
|
3489
|
+
|
|
3490
|
+
/**
|
|
3491
|
+
* Return type for usePan composable
|
|
3492
|
+
*/
|
|
3493
|
+
export declare interface UsePanReturn {
|
|
3494
|
+
/** Whether pan is in progress */
|
|
3495
|
+
isPanning: Ref<boolean>;
|
|
3496
|
+
/** Current pan direction */
|
|
3497
|
+
direction: Ref<'left' | 'right' | 'up' | 'down' | null>;
|
|
3498
|
+
/** Pan distance */
|
|
3499
|
+
distance: Ref<number>;
|
|
3500
|
+
/** Bind pan to an element */
|
|
3501
|
+
bind: (element: HTMLElement) => () => void;
|
|
3502
|
+
}
|
|
3503
|
+
|
|
3504
|
+
/**
|
|
3505
|
+
* Composable for parallax scrolling
|
|
3506
|
+
*
|
|
3507
|
+
* @param options - Configuration options
|
|
3508
|
+
* @returns Parallax utilities
|
|
3509
|
+
*
|
|
3510
|
+
* @example
|
|
3511
|
+
* ```vue
|
|
3512
|
+
* <script setup>
|
|
3513
|
+
* import { ref } from 'vue'
|
|
3514
|
+
* import { useParallax } from 'directix'
|
|
3515
|
+
*
|
|
3516
|
+
* const containerRef = ref(null)
|
|
3517
|
+
* const { offset, bind } = useParallax({ speed: 0.5 })
|
|
3518
|
+
*
|
|
3519
|
+
* onMounted(() => bind(containerRef.value))
|
|
3520
|
+
* </script>
|
|
3521
|
+
*
|
|
3522
|
+
* <template>
|
|
3523
|
+
* <div ref="containerRef">Parallax content</div>
|
|
3524
|
+
* </template>
|
|
3525
|
+
* ```
|
|
3526
|
+
*/
|
|
3527
|
+
export declare function useParallax(options?: UseParallaxOptions): UseParallaxReturn;
|
|
3528
|
+
|
|
3529
|
+
/**
|
|
3530
|
+
* Options for useParallax composable
|
|
3531
|
+
*/
|
|
3532
|
+
export declare interface UseParallaxOptions {
|
|
3533
|
+
/** Parallax speed factor */
|
|
3534
|
+
speed?: number | Ref<number>;
|
|
3535
|
+
/** Whether enabled */
|
|
3536
|
+
enabled?: boolean | Ref<boolean>;
|
|
3537
|
+
/** Reverse direction */
|
|
3538
|
+
reverse?: boolean;
|
|
3539
|
+
/** Horizontal parallax */
|
|
3540
|
+
horizontal?: boolean;
|
|
3541
|
+
/** Custom transform function */
|
|
3542
|
+
transform?: (offset: number, el: HTMLElement) => string;
|
|
3543
|
+
/** Mobile breakpoint */
|
|
3544
|
+
mobileBreakpoint?: number;
|
|
3545
|
+
}
|
|
3546
|
+
|
|
3547
|
+
/**
|
|
3548
|
+
* Return type for useParallax composable
|
|
3549
|
+
*/
|
|
3550
|
+
export declare interface UseParallaxReturn {
|
|
3551
|
+
/** Current offset */
|
|
3552
|
+
offset: Ref<number>;
|
|
3553
|
+
/** Whether parallax is active */
|
|
3554
|
+
isActive: Ref<boolean>;
|
|
3555
|
+
/** Bind parallax to an element */
|
|
3556
|
+
bind: (element: HTMLElement) => () => void;
|
|
3557
|
+
}
|
|
3558
|
+
|
|
2216
3559
|
/**
|
|
2217
3560
|
* Composable for checking user permissions
|
|
2218
3561
|
*
|
|
@@ -2280,6 +3623,63 @@ export declare interface UsePermissionReturn {
|
|
|
2280
3623
|
recheck: () => void;
|
|
2281
3624
|
}
|
|
2282
3625
|
|
|
3626
|
+
/**
|
|
3627
|
+
* Composable for pinch gesture
|
|
3628
|
+
*
|
|
3629
|
+
* @param options - Configuration options
|
|
3630
|
+
* @returns Pinch gesture utilities
|
|
3631
|
+
*
|
|
3632
|
+
* @example
|
|
3633
|
+
* ```vue
|
|
3634
|
+
* <script setup>
|
|
3635
|
+
* import { ref } from 'vue'
|
|
3636
|
+
* import { usePinch } from 'directix'
|
|
3637
|
+
*
|
|
3638
|
+
* const containerRef = ref(null)
|
|
3639
|
+
* const { scale, bind } = usePinch({
|
|
3640
|
+
* onPinch: (e) => console.log('Scale:', e.scale)
|
|
3641
|
+
* })
|
|
3642
|
+
*
|
|
3643
|
+
* onMounted(() => bind(containerRef.value))
|
|
3644
|
+
* </script>
|
|
3645
|
+
*
|
|
3646
|
+
* <template>
|
|
3647
|
+
* <div ref="containerRef">Pinch to zoom</div>
|
|
3648
|
+
* </template>
|
|
3649
|
+
* ```
|
|
3650
|
+
*/
|
|
3651
|
+
export declare function usePinch(options?: UsePinchOptions): UsePinchReturn;
|
|
3652
|
+
|
|
3653
|
+
/**
|
|
3654
|
+
* Options for usePinch composable
|
|
3655
|
+
*/
|
|
3656
|
+
export declare interface UsePinchOptions {
|
|
3657
|
+
/** Callback when pinch starts */
|
|
3658
|
+
onStart?: (e: PinchEvent) => void;
|
|
3659
|
+
/** Callback during pinch */
|
|
3660
|
+
onPinch?: (e: PinchEvent) => void;
|
|
3661
|
+
/** Callback when pinch ends */
|
|
3662
|
+
onEnd?: (e: PinchEvent) => void;
|
|
3663
|
+
/** Minimum scale */
|
|
3664
|
+
minScale?: number;
|
|
3665
|
+
/** Maximum scale */
|
|
3666
|
+
maxScale?: number;
|
|
3667
|
+
/** Enable transform */
|
|
3668
|
+
enableTransform?: boolean;
|
|
3669
|
+
}
|
|
3670
|
+
|
|
3671
|
+
/**
|
|
3672
|
+
* Return type for usePinch composable
|
|
3673
|
+
*/
|
|
3674
|
+
export declare interface UsePinchReturn {
|
|
3675
|
+
/** Whether pinch is in progress */
|
|
3676
|
+
isPinching: Ref<boolean>;
|
|
3677
|
+
/** Current scale */
|
|
3678
|
+
scale: Ref<number>;
|
|
3679
|
+
/** Bind pinch to an element */
|
|
3680
|
+
bind: (element: HTMLElement) => () => void;
|
|
3681
|
+
}
|
|
3682
|
+
|
|
2283
3683
|
/**
|
|
2284
3684
|
* Composable for printing functionality
|
|
2285
3685
|
*
|
|
@@ -2373,6 +3773,85 @@ export declare interface UsePrintReturn {
|
|
|
2373
3773
|
printPage: () => Promise<void>;
|
|
2374
3774
|
}
|
|
2375
3775
|
|
|
3776
|
+
/**
|
|
3777
|
+
* Composable for progress bar
|
|
3778
|
+
*
|
|
3779
|
+
* @param options - Configuration options
|
|
3780
|
+
* @returns Progress utilities
|
|
3781
|
+
*
|
|
3782
|
+
* @example
|
|
3783
|
+
* ```vue
|
|
3784
|
+
* <script setup>
|
|
3785
|
+
* import { ref } from 'vue'
|
|
3786
|
+
* import { useProgress } from 'directix'
|
|
3787
|
+
*
|
|
3788
|
+
* const containerRef = ref(null)
|
|
3789
|
+
* const { value, percent, setValue, bind } = useProgress({ value: 50 })
|
|
3790
|
+
*
|
|
3791
|
+
* onMounted(() => bind(containerRef.value))
|
|
3792
|
+
* </script>
|
|
3793
|
+
*
|
|
3794
|
+
* <template>
|
|
3795
|
+
* <div ref="containerRef">
|
|
3796
|
+
* <button @click="increment(10)">+10%</button>
|
|
3797
|
+
* </div>
|
|
3798
|
+
* </template>
|
|
3799
|
+
* ```
|
|
3800
|
+
*/
|
|
3801
|
+
export declare function useProgress(options?: UseProgressOptions): UseProgressReturn;
|
|
3802
|
+
|
|
3803
|
+
/**
|
|
3804
|
+
* Options for useProgress composable
|
|
3805
|
+
*/
|
|
3806
|
+
export declare interface UseProgressOptions {
|
|
3807
|
+
/** Current progress value */
|
|
3808
|
+
value?: number | Ref<number>;
|
|
3809
|
+
/** Maximum value */
|
|
3810
|
+
max?: number;
|
|
3811
|
+
/** Minimum value */
|
|
3812
|
+
min?: number;
|
|
3813
|
+
/** Progress bar height */
|
|
3814
|
+
height?: number;
|
|
3815
|
+
/** Progress bar color */
|
|
3816
|
+
color?: string;
|
|
3817
|
+
/** Background color */
|
|
3818
|
+
backgroundColor?: string;
|
|
3819
|
+
/** Transition duration */
|
|
3820
|
+
duration?: number;
|
|
3821
|
+
/** Show percentage text */
|
|
3822
|
+
showText?: boolean;
|
|
3823
|
+
/** Indeterminate mode */
|
|
3824
|
+
indeterminate?: boolean | Ref<boolean>;
|
|
3825
|
+
/** Striped pattern */
|
|
3826
|
+
striped?: boolean;
|
|
3827
|
+
/** Animate stripes */
|
|
3828
|
+
animated?: boolean;
|
|
3829
|
+
/** Callback on change */
|
|
3830
|
+
onChange?: (value: number, percent: number) => void;
|
|
3831
|
+
/** Callback on complete */
|
|
3832
|
+
onComplete?: () => void;
|
|
3833
|
+
}
|
|
3834
|
+
|
|
3835
|
+
/**
|
|
3836
|
+
* Return type for useProgress composable
|
|
3837
|
+
*/
|
|
3838
|
+
export declare interface UseProgressReturn {
|
|
3839
|
+
/** Current value */
|
|
3840
|
+
value: Ref<number>;
|
|
3841
|
+
/** Current percentage */
|
|
3842
|
+
percent: Ref<number>;
|
|
3843
|
+
/** Set progress value */
|
|
3844
|
+
setValue: (value: number) => void;
|
|
3845
|
+
/** Increment progress */
|
|
3846
|
+
increment: (amount?: number) => void;
|
|
3847
|
+
/** Decrement progress */
|
|
3848
|
+
decrement: (amount?: number) => void;
|
|
3849
|
+
/** Reset to minimum */
|
|
3850
|
+
reset: () => void;
|
|
3851
|
+
/** Bind progress to an element */
|
|
3852
|
+
bind: (element: HTMLElement) => () => void;
|
|
3853
|
+
}
|
|
3854
|
+
|
|
2376
3855
|
/**
|
|
2377
3856
|
* Composable for pull to refresh functionality
|
|
2378
3857
|
*
|
|
@@ -2480,67 +3959,265 @@ export declare interface UsePullRefreshReturn {
|
|
|
2480
3959
|
}
|
|
2481
3960
|
|
|
2482
3961
|
/**
|
|
2483
|
-
* Composable for tracking element resize
|
|
3962
|
+
* Composable for tracking element resize
|
|
3963
|
+
*
|
|
3964
|
+
* @param options - Configuration options
|
|
3965
|
+
* @returns Resize utilities
|
|
3966
|
+
*
|
|
3967
|
+
* @example
|
|
3968
|
+
* ```vue
|
|
3969
|
+
* <script setup>
|
|
3970
|
+
* import { ref } from 'vue'
|
|
3971
|
+
* import { useResize } from 'directix'
|
|
3972
|
+
*
|
|
3973
|
+
* const target = ref(null)
|
|
3974
|
+
* const { width, height, bind } = useResize({
|
|
3975
|
+
* debounce: 100,
|
|
3976
|
+
* onResize: (info) => console.log('Resized:', info.width, info.height)
|
|
3977
|
+
* })
|
|
3978
|
+
*
|
|
3979
|
+
* onMounted(() => bind(target.value))
|
|
3980
|
+
* </script>
|
|
3981
|
+
*
|
|
3982
|
+
* <template>
|
|
3983
|
+
* <div ref="target">
|
|
3984
|
+
* Size: {{ width }} x {{ height }}
|
|
3985
|
+
* </div>
|
|
3986
|
+
* </template>
|
|
3987
|
+
* ```
|
|
3988
|
+
*/
|
|
3989
|
+
export declare function useResize(options?: UseResizeOptions): UseResizeReturn;
|
|
3990
|
+
|
|
3991
|
+
/**
|
|
3992
|
+
* Options for useResize composable
|
|
3993
|
+
*/
|
|
3994
|
+
export declare interface UseResizeOptions {
|
|
3995
|
+
/**
|
|
3996
|
+
* Debounce time in milliseconds
|
|
3997
|
+
* @default 0 (no debounce)
|
|
3998
|
+
*/
|
|
3999
|
+
debounce?: number | Ref<number>;
|
|
4000
|
+
/**
|
|
4001
|
+
* Box model to observe
|
|
4002
|
+
* @default 'content-box'
|
|
4003
|
+
*/
|
|
4004
|
+
box?: 'content-box' | 'border-box' | 'device-pixel-content-box';
|
|
4005
|
+
/**
|
|
4006
|
+
* Callback when resize occurs
|
|
4007
|
+
*/
|
|
4008
|
+
onResize?: (info: ResizeInfo) => void;
|
|
4009
|
+
}
|
|
4010
|
+
|
|
4011
|
+
/**
|
|
4012
|
+
* Return type for useResize composable
|
|
4013
|
+
*/
|
|
4014
|
+
export declare interface UseResizeReturn {
|
|
4015
|
+
/** Current width */
|
|
4016
|
+
width: Readonly<Ref<number>>;
|
|
4017
|
+
/** Current height */
|
|
4018
|
+
height: Readonly<Ref<number>>;
|
|
4019
|
+
/** Bind resize observer to an element */
|
|
4020
|
+
bind: (element: HTMLElement) => () => void;
|
|
4021
|
+
/** Stop observing */
|
|
4022
|
+
stop: () => void;
|
|
4023
|
+
}
|
|
4024
|
+
|
|
4025
|
+
/**
|
|
4026
|
+
* Composable for creating ripple effects
|
|
4027
|
+
*
|
|
4028
|
+
* @param options - Configuration options
|
|
4029
|
+
* @returns Ripple utilities
|
|
4030
|
+
*
|
|
4031
|
+
* @example
|
|
4032
|
+
* ```vue
|
|
4033
|
+
* <script setup>
|
|
4034
|
+
* import { ref } from 'vue'
|
|
4035
|
+
* import { useRipple } from 'directix'
|
|
4036
|
+
*
|
|
4037
|
+
* const buttonRef = ref(null)
|
|
4038
|
+
* const { bind, trigger } = useRipple({
|
|
4039
|
+
* color: 'rgba(255, 255, 255, 0.3)',
|
|
4040
|
+
* duration: 600
|
|
4041
|
+
* })
|
|
4042
|
+
*
|
|
4043
|
+
* onMounted(() => bind(buttonRef.value))
|
|
4044
|
+
* </script>
|
|
4045
|
+
*
|
|
4046
|
+
* <template>
|
|
4047
|
+
* <button ref="buttonRef">Click for ripple</button>
|
|
4048
|
+
* </template>
|
|
4049
|
+
* ```
|
|
4050
|
+
*/
|
|
4051
|
+
export declare function useRipple(options?: UseRippleOptions): UseRippleReturn;
|
|
4052
|
+
|
|
4053
|
+
/**
|
|
4054
|
+
* Options for useRipple composable
|
|
4055
|
+
*/
|
|
4056
|
+
export declare interface UseRippleOptions {
|
|
4057
|
+
/**
|
|
4058
|
+
* Ripple color
|
|
4059
|
+
* @default 'currentColor'
|
|
4060
|
+
*/
|
|
4061
|
+
color?: string | Ref<string>;
|
|
4062
|
+
/**
|
|
4063
|
+
* Ripple duration in milliseconds
|
|
4064
|
+
* @default 600
|
|
4065
|
+
*/
|
|
4066
|
+
duration?: number | Ref<number>;
|
|
4067
|
+
/**
|
|
4068
|
+
* Whether to disable ripple
|
|
4069
|
+
* @default false
|
|
4070
|
+
*/
|
|
4071
|
+
disabled?: boolean | Ref<boolean>;
|
|
4072
|
+
/**
|
|
4073
|
+
* Initial scale of ripple
|
|
4074
|
+
* @default 0
|
|
4075
|
+
*/
|
|
4076
|
+
initialScale?: number;
|
|
4077
|
+
/**
|
|
4078
|
+
* Final scale of ripple
|
|
4079
|
+
* @default 2
|
|
4080
|
+
*/
|
|
4081
|
+
finalScale?: number;
|
|
4082
|
+
}
|
|
4083
|
+
|
|
4084
|
+
/**
|
|
4085
|
+
* Return type for useRipple composable
|
|
4086
|
+
*/
|
|
4087
|
+
export declare interface UseRippleReturn {
|
|
4088
|
+
/** Bind ripple effect to an element */
|
|
4089
|
+
bind: (element: HTMLElement) => () => void;
|
|
4090
|
+
/** Trigger ripple effect manually */
|
|
4091
|
+
trigger: (event?: {
|
|
4092
|
+
x?: number;
|
|
4093
|
+
y?: number;
|
|
4094
|
+
}) => void;
|
|
4095
|
+
}
|
|
4096
|
+
|
|
4097
|
+
/**
|
|
4098
|
+
* Composable for rotate gesture
|
|
4099
|
+
*
|
|
4100
|
+
* @param options - Configuration options
|
|
4101
|
+
* @returns Rotate gesture utilities
|
|
4102
|
+
*
|
|
4103
|
+
* @example
|
|
4104
|
+
* ```vue
|
|
4105
|
+
* <script setup>
|
|
4106
|
+
* import { ref } from 'vue'
|
|
4107
|
+
* import { useRotateGesture } from 'directix'
|
|
4108
|
+
*
|
|
4109
|
+
* const containerRef = ref(null)
|
|
4110
|
+
* const { angle, bind } = useRotateGesture({
|
|
4111
|
+
* onRotate: (e) => console.log('Rotation:', e.rotation)
|
|
4112
|
+
* })
|
|
4113
|
+
*
|
|
4114
|
+
* onMounted(() => bind(containerRef.value))
|
|
4115
|
+
* </script>
|
|
4116
|
+
*
|
|
4117
|
+
* <template>
|
|
4118
|
+
* <div ref="containerRef">Rotate with two fingers</div>
|
|
4119
|
+
* </template>
|
|
4120
|
+
* ```
|
|
4121
|
+
*/
|
|
4122
|
+
export declare function useRotateGesture(options?: UseRotateGestureOptions): UseRotateGestureReturn;
|
|
4123
|
+
|
|
4124
|
+
/**
|
|
4125
|
+
* Options for useRotateGesture composable
|
|
4126
|
+
*/
|
|
4127
|
+
export declare interface UseRotateGestureOptions {
|
|
4128
|
+
/** Callback when rotation starts */
|
|
4129
|
+
onStart?: (e: RotateGestureEvent) => void;
|
|
4130
|
+
/** Callback during rotation */
|
|
4131
|
+
onRotate?: (e: RotateGestureEvent) => void;
|
|
4132
|
+
/** Callback when rotation ends */
|
|
4133
|
+
onEnd?: (e: RotateGestureEvent) => void;
|
|
4134
|
+
/** Enable transform */
|
|
4135
|
+
enableTransform?: boolean;
|
|
4136
|
+
}
|
|
4137
|
+
|
|
4138
|
+
/**
|
|
4139
|
+
* Return type for useRotateGesture composable
|
|
4140
|
+
*/
|
|
4141
|
+
export declare interface UseRotateGestureReturn {
|
|
4142
|
+
/** Whether rotation is in progress */
|
|
4143
|
+
isRotating: Ref<boolean>;
|
|
4144
|
+
/** Current rotation angle */
|
|
4145
|
+
angle: Ref<number>;
|
|
4146
|
+
/** Bind rotation to an element */
|
|
4147
|
+
bind: (element: HTMLElement) => () => void;
|
|
4148
|
+
}
|
|
4149
|
+
|
|
4150
|
+
/**
|
|
4151
|
+
* Composable for HTML sanitization
|
|
2484
4152
|
*
|
|
2485
4153
|
* @param options - Configuration options
|
|
2486
|
-
* @returns
|
|
4154
|
+
* @returns Sanitization utilities
|
|
2487
4155
|
*
|
|
2488
4156
|
* @example
|
|
2489
4157
|
* ```vue
|
|
2490
4158
|
* <script setup>
|
|
2491
4159
|
* import { ref } from 'vue'
|
|
2492
|
-
* import {
|
|
4160
|
+
* import { useSanitize } from 'directix'
|
|
2493
4161
|
*
|
|
2494
|
-
* const
|
|
2495
|
-
*
|
|
2496
|
-
*
|
|
2497
|
-
* onResize: (info) => console.log('Resized:', info.width, info.height)
|
|
4162
|
+
* const { sanitize } = useSanitize({
|
|
4163
|
+
* allowedTags: ['b', 'i', 'p'],
|
|
4164
|
+
* allowedAttributes: []
|
|
2498
4165
|
* })
|
|
2499
4166
|
*
|
|
2500
|
-
*
|
|
4167
|
+
* const safeHtml = sanitize(userInput)
|
|
2501
4168
|
* </script>
|
|
2502
|
-
*
|
|
2503
|
-
* <template>
|
|
2504
|
-
* <div ref="target">
|
|
2505
|
-
* Size: {{ width }} x {{ height }}
|
|
2506
|
-
* </div>
|
|
2507
|
-
* </template>
|
|
2508
4169
|
* ```
|
|
2509
4170
|
*/
|
|
2510
|
-
export declare function
|
|
4171
|
+
export declare function useSanitize(options?: UseSanitizeOptions): UseSanitizeReturn;
|
|
2511
4172
|
|
|
2512
4173
|
/**
|
|
2513
|
-
* Options for
|
|
4174
|
+
* Options for useSanitize composable
|
|
2514
4175
|
*/
|
|
2515
|
-
export declare interface
|
|
4176
|
+
export declare interface UseSanitizeOptions {
|
|
2516
4177
|
/**
|
|
2517
|
-
*
|
|
2518
|
-
* @default
|
|
4178
|
+
* Tags to allow (whitelist)
|
|
4179
|
+
* @default ['b', 'i', 'u', 'strong', 'em', 'br', 'p', 'span', 'div']
|
|
2519
4180
|
*/
|
|
2520
|
-
|
|
4181
|
+
allowedTags?: string[];
|
|
2521
4182
|
/**
|
|
2522
|
-
*
|
|
2523
|
-
* @default '
|
|
4183
|
+
* Attributes to allow (whitelist)
|
|
4184
|
+
* @default ['title', 'alt', 'href', 'src']
|
|
2524
4185
|
*/
|
|
2525
|
-
|
|
4186
|
+
allowedAttributes?: string[];
|
|
2526
4187
|
/**
|
|
2527
|
-
*
|
|
4188
|
+
* Whether to allow data URLs
|
|
4189
|
+
* @default false
|
|
2528
4190
|
*/
|
|
2529
|
-
|
|
4191
|
+
allowDataUrls?: boolean;
|
|
4192
|
+
/**
|
|
4193
|
+
* Whether to allow inline styles
|
|
4194
|
+
* @default false
|
|
4195
|
+
*/
|
|
4196
|
+
allowStyles?: boolean;
|
|
4197
|
+
/**
|
|
4198
|
+
* Whether to allow class attribute
|
|
4199
|
+
* @default false
|
|
4200
|
+
*/
|
|
4201
|
+
allowClass?: boolean;
|
|
4202
|
+
/**
|
|
4203
|
+
* Whether to allow id attribute
|
|
4204
|
+
* @default false
|
|
4205
|
+
*/
|
|
4206
|
+
allowId?: boolean;
|
|
4207
|
+
/**
|
|
4208
|
+
* Custom sanitize function
|
|
4209
|
+
*/
|
|
4210
|
+
handler?: (html: string) => string;
|
|
2530
4211
|
}
|
|
2531
4212
|
|
|
2532
4213
|
/**
|
|
2533
|
-
* Return type for
|
|
4214
|
+
* Return type for useSanitize composable
|
|
2534
4215
|
*/
|
|
2535
|
-
export declare interface
|
|
2536
|
-
/**
|
|
2537
|
-
|
|
2538
|
-
/**
|
|
2539
|
-
height: Readonly<Ref<number>>;
|
|
2540
|
-
/** Bind resize observer to an element */
|
|
4216
|
+
export declare interface UseSanitizeReturn {
|
|
4217
|
+
/** Sanitize HTML string */
|
|
4218
|
+
sanitize: (html: string) => string;
|
|
4219
|
+
/** Sanitize and set to element */
|
|
2541
4220
|
bind: (element: HTMLElement) => () => void;
|
|
2542
|
-
/** Stop observing */
|
|
2543
|
-
stop: () => void;
|
|
2544
4221
|
}
|
|
2545
4222
|
|
|
2546
4223
|
/**
|
|
@@ -2618,6 +4295,136 @@ export declare interface UseScrollReturn {
|
|
|
2618
4295
|
}) => void;
|
|
2619
4296
|
}
|
|
2620
4297
|
|
|
4298
|
+
/**
|
|
4299
|
+
* Composable for skeleton loading states
|
|
4300
|
+
*
|
|
4301
|
+
* @param options - Configuration options
|
|
4302
|
+
* @returns Skeleton utilities
|
|
4303
|
+
*
|
|
4304
|
+
* @example
|
|
4305
|
+
* ```vue
|
|
4306
|
+
* <script setup>
|
|
4307
|
+
* import { ref } from 'vue'
|
|
4308
|
+
* import { useSkeleton } from 'directix'
|
|
4309
|
+
*
|
|
4310
|
+
* const containerRef = ref(null)
|
|
4311
|
+
* const loading = ref(true)
|
|
4312
|
+
* const { isLoading, bind } = useSkeleton({ loading, animation: 'wave' })
|
|
4313
|
+
*
|
|
4314
|
+
* onMounted(() => bind(containerRef.value))
|
|
4315
|
+
*
|
|
4316
|
+
* // Later: loading.value = false
|
|
4317
|
+
* </script>
|
|
4318
|
+
*
|
|
4319
|
+
* <template>
|
|
4320
|
+
* <div ref="containerRef">
|
|
4321
|
+
* <p>Content here</p>
|
|
4322
|
+
* </div>
|
|
4323
|
+
* </template>
|
|
4324
|
+
* ```
|
|
4325
|
+
*/
|
|
4326
|
+
export declare function useSkeleton(options?: UseSkeletonOptions): UseSkeletonReturn;
|
|
4327
|
+
|
|
4328
|
+
/**
|
|
4329
|
+
* Options for useSkeleton composable
|
|
4330
|
+
*/
|
|
4331
|
+
export declare interface UseSkeletonOptions {
|
|
4332
|
+
/** Whether to show skeleton loading state */
|
|
4333
|
+
loading?: boolean | Ref<boolean>;
|
|
4334
|
+
/** Animation type */
|
|
4335
|
+
animation?: SkeletonAnimation;
|
|
4336
|
+
/** Skeleton width */
|
|
4337
|
+
width?: string | number;
|
|
4338
|
+
/** Skeleton height */
|
|
4339
|
+
height?: string | number;
|
|
4340
|
+
/** Border radius */
|
|
4341
|
+
radius?: string | number;
|
|
4342
|
+
/** Skeleton color */
|
|
4343
|
+
color?: string;
|
|
4344
|
+
/** Animation color */
|
|
4345
|
+
animationColor?: string;
|
|
4346
|
+
/** Custom class */
|
|
4347
|
+
class?: string;
|
|
4348
|
+
}
|
|
4349
|
+
|
|
4350
|
+
/**
|
|
4351
|
+
* Return type for useSkeleton composable
|
|
4352
|
+
*/
|
|
4353
|
+
export declare interface UseSkeletonReturn {
|
|
4354
|
+
/** Whether skeleton is currently showing */
|
|
4355
|
+
isLoading: Ref<boolean>;
|
|
4356
|
+
/** Show skeleton */
|
|
4357
|
+
show: () => void;
|
|
4358
|
+
/** Hide skeleton */
|
|
4359
|
+
hide: () => void;
|
|
4360
|
+
/** Toggle skeleton */
|
|
4361
|
+
toggle: () => void;
|
|
4362
|
+
/** Bind skeleton to an element */
|
|
4363
|
+
bind: (element: HTMLElement) => () => void;
|
|
4364
|
+
}
|
|
4365
|
+
|
|
4366
|
+
/**
|
|
4367
|
+
* Composable for sticky positioning
|
|
4368
|
+
*
|
|
4369
|
+
* @param options - Configuration options
|
|
4370
|
+
* @returns Sticky utilities
|
|
4371
|
+
*
|
|
4372
|
+
* @example
|
|
4373
|
+
* ```vue
|
|
4374
|
+
* <script setup>
|
|
4375
|
+
* import { ref } from 'vue'
|
|
4376
|
+
* import { useSticky } from 'directix'
|
|
4377
|
+
*
|
|
4378
|
+
* const headerRef = ref(null)
|
|
4379
|
+
* const { isSticky, bind } = useSticky({
|
|
4380
|
+
* offsetTop: 60,
|
|
4381
|
+
* onStick: (sticky) => console.log('Sticky:', sticky)
|
|
4382
|
+
* })
|
|
4383
|
+
*
|
|
4384
|
+
* onMounted(() => bind(headerRef.value))
|
|
4385
|
+
* </script>
|
|
4386
|
+
*
|
|
4387
|
+
* <template>
|
|
4388
|
+
* <header ref="headerRef" :class="{ sticky: isSticky }">
|
|
4389
|
+
* Navigation
|
|
4390
|
+
* </header>
|
|
4391
|
+
* </template>
|
|
4392
|
+
* ```
|
|
4393
|
+
*/
|
|
4394
|
+
export declare function useSticky(options?: UseStickyOptions): UseStickyReturn;
|
|
4395
|
+
|
|
4396
|
+
/**
|
|
4397
|
+
* Options for useSticky composable
|
|
4398
|
+
*/
|
|
4399
|
+
export declare interface UseStickyOptions {
|
|
4400
|
+
/**
|
|
4401
|
+
* Offset from top in pixels
|
|
4402
|
+
* @default 0
|
|
4403
|
+
*/
|
|
4404
|
+
offsetTop?: number | Ref<number>;
|
|
4405
|
+
/**
|
|
4406
|
+
* Callback when stick state changes
|
|
4407
|
+
*/
|
|
4408
|
+
onStick?: (isSticky: boolean) => void;
|
|
4409
|
+
/**
|
|
4410
|
+
* Whether to disable
|
|
4411
|
+
* @default false
|
|
4412
|
+
*/
|
|
4413
|
+
disabled?: boolean | Ref<boolean>;
|
|
4414
|
+
}
|
|
4415
|
+
|
|
4416
|
+
/**
|
|
4417
|
+
* Return type for useSticky composable
|
|
4418
|
+
*/
|
|
4419
|
+
export declare interface UseStickyReturn {
|
|
4420
|
+
/** Whether the element is sticky */
|
|
4421
|
+
isSticky: Readonly<Ref<boolean>>;
|
|
4422
|
+
/** Bind sticky behavior to an element */
|
|
4423
|
+
bind: (element: HTMLElement) => () => void;
|
|
4424
|
+
/** Stop observing */
|
|
4425
|
+
stop: () => void;
|
|
4426
|
+
}
|
|
4427
|
+
|
|
2621
4428
|
/**
|
|
2622
4429
|
* Composable for detecting swipe gestures
|
|
2623
4430
|
*
|
|
@@ -2780,6 +4587,102 @@ export declare interface UseThrottleReturn<T extends (...args: any[]) => any> {
|
|
|
2780
4587
|
cancel: () => void;
|
|
2781
4588
|
}
|
|
2782
4589
|
|
|
4590
|
+
/**
|
|
4591
|
+
* Composable for tooltip functionality
|
|
4592
|
+
*
|
|
4593
|
+
* @param options - Configuration options
|
|
4594
|
+
* @returns Tooltip utilities
|
|
4595
|
+
*
|
|
4596
|
+
* @example
|
|
4597
|
+
* ```vue
|
|
4598
|
+
* <script setup>
|
|
4599
|
+
* import { ref } from 'vue'
|
|
4600
|
+
* import { useTooltip } from 'directix'
|
|
4601
|
+
*
|
|
4602
|
+
* const buttonRef = ref(null)
|
|
4603
|
+
* const { isVisible, bind } = useTooltip({
|
|
4604
|
+
* content: 'Tooltip text',
|
|
4605
|
+
* placement: 'top'
|
|
4606
|
+
* })
|
|
4607
|
+
*
|
|
4608
|
+
* onMounted(() => bind(buttonRef.value))
|
|
4609
|
+
* </script>
|
|
4610
|
+
*
|
|
4611
|
+
* <template>
|
|
4612
|
+
* <button ref="buttonRef">Hover me</button>
|
|
4613
|
+
* </template>
|
|
4614
|
+
* ```
|
|
4615
|
+
*/
|
|
4616
|
+
export declare function useTooltip(options?: UseTooltipOptions): UseTooltipReturn;
|
|
4617
|
+
|
|
4618
|
+
/**
|
|
4619
|
+
* Options for useTooltip composable
|
|
4620
|
+
*/
|
|
4621
|
+
export declare interface UseTooltipOptions {
|
|
4622
|
+
/**
|
|
4623
|
+
* Tooltip content
|
|
4624
|
+
*/
|
|
4625
|
+
content?: string | Ref<string>;
|
|
4626
|
+
/**
|
|
4627
|
+
* Tooltip placement
|
|
4628
|
+
* @default 'top'
|
|
4629
|
+
*/
|
|
4630
|
+
placement?: TooltipPlacement;
|
|
4631
|
+
/**
|
|
4632
|
+
* Trigger type
|
|
4633
|
+
* @default 'hover'
|
|
4634
|
+
*/
|
|
4635
|
+
trigger?: TooltipTrigger;
|
|
4636
|
+
/**
|
|
4637
|
+
* Show delay in milliseconds
|
|
4638
|
+
* @default 0
|
|
4639
|
+
*/
|
|
4640
|
+
delay?: number;
|
|
4641
|
+
/**
|
|
4642
|
+
* Hide delay in milliseconds
|
|
4643
|
+
* @default 0
|
|
4644
|
+
*/
|
|
4645
|
+
hideDelay?: number;
|
|
4646
|
+
/**
|
|
4647
|
+
* Whether to show arrow
|
|
4648
|
+
* @default true
|
|
4649
|
+
*/
|
|
4650
|
+
arrow?: boolean;
|
|
4651
|
+
/**
|
|
4652
|
+
* Custom class for tooltip
|
|
4653
|
+
*/
|
|
4654
|
+
class?: string;
|
|
4655
|
+
/**
|
|
4656
|
+
* Callback when tooltip shows
|
|
4657
|
+
*/
|
|
4658
|
+
onShow?: () => void;
|
|
4659
|
+
/**
|
|
4660
|
+
* Callback when tooltip hides
|
|
4661
|
+
*/
|
|
4662
|
+
onHide?: () => void;
|
|
4663
|
+
/**
|
|
4664
|
+
* Whether to disable
|
|
4665
|
+
* @default false
|
|
4666
|
+
*/
|
|
4667
|
+
disabled?: boolean | Ref<boolean>;
|
|
4668
|
+
}
|
|
4669
|
+
|
|
4670
|
+
/**
|
|
4671
|
+
* Return type for useTooltip composable
|
|
4672
|
+
*/
|
|
4673
|
+
export declare interface UseTooltipReturn {
|
|
4674
|
+
/** Whether the tooltip is visible */
|
|
4675
|
+
isVisible: Readonly<Ref<boolean>>;
|
|
4676
|
+
/** Show the tooltip */
|
|
4677
|
+
show: () => void;
|
|
4678
|
+
/** Hide the tooltip */
|
|
4679
|
+
hide: () => void;
|
|
4680
|
+
/** Toggle the tooltip */
|
|
4681
|
+
toggle: () => void;
|
|
4682
|
+
/** Bind tooltip to an element */
|
|
4683
|
+
bind: (element: HTMLElement) => () => void;
|
|
4684
|
+
}
|
|
4685
|
+
|
|
2783
4686
|
/**
|
|
2784
4687
|
* Composable for touch gesture detection
|
|
2785
4688
|
*
|
|
@@ -2928,21 +4831,164 @@ export declare interface UseTrimOptions {
|
|
|
2928
4831
|
}
|
|
2929
4832
|
|
|
2930
4833
|
/**
|
|
2931
|
-
* Return type for useTrim composable
|
|
4834
|
+
* Return type for useTrim composable
|
|
4835
|
+
*/
|
|
4836
|
+
export declare interface UseTrimReturn {
|
|
4837
|
+
/**
|
|
4838
|
+
* The trimmed text
|
|
4839
|
+
*/
|
|
4840
|
+
trimmed: Ref<string>;
|
|
4841
|
+
/**
|
|
4842
|
+
* Original text
|
|
4843
|
+
*/
|
|
4844
|
+
original: Ref<string>;
|
|
4845
|
+
/**
|
|
4846
|
+
* Whether the text was trimmed
|
|
4847
|
+
*/
|
|
4848
|
+
wasTrimmed: Ref<boolean>;
|
|
4849
|
+
}
|
|
4850
|
+
|
|
4851
|
+
/**
|
|
4852
|
+
* Composable for text truncation
|
|
4853
|
+
*
|
|
4854
|
+
* @param options - Configuration options
|
|
4855
|
+
* @returns Truncation utilities
|
|
4856
|
+
*
|
|
4857
|
+
* @example
|
|
4858
|
+
* ```vue
|
|
4859
|
+
* <script setup>
|
|
4860
|
+
* import { ref } from 'vue'
|
|
4861
|
+
* import { useTruncate } from 'directix'
|
|
4862
|
+
*
|
|
4863
|
+
* const longText = ref('This is a very long text that needs to be truncated')
|
|
4864
|
+
* const { truncated, isTruncated } = useTruncate({
|
|
4865
|
+
* text: longText,
|
|
4866
|
+
* length: 20,
|
|
4867
|
+
* position: 'middle'
|
|
4868
|
+
* })
|
|
4869
|
+
* </script>
|
|
4870
|
+
*
|
|
4871
|
+
* <template>
|
|
4872
|
+
* <span>{{ truncated }}</span>
|
|
4873
|
+
* <span v-if="isTruncated" :title="longText">...</span>
|
|
4874
|
+
* </template>
|
|
4875
|
+
* ```
|
|
4876
|
+
*/
|
|
4877
|
+
export declare function useTruncate(options: UseTruncateOptions): UseTruncateReturn;
|
|
4878
|
+
|
|
4879
|
+
/**
|
|
4880
|
+
* Options for useTruncate composable
|
|
4881
|
+
*/
|
|
4882
|
+
export declare interface UseTruncateOptions {
|
|
4883
|
+
/**
|
|
4884
|
+
* Text to truncate
|
|
4885
|
+
*/
|
|
4886
|
+
text: string | Ref<string>;
|
|
4887
|
+
/**
|
|
4888
|
+
* Maximum length
|
|
4889
|
+
* @default 100
|
|
4890
|
+
*/
|
|
4891
|
+
length?: number | Ref<number>;
|
|
4892
|
+
/**
|
|
4893
|
+
* Truncation position
|
|
4894
|
+
* @default 'end'
|
|
4895
|
+
*/
|
|
4896
|
+
position?: TruncatePosition | Ref<TruncatePosition>;
|
|
4897
|
+
/**
|
|
4898
|
+
* Omission string
|
|
4899
|
+
* @default '...'
|
|
4900
|
+
*/
|
|
4901
|
+
omission?: string;
|
|
4902
|
+
}
|
|
4903
|
+
|
|
4904
|
+
/**
|
|
4905
|
+
* Return type for useTruncate composable
|
|
4906
|
+
*/
|
|
4907
|
+
export declare interface UseTruncateReturn {
|
|
4908
|
+
/** Truncated text */
|
|
4909
|
+
truncated: Readonly<Ref<string>>;
|
|
4910
|
+
/** Whether the text was truncated */
|
|
4911
|
+
isTruncated: Readonly<Ref<boolean>>;
|
|
4912
|
+
/** Original text length */
|
|
4913
|
+
originalLength: Readonly<Ref<number>>;
|
|
4914
|
+
/** Truncate a custom string */
|
|
4915
|
+
truncate: (text: string, length?: number, position?: TruncatePosition) => string;
|
|
4916
|
+
}
|
|
4917
|
+
|
|
4918
|
+
/**
|
|
4919
|
+
* Composable for typewriter effect
|
|
4920
|
+
*
|
|
4921
|
+
* @param options - Configuration options
|
|
4922
|
+
* @returns Typewriter utilities
|
|
4923
|
+
*
|
|
4924
|
+
* @example
|
|
4925
|
+
* ```vue
|
|
4926
|
+
* <script setup>
|
|
4927
|
+
* import { ref } from 'vue'
|
|
4928
|
+
* import { useTypewriter } from 'directix'
|
|
4929
|
+
*
|
|
4930
|
+
* const containerRef = ref(null)
|
|
4931
|
+
* const { displayedText, isTyping, bind } = useTypewriter({
|
|
4932
|
+
* text: 'Hello, World!',
|
|
4933
|
+
* speed: 100
|
|
4934
|
+
* })
|
|
4935
|
+
*
|
|
4936
|
+
* onMounted(() => bind(containerRef.value))
|
|
4937
|
+
* </script>
|
|
4938
|
+
*
|
|
4939
|
+
* <template>
|
|
4940
|
+
* <span ref="containerRef"></span>
|
|
4941
|
+
* </template>
|
|
4942
|
+
* ```
|
|
4943
|
+
*/
|
|
4944
|
+
export declare function useTypewriter(options: UseTypewriterOptions): UseTypewriterReturn;
|
|
4945
|
+
|
|
4946
|
+
/**
|
|
4947
|
+
* Options for useTypewriter composable
|
|
4948
|
+
*/
|
|
4949
|
+
export declare interface UseTypewriterOptions {
|
|
4950
|
+
/** Text to type */
|
|
4951
|
+
text: string | Ref<string>;
|
|
4952
|
+
/** Typing speed */
|
|
4953
|
+
speed?: number;
|
|
4954
|
+
/** Delay before start */
|
|
4955
|
+
delay?: number;
|
|
4956
|
+
/** Loop animation */
|
|
4957
|
+
loop?: boolean;
|
|
4958
|
+
/** Delay before deleting */
|
|
4959
|
+
deleteDelay?: number;
|
|
4960
|
+
/** Delete speed */
|
|
4961
|
+
deleteSpeed?: number;
|
|
4962
|
+
/** Cursor character */
|
|
4963
|
+
cursor?: string | false;
|
|
4964
|
+
/** Cursor blink */
|
|
4965
|
+
cursorBlink?: boolean;
|
|
4966
|
+
/** Callback on start */
|
|
4967
|
+
onStart?: () => void;
|
|
4968
|
+
/** Callback on complete */
|
|
4969
|
+
onComplete?: () => void;
|
|
4970
|
+
/** Callback on each character */
|
|
4971
|
+
onType?: (char: string, index: number) => void;
|
|
4972
|
+
}
|
|
4973
|
+
|
|
4974
|
+
/**
|
|
4975
|
+
* Return type for useTypewriter composable
|
|
2932
4976
|
*/
|
|
2933
|
-
export declare interface
|
|
2934
|
-
/**
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
/**
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
/**
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
4977
|
+
export declare interface UseTypewriterReturn {
|
|
4978
|
+
/** Current displayed text */
|
|
4979
|
+
displayedText: Ref<string>;
|
|
4980
|
+
/** Whether typing is in progress */
|
|
4981
|
+
isTyping: Ref<boolean>;
|
|
4982
|
+
/** Whether deleting is in progress */
|
|
4983
|
+
isDeleting: Ref<boolean>;
|
|
4984
|
+
/** Start typing */
|
|
4985
|
+
start: () => void;
|
|
4986
|
+
/** Stop typing */
|
|
4987
|
+
stop: () => void;
|
|
4988
|
+
/** Reset to empty */
|
|
4989
|
+
reset: () => void;
|
|
4990
|
+
/** Bind typewriter to an element */
|
|
4991
|
+
bind: (element: HTMLElement) => () => void;
|
|
2946
4992
|
}
|
|
2947
4993
|
|
|
2948
4994
|
/**
|
|
@@ -3327,6 +5373,33 @@ export declare interface UseWatermarkReturn {
|
|
|
3327
5373
|
disable: () => void;
|
|
3328
5374
|
}
|
|
3329
5375
|
|
|
5376
|
+
/**
|
|
5377
|
+
* v-blur directive
|
|
5378
|
+
* Background blur overlay effect
|
|
5379
|
+
*
|
|
5380
|
+
* @example
|
|
5381
|
+
* ```vue
|
|
5382
|
+
* <template>
|
|
5383
|
+
* <!-- Simple blur -->
|
|
5384
|
+
* <div v-blur="isBlurred">Content behind blur</div>
|
|
5385
|
+
*
|
|
5386
|
+
* <!-- With radius -->
|
|
5387
|
+
* <div v-blur="15">Blur with 15px radius</div>
|
|
5388
|
+
*
|
|
5389
|
+
* <!-- With options -->
|
|
5390
|
+
* <div v-blur="{
|
|
5391
|
+
* visible: isBlurred,
|
|
5392
|
+
* radius: 20,
|
|
5393
|
+
* overlayColor: 'rgba(255, 255, 255, 0.3)',
|
|
5394
|
+
* lockScroll: true
|
|
5395
|
+
* }">
|
|
5396
|
+
* Content
|
|
5397
|
+
* </div>
|
|
5398
|
+
* </template>
|
|
5399
|
+
* ```
|
|
5400
|
+
*/
|
|
5401
|
+
export declare const vBlur: Directive;
|
|
5402
|
+
|
|
3330
5403
|
/**
|
|
3331
5404
|
* v-capitalcase directive
|
|
3332
5405
|
*
|
|
@@ -3383,6 +5456,43 @@ export declare const vClickDelay: Directive;
|
|
|
3383
5456
|
*/
|
|
3384
5457
|
export declare const vClickOutside: Directive;
|
|
3385
5458
|
|
|
5459
|
+
/**
|
|
5460
|
+
* v-click-wave directive
|
|
5461
|
+
* A simplified click wave effect directive
|
|
5462
|
+
*
|
|
5463
|
+
* @example
|
|
5464
|
+
* ```vue
|
|
5465
|
+
* <template>
|
|
5466
|
+
* <button v-click-wave>Click me</button>
|
|
5467
|
+
* <button v-click-wave="'rgba(255, 255, 255, 0.3)'">Custom color</button>
|
|
5468
|
+
* <button v-click-wave="{ color: 'red', duration: 400 }">Custom options</button>
|
|
5469
|
+
* </template>
|
|
5470
|
+
* ```
|
|
5471
|
+
*/
|
|
5472
|
+
export declare const vClickWave: Directive;
|
|
5473
|
+
|
|
5474
|
+
/**
|
|
5475
|
+
* v-context-menu directive
|
|
5476
|
+
*
|
|
5477
|
+
* @example
|
|
5478
|
+
* ```vue
|
|
5479
|
+
* <template>
|
|
5480
|
+
* <div v-context-menu="menuItems">Right click here</div>
|
|
5481
|
+
* <div v-context-menu="{ items: menuItems, width: 200 }">Custom width</div>
|
|
5482
|
+
* </template>
|
|
5483
|
+
*
|
|
5484
|
+
* <script setup>
|
|
5485
|
+
* const menuItems = [
|
|
5486
|
+
* { label: 'Copy', handler: () => console.log('Copy') },
|
|
5487
|
+
* { label: 'Paste', handler: () => console.log('Paste') },
|
|
5488
|
+
* { divider: true, label: '' },
|
|
5489
|
+
* { label: 'Delete', handler: () => console.log('Delete') }
|
|
5490
|
+
* ]
|
|
5491
|
+
* </script>
|
|
5492
|
+
* ```
|
|
5493
|
+
*/
|
|
5494
|
+
export declare const vContextMenu: Directive;
|
|
5495
|
+
|
|
3386
5496
|
/**
|
|
3387
5497
|
* v-copy directive
|
|
3388
5498
|
*
|
|
@@ -3426,6 +5536,31 @@ export declare const vCopy: Directive;
|
|
|
3426
5536
|
*/
|
|
3427
5537
|
export declare const vCountdown: Directive;
|
|
3428
5538
|
|
|
5539
|
+
/**
|
|
5540
|
+
* v-counter directive
|
|
5541
|
+
* Animated number counter
|
|
5542
|
+
*
|
|
5543
|
+
* @example
|
|
5544
|
+
* ```vue
|
|
5545
|
+
* <template>
|
|
5546
|
+
* <span v-counter="1000">0</span>
|
|
5547
|
+
*
|
|
5548
|
+
* <span v-counter="{
|
|
5549
|
+
* value: 10000,
|
|
5550
|
+
* duration: 3000,
|
|
5551
|
+
* decimals: 2,
|
|
5552
|
+
* useGrouping: true
|
|
5553
|
+
* }">0</span>
|
|
5554
|
+
*
|
|
5555
|
+
* <span v-counter="{
|
|
5556
|
+
* value: targetValue,
|
|
5557
|
+
* formatter: (v) => '$' + v.toFixed(2)
|
|
5558
|
+
* }">0</span>
|
|
5559
|
+
* </template>
|
|
5560
|
+
* ```
|
|
5561
|
+
*/
|
|
5562
|
+
export declare const vCounter: Directive;
|
|
5563
|
+
|
|
3429
5564
|
/**
|
|
3430
5565
|
* v-debounce directive
|
|
3431
5566
|
*
|
|
@@ -3490,6 +5625,91 @@ export declare const vDraggable: Directive;
|
|
|
3490
5625
|
*/
|
|
3491
5626
|
export declare const vEllipsis: Directive;
|
|
3492
5627
|
|
|
5628
|
+
/**
|
|
5629
|
+
* v-emoji directive
|
|
5630
|
+
* Restrict or filter emoji input
|
|
5631
|
+
*
|
|
5632
|
+
* @example
|
|
5633
|
+
* ```vue
|
|
5634
|
+
* <template>
|
|
5635
|
+
* <!-- Strip all emojis -->
|
|
5636
|
+
* <input v-emoji type="text" />
|
|
5637
|
+
*
|
|
5638
|
+
* <!-- Strip emojis with replacement -->
|
|
5639
|
+
* <input v-emoji="{ strip: true, replacement: '*' }" type="text" />
|
|
5640
|
+
*
|
|
5641
|
+
* <!-- Allow specific emojis -->
|
|
5642
|
+
* <input v-emoji="{ allowList: ['😊', '👍'] }" type="text" />
|
|
5643
|
+
*
|
|
5644
|
+
* <!-- Block specific emojis -->
|
|
5645
|
+
* <input v-emoji="{ blockList: ['🚫', '❌'] }" type="text" />
|
|
5646
|
+
* </template>
|
|
5647
|
+
* ```
|
|
5648
|
+
*/
|
|
5649
|
+
export declare const vEmoji: Directive;
|
|
5650
|
+
|
|
5651
|
+
/**
|
|
5652
|
+
* v-export directive
|
|
5653
|
+
*
|
|
5654
|
+
* @example
|
|
5655
|
+
* ```vue
|
|
5656
|
+
* <template>
|
|
5657
|
+
* <button v-export="exportData">Export CSV</button>
|
|
5658
|
+
*
|
|
5659
|
+
* <button v-export="{ data: tableData, format: 'json', filename: 'my-data' }">
|
|
5660
|
+
* Export JSON
|
|
5661
|
+
* </button>
|
|
5662
|
+
*
|
|
5663
|
+
* <button v-export="{
|
|
5664
|
+
* data: tableData,
|
|
5665
|
+
* format: 'csv',
|
|
5666
|
+
* columns: ['name', 'email'],
|
|
5667
|
+
* headers: { name: 'Name', email: 'Email Address' }
|
|
5668
|
+
* }">
|
|
5669
|
+
* Export with custom columns
|
|
5670
|
+
* </button>
|
|
5671
|
+
* </template>
|
|
5672
|
+
*
|
|
5673
|
+
* <script setup>
|
|
5674
|
+
* const tableData = [
|
|
5675
|
+
* { name: 'John', email: 'john@example.com', age: 30 },
|
|
5676
|
+
* { name: 'Jane', email: 'jane@example.com', age: 25 }
|
|
5677
|
+
* ]
|
|
5678
|
+
* </script>
|
|
5679
|
+
* ```
|
|
5680
|
+
*/
|
|
5681
|
+
export declare const vExport: Directive;
|
|
5682
|
+
|
|
5683
|
+
/**
|
|
5684
|
+
* v-fade directive
|
|
5685
|
+
* Fade in/out transition effect
|
|
5686
|
+
*
|
|
5687
|
+
* @example
|
|
5688
|
+
* ```vue
|
|
5689
|
+
* <template>
|
|
5690
|
+
* <!-- Toggle visibility with fade -->
|
|
5691
|
+
* <div v-fade="isVisible">Fade content</div>
|
|
5692
|
+
*
|
|
5693
|
+
* <!-- Fade in only -->
|
|
5694
|
+
* <div v-fade="'in'">Fade in</div>
|
|
5695
|
+
*
|
|
5696
|
+
* <!-- Fade out only -->
|
|
5697
|
+
* <div v-fade="'out'">Fade out</div>
|
|
5698
|
+
*
|
|
5699
|
+
* <!-- With options -->
|
|
5700
|
+
* <div v-fade="{
|
|
5701
|
+
* visible: isVisible,
|
|
5702
|
+
* duration: 500,
|
|
5703
|
+
* easing: 'ease-in-out',
|
|
5704
|
+
* onComplete: () => console.log('Fade complete')
|
|
5705
|
+
* }">
|
|
5706
|
+
* Content
|
|
5707
|
+
* </div>
|
|
5708
|
+
* </template>
|
|
5709
|
+
* ```
|
|
5710
|
+
*/
|
|
5711
|
+
export declare const vFade: Directive;
|
|
5712
|
+
|
|
3493
5713
|
/**
|
|
3494
5714
|
* v-focus directive
|
|
3495
5715
|
*
|
|
@@ -3503,6 +5723,48 @@ export declare const vEllipsis: Directive;
|
|
|
3503
5723
|
*/
|
|
3504
5724
|
export declare const vFocus: Directive;
|
|
3505
5725
|
|
|
5726
|
+
/**
|
|
5727
|
+
* v-fullscreen directive
|
|
5728
|
+
*
|
|
5729
|
+
* @example
|
|
5730
|
+
* ```vue
|
|
5731
|
+
* <template>
|
|
5732
|
+
* <div v-fullscreen>
|
|
5733
|
+
* Content to show in fullscreen
|
|
5734
|
+
* <button @click="toggleFullscreen">Toggle</button>
|
|
5735
|
+
* </div>
|
|
5736
|
+
*
|
|
5737
|
+
* <div v-fullscreen="{ fullscreenClass: 'my-fullscreen' }">
|
|
5738
|
+
* Custom fullscreen class
|
|
5739
|
+
* </div>
|
|
5740
|
+
* </template>
|
|
5741
|
+
* ```
|
|
5742
|
+
*/
|
|
5743
|
+
export declare const vFullscreen: Directive;
|
|
5744
|
+
|
|
5745
|
+
/**
|
|
5746
|
+
* v-highlight directive
|
|
5747
|
+
*
|
|
5748
|
+
* @example
|
|
5749
|
+
* ```vue
|
|
5750
|
+
* <template>
|
|
5751
|
+
* <p v-highlight="'important'">This is an important message.</p>
|
|
5752
|
+
*
|
|
5753
|
+
* <p v-highlight="['Vue', 'React']">Vue and React are popular frameworks.</p>
|
|
5754
|
+
*
|
|
5755
|
+
* <p v-highlight="{
|
|
5756
|
+
* keywords: 'highlight',
|
|
5757
|
+
* className: 'my-highlight',
|
|
5758
|
+
* style: 'background: yellow; color: black;',
|
|
5759
|
+
* caseSensitive: true
|
|
5760
|
+
* }">
|
|
5761
|
+
* This will highlight the word.
|
|
5762
|
+
* </p>
|
|
5763
|
+
* </template>
|
|
5764
|
+
* ```
|
|
5765
|
+
*/
|
|
5766
|
+
export declare const vHighlight: Directive;
|
|
5767
|
+
|
|
3506
5768
|
export declare const vHotkey: Directive;
|
|
3507
5769
|
|
|
3508
5770
|
/**
|
|
@@ -3631,6 +5893,36 @@ export declare const vLoading: Directive;
|
|
|
3631
5893
|
*/
|
|
3632
5894
|
export declare const vLongPress: Directive;
|
|
3633
5895
|
|
|
5896
|
+
/**
|
|
5897
|
+
* v-lottie directive
|
|
5898
|
+
* Lottie animation player
|
|
5899
|
+
*
|
|
5900
|
+
* @example
|
|
5901
|
+
* ```vue
|
|
5902
|
+
* <template>
|
|
5903
|
+
* <!-- With URL -->
|
|
5904
|
+
* <div v-lottie="'https://assets.example.com/animation.json'"></div>
|
|
5905
|
+
*
|
|
5906
|
+
* <!-- With animation data -->
|
|
5907
|
+
* <div v-lottie="animationData"></div>
|
|
5908
|
+
*
|
|
5909
|
+
* <!-- With options -->
|
|
5910
|
+
* <div v-lottie="{
|
|
5911
|
+
* animationData: animationData,
|
|
5912
|
+
* autoplay: true,
|
|
5913
|
+
* loop: true,
|
|
5914
|
+
* speed: 1.5,
|
|
5915
|
+
* onComplete: () => console.log('Done')
|
|
5916
|
+
* }"></div>
|
|
5917
|
+
* </template>
|
|
5918
|
+
*
|
|
5919
|
+
* <script setup>
|
|
5920
|
+
* import animationData from './animation.json'
|
|
5921
|
+
* </script>
|
|
5922
|
+
* ```
|
|
5923
|
+
*/
|
|
5924
|
+
export declare const vLottie: Directive;
|
|
5925
|
+
|
|
3634
5926
|
/**
|
|
3635
5927
|
* v-lowercase directive
|
|
3636
5928
|
*
|
|
@@ -3687,6 +5979,59 @@ export declare const vMutation: Directive;
|
|
|
3687
5979
|
|
|
3688
5980
|
export declare const vNumber: Directive;
|
|
3689
5981
|
|
|
5982
|
+
/**
|
|
5983
|
+
* v-pan directive
|
|
5984
|
+
*
|
|
5985
|
+
* @example
|
|
5986
|
+
* ```vue
|
|
5987
|
+
* <template>
|
|
5988
|
+
* <div v-pan="handlePan">Swipe me</div>
|
|
5989
|
+
*
|
|
5990
|
+
* <div v-pan="{
|
|
5991
|
+
* onPan: handlePan,
|
|
5992
|
+
* direction: 'horizontal',
|
|
5993
|
+
* threshold: 20
|
|
5994
|
+
* }">
|
|
5995
|
+
* Horizontal only
|
|
5996
|
+
* </div>
|
|
5997
|
+
* </template>
|
|
5998
|
+
*
|
|
5999
|
+
* <script setup>
|
|
6000
|
+
* function handlePan(e) {
|
|
6001
|
+
* console.log('Direction:', e.direction)
|
|
6002
|
+
* console.log('Distance:', e.distance)
|
|
6003
|
+
* }
|
|
6004
|
+
* </script>
|
|
6005
|
+
* ```
|
|
6006
|
+
*/
|
|
6007
|
+
export declare const vPan: Directive;
|
|
6008
|
+
|
|
6009
|
+
/**
|
|
6010
|
+
* v-parallax directive
|
|
6011
|
+
* Parallax scrolling effect
|
|
6012
|
+
*
|
|
6013
|
+
* @example
|
|
6014
|
+
* ```vue
|
|
6015
|
+
* <template>
|
|
6016
|
+
* <!-- Simple parallax -->
|
|
6017
|
+
* <div v-parallax>Parallax content</div>
|
|
6018
|
+
*
|
|
6019
|
+
* <!-- With speed factor -->
|
|
6020
|
+
* <div v-parallax="0.3">Slower parallax</div>
|
|
6021
|
+
*
|
|
6022
|
+
* <!-- With options -->
|
|
6023
|
+
* <div v-parallax="{
|
|
6024
|
+
* speed: 0.5,
|
|
6025
|
+
* reverse: true,
|
|
6026
|
+
* mobileBreakpoint: 768
|
|
6027
|
+
* }">
|
|
6028
|
+
* Reverse parallax, disabled on mobile
|
|
6029
|
+
* </div>
|
|
6030
|
+
* </template>
|
|
6031
|
+
* ```
|
|
6032
|
+
*/
|
|
6033
|
+
export declare const vParallax: Directive;
|
|
6034
|
+
|
|
3690
6035
|
/**
|
|
3691
6036
|
* v-permission directive
|
|
3692
6037
|
*
|
|
@@ -3715,6 +6060,34 @@ export declare const vNumber: Directive;
|
|
|
3715
6060
|
*/
|
|
3716
6061
|
export declare const vPermission: Directive;
|
|
3717
6062
|
|
|
6063
|
+
/**
|
|
6064
|
+
* v-pinch directive
|
|
6065
|
+
*
|
|
6066
|
+
* @example
|
|
6067
|
+
* ```vue
|
|
6068
|
+
* <template>
|
|
6069
|
+
* <div v-pinch="handlePinch">Pinch to zoom</div>
|
|
6070
|
+
*
|
|
6071
|
+
* <div v-pinch="{
|
|
6072
|
+
* onPinch: handlePinch,
|
|
6073
|
+
* enableTransform: true,
|
|
6074
|
+
* minScale: 0.5,
|
|
6075
|
+
* maxScale: 3
|
|
6076
|
+
* }">
|
|
6077
|
+
* Pinch to scale
|
|
6078
|
+
* </div>
|
|
6079
|
+
* </template>
|
|
6080
|
+
*
|
|
6081
|
+
* <script setup>
|
|
6082
|
+
* function handlePinch(e) {
|
|
6083
|
+
* console.log('Scale:', e.scale)
|
|
6084
|
+
* console.log('Center:', e.centerX, e.centerY)
|
|
6085
|
+
* }
|
|
6086
|
+
* </script>
|
|
6087
|
+
* ```
|
|
6088
|
+
*/
|
|
6089
|
+
export declare const vPinch: Directive;
|
|
6090
|
+
|
|
3718
6091
|
/**
|
|
3719
6092
|
* v-print directive
|
|
3720
6093
|
*
|
|
@@ -3741,6 +6114,32 @@ export declare const vPermission: Directive;
|
|
|
3741
6114
|
*/
|
|
3742
6115
|
export declare const vPrint: Directive;
|
|
3743
6116
|
|
|
6117
|
+
/**
|
|
6118
|
+
* v-progress directive
|
|
6119
|
+
* Progress bar animation
|
|
6120
|
+
*
|
|
6121
|
+
* @example
|
|
6122
|
+
* ```vue
|
|
6123
|
+
* <template>
|
|
6124
|
+
* <div v-progress="50">Progress at 50%</div>
|
|
6125
|
+
*
|
|
6126
|
+
* <div v-progress="{
|
|
6127
|
+
* value: progressValue,
|
|
6128
|
+
* color: '#42b883',
|
|
6129
|
+
* height: 8,
|
|
6130
|
+
* showText: true
|
|
6131
|
+
* }">
|
|
6132
|
+
* Content
|
|
6133
|
+
* </div>
|
|
6134
|
+
*
|
|
6135
|
+
* <div v-progress="{ indeterminate: true }">
|
|
6136
|
+
* Loading...
|
|
6137
|
+
* </div>
|
|
6138
|
+
* </template>
|
|
6139
|
+
* ```
|
|
6140
|
+
*/
|
|
6141
|
+
export declare const vProgress: Directive;
|
|
6142
|
+
|
|
3744
6143
|
export declare const vPullRefresh: Directive;
|
|
3745
6144
|
|
|
3746
6145
|
/**
|
|
@@ -3770,6 +6169,33 @@ export declare const vResize: Directive;
|
|
|
3770
6169
|
*/
|
|
3771
6170
|
export declare const vRipple: Directive;
|
|
3772
6171
|
|
|
6172
|
+
/**
|
|
6173
|
+
* v-rotate directive
|
|
6174
|
+
* Two-finger rotation gesture
|
|
6175
|
+
*
|
|
6176
|
+
* @example
|
|
6177
|
+
* ```vue
|
|
6178
|
+
* <template>
|
|
6179
|
+
* <div v-rotate="handleRotate">Rotate with two fingers</div>
|
|
6180
|
+
*
|
|
6181
|
+
* <div v-rotate="{
|
|
6182
|
+
* onRotate: handleRotate,
|
|
6183
|
+
* enableTransform: true
|
|
6184
|
+
* }">
|
|
6185
|
+
* Rotate with transform
|
|
6186
|
+
* </div>
|
|
6187
|
+
* </template>
|
|
6188
|
+
*
|
|
6189
|
+
* <script setup>
|
|
6190
|
+
* function handleRotate(e) {
|
|
6191
|
+
* console.log('Rotation:', e.rotation)
|
|
6192
|
+
* console.log('Angle:', e.angle)
|
|
6193
|
+
* }
|
|
6194
|
+
* </script>
|
|
6195
|
+
* ```
|
|
6196
|
+
*/
|
|
6197
|
+
export declare const vRotateGesture: Directive;
|
|
6198
|
+
|
|
3773
6199
|
/**
|
|
3774
6200
|
* v-sanitize directive
|
|
3775
6201
|
*
|
|
@@ -3797,6 +6223,28 @@ export declare const vSanitize: Directive;
|
|
|
3797
6223
|
*/
|
|
3798
6224
|
export declare const vScroll: Directive;
|
|
3799
6225
|
|
|
6226
|
+
/**
|
|
6227
|
+
* v-skeleton directive
|
|
6228
|
+
*
|
|
6229
|
+
* @example
|
|
6230
|
+
* ```vue
|
|
6231
|
+
* <template>
|
|
6232
|
+
* <!-- Basic usage -->
|
|
6233
|
+
* <div v-skeleton="isLoading">Content here</div>
|
|
6234
|
+
*
|
|
6235
|
+
* <!-- With options -->
|
|
6236
|
+
* <div v-skeleton="{ loading: isLoading, animation: 'pulse', width: 200, height: 20 }">
|
|
6237
|
+
* Content here
|
|
6238
|
+
* </div>
|
|
6239
|
+
*
|
|
6240
|
+
* <!-- Multiple skeleton lines -->
|
|
6241
|
+
* <div v-skeleton="{ loading: isLoading, height: '1em' }">Line 1</div>
|
|
6242
|
+
* <div v-skeleton="{ loading: isLoading, height: '1em' }">Line 2</div>
|
|
6243
|
+
* </template>
|
|
6244
|
+
* ```
|
|
6245
|
+
*/
|
|
6246
|
+
export declare const vSkeleton: Directive;
|
|
6247
|
+
|
|
3800
6248
|
/**
|
|
3801
6249
|
* v-sticky directive
|
|
3802
6250
|
*
|
|
@@ -3874,6 +6322,35 @@ export declare const vTrim: Directive;
|
|
|
3874
6322
|
*/
|
|
3875
6323
|
export declare const vTruncate: Directive;
|
|
3876
6324
|
|
|
6325
|
+
/**
|
|
6326
|
+
* v-typewriter directive
|
|
6327
|
+
* Typewriter animation effect
|
|
6328
|
+
*
|
|
6329
|
+
* @example
|
|
6330
|
+
* ```vue
|
|
6331
|
+
* <template>
|
|
6332
|
+
* <!-- Simple usage -->
|
|
6333
|
+
* <span v-typewriter="'Hello, World!'"></span>
|
|
6334
|
+
*
|
|
6335
|
+
* <!-- With options -->
|
|
6336
|
+
* <span v-typewriter="{
|
|
6337
|
+
* text: 'Typing animation',
|
|
6338
|
+
* speed: 100,
|
|
6339
|
+
* cursor: '_',
|
|
6340
|
+
* onComplete: () => console.log('Done!')
|
|
6341
|
+
* }"></span>
|
|
6342
|
+
*
|
|
6343
|
+
* <!-- Loop mode -->
|
|
6344
|
+
* <span v-typewriter="{
|
|
6345
|
+
* text: 'Loop animation',
|
|
6346
|
+
* loop: true,
|
|
6347
|
+
* deleteDelay: 1000
|
|
6348
|
+
* }"></span>
|
|
6349
|
+
* </template>
|
|
6350
|
+
* ```
|
|
6351
|
+
*/
|
|
6352
|
+
export declare const vTypewriter: Directive;
|
|
6353
|
+
|
|
3877
6354
|
/**
|
|
3878
6355
|
* Vue 2 directive hooks
|
|
3879
6356
|
*/
|