@htmlbricks/hb-bundle
Version:
Single IIFE loader for all HTML Bricks hb-* web components from the jsDelivr CDN, with optional Subresource Integrity; includes agent/LLM docs and theme CSS variables.
40 lines (38 loc) • 1.6 kB
TypeScript
export type Component = {
id?: string;
style?: string;
/** Total page count; defaults to `1` in the implementation. */
pages?: number;
/** Zero-based current page; defaults to `0`. */
page?: number;
info?: {
total?: number;
size?: number;
/** Type of page size selector: "number" for free input, "select" for dropdown */
page_size_type?: "number" | "select";
/** Page size options for select mode: comma-separated string, JSON array string, or array after `info` is parsed */
page_size_options?: string | string[] | number[];
/** Available sort fields. At least one must be present to show the sort indicator */
sort_fields?: { value: string; label?: string }[];
/** Currently selected sort field */
sort_by?: string;
/** Current sort direction */
sort_direction?: "asc" | "desc" | "default";
/** Whether the sort controls are disabled */
sort_disabled?: boolean;
/** Whether the sort direction is disabled */
sort_direction_disabled?: boolean;
/** When true, sort_direction can only be "asc" or "desc" (no "default" state) */
sort_strict_direction?: boolean;
/** Value for the "Default" sort option (emitted as sort_by when default is selected) */
sort_default_value?: string;
/** Custom label for the "Default" sort option (e.g. "Relevance") */
sort_default_label?: string;
};
i18nlang?: string;
};
export type Events = {
pageChange: { page: number; pages: number };
changePageSize: { page_size: number };
changeSort: { sort_by: string; sort_direction: "asc" | "desc" | "default" };
};