@webx-ui/core 0.4.0 → 0.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.
@@ -0,0 +1,82 @@
1
+ import { KanbanCard, KanbanColumn, KanbanId, KanbanProps, KanbanVia } from './types';
2
+ declare const _default: <T extends KanbanCard = KanbanCard>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
4
+ readonly onAdd?: ((column: KanbanColumn<T>) => any) | undefined;
5
+ readonly "onUpdate:collapsed"?: ((value: KanbanId[]) => any) | undefined;
6
+ readonly onMove?: ((move: import('./types').KanbanMove<T>) => any) | undefined;
7
+ readonly "onColumn-move"?: ((move: import('./types').KanbanColumnMove<T>) => any) | undefined;
8
+ readonly "onAdd-column"?: (() => any) | undefined;
9
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onAdd" | "onUpdate:collapsed" | "onMove" | "onColumn-move" | "onAdd-column"> & ({
10
+ collapsed?: KanbanId[];
11
+ } & KanbanProps<T>) & Partial<{}>> & import('vue').PublicProps;
12
+ expose(exposed: import('vue').ShallowUnwrapRef<{
13
+ move: (from: KanbanColumn<T>, fromIndex: number, to: KanbanColumn<T>, toIndex: number, via: KanbanVia) => void;
14
+ moveColumn: (from: number, to: number, via: KanbanVia) => void;
15
+ toggle: (column: KanbanColumn<T>) => void;
16
+ }>): void;
17
+ attrs: any;
18
+ slots: Readonly<{
19
+ /** One card. Without it the board falls back to the card's own title. */
20
+ card?: (props: {
21
+ card: T;
22
+ column: KanbanColumn<T>;
23
+ index: number;
24
+ }) => unknown;
25
+ /** Replaces the title and the count above a column. */
26
+ 'column-header'?: (props: {
27
+ column: KanbanColumn<T>;
28
+ count: number;
29
+ overLimit: boolean;
30
+ }) => unknown;
31
+ /** The end of a column's heading — a plus, a menu, whatever the column can do. */
32
+ 'column-actions'?: (props: {
33
+ column: KanbanColumn<T>;
34
+ collapsed: boolean;
35
+ }) => unknown;
36
+ /** Under the cards, where the add button would be. */
37
+ 'column-footer'?: (props: {
38
+ column: KanbanColumn<T>;
39
+ }) => unknown;
40
+ /** Shown in a column holding no cards. */
41
+ empty?: (props: {
42
+ column: KanbanColumn<T>;
43
+ }) => unknown;
44
+ /** After the last column, in place of the add-a-column button. */
45
+ default?: () => unknown;
46
+ }> & {
47
+ /** One card. Without it the board falls back to the card's own title. */
48
+ card?: (props: {
49
+ card: T;
50
+ column: KanbanColumn<T>;
51
+ index: number;
52
+ }) => unknown;
53
+ /** Replaces the title and the count above a column. */
54
+ 'column-header'?: (props: {
55
+ column: KanbanColumn<T>;
56
+ count: number;
57
+ overLimit: boolean;
58
+ }) => unknown;
59
+ /** The end of a column's heading — a plus, a menu, whatever the column can do. */
60
+ 'column-actions'?: (props: {
61
+ column: KanbanColumn<T>;
62
+ collapsed: boolean;
63
+ }) => unknown;
64
+ /** Under the cards, where the add button would be. */
65
+ 'column-footer'?: (props: {
66
+ column: KanbanColumn<T>;
67
+ }) => unknown;
68
+ /** Shown in a column holding no cards. */
69
+ empty?: (props: {
70
+ column: KanbanColumn<T>;
71
+ }) => unknown;
72
+ /** After the last column, in place of the add-a-column button. */
73
+ default?: () => unknown;
74
+ };
75
+ emit: (((evt: "add", column: KanbanColumn<T>) => void) & ((evt: "move", move: import('./types').KanbanMove<T>) => void) & ((evt: "column-move", move: import('./types').KanbanColumnMove<T>) => void) & ((evt: "add-column") => void)) & ((evt: "update:collapsed", value: KanbanId[]) => void);
76
+ }>) => import('vue').VNode & {
77
+ __ctx?: Awaited<typeof __VLS_setup>;
78
+ };
79
+ export default _default;
80
+ type __VLS_PrettifyLocal<T> = {
81
+ [K in keyof T]: T[K];
82
+ } & {};
@@ -0,0 +1,2 @@
1
+ export { default as WxKanban } from './Kanban';
2
+ export type * from './types';
@@ -0,0 +1,83 @@
1
+ export type KanbanId = string | number;
2
+ /** Colour of the line above a column's heading. */
3
+ export type KanbanTone = 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info';
4
+ export type KanbanSize = 'sm' | 'md';
5
+ /** How something was moved — worth knowing when you animate or undo. */
6
+ export type KanbanVia = 'pointer' | 'keyboard';
7
+ /** The least a card has to carry: something to key it by. */
8
+ export interface KanbanCard {
9
+ id: KanbanId;
10
+ [key: string]: unknown;
11
+ }
12
+ export interface KanbanColumn<T extends KanbanCard = KanbanCard> {
13
+ id: KanbanId;
14
+ title?: string;
15
+ /** The cards, in the order they are shown. The board writes moves back into it. */
16
+ items: T[];
17
+ /**
18
+ * How many cards the column is meant to hold. At the limit the count turns red and
19
+ * nothing more can be dropped in — a work-in-progress limit, the point of a board.
20
+ */
21
+ limit?: number;
22
+ /** Colour of the rule above the heading. */
23
+ tone?: KanbanTone;
24
+ /** Cards can be neither taken from this column nor put into it. */
25
+ disabled?: boolean;
26
+ }
27
+ /** Where a card came from and where it went. */
28
+ export interface KanbanMove<T extends KanbanCard = KanbanCard> {
29
+ card: T;
30
+ from: {
31
+ column: KanbanId;
32
+ index: number;
33
+ };
34
+ to: {
35
+ column: KanbanId;
36
+ index: number;
37
+ };
38
+ via: KanbanVia;
39
+ }
40
+ /** Where a column came from and where it went. */
41
+ export interface KanbanColumnMove<T extends KanbanCard = KanbanCard> {
42
+ column: KanbanColumn<T>;
43
+ from: number;
44
+ to: number;
45
+ via: KanbanVia;
46
+ }
47
+ export interface KanbanProps<T extends KanbanCard = KanbanCard> {
48
+ /** The columns, each carrying its own cards. */
49
+ columns: KanbanColumn<T>[];
50
+ /** Boards that share a name exchange cards. Left alone, a board keeps to itself. */
51
+ group?: string;
52
+ size?: KanbanSize;
53
+ /** Width of a column: a number is pixels, a string is any CSS length. */
54
+ columnWidth?: number | string;
55
+ /** Nothing on the board can be moved. */
56
+ disabled?: boolean;
57
+ /** CSS selector for the part of a card that starts a drag. */
58
+ handle?: string;
59
+ /** Shows an add button under every column, which emits `add`. */
60
+ addable?: boolean;
61
+ addLabel?: string;
62
+ /** Lets a column be folded down to a strip. Use `v-model:collapsed` to remember it. */
63
+ collapsible?: boolean;
64
+ /** Columns can be dragged into another order, by their heading. */
65
+ reorderColumns?: boolean;
66
+ /** Shows an add button after the last column, which emits `add-column`. */
67
+ columnAddable?: boolean;
68
+ addColumnLabel?: string;
69
+ /** Shown in a column with no cards. */
70
+ emptyText?: string;
71
+ /** Accessible name for the board. */
72
+ ariaLabel?: string;
73
+ }
74
+ export interface KanbanEmits<T extends KanbanCard = KanbanCard> {
75
+ /** A card changed position or column. The arrays have already been updated. */
76
+ move: [move: KanbanMove<T>];
77
+ /** A column changed position. */
78
+ 'column-move': [move: KanbanColumnMove<T>];
79
+ /** The add button under a column was pressed. */
80
+ add: [column: KanbanColumn<T>];
81
+ /** The add button after the last column was pressed. */
82
+ 'add-column': [];
83
+ }
@@ -25,6 +25,7 @@ export * from './Icon';
25
25
  export * from './Indicator';
26
26
  export * from './Input';
27
27
  export * from './InputNumber';
28
+ export * from './Kanban';
28
29
  export * from './Link';
29
30
  export * from './Pagination';
30
31
  export * from './Popover';