@formicoidea/labre-core 0.48.0 → 0.49.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/_pkgs/affine-block-data-view/configs/slash-menu.js +3 -1
- package/dist/_pkgs/affine-block-data-view/view.d.ts +17 -1
- package/dist/_pkgs/affine-block-data-view/view.js +21 -2
- package/dist/_pkgs/affine-block-database/commands.d.ts +2 -2
- package/dist/_pkgs/affine-block-database/commands.js +3 -3
- package/dist/_pkgs/affine-block-database/components/values-banner.d.ts +28 -0
- package/dist/_pkgs/affine-block-database/components/values-banner.js +199 -0
- package/dist/_pkgs/affine-block-database/configs/slash-menu.d.ts +6 -1
- package/dist/_pkgs/affine-block-database/configs/slash-menu.js +57 -70
- package/dist/_pkgs/affine-block-database/data-source.d.ts +9 -5
- package/dist/_pkgs/affine-block-database/data-source.js +11 -7
- package/dist/_pkgs/affine-block-database/database-block-styles.d.ts +2 -0
- package/dist/_pkgs/affine-block-database/database-block-styles.js +15 -0
- package/dist/_pkgs/affine-block-database/database-block.d.ts +23 -0
- package/dist/_pkgs/affine-block-database/database-block.js +141 -19
- package/dist/_pkgs/affine-block-database/effects.js +2 -0
- package/dist/_pkgs/affine-block-database/external-data-source.d.ts +69 -2
- package/dist/_pkgs/affine-block-database/external-data-source.js +88 -16
- package/dist/_pkgs/affine-block-database/index.d.ts +2 -0
- package/dist/_pkgs/affine-block-database/index.js +2 -0
- package/dist/_pkgs/affine-block-database/linked-view.d.ts +38 -0
- package/dist/_pkgs/affine-block-database/linked-view.js +109 -0
- package/dist/_pkgs/affine-block-database/properties/index.d.ts +2 -0
- package/dist/_pkgs/affine-block-database/properties/index.js +2 -0
- package/dist/_pkgs/affine-block-database/properties/text/hosted.d.ts +15 -0
- package/dist/_pkgs/affine-block-database/properties/text/hosted.js +24 -0
- package/dist/_pkgs/affine-block-database/properties/title/hosted.d.ts +16 -0
- package/dist/_pkgs/affine-block-database/properties/title/hosted.js +42 -0
- package/dist/_pkgs/affine-block-database/service/index.d.ts +3 -0
- package/dist/_pkgs/affine-block-database/service/index.js +3 -0
- package/dist/_pkgs/affine-block-database/service/new-row-menu.d.ts +49 -0
- package/dist/_pkgs/affine-block-database/service/new-row-menu.js +21 -0
- package/dist/_pkgs/affine-block-database/service/open-row.d.ts +77 -0
- package/dist/_pkgs/affine-block-database/service/open-row.js +62 -0
- package/dist/_pkgs/affine-block-database/service/properties-panel.d.ts +23 -0
- package/dist/_pkgs/affine-block-database/service/properties-panel.js +33 -0
- package/dist/_pkgs/affine-block-database/translations.d.ts +10 -0
- package/dist/_pkgs/affine-block-database/translations.js +35 -0
- package/dist/_pkgs/affine-block-database/view-creation.d.ts +10 -0
- package/dist/_pkgs/affine-block-database/view-creation.js +14 -0
- package/dist/_pkgs/affine-block-database/view.d.ts +31 -1
- package/dist/_pkgs/affine-block-database/view.js +44 -5
- package/dist/_pkgs/affine-block-database/views/index.d.ts +30 -3
- package/dist/_pkgs/affine-block-database/views/index.js +44 -3
- package/dist/_pkgs/affine-components/date-picker/date-picker.d.ts +20 -0
- package/dist/_pkgs/affine-components/date-picker/date-picker.js +60 -26
- package/dist/_pkgs/affine-components/date-picker/style.js +1 -0
- package/dist/_pkgs/affine-components/translations.d.ts +4 -0
- package/dist/_pkgs/affine-components/translations.js +26 -0
- package/dist/_pkgs/affine-fragment-doc-title/doc-title.d.ts +18 -0
- package/dist/_pkgs/affine-fragment-doc-title/doc-title.js +41 -2
- package/dist/_pkgs/affine-fragment-doc-title/title-band/band-cell.d.ts +8 -0
- package/dist/_pkgs/affine-fragment-doc-title/title-band/band-cell.js +12 -0
- package/dist/_pkgs/affine-fragment-doc-title/title-band/title-band.d.ts +5 -0
- package/dist/_pkgs/affine-fragment-doc-title/title-band/title-band.js +44 -4
- package/dist/_pkgs/affine-model/blocks/database/types.d.ts +16 -0
- package/dist/_pkgs/affine-model/blocks/database/types.js +5 -1
- package/dist/_pkgs/affine-shared/services/data-source-picker-service.d.ts +139 -0
- package/dist/_pkgs/affine-shared/services/data-source-picker-service.js +22 -0
- package/dist/_pkgs/affine-shared/services/index.d.ts +1 -0
- package/dist/_pkgs/affine-shared/services/index.js +1 -0
- package/dist/_pkgs/affine-shared/services/telemetry-service/database.d.ts +59 -0
- package/dist/_pkgs/affine-shared/services/title-band-service.d.ts +24 -0
- package/dist/_pkgs/data-view/core/component/cell-status/cell-status-css.d.ts +2 -0
- package/dist/_pkgs/data-view/core/component/cell-status/cell-status-css.js +16 -0
- package/dist/_pkgs/data-view/core/component/cell-status/cell-status.d.ts +10 -0
- package/dist/_pkgs/data-view/core/component/cell-status/cell-status.js +23 -0
- package/dist/_pkgs/data-view/core/component/index.d.ts +1 -0
- package/dist/_pkgs/data-view/core/component/index.js +1 -0
- package/dist/_pkgs/data-view/core/component/overflow/fit.d.ts +26 -0
- package/dist/_pkgs/data-view/core/component/overflow/fit.js +48 -0
- package/dist/_pkgs/data-view/core/component/overflow/overflow.d.ts +26 -3
- package/dist/_pkgs/data-view/core/component/overflow/overflow.js +84 -31
- package/dist/_pkgs/data-view/core/component/tags/colors.d.ts +7 -0
- package/dist/_pkgs/data-view/core/component/tags/colors.js +22 -10
- package/dist/_pkgs/data-view/core/component/tags/multi-tag-select.d.ts +18 -0
- package/dist/_pkgs/data-view/core/component/tags/multi-tag-select.js +63 -21
- package/dist/_pkgs/data-view/core/data-source/base.d.ts +5 -1
- package/dist/_pkgs/data-view/core/data-source/base.js +7 -1
- package/dist/_pkgs/data-view/core/data-source/hydration.d.ts +44 -0
- package/dist/_pkgs/data-view/core/data-source/hydration.js +31 -0
- package/dist/_pkgs/data-view/core/data-source/index.d.ts +1 -0
- package/dist/_pkgs/data-view/core/data-source/index.js +1 -0
- package/dist/_pkgs/data-view/core/data-view.d.ts +22 -2
- package/dist/_pkgs/data-view/core/data-view.js +14 -0
- package/dist/_pkgs/data-view/core/effect.js +2 -0
- package/dist/_pkgs/data-view/core/group-by/collapsed-state.d.ts +3 -0
- package/dist/_pkgs/data-view/core/group-by/collapsed-state.js +59 -0
- package/dist/_pkgs/data-view/core/group-by/group-properties.d.ts +21 -0
- package/dist/_pkgs/data-view/core/group-by/group-properties.js +38 -0
- package/dist/_pkgs/data-view/core/group-by/group-title.js +4 -0
- package/dist/_pkgs/data-view/core/group-by/group-visibility.d.ts +40 -0
- package/dist/_pkgs/data-view/core/group-by/group-visibility.js +291 -0
- package/dist/_pkgs/data-view/core/group-by/setting.d.ts +11 -3
- package/dist/_pkgs/data-view/core/group-by/setting.js +81 -8
- package/dist/_pkgs/data-view/core/group-by/trait.d.ts +22 -0
- package/dist/_pkgs/data-view/core/group-by/trait.js +62 -1
- package/dist/_pkgs/data-view/core/index.d.ts +3 -0
- package/dist/_pkgs/data-view/core/index.js +3 -0
- package/dist/_pkgs/data-view/core/property/base-cell.d.ts +15 -1
- package/dist/_pkgs/data-view/core/property/base-cell.js +28 -3
- package/dist/_pkgs/data-view/core/property/standalone-cell.d.ts +15 -1
- package/dist/_pkgs/data-view/core/property/standalone-cell.js +19 -1
- package/dist/_pkgs/data-view/core/telemetry.d.ts +16 -0
- package/dist/_pkgs/data-view/core/telemetry.js +22 -0
- package/dist/_pkgs/data-view/core/utils/new-tab-click.d.ts +2 -0
- package/dist/_pkgs/data-view/core/utils/new-tab-click.js +4 -0
- package/dist/_pkgs/data-view/core/utils/wording.d.ts +11 -0
- package/dist/_pkgs/data-view/core/utils/wording.js +9 -0
- package/dist/_pkgs/data-view/core/view/data-view.d.ts +7 -0
- package/dist/_pkgs/data-view/core/view/default-name.d.ts +10 -0
- package/dist/_pkgs/data-view/core/view/default-name.js +14 -0
- package/dist/_pkgs/data-view/core/view/index.d.ts +2 -0
- package/dist/_pkgs/data-view/core/view/index.js +2 -0
- package/dist/_pkgs/data-view/core/view/open-in.d.ts +27 -0
- package/dist/_pkgs/data-view/core/view/open-in.js +39 -0
- package/dist/_pkgs/data-view/core/view-manager/cell.d.ts +5 -0
- package/dist/_pkgs/data-view/core/view-manager/cell.js +11 -0
- package/dist/_pkgs/data-view/core/view-manager/index.d.ts +3 -0
- package/dist/_pkgs/data-view/core/view-manager/index.js +3 -0
- package/dist/_pkgs/data-view/core/view-manager/new-row-menu-opener.d.ts +18 -0
- package/dist/_pkgs/data-view/core/view-manager/new-row-menu-opener.js +2 -0
- package/dist/_pkgs/data-view/core/view-manager/properties-panel-opener.d.ts +8 -0
- package/dist/_pkgs/data-view/core/view-manager/properties-panel-opener.js +9 -0
- package/dist/_pkgs/data-view/core/view-manager/property.d.ts +8 -0
- package/dist/_pkgs/data-view/core/view-manager/single-view.d.ts +28 -1
- package/dist/_pkgs/data-view/core/view-manager/single-view.js +45 -1
- package/dist/_pkgs/data-view/core/view-manager/view-creation.d.ts +49 -0
- package/dist/_pkgs/data-view/core/view-manager/view-creation.js +40 -0
- package/dist/_pkgs/data-view/core/view-manager/view-manager.d.ts +6 -2
- package/dist/_pkgs/data-view/core/view-manager/view-manager.js +2 -2
- package/dist/_pkgs/data-view/property-presets/date/cell-renderer.d.ts +2 -0
- package/dist/_pkgs/data-view/property-presets/date/cell-renderer.js +11 -2
- package/dist/_pkgs/data-view/property-presets/multi-select/cell-renderer.js +2 -0
- package/dist/_pkgs/data-view/property-presets/select/cell-renderer.js +2 -0
- package/dist/_pkgs/data-view/translations.d.ts +55 -0
- package/dist/_pkgs/data-view/translations.js +181 -0
- package/dist/_pkgs/data-view/view-presets/calendar/define.js +3 -1
- package/dist/_pkgs/data-view/view-presets/convert.js +2 -0
- package/dist/_pkgs/data-view/view-presets/effect.js +4 -0
- package/dist/_pkgs/data-view/view-presets/flat/flat-converts.d.ts +2 -0
- package/dist/_pkgs/data-view/view-presets/flat/flat-converts.js +35 -0
- package/dist/_pkgs/data-view/view-presets/flat/flat-view-manager.d.ts +79 -0
- package/dist/_pkgs/data-view/view-presets/flat/flat-view-manager.js +194 -0
- package/dist/_pkgs/data-view/view-presets/flat/flat-view-ui.d.ts +56 -0
- package/dist/_pkgs/data-view/view-presets/flat/flat-view-ui.js +266 -0
- package/dist/_pkgs/data-view/view-presets/gallery/define.d.ts +14 -0
- package/dist/_pkgs/data-view/view-presets/gallery/define.js +15 -0
- package/dist/_pkgs/data-view/view-presets/gallery/effect.d.ts +1 -0
- package/dist/_pkgs/data-view/view-presets/gallery/effect.js +4 -0
- package/dist/_pkgs/data-view/view-presets/gallery/gallery-view.d.ts +27 -0
- package/dist/_pkgs/data-view/view-presets/gallery/gallery-view.js +179 -0
- package/dist/_pkgs/data-view/view-presets/gallery/index.d.ts +2 -0
- package/dist/_pkgs/data-view/view-presets/gallery/index.js +2 -0
- package/dist/_pkgs/data-view/view-presets/gallery/renderer.d.ts +1 -0
- package/dist/_pkgs/data-view/view-presets/gallery/renderer.js +11 -0
- package/dist/_pkgs/data-view/view-presets/index.d.ts +5 -0
- package/dist/_pkgs/data-view/view-presets/index.js +7 -0
- package/dist/_pkgs/data-view/view-presets/kanban/define.js +3 -1
- package/dist/_pkgs/data-view/view-presets/kanban/kanban-view-manager.js +5 -53
- package/dist/_pkgs/data-view/view-presets/kanban/mobile/card.js +8 -1
- package/dist/_pkgs/data-view/view-presets/kanban/mobile/cell.js +6 -1
- package/dist/_pkgs/data-view/view-presets/kanban/mobile/group.d.ts +4 -2
- package/dist/_pkgs/data-view/view-presets/kanban/mobile/group.js +52 -6
- package/dist/_pkgs/data-view/view-presets/kanban/mobile/kanban-view-ui-logic.js +5 -1
- package/dist/_pkgs/data-view/view-presets/kanban/pc/card.js +2 -0
- package/dist/_pkgs/data-view/view-presets/kanban/pc/cell.js +4 -0
- package/dist/_pkgs/data-view/view-presets/kanban/pc/group.d.ts +4 -2
- package/dist/_pkgs/data-view/view-presets/kanban/pc/group.js +51 -6
- package/dist/_pkgs/data-view/view-presets/kanban/pc/kanban-view-ui-logic.js +5 -1
- package/dist/_pkgs/data-view/view-presets/list/define.d.ts +14 -0
- package/dist/_pkgs/data-view/view-presets/list/define.js +15 -0
- package/dist/_pkgs/data-view/view-presets/list/effect.d.ts +1 -0
- package/dist/_pkgs/data-view/view-presets/list/effect.js +4 -0
- package/dist/_pkgs/data-view/view-presets/list/index.d.ts +2 -0
- package/dist/_pkgs/data-view/view-presets/list/index.js +2 -0
- package/dist/_pkgs/data-view/view-presets/list/list-view.d.ts +24 -0
- package/dist/_pkgs/data-view/view-presets/list/list-view.js +194 -0
- package/dist/_pkgs/data-view/view-presets/list/renderer.d.ts +1 -0
- package/dist/_pkgs/data-view/view-presets/list/renderer.js +11 -0
- package/dist/_pkgs/data-view/view-presets/table/collapsed-state.d.ts +3 -14
- package/dist/_pkgs/data-view/view-presets/table/collapsed-state.js +6 -30
- package/dist/_pkgs/data-view/view-presets/table/consts.d.ts +2 -0
- package/dist/_pkgs/data-view/view-presets/table/consts.js +2 -0
- package/dist/_pkgs/data-view/view-presets/table/define.js +3 -1
- package/dist/_pkgs/data-view/view-presets/table/mobile/cell.js +4 -1
- package/dist/_pkgs/data-view/view-presets/table/mobile/column-header.js +2 -2
- package/dist/_pkgs/data-view/view-presets/table/mobile/group.d.ts +3 -1
- package/dist/_pkgs/data-view/view-presets/table/mobile/group.js +20 -5
- package/dist/_pkgs/data-view/view-presets/table/mobile/row.js +10 -2
- package/dist/_pkgs/data-view/view-presets/table/mobile/table-view-ui-logic.js +4 -1
- package/dist/_pkgs/data-view/view-presets/table/pc/cell.js +4 -1
- package/dist/_pkgs/data-view/view-presets/table/pc/controller/hotkeys.js +1 -1
- package/dist/_pkgs/data-view/view-presets/table/pc/group.d.ts +3 -1
- package/dist/_pkgs/data-view/view-presets/table/pc/group.js +20 -5
- package/dist/_pkgs/data-view/view-presets/table/pc/menu.d.ts +1 -1
- package/dist/_pkgs/data-view/view-presets/table/pc/menu.js +2 -1
- package/dist/_pkgs/data-view/view-presets/table/pc/row/row.js +3 -2
- package/dist/_pkgs/data-view/view-presets/table/pc/table-view-ui-logic.js +4 -1
- package/dist/_pkgs/data-view/view-presets/table/pc-virtual/controller/hotkeys.js +1 -1
- package/dist/_pkgs/data-view/view-presets/table/pc-virtual/group/bottom/stats/column-stats-column.js +5 -1
- package/dist/_pkgs/data-view/view-presets/table/pc-virtual/group/top/group-title.js +22 -19
- package/dist/_pkgs/data-view/view-presets/table/pc-virtual/row/cell.js +4 -1
- package/dist/_pkgs/data-view/view-presets/table/pc-virtual/table-view-ui-logic.js +7 -2
- package/dist/_pkgs/data-view/view-presets/table/stats/column-stats-column.js +5 -1
- package/dist/_pkgs/data-view/view-presets/table/table-view-manager.js +5 -53
- package/dist/_pkgs/data-view/widget-presets/tools/presets/table-add-row/add-row.d.ts +1 -0
- package/dist/_pkgs/data-view/widget-presets/tools/presets/table-add-row/add-row.js +60 -2
- package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/view-options.d.ts +18 -1
- package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/view-options.js +121 -124
- package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/view-settings.d.ts +43 -0
- package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/view-settings.js +187 -0
- package/dist/_pkgs/data-view/widget-presets/views-bar/views-view.d.ts +36 -3
- package/dist/_pkgs/data-view/widget-presets/views-bar/views-view.js +187 -59
- package/dist/extensions/view.d.ts +2 -2
- package/dist/extensions/view.js +10 -3
- package/dist/flags.d.ts +8 -4
- package/dist/flags.js +8 -4
- package/dist/frameworks.d.ts +27 -0
- package/dist/frameworks.js +28 -0
- package/dist/translations.js +13 -1
- package/package.json +5 -1
|
@@ -2,12 +2,13 @@ import { menu, popFilterableSimpleMenu, } from '../../../../affine-components/co
|
|
|
2
2
|
import { CopyIcon, DeleteIcon, ExpandFullIcon, MoveLeftIcon, MoveRightIcon, } from '@blocksuite/icons/lit';
|
|
3
3
|
import { html } from 'lit';
|
|
4
4
|
import { TableViewRowSelection } from '../selection.js';
|
|
5
|
-
export const openDetail = (tableViewLogic, rowId, selection) => {
|
|
5
|
+
export const openDetail = (tableViewLogic, rowId, selection, newTab = false) => {
|
|
6
6
|
const old = selection.selection;
|
|
7
7
|
selection.selection = undefined;
|
|
8
8
|
tableViewLogic.root.openDetailPanel({
|
|
9
9
|
view: selection.logic.view,
|
|
10
10
|
rowId: rowId,
|
|
11
|
+
newTab,
|
|
11
12
|
onClose: () => {
|
|
12
13
|
selection.selection = old;
|
|
13
14
|
},
|
|
@@ -44,6 +44,7 @@ import { styleMap } from 'lit/directives/style-map.js';
|
|
|
44
44
|
import { html } from 'lit/static-html.js';
|
|
45
45
|
import { TableViewRowSelection, } from '../../selection.js';
|
|
46
46
|
import { cellDivider } from '../../styles.js';
|
|
47
|
+
import { isNewTabClick } from '../../../../core/utils/new-tab-click.js';
|
|
47
48
|
import { openDetail, popRowMenu } from '../menu.js';
|
|
48
49
|
let TableRowView = (() => {
|
|
49
50
|
let _classSuper = SignalWatcher(WithDisposable(ShadowlessElement));
|
|
@@ -203,14 +204,14 @@ let TableRowView = (() => {
|
|
|
203
204
|
</div>
|
|
204
205
|
</div>`}
|
|
205
206
|
${repeat(view.properties$.value, v => v.id, (column, i) => {
|
|
206
|
-
const clickDetail = () => {
|
|
207
|
+
const clickDetail = (event) => {
|
|
207
208
|
if (!this.selectionController) {
|
|
208
209
|
return;
|
|
209
210
|
}
|
|
210
211
|
this.setSelection(TableViewRowSelection.create({
|
|
211
212
|
rows: [{ id: this.rowId, groupKey: this.groupKey }],
|
|
212
213
|
}));
|
|
213
|
-
openDetail(this.tableViewLogic, this.rowId, this.selectionController);
|
|
214
|
+
openDetail(this.tableViewLogic, this.rowId, this.selectionController, isNewTabClick(event));
|
|
214
215
|
};
|
|
215
216
|
const openMenu = (e) => {
|
|
216
217
|
if (!this.selectionController) {
|
|
@@ -116,7 +116,7 @@ export class TableViewUI extends DataViewUIBase {
|
|
|
116
116
|
this.dataset['testid'] = 'dv-table-view';
|
|
117
117
|
}
|
|
118
118
|
renderTable() {
|
|
119
|
-
const groups = this.logic.view.groupTrait.
|
|
119
|
+
const groups = this.logic.view.groupTrait.visibleGroups$.value;
|
|
120
120
|
if (groups) {
|
|
121
121
|
return html `
|
|
122
122
|
<div class="${tableGroupsContainerStyle}">
|
|
@@ -128,6 +128,9 @@ export class TableViewUI extends DataViewUIBase {
|
|
|
128
128
|
></affine-data-view-table-group>`;
|
|
129
129
|
})}
|
|
130
130
|
${this.logic.renderAddGroup(this.logic.view.groupTrait)}
|
|
131
|
+
<dv-hidden-groups
|
|
132
|
+
.groupTrait="${this.logic.view.groupTrait}"
|
|
133
|
+
></dv-hidden-groups>
|
|
131
134
|
</div>
|
|
132
135
|
`;
|
|
133
136
|
}
|
|
@@ -309,7 +309,7 @@ export class TableHotkeysController {
|
|
|
309
309
|
if (selection) {
|
|
310
310
|
context.get('keyboardState').raw.preventDefault();
|
|
311
311
|
this.selectionController.selection = TableViewRowSelection.create({
|
|
312
|
-
rows: this.logic.view.groupTrait.
|
|
312
|
+
rows: this.logic.view.groupTrait.visibleGroups$.value?.flatMap(group => group?.rows.map(row => ({
|
|
313
313
|
groupKey: group.key,
|
|
314
314
|
id: row.rowId,
|
|
315
315
|
})) ?? []) ??
|
package/dist/_pkgs/data-view/view-presets/table/pc-virtual/group/bottom/stats/column-stats-column.js
CHANGED
|
@@ -42,7 +42,7 @@ import { computed, signal } from '@preact/signals-core';
|
|
|
42
42
|
import { css, html } from 'lit';
|
|
43
43
|
import { property } from 'lit/decorators.js';
|
|
44
44
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
45
|
-
import { typeSystem } from '../../../../../../core/index.js';
|
|
45
|
+
import { typeSystem, VALUES_PENDING_MARK, valuesReady, } from '../../../../../../core/index.js';
|
|
46
46
|
import { statsFunctions } from '../../../../../../core/statistics/index.js';
|
|
47
47
|
const styles = css `
|
|
48
48
|
.stats-cell {
|
|
@@ -255,6 +255,10 @@ let VirtualDatabaseColumnStatsCell = (() => {
|
|
|
255
255
|
if (!func) {
|
|
256
256
|
return null;
|
|
257
257
|
}
|
|
258
|
+
const dataSource = this.column.view.manager.dataSource;
|
|
259
|
+
if (!valuesReady(dataSource)) {
|
|
260
|
+
return { name: func.displayName, value: VALUES_PENDING_MARK };
|
|
261
|
+
}
|
|
258
262
|
return {
|
|
259
263
|
name: func.displayName,
|
|
260
264
|
value: func.impl?.(this.values$.value, {
|
|
@@ -2,9 +2,12 @@ import { MoreHorizontalIcon, PlusIcon } from '@blocksuite/icons/lit';
|
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { nothing } from 'lit';
|
|
4
4
|
import { html } from 'lit/static-html.js';
|
|
5
|
-
import { renderUniLit, } from '../../../../../core/index.js';
|
|
5
|
+
import { renderUniLit, VALUES_PENDING_MARK, valuesReady, } from '../../../../../core/index.js';
|
|
6
6
|
import { groupHeaderCount, groupHeaderIcon, groupHeaderOp, groupHeaderOps, groupHeaderTitle, groupTitleRow, show, } from './group-title-css.js';
|
|
7
7
|
function GroupHeaderCount(group) {
|
|
8
|
+
if (!valuesReady(group.property.view.manager.dataSource)) {
|
|
9
|
+
return html ` <div class="${groupHeaderCount}">${VALUES_PENDING_MARK}</div>`;
|
|
10
|
+
}
|
|
8
11
|
const cards = group.rows;
|
|
9
12
|
if (!cards.length) {
|
|
10
13
|
return;
|
|
@@ -19,9 +22,9 @@ export const GroupTitle = (groupData, ops) => {
|
|
|
19
22
|
}
|
|
20
23
|
const icon = groupData.value == null
|
|
21
24
|
? ''
|
|
22
|
-
: html ` <uni-lit
|
|
23
|
-
class="${groupHeaderIcon}"
|
|
24
|
-
.uni="${groupData.property.icon}"
|
|
25
|
+
: html ` <uni-lit
|
|
26
|
+
class="${groupHeaderIcon}"
|
|
27
|
+
.uni="${groupData.property.icon}"
|
|
25
28
|
></uni-lit>`;
|
|
26
29
|
const props = {
|
|
27
30
|
group: groupData,
|
|
@@ -29,25 +32,25 @@ export const GroupTitle = (groupData, ops) => {
|
|
|
29
32
|
};
|
|
30
33
|
const showColumnName = groupData.property.type$.value === 'checkbox';
|
|
31
34
|
const columnName = showColumnName
|
|
32
|
-
? html `<span class="${groupHeaderTitle}"
|
|
33
|
-
>${groupData.property.name$.value}</span
|
|
35
|
+
? html `<span class="${groupHeaderTitle}"
|
|
36
|
+
>${groupData.property.name$.value}</span
|
|
34
37
|
>`
|
|
35
38
|
: nothing;
|
|
36
39
|
const opsClass = clsx(ops.groupHover && show, groupHeaderOps);
|
|
37
|
-
return html `
|
|
38
|
-
<div class="${groupTitleRow}">
|
|
39
|
-
${icon} ${renderUniLit(view, props)} ${columnName}
|
|
40
|
-
${GroupHeaderCount(groupData)}
|
|
41
|
-
</div>
|
|
40
|
+
return html `
|
|
41
|
+
<div class="${groupTitleRow}">
|
|
42
|
+
${icon} ${renderUniLit(view, props)} ${columnName}
|
|
43
|
+
${GroupHeaderCount(groupData)}
|
|
44
|
+
</div>
|
|
42
45
|
${!ops.readonly
|
|
43
|
-
? html ` <div class="${opsClass}">
|
|
44
|
-
<div @click="${ops.clickAdd}" class="${groupHeaderOp}">
|
|
45
|
-
${PlusIcon()}
|
|
46
|
-
</div>
|
|
47
|
-
<div @click="${ops.clickOps}" class="${groupHeaderOp}">
|
|
48
|
-
${MoreHorizontalIcon()}
|
|
49
|
-
</div>
|
|
46
|
+
? html ` <div class="${opsClass}">
|
|
47
|
+
<div @click="${ops.clickAdd}" class="${groupHeaderOp}">
|
|
48
|
+
${PlusIcon()}
|
|
49
|
+
</div>
|
|
50
|
+
<div @click="${ops.clickOps}" class="${groupHeaderOp}">
|
|
51
|
+
${MoreHorizontalIcon()}
|
|
52
|
+
</div>
|
|
50
53
|
</div>`
|
|
51
|
-
: nothing}
|
|
54
|
+
: nothing}
|
|
52
55
|
`;
|
|
53
56
|
};
|
|
@@ -38,7 +38,7 @@ import { ShadowlessElement } from '../../../../../std/index.js';
|
|
|
38
38
|
import { computed, effect, signal } from '@preact/signals-core';
|
|
39
39
|
import { css } from 'lit';
|
|
40
40
|
import { property } from 'lit/decorators.js';
|
|
41
|
-
import { renderUniLit } from '../../../../core/index.js';
|
|
41
|
+
import { renderCellStatus, renderUniLit } from '../../../../core/index.js';
|
|
42
42
|
import { TableViewAreaSelection, TableViewRowSelection, } from '../../selection.js';
|
|
43
43
|
import { popRowMenu } from './menu.js';
|
|
44
44
|
import { rowSelectedBg } from './row-header-css.js';
|
|
@@ -133,6 +133,9 @@ let DatabaseCellContainer = (() => {
|
|
|
133
133
|
return;
|
|
134
134
|
}
|
|
135
135
|
const { view } = renderer;
|
|
136
|
+
const status = renderCellStatus(this.cell$.value);
|
|
137
|
+
if (status)
|
|
138
|
+
return status;
|
|
136
139
|
this.view.lockRows(this.isEditing$.value);
|
|
137
140
|
this.dataset['editing'] = `${this.isEditing$.value}`;
|
|
138
141
|
const props = {
|
|
@@ -51,7 +51,12 @@ export class VirtualTableViewUILogic extends DataViewUILogicBase {
|
|
|
51
51
|
});
|
|
52
52
|
this.groups$ = computed(() => {
|
|
53
53
|
const groupTrait = this.groupTrait$.value;
|
|
54
|
-
|
|
54
|
+
// ponytail: the virtual grid drops hidden groups but lists none at its
|
|
55
|
+
// end and folds nothing (B8); it is off by default
|
|
56
|
+
// (`enable_table_virtual_scroll`). Upgrade: a last grid row drawing
|
|
57
|
+
// <dv-hidden-groups>, and the fold of `TableGroup` in its group header.
|
|
58
|
+
const groups = groupTrait?.visibleGroups$.value;
|
|
59
|
+
if (!groups) {
|
|
55
60
|
return [
|
|
56
61
|
{
|
|
57
62
|
id: '',
|
|
@@ -59,7 +64,7 @@ export class VirtualTableViewUILogic extends DataViewUILogicBase {
|
|
|
59
64
|
},
|
|
60
65
|
];
|
|
61
66
|
}
|
|
62
|
-
return
|
|
67
|
+
return groups.map(group => ({
|
|
63
68
|
id: group.key,
|
|
64
69
|
rows: group.rows.map(v => v.rowId),
|
|
65
70
|
}));
|
|
@@ -42,7 +42,7 @@ import { computed, signal } from '@preact/signals-core';
|
|
|
42
42
|
import { css, html } from 'lit';
|
|
43
43
|
import { property } from 'lit/decorators.js';
|
|
44
44
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
45
|
-
import { typeSystem } from '../../../core/index.js';
|
|
45
|
+
import { typeSystem, VALUES_PENDING_MARK, valuesReady, } from '../../../core/index.js';
|
|
46
46
|
import { statsFunctions } from '../../../core/statistics/index.js';
|
|
47
47
|
const styles = css `
|
|
48
48
|
.stats-cell {
|
|
@@ -255,6 +255,10 @@ let DatabaseColumnStatsCell = (() => {
|
|
|
255
255
|
if (!func) {
|
|
256
256
|
return null;
|
|
257
257
|
}
|
|
258
|
+
const dataSource = this.column.view.manager.dataSource;
|
|
259
|
+
if (!valuesReady(dataSource)) {
|
|
260
|
+
return { name: func.displayName, value: VALUES_PENDING_MARK };
|
|
261
|
+
}
|
|
258
262
|
return {
|
|
259
263
|
name: func.displayName,
|
|
260
264
|
value: func.impl?.(this.values$.value, {
|
|
@@ -4,7 +4,8 @@ import { evalFilter } from '../../core/filter/eval.js';
|
|
|
4
4
|
import { generateDefaultValues } from '../../core/filter/generate-default-values.js';
|
|
5
5
|
import { FilterTrait, filterTraitKey } from '../../core/filter/trait.js';
|
|
6
6
|
import { emptyFilterGroup } from '../../core/filter/utils.js';
|
|
7
|
-
import {
|
|
7
|
+
import { groupPropertiesOps } from '../../core/group-by/group-properties.js';
|
|
8
|
+
import { GroupTrait, groupTraitKey } from '../../core/group-by/trait.js';
|
|
8
9
|
import { fromJson } from '../../core/property/utils.js';
|
|
9
10
|
import { SortManager, sortTraitKey } from '../../core/sort/manager.js';
|
|
10
11
|
import { PropertyBase } from '../../core/view-manager/property.js';
|
|
@@ -79,58 +80,9 @@ export class TableSingleView extends SingleViewBase {
|
|
|
79
80
|
};
|
|
80
81
|
});
|
|
81
82
|
},
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
return sortByManually(rows, v => v.rowId, property?.manuallyCardSort ?? []);
|
|
86
|
-
},
|
|
87
|
-
changeGroupSort: keys => {
|
|
88
|
-
const map = new Map(this.groupProperties.map(v => [v.key, v]));
|
|
89
|
-
this.dataUpdate(() => {
|
|
90
|
-
return {
|
|
91
|
-
groupProperties: keys.map(key => {
|
|
92
|
-
const property = map.get(key);
|
|
93
|
-
if (property) {
|
|
94
|
-
return property;
|
|
95
|
-
}
|
|
96
|
-
return {
|
|
97
|
-
key,
|
|
98
|
-
hide: false,
|
|
99
|
-
manuallyCardSort: [],
|
|
100
|
-
};
|
|
101
|
-
}),
|
|
102
|
-
};
|
|
103
|
-
});
|
|
104
|
-
},
|
|
105
|
-
changeRowSort: (groupKeys, groupKey, keys) => {
|
|
106
|
-
const map = new Map(this.groupProperties.map(v => [v.key, v]));
|
|
107
|
-
this.dataUpdate(() => {
|
|
108
|
-
return {
|
|
109
|
-
groupProperties: groupKeys.map(key => {
|
|
110
|
-
if (key === groupKey) {
|
|
111
|
-
const group = map.get(key);
|
|
112
|
-
return group
|
|
113
|
-
? {
|
|
114
|
-
...group,
|
|
115
|
-
manuallyCardSort: keys,
|
|
116
|
-
}
|
|
117
|
-
: {
|
|
118
|
-
key,
|
|
119
|
-
hide: false,
|
|
120
|
-
manuallyCardSort: keys,
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
else {
|
|
124
|
-
return (map.get(key) ?? {
|
|
125
|
-
key,
|
|
126
|
-
hide: false,
|
|
127
|
-
manuallyCardSort: [],
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
}),
|
|
131
|
-
};
|
|
132
|
-
});
|
|
133
|
-
},
|
|
83
|
+
...groupPropertiesOps(() => this.groupProperties, groupProperties => {
|
|
84
|
+
this.dataUpdate(() => ({ groupProperties }));
|
|
85
|
+
}),
|
|
134
86
|
}));
|
|
135
87
|
this.mainProperties$ = computed(() => {
|
|
136
88
|
return (this.data$.value?.header ?? {
|
|
@@ -2,6 +2,7 @@ import { WidgetBase } from '../../../../core/widget/widget-base.js';
|
|
|
2
2
|
export declare class DataViewHeaderToolsAddRow extends WidgetBase {
|
|
3
3
|
static styles: import("lit").CSSResult;
|
|
4
4
|
private readonly onAddNewRecord;
|
|
5
|
+
private readonly onOpenMenu;
|
|
5
6
|
private get readonly$();
|
|
6
7
|
render(): import("lit-html").TemplateResult<1> | undefined;
|
|
7
8
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { unsafeCSSVarV2 } from '../../../../../affine-shared/theme/index.js';
|
|
2
2
|
import { IS_MOBILE } from '../../../../../global/env/index.js';
|
|
3
|
-
import { PlusIcon } from '@blocksuite/icons/lit';
|
|
3
|
+
import { ArrowDownSmallIcon, PlusIcon } from '@blocksuite/icons/lit';
|
|
4
4
|
import { css, html } from 'lit';
|
|
5
|
+
import { NewRowMenuOpenerKey } from '../../../../core/view-manager/new-row-menu-opener.js';
|
|
5
6
|
import { WidgetBase } from '../../../../core/widget/widget-base.js';
|
|
6
7
|
const styles = css `
|
|
7
8
|
.new-record {
|
|
@@ -12,6 +13,37 @@ const styles = css `
|
|
|
12
13
|
font-size: 20px;
|
|
13
14
|
color: ${unsafeCSSVarV2('icon/primary')};
|
|
14
15
|
}
|
|
16
|
+
|
|
17
|
+
/* A split button only when the host offers a menu beside "New"
|
|
18
|
+
(NewRowMenuOpenerKey): without it, the single button above. */
|
|
19
|
+
.new-record-split {
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: stretch;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.new-record-split .new-record {
|
|
25
|
+
border-top-right-radius: 0;
|
|
26
|
+
border-bottom-right-radius: 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.new-record-split .new-record-more {
|
|
30
|
+
border-left: none;
|
|
31
|
+
border-top-left-radius: 0;
|
|
32
|
+
border-bottom-left-radius: 0;
|
|
33
|
+
padding: 4px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@media (pointer: coarse) {
|
|
37
|
+
.new-record-split .new-record,
|
|
38
|
+
.new-record-split .new-record-more {
|
|
39
|
+
min-height: 44px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.new-record-split .new-record-more {
|
|
43
|
+
min-width: 44px;
|
|
44
|
+
justify-content: center;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
15
47
|
`;
|
|
16
48
|
export class DataViewHeaderToolsAddRow extends WidgetBase {
|
|
17
49
|
constructor() {
|
|
@@ -21,6 +53,14 @@ export class DataViewHeaderToolsAddRow extends WidgetBase {
|
|
|
21
53
|
return;
|
|
22
54
|
this.dataViewLogic.addRow?.('start');
|
|
23
55
|
};
|
|
56
|
+
this.onOpenMenu = (event) => {
|
|
57
|
+
event.stopPropagation();
|
|
58
|
+
if (this.readonly$.value)
|
|
59
|
+
return;
|
|
60
|
+
this.view
|
|
61
|
+
.serviceGet(NewRowMenuOpenerKey)
|
|
62
|
+
?.open(event.currentTarget, this.view.id);
|
|
63
|
+
};
|
|
24
64
|
}
|
|
25
65
|
static { this.styles = styles; }
|
|
26
66
|
get readonly$() {
|
|
@@ -30,7 +70,7 @@ export class DataViewHeaderToolsAddRow extends WidgetBase {
|
|
|
30
70
|
if (this.readonly$.value) {
|
|
31
71
|
return;
|
|
32
72
|
}
|
|
33
|
-
|
|
73
|
+
const button = html ` <data-view-component-button
|
|
34
74
|
class="affine-database-toolbar-item new-record"
|
|
35
75
|
.onClick="${this.onAddNewRecord}"
|
|
36
76
|
.icon="${PlusIcon()}"
|
|
@@ -39,5 +79,23 @@ export class DataViewHeaderToolsAddRow extends WidgetBase {
|
|
|
39
79
|
: html `<span style="font-weight: 500">New Record</span>`}"
|
|
40
80
|
>
|
|
41
81
|
</data-view-component-button>`;
|
|
82
|
+
const opener = this.view.serviceGet(NewRowMenuOpenerKey);
|
|
83
|
+
if (!opener || opener.canOpen?.(this.view.id) === false)
|
|
84
|
+
return button;
|
|
85
|
+
const label = opener.label();
|
|
86
|
+
return html `<div class="new-record-split">
|
|
87
|
+
${button}
|
|
88
|
+
<data-view-component-button
|
|
89
|
+
class="affine-database-toolbar-item new-record-more"
|
|
90
|
+
data-testid="database-new-record-more"
|
|
91
|
+
role="button"
|
|
92
|
+
aria-haspopup="menu"
|
|
93
|
+
aria-label="${label}"
|
|
94
|
+
title="${label}"
|
|
95
|
+
.onClick="${this.onOpenMenu}"
|
|
96
|
+
.icon="${ArrowDownSmallIcon()}"
|
|
97
|
+
>
|
|
98
|
+
</data-view-component-button>
|
|
99
|
+
</div>`;
|
|
42
100
|
}
|
|
43
101
|
}
|
|
@@ -1,10 +1,27 @@
|
|
|
1
1
|
import { type PopupTarget } from '../../../../../affine-components/context-menu/index.js';
|
|
2
|
+
import { type BlockStdScope } from '../../../../../std/index.js';
|
|
2
3
|
import { type DataViewUILogicBase } from '../../../../core/index.js';
|
|
4
|
+
import { type Wording } from '../../../../core/utils/wording.js';
|
|
3
5
|
import { WidgetBase } from '../../../../core/widget/widget-base.js';
|
|
6
|
+
import { type ViewSettingKey } from './view-settings.js';
|
|
4
7
|
export declare class DataViewHeaderToolsViewOptions extends WidgetBase {
|
|
5
8
|
static styles: import("lit").CSSResult;
|
|
9
|
+
/** Absent outside an editor host: the wordings read English. */
|
|
10
|
+
accessor std: BlockStdScope;
|
|
6
11
|
clickMoreAction: (e: MouseEvent) => void;
|
|
7
12
|
openMoreAction: (target: PopupTarget) => void;
|
|
13
|
+
/**
|
|
14
|
+
* Whether the current view offers setting `key` now (labre PRD REQ-DB-10:
|
|
15
|
+
* what a host's "This view" menu lists for the full page of a database).
|
|
16
|
+
*/
|
|
17
|
+
settingAvailable(key: ViewSettingKey): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Open the menu of one setting of the current view, anchored on this
|
|
20
|
+
* button, its "back" leading to the view settings: the entry the view
|
|
21
|
+
* settings menu would open, for a caller outside it (a host's menu, through
|
|
22
|
+
* the database page's view-menu commands). Nothing when not offered.
|
|
23
|
+
*/
|
|
24
|
+
openSetting(key: ViewSettingKey): void;
|
|
8
25
|
render(): import("lit-html").TemplateResult<1> | undefined;
|
|
9
26
|
}
|
|
10
27
|
declare global {
|
|
@@ -12,4 +29,4 @@ declare global {
|
|
|
12
29
|
'data-view-header-tools-view-options': DataViewHeaderToolsViewOptions;
|
|
13
30
|
}
|
|
14
31
|
}
|
|
15
|
-
export declare const popViewOptions: (target: PopupTarget, dataViewLogic: DataViewUILogicBase, onClose?: () => void) => void;
|
|
32
|
+
export declare const popViewOptions: (target: PopupTarget, dataViewLogic: DataViewUILogicBase, onClose?: () => void, wording?: Wording) => void;
|