@khaos-systems/helm 0.2.3 → 0.3.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.
- package/README.md +11 -4
- package/dist/MtIconSelect-CfmehFw5.js +7859 -0
- package/dist/MtIconSelect-D3hqMI_b.cjs +46 -0
- package/dist/components/matter/MtButton.d.ts +2 -2
- package/dist/components/matter/MtDropdown.d.ts +1 -1
- package/dist/components/matter/MtFilter.d.ts +6 -0
- package/dist/components/matter/MtIcon.d.ts +3 -0
- package/dist/components/matter/MtIconSelect.d.ts +19 -0
- package/dist/components/matter/MtInput.d.ts +1 -1
- package/dist/components/matter/MtSearch.d.ts +1 -1
- package/dist/components/matter/MtSelect.d.ts +1 -1
- package/dist/components/matter/MtToast.d.ts +31 -0
- package/dist/components/matter/experimental/collection/MtCollection.d.ts +41 -1
- package/dist/components/matter/experimental/collection/MtCollectionContext.d.ts +26 -3
- package/dist/components/matter/experimental/collection/MtCollectionEntryControls.d.ts +21 -5
- package/dist/components/matter/experimental/collection/MtCollectionEntryUtils.d.ts +24 -0
- package/dist/components/matter/experimental/collection/MtCollectionSelectionToolbar.d.ts +8 -0
- package/dist/components/matter/experimental/collection/MtCollectionTaskListEntry.d.ts +32 -1
- package/dist/components/matter/experimental/collection/MtCollectionToast.d.ts +10 -0
- package/dist/components/matter/experimental/collection/index.d.ts +2 -1
- package/dist/components/matter/experimental/collection/layouts/MtCollectionBoardLayout.d.ts +33 -0
- package/dist/components/matter/experimental/collection/layouts/MtCollectionPlanLayout.d.ts +2 -0
- package/dist/components/matter/experimental/collection/layouts/useBoardDnd.d.ts +40 -0
- package/dist/experimental.cjs +6 -2
- package/dist/experimental.js +6464 -1720
- package/dist/lib.d.ts +4 -1
- package/dist/matter.cjs +2 -2
- package/dist/matter.js +262 -275
- package/dist/styles.css +1 -1
- package/package.json +6 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InputHTMLAttributes } from 'react';
|
|
2
2
|
interface MtInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'variant'> {
|
|
3
3
|
size?: 'medium' | 'large';
|
|
4
|
-
variant?: 'default' | 'ghost';
|
|
4
|
+
variant?: 'default' | 'ghost' | 'panel';
|
|
5
5
|
placeholder?: string;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InputHTMLAttributes } from 'react';
|
|
2
2
|
interface MtSearchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'variant' | 'type'> {
|
|
3
3
|
size?: 'medium' | 'large';
|
|
4
|
-
variant?: 'default' | 'ghost';
|
|
4
|
+
variant?: 'default' | 'ghost' | 'panel';
|
|
5
5
|
}
|
|
6
6
|
export declare function MtSearch({ size, variant, className, value: propValue, onChange, placeholder, ...props }: MtSearchProps): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -22,7 +22,7 @@ interface MtSelectProps {
|
|
|
22
22
|
icon?: React.ReactNode;
|
|
23
23
|
disabled?: boolean;
|
|
24
24
|
}[];
|
|
25
|
-
variant?: 'default' | 'ghost';
|
|
25
|
+
variant?: 'default' | 'ghost' | 'accent' | 'panel';
|
|
26
26
|
showCaret?: boolean;
|
|
27
27
|
}
|
|
28
28
|
type MtSelectComponent = ((props: MtSelectProps) => React.ReactElement) & {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
type ToastVariant = 'default' | 'error' | 'success';
|
|
3
|
+
interface MtToastContextValue {
|
|
4
|
+
/** Show a toast with the given message. */
|
|
5
|
+
toast: (message: string, options?: {
|
|
6
|
+
variant?: ToastVariant;
|
|
7
|
+
durationMs?: number;
|
|
8
|
+
}) => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Hook to show toasts from anywhere in the app.
|
|
12
|
+
*
|
|
13
|
+
* Returns `null` if no `<MtToastProvider>` is present above in the tree.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useMtToast(): MtToastContextValue | null;
|
|
16
|
+
/**
|
|
17
|
+
* Site-wide toast provider built on Radix Toast.
|
|
18
|
+
*
|
|
19
|
+
* Wrap your app root with `<MtToastProvider>` and use the `useMtToast()` hook
|
|
20
|
+
* to dispatch toasts from any component.
|
|
21
|
+
*
|
|
22
|
+
* ```tsx
|
|
23
|
+
* <MtToastProvider>
|
|
24
|
+
* <App />
|
|
25
|
+
* </MtToastProvider>
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare function MtToastProvider({ children }: {
|
|
29
|
+
children: ReactNode;
|
|
30
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export {};
|
|
@@ -14,16 +14,24 @@
|
|
|
14
14
|
* - [MUI DataGrid](https://mui.com/x/react-data-grid/)
|
|
15
15
|
*/
|
|
16
16
|
import React, { ReactNode } from 'react';
|
|
17
|
+
import type { MtCollectionAssigneeOption } from './MtCollectionEntryControls';
|
|
17
18
|
/**
|
|
18
19
|
* Minimal interface for an item represented in the collection.
|
|
19
20
|
*/
|
|
20
21
|
export interface MtCollectionEntry {
|
|
21
22
|
id: any;
|
|
22
23
|
}
|
|
24
|
+
export interface MtCollectionDiscreteValueOption {
|
|
25
|
+
value: string;
|
|
26
|
+
label?: string;
|
|
27
|
+
icon?: string;
|
|
28
|
+
color?: string;
|
|
29
|
+
}
|
|
23
30
|
export interface MtCollectionProperty {
|
|
24
31
|
id: string;
|
|
25
32
|
label: string;
|
|
26
33
|
groupable?: boolean;
|
|
34
|
+
discreteValues?: Array<string | MtCollectionDiscreteValueOption>;
|
|
27
35
|
}
|
|
28
36
|
export interface MtCollectionViewSettingsState {
|
|
29
37
|
visiblePropertyIds?: string[];
|
|
@@ -70,6 +78,14 @@ export interface MtCollectionLayoutProps<T extends MtCollectionEntry> {
|
|
|
70
78
|
viewSettings?: MtCollectionViewSettingsState;
|
|
71
79
|
/** Custom renderer for each entry. Layouts should fall back to their own default if omitted. */
|
|
72
80
|
renderEntry?: MtCollectionEntryRenderer<T>;
|
|
81
|
+
/** Optional assignee options for entry-level assignee controls. */
|
|
82
|
+
assigneeOptions?: MtCollectionAssigneeOption[];
|
|
83
|
+
/** Optional callback invoked when a layout updates an entry field. */
|
|
84
|
+
onUpdateEntry?: (entry: T, patch: Partial<T>) => void | Promise<void>;
|
|
85
|
+
/** When true, subtask expand/collapse and add-subtask controls are shown. */
|
|
86
|
+
subtasksEnabled?: boolean;
|
|
87
|
+
/** Called when the user clicks "+ Add subtask" for a parent entry. */
|
|
88
|
+
onAddSubtask?: (parentEntry: T) => void | Promise<void>;
|
|
73
89
|
}
|
|
74
90
|
/**
|
|
75
91
|
* Props for MtCollection component
|
|
@@ -77,6 +93,8 @@ export interface MtCollectionLayoutProps<T extends MtCollectionEntry> {
|
|
|
77
93
|
export interface MtCollectionProps<T extends MtCollectionEntry> {
|
|
78
94
|
entries: T[];
|
|
79
95
|
views: MtCollectionView<T>[];
|
|
96
|
+
/** Optional template views used when creating new views from available layouts. */
|
|
97
|
+
viewTemplates?: MtCollectionView<T>[];
|
|
80
98
|
properties?: MtCollectionProperty[];
|
|
81
99
|
/** Undefined will render default toolbar, null will render no toolbar. */
|
|
82
100
|
toolbar?: ReactNode | null;
|
|
@@ -85,8 +103,30 @@ export interface MtCollectionProps<T extends MtCollectionEntry> {
|
|
|
85
103
|
showViewSettings?: boolean;
|
|
86
104
|
viewSettings?: ReactNode;
|
|
87
105
|
className?: string;
|
|
106
|
+
assigneeOptions?: MtCollectionAssigneeOption[];
|
|
107
|
+
currentUserQuickFilter?: {
|
|
108
|
+
assignee: string;
|
|
109
|
+
label: string;
|
|
110
|
+
avatarSrc?: string;
|
|
111
|
+
};
|
|
112
|
+
onUpdateEntry?: (entry: T, patch: Partial<T>) => void | Promise<void>;
|
|
113
|
+
onAddEntry?: () => void | Promise<void>;
|
|
114
|
+
/** When true, subtask expand/collapse and add-subtask controls are shown. */
|
|
115
|
+
subtasksEnabled?: boolean;
|
|
116
|
+
/** Called when the user clicks "+ Add subtask" for a parent entry. */
|
|
117
|
+
onAddSubtask?: (parentEntry: T) => void | Promise<void>;
|
|
118
|
+
/** Persist a view and optionally return its persisted id. */
|
|
119
|
+
onSaveView?: (view: MtCollectionView<T>) => Promise<string | void>;
|
|
120
|
+
/** Delete a persisted view. */
|
|
121
|
+
onDeleteView?: (viewId: string) => Promise<void>;
|
|
122
|
+
/** Bulk-delete entries by id. Called immediately with no confirmation dialog. */
|
|
123
|
+
onDeleteEntries?: (ids: Set<string>) => void | Promise<void>;
|
|
124
|
+
/** Persist a reordered list of view IDs. */
|
|
125
|
+
onReorderViews?: (viewIds: string[]) => void | Promise<void>;
|
|
126
|
+
/** Callback invoked when an entry is clicked (e.g. to navigate to detail). */
|
|
127
|
+
onEntryClick?: (entry: T) => void;
|
|
88
128
|
}
|
|
89
129
|
/**
|
|
90
130
|
* MtCollection component: top-level collection container.
|
|
91
131
|
*/
|
|
92
|
-
export declare function MtCollection<T extends MtCollectionEntry>({ entries, views, properties, toolbar, renderEntry, showViewSettings, viewSettings, className, }: MtCollectionProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
132
|
+
export declare function MtCollection<T extends MtCollectionEntry>({ entries, views, viewTemplates, properties, toolbar, renderEntry, showViewSettings, viewSettings, className, assigneeOptions, currentUserQuickFilter, onUpdateEntry, onAddEntry, subtasksEnabled, onAddSubtask, onSaveView, onDeleteView, onDeleteEntries, onReorderViews, onEntryClick, }: MtCollectionProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { MtCollectionEntry, MtCollectionProperty, MtCollectionView } from './MtCollection';
|
|
2
|
+
import type { MtCollectionQuickFilterState } from './MtCollectionEntryUtils';
|
|
2
3
|
/**
|
|
3
4
|
* Context props for MtCollection.
|
|
4
5
|
* We use context here as I don’t want to assume anything
|
|
@@ -6,7 +7,9 @@ import type { MtCollectionEntry, MtCollectionProperty, MtCollectionView } from '
|
|
|
6
7
|
*/
|
|
7
8
|
interface MtCollectionContextProps<T extends MtCollectionEntry> {
|
|
8
9
|
entries: T[];
|
|
10
|
+
onAddEntry?: () => void | Promise<void>;
|
|
9
11
|
views: MtCollectionView<T>[];
|
|
12
|
+
viewTemplates: MtCollectionView<T>[];
|
|
10
13
|
currentView: MtCollectionView<T> | null;
|
|
11
14
|
showViewSettings: boolean;
|
|
12
15
|
setShowViewSettings: (show: boolean) => void;
|
|
@@ -20,12 +23,32 @@ interface MtCollectionContextProps<T extends MtCollectionEntry> {
|
|
|
20
23
|
properties: MtCollectionProperty[];
|
|
21
24
|
setProperties: (properties: MtCollectionProperty[]) => void;
|
|
22
25
|
setCurrentView: (view: MtCollectionView<T> | null) => void;
|
|
23
|
-
addView: (view: MtCollectionView<T>) => void
|
|
26
|
+
addView: (view: MtCollectionView<T>) => void | Promise<void>;
|
|
24
27
|
updateView: (viewId: string, patch: Partial<MtCollectionView<T>>) => void;
|
|
25
|
-
deleteView: (viewId: string) => void
|
|
28
|
+
deleteView: (viewId: string) => void | Promise<void>;
|
|
29
|
+
reorderViews: (viewIds: string[]) => void | Promise<void>;
|
|
26
30
|
hasCurrentViewUnsavedChanges: boolean;
|
|
27
|
-
saveCurrentViewAsDefault: () => void
|
|
31
|
+
saveCurrentViewAsDefault: () => void | Promise<void>;
|
|
28
32
|
revertCurrentViewToDefault: () => void;
|
|
33
|
+
quickFilters: MtCollectionQuickFilterState;
|
|
34
|
+
setQuickFilters: (patch: Partial<MtCollectionQuickFilterState>) => void;
|
|
35
|
+
transientQuickFilters: MtCollectionQuickFilterState;
|
|
36
|
+
setTransientQuickFilters: (patch: Partial<MtCollectionQuickFilterState>) => void;
|
|
37
|
+
currentUserQuickFilter?: {
|
|
38
|
+
assignee: string;
|
|
39
|
+
label: string;
|
|
40
|
+
avatarSrc?: string;
|
|
41
|
+
};
|
|
42
|
+
/** Set of selected entry IDs. */
|
|
43
|
+
selectedIds: Set<string>;
|
|
44
|
+
/** Toggle selection for a single entry by its id. */
|
|
45
|
+
toggleSelected: (id: string) => void;
|
|
46
|
+
/** Clear all selections. */
|
|
47
|
+
clearSelection: () => void;
|
|
48
|
+
/** Callback to delete selected entries (no confirmation). Only present when consumer provides it. */
|
|
49
|
+
onDeleteEntries?: (ids: Set<string>) => void | Promise<void>;
|
|
50
|
+
/** Callback invoked when an entry is clicked (e.g. to navigate to detail). */
|
|
51
|
+
onEntryClick?: (entry: T) => void;
|
|
29
52
|
}
|
|
30
53
|
export declare const MtCollectionContext: import("react").Context<MtCollectionContextProps<any> | null>;
|
|
31
54
|
export declare function useMtCollection<T extends MtCollectionEntry>(): MtCollectionContextProps<T>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { MtCollectionDiscreteValueOption } from './MtCollection';
|
|
1
2
|
export type MtCollectionAssigneeOption = {
|
|
2
3
|
value: string;
|
|
3
4
|
label: string;
|
|
@@ -5,26 +6,41 @@ export type MtCollectionAssigneeOption = {
|
|
|
5
6
|
export declare function MtCollectionPriorityBadge({ priority }: {
|
|
6
7
|
priority?: string;
|
|
7
8
|
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export declare function
|
|
9
|
+
export declare function getIssueTypeOption(options: Array<string | MtCollectionDiscreteValueOption> | undefined, value: string | undefined): MtCollectionDiscreteValueOption | undefined;
|
|
10
|
+
export declare function MtIssueTypePreview({ value, options, size, }: {
|
|
11
|
+
value?: string;
|
|
12
|
+
options?: Array<string | MtCollectionDiscreteValueOption>;
|
|
13
|
+
size?: number;
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function MtPrioritySelect({ value, onChange, options, }: {
|
|
9
16
|
value?: string;
|
|
10
17
|
onChange: (value: string) => void;
|
|
18
|
+
options?: Array<string | MtCollectionDiscreteValueOption>;
|
|
11
19
|
}): import("react/jsx-runtime").JSX.Element;
|
|
12
20
|
export declare const MtPrioirtySelect: typeof MtPrioritySelect;
|
|
13
|
-
export declare function MtStateSelect({ value, onChange }: {
|
|
21
|
+
export declare function MtStateSelect({ value, onChange, options, }: {
|
|
14
22
|
value?: string;
|
|
15
23
|
onChange: (value: string) => void;
|
|
24
|
+
options?: Array<string | MtCollectionDiscreteValueOption>;
|
|
16
25
|
}): import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
export declare function MtIssueTypeSelect({ value, onChange }: {
|
|
26
|
+
export declare function MtIssueTypeSelect({ value, onChange, options, }: {
|
|
18
27
|
value?: string;
|
|
19
28
|
onChange: (value: string) => void;
|
|
29
|
+
options?: Array<string | MtCollectionDiscreteValueOption>;
|
|
20
30
|
}): import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
export declare function MtCollectionSummaryInput({ value, onChange, placeholder, }: {
|
|
31
|
+
export declare function MtCollectionSummaryInput({ value, onChange, placeholder, className, inputSize, contentWidthCh, autoWidth, minAutoWidthPx, maxAutoWidthPx, }: {
|
|
22
32
|
value: string;
|
|
23
33
|
onChange: (value: string) => void;
|
|
24
34
|
placeholder?: string;
|
|
35
|
+
className?: string;
|
|
36
|
+
inputSize?: number;
|
|
37
|
+
contentWidthCh?: number;
|
|
38
|
+
autoWidth?: boolean;
|
|
39
|
+
minAutoWidthPx?: number;
|
|
40
|
+
maxAutoWidthPx?: number;
|
|
25
41
|
}): import("react/jsx-runtime").JSX.Element;
|
|
26
42
|
export declare function MtCollectionAssigneeDropdown({ assignee, options, onChange, }: {
|
|
27
43
|
assignee?: string;
|
|
28
44
|
options: MtCollectionAssigneeOption[];
|
|
29
|
-
onChange: (value
|
|
45
|
+
onChange: (value?: string) => void;
|
|
30
46
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { MtFilterGroup } from '../../MtFilter';
|
|
2
|
+
import type { MtFilterField } from '../../MtFilter';
|
|
2
3
|
import type { MtSortRule } from '../../MtSort';
|
|
4
|
+
import type { MtCollectionProperty } from './MtCollection';
|
|
3
5
|
type MtCollectionLegacyFilterState = {
|
|
4
6
|
query?: string;
|
|
5
7
|
status?: string[];
|
|
@@ -9,6 +11,7 @@ type MtCollectionLegacyFilterState = {
|
|
|
9
11
|
export type MtCollectionQuickFilterState = {
|
|
10
12
|
status?: string[];
|
|
11
13
|
assignee?: string[];
|
|
14
|
+
requiredAssignee?: string;
|
|
12
15
|
search?: string;
|
|
13
16
|
};
|
|
14
17
|
export type MtCollectionFilterState = MtFilterGroup | MtCollectionLegacyFilterState;
|
|
@@ -16,11 +19,32 @@ export declare function getCollectionEntryId(entry: any): string;
|
|
|
16
19
|
export declare function getCollectionEntrySummary(entry: any): any;
|
|
17
20
|
export declare function getCollectionEntryPriority(entry: any): any;
|
|
18
21
|
export declare function getCollectionEntryAssignee(entry: any): any;
|
|
22
|
+
export declare function getCollectionEntryType(entry: any): string;
|
|
19
23
|
export declare function toggleCollectionFilterValue(values: string[] | undefined, value: string): string[];
|
|
20
24
|
export declare function getUniqueEntryValues(entries: any[], key: string): string[];
|
|
21
25
|
export declare function applyCollectionFilters(entries: any[], filterState: MtCollectionFilterState | undefined): any[];
|
|
22
26
|
export declare function getDefaultCollectionFilter(): MtFilterGroup;
|
|
23
27
|
export declare function getCollectionFilterRuleCount(filterState: MtCollectionFilterState | undefined): number;
|
|
28
|
+
export declare const COLLECTION_SORT_FIELDS: {
|
|
29
|
+
value: string;
|
|
30
|
+
label: string;
|
|
31
|
+
}[];
|
|
32
|
+
export declare const COLLECTION_FILTER_FIELDS: MtFilterField[];
|
|
33
|
+
/**
|
|
34
|
+
* Build filter fields enriched with dropdown options from property `discreteValues`.
|
|
35
|
+
*
|
|
36
|
+
* The base set of filter fields is always present. When a `properties` schema is
|
|
37
|
+
* provided, fields whose id matches a property with `discreteValues` will offer
|
|
38
|
+
* those values as selectable options in the filter value dropdown.
|
|
39
|
+
*
|
|
40
|
+
* Property id mapping: `status`/`state` → "status", `type`/`entryType`/`issueType` → "type".
|
|
41
|
+
*/
|
|
42
|
+
export declare function buildCollectionFilterFields(properties?: MtCollectionProperty[]): MtFilterField[];
|
|
43
|
+
export declare const COLLECTION_FILTER_OPERATORS: {
|
|
44
|
+
value: string;
|
|
45
|
+
label: string;
|
|
46
|
+
requiresValue: boolean;
|
|
47
|
+
}[];
|
|
24
48
|
export declare function isCollectionFilterActive(filterState: MtCollectionFilterState | undefined): boolean;
|
|
25
49
|
export declare function applyCollectionSort(entries: any[], sortRules: MtSortRule[] | undefined, fallbackSortBy?: string): any[];
|
|
26
50
|
export declare function applyCollectionQuickFilters(entries: any[], quickFilters: MtCollectionQuickFilterState | undefined): any[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Floating selection toolbar that appears at the bottom of the collection when one or more
|
|
3
|
+
* entries are selected. Provides bulk-action controls.
|
|
4
|
+
*
|
|
5
|
+
* Disabled stubs: Status, Assignee, Dates, Tags
|
|
6
|
+
* Active action: Delete (immediate, no confirmation)
|
|
7
|
+
*/
|
|
8
|
+
export declare function MtCollectionSelectionToolbar(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,10 +1,41 @@
|
|
|
1
|
+
import { MtCollectionAssigneeOption } from './MtCollectionEntryControls';
|
|
2
|
+
import type { MtCollectionDiscreteValueOption } from './MtCollection';
|
|
1
3
|
type MtCollectionTaskListEntryProps = {
|
|
2
4
|
entry: any;
|
|
3
5
|
visiblePropertySet: Set<string>;
|
|
6
|
+
properties?: Array<{
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
}>;
|
|
10
|
+
statusOptions?: string[];
|
|
11
|
+
priorityOptions?: string[];
|
|
12
|
+
issueTypeOptions?: Array<string | MtCollectionDiscreteValueOption>;
|
|
4
13
|
onSummaryChange?: (nextSummary: string) => void;
|
|
5
14
|
onPriorityChange?: (nextPriority: string) => void;
|
|
6
15
|
onStatusChange?: (nextStatus: string) => void;
|
|
7
16
|
onIssueTypeChange?: (nextType: string) => void;
|
|
17
|
+
assigneeOptions?: MtCollectionAssigneeOption[];
|
|
18
|
+
onAssigneeChange?: (nextAssignee?: string) => void;
|
|
19
|
+
onPropertyChange?: (propertyId: string, value: unknown) => void;
|
|
20
|
+
/** Nesting depth for subtask indentation (0 = top-level). */
|
|
21
|
+
depth?: number;
|
|
22
|
+
/** Whether subtask support is active for this collection. */
|
|
23
|
+
subtasksEnabled?: boolean;
|
|
24
|
+
/** Whether this entry has subtasks. */
|
|
25
|
+
hasSubtasks?: boolean;
|
|
26
|
+
/** Number of direct subtasks for this entry. */
|
|
27
|
+
subtaskCount?: number;
|
|
28
|
+
/** Whether the subtask tree below this entry is expanded. */
|
|
29
|
+
isExpanded?: boolean;
|
|
30
|
+
/** Toggle expand/collapse. */
|
|
31
|
+
onToggleExpand?: () => void;
|
|
32
|
+
/** Add a subtask under this entry. */
|
|
33
|
+
onAddSubtask?: () => void;
|
|
34
|
+
dragHandleProps?: {
|
|
35
|
+
ref?: (element: HTMLElement | null) => void;
|
|
36
|
+
attributes?: Record<string, unknown>;
|
|
37
|
+
listeners?: Record<string, unknown>;
|
|
38
|
+
};
|
|
8
39
|
};
|
|
9
|
-
export declare function MtCollectionTaskListEntry({ entry, visiblePropertySet, onSummaryChange, onPriorityChange, onStatusChange, onIssueTypeChange, }: MtCollectionTaskListEntryProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export declare function MtCollectionTaskListEntry({ entry, visiblePropertySet, properties, statusOptions, priorityOptions, issueTypeOptions, onSummaryChange, onPriorityChange, onStatusChange, onIssueTypeChange, assigneeOptions, onAssigneeChange, onPropertyChange, depth, subtasksEnabled, hasSubtasks, subtaskCount, isExpanded, onToggleExpand, onAddSubtask, dragHandleProps, }: MtCollectionTaskListEntryProps): import("react/jsx-runtime").JSX.Element;
|
|
10
41
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Lightweight toast hook for collection layouts.
|
|
4
|
+
* Returns a `showToast` function and a `ToastPortal` component that should be
|
|
5
|
+
* rendered at the end of the layout.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useCollectionToast(durationMs?: number): {
|
|
8
|
+
showToast: (message: string) => void;
|
|
9
|
+
ToastPortal: () => React.ReactPortal | null;
|
|
10
|
+
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export { MtCollection } from './MtCollection';
|
|
2
|
-
export type { MtCollectionEntry, MtCollectionView,
|
|
2
|
+
export type { MtCollectionDiscreteValueOption, MtCollectionEntry, MtCollectionProps, MtCollectionView, } from './MtCollection';
|
|
3
3
|
export { MtCollectionListLayout } from './layouts/MtCollectionListLayout';
|
|
4
4
|
export { MtCollectionGridLayout } from './layouts/MtCollectionGridLayout';
|
|
5
5
|
export { MtCollectionTableLayout } from './layouts/MtCollectionTableLayout';
|
|
6
6
|
export { MtCollectionBoardLayout } from './layouts/MtCollectionBoardLayout';
|
|
7
7
|
export { MtCollectionGanttLayout } from './layouts/MtCollectionGanttLayout';
|
|
8
|
+
export { MtCollectionPlanLayout } from './layouts/MtCollectionPlanLayout';
|
|
8
9
|
export { MtCollectionToolbar } from './MtCollectionToolbar';
|
|
9
10
|
export { MtCollectionViewSettings } from './MtCollectionViewSettings';
|
|
@@ -1,2 +1,35 @@
|
|
|
1
1
|
import { MtCollectionLayoutComponent } from '../MtCollection';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { type MtCollectionAssigneeOption } from '../MtCollectionEntryControls';
|
|
4
|
+
import type { MtCollectionDiscreteValueOption } from '../MtCollection';
|
|
5
|
+
export declare function MtCollectionBoardCard({ entry, onSummaryChange, onPriorityChange, onStatusChange, onIssueTypeChange, onAssigneeChange, onClick, isDragPreview, visiblePropertySet, parentDisplayId, statusOptions, priorityOptions, issueTypeOptions, assigneeOptions, }: {
|
|
6
|
+
entry: any;
|
|
7
|
+
onSummaryChange?: (nextSummary: string) => void;
|
|
8
|
+
onPriorityChange?: (nextPriority: string) => void;
|
|
9
|
+
onStatusChange?: (nextStatus: string) => void;
|
|
10
|
+
onIssueTypeChange?: (nextType: string) => void;
|
|
11
|
+
onAssigneeChange?: (nextAssignee?: string) => void;
|
|
12
|
+
onClick?: () => void;
|
|
13
|
+
isDragPreview?: boolean;
|
|
14
|
+
visiblePropertySet: Set<string>;
|
|
15
|
+
parentDisplayId?: string;
|
|
16
|
+
statusOptions?: string[];
|
|
17
|
+
priorityOptions?: string[];
|
|
18
|
+
issueTypeOptions?: Array<string | MtCollectionDiscreteValueOption>;
|
|
19
|
+
assigneeOptions?: MtCollectionAssigneeOption[];
|
|
20
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function SortableBoardCard({ id, children, onClick, }: {
|
|
22
|
+
id: string;
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
onClick?: () => void;
|
|
25
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare function DroppableColumn({ columnKey, label, trailing, entryIds, children, }: {
|
|
27
|
+
columnKey: string;
|
|
28
|
+
label: React.ReactNode;
|
|
29
|
+
trailing?: React.ReactNode;
|
|
30
|
+
entryIds: string[];
|
|
31
|
+
children: React.ReactNode;
|
|
32
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
/** @deprecated Use DroppableColumn instead */
|
|
34
|
+
export declare const BoardDroppableColumn: typeof DroppableColumn;
|
|
2
35
|
export declare const MtCollectionBoardLayout: MtCollectionLayoutComponent;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type DragOverEvent, type DragEndEvent, type DragStartEvent } from '@dnd-kit/core';
|
|
2
|
+
export declare function areColumnOrdersEqual(a: Record<string, string[]>, b: Record<string, string[]>): boolean;
|
|
3
|
+
export interface BoardDndColumn {
|
|
4
|
+
key: string;
|
|
5
|
+
label: string;
|
|
6
|
+
[extraKey: string]: unknown;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Shared board DnD hook used by both the board and plan layouts.
|
|
10
|
+
*
|
|
11
|
+
* Manages column ordering, drag state, and cross-column movement.
|
|
12
|
+
* The consumer provides columns with their entries and a callback
|
|
13
|
+
* for handling cross-column moves (e.g. updating status or dates).
|
|
14
|
+
*/
|
|
15
|
+
export declare function useBoardDnd<TColumn extends BoardDndColumn>({ columns, entriesByColumn, onCrossColumnMove, onPositionChange, disableSameColumnReorder, onReorderBlocked, }: {
|
|
16
|
+
/** Column definitions (board groups or plan weeks). */
|
|
17
|
+
columns: TColumn[];
|
|
18
|
+
/** Map from column key → entries in that column. */
|
|
19
|
+
entriesByColumn: Map<string, any[]>;
|
|
20
|
+
/** Called when a card is dropped in a different column. */
|
|
21
|
+
onCrossColumnMove?: (activeId: string, entry: any, sourceColumnKey: string, destinationColumnKey: string, destinationColumn: TColumn) => void;
|
|
22
|
+
/** Called when a card is dropped to persist its new position. */
|
|
23
|
+
onPositionChange?: (activeId: string, entry: any, newPosition: number) => void;
|
|
24
|
+
/** When true, within-column reordering is disabled (cross-column moves still work). */
|
|
25
|
+
disableSameColumnReorder?: boolean;
|
|
26
|
+
/** Called when a within-column reorder was attempted but blocked by `disableSameColumnReorder`. */
|
|
27
|
+
onReorderBlocked?: () => void;
|
|
28
|
+
}): {
|
|
29
|
+
activeDragId: string | null;
|
|
30
|
+
entryById: Map<string, any>;
|
|
31
|
+
orderedColumns: {
|
|
32
|
+
column: TColumn;
|
|
33
|
+
entryIds: string[];
|
|
34
|
+
}[];
|
|
35
|
+
sensors: import("@dnd-kit/core").SensorDescriptor<import("@dnd-kit/core").SensorOptions>[];
|
|
36
|
+
onDragStart: (event: DragStartEvent) => void;
|
|
37
|
+
onDragOver: (event: DragOverEvent) => void;
|
|
38
|
+
onDragEnd: (event: DragEndEvent) => void;
|
|
39
|
+
onDragCancel: () => void;
|
|
40
|
+
};
|