@stll/workspace-ui 0.6.3 → 0.7.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/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/kanban-view.d.ts +32 -4
- package/dist/kanban-view.js +53 -22
- package/dist/types.d.ts +3 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -10,9 +10,9 @@ import { getClipFieldValueLabel } from "./field-value-logic.js";
|
|
|
10
10
|
import { FieldValue, IntFieldValue, MoneyFieldValue, PersonFieldValue } from "./field-value.js";
|
|
11
11
|
import { SortChips, SortChipsLabels, SortChipsProps, SortDescriptor, SortableProperty, sortDirectionHint } from "./sorts.js";
|
|
12
12
|
import { TableSkeletonRows } from "./table-skeleton-rows.js";
|
|
13
|
-
import { CreateWorkspaceKanbanSchemaParams, KANBAN_EMPTY_GROUP_VISIBILITIES, KanbanBoardPresentation, KanbanEmptyGroupVisibility, KanbanPresentedLane, KanbanSavedAxisState, KanbanSavedGroupReference, KanbanSavedSubgroupState, KanbanSavedViewState, ResolveWorkspaceKanbanViewParams, ResolvedWorkspaceKanbanView, WorkspaceKanbanBuiltInGroupLabel, WorkspaceKanbanGroupingChoice, WorkspaceKanbanGroupingPickerLabels, WorkspaceKanbanGroupingPickerProps, WorkspaceKanbanProperty, createWorkspaceKanbanSchema, getWorkspaceKanbanGroupingChoices, presentKanbanBoard, resolveWorkspaceKanbanView } from "./kanban-view.js";
|
|
13
|
+
import { CreateWorkspaceKanbanSchemaParams, KANBAN_EMPTY_GROUP_VISIBILITIES, KANBAN_SAVED_VIEW_STATE_VERSION, KanbanBoardPresentation, KanbanEmptyGroupVisibility, KanbanPresentedBand, KanbanPresentedLane, KanbanSavedAxisState, KanbanSavedGroupAxisState, KanbanSavedGroupReference, KanbanSavedSubgroupState, KanbanSavedViewState, KanbanSavedViewStateV1, ResolveWorkspaceKanbanViewParams, ResolvedWorkspaceKanbanView, WorkspaceKanbanBuiltInGroupLabel, WorkspaceKanbanGroupingChoice, WorkspaceKanbanGroupingPickerLabels, WorkspaceKanbanGroupingPickerProps, WorkspaceKanbanProperty, createWorkspaceKanbanSchema, getWorkspaceKanbanGroupingChoices, normalizeKanbanSavedViewState, presentKanbanBoard, resolveWorkspaceKanbanView } from "./kanban-view.js";
|
|
14
14
|
import { WorkspaceKanbanGroupingPicker } from "./kanban-grouping-picker.js";
|
|
15
15
|
import { WorkspaceViewDirection, WorkspaceViewDropPosition, reorderWorkspaceViewIds, toWorkspaceViewDropPosition } from "./view-switcher.logic.js";
|
|
16
16
|
import { WorkspaceViewSwitcher, WorkspaceViewSwitcherEditing, WorkspaceViewSwitcherItem, WorkspaceViewSwitcherProps, WorkspaceViewSwitcherReorder } from "./view-switcher.js";
|
|
17
17
|
import { WorkspaceFrame, WorkspaceFrameEndRail, WorkspaceFrameInspector, WorkspaceFrameNavigation, WorkspaceFrameNavigationItem, WorkspaceFrameProps, WorkspaceFrameTopBar } from "./workspace-frame.js";
|
|
18
|
-
export { type ApplyCalculationSelectionParams, CONDITION_OPERATORS, type CalculationFormatters, CalculationKindPicker, type CalculationKindPickerProps, type CalculationLabels, CalculationPicker, type CalculationPickerProps, type CalculationProperty, type CalculationResult, type CalculationSelection, CalculationSummary, type CalculationSummaryProps, type ColorVariants, ColumnCalculation, ConditionBuilder, type ConditionBuilderLabels, type ConditionCapabilities, type ConditionOperator, type CreateWorkspaceKanbanSchemaParams, FIELD_CONTENT_TYPES, type FieldContent, type FieldOption, type FieldOptionChoice, FieldValue, type FieldValueType, type FormatCalculationParams, type FormatMoneyCentsParams, type FormattedCalculation, type FormulaCellRenderCtx, type GenericProperty, IntFieldValue, KANBAN_EMPTY_GROUP_VISIBILITIES, type KanbanBoardPresentation, type KanbanEmptyGroupVisibility, type KanbanPresentedLane, type KanbanSavedAxisState, type KanbanSavedGroupReference, type KanbanSavedSubgroupState, type KanbanSavedViewState, MoneyFieldValue, type OptionColor, PersonFieldValue, PropertyIcon, type PropertyIconType, type ResolveWorkspaceKanbanViewParams, type ResolvedWorkspaceKanbanView, SortChips, type SortChipsLabels, type SortChipsProps, type SortDescriptor, type SortableProperty, TableSkeletonRows, type UseCalculationParams, type ValueEditorKind, type ValueEditorRenderCtx, type WorkspaceCalculationLabels, type WorkspaceFieldContent, WorkspaceFrame, type WorkspaceFrameEndRail, type WorkspaceFrameInspector, type WorkspaceFrameNavigation, type WorkspaceFrameNavigationItem, type WorkspaceFrameProps, type WorkspaceFrameTopBar, type WorkspaceKanbanBuiltInGroupLabel, type WorkspaceKanbanGroupingChoice, WorkspaceKanbanGroupingPicker, type WorkspaceKanbanGroupingPickerLabels, type WorkspaceKanbanGroupingPickerProps, type WorkspaceKanbanProperty, type WorkspaceViewDirection, type WorkspaceViewDropPosition, WorkspaceViewSwitcher, type WorkspaceViewSwitcherEditing, type WorkspaceViewSwitcherItem, type WorkspaceViewSwitcherProps, type WorkspaceViewSwitcherReorder, appendChild, applyCalculationSelection, asGroup, buildLeaf, createWorkspaceKanbanSchema, currencyMinorUnitDigits, emptyColor, fieldForNode, formatCalculationResult, formatMoneyCents, getClipFieldValueLabel, getWorkspaceKanbanGroupingChoices, isConditionOperator, isMultiValue, leafFromField, leafOperand, leafOperator, leafValueList, leafValueString, operandsEqual, operatorsFor, optionColors, presentKanbanBoard, removeChild, reorderWorkspaceViewIds, replaceChild, resolveOptionColor, resolveWorkspaceKanbanView, sortDirectionHint, toWorkspaceViewDropPosition, useCalculation, valueEditorFor };
|
|
18
|
+
export { type ApplyCalculationSelectionParams, CONDITION_OPERATORS, type CalculationFormatters, CalculationKindPicker, type CalculationKindPickerProps, type CalculationLabels, CalculationPicker, type CalculationPickerProps, type CalculationProperty, type CalculationResult, type CalculationSelection, CalculationSummary, type CalculationSummaryProps, type ColorVariants, ColumnCalculation, ConditionBuilder, type ConditionBuilderLabels, type ConditionCapabilities, type ConditionOperator, type CreateWorkspaceKanbanSchemaParams, FIELD_CONTENT_TYPES, type FieldContent, type FieldOption, type FieldOptionChoice, FieldValue, type FieldValueType, type FormatCalculationParams, type FormatMoneyCentsParams, type FormattedCalculation, type FormulaCellRenderCtx, type GenericProperty, IntFieldValue, KANBAN_EMPTY_GROUP_VISIBILITIES, KANBAN_SAVED_VIEW_STATE_VERSION, type KanbanBoardPresentation, type KanbanEmptyGroupVisibility, type KanbanPresentedBand, type KanbanPresentedLane, type KanbanSavedAxisState, type KanbanSavedGroupAxisState, type KanbanSavedGroupReference, type KanbanSavedSubgroupState, type KanbanSavedViewState, type KanbanSavedViewStateV1, MoneyFieldValue, type OptionColor, PersonFieldValue, PropertyIcon, type PropertyIconType, type ResolveWorkspaceKanbanViewParams, type ResolvedWorkspaceKanbanView, SortChips, type SortChipsLabels, type SortChipsProps, type SortDescriptor, type SortableProperty, TableSkeletonRows, type UseCalculationParams, type ValueEditorKind, type ValueEditorRenderCtx, type WorkspaceCalculationLabels, type WorkspaceFieldContent, WorkspaceFrame, type WorkspaceFrameEndRail, type WorkspaceFrameInspector, type WorkspaceFrameNavigation, type WorkspaceFrameNavigationItem, type WorkspaceFrameProps, type WorkspaceFrameTopBar, type WorkspaceKanbanBuiltInGroupLabel, type WorkspaceKanbanGroupingChoice, WorkspaceKanbanGroupingPicker, type WorkspaceKanbanGroupingPickerLabels, type WorkspaceKanbanGroupingPickerProps, type WorkspaceKanbanProperty, type WorkspaceViewDirection, type WorkspaceViewDropPosition, WorkspaceViewSwitcher, type WorkspaceViewSwitcherEditing, type WorkspaceViewSwitcherItem, type WorkspaceViewSwitcherProps, type WorkspaceViewSwitcherReorder, appendChild, applyCalculationSelection, asGroup, buildLeaf, createWorkspaceKanbanSchema, currencyMinorUnitDigits, emptyColor, fieldForNode, formatCalculationResult, formatMoneyCents, getClipFieldValueLabel, getWorkspaceKanbanGroupingChoices, isConditionOperator, isMultiValue, leafFromField, leafOperand, leafOperator, leafValueList, leafValueString, normalizeKanbanSavedViewState, operandsEqual, operatorsFor, optionColors, presentKanbanBoard, removeChild, reorderWorkspaceViewIds, replaceChild, resolveOptionColor, resolveWorkspaceKanbanView, sortDirectionHint, toWorkspaceViewDropPosition, useCalculation, valueEditorFor };
|
package/dist/index.js
CHANGED
|
@@ -10,9 +10,9 @@ import { PropertyIcon } from "./property-icon.js";
|
|
|
10
10
|
import { SortChips, sortDirectionHint } from "./sorts.js";
|
|
11
11
|
import { TableSkeletonRows } from "./table-skeleton-rows.js";
|
|
12
12
|
import { FIELD_CONTENT_TYPES } from "./types.js";
|
|
13
|
-
import { KANBAN_EMPTY_GROUP_VISIBILITIES, createWorkspaceKanbanSchema, getWorkspaceKanbanGroupingChoices, presentKanbanBoard, resolveWorkspaceKanbanView } from "./kanban-view.js";
|
|
13
|
+
import { KANBAN_EMPTY_GROUP_VISIBILITIES, KANBAN_SAVED_VIEW_STATE_VERSION, createWorkspaceKanbanSchema, getWorkspaceKanbanGroupingChoices, normalizeKanbanSavedViewState, presentKanbanBoard, resolveWorkspaceKanbanView } from "./kanban-view.js";
|
|
14
14
|
import { WorkspaceKanbanGroupingPicker } from "./kanban-grouping-picker.js";
|
|
15
15
|
import { reorderWorkspaceViewIds, toWorkspaceViewDropPosition } from "./view-switcher.logic.js";
|
|
16
16
|
import { WorkspaceViewSwitcher } from "./view-switcher.js";
|
|
17
17
|
import { WorkspaceFrame } from "./workspace-frame.js";
|
|
18
|
-
export { CONDITION_OPERATORS, CalculationKindPicker, CalculationPicker, CalculationSummary, ColumnCalculation, ConditionBuilder, FIELD_CONTENT_TYPES, FieldValue, IntFieldValue, KANBAN_EMPTY_GROUP_VISIBILITIES, MoneyFieldValue, PersonFieldValue, PropertyIcon, SortChips, TableSkeletonRows, WorkspaceFrame, WorkspaceKanbanGroupingPicker, WorkspaceViewSwitcher, appendChild, applyCalculationSelection, asGroup, buildLeaf, createWorkspaceKanbanSchema, currencyMinorUnitDigits, emptyColor, fieldForNode, formatCalculationResult, formatMoneyCents, getClipFieldValueLabel, getWorkspaceKanbanGroupingChoices, isConditionOperator, isMultiValue, leafFromField, leafOperand, leafOperator, leafValueList, leafValueString, operandsEqual, operatorsFor, optionColors, presentKanbanBoard, removeChild, reorderWorkspaceViewIds, replaceChild, resolveOptionColor, resolveWorkspaceKanbanView, sortDirectionHint, toWorkspaceViewDropPosition, useCalculation, valueEditorFor };
|
|
18
|
+
export { CONDITION_OPERATORS, CalculationKindPicker, CalculationPicker, CalculationSummary, ColumnCalculation, ConditionBuilder, FIELD_CONTENT_TYPES, FieldValue, IntFieldValue, KANBAN_EMPTY_GROUP_VISIBILITIES, KANBAN_SAVED_VIEW_STATE_VERSION, MoneyFieldValue, PersonFieldValue, PropertyIcon, SortChips, TableSkeletonRows, WorkspaceFrame, WorkspaceKanbanGroupingPicker, WorkspaceViewSwitcher, appendChild, applyCalculationSelection, asGroup, buildLeaf, createWorkspaceKanbanSchema, currencyMinorUnitDigits, emptyColor, fieldForNode, formatCalculationResult, formatMoneyCents, getClipFieldValueLabel, getWorkspaceKanbanGroupingChoices, isConditionOperator, isMultiValue, leafFromField, leafOperand, leafOperator, leafValueList, leafValueString, normalizeKanbanSavedViewState, operandsEqual, operatorsFor, optionColors, presentKanbanBoard, removeChild, reorderWorkspaceViewIds, replaceChild, resolveOptionColor, resolveWorkspaceKanbanView, sortDirectionHint, toWorkspaceViewDropPosition, useCalculation, valueEditorFor };
|
package/dist/kanban-view.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GenericProperty } from "./types.js";
|
|
2
|
-
import { KanbanBoardCell, KanbanBoardColumn, KanbanBoardLane, KanbanBoardMatrix, KanbanBuiltInGroup, KanbanGrouping, KanbanSchema } from "@stll/ui/kanban";
|
|
2
|
+
import { KanbanBoardCell, KanbanBoardColumn, KanbanBoardLane, KanbanBoardMatrix, KanbanBuiltInGroup, KanbanColumnBandSpan, KanbanGrouping, KanbanSchema } from "@stll/ui/kanban";
|
|
3
3
|
//#region src/kanban-view.d.ts
|
|
4
4
|
declare const KANBAN_EMPTY_GROUP_VISIBILITIES: {
|
|
5
5
|
readonly hide: "hide";
|
|
@@ -19,18 +19,40 @@ type KanbanSavedAxisState<TGroupId extends string = string> = {
|
|
|
19
19
|
hiddenGroups: readonly KanbanSavedGroupReference[];
|
|
20
20
|
orderedGroups: readonly KanbanSavedGroupReference[];
|
|
21
21
|
};
|
|
22
|
+
/**
|
|
23
|
+
* The column axis also remembers which column bands are folded. Bands are
|
|
24
|
+
* addressed by id, not by option reference: a band is metadata over several
|
|
25
|
+
* options, not an option itself.
|
|
26
|
+
*/
|
|
27
|
+
type KanbanSavedGroupAxisState<TGroupId extends string = string> = KanbanSavedAxisState<TGroupId> & {
|
|
28
|
+
collapsedBands: readonly string[];
|
|
29
|
+
};
|
|
22
30
|
type KanbanSavedSubgroupState<TGroupId extends string = string> = KanbanSavedAxisState<TGroupId> & {
|
|
23
31
|
collapsedGroups: readonly KanbanSavedGroupReference[];
|
|
24
32
|
};
|
|
33
|
+
/** The shape persisted before column bands existed. */
|
|
34
|
+
type KanbanSavedViewStateV1<TGroupId extends string = string> = {
|
|
35
|
+
group: KanbanSavedAxisState<TGroupId>;
|
|
36
|
+
subgroup: KanbanSavedSubgroupState<TGroupId> | null;
|
|
37
|
+
version: 1;
|
|
38
|
+
};
|
|
25
39
|
/**
|
|
26
40
|
* View state is deliberately separate from the board's domain data. It may
|
|
27
41
|
* change visibility, order, and collapse, but cannot change a card's cell.
|
|
28
42
|
*/
|
|
29
43
|
type KanbanSavedViewState<TGroupId extends string = string> = {
|
|
30
|
-
group:
|
|
44
|
+
group: KanbanSavedGroupAxisState<TGroupId>;
|
|
31
45
|
subgroup: KanbanSavedSubgroupState<TGroupId> | null;
|
|
32
|
-
version:
|
|
46
|
+
version: 2;
|
|
33
47
|
};
|
|
48
|
+
declare const KANBAN_SAVED_VIEW_STATE_VERSION = 2;
|
|
49
|
+
/**
|
|
50
|
+
* Lift a persisted view state to the current shape. Version 1 predates column
|
|
51
|
+
* bands, so it lifts with no band folded; the current shape passes through.
|
|
52
|
+
* Every reader of persisted state goes through here, so a version bump is
|
|
53
|
+
* one branch in this function rather than a check at each consumer.
|
|
54
|
+
*/
|
|
55
|
+
declare const normalizeKanbanSavedViewState: <TGroupId extends string = string>(state: KanbanSavedViewStateV1<TGroupId> | KanbanSavedViewState<TGroupId>) => KanbanSavedViewState<TGroupId>;
|
|
34
56
|
type WorkspaceKanbanProperty<TGroupId extends string = string> = GenericProperty & {
|
|
35
57
|
id: TGroupId;
|
|
36
58
|
name: string;
|
|
@@ -88,7 +110,13 @@ type KanbanPresentedLane<TRow> = {
|
|
|
88
110
|
collapsed: boolean;
|
|
89
111
|
lane: KanbanBoardLane;
|
|
90
112
|
};
|
|
113
|
+
/** A run of presented columns under one band header, folded or open. */
|
|
114
|
+
type KanbanPresentedBand = KanbanColumnBandSpan & {
|
|
115
|
+
collapsed: boolean;
|
|
116
|
+
};
|
|
91
117
|
type KanbanBoardPresentation<TRow> = {
|
|
118
|
+
/** The presented columns, span by span, with the view's fold applied. */
|
|
119
|
+
bands: KanbanPresentedBand[];
|
|
92
120
|
columns: KanbanBoardColumn[];
|
|
93
121
|
lanes: KanbanPresentedLane<TRow>[];
|
|
94
122
|
matrix: KanbanBoardMatrix<TRow>;
|
|
@@ -103,4 +131,4 @@ declare const presentKanbanBoard: <TRow>({ matrix, state }: {
|
|
|
103
131
|
state: KanbanSavedViewState;
|
|
104
132
|
}) => KanbanBoardPresentation<TRow>;
|
|
105
133
|
//#endregion
|
|
106
|
-
export { CreateWorkspaceKanbanSchemaParams, KANBAN_EMPTY_GROUP_VISIBILITIES, KanbanBoardPresentation, KanbanEmptyGroupVisibility, KanbanPresentedLane, KanbanSavedAxisState, KanbanSavedGroupReference, KanbanSavedSubgroupState, KanbanSavedViewState, ResolveWorkspaceKanbanViewParams, ResolvedWorkspaceKanbanView, WorkspaceKanbanBuiltInGroupLabel, WorkspaceKanbanGroupingChoice, WorkspaceKanbanGroupingPickerLabels, WorkspaceKanbanGroupingPickerProps, WorkspaceKanbanProperty, createWorkspaceKanbanSchema, getWorkspaceKanbanGroupingChoices, presentKanbanBoard, resolveWorkspaceKanbanView };
|
|
134
|
+
export { CreateWorkspaceKanbanSchemaParams, KANBAN_EMPTY_GROUP_VISIBILITIES, KANBAN_SAVED_VIEW_STATE_VERSION, KanbanBoardPresentation, KanbanEmptyGroupVisibility, KanbanPresentedBand, KanbanPresentedLane, KanbanSavedAxisState, KanbanSavedGroupAxisState, KanbanSavedGroupReference, KanbanSavedSubgroupState, KanbanSavedViewState, KanbanSavedViewStateV1, ResolveWorkspaceKanbanViewParams, ResolvedWorkspaceKanbanView, WorkspaceKanbanBuiltInGroupLabel, WorkspaceKanbanGroupingChoice, WorkspaceKanbanGroupingPickerLabels, WorkspaceKanbanGroupingPickerProps, WorkspaceKanbanProperty, createWorkspaceKanbanSchema, getWorkspaceKanbanGroupingChoices, normalizeKanbanSavedViewState, presentKanbanBoard, resolveWorkspaceKanbanView };
|
package/dist/kanban-view.js
CHANGED
|
@@ -1,10 +1,34 @@
|
|
|
1
1
|
import { panic } from "better-result";
|
|
2
|
-
import { orderKanbanCellsByColumns, resolveKanbanGrouping } from "@stll/ui/kanban";
|
|
2
|
+
import { orderKanbanCellsByColumns, resolveKanbanColumnBands, resolveKanbanGrouping } from "@stll/ui/kanban";
|
|
3
3
|
//#region src/kanban-view.ts
|
|
4
4
|
const KANBAN_EMPTY_GROUP_VISIBILITIES = {
|
|
5
5
|
hide: "hide",
|
|
6
6
|
show: "show"
|
|
7
7
|
};
|
|
8
|
+
const KANBAN_SAVED_VIEW_STATE_VERSION = 2;
|
|
9
|
+
/**
|
|
10
|
+
* Lift a persisted view state to the current shape. Version 1 predates column
|
|
11
|
+
* bands, so it lifts with no band folded; the current shape passes through.
|
|
12
|
+
* Every reader of persisted state goes through here, so a version bump is
|
|
13
|
+
* one branch in this function rather than a check at each consumer.
|
|
14
|
+
*/
|
|
15
|
+
const normalizeKanbanSavedViewState = (state) => {
|
|
16
|
+
switch (state.version) {
|
|
17
|
+
case 1: return {
|
|
18
|
+
group: {
|
|
19
|
+
collapsedBands: [],
|
|
20
|
+
emptyGroups: state.group.emptyGroups,
|
|
21
|
+
groupBy: state.group.groupBy,
|
|
22
|
+
hiddenGroups: state.group.hiddenGroups,
|
|
23
|
+
orderedGroups: state.group.orderedGroups
|
|
24
|
+
},
|
|
25
|
+
subgroup: state.subgroup,
|
|
26
|
+
version: 2
|
|
27
|
+
};
|
|
28
|
+
case 2: return state;
|
|
29
|
+
default: return state;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
8
32
|
/**
|
|
9
33
|
* Turns the authoritative workspace property model into board declarations.
|
|
10
34
|
* Select options remain the sole source of property-derived columns and lanes.
|
|
@@ -17,7 +41,8 @@ const createWorkspaceKanbanSchema = ({ builtInGroups, properties }) => ({
|
|
|
17
41
|
return property.content.options.map((option) => ({
|
|
18
42
|
optionColor: option.color,
|
|
19
43
|
value: option.value,
|
|
20
|
-
label: option.value
|
|
44
|
+
label: option.value,
|
|
45
|
+
...option.band === void 0 ? {} : { band: option.band }
|
|
21
46
|
}));
|
|
22
47
|
},
|
|
23
48
|
properties
|
|
@@ -84,29 +109,35 @@ const presentKanbanBoard = ({ matrix, state }) => {
|
|
|
84
109
|
type: "group"
|
|
85
110
|
})).filter((column) => !refersToGroup(state.group.hiddenGroups, column.group) && (state.group.emptyGroups === "show" || !isGroupEmpty(column, matrix))), ...matrix.columns.filter((column) => column.type === "destination")];
|
|
86
111
|
const subgroupState = state.subgroup;
|
|
112
|
+
const lanes = (subgroupState === null || matrix.lanes.some((lane) => lane.type === "none") ? matrix.lanes : orderGroups(matrix.lanes.filter((lane) => lane.type === "group").map((lane) => lane.group), subgroupState.orderedGroups).map((group) => ({
|
|
113
|
+
group,
|
|
114
|
+
type: "group"
|
|
115
|
+
}))).filter((lane) => {
|
|
116
|
+
if (lane.type === "none" || subgroupState === null) return true;
|
|
117
|
+
return !refersToGroup(subgroupState.hiddenGroups, lane.group) && (subgroupState.emptyGroups === "show" || !isLaneEmpty(lane, matrix));
|
|
118
|
+
}).map((lane) => {
|
|
119
|
+
const collapsed = lane.type === "group" && subgroupState !== null && refersToGroup(subgroupState.collapsedGroups, lane.group);
|
|
120
|
+
const cells = orderKanbanCellsByColumns({
|
|
121
|
+
cells: matrix.cells.filter((cell) => lane.type === "none" ? cell.coordinate.lane.type === "none" : cell.coordinate.lane.type === "group" && cell.coordinate.lane.group.value === lane.group.value),
|
|
122
|
+
columns
|
|
123
|
+
});
|
|
124
|
+
if (cells.length !== columns.length) return panic("Kanban presentation lane is missing a declared cell");
|
|
125
|
+
return {
|
|
126
|
+
cells,
|
|
127
|
+
collapsed,
|
|
128
|
+
lane
|
|
129
|
+
};
|
|
130
|
+
});
|
|
87
131
|
return {
|
|
132
|
+
bands: resolveKanbanColumnBands(columns).map(({ band, columns: bandColumns }) => ({
|
|
133
|
+
band,
|
|
134
|
+
collapsed: band !== null && state.group.collapsedBands.includes(band.id),
|
|
135
|
+
columns: bandColumns
|
|
136
|
+
})),
|
|
88
137
|
columns,
|
|
89
|
-
lanes
|
|
90
|
-
group,
|
|
91
|
-
type: "group"
|
|
92
|
-
}))).filter((lane) => {
|
|
93
|
-
if (lane.type === "none" || subgroupState === null) return true;
|
|
94
|
-
return !refersToGroup(subgroupState.hiddenGroups, lane.group) && (subgroupState.emptyGroups === "show" || !isLaneEmpty(lane, matrix));
|
|
95
|
-
}).map((lane) => {
|
|
96
|
-
const collapsed = lane.type === "group" && subgroupState !== null && refersToGroup(subgroupState.collapsedGroups, lane.group);
|
|
97
|
-
const cells = orderKanbanCellsByColumns({
|
|
98
|
-
cells: matrix.cells.filter((cell) => lane.type === "none" ? cell.coordinate.lane.type === "none" : cell.coordinate.lane.type === "group" && cell.coordinate.lane.group.value === lane.group.value),
|
|
99
|
-
columns
|
|
100
|
-
});
|
|
101
|
-
if (cells.length !== columns.length) return panic("Kanban presentation lane is missing a declared cell");
|
|
102
|
-
return {
|
|
103
|
-
cells,
|
|
104
|
-
collapsed,
|
|
105
|
-
lane
|
|
106
|
-
};
|
|
107
|
-
}),
|
|
138
|
+
lanes,
|
|
108
139
|
matrix
|
|
109
140
|
};
|
|
110
141
|
};
|
|
111
142
|
//#endregion
|
|
112
|
-
export { KANBAN_EMPTY_GROUP_VISIBILITIES, createWorkspaceKanbanSchema, getWorkspaceKanbanGroupingChoices, presentKanbanBoard, resolveWorkspaceKanbanView };
|
|
143
|
+
export { KANBAN_EMPTY_GROUP_VISIBILITIES, KANBAN_SAVED_VIEW_STATE_VERSION, createWorkspaceKanbanSchema, getWorkspaceKanbanGroupingChoices, normalizeKanbanSavedViewState, presentKanbanBoard, resolveWorkspaceKanbanView };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { OptionColor, OptionColor as OptionColor$1 } from "@stll/ui/option-color";
|
|
2
|
+
import { KanbanColumnBand } from "@stll/ui/kanban";
|
|
2
3
|
//#region src/types.d.ts
|
|
3
4
|
type FieldContent = {
|
|
4
5
|
type: "error";
|
|
@@ -82,6 +83,8 @@ type GenericProperty = {
|
|
|
82
83
|
options: {
|
|
83
84
|
value: string;
|
|
84
85
|
color: OptionColor$1;
|
|
86
|
+
/** The column band this option's column joins, when the board bands. */
|
|
87
|
+
band?: KanbanColumnBand | undefined;
|
|
85
88
|
}[];
|
|
86
89
|
};
|
|
87
90
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stll/workspace-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Reusable workspace presentation components and view helpers for Stella.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"calculations",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"@stll/calculations": "^0.1.0",
|
|
120
120
|
"@stll/conditions": "^0.2.0",
|
|
121
121
|
"@stll/money": "^0.1.0",
|
|
122
|
-
"@stll/ui": "^0.
|
|
122
|
+
"@stll/ui": "^0.17.0",
|
|
123
123
|
"better-result": "3.0.0",
|
|
124
124
|
"lucide-react": "1.30.0",
|
|
125
125
|
"use-intl": "4.13.5"
|