@formicoidea/labre-core 0.53.0 → 0.55.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/data-view-block.js +1 -1
- package/dist/_pkgs/affine-block-database/components/title/index.js +7 -2
- package/dist/_pkgs/affine-block-database/database-block-styles.js +9 -1
- package/dist/_pkgs/affine-block-embed-doc/page-drop/page-drop.d.ts +70 -0
- package/dist/_pkgs/affine-block-embed-doc/page-drop/page-drop.js +196 -0
- package/dist/_pkgs/affine-block-embed-doc/view.js +3 -0
- package/dist/_pkgs/affine-block-frame/frame-template.d.ts +11 -0
- package/dist/_pkgs/affine-block-frame/frame-template.js +24 -4
- package/dist/_pkgs/affine-block-frame/translations.d.ts +3 -0
- package/dist/_pkgs/affine-block-frame/translations.js +7 -0
- package/dist/_pkgs/affine-block-surface/extensions/export-svg/render.js +9 -3
- package/dist/_pkgs/affine-block-surface/framework-background/renderer.js +9 -5
- package/dist/_pkgs/affine-block-surface/index.d.ts +1 -0
- package/dist/_pkgs/affine-block-surface/index.js +1 -0
- package/dist/_pkgs/affine-block-surface/renderer/canvas-renderer.d.ts +55 -3
- package/dist/_pkgs/affine-block-surface/renderer/canvas-renderer.js +139 -6
- package/dist/_pkgs/affine-block-surface/renderer/notation-tint.d.ts +92 -0
- package/dist/_pkgs/affine-block-surface/renderer/notation-tint.js +113 -0
- package/dist/_pkgs/affine-block-surface/surface-block.js +2 -2
- package/dist/_pkgs/affine-components/color-picker/styles.js +1 -1
- package/dist/_pkgs/affine-components/context-menu/input.js +2 -1
- package/dist/_pkgs/affine-components/context-menu/menu-renderer.d.ts +7 -0
- package/dist/_pkgs/affine-components/context-menu/menu-renderer.js +53 -13
- package/dist/_pkgs/affine-components/drop-indicator/file-drop-manager.js +15 -0
- package/dist/_pkgs/affine-gfx-shape/element-renderer/shape/index.js +4 -2
- package/dist/_pkgs/affine-inline-link/link-node/link-popup/styles.js +1 -1
- package/dist/_pkgs/affine-inline-reference/reference-node/reference-popup/reference-popup.js +9 -9
- package/dist/_pkgs/affine-shared/consts/notation.d.ts +1 -0
- package/dist/_pkgs/affine-shared/consts/notation.js +29 -0
- package/dist/_pkgs/affine-shared/services/frame-template-service.d.ts +5 -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/page-drop-service.d.ts +61 -0
- package/dist/_pkgs/affine-shared/services/page-drop-service.js +30 -0
- package/dist/_pkgs/affine-shared/styles/scrollbar-style.js +1 -1
- package/dist/_pkgs/affine-widget-edgeless-auto-connect/index.js +5 -5
- package/dist/_pkgs/affine-widget-edgeless-selected-rect/edgeless-auto-complete.js +2 -2
- package/dist/_pkgs/affine-widget-keyboard-toolbar/config.js +6 -6
- package/dist/_pkgs/affine-widget-keyboard-toolbar/styles.js +1 -1
- package/dist/_pkgs/affine-widget-linked-doc/config.d.ts +8 -0
- package/dist/_pkgs/affine-widget-linked-doc/config.js +8 -1
- package/dist/_pkgs/affine-widget-linked-doc/linked-doc-popover.js +40 -32
- package/dist/_pkgs/affine-widget-linked-doc/styles.js +1 -1
- package/dist/_pkgs/affine-widget-linked-doc/translations.d.ts +2 -0
- package/dist/_pkgs/affine-widget-linked-doc/translations.js +6 -0
- package/dist/_pkgs/affine-widget-thread-marks/widget.d.ts +3 -1
- package/dist/_pkgs/affine-widget-thread-marks/widget.js +6 -1
- package/dist/_pkgs/affine-widget-toolbar/utils.d.ts +2 -1
- package/dist/_pkgs/affine-widget-toolbar/utils.js +5 -2
- package/dist/_pkgs/data-view/core/common/properties.js +2 -2
- package/dist/_pkgs/data-view/core/common/property-menu.d.ts +3 -3
- package/dist/_pkgs/data-view/core/common/property-menu.js +7 -7
- package/dist/_pkgs/data-view/core/component/overflow/overflow.js +4 -1
- package/dist/_pkgs/data-view/core/group-by/renderer/base.d.ts +4 -1
- package/dist/_pkgs/data-view/core/group-by/renderer/base.js +17 -2
- package/dist/_pkgs/data-view/core/group-by/renderer/number-group.js +1 -1
- package/dist/_pkgs/data-view/core/group-by/renderer/select-group.d.ts +0 -3
- package/dist/_pkgs/data-view/core/group-by/renderer/select-group.js +63 -118
- package/dist/_pkgs/data-view/core/group-by/renderer/string-group.js +1 -1
- package/dist/_pkgs/data-view/core/group-by/setting.js +2 -2
- package/dist/_pkgs/data-view/core/utils/wording.d.ts +6 -2
- package/dist/_pkgs/data-view/core/utils/wording.js +5 -3
- package/dist/_pkgs/data-view/core/view/default-name.d.ts +6 -0
- package/dist/_pkgs/data-view/core/view/default-name.js +8 -0
- package/dist/_pkgs/data-view/translations.d.ts +45 -0
- package/dist/_pkgs/data-view/translations.js +118 -0
- package/dist/_pkgs/data-view/view-presets/flat/flat-view-ui.d.ts +3 -1
- package/dist/_pkgs/data-view/view-presets/flat/flat-view-ui.js +5 -1
- package/dist/_pkgs/data-view/view-presets/kanban/mobile/card.d.ts +6 -0
- package/dist/_pkgs/data-view/view-presets/kanban/mobile/card.js +11 -0
- package/dist/_pkgs/data-view/view-presets/kanban/mobile/cell.js +9 -10
- package/dist/_pkgs/data-view/view-presets/kanban/mobile/kanban-view-ui-logic.js +3 -0
- package/dist/_pkgs/data-view/view-presets/table/mobile/cell.js +7 -4
- package/dist/_pkgs/data-view/view-presets/table/mobile/column-header.d.ts +3 -1
- package/dist/_pkgs/data-view/view-presets/table/mobile/column-header.js +102 -124
- package/dist/_pkgs/data-view/view-presets/table/mobile/group.js +12 -7
- package/dist/_pkgs/data-view/view-presets/table/mobile/header.d.ts +8 -2
- package/dist/_pkgs/data-view/view-presets/table/mobile/header.js +64 -24
- package/dist/_pkgs/data-view/view-presets/table/mobile/menu.d.ts +3 -1
- package/dist/_pkgs/data-view/view-presets/table/mobile/menu.js +7 -3
- package/dist/_pkgs/data-view/view-presets/table/mobile/row.d.ts +23 -1
- package/dist/_pkgs/data-view/view-presets/table/mobile/row.js +138 -55
- package/dist/_pkgs/data-view/view-presets/table/mobile/table-view-style.d.ts +17 -0
- package/dist/_pkgs/data-view/view-presets/table/mobile/table-view-style.js +31 -6
- package/dist/_pkgs/data-view/view-presets/table/mobile/table-view-ui-logic.d.ts +5 -1
- package/dist/_pkgs/data-view/view-presets/table/mobile/table-view-ui-logic.js +11 -4
- package/dist/_pkgs/data-view/view-presets/table/pc/group.js +4 -2
- package/dist/_pkgs/data-view/view-presets/table/pc/row/row.js +5 -1
- package/dist/_pkgs/data-view/widget-presets/quick-setting-bar/filter/index.js +1 -2
- package/dist/_pkgs/data-view/widget-presets/quick-setting-bar/filter/list-view.d.ts +3 -1
- package/dist/_pkgs/data-view/widget-presets/quick-setting-bar/filter/list-view.js +23 -3
- package/dist/_pkgs/data-view/widget-presets/quick-setting-bar/index.js +8 -8
- package/dist/_pkgs/data-view/widget-presets/tools/presets/filter/filter.d.ts +3 -0
- package/dist/_pkgs/data-view/widget-presets/tools/presets/filter/filter.js +125 -60
- package/dist/_pkgs/data-view/widget-presets/tools/presets/search/search.d.ts +3 -0
- package/dist/_pkgs/data-view/widget-presets/tools/presets/search/search.js +37 -5
- package/dist/_pkgs/data-view/widget-presets/tools/presets/sort/sort.d.ts +3 -0
- package/dist/_pkgs/data-view/widget-presets/tools/presets/sort/sort.js +131 -66
- package/dist/_pkgs/data-view/widget-presets/tools/presets/table-add-row/add-row.d.ts +3 -0
- package/dist/_pkgs/data-view/widget-presets/tools/presets/table-add-row/add-row.js +143 -40
- package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/view-options.js +30 -22
- package/dist/_pkgs/data-view/widget-presets/tools/presets/view-options/view-settings.js +8 -6
- package/dist/_pkgs/data-view/widget-presets/views-bar/views-view.js +15 -0
- package/package.json +1 -1
|
@@ -36,7 +36,9 @@ export declare abstract class FlatViewUI<Logic extends FlatViewUILogic = FlatVie
|
|
|
36
36
|
/**
|
|
37
37
|
* One property's value, drawn and edited by the cell renderer a table cell
|
|
38
38
|
* mounts. `readonly` draws the value only and lets a click through to the
|
|
39
|
-
* card or row, which is how the title opens its row.
|
|
39
|
+
* card or row, which is how the title opens its row. On a phone every value
|
|
40
|
+
* is drawn so: a tap on a card or a row opens it, its values are edited in
|
|
41
|
+
* the row page (P7, after Notion's phone gallery and list).
|
|
40
42
|
*/
|
|
41
43
|
protected renderCell(property: Property, rowId: string, readonly?: boolean): import("lit-html").TemplateResult<1>;
|
|
42
44
|
protected renderOpenButton(rowId: string): import("lit-html").TemplateResult<1>;
|
|
@@ -35,6 +35,7 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
35
35
|
import { popFilterableSimpleMenu, popupTargetFromElement, } from '../../../affine-components/context-menu/index.js';
|
|
36
36
|
import { translateKey } from '../../../affine-shared/services/index.js';
|
|
37
37
|
import { OPEN_LABEL } from '../../../affine-components/translations.js';
|
|
38
|
+
import { IS_MOBILE } from '../../../global/env/index.js';
|
|
38
39
|
import { CenterPeekIcon } from '@blocksuite/icons/lit';
|
|
39
40
|
import { stdContext } from '../../../std/index.js';
|
|
40
41
|
import { consume } from '@lit/context';
|
|
@@ -112,7 +113,9 @@ let FlatViewUI = (() => {
|
|
|
112
113
|
/**
|
|
113
114
|
* One property's value, drawn and edited by the cell renderer a table cell
|
|
114
115
|
* mounts. `readonly` draws the value only and lets a click through to the
|
|
115
|
-
* card or row, which is how the title opens its row.
|
|
116
|
+
* card or row, which is how the title opens its row. On a phone every value
|
|
117
|
+
* is drawn so: a tap on a card or a row opens it, its values are edited in
|
|
118
|
+
* the row page (P7, after Notion's phone gallery and list).
|
|
116
119
|
*/
|
|
117
120
|
renderCell(property, rowId, readonly = false) {
|
|
118
121
|
const view = this.view;
|
|
@@ -127,6 +130,7 @@ let FlatViewUI = (() => {
|
|
|
127
130
|
data-property-id="${property.id}"
|
|
128
131
|
.cell="${cell}"
|
|
129
132
|
.readonly="${readonly ||
|
|
133
|
+
IS_MOBILE ||
|
|
130
134
|
view.readonly$.value ||
|
|
131
135
|
property.readonly$.value}"
|
|
132
136
|
.onEditingChange="${(editing) => view.lockRows(editing)}"
|
|
@@ -4,6 +4,12 @@ declare const MobileKanbanCard_base: typeof ShadowlessElement & import("../../..
|
|
|
4
4
|
export declare class MobileKanbanCard extends MobileKanbanCard_base {
|
|
5
5
|
static styles: import("lit").CSSResult;
|
|
6
6
|
private readonly clickCenterPeek;
|
|
7
|
+
/**
|
|
8
|
+
* A tap on a phone's card opens its row, the path of the open button, as on
|
|
9
|
+
* Notion's phone board (P7); its "..." keeps the card's menu.
|
|
10
|
+
*/
|
|
11
|
+
private readonly openCard;
|
|
12
|
+
connectedCallback(): void;
|
|
7
13
|
private readonly clickMore;
|
|
8
14
|
private renderBody;
|
|
9
15
|
private renderHeader;
|
|
@@ -155,6 +155,10 @@ let MobileKanbanCard = (() => {
|
|
|
155
155
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
156
156
|
}
|
|
157
157
|
static { this.styles = styles; }
|
|
158
|
+
connectedCallback() {
|
|
159
|
+
super.connectedCallback();
|
|
160
|
+
this.disposables.addFromEvent(this, 'click', this.openCard);
|
|
161
|
+
}
|
|
158
162
|
renderBody(columns) {
|
|
159
163
|
if (columns.length === 0) {
|
|
160
164
|
return '';
|
|
@@ -254,6 +258,13 @@ let MobileKanbanCard = (() => {
|
|
|
254
258
|
super(...arguments);
|
|
255
259
|
this.clickCenterPeek = (e) => {
|
|
256
260
|
e.stopPropagation();
|
|
261
|
+
this.openCard();
|
|
262
|
+
};
|
|
263
|
+
/**
|
|
264
|
+
* A tap on a phone's card opens its row, the path of the open button, as on
|
|
265
|
+
* Notion's phone board (P7); its "..." keeps the card's menu.
|
|
266
|
+
*/
|
|
267
|
+
this.openCard = () => {
|
|
257
268
|
this.kanbanViewLogic.root.openDetailPanel({
|
|
258
269
|
view: this.view,
|
|
259
270
|
rowId: this.cardId,
|
|
@@ -124,12 +124,8 @@ let MobileKanbanCell = (() => {
|
|
|
124
124
|
this.isEditing$.value = false;
|
|
125
125
|
}
|
|
126
126
|
}));
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
if (!this.isEditing$.value) {
|
|
130
|
-
this.selectCurrentCell(!this.column.readonly$.value);
|
|
131
|
-
}
|
|
132
|
-
});
|
|
127
|
+
// No tap-to-edit here: a tap anywhere on a phone's card opens the row
|
|
128
|
+
// (`MobileKanbanCard`), where its values are edited (P7, after Notion).
|
|
133
129
|
}
|
|
134
130
|
render() {
|
|
135
131
|
const props = {
|
|
@@ -203,13 +199,16 @@ let MobileKanbanCell = (() => {
|
|
|
203
199
|
if (this.view.readonly$.value) {
|
|
204
200
|
return;
|
|
205
201
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
202
|
+
// Called on the logic, never detached: `setSelection` is a method of
|
|
203
|
+
// `DataViewUILogicBase`, and up to 0.54 a detached call threw on every
|
|
204
|
+
// tap, so no value of a phone card ever entered editing.
|
|
205
|
+
const logic = this.kanbanViewLogic;
|
|
206
|
+
const viewId = logic.view.id;
|
|
207
|
+
if (viewId) {
|
|
209
208
|
if (editing && this.cell?.beforeEnterEditMode() === false) {
|
|
210
209
|
return;
|
|
211
210
|
}
|
|
212
|
-
setSelection({
|
|
211
|
+
logic.setSelection({
|
|
213
212
|
viewId,
|
|
214
213
|
type: 'kanban',
|
|
215
214
|
selectionType: 'cell',
|
|
@@ -43,6 +43,9 @@ export class MobileKanbanViewUILogic extends DataViewUILogicBase {
|
|
|
43
43
|
return;
|
|
44
44
|
const id = this.view.rowAdd(position);
|
|
45
45
|
this.ui$.value?.requestUpdate();
|
|
46
|
+
// The toolbar's "+" opens the new card, as on the desktop board (P7).
|
|
47
|
+
if (id)
|
|
48
|
+
this.root.openDetailPanel({ view: this.view, rowId: id });
|
|
46
49
|
return id;
|
|
47
50
|
};
|
|
48
51
|
this.focusFirstCell = () => { };
|
|
@@ -196,13 +196,16 @@ let MobileTableCell = (() => {
|
|
|
196
196
|
if (this.view.readonly$.value) {
|
|
197
197
|
return;
|
|
198
198
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
199
|
+
// Called on the logic, never detached: `setSelection` is a method of
|
|
200
|
+
// `DataViewUILogicBase`, and up to 0.54 a detached call threw on every
|
|
201
|
+
// tap, so no cell of a phone table ever entered editing.
|
|
202
|
+
const logic = this.tableViewLogic;
|
|
203
|
+
const viewId = logic.view.id;
|
|
204
|
+
if (viewId) {
|
|
202
205
|
if (editing && this.cell?.beforeEnterEditMode() === false) {
|
|
203
206
|
return;
|
|
204
207
|
}
|
|
205
|
-
setSelection({
|
|
208
|
+
logic.setSelection({
|
|
206
209
|
viewId,
|
|
207
210
|
type: 'table',
|
|
208
211
|
...TableViewAreaSelection.create({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ShadowlessElement } from '../../../../std/index.js';
|
|
1
|
+
import { type BlockStdScope, ShadowlessElement } from '../../../../std/index.js';
|
|
2
2
|
import type { TableProperty, TableSingleView } from '../table-view-manager.js';
|
|
3
3
|
declare const MobileTableColumnHeader_base: typeof ShadowlessElement & import("../../../../global/utils/types.js").Constructor<import("../../../../global/lit/with-disposable.js").DisposableClass>;
|
|
4
4
|
export declare class MobileTableColumnHeader extends MobileTableColumnHeader_base {
|
|
@@ -7,6 +7,8 @@ export declare class MobileTableColumnHeader extends MobileTableColumnHeader_bas
|
|
|
7
7
|
editTitle: () => void;
|
|
8
8
|
private popMenu;
|
|
9
9
|
render(): import("lit-html").TemplateResult;
|
|
10
|
+
/** Absent outside an editor host: the menu reads English. */
|
|
11
|
+
accessor std: BlockStdScope;
|
|
10
12
|
accessor column: TableProperty;
|
|
11
13
|
accessor tableViewManager: TableSingleView;
|
|
12
14
|
}
|
|
@@ -35,17 +35,23 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
35
35
|
import { menu, popMenu, popupTargetFromElement, } from '../../../../affine-components/context-menu/index.js';
|
|
36
36
|
import { unsafeCSSVarV2 } from '../../../../affine-shared/theme/index.js';
|
|
37
37
|
import { SignalWatcher, WithDisposable } from '../../../../global/lit/index.js';
|
|
38
|
-
import {
|
|
39
|
-
import { ShadowlessElement } from '../../../../std/index.js';
|
|
38
|
+
import { InsertLeftIcon, InsertRightIcon, MoveLeftIcon, MoveRightIcon, } from '@blocksuite/icons/lit';
|
|
39
|
+
import { ShadowlessElement, stdContext } from '../../../../std/index.js';
|
|
40
|
+
import { consume } from '@lit/context';
|
|
40
41
|
import { css } from 'lit';
|
|
41
42
|
import { property } from 'lit/decorators.js';
|
|
42
43
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
43
44
|
import { html } from 'lit/static-html.js';
|
|
44
|
-
import {
|
|
45
|
+
import { propertyMenuItems } from '../../../core/common/property-menu.js';
|
|
46
|
+
import { wordingOf } from '../../../core/utils/wording.js';
|
|
45
47
|
import { numberFormats } from '../../../property-presets/number/utils/formats.js';
|
|
48
|
+
import { DATA_VIEW_INSERT_LEFT, DATA_VIEW_INSERT_RIGHT, DATA_VIEW_PROPERTY_SETTINGS, VIEWS_BAR_MOVE_LEFT, VIEWS_BAR_MOVE_RIGHT, } from '../../../translations.js';
|
|
46
49
|
import { MOBILE_TOUCH_TARGET } from '../consts.js';
|
|
47
50
|
let MobileTableColumnHeader = (() => {
|
|
48
51
|
let _classSuper = SignalWatcher(WithDisposable(ShadowlessElement));
|
|
52
|
+
let _std_decorators;
|
|
53
|
+
let _std_initializers = [];
|
|
54
|
+
let _std_extraInitializers = [];
|
|
49
55
|
let _column_decorators;
|
|
50
56
|
let _column_initializers = [];
|
|
51
57
|
let _column_extraInitializers = [];
|
|
@@ -55,8 +61,10 @@ let MobileTableColumnHeader = (() => {
|
|
|
55
61
|
return class MobileTableColumnHeader extends _classSuper {
|
|
56
62
|
static {
|
|
57
63
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
64
|
+
_std_decorators = [consume({ context: stdContext })];
|
|
58
65
|
_column_decorators = [property({ attribute: false })];
|
|
59
66
|
_tableViewManager_decorators = [property({ attribute: false })];
|
|
67
|
+
__esDecorate(this, null, _std_decorators, { kind: "accessor", name: "std", static: false, private: false, access: { has: obj => "std" in obj, get: obj => obj.std, set: (obj, value) => { obj.std = value; } }, metadata: _metadata }, _std_initializers, _std_extraInitializers);
|
|
60
68
|
__esDecorate(this, null, _column_decorators, { kind: "accessor", name: "column", static: false, private: false, access: { has: obj => "column" in obj, get: obj => obj.column, set: (obj, value) => { obj.column = value; } }, metadata: _metadata }, _column_initializers, _column_extraInitializers);
|
|
61
69
|
__esDecorate(this, null, _tableViewManager_decorators, { kind: "accessor", name: "tableViewManager", static: false, private: false, access: { has: obj => "tableViewManager" in obj, get: obj => obj.tableViewManager, set: (obj, value) => { obj.tableViewManager = value; } }, metadata: _metadata }, _tableViewManager_initializers, _tableViewManager_extraInitializers);
|
|
62
70
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
@@ -84,16 +92,15 @@ let MobileTableColumnHeader = (() => {
|
|
|
84
92
|
`; }
|
|
85
93
|
popMenu(ele) {
|
|
86
94
|
const enableNumberFormatting = this.tableViewManager.featureFlags$.value.enable_number_formatting;
|
|
95
|
+
const wording = wordingOf(this.std);
|
|
87
96
|
popMenu(popupTargetFromElement(ele ?? this), {
|
|
88
97
|
options: {
|
|
89
98
|
title: {
|
|
90
|
-
text:
|
|
99
|
+
text: wording(DATA_VIEW_PROPERTY_SETTINGS),
|
|
91
100
|
},
|
|
92
|
-
items:
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
// Number format begin
|
|
96
|
-
...(enableNumberFormatting
|
|
101
|
+
items: propertyMenuItems(this.column, {
|
|
102
|
+
wording,
|
|
103
|
+
afterType: enableNumberFormatting
|
|
97
104
|
? [
|
|
98
105
|
menu.subMenu({
|
|
99
106
|
name: 'Number Format',
|
|
@@ -127,122 +134,88 @@ let MobileTableColumnHeader = (() => {
|
|
|
127
134
|
},
|
|
128
135
|
}),
|
|
129
136
|
]
|
|
130
|
-
: []
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
137
|
+
: [],
|
|
138
|
+
beforeOperations: [
|
|
139
|
+
menu.group({
|
|
140
|
+
items: [
|
|
141
|
+
menu.action({
|
|
142
|
+
name: wording(DATA_VIEW_INSERT_LEFT),
|
|
143
|
+
prefix: InsertLeftIcon(),
|
|
144
|
+
select: () => {
|
|
145
|
+
this.tableViewManager.propertyAdd({
|
|
146
|
+
id: this.column.id,
|
|
147
|
+
before: true,
|
|
148
|
+
});
|
|
149
|
+
Promise.resolve()
|
|
150
|
+
.then(() => {
|
|
151
|
+
const pre = this.previousElementSibling?.previousElementSibling;
|
|
152
|
+
if (pre instanceof MobileTableColumnHeader) {
|
|
153
|
+
pre.editTitle();
|
|
154
|
+
pre.scrollIntoView({
|
|
155
|
+
inline: 'nearest',
|
|
156
|
+
block: 'nearest',
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
})
|
|
160
|
+
.catch(console.error);
|
|
161
|
+
},
|
|
162
|
+
}),
|
|
163
|
+
menu.action({
|
|
164
|
+
name: wording(DATA_VIEW_INSERT_RIGHT),
|
|
165
|
+
prefix: InsertRightIcon(),
|
|
166
|
+
select: () => {
|
|
167
|
+
this.tableViewManager.propertyAdd({
|
|
168
|
+
id: this.column.id,
|
|
169
|
+
before: false,
|
|
170
|
+
});
|
|
171
|
+
Promise.resolve()
|
|
172
|
+
.then(() => {
|
|
173
|
+
const next = this.nextElementSibling?.nextElementSibling;
|
|
174
|
+
if (next instanceof MobileTableColumnHeader) {
|
|
175
|
+
next.editTitle();
|
|
176
|
+
next.scrollIntoView({
|
|
177
|
+
inline: 'nearest',
|
|
178
|
+
block: 'nearest',
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
})
|
|
182
|
+
.catch(console.error);
|
|
183
|
+
},
|
|
184
|
+
}),
|
|
185
|
+
menu.action({
|
|
186
|
+
name: wording(VIEWS_BAR_MOVE_LEFT),
|
|
187
|
+
prefix: MoveLeftIcon(),
|
|
188
|
+
hide: () => this.column.isFirst$.value,
|
|
189
|
+
select: () => {
|
|
190
|
+
const pre = this.column.prev$.value;
|
|
191
|
+
if (!pre) {
|
|
192
|
+
return;
|
|
163
193
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
const next = this.nextElementSibling?.nextElementSibling;
|
|
179
|
-
if (next instanceof MobileTableColumnHeader) {
|
|
180
|
-
next.editTitle();
|
|
181
|
-
next.scrollIntoView({
|
|
182
|
-
inline: 'nearest',
|
|
183
|
-
block: 'nearest',
|
|
184
|
-
});
|
|
194
|
+
this.column.move({
|
|
195
|
+
id: pre.id,
|
|
196
|
+
before: true,
|
|
197
|
+
});
|
|
198
|
+
},
|
|
199
|
+
}),
|
|
200
|
+
menu.action({
|
|
201
|
+
name: wording(VIEWS_BAR_MOVE_RIGHT),
|
|
202
|
+
prefix: MoveRightIcon(),
|
|
203
|
+
hide: () => this.column.isLast$.value,
|
|
204
|
+
select: () => {
|
|
205
|
+
const next = this.column.next$.value;
|
|
206
|
+
if (!next) {
|
|
207
|
+
return;
|
|
185
208
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
if (!pre) {
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
199
|
-
this.column.move({
|
|
200
|
-
id: pre.id,
|
|
201
|
-
before: true,
|
|
202
|
-
});
|
|
203
|
-
},
|
|
204
|
-
}),
|
|
205
|
-
menu.action({
|
|
206
|
-
name: 'Move Right',
|
|
207
|
-
prefix: MoveRightIcon(),
|
|
208
|
-
hide: () => this.column.isLast$.value,
|
|
209
|
-
select: () => {
|
|
210
|
-
const next = this.column.next$.value;
|
|
211
|
-
if (!next) {
|
|
212
|
-
return;
|
|
213
|
-
}
|
|
214
|
-
this.column.move({
|
|
215
|
-
id: next.id,
|
|
216
|
-
before: false,
|
|
217
|
-
});
|
|
218
|
-
},
|
|
219
|
-
}),
|
|
220
|
-
],
|
|
221
|
-
}),
|
|
222
|
-
menu.group({
|
|
223
|
-
items: [
|
|
224
|
-
menu.action({
|
|
225
|
-
name: 'Duplicate',
|
|
226
|
-
prefix: DuplicateIcon(),
|
|
227
|
-
hide: () => !this.column.canDuplicate,
|
|
228
|
-
select: () => {
|
|
229
|
-
this.column.duplicate?.();
|
|
230
|
-
},
|
|
231
|
-
}),
|
|
232
|
-
menu.action({
|
|
233
|
-
name: 'Delete',
|
|
234
|
-
prefix: DeleteIcon(),
|
|
235
|
-
hide: () => !this.column.canDelete,
|
|
236
|
-
select: () => {
|
|
237
|
-
this.column.delete?.();
|
|
238
|
-
},
|
|
239
|
-
class: {
|
|
240
|
-
'delete-item': true,
|
|
241
|
-
},
|
|
242
|
-
}),
|
|
243
|
-
],
|
|
244
|
-
}),
|
|
245
|
-
],
|
|
209
|
+
this.column.move({
|
|
210
|
+
id: next.id,
|
|
211
|
+
before: false,
|
|
212
|
+
});
|
|
213
|
+
},
|
|
214
|
+
}),
|
|
215
|
+
],
|
|
216
|
+
}),
|
|
217
|
+
],
|
|
218
|
+
}),
|
|
246
219
|
},
|
|
247
220
|
});
|
|
248
221
|
}
|
|
@@ -265,6 +238,10 @@ let MobileTableColumnHeader = (() => {
|
|
|
265
238
|
</div>
|
|
266
239
|
`;
|
|
267
240
|
}
|
|
241
|
+
#std_accessor_storage;
|
|
242
|
+
/** Absent outside an editor host: the menu reads English. */
|
|
243
|
+
get std() { return this.#std_accessor_storage; }
|
|
244
|
+
set std(value) { this.#std_accessor_storage = value; }
|
|
268
245
|
#column_accessor_storage;
|
|
269
246
|
get column() { return this.#column_accessor_storage; }
|
|
270
247
|
set column(value) { this.#column_accessor_storage = value; }
|
|
@@ -282,7 +259,8 @@ let MobileTableColumnHeader = (() => {
|
|
|
282
259
|
this.editTitle = () => {
|
|
283
260
|
this._clickColumn();
|
|
284
261
|
};
|
|
285
|
-
this.#
|
|
262
|
+
this.#std_accessor_storage = __runInitializers(this, _std_initializers, void 0);
|
|
263
|
+
this.#column_accessor_storage = (__runInitializers(this, _std_extraInitializers), __runInitializers(this, _column_initializers, void 0));
|
|
286
264
|
this.#tableViewManager_accessor_storage = (__runInitializers(this, _column_extraInitializers), __runInitializers(this, _tableViewManager_initializers, void 0));
|
|
287
265
|
__runInitializers(this, _tableViewManager_extraInitializers);
|
|
288
266
|
}
|
|
@@ -45,14 +45,17 @@ import { repeat } from 'lit/directives/repeat.js';
|
|
|
45
45
|
import { GroupTitle } from '../../../core/group-by/group-title.js';
|
|
46
46
|
import { hideGroupAction } from '../../../core/group-by/group-visibility.js';
|
|
47
47
|
import { wordingOf } from '../../../core/utils/wording.js';
|
|
48
|
-
import { DATA_VIEW_GROUP_COLLAPSE, DATA_VIEW_GROUP_EXPAND, } from '../../../translations.js';
|
|
48
|
+
import { DATA_VIEW_GROUP_COLLAPSE, DATA_VIEW_GROUP_EXPAND, DATA_VIEW_NEW_PAGE, } from '../../../translations.js';
|
|
49
49
|
import { getCollapsedState, setCollapsedState } from '../collapsed-state.js';
|
|
50
50
|
import { LEFT_TOOL_BAR_WIDTH } from '../consts.js';
|
|
51
51
|
const styles = css `
|
|
52
|
+
/* "+ New page" under the rows: a full row, 44px for a finger (P7). */
|
|
52
53
|
.data-view-table-group-add-row {
|
|
53
54
|
display: flex;
|
|
54
55
|
width: 100%;
|
|
55
|
-
height:
|
|
56
|
+
min-height: 44px;
|
|
57
|
+
box-sizing: border-box;
|
|
58
|
+
align-items: center;
|
|
56
59
|
position: relative;
|
|
57
60
|
z-index: 0;
|
|
58
61
|
cursor: pointer;
|
|
@@ -69,8 +72,8 @@ const styles = css `
|
|
|
69
72
|
justify-content: center;
|
|
70
73
|
gap: 10px;
|
|
71
74
|
user-select: none;
|
|
72
|
-
font-size:
|
|
73
|
-
line-height:
|
|
75
|
+
font-size: 14px;
|
|
76
|
+
line-height: 22px;
|
|
74
77
|
color: var(--affine-text-secondary-color);
|
|
75
78
|
}
|
|
76
79
|
|
|
@@ -168,7 +171,9 @@ let MobileTableGroup = (() => {
|
|
|
168
171
|
data-test-id="affine-database-add-row-button"
|
|
169
172
|
role="button"
|
|
170
173
|
>
|
|
171
|
-
${PlusIcon()}<span
|
|
174
|
+
${PlusIcon()}<span
|
|
175
|
+
>${wordingOf(this.std)(DATA_VIEW_NEW_PAGE)}</span
|
|
176
|
+
>
|
|
172
177
|
</div>
|
|
173
178
|
</div>`}
|
|
174
179
|
`;
|
|
@@ -216,11 +221,11 @@ let MobileTableGroup = (() => {
|
|
|
216
221
|
}
|
|
217
222
|
};
|
|
218
223
|
this.clickAddRow = () => {
|
|
219
|
-
this.
|
|
224
|
+
this.tableViewLogic.addRow('end', this.group?.key);
|
|
220
225
|
this.requestUpdate();
|
|
221
226
|
};
|
|
222
227
|
this.clickAddRowInStart = () => {
|
|
223
|
-
this.
|
|
228
|
+
this.tableViewLogic.addRow('start', this.group?.key);
|
|
224
229
|
this.requestUpdate();
|
|
225
230
|
};
|
|
226
231
|
this.clickGroupOptions = (e) => {
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import { ShadowlessElement } from '../../../../std/index.js';
|
|
1
|
+
import { type BlockStdScope, ShadowlessElement } from '../../../../std/index.js';
|
|
2
2
|
import { type TemplateResult } from 'lit';
|
|
3
3
|
import type { TableSingleView } from '../table-view-manager.js';
|
|
4
4
|
declare const MobileTableHeader_base: typeof ShadowlessElement & import("../../../../global/utils/types.js").Constructor<import("../../../../global/lit/with-disposable.js").DisposableClass>;
|
|
5
5
|
export declare class MobileTableHeader extends MobileTableHeader_base {
|
|
6
6
|
static styles: import("lit").CSSResult;
|
|
7
|
+
/** Absent outside an editor host: the wordings read English. */
|
|
8
|
+
accessor std: BlockStdScope;
|
|
9
|
+
/**
|
|
10
|
+
* "+" adds a property and opens ITS "Property settings" sheet. Up to 0.54
|
|
11
|
+
* the last header was looked up in the same tick, before the header had
|
|
12
|
+
* drawn the new column, so the sheet opened on the previous last property.
|
|
13
|
+
*/
|
|
7
14
|
private readonly _onAddColumn;
|
|
8
|
-
editLastColumnTitle: () => void;
|
|
9
15
|
private get readonly();
|
|
10
16
|
render(): TemplateResult;
|
|
11
17
|
accessor renderGroupHeader: (() => TemplateResult) | undefined;
|