1 | /**
|
2 | * @param {string} input - String to capitalize first letter
|
3 | */
|
4 | export declare function capitalize(input: string): string;
|
5 | /**
|
6 | * @param {string} prefix - String to prefix ID with
|
7 | */
|
8 | export declare function getUniqueId(prefix?: string): string;
|
9 | /**
|
10 | * @param { any } this - "This" reference
|
11 | * @param { Function } func - Function to debounce
|
12 | * @param { number } wait - Debounce amount
|
13 | */
|
14 | export declare function debounce(this: any, func: (...args: any[]) => any, wait: number): (...args: any[]) => void;
|
15 | /** This function returns whether or not an element is within the viewable area of a container. If partial is true,
|
16 | * then this function will return true even if only part of the element is in view.
|
17 | *
|
18 | * @param {HTMLElement} container The container to check if the element is in view of.
|
19 | * @param {HTMLElement} element The element to check if it is view
|
20 | * @param {boolean} partial true if partial view is allowed
|
21 | * @param {boolean} strict true if strict mode is set, never consider the container width and element width
|
22 | *
|
23 | * @returns { boolean } True if the component is in View.
|
24 | */
|
25 | export declare function isElementInView(container: HTMLElement, element: HTMLElement, partial: boolean, strict?: boolean): boolean;
|
26 | /** This function returns the side the element is out of view on (right, left or both)
|
27 | *
|
28 | * @param {HTMLElement} container The container to check if the element is in view of.
|
29 | * @param {HTMLElement} element The element to check if it is view
|
30 | *
|
31 | * @returns {string} right if the element is of the right, left if element is off the left or both if it is off on both sides.
|
32 | */
|
33 | export declare function sideElementIsOutOfView(container: HTMLElement, element: HTMLElement): string;
|
34 | /** Interpolates a parameterized templateString using values from a templateVars object.
|
35 | * The templateVars object should have keys and values which match the templateString's parameters.
|
36 | * Example:
|
37 | * const templateString: 'My name is ${firstName} ${lastName}';
|
38 | * const templateVars: {
|
39 | * firstName: 'Jon'
|
40 | * lastName: 'Dough'
|
41 | * };
|
42 | * const result = fillTemplate(templateString, templateVars);
|
43 | * // "My name is Jon Dough"
|
44 | *
|
45 | * @param {string} templateString The string passed by the consumer
|
46 | * @param {object} templateVars The variables passed to the string
|
47 | *
|
48 | * @returns {string} The template string literal result
|
49 | */
|
50 | export declare function fillTemplate(templateString: string, templateVars: any): string;
|
51 | /**
|
52 | * This function allows for keyboard navigation through dropdowns. The custom argument is optional.
|
53 | *
|
54 | * @param {number} index The index of the element you're on
|
55 | * @param {number} innerIndex Inner index number
|
56 | * @param {string} position The orientation of the dropdown
|
57 | * @param {string[]} refsCollection Array of refs to the items in the dropdown
|
58 | * @param {object[]} kids Array of items in the dropdown
|
59 | * @param {boolean} [custom] Allows for handling of flexible content
|
60 | */
|
61 | export declare function keyHandler(index: number, innerIndex: number, position: string, refsCollection: any[], kids: any[], custom?: boolean): void;
|
62 | /** This function returns a list of tabbable items in a container
|
63 | *
|
64 | * @param {any} containerRef to the container
|
65 | * @param {string} tababbleSelectors CSS selector string of tabbable items
|
66 | */
|
67 | export declare function findTabbableElements(containerRef: any, tababbleSelectors: string): any[];
|
68 | /** This function is a helper for keyboard navigation through dropdowns.
|
69 | *
|
70 | * @param {number} index The index of the element you're on
|
71 | * @param {string} position The orientation of the dropdown
|
72 | * @param {string[]} collection Array of refs to the items in the dropdown
|
73 | */
|
74 | export declare function getNextIndex(index: number, position: string, collection: any[]): number;
|
75 | /** This function is a helper for pluralizing strings.
|
76 | *
|
77 | * @param {number} i The quantity of the string you want to pluralize
|
78 | * @param {string} singular The singular version of the string
|
79 | * @param {string} plural The change to the string that should occur if the quantity is not equal to 1.
|
80 | * Defaults to adding an 's'.
|
81 | */
|
82 | export declare function pluralize(i: number, singular: string, plural?: string): string;
|
83 | /**
|
84 | * This function is a helper for turning arrays of breakpointMod objects for flex and grid into style object
|
85 | *
|
86 | * @param {object} mods The modifiers object
|
87 | * @param {string} css-variable The appropriate css variable for the component
|
88 | */
|
89 | export declare const setBreakpointCssVars: (mods: {
|
90 | default?: string;
|
91 | sm?: string;
|
92 | md?: string;
|
93 | lg?: string;
|
94 | xl?: string;
|
95 | '2xl'?: string;
|
96 | '3xl'?: string;
|
97 | }, cssVar: string) => React.CSSProperties;
|
98 | export interface Mods {
|
99 | default?: string;
|
100 | sm?: string;
|
101 | md?: string;
|
102 | lg?: string;
|
103 | xl?: string;
|
104 | '2xl'?: string;
|
105 | '3xl'?: string;
|
106 | }
|
107 | /**
|
108 | * This function is a helper for turning arrays of breakpointMod objects for data toolbar and flex into classes
|
109 | *
|
110 | * @param {object} mods The modifiers object
|
111 | * @param {any} styles The appropriate styles object for the component
|
112 | */
|
113 | export declare const formatBreakpointMods: (mods: Mods, styles: any, stylePrefix?: string, breakpoint?: 'default' | 'sm' | 'md' | 'lg' | 'xl' | '2xl') => any;
|
114 | /**
|
115 | * Return the breakpoint for the given width
|
116 | *
|
117 | * @param {number | null} width The width to check
|
118 | * @returns {'default' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'} The breakpoint
|
119 | */
|
120 | export declare const getBreakpoint: (width: number) => 'default' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
121 | /**
|
122 | *
|
123 | * @param {string} s string to make camelCased
|
124 | */
|
125 | export declare const toCamel: (s: string) => string;
|
126 | /**
|
127 | * Copied from exenv
|
128 | */
|
129 | export declare const canUseDOM: boolean;
|
130 | /**
|
131 | * Calculate the width of the text
|
132 | * Example:
|
133 | * getTextWidth('my text', node)
|
134 | *
|
135 | * @param {string} text The text to calculate the width for
|
136 | * @param {HTMLElement} node The HTML element
|
137 | */
|
138 | export declare const getTextWidth: (text: string, node: HTMLElement) => number;
|
139 | /**
|
140 | * Get the inner dimensions of an element
|
141 | *
|
142 | * @param {HTMLElement} node HTML element to calculate the inner dimensions for
|
143 | */
|
144 | export declare const innerDimensions: (node: HTMLElement) => {
|
145 | height: number;
|
146 | width: number;
|
147 | };
|
148 | /**
|
149 | * This function is a helper for truncating text content on the left, leaving the right side of the content in view
|
150 | *
|
151 | * @param {HTMLElement} node HTML element
|
152 | * @param {string} value The original text value
|
153 | */
|
154 | export declare const trimLeft: (node: HTMLElement, value: string) => void;
|
155 | /**
|
156 | * @param {string[]} events - Operations to prevent when disabled
|
157 | */
|
158 | export declare const preventedEvents: (events: string[]) => {};
|
159 | //# sourceMappingURL=util.d.ts.map |
\ | No newline at end of file |