UNPKG

@nethesis/vue-components

Version:

This library contains: - a collection of Vue 3 components based on [Flowbite](https://flowbite.com/) - a set of utility functions

49 lines 2.15 kB
import type { Ref } from 'vue'; /** * Uppercase the first character, leaving the rest untouched. Unlike lodash capitalize, it doesn't * lowercase the remainder, which would mangle locales that capitalize other words (e.g. German) */ export declare function capitalizeFirst(value: string): string; /** * Sort function to order array elements by a specific property (for array of objects) or by a specific index (for arrays of arrays) * */ export declare const sortByProperty: (property: string | number) => (a: any, b: any) => 1 | 0 | -1; /** * Set the focus on an element. To set the focus on a custom component, it needs to expose focus() function (see NeTextInput for an example) * */ export declare const focusElement: (elementRef: Ref<{ focus: () => void; } | null | undefined>) => void; /** * Returns a i18n key for an error returned by Axios * */ export declare const getAxiosErrorMessage: (error: any) => "error.network_error" | "error.network_timeout" | "error.http_401" | "error.http_403" | "error.http_404" | "error.http_500" | "error.generic_error"; /** * Format a byte size according to the International Electrotechnical Commission (IEC), using 1024 as multiple factor * * @param byteSize the number of bytes to format * @returns a string representing the byte size with the appropriate unit */ export declare const byteFormat1024: (byteSize: number) => string; /** * Format a byte size according to the International System of Units (SI), using 1000 as multiple factor * * @param byteSize the number of bytes to format * @returns a string representing the byte size with the appropriate unit */ export declare const byteFormat1000: (byteSize: number) => string; /** * Format kilobits per second (kbps, typically a network speed) * * @param kbps the number of kilobits to format * @returns a string representing the input value with the appropriate unit */ export declare const kbpsFormat: (kbps: number) => string; /** * Prints a deprecation warning in the browser console */ export declare const warnDeprecated: (componentName: string, message: string) => void; //# sourceMappingURL=utils.d.ts.map