rei-kit 2.6.0 → 2.8.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.
@@ -0,0 +1,50 @@
1
+ import { Component } from 'vue';
2
+ export interface CommandItem<Id extends string> {
3
+ id: Id;
4
+ /** Already translated. */
5
+ label: string;
6
+ /** A line under it, or a shortcut to show on the right. */
7
+ hint?: string | undefined;
8
+ icon?: Component | undefined;
9
+ /** Extra words that should find it — synonyms, the English name. */
10
+ keywords?: readonly string[] | undefined;
11
+ }
12
+ export interface CommandGroup<Id extends string> {
13
+ /** Already translated. Omitted, the items sit without a heading. */
14
+ label?: string | undefined;
15
+ items: readonly CommandItem<Id>[];
16
+ }
17
+ declare const __VLS_export: <Id extends string>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
18
+ props: import('vue').PublicProps & __VLS_PrettifyLocal<({
19
+ groups: readonly CommandGroup<Id>[];
20
+ /** The dialog's accessible name, e.g. "Commands". */
21
+ label: string;
22
+ /** The field's placeholder, e.g. "Type a command or search". */
23
+ placeholder: string;
24
+ /** Shown when nothing matches, e.g. "Nothing found". */
25
+ emptyLabel: string;
26
+ /** The letter that opens it with ⌘ or Ctrl. Unset, the app opens it itself. */
27
+ hotkey?: string | undefined;
28
+ } & {
29
+ /** Open or closed, with `v-model`. */
30
+ modelValue?: boolean;
31
+ }) & {
32
+ onSelect?: (id: Id) => any;
33
+ "onUpdate:modelValue"?: (value: boolean) => any;
34
+ }> & (typeof globalThis extends {
35
+ __VLS_PROPS_FALLBACK: infer P;
36
+ } ? P : {});
37
+ expose: (exposed: {}) => void;
38
+ attrs: any;
39
+ slots: {};
40
+ emit: ((evt: "select", id: Id) => void) & ((event: "update:modelValue", value: boolean) => void);
41
+ }>) => import('vue').VNode & {
42
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
43
+ };
44
+ declare const _default: typeof __VLS_export;
45
+ export default _default;
46
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
47
+ [K in keyof T]: T[K];
48
+ } : {
49
+ [K in keyof T as K]: T[K];
50
+ }) & {};
@@ -0,0 +1,61 @@
1
+ import { Column } from '../components/BaseTable.vue';
2
+ export interface DataColumn<Row> extends Column<Row> {
3
+ /** Adds a button to the header that sorts by this column. */
4
+ sortable?: boolean | undefined;
5
+ }
6
+ export interface TableSort<Row> {
7
+ key: string & keyof Row;
8
+ direction: 'asc' | 'desc';
9
+ }
10
+ declare const __VLS_export: <Row extends Record<string, unknown>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
11
+ props: import('vue').PublicProps & __VLS_PrettifyLocal<({
12
+ columns: readonly DataColumn<Row>[];
13
+ rows: readonly Row[];
14
+ /** What this table is. Required — an unnamed table is a box of numbers. */
15
+ caption: string;
16
+ captionHidden?: boolean | undefined;
17
+ /** Which field identifies a row. Required for selection. */
18
+ rowKey?: (string & keyof Row) | undefined;
19
+ /** Given with `rowKey`, the table grows a checkbox column. Names the header one. */
20
+ selectAllLabel?: string | undefined;
21
+ /** Names each row's checkbox from the row: `(row) => \`Select ${row.name}\``. */
22
+ rowLabel?: ((row: Row) => string) | undefined;
23
+ /** Report the sort instead of doing it — for a server that pages the data. */
24
+ manualSort?: boolean | undefined;
25
+ /** Draws skeleton rows instead of the body. */
26
+ loading?: boolean | undefined;
27
+ loadingRows?: number | undefined;
28
+ /** Keeps the header on screen while the body scrolls under it. */
29
+ stickyHeader?: boolean | undefined;
30
+ } & {
31
+ /** Which column is sorted, and which way. `v-model:sort`. */
32
+ sort?: TableSort<Row> | undefined;
33
+ /** The chosen rows' keys. `v-model:selected`. */
34
+ selected?: string[];
35
+ }) & {
36
+ "onUpdate:sort"?: (value: TableSort<Row> | undefined) => any;
37
+ "onUpdate:selected"?: (value: string[]) => any;
38
+ }> & (typeof globalThis extends {
39
+ __VLS_PROPS_FALLBACK: infer P;
40
+ } ? P : {});
41
+ expose: (exposed: {}) => void;
42
+ attrs: any;
43
+ slots: {
44
+ [key: string]: (props: {
45
+ row: Row;
46
+ value: unknown;
47
+ }) => unknown;
48
+ /** Shown instead of the body when there are no rows. */
49
+ empty?: () => unknown;
50
+ };
51
+ emit: ((event: "update:sort", value: TableSort<Row> | undefined) => void) & ((event: "update:selected", value: string[]) => void);
52
+ }>) => import('vue').VNode & {
53
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
54
+ };
55
+ declare const _default: typeof __VLS_export;
56
+ export default _default;
57
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
58
+ [K in keyof T]: T[K];
59
+ } : {
60
+ [K in keyof T as K]: T[K];
61
+ }) & {};
@@ -34,6 +34,19 @@ export { default as BaseDisclosure } from './BaseDisclosure.vue';
34
34
  */
35
35
  export { default as BaseModal } from './BaseModal.vue';
36
36
  export { default as BasePagination } from './BasePagination.vue';
37
+ /**
38
+ * Everything the app can do, behind ⌘K. In the wide entry because it is a
39
+ * keyboard shortcut first: a phone has no ⌘, and an app that is only ever a
40
+ * phone should not download it.
41
+ */
42
+ export { default as CommandMenu } from './CommandMenu.vue';
43
+ export type { CommandGroup, CommandItem } from './CommandMenu.vue';
44
+ /**
45
+ * `BaseTable` with a sort, a selection and a loading state. Wide because a
46
+ * table of nine columns is not a thing a phone shows; a phone shows a list.
47
+ */
48
+ export { default as DataTable } from './DataTable.vue';
49
+ export type { DataColumn, TableSort } from './DataTable.vue';
37
50
  export { default as BaseTabs } from './BaseTabs.vue';
38
51
  export type { TabPanel } from './BaseTabs.vue';
39
52
  export { default as BaseTooltip } from './BaseTooltip.vue';