viewkitjs 0.34.0 → 0.36.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/CHANGELOG.md +173 -0
- package/MIGRATION.md +7 -0
- package/package.json +1 -1
- package/views/README.md +1 -1
- package/views/dist/atoms/Avatar.js +2 -1
- package/views/dist/atoms/RelationChip.d.ts +2 -0
- package/views/dist/atoms/RelationChip.js +5 -0
- package/views/dist/atoms/RowMenu.d.ts +1 -1
- package/views/dist/atoms/RowMenu.js +15 -3
- package/views/dist/atoms/defaults.js +2 -0
- package/views/dist/atoms/types.d.ts +40 -4
- package/views/dist/cells/relation-wrap.js +9 -2
- package/views/dist/contract.d.ts +27 -7
- package/views/dist/contract.js +25 -2
- package/views/dist/controls/avatar/avatar-mark.d.ts +4 -0
- package/views/dist/controls/avatar/avatar-mark.js +5 -0
- package/views/dist/controls/avatar/avatar.d.ts +10 -5
- package/views/dist/controls/avatar/avatar.js +12 -6
- package/views/dist/controls/avatar/looks.d.ts +1 -1
- package/views/dist/controls/avatar/looks.js +3 -0
- package/views/dist/controls/avatar/record-mark.d.ts +16 -0
- package/views/dist/controls/avatar/record-mark.js +13 -0
- package/views/dist/controls/avatar/tokens.d.ts +12 -0
- package/views/dist/controls/avatar/tokens.js +3 -0
- package/views/dist/controls/avatar.css +54 -17
- package/views/dist/controls/bulk-bar/bulk-bar.js +4 -5
- package/views/dist/controls/bulk-bar/map-selection-bar.js +2 -1
- package/views/dist/controls/compound-editor/compound-editor.d.ts +3 -0
- package/views/dist/controls/compound-editor/map-parts-body.d.ts +1 -1
- package/views/dist/controls/compound-editor/map-parts-body.js +8 -1
- package/views/dist/controls/compound-editor/name-parts.js +3 -2
- package/views/dist/controls/compound-editor/place-parts.js +3 -3
- package/views/dist/controls/compound-editor/range-parts.js +11 -10
- package/views/dist/controls/compound-editor/words.d.ts +3 -0
- package/views/dist/controls/compound-editor/words.js +2 -0
- package/views/dist/controls/customize/customize.d.ts +22 -6
- package/views/dist/controls/customize/customize.js +154 -73
- package/views/dist/controls/customize/items.d.ts +49 -0
- package/views/dist/controls/customize/items.js +104 -0
- package/views/dist/controls/customize/map-customize-body.js +19 -15
- package/views/dist/controls/customize/words.d.ts +5 -3
- package/views/dist/controls/customize/words.js +1 -0
- package/views/dist/controls/filter-editor/block.js +5 -2
- package/views/dist/controls/filter-editor/filter-editor.d.ts +16 -1
- package/views/dist/controls/filter-editor/filter-editor.js +22 -16
- package/views/dist/controls/filter-editor/map-filter-body.d.ts +3 -2
- package/views/dist/controls/filter-editor/map-filter-body.js +16 -2
- package/views/dist/controls/filter-editor/map-rules.d.ts +9 -2
- package/views/dist/controls/filter-editor/map-rules.js +18 -13
- package/views/dist/controls/filter-editor/parts.d.ts +1 -1
- package/views/dist/controls/filter-editor/parts.js +16 -15
- package/views/dist/controls/filter-editor/rules.d.ts +4 -4
- package/views/dist/controls/filter-editor/rules.js +6 -3
- package/views/dist/controls/filter-editor/words.d.ts +2 -0
- package/views/dist/controls/filter-editor/words.js +1 -0
- package/views/dist/controls/group-editor/group-editor.d.ts +3 -0
- package/views/dist/controls/group-editor/group-editor.js +21 -15
- package/views/dist/controls/group-editor/map-group-body.js +1 -0
- package/views/dist/controls/index.d.ts +1 -1
- package/views/dist/controls/internal/kit-words.d.ts +11 -0
- package/views/dist/controls/internal/kit-words.js +7 -0
- package/views/dist/controls/internal/map-panel-controls.d.ts +4 -1
- package/views/dist/controls/internal/map-panel-controls.js +23 -6
- package/views/dist/controls/internal/menu-items.d.ts +9 -0
- package/views/dist/controls/internal/menu-items.js +97 -0
- package/views/dist/controls/internal/panel-controls.d.ts +27 -3
- package/views/dist/controls/internal/panel-controls.js +142 -13
- package/views/dist/controls/links-editor/links-editor.js +5 -7
- package/views/dist/controls/links-editor/map-links-body.d.ts +1 -1
- package/views/dist/controls/links-editor/map-links-body.js +5 -1
- package/views/dist/controls/menu/menu.d.ts +4 -1
- package/views/dist/controls/menu/menu.js +3 -2
- package/views/dist/controls/number-editor/map-number-body.js +2 -0
- package/views/dist/controls/number-editor/number-editor.js +1 -1
- package/views/dist/controls/number-editor/words.d.ts +3 -0
- package/views/dist/controls/number-editor/words.js +2 -0
- package/views/dist/controls/picker/fields-frame.d.ts +5 -0
- package/views/dist/controls/picker/fields-frame.js +30 -0
- package/views/dist/controls/picker/map-fields-body.d.ts +2 -2
- package/views/dist/controls/picker/map-fields-body.js +7 -26
- package/views/dist/controls/picker/map-picker.d.ts +9 -3
- package/views/dist/controls/picker/map-picker.js +16 -3
- package/views/dist/controls/picker/picker.js +20 -10
- package/views/dist/controls/picker/rows.d.ts +9 -2
- package/views/dist/controls/picker.css +2 -0
- package/views/dist/controls/quick-filters/map-quick-filters-body.js +2 -1
- package/views/dist/controls/quick-filters/quick-filters.js +4 -4
- package/views/dist/controls/quick-filters/reminder.js +2 -2
- package/views/dist/controls/quick-filters/rules.d.ts +4 -1
- package/views/dist/controls/quick-filters/words.d.ts +2 -0
- package/views/dist/controls/quick-filters/words.js +1 -0
- package/views/dist/controls/select/map-select.d.ts +1 -1
- package/views/dist/controls/select/map-select.js +4 -1
- package/views/dist/controls/select/select.d.ts +5 -0
- package/views/dist/controls/select/select.js +11 -3
- package/views/dist/controls/sheet/bottom-sheet.d.ts +6 -1
- package/views/dist/controls/sheet/bottom-sheet.js +3 -3
- package/views/dist/controls/sort-editor/map-sort-body.js +1 -0
- package/views/dist/controls/sort-editor/sort-editor.d.ts +5 -1
- package/views/dist/controls/sort-editor/sort-editor.js +9 -8
- package/views/dist/controls/tag/tag.js +4 -2
- package/views/dist/controls/text-editor/map-text-body.js +4 -1
- package/views/dist/controls/text-editor/text-editor.js +2 -2
- package/views/dist/controls/text-editor/words.d.ts +3 -0
- package/views/dist/controls/text-editor/words.js +1 -1
- package/views/dist/controls/toolbar/toolbar.d.ts +31 -12
- package/views/dist/controls/toolbar/toolbar.js +15 -20
- package/views/dist/controls/toolbar.css +0 -5
- package/views/dist/controls/tooltip/map-tooltip.d.ts +1 -1
- package/views/dist/controls/tooltip/map-tooltip.js +4 -2
- package/views/dist/controls/values-editor/map-values-body.d.ts +1 -2
- package/views/dist/controls/values-editor/map-values-body.js +5 -1
- package/views/dist/controls/values-editor/values-editor.js +8 -7
- package/views/dist/controls/views-list/map-views-list-body.js +9 -1
- package/views/dist/controls/views-list/rules.d.ts +1 -0
- package/views/dist/controls/views-list/rules.js +2 -2
- package/views/dist/controls/views-list/view-menu.js +2 -2
- package/views/dist/controls/views-list/words.d.ts +4 -0
- package/views/dist/controls/views-list/words.js +2 -1
- package/views/dist/display/option-badges.d.ts +17 -0
- package/views/dist/display/option-badges.js +11 -0
- package/views/dist/display/relation-link.d.ts +12 -0
- package/views/dist/display/relation-link.js +17 -0
- package/views/dist/display/relation.d.ts +1 -1
- package/views/dist/display/relation.js +10 -3
- package/views/dist/display/select.js +1 -8
- package/views/dist/editors/EditorPanel.js +1 -1
- package/views/dist/editors/RangeEditor.d.ts +3 -0
- package/views/dist/editors/RangeEditor.js +2 -2
- package/views/dist/editors/SelectEditor.d.ts +2 -2
- package/views/dist/editors/SelectEditor.js +1 -1
- package/views/dist/editors/TextEditor.js +4 -2
- package/views/dist/editors/ValueListEditor.js +2 -1
- package/views/dist/field-row/FieldRow.js +32 -5
- package/views/dist/field-row/editors/RowRangeEditor.js +2 -1
- package/views/dist/grid/chrome/GridAddColumn.d.ts +7 -2
- package/views/dist/grid/chrome/GridAddColumn.js +13 -9
- package/views/dist/grid/chrome/GridCellEditors.js +1 -1
- package/views/dist/grid/chrome/GridCellOutline.d.ts +3 -1
- package/views/dist/grid/chrome/GridCellOutline.js +16 -6
- package/views/dist/grid/chrome/GridChipsEditor.js +3 -2
- package/views/dist/grid/chrome/GridColumnMenu.js +7 -4
- package/views/dist/grid/chrome/GridFooter.d.ts +4 -1
- package/views/dist/grid/chrome/GridFooter.js +4 -4
- package/views/dist/grid/chrome/GridGroupMenu.js +39 -14
- package/views/dist/grid/chrome/GridHeader.d.ts +1 -1
- package/views/dist/grid/chrome/GridHeader.js +4 -3
- package/views/dist/grid/chrome/GridNumberEditor.js +1 -1
- package/views/dist/grid/chrome/GridRangeEditor.d.ts +4 -1
- package/views/dist/grid/chrome/GridRangeEditor.js +2 -2
- package/views/dist/grid/chrome/GridRow.js +11 -3
- package/views/dist/grid/chrome/GridRowActions.d.ts +4 -1
- package/views/dist/grid/chrome/GridRowActions.js +2 -2
- package/views/dist/grid/chrome/GridRowCells.js +3 -2
- package/views/dist/grid/chrome/GridStructure.js +1 -1
- package/views/dist/grid/chrome/GridTable.js +32 -20
- package/views/dist/grid/chrome/GridTableSurface.js +2 -1
- package/views/dist/grid/chrome/checks.d.ts +1 -1
- package/views/dist/grid/chrome/checks.js +4 -1
- package/views/dist/grid/chrome/grid-cell-classes.d.ts +6 -2
- package/views/dist/grid/chrome/grid-cell-classes.js +10 -5
- package/views/dist/grid/chrome/grid-fitted-box.d.ts +5 -2
- package/views/dist/grid/chrome/grid-fitted-box.js +14 -4
- package/views/dist/grid/chrome/grid-hover.d.ts +10 -2
- package/views/dist/grid/chrome/grid-hover.js +14 -4
- package/views/dist/grid/chrome/grid-row-props.d.ts +4 -0
- package/views/dist/grid/chrome/grid-rows-menu.js +9 -4
- package/views/dist/grid/chrome/grid-table-props.d.ts +16 -4
- package/views/dist/grid/chrome/useGridScaleStyles.d.ts +9 -1
- package/views/dist/grid/chrome/useGridScaleStyles.js +1 -4
- package/views/dist/grid/grid-format-props.d.ts +1 -1
- package/views/dist/grid/grid-format-props.js +18 -5
- package/views/dist/grid/grid.css +11 -1
- package/views/dist/grid/looks.d.ts +3 -1
- package/views/dist/grid/looks.js +10 -4
- package/views/dist/grid/useGridTablePrefs.d.ts +1 -1
- package/views/dist/grid/useGridTableSettings.d.ts +1 -1
- package/views/dist/list/layer.d.ts +8 -0
- package/views/dist/list/layer.js +7 -0
- package/views/dist/list/list.js +2 -2
- package/views/dist/list/menu.d.ts +5 -4
- package/views/dist/list/store.d.ts +1 -1
- package/views/dist/list/toolbar.js +47 -20
- package/views/dist/list/views.js +1 -0
- package/views/dist/panels/availability.d.ts +5 -0
- package/views/dist/panels/availability.js +4 -5
- package/views/dist/panels/customize-body.d.ts +5 -1
- package/views/dist/panels/customize-body.js +21 -12
- package/views/dist/panels/model.d.ts +14 -4
- package/views/dist/panels/react/customize-body.js +15 -3
- package/views/dist/panels/react/customize.d.ts +8 -0
- package/views/dist/panels/react/filter/FilterEditor.d.ts +6 -0
- package/views/dist/panels/react/filter/FilterEditor.js +7 -0
- package/views/dist/panels/react/filter/FilterFieldList.d.ts +3 -1
- package/views/dist/panels/react/filter/FilterFieldList.js +2 -2
- package/views/dist/panels/react/filter/filter-body.js +3 -1
- package/views/dist/panels/react/filter/filter-part-body.d.ts +3 -1
- package/views/dist/panels/react/filter/filter-part-body.js +2 -2
- package/views/dist/panels/react/quick/QuickFiltersPanel.d.ts +3 -1
- package/views/dist/panels/react/quick/QuickFiltersPanel.js +7 -3
- package/views/dist/panels/react/sort/SortEditor.js +3 -1
- package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +13 -2
- package/views/dist/panels/react/toolbar/Toolbar.d.ts +11 -1
- package/views/dist/panels/react/toolbar/Toolbar.js +16 -6
- package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +5 -3
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.d.ts +6 -1
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +12 -5
- package/views/dist/panels/react/toolbar/ToolbarFilters.d.ts +7 -3
- package/views/dist/panels/react/toolbar/ToolbarFilters.js +18 -8
- package/views/dist/panels/react/toolbar/ToolbarOptions.d.ts +9 -1
- package/views/dist/panels/react/toolbar/ToolbarOptions.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarSave.d.ts +3 -1
- package/views/dist/panels/react/toolbar/ToolbarSave.js +5 -4
- package/views/dist/panels/react/toolbar/ToolbarSort.d.ts +7 -1
- package/views/dist/panels/react/toolbar/ToolbarSort.js +6 -3
- package/views/dist/panels/react/toolbar/ToolbarSortPill.d.ts +3 -0
- package/views/dist/panels/react/toolbar/ToolbarSortPill.js +4 -4
- package/views/dist/panels/react/toolbar/editor-menus.d.ts +8 -0
- package/views/dist/panels/react/toolbar/editor-menus.js +3 -0
- package/views/dist/panels/react/views-row/FoldingViewRow.js +3 -5
- package/views/dist/panels/react/views-row/HScrollRow.d.ts +4 -2
- package/views/dist/panels/react/views-row/HScrollRow.js +6 -2
- package/views/dist/panels/react/views-row/ViewAxes.js +6 -1
- package/views/dist/panels/react/views-row/ViewPicker.js +8 -3
- package/views/dist/panels/react/views-row/new-view.d.ts +11 -0
- package/views/dist/panels/react/views-row/new-view.js +21 -0
- package/views/dist/panels/react.d.ts +1 -1
- package/views/dist/panels/settings/layout.js +6 -38
- package/views/dist/panels/toolbar/page-resets.d.ts +17 -0
- package/views/dist/panels/toolbar/page-resets.js +62 -0
- package/views/dist/panels/toolbar/same-item.d.ts +7 -0
- package/views/dist/panels/toolbar/same-item.js +9 -0
- package/views/dist/panels/view-state.d.ts +4 -0
- package/views/dist/provider/ViewsProvider.d.ts +9 -4
- package/views/dist/provider/ViewsProvider.js +13 -2
- package/views/dist/provider/components.d.ts +109 -7
- package/views/dist/provider/components.js +1 -1
- package/views/dist/react.d.ts +2 -2
- package/views/dist/styles.css +115 -27
- package/views/dist/styles.unlayered.css +115 -27
- package/views/docs/contract.md +55 -35
- package/views/docs/controls/avatar.md +3 -0
- package/views/docs/controls/bulk-bar.md +3 -1
- package/views/docs/controls/compound-editor.md +2 -0
- package/views/docs/controls/customize.md +1 -1
- package/views/docs/controls/filter-editor.md +1 -1
- package/views/docs/controls/links-editor.md +2 -0
- package/views/docs/controls/pane.md +1 -1
- package/views/docs/controls/picker.md +2 -0
- package/views/docs/controls/quick-filters.md +1 -1
- package/views/docs/controls/text-editor.md +1 -1
- package/views/docs/controls/values-editor.md +2 -0
- package/views/docs/guides/atoms.md +54 -3
- package/views/docs/guides/display.md +1 -1
- package/views/docs/guides/looks.md +1 -1
- package/views/docs/guides/the-grid.md +4 -2
- package/views/docs/guides/the-provider.md +2 -2
- package/views/docs/index.md +2 -2
- package/views/docs/install.md +198 -104
- package/views/docs/reference/controls.md +27 -24
- package/views/docs/reference/editors-range.md +1 -1
- package/views/docs/reference/field-row.md +1 -1
- package/views/docs/reference/grid.md +6 -5
- package/views/docs/reference/list.md +27 -7
- package/views/docs/reference/looks.md +5 -5
- package/views/docs/reference/panels-react.md +15 -14
- package/views/docs/reference/panels.md +5 -5
- package/views/docs/reference/react.md +25 -11
- package/views/docs/reference/views.md +2 -2
- package/views/docs/reshaping.md +22 -6
- package/views/skills/views/SKILL.md +2 -2
|
@@ -3,22 +3,16 @@ import { resolveViewsMessage } from "../../contract.js";
|
|
|
3
3
|
import { listCardLayout } from "../../model/card-layout.js";
|
|
4
4
|
import { columnLabel, columnPlacedByView, resolveViewColumnOrder, } from "../../model/column-capabilities.js";
|
|
5
5
|
import { columnHideable, isColumnHidden, resolveColumnOrder, toggleColumnHidden, } from "../../model/column-state.js";
|
|
6
|
-
import { verticalBordersDefault } from "../../model/prefs-buckets.js";
|
|
7
6
|
import { boardFieldCandidates, boardFieldOf, calendarFieldCandidates, calendarFieldOf, defaultCalendarField, withBoardField, withCalendarField, } from "./axes.js";
|
|
8
7
|
import { columnRefOf, columnsChangeOf, columnsReset, columnStateOf, settingsColumnId, } from "../../model/settings-columns.js";
|
|
9
8
|
import { withPartColumns } from "../../model/part-columns.js";
|
|
10
9
|
import { lookChange, seenLook } from "../../model/settings-look.js";
|
|
11
10
|
const LAYOUTS = ["table", "list", "board", "calendar"];
|
|
12
11
|
const DENSITIES = ["compact", "default", "spacious"];
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
(layer.folded ?? []).length > 0 ||
|
|
18
|
-
layer.phoneLayout !== undefined);
|
|
19
|
-
}
|
|
20
|
-
function phoneLayoutOf(settings, layer) {
|
|
21
|
-
return layer.phoneLayout ?? (settings.layout === "table" ? "list" : settings.layout);
|
|
12
|
+
function phoneLayoutOf(settings, layer, offered) {
|
|
13
|
+
if (layer.phoneLayout && offered.includes(layer.phoneLayout))
|
|
14
|
+
return layer.phoneLayout;
|
|
15
|
+
return settings.layout === "table" && offered.includes("list") ? "list" : settings.layout;
|
|
22
16
|
}
|
|
23
17
|
export function settingsLayout(input) {
|
|
24
18
|
const { settings, layer, columns, onChange, onLayerChange, defaults } = input;
|
|
@@ -86,18 +80,8 @@ export function settingsLayout(input) {
|
|
|
86
80
|
value: look[key],
|
|
87
81
|
onChange: (next) => write(applyLook(settings, key, next, defaults)),
|
|
88
82
|
});
|
|
89
|
-
const bordersDefault = verticalBordersDefault(defaults);
|
|
90
83
|
const toggles = [
|
|
91
|
-
|
|
92
|
-
...lookToggle("verticalBorders", "views.panels.look-vertical-borders"),
|
|
93
|
-
...(look.verticalBorders !== bordersDefault
|
|
94
|
-
? {
|
|
95
|
-
reset: {
|
|
96
|
-
onReset: () => write(applyLook(settings, "verticalBorders", bordersDefault, defaults)),
|
|
97
|
-
},
|
|
98
|
-
}
|
|
99
|
-
: {}),
|
|
100
|
-
},
|
|
84
|
+
lookToggle("verticalBorders", "views.panels.look-vertical-borders"),
|
|
101
85
|
...(input.rowIcon ? [lookToggle("rowIcon", "views.panels.look-row-icon")] : []),
|
|
102
86
|
...(columns.some((column) => column.type === "title")
|
|
103
87
|
? [lookToggle("freezeIdentity", "views.panels.look-freeze-identity")]
|
|
@@ -205,26 +189,11 @@ export function settingsLayout(input) {
|
|
|
205
189
|
views: ["board"],
|
|
206
190
|
});
|
|
207
191
|
}
|
|
208
|
-
const phone = phoneLayoutOf(settings, layer);
|
|
192
|
+
const phone = phoneLayoutOf(settings, layer, options.map((option) => option.value));
|
|
209
193
|
const setPhone = (value) => {
|
|
210
194
|
if (value !== layer.phoneLayout)
|
|
211
195
|
onLayerChange({ phoneLayout: value });
|
|
212
196
|
};
|
|
213
|
-
const personal = {
|
|
214
|
-
choices: [
|
|
215
|
-
{
|
|
216
|
-
key: "personal.mobileLayout",
|
|
217
|
-
label: word("views.panels.phone-layout"),
|
|
218
|
-
value: phone,
|
|
219
|
-
options: LAYOUTS.map((value) => ({
|
|
220
|
-
value,
|
|
221
|
-
label: word(value === "list" ? "views.panels.layout-rows" : `views.panels.layout-${value}`),
|
|
222
|
-
})),
|
|
223
|
-
onChange: (value) => setPhone(value),
|
|
224
|
-
},
|
|
225
|
-
],
|
|
226
|
-
...(layerTouched(layer) ? { onReset: () => onLayerChange(EMPTY_LAYER) } : {}),
|
|
227
|
-
};
|
|
228
197
|
return {
|
|
229
198
|
label: word("views.panels.layout"),
|
|
230
199
|
value: settings.layout,
|
|
@@ -251,7 +220,6 @@ export function settingsLayout(input) {
|
|
|
251
220
|
},
|
|
252
221
|
...(choices.length ? { choices } : {}),
|
|
253
222
|
...(offersBoard ? { hidesGroupFor: ["board"] } : {}),
|
|
254
|
-
personal,
|
|
255
223
|
};
|
|
256
224
|
}
|
|
257
225
|
function applyLook(settings, key, value, defaults) {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type ListPersonalLayer, type ListSettings, type ListSettingsChange } from "viewkitjs/fields/query";
|
|
2
|
+
import type { SettingsPanelsInput } from "../settings/input.js";
|
|
3
|
+
/** A Customize page that resets itself. */
|
|
4
|
+
export type CustomizePage = "layout" | "columns" | "filter" | "sort" | "group";
|
|
5
|
+
/** A page's way back: the settings change it writes and its part of the layer, each null where it holds nothing (a page
|
|
6
|
+
* that differs by its layer part alone writes no settings). */
|
|
7
|
+
export type PageReset = {
|
|
8
|
+
change: ListSettingsChange | null;
|
|
9
|
+
layer: ListPersonalLayer | null;
|
|
10
|
+
};
|
|
11
|
+
/** Each page's way back to `saved`, present only while that page differs. `saved` null: no page has one (a shown view
|
|
12
|
+
* that hands no saved settings). With `cleared` (no view shown), the first page's Clear is the baseline, on a phone the
|
|
13
|
+
* phone's (`phone`), as the first page's Clear reads it. */
|
|
14
|
+
export declare function pageResets<Row>(input: Omit<SettingsPanelsInput<Row>, "onChange" | "onLayerChange">, saved: ListSettings | null, { cleared, phone }?: {
|
|
15
|
+
cleared?: boolean;
|
|
16
|
+
phone?: boolean;
|
|
17
|
+
}): Partial<Record<CustomizePage, PageReset>>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { applySettingsChange, settingsChange, } from "viewkitjs/fields/query";
|
|
2
|
+
import { columnsReset } from "../../model/settings-columns.js";
|
|
3
|
+
import { settingsCleared } from "./clear.js";
|
|
4
|
+
const KEYS = {
|
|
5
|
+
layout: ["layout", "look", "board", "calendar"],
|
|
6
|
+
columns: ["columns"],
|
|
7
|
+
filter: ["filter"],
|
|
8
|
+
sort: ["sorts", "rowOrderMode"],
|
|
9
|
+
group: ["group"],
|
|
10
|
+
};
|
|
11
|
+
const PAGES = Object.keys(KEYS);
|
|
12
|
+
function layerPart(page, layer, phone) {
|
|
13
|
+
if (page === "layout") {
|
|
14
|
+
const look = Object.keys(layer.look ?? {}).length > 0, phoneLayout = phone && layer.phoneLayout !== undefined;
|
|
15
|
+
return look || phoneLayout ? { look: {}, ...(phone && { phoneLayout: undefined }) } : null;
|
|
16
|
+
}
|
|
17
|
+
if (page === "columns")
|
|
18
|
+
return Object.keys(layer.widths ?? {}).length > 0 ? { widths: {} } : null;
|
|
19
|
+
if (page === "group")
|
|
20
|
+
return (layer.folded ?? []).length > 0 ? { folded: [] } : null;
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
function only(change, keys) {
|
|
24
|
+
const kept = Object.fromEntries(Object.entries(change).filter(([key]) => keys.includes(key)));
|
|
25
|
+
return Object.keys(kept).length > 0 ? kept : null;
|
|
26
|
+
}
|
|
27
|
+
const columnKey = (column) => `${column.key}\u0000${column.part ?? ""}`;
|
|
28
|
+
const withoutFigure = (columns) => columns.map(({ figure: _figure, ...rest }) => rest);
|
|
29
|
+
function columnsBack(now, baseline) {
|
|
30
|
+
const same = settingsChange({ columns: withoutFigure(now) }, { columns: withoutFigure(baseline) });
|
|
31
|
+
if (Object.keys(same).length === 0)
|
|
32
|
+
return null;
|
|
33
|
+
const figures = new Map(now.map((column) => [columnKey(column), column.figure]));
|
|
34
|
+
return {
|
|
35
|
+
columns: baseline.map((column) => {
|
|
36
|
+
const { figure: _figure, ...rest } = column;
|
|
37
|
+
const figure = figures.get(columnKey(column));
|
|
38
|
+
return figure === undefined ? rest : { ...rest, figure };
|
|
39
|
+
}),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export function pageResets(input, saved, { cleared = false, phone = false } = {}) {
|
|
43
|
+
const { settings, layer } = input;
|
|
44
|
+
const out = {};
|
|
45
|
+
let baseline = saved;
|
|
46
|
+
if (cleared)
|
|
47
|
+
baseline = applySettingsChange(settings, settingsCleared(input, "options", { phone }) ?? {});
|
|
48
|
+
if (!baseline)
|
|
49
|
+
return out;
|
|
50
|
+
const towards = settingsChange(settings, baseline);
|
|
51
|
+
for (const page of PAGES) {
|
|
52
|
+
if (cleared && page === "layout")
|
|
53
|
+
continue;
|
|
54
|
+
const change = page === "columns"
|
|
55
|
+
? columnsBack(settings.columns, cleared ? applySettingsChange(settings, columnsReset(settings, input.columns)).columns : baseline.columns)
|
|
56
|
+
: only(towards, KEYS[page]);
|
|
57
|
+
const part = layerPart(page, layer, phone);
|
|
58
|
+
if (change || part)
|
|
59
|
+
out[page] = { change, layer: part };
|
|
60
|
+
}
|
|
61
|
+
return out;
|
|
62
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type FilterTree } from "viewkitjs/fields/query";
|
|
2
|
+
type Item = FilterTree["items"][number];
|
|
3
|
+
/** Whether two filter items hold the same. */
|
|
4
|
+
export declare function sameFilterItem(a: Item, b: Item): boolean;
|
|
5
|
+
/** Whether the filter's top-level item at `index` is one of the saved filter's own. */
|
|
6
|
+
export declare function savedItem(tree: FilterTree, index: number, saved: FilterTree | undefined): boolean;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { settingsChange } from "viewkitjs/fields/query";
|
|
2
|
+
export function sameFilterItem(a, b) {
|
|
3
|
+
const one = (item) => ({ filter: { op: "and", items: [item] } });
|
|
4
|
+
return Object.keys(settingsChange(one(a), one(b))).length === 0;
|
|
5
|
+
}
|
|
6
|
+
export function savedItem(tree, index, saved) {
|
|
7
|
+
const item = tree.items[index];
|
|
8
|
+
return !!saved && item !== undefined && saved.items.some((own) => sameFilterItem(item, own));
|
|
9
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ListSettings } from "viewkitjs/fields/query";
|
|
1
2
|
/**
|
|
2
3
|
* THE VIEW AS A THING SHARED WITH OTHERS — how far what this person sees has
|
|
3
4
|
* drifted from it, and the two verbs that settle the drift.
|
|
@@ -28,6 +29,9 @@ export type CollectionViewState = {
|
|
|
28
29
|
onReset: () => void;
|
|
29
30
|
/** Make what you see everyone's view. */
|
|
30
31
|
onPublish: () => void;
|
|
32
|
+
/** The view's settings as saved: what each Customize page's Reset goes back to. Absent, its pages carry no Reset of
|
|
33
|
+
* their own; the first page's Reset still goes back through `onReset`. */
|
|
34
|
+
saved?: ListSettings;
|
|
31
35
|
};
|
|
32
36
|
/**
|
|
33
37
|
* Export CSV, when the list offers one: the Customize panel's actions row and the phone sheet's foot. `count`
|
|
@@ -69,10 +69,15 @@ export type ViewsProviderProps = {
|
|
|
69
69
|
* while rendering; until the first read a date that needs it draws its full form. A moment you hand is kept as it is:
|
|
70
70
|
* hand a new one to move it. */
|
|
71
71
|
now?: Date;
|
|
72
|
-
/** Which of your own controls ViewKit's panels and field editors draw inside them (VK-1013, VK-1021): `true` for all
|
|
73
|
-
* the names among `Button`, `Select`, `Menu`, `Popover`, `Input`
|
|
74
|
-
*
|
|
75
|
-
* `
|
|
72
|
+
/** Which of your own controls ViewKit's panels and field editors draw inside them (VK-1013, VK-1021): `true` for all nine, or
|
|
73
|
+
* the names among `Button`, `Select`, `Menu`, `Popover`, `Input` (the panels' text boxes, and the filter's number and range
|
|
74
|
+
* boxes with ViewKit reading what is typed, VK-1018), `Calendar` (the date editor's month; the filter's range calendar reads
|
|
75
|
+
* your `Calendar` whatever this says), `Tooltip` (the panels' tooltips, a reason marked `reason`, VK-1015), `Avatar` (your `atoms.Avatar`, every record's mark the panels draw:
|
|
76
|
+
* the Picker's rows, the links editor, the bulk bar, the quick filters, VK-1044) and `RelationChip` (your
|
|
77
|
+
* `atoms.RelationChip`, every mentioned record ViewKit draws: a table's cell, a field row's value, `renderFieldValue`,
|
|
78
|
+
* VK-1053). Each is handed the map's props and the part's `data-slot` and `data-key`; the two atoms their data alone
|
|
79
|
+
* (`ViewsAvatarProps`, a pixel size; `ViewsRelationChipProps`). A control of `CONTROLS`' and ViewKit's own atoms stay
|
|
80
|
+
* ViewKit's whatever this says. Absent, they draw ViewKit's own, as before. */
|
|
76
81
|
panelControls?: boolean | readonly PanelControlName[];
|
|
77
82
|
children: ReactNode;
|
|
78
83
|
};
|
|
@@ -60,10 +60,13 @@ export function ViewsProvider({ children, components, conventions = DEFAULT_CONV
|
|
|
60
60
|
Calendar: components.Calendar ?? MISSING_CALENDAR_COMPONENT,
|
|
61
61
|
}), [components]);
|
|
62
62
|
const optedKey = opted === true ? "all" : opted ? opted.join(",") : "";
|
|
63
|
+
const ownAvatar = merged.Avatar !== DEFAULT_VIEWS_ATOMS.Avatar;
|
|
64
|
+
const ownRelationChip = merged.RelationChip !== DEFAULT_VIEWS_ATOMS.RelationChip;
|
|
63
65
|
const panelControls = useMemo(() => {
|
|
64
66
|
const names = optedKey === "all" ? PANEL_CONTROL_NAMES : (optedKey ? optedKey.split(",") : []);
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
const apps = (name) => name === "Avatar" ? ownAvatar : name === "RelationChip" ? ownRelationChip : components[name] != null && !isOwnControl(components[name]);
|
|
68
|
+
return new Set(PANEL_CONTROL_NAMES.filter((name) => names.includes(name) && apps(name)));
|
|
69
|
+
}, [optedKey, components, ownAvatar, ownRelationChip]);
|
|
67
70
|
const strandedSelect = components.Select != null && !isOwnControl(components.Select) && !panelControls.has("Select");
|
|
68
71
|
const warnedSelect = useRef(false);
|
|
69
72
|
useEffect(() => {
|
|
@@ -72,6 +75,14 @@ export function ViewsProvider({ children, components, conventions = DEFAULT_CONV
|
|
|
72
75
|
warnedSelect.current = true;
|
|
73
76
|
console.warn("ViewKit: components.Select is drawn only inside ViewKit's panels, and panelControls doesn't name \"Select\", so it is never drawn.");
|
|
74
77
|
}, [strandedSelect]);
|
|
78
|
+
const strandedAtoms = carried === undefined && atoms?.ToolbarButton === undefined && Object.values(components).some(isOwnControl);
|
|
79
|
+
const warnedAtoms = useRef(false);
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
if (!strandedAtoms || warnedAtoms.current || process.env.NODE_ENV === "production")
|
|
82
|
+
return;
|
|
83
|
+
warnedAtoms.current = true;
|
|
84
|
+
console.warn("ViewKit: components holds ViewKit's own controls but none of their atoms, which a map spread from CONTROLS doesn't carry, so the toolbar draws ViewKit's plain button and the Toolbar's look options don't apply. Hand them beside it: atoms={{ ...CONTROL_ATOMS, ...yours }}.");
|
|
85
|
+
}, [strandedAtoms]);
|
|
75
86
|
const hosted = useRef({});
|
|
76
87
|
const mounted = useSyncExternalStore(NO_SUBSCRIBE, IN_BROWSER, ON_SERVER);
|
|
77
88
|
const onHostReady = useCallback((p) => {
|
|
@@ -100,6 +100,10 @@ export type ViewsPopoverProps = {
|
|
|
100
100
|
export type ViewsTooltipProps = {
|
|
101
101
|
content: ReactNode;
|
|
102
102
|
children: ReactElement;
|
|
103
|
+
/** Its content says why what it names can't be used (Add sort at its most, a rule set aside): a longer line, which your tooltip
|
|
104
|
+
* may wrap and draw in its regular weight, as ViewKit's own does. Handed inside ViewKit's panels, under `panelControls`
|
|
105
|
+
* (VK-1015). */
|
|
106
|
+
reason?: boolean;
|
|
103
107
|
side?: ViewsSide;
|
|
104
108
|
align?: ViewsAlign;
|
|
105
109
|
delayMs?: number;
|
|
@@ -551,6 +555,10 @@ export type ViewsPartsBodyProps = ViewsPartsBodyCommon & ({
|
|
|
551
555
|
low: number | null;
|
|
552
556
|
high: number | null;
|
|
553
557
|
}[];
|
|
558
|
+
/** The least each end may hold: with `max`, the field's limits: each end steps within them, as the number body's box does, and a typed end outside them is drawn back to them as the box is left (VK-904). Absent where the field states none. */
|
|
559
|
+
min?: number;
|
|
560
|
+
/** The most each end may hold (`min`). Absent where the field states none. */
|
|
561
|
+
max?: number;
|
|
554
562
|
});
|
|
555
563
|
/** One value of a list a values body holds: its text, its label where it has one, and whether it is the main one. */
|
|
556
564
|
export type ViewsValueLine = {
|
|
@@ -579,7 +587,8 @@ export type ViewsValuesBodyProps = {
|
|
|
579
587
|
labels: boolean;
|
|
580
588
|
/** `one`: the field holds one value: one line, no label, no main mark, no line to add another while it holds one. */
|
|
581
589
|
holds: "one" | "several";
|
|
582
|
-
/** A phone's country, where a number typed without its country code is read (RO)
|
|
590
|
+
/** A phone's country, where a number typed without its country code is read (RO): the record's, else the conventions'
|
|
591
|
+
* `region`. ViewKit's own body starts a new number on it. */
|
|
583
592
|
region?: string;
|
|
584
593
|
/** It may be emptied: every value removed is a clear. */
|
|
585
594
|
empty: boolean;
|
|
@@ -612,7 +621,8 @@ export type ViewsTextBodyProps = {
|
|
|
612
621
|
onDone: () => void;
|
|
613
622
|
/** Why a value would be refused, in the app's words, or null when it reads. The editor checks again at the close. */
|
|
614
623
|
check: (value: string) => string | null;
|
|
615
|
-
/** A phone's country, where a number typed without its country code is read (RO)
|
|
624
|
+
/** A phone's country, where a number typed without its country code is read (RO): the record's, else the conventions'
|
|
625
|
+
* `region`. ViewKit's own body starts a new number on it. */
|
|
616
626
|
region?: string;
|
|
617
627
|
/** What was typed on what opened it, already the value. */
|
|
618
628
|
typed?: string;
|
|
@@ -711,6 +721,49 @@ export type ViewsBodyStep = {
|
|
|
711
721
|
title: string;
|
|
712
722
|
onBack: () => void;
|
|
713
723
|
};
|
|
724
|
+
/** Which of the sort editor's menus a function is handed (VK-1063): a rule's ⋯ (a phone's and the narrow form's: a computer's rule
|
|
725
|
+
* has × and no ⋯), its `field` the sort's key (`rules[].value`), `index` its place; or a set-aside rule's ⋯, its `field` the
|
|
726
|
+
* rule's stored `fieldKey`. */
|
|
727
|
+
export type ViewsSortEditorItemsContext = ({
|
|
728
|
+
menu: "rule";
|
|
729
|
+
field: string;
|
|
730
|
+
index: number;
|
|
731
|
+
} | {
|
|
732
|
+
menu: "aside";
|
|
733
|
+
field: string;
|
|
734
|
+
}) & {
|
|
735
|
+
form: "computer" | "phone";
|
|
736
|
+
};
|
|
737
|
+
/** Which of the filter editor's menus (VK-1063): a rule's ⋮ or a set-aside rule's, named by its field (`field`, the rule's
|
|
738
|
+
* `fieldKey`; its `part`; the `relation` it stands under), or a group's actions; each by its `path` in the filter the body is handed
|
|
739
|
+
* (`ViewsFilterBodyProps.filter`): its indices through `items` and a relation rule's `where.items`, the whole filter `[]`. */
|
|
740
|
+
export type ViewsFilterEditorItemsContext = ({
|
|
741
|
+
menu: "rule" | "aside";
|
|
742
|
+
field: string;
|
|
743
|
+
part?: string;
|
|
744
|
+
relation?: string;
|
|
745
|
+
path: number[];
|
|
746
|
+
} | {
|
|
747
|
+
menu: "group";
|
|
748
|
+
path: number[];
|
|
749
|
+
}) & {
|
|
750
|
+
form: "computer" | "phone";
|
|
751
|
+
};
|
|
752
|
+
/** Which of the group editor's rows (VK-1063): its settings (`field`, the field grouped by), or its foot (Remove grouping). */
|
|
753
|
+
export type ViewsGroupEditorItemsContext = ({
|
|
754
|
+
menu: "settings";
|
|
755
|
+
field?: string;
|
|
756
|
+
} | {
|
|
757
|
+
menu: "foot";
|
|
758
|
+
}) & {
|
|
759
|
+
form: "computer" | "phone";
|
|
760
|
+
};
|
|
761
|
+
/** The sort editor's menus reshaped: handed a menu's default items, it hands back the items drawn. Pure, no hooks. */
|
|
762
|
+
export type ViewsSortEditorItems = (items: ViewsMenuItem[], ctx: ViewsSortEditorItemsContext) => ViewsMenuItem[];
|
|
763
|
+
/** The filter editor's menus reshaped. */
|
|
764
|
+
export type ViewsFilterEditorItems = (items: ViewsMenuItem[], ctx: ViewsFilterEditorItemsContext) => ViewsMenuItem[];
|
|
765
|
+
/** The group editor's rows reshaped. */
|
|
766
|
+
export type ViewsGroupEditorItems = (items: ViewsMenuItem[], ctx: ViewsGroupEditorItemsContext) => ViewsMenuItem[];
|
|
714
767
|
/** The sort editor's body, which your app draws (`SortBody`): what the sort pill opens on a computer and in the phone's
|
|
715
768
|
* Sheet, in place of ViewKit's own. A panel's body, as every panel's: handed the panel's state as data, it hands back
|
|
716
769
|
* the whole new value, every change as it is made; ViewKit keeps the rules, the save and what ✕ takes back to. Its
|
|
@@ -767,6 +820,9 @@ export type ViewsSortBodyProps = {
|
|
|
767
820
|
* ✓; under `bar` your own head does. Escape calls `onBack`; a swipe still closes the whole sheet, keeping the rules.
|
|
768
821
|
* Absent on a computer. */
|
|
769
822
|
onStepChange?: (step: ViewsBodyStep | null) => void;
|
|
823
|
+
/** Its menus as data (`menus.sortEditor`, VK-1063): a rule's ⋯ and a set-aside rule's, reshaped. `CONTROLS.SortBody` draws
|
|
824
|
+
* what it hands back; a body of your own may honour it. */
|
|
825
|
+
items?: ViewsSortEditorItems;
|
|
770
826
|
};
|
|
771
827
|
/** The quick filters' body, which your app draws (`QuickFiltersBody`): what the quick filters' button opens on a
|
|
772
828
|
* computer and in the phone's Sheet, in place of ViewKit's own panel. A panel's body, as every panel's: handed the
|
|
@@ -902,6 +958,9 @@ export type ViewsFilterBodyProps = {
|
|
|
902
958
|
* are back. The sheet's head shows the step's title, Back in ✕'s place and ✓; Escape calls onBack; a swipe still closes
|
|
903
959
|
* the whole sheet, keeping the filter. Absent on a computer. */
|
|
904
960
|
onStepChange?: (step: ViewsBodyStep | null) => void;
|
|
961
|
+
/** Its menus as data (`menus.filterEditor`, VK-1063): a rule's ⋮, a set-aside rule's and a group's actions, reshaped.
|
|
962
|
+
* `CONTROLS.FilterBody` draws what it hands back; a body of your own may honour it. */
|
|
963
|
+
items?: ViewsFilterEditorItems;
|
|
905
964
|
};
|
|
906
965
|
/** A field as the field list's body is handed it (`ViewsFieldsBodyProps.fields`). */
|
|
907
966
|
export type ViewsFieldsBodyField = {
|
|
@@ -935,6 +994,9 @@ export type ViewsFieldsBodyProps = {
|
|
|
935
994
|
fields: readonly ViewsFieldsBodyField[];
|
|
936
995
|
/** The field being changed (a rule's field): ticked, and pickable. Absent where a pick adds. */
|
|
937
996
|
own?: string;
|
|
997
|
+
/** For a rule on a related record's field, the relation `own` stands under: its key, as `onPick` hands it back, so the
|
|
998
|
+
* far field is ticked and never a field of the list's own with the same key. Absent for the list's own field. */
|
|
999
|
+
ownRelation?: string;
|
|
938
1000
|
form: "computer" | "phone";
|
|
939
1001
|
/** A field picked: its key, and, for a relation's far field, the far field's key. A key not handed, or one handed
|
|
940
1002
|
* `disabled`, writes nothing. */
|
|
@@ -956,6 +1018,9 @@ export type ViewsFilterPartBodyProps = {
|
|
|
956
1018
|
/** The field it names (for a far rule, the relation's far field): its `type` says the ways and the value each
|
|
957
1019
|
* stores. */
|
|
958
1020
|
field: Omit<ViewsFilterBodyField, "far">;
|
|
1021
|
+
/** For a far rule (Company › Industry), the relation's field key it stands under ("company"), as `FilterBody`'s
|
|
1022
|
+
* `ruleValue` hands it: whose values to offer. Absent for a rule on the list's own field. */
|
|
1023
|
+
relation?: string;
|
|
959
1024
|
/** The ways its field offers, in order: each its operator and its words. */
|
|
960
1025
|
ways: readonly {
|
|
961
1026
|
value: FilterRule["operator"];
|
|
@@ -1245,9 +1310,31 @@ export type ViewsGroupBodyProps = {
|
|
|
1245
1310
|
/** Tell what holds you that you stand on a level of your own (Group by's fields, an order's choices): its head shows the
|
|
1246
1311
|
* level's name and its Back calls onBack; hand null once you are back. On a computer and a phone. */
|
|
1247
1312
|
onStepChange?: (step: ViewsBodyStep | null) => void;
|
|
1313
|
+
/** Its rows as data (`menus.groupEditor`, VK-1063): its settings and its foot, reshaped. `CONTROLS.GroupBody` draws what it
|
|
1314
|
+
* hands back; a body of your own may honour it. */
|
|
1315
|
+
items?: ViewsGroupEditorItems;
|
|
1316
|
+
};
|
|
1317
|
+
/** Where a Customize body stands: its list, a section's page, or `page:<key>`, a page of the app's own (VK-1062). */
|
|
1318
|
+
export type ViewsCustomizePage = "list" | "layout" | "columns" | "filter" | "sort" | "group" | `page:${string}`;
|
|
1319
|
+
/** A row of Customize as data (VK-1062): a menu's row (`ViewsMenuItem`), its value in the brand while it differs from the
|
|
1320
|
+
* view as saved (`inForce`), and on Customize's list a page of the app's own (`page`), opened by the row and titled by its
|
|
1321
|
+
* `label`. A row whose key is one of Customize's own (list.md, Default keys) is ViewKit's row, with this item's words, icon,
|
|
1322
|
+
* value, mark and divider. */
|
|
1323
|
+
export type ViewsCustomizeItem = Omit<ViewsMenuItem, "children"> & {
|
|
1324
|
+
inForce?: boolean;
|
|
1325
|
+
/** On Customize's list alone: a page of the app's own, or a function handed its Back. */
|
|
1326
|
+
page?: ReactNode | ((back: () => void) => ReactNode);
|
|
1327
|
+
children?: ViewsCustomizeItem[];
|
|
1328
|
+
};
|
|
1329
|
+
/** Which of Customize's rows a function is handed: its list, Layout's page, or Columns' page; the form; the layout in use. */
|
|
1330
|
+
export type ViewsCustomizeItemsContext = {
|
|
1331
|
+
page: "list" | "layout" | "columns";
|
|
1332
|
+
form: "computer" | "phone";
|
|
1333
|
+
layout?: string;
|
|
1248
1334
|
};
|
|
1249
|
-
/**
|
|
1250
|
-
|
|
1335
|
+
/** Customize's rows reshaped: handed a page's default rows, it hands back the rows that page draws. Called as Customize draws:
|
|
1336
|
+
* pure and cheap, no hooks. */
|
|
1337
|
+
export type ViewsCustomizeItems = (items: ViewsCustomizeItem[], ctx: ViewsCustomizeItemsContext) => ViewsCustomizeItem[];
|
|
1251
1338
|
/** A setting turned on or off in Customize (Show counts, a layout's Freeze first column, a column's Show time): the
|
|
1252
1339
|
* panels' `ToggleConfig`, written out here. `onChange` writes it; `reset`, where present, takes it back to the
|
|
1253
1340
|
* reader's default; `section`, the heading it stands under, where it has one. */
|
|
@@ -1257,6 +1344,7 @@ export type ViewsCustomizeToggle = {
|
|
|
1257
1344
|
value: boolean;
|
|
1258
1345
|
onChange: (next: boolean) => void;
|
|
1259
1346
|
icon?: ReactNode;
|
|
1347
|
+
/** @deprecated Handed by nothing since a toggle carries no way back of its own (VK-1033). To be removed in a later release. */
|
|
1260
1348
|
reset?: () => void;
|
|
1261
1349
|
section?: string;
|
|
1262
1350
|
};
|
|
@@ -1296,7 +1384,8 @@ export type ViewsCustomizeLayout = {
|
|
|
1296
1384
|
choices: readonly ViewsCustomizeChoice[];
|
|
1297
1385
|
/** Its row spacing, where the layout has one. */
|
|
1298
1386
|
density?: ViewsCustomizeChoice;
|
|
1299
|
-
/**
|
|
1387
|
+
/** @deprecated Handed by nothing since Customize's Layout page ends at its toggles (VK-1033). To be removed in a later
|
|
1388
|
+
* release. */
|
|
1300
1389
|
personal?: {
|
|
1301
1390
|
label: string;
|
|
1302
1391
|
toggles: readonly ViewsCustomizeToggle[];
|
|
@@ -1464,7 +1553,14 @@ export type ViewsCustomizeBodyProps = {
|
|
|
1464
1553
|
pending: boolean;
|
|
1465
1554
|
onReset: () => void;
|
|
1466
1555
|
onPublish: () => void;
|
|
1556
|
+
/** The reader's own layer holds something: Reset stands (and empties it), Save only for `changes` (VK-1034). */
|
|
1557
|
+
layered?: boolean;
|
|
1467
1558
|
};
|
|
1559
|
+
/** Each page's own Reset, back to the view as saved (with no saved view, to the first page's Clear), each only while
|
|
1560
|
+
* that page differs; drawn on its page in the first page's Reset's word and look (VK-1034). Handed (even empty), the
|
|
1561
|
+
* body draws these alone, and no Clear all of the sort's or the filter's; not handed (a view without its saved
|
|
1562
|
+
* settings), the body keeps `columns.reset` and Clear all. */
|
|
1563
|
+
resets?: Partial<Record<"layout" | "columns" | "filter" | "sort" | "group", () => void>>;
|
|
1468
1564
|
/** The foot's words: `kit` for Clear and Save, `none` for none (they stand elsewhere); absent, Reset and Set default
|
|
1469
1565
|
* for everyone. */
|
|
1470
1566
|
foot?: "kit" | "none";
|
|
@@ -1478,6 +1574,9 @@ export type ViewsCustomizeBodyProps = {
|
|
|
1478
1574
|
/** On a phone where the sheet's head doesn't draw it (`sheetActions: "bar"`): its ✕, closing it, for your body's own
|
|
1479
1575
|
* head. Absent on a computer, and under `head`, where the sheet holds it. */
|
|
1480
1576
|
actions?: ViewsSheetActions;
|
|
1577
|
+
/** Customize's rows as data (`menus.customize`, VK-1062): the list's and Layout's and Columns' pages' rows, reshaped.
|
|
1578
|
+
* `CONTROLS.CustomizeBody` draws what it hands back; a body of your own may honour it. */
|
|
1579
|
+
items?: ViewsCustomizeItems;
|
|
1481
1580
|
/** The view's name, as the app hands it through the toolbar (`viewName`): draw it, renamed in place, only with `onRename`. */
|
|
1482
1581
|
name?: string;
|
|
1483
1582
|
/** Renames the view (the toolbar's `onRenameView`): handed only where the app can rename it. */
|
|
@@ -1576,13 +1675,16 @@ export type ViewsSelectProps = {
|
|
|
1576
1675
|
size?: "sm" | "default";
|
|
1577
1676
|
className?: string;
|
|
1578
1677
|
"aria-label"?: string;
|
|
1678
|
+
/** Inside a ViewKit field (the place editor's country, VK-1022), the id its label names: put it on the box a person presses. */
|
|
1679
|
+
id?: string;
|
|
1579
1680
|
/** The part's public name (`vk-sort-field`) and which one: draw them on the box a person presses. */
|
|
1580
1681
|
"data-slot"?: string;
|
|
1581
1682
|
"data-key"?: string;
|
|
1582
1683
|
};
|
|
1583
1684
|
/** The controls ViewKit's panels and field editors can draw as the app's own, under the provider's `panelControls` (VK-1013;
|
|
1584
|
-
* `Calendar`, the date editor's month, VK-1021)
|
|
1585
|
-
|
|
1685
|
+
* `Calendar`, the date editor's month, VK-1021; `Tooltip`, the panels' tooltips, VK-1015); `Avatar`, the atom, every record's
|
|
1686
|
+
* mark the panels draw (VK-1044); and `RelationChip`, the atom, every mentioned record ViewKit draws (VK-1053). */
|
|
1687
|
+
export type PanelControlName = "Button" | "Select" | "Menu" | "Popover" | "Input" | "Calendar" | "Tooltip" | "Avatar" | "RelationChip";
|
|
1586
1688
|
export declare const PANEL_CONTROL_NAMES: readonly PanelControlName[];
|
|
1587
1689
|
/** What the components map's `RowsWait` is handed: a grid's rows, and whether new ones are loading. */
|
|
1588
1690
|
export type ViewsRowsWaitProps = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const PANEL_CONTROL_NAMES = ["Button", "Select", "Menu", "Popover", "Input", "Calendar"];
|
|
1
|
+
export const PANEL_CONTROL_NAMES = ["Button", "Select", "Menu", "Popover", "Input", "Calendar", "Tooltip", "Avatar", "RelationChip"];
|
|
2
2
|
const _requiredMatchContract = true;
|
|
3
3
|
const _optionalMatchContract = true;
|
|
4
4
|
void _requiredMatchContract;
|
package/views/dist/react.d.ts
CHANGED
|
@@ -6,10 +6,10 @@ export { DEFAULT_DESKTOP_QUERY } from "./provider/desktop.js";
|
|
|
6
6
|
export { PANEL_CONTROL_NAMES } from "./provider/components.js";
|
|
7
7
|
export { flatSelectItems } from "./provider/select-items.js";
|
|
8
8
|
export type { ViewsSeveralValues } from "./display/fit-values.js";
|
|
9
|
-
export type { ViewsAlign, ViewsAnchor, ViewsBarPlacement, ViewsButtonProps, ViewsCalendarProps, ViewsCheckboxProps, ViewsCloseReason, ViewsCollapseProps, ViewsCommandParts, ViewsComponents, ViewsCustomizeBodyProps, ViewsCustomizeChoice, ViewsCustomizeColumn, ViewsCustomizeColumns, ViewsCustomizeField, ViewsCustomizeFields, ViewsCustomizeLayout, ViewsCustomizePage, ViewsCustomizeToggle, ViewsDateBodyProps, ViewsDatePick, ViewsDatePicks, ViewsInputProps, ViewsFieldsBodyField, ViewsFieldsBodyProps, ViewsFilterBodyField, ViewsFilterBodyProps, ViewsFilterPartBodyProps, ViewsGroupBodyProps, ViewsGroupDimension, ViewsGroupEntry, ViewsGroupValue, ViewsMenuItem, ViewsMenuProps, ViewsNumberBodyProps, ViewsOpenChange, ViewsPartsBodyProps, ViewsPickerAction, ViewsPickerItem, ViewsPickerProps, ViewsLink, ViewsLinkRole, ViewsLinksBodyProps, ViewsPlacePart, ViewsPlaceParts, ViewsPopoverProps, ViewsPortsHostProps, PanelControlName, ViewsSelectionBarProps, ViewsSelectItem, ViewsSelectProps, ViewsQuickFiltersBodyProps, ViewsResolvedComponents, ViewsRowsWaitProps, ViewsSearchFieldProps, ViewsSelectionBarSettings, ViewsSheetAction, ViewsSheetActions, ViewsBodyStep, ViewsSheetActionsPlace, ViewsSheetProps, ViewsSide, ViewsSortBodyProps, ViewsTextBodyProps, ViewsTooltipProps, ViewsValueLine, ViewsValuesBodyProps, ViewsViewsListBodyProps, ViewsViewsListItem, ViewsViewChange, ViewsViewLayout, ViewsViewMenuProps, ViewsPaneProps, ViewsViewRecord, ViewsViewVerbs, } from "./provider/components.js";
|
|
9
|
+
export type { ViewsAlign, ViewsAnchor, ViewsBarPlacement, ViewsButtonProps, ViewsCalendarProps, ViewsCheckboxProps, ViewsCloseReason, ViewsCollapseProps, ViewsCommandParts, ViewsComponents, ViewsCustomizeBodyProps, ViewsCustomizeChoice, ViewsCustomizeColumn, ViewsCustomizeColumns, ViewsCustomizeField, ViewsCustomizeFields, ViewsCustomizeItem, ViewsCustomizeItems, ViewsCustomizeItemsContext, ViewsCustomizeLayout, ViewsCustomizePage, ViewsCustomizeToggle, ViewsDateBodyProps, ViewsDatePick, ViewsDatePicks, ViewsInputProps, ViewsFieldsBodyField, ViewsFieldsBodyProps, ViewsFilterBodyField, ViewsFilterBodyProps, ViewsFilterEditorItems, ViewsFilterEditorItemsContext, ViewsFilterPartBodyProps, ViewsGroupBodyProps, ViewsGroupEditorItems, ViewsGroupEditorItemsContext, ViewsGroupDimension, ViewsGroupEntry, ViewsGroupValue, ViewsMenuItem, ViewsMenuProps, ViewsNumberBodyProps, ViewsOpenChange, ViewsPartsBodyProps, ViewsPickerAction, ViewsPickerItem, ViewsPickerProps, ViewsLink, ViewsLinkRole, ViewsLinksBodyProps, ViewsPlacePart, ViewsPlaceParts, ViewsPopoverProps, ViewsPortsHostProps, PanelControlName, ViewsSelectionBarProps, ViewsSelectItem, ViewsSelectProps, ViewsQuickFiltersBodyProps, ViewsResolvedComponents, ViewsRowsWaitProps, ViewsSearchFieldProps, ViewsSelectionBarSettings, ViewsSheetAction, ViewsSheetActions, ViewsBodyStep, ViewsSheetActionsPlace, ViewsSheetProps, ViewsSide, ViewsSortBodyProps, ViewsSortEditorItems, ViewsSortEditorItemsContext, ViewsTextBodyProps, ViewsTooltipProps, ViewsValueLine, ViewsValuesBodyProps, ViewsViewsListBodyProps, ViewsViewsListItem, ViewsViewChange, ViewsViewLayout, ViewsViewMenuProps, ViewsPaneProps, ViewsViewRecord, ViewsViewVerbs, } from "./provider/components.js";
|
|
10
10
|
export type { ViewsIconProps, ViewsIcons } from "./provider/icons.js";
|
|
11
11
|
export { NOOP_PORTS, NOOP_TOAST } from "./provider/ports.js";
|
|
12
12
|
export type { ViewsClipboardPort, ViewsConfirmPort, ViewsConfirmRequest, ViewsHapticsPort, ViewsPorts, ViewsPrefsPort, ViewsResolvedPorts, ViewsToastPort, } from "./provider/ports.js";
|
|
13
13
|
export { DEFAULT_VIEWS_ATOMS } from "./atoms/defaults.js";
|
|
14
|
-
export type { ViewsAtoms, ViewsAvatarProps, ViewsCommandMenuProps, ViewsRowMenuItem, ViewsRowMenuProps, ViewsListProps, ViewsRelationLinkProps, ViewsRelationRolesProps, ViewsCellMoreProps, ViewsLoadingProps, ViewsLoadMoreProps, ViewsPlatformMarkProps, ViewsRowContentProps, ViewsRowProps, ViewsSelectionSheetProps, ViewsStatusBadgeProps, ViewsStatusOption, ViewsStatusPlace, ViewsStatusMarkerProps, ViewsTagProps, ViewsTickBoxProps, ViewsChoiceRowProps, ViewsCheckRowProps, ViewsRadioRowProps, ViewsDirectionButtonProps, ViewsMenuRowProps, ViewsToggleRowProps, ViewsPanelSearchProps, ViewsPillProps, ViewsRangeCalendarProps, ViewsToolbarButtonProps, ViewsToolbarButtonPart, ViewsFramePart, } from "./atoms/types.js";
|
|
14
|
+
export type { ViewsAtoms, ViewsAvatarProps, ViewsCommandMenuProps, ViewsRowMenuItem, ViewsRowMenuProps, ViewsListProps, ViewsRelationLinkProps, ViewsRelationRolesProps, ViewsRelationChipProps, ViewsRelationChipLinkProps, ViewsCellMoreProps, ViewsLoadingProps, ViewsLoadMoreProps, ViewsPlatformMarkProps, ViewsRowContentProps, ViewsRowProps, ViewsSelectionSheetProps, ViewsStatusBadgeProps, ViewsStatusOption, ViewsStatusPlace, ViewsStatusMarkerProps, ViewsTagProps, ViewsTickBoxProps, ViewsChoiceRowProps, ViewsCheckRowProps, ViewsRadioRowProps, ViewsDirectionButtonProps, ViewsMenuRowProps, ViewsToggleRowProps, ViewsPanelSearchProps, ViewsPillProps, ViewsRangeCalendarProps, ViewsToolbarButtonProps, ViewsToolbarButtonPart, ViewsFramePart, } from "./atoms/types.js";
|
|
15
15
|
export type { ComponentName, PortName, ViewsIconName, ViewsMessage, ViewsMessageResolver } from "./contract.js";
|