@formicoidea/labre-core 1.0.0 → 2.0.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/architecture/code.c4 +48 -44
- package/architecture/likec4.config.json +3 -3
- package/dist/_pkgs/affine-block-root/configs/toolbar.d.ts +1 -1
- package/dist/_pkgs/affine-block-root/configs/toolbar.js +4 -2
- package/dist/_pkgs/affine-block-surface/extensions/reading-toolbar.js +12 -12
- package/dist/_pkgs/affine-components/context-menu/menu-all.d.ts +1 -0
- package/dist/_pkgs/affine-components/context-menu/menu-renderer.d.ts +3 -1
- package/dist/_pkgs/affine-components/context-menu/menu-renderer.js +9 -1
- package/dist/_pkgs/affine-components/context-menu/menu.d.ts +7 -0
- package/dist/_pkgs/affine-components/context-menu/menu.js +5 -0
- package/dist/_pkgs/affine-components/context-menu/sub-menu.d.ts +19 -1
- package/dist/_pkgs/affine-components/context-menu/sub-menu.js +46 -7
- package/dist/_pkgs/affine-components/highlight-dropdown-menu/highlight-duotone-icon.js +8 -8
- package/dist/_pkgs/affine-components/highlight-dropdown-menu/text-duotone-icon.js +11 -11
- package/dist/_pkgs/affine-database-block/configs/slash-menu.d.ts +24 -0
- package/dist/_pkgs/affine-database-block/configs/slash-menu.js +52 -37
- package/dist/_pkgs/affine-database-block/creation-menu.d.ts +6 -0
- package/dist/_pkgs/affine-database-block/data-source.d.ts +6 -0
- package/dist/_pkgs/affine-database-block/data-source.js +16 -0
- package/dist/_pkgs/affine-database-block/database-block-styles.js +4 -3
- package/dist/_pkgs/affine-database-block/database-block.d.ts +23 -0
- package/dist/_pkgs/affine-database-block/database-block.js +129 -19
- package/dist/_pkgs/affine-database-block/database-dnd-preview-block.js +5 -1
- package/dist/_pkgs/affine-database-block/detail-panel/block-renderer.js +5 -2
- package/dist/_pkgs/affine-database-block/detail-panel/note-renderer.js +3 -2
- package/dist/_pkgs/affine-database-block/external-data-source.d.ts +17 -0
- package/dist/_pkgs/affine-database-block/external-data-source.js +54 -4
- package/dist/_pkgs/affine-database-block/index.d.ts +3 -0
- package/dist/_pkgs/affine-database-block/index.js +5 -0
- package/dist/_pkgs/affine-database-block/linked-view.d.ts +59 -0
- package/dist/_pkgs/affine-database-block/linked-view.js +131 -1
- package/dist/_pkgs/affine-database-block/properties/created-time/define.js +3 -1
- package/dist/_pkgs/affine-database-block/properties/link/cell-renderer.js +3 -2
- package/dist/_pkgs/affine-database-block/properties/link/define.js +3 -1
- package/dist/_pkgs/affine-database-block/properties/rich-text/define.js +3 -1
- package/dist/_pkgs/affine-database-block/properties/text/hosted.js +1 -0
- package/dist/_pkgs/affine-database-block/properties/title/define.js +3 -1
- package/dist/_pkgs/affine-database-block/properties/title/hosted.js +1 -0
- package/dist/_pkgs/affine-database-block/service/new-row-menu.d.ts +1 -1
- package/dist/_pkgs/affine-database-block/service/new-row-menu.js +1 -1
- package/dist/_pkgs/affine-database-block/translations.d.ts +29 -0
- package/dist/_pkgs/affine-database-block/translations.js +104 -0
- package/dist/_pkgs/affine-database-block/turn-into-source.d.ts +38 -0
- package/dist/_pkgs/affine-database-block/turn-into-source.js +187 -0
- package/dist/_pkgs/affine-database-block/view-deletion.d.ts +15 -0
- package/dist/_pkgs/affine-database-block/view-deletion.js +113 -0
- package/dist/_pkgs/affine-database-block/views/index.d.ts +7 -9
- package/dist/_pkgs/affine-database-block/views/index.js +7 -10
- package/dist/_pkgs/affine-database-engine/core/common/properties.js +7 -7
- package/dist/_pkgs/affine-database-engine/core/common/property-menu.d.ts +18 -2
- package/dist/_pkgs/affine-database-engine/core/common/property-menu.js +78 -27
- package/dist/_pkgs/affine-database-engine/core/data-source/base.d.ts +11 -0
- package/dist/_pkgs/affine-database-engine/core/data-source/base.js +3 -0
- package/dist/_pkgs/affine-database-engine/core/detail/detail.js +8 -5
- package/dist/_pkgs/affine-database-engine/core/detail/field.js +14 -7
- package/dist/_pkgs/affine-database-engine/core/filter/add-filter.js +4 -2
- package/dist/_pkgs/affine-database-engine/core/filter/filter-fn/boolean.js +7 -4
- package/dist/_pkgs/affine-database-engine/core/filter/filter-fn/create.d.ts +9 -1
- package/dist/_pkgs/affine-database-engine/core/filter/filter-fn/create.js +2 -0
- package/dist/_pkgs/affine-database-engine/core/filter/filter-fn/date.js +7 -4
- package/dist/_pkgs/affine-database-engine/core/filter/filter-fn/multi-tag.js +17 -8
- package/dist/_pkgs/affine-database-engine/core/filter/filter-fn/number.js +6 -6
- package/dist/_pkgs/affine-database-engine/core/filter/filter-fn/string.js +19 -12
- package/dist/_pkgs/affine-database-engine/core/filter/filter-fn/tag.js +9 -4
- package/dist/_pkgs/affine-database-engine/core/filter/filter-fn/unknown.js +7 -4
- package/dist/_pkgs/affine-database-engine/core/filter/literal/define.js +6 -4
- package/dist/_pkgs/affine-database-engine/core/filter/literal/matcher.d.ts +2 -1
- package/dist/_pkgs/affine-database-engine/core/filter/literal/matcher.js +3 -2
- package/dist/_pkgs/affine-database-engine/core/filter/literal/types.d.ts +4 -1
- package/dist/_pkgs/affine-database-engine/core/filter/literal/types.js +1 -1
- package/dist/_pkgs/affine-database-engine/core/group-by/define.js +11 -9
- package/dist/_pkgs/affine-database-engine/core/group-by/group-title.js +16 -6
- package/dist/_pkgs/affine-database-engine/core/group-by/locate-row.d.ts +16 -0
- package/dist/_pkgs/affine-database-engine/core/group-by/locate-row.js +32 -0
- package/dist/_pkgs/affine-database-engine/core/group-by/renderer/date-group.js +10 -3
- package/dist/_pkgs/affine-database-engine/core/group-by/setting.d.ts +2 -0
- package/dist/_pkgs/affine-database-engine/core/group-by/setting.js +40 -28
- package/dist/_pkgs/affine-database-engine/core/group-by/trait.d.ts +3 -0
- package/dist/_pkgs/affine-database-engine/core/group-by/trait.js +8 -0
- package/dist/_pkgs/affine-database-engine/core/group-by/types.d.ts +3 -1
- package/dist/_pkgs/affine-database-engine/core/group-by/types.js +1 -1
- package/dist/_pkgs/affine-database-engine/core/property/types.d.ts +7 -0
- package/dist/_pkgs/affine-database-engine/core/property/types.js +1 -1
- package/dist/_pkgs/affine-database-engine/core/sort/add-sort.js +3 -1
- package/dist/_pkgs/affine-database-engine/core/statistics/any.js +43 -21
- package/dist/_pkgs/affine-database-engine/core/statistics/checkbox.js +29 -14
- package/dist/_pkgs/affine-database-engine/core/statistics/number.js +54 -31
- package/dist/_pkgs/affine-database-engine/core/statistics/types.d.ts +8 -0
- package/dist/_pkgs/affine-database-engine/core/statistics/types.js +2 -1
- package/dist/_pkgs/affine-database-engine/core/utils/wording.d.ts +20 -1
- package/dist/_pkgs/affine-database-engine/core/utils/wording.js +24 -0
- package/dist/_pkgs/affine-database-engine/core/view-manager/property.d.ts +7 -0
- package/dist/_pkgs/affine-database-engine/core/view-manager/property.js +29 -5
- package/dist/_pkgs/affine-database-engine/core/view-manager/single-view.d.ts +14 -0
- package/dist/_pkgs/affine-database-engine/core/view-manager/single-view.js +11 -0
- package/dist/_pkgs/affine-database-engine/property-presets/checkbox/define.js +3 -1
- package/dist/_pkgs/affine-database-engine/property-presets/date/define.js +3 -1
- package/dist/_pkgs/affine-database-engine/property-presets/multi-select/define.js +3 -1
- package/dist/_pkgs/affine-database-engine/property-presets/number/define.js +3 -1
- package/dist/_pkgs/affine-database-engine/property-presets/number/utils/formats.d.ts +3 -0
- package/dist/_pkgs/affine-database-engine/property-presets/number/utils/formats.js +56 -9
- package/dist/_pkgs/affine-database-engine/property-presets/progress/define.js +3 -1
- package/dist/_pkgs/affine-database-engine/property-presets/select/define.js +3 -1
- package/dist/_pkgs/affine-database-engine/property-presets/text/define.js +3 -1
- package/dist/_pkgs/affine-database-engine/translations.d.ts +133 -5
- package/dist/_pkgs/affine-database-engine/translations.js +625 -9
- package/dist/_pkgs/affine-database-engine/view-presets/convert.js +0 -28
- package/dist/_pkgs/affine-database-engine/view-presets/effect.js +0 -2
- package/dist/_pkgs/affine-database-engine/view-presets/flat/flat-converts.js +2 -4
- package/dist/_pkgs/affine-database-engine/view-presets/flat/flat-view-ui.d.ts +57 -0
- package/dist/_pkgs/affine-database-engine/view-presets/flat/flat-view-ui.js +113 -4
- package/dist/_pkgs/affine-database-engine/view-presets/gallery/gallery-view.js +2 -1
- package/dist/_pkgs/affine-database-engine/view-presets/index.d.ts +0 -2
- package/dist/_pkgs/affine-database-engine/view-presets/index.js +0 -3
- package/dist/_pkgs/affine-database-engine/view-presets/kanban/kanban-view-manager.js +2 -0
- package/dist/_pkgs/affine-database-engine/view-presets/kanban/mobile/group.js +7 -5
- package/dist/_pkgs/affine-database-engine/view-presets/kanban/mobile/kanban-view-ui-logic.d.ts +5 -0
- package/dist/_pkgs/affine-database-engine/view-presets/kanban/mobile/kanban-view-ui-logic.js +25 -3
- package/dist/_pkgs/affine-database-engine/view-presets/kanban/mobile/menu.js +12 -6
- package/dist/_pkgs/affine-database-engine/view-presets/kanban/pc/controller/selection.d.ts +8 -0
- package/dist/_pkgs/affine-database-engine/view-presets/kanban/pc/controller/selection.js +35 -12
- package/dist/_pkgs/affine-database-engine/view-presets/kanban/pc/group.js +7 -5
- package/dist/_pkgs/affine-database-engine/view-presets/kanban/pc/header.js +5 -1
- package/dist/_pkgs/affine-database-engine/view-presets/kanban/pc/kanban-view-ui-logic.d.ts +5 -0
- package/dist/_pkgs/affine-database-engine/view-presets/kanban/pc/kanban-view-ui-logic.js +8 -4
- package/dist/_pkgs/affine-database-engine/view-presets/kanban/pc/menu.js +12 -6
- package/dist/_pkgs/affine-database-engine/view-presets/list/list-view.js +2 -1
- package/dist/_pkgs/affine-database-engine/view-presets/table/mobile/column-header.js +6 -4
- package/dist/_pkgs/affine-database-engine/view-presets/table/mobile/group.js +6 -5
- package/dist/_pkgs/affine-database-engine/view-presets/table/mobile/header.js +2 -2
- package/dist/_pkgs/affine-database-engine/view-presets/table/mobile/table-view-ui-logic.d.ts +4 -3
- package/dist/_pkgs/affine-database-engine/view-presets/table/mobile/table-view-ui-logic.js +29 -5
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc/controller/clipboard.js +6 -2
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc/controller/selection.js +2 -0
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc/group.js +6 -5
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc/header/column-header.js +11 -7
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc/header/database-header-column.js +16 -12
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc/header/number-format-bar.js +4 -2
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc/menu.js +9 -6
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc/table-view-ui-logic.d.ts +8 -1
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc/table-view-ui-logic.js +29 -7
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc-virtual/controller/clipboard.js +6 -2
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc-virtual/controller/selection.js +2 -0
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc-virtual/group/bottom/group-footer.js +5 -2
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc-virtual/group/bottom/stats/column-stats-column.d.ts +1 -1
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc-virtual/group/bottom/stats/column-stats-column.js +14 -6
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc-virtual/group/top/group-header.js +5 -2
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc-virtual/group/top/group-title.js +5 -3
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc-virtual/group/top/header/column-header.js +17 -10
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc-virtual/group/top/header/number-format-bar.js +4 -2
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc-virtual/group/top/header/single-column-header.js +20 -14
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc-virtual/row/menu.js +9 -6
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc-virtual/table-view-ui-logic.d.ts +6 -1
- package/dist/_pkgs/affine-database-engine/view-presets/table/pc-virtual/table-view-ui-logic.js +30 -3
- package/dist/_pkgs/affine-database-engine/view-presets/table/stats/column-stats-column.d.ts +1 -1
- package/dist/_pkgs/affine-database-engine/view-presets/table/stats/column-stats-column.js +14 -6
- package/dist/_pkgs/affine-database-engine/view-presets/table/table-view-manager.js +2 -0
- package/dist/_pkgs/affine-database-engine/widget-presets/quick-setting-bar/filter/condition-view.d.ts +2 -0
- package/dist/_pkgs/affine-database-engine/widget-presets/quick-setting-bar/filter/condition-view.js +13 -6
- package/dist/_pkgs/affine-database-engine/widget-presets/quick-setting-bar/filter/group-panel-view.js +20 -13
- package/dist/_pkgs/affine-database-engine/widget-presets/quick-setting-bar/filter/root-panel-view.js +10 -5
- package/dist/_pkgs/affine-database-engine/widget-presets/quick-setting-bar/sort/root-panel.js +8 -5
- package/dist/_pkgs/affine-database-engine/widget-presets/tools/presets/search/search.js +2 -2
- package/dist/_pkgs/affine-database-engine/widget-presets/tools/presets/table-add-row/add-row.d.ts +6 -0
- package/dist/_pkgs/affine-database-engine/widget-presets/tools/presets/table-add-row/add-row.js +49 -4
- package/dist/_pkgs/affine-database-engine/widget-presets/tools/presets/view-options/view-settings.d.ts +3 -3
- package/dist/_pkgs/affine-database-engine/widget-presets/tools/presets/view-options/view-settings.js +3 -3
- package/dist/_pkgs/affine-database-engine/widget-presets/views-bar/views-view.js +5 -0
- package/dist/_pkgs/affine-database-view-block/configs/slash-menu.js +6 -3
- package/dist/_pkgs/affine-database-view-block/data-view-block.js +5 -4
- package/dist/_pkgs/affine-fragment-doc-title/doc-title.d.ts +3 -2
- package/dist/_pkgs/affine-fragment-doc-title/doc-title.js +3 -2
- package/dist/_pkgs/affine-shared/services/data-source-picker-service.d.ts +130 -1
- package/dist/_pkgs/affine-widget-edgeless-zoom-toolbar/index.js +26 -26
- package/dist/_pkgs/affine-widget-keyboard-toolbar/config.js +10 -21
- package/dist/_pkgs/affine-widget-keyboard-toolbar/icons.js +98 -98
- package/dist/_pkgs/affine-widget-page-dragging-area/index.js +10 -10
- package/dist/_pkgs/affine-widget-viewport-overlay/index.js +13 -13
- package/package.json +1 -1
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/calendar-view-manager.d.ts +0 -70
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/calendar-view-manager.js +0 -449
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/define.d.ts +0 -10
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/define.js +0 -29
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/effect.d.ts +0 -1
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/effect.js +0 -4
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/index.d.ts +0 -6
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/index.js +0 -6
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/layout.d.ts +0 -37
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/layout.js +0 -138
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/pc/actions.d.ts +0 -7
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/pc/actions.js +0 -64
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/pc/dnd.d.ts +0 -32
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/pc/dnd.js +0 -159
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/pc/effect.d.ts +0 -1
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/pc/effect.js +0 -7
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/pc/hit-test.d.ts +0 -1
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/pc/hit-test.js +0 -28
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/pc/styles.d.ts +0 -1
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/pc/styles.js +0 -707
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/pc/view.d.ts +0 -89
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/pc/view.js +0 -849
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/renderer.d.ts +0 -2
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/renderer.js +0 -8
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/source.d.ts +0 -8
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/source.js +0 -3
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/types.d.ts +0 -79
- package/dist/_pkgs/affine-database-engine/view-presets/calendar/types.js +0 -1
|
@@ -44,7 +44,9 @@ import { html } from 'lit/static-html.js';
|
|
|
44
44
|
import { GroupTitle } from '../../../core/group-by/group-title.js';
|
|
45
45
|
import { groupToggleStyles, hideGroupAction, renderGroupToggle, } from '../../../core/group-by/group-visibility.js';
|
|
46
46
|
import { dragHandler } from '../../../core/utils/wc-dnd/dnd-context.js';
|
|
47
|
-
import { wordingOf } from '../../../core/utils/wording.js';
|
|
47
|
+
import { wordingOf, wordingFrom } from '../../../core/utils/wording.js';
|
|
48
|
+
import { DATA_VIEW_GROUP_DELETE_CARDS, DATA_VIEW_GROUP_ADD, } from '../../../translations.js';
|
|
49
|
+
import { TOOLBAR_UNGROUP } from '../../../../affine-shared/services/index.js';
|
|
48
50
|
const styles = css `
|
|
49
51
|
affine-data-view-kanban-group {
|
|
50
52
|
width: 260px;
|
|
@@ -197,7 +199,7 @@ let KanbanGroup = (() => {
|
|
|
197
199
|
></affine-data-view-kanban-card>
|
|
198
200
|
`;
|
|
199
201
|
})}
|
|
200
|
-
${this.view.readonly$.value
|
|
202
|
+
${this.view.readonly$.value || this.view.rowsLocked$.value
|
|
201
203
|
? nothing
|
|
202
204
|
: html `<div class="add-card" @click="${this.clickAddCard}">
|
|
203
205
|
<div
|
|
@@ -205,7 +207,7 @@ let KanbanGroup = (() => {
|
|
|
205
207
|
>
|
|
206
208
|
${AddCursorIcon()}
|
|
207
209
|
</div>
|
|
208
|
-
|
|
210
|
+
${wordingFrom(this)(DATA_VIEW_GROUP_ADD)}
|
|
209
211
|
</div>`}
|
|
210
212
|
</div>
|
|
211
213
|
`;
|
|
@@ -260,7 +262,7 @@ let KanbanGroup = (() => {
|
|
|
260
262
|
const ele = e.currentTarget;
|
|
261
263
|
popFilterableSimpleMenu(popupTargetFromElement(ele), [
|
|
262
264
|
menu.action({
|
|
263
|
-
name:
|
|
265
|
+
name: wordingFrom(this)(TOOLBAR_UNGROUP),
|
|
264
266
|
hide: () => this.group.value == null,
|
|
265
267
|
select: () => {
|
|
266
268
|
this.group.rows.forEach(row => {
|
|
@@ -271,7 +273,7 @@ let KanbanGroup = (() => {
|
|
|
271
273
|
}),
|
|
272
274
|
hideGroupAction(this.group, wordingOf(this.std)),
|
|
273
275
|
menu.action({
|
|
274
|
-
name:
|
|
276
|
+
name: wordingFrom(this)(DATA_VIEW_GROUP_DELETE_CARDS),
|
|
275
277
|
select: () => {
|
|
276
278
|
this.view.rowsDelete(this.group.rows.map(row => row.rowId));
|
|
277
279
|
this.requestUpdate();
|
|
@@ -39,6 +39,8 @@ import { css } from 'lit';
|
|
|
39
39
|
import { property } from 'lit/decorators.js';
|
|
40
40
|
import { html } from 'lit/static-html.js';
|
|
41
41
|
import { groupTraitKey } from '../../../core/group-by/trait.js';
|
|
42
|
+
import { DATA_VIEW_GROUP } from '../../../translations.js';
|
|
43
|
+
import { wordingFrom } from '../../../core/utils/wording.js';
|
|
42
44
|
const styles = css `
|
|
43
45
|
affine-data-view-kanban-header {
|
|
44
46
|
display: flex;
|
|
@@ -73,7 +75,9 @@ let KanbanHeader = (() => {
|
|
|
73
75
|
return html `
|
|
74
76
|
<div></div>
|
|
75
77
|
<div>
|
|
76
|
-
<div class="select-group" @click="${this.clickGroup}">
|
|
78
|
+
<div class="select-group" @click="${this.clickGroup}">
|
|
79
|
+
${wordingFrom(this)(DATA_VIEW_GROUP)}
|
|
80
|
+
</div>
|
|
77
81
|
</div>
|
|
78
82
|
`;
|
|
79
83
|
}
|
|
@@ -18,6 +18,11 @@ export declare class KanbanViewUILogic extends DataViewUILogicBase<KanbanSingleV
|
|
|
18
18
|
groups$: import("@preact/signals-core").ReadonlySignal<import("../../../index.js").Group<unknown, unknown, Record<string, unknown>>[]>;
|
|
19
19
|
private get readonly();
|
|
20
20
|
clearSelection: () => void;
|
|
21
|
+
/**
|
|
22
|
+
* "New" adds the card and puts its title in editing, as a group's own
|
|
23
|
+
* "New" does: it no longer opens the card (product owner, recette P3-15).
|
|
24
|
+
* Nothing is written but the row.
|
|
25
|
+
*/
|
|
21
26
|
addRow: (position: InsertToPosition) => string | undefined;
|
|
22
27
|
focusFirstCell: () => void;
|
|
23
28
|
showIndicator: (evt: MouseEvent) => boolean;
|
|
@@ -34,17 +34,21 @@ export class KanbanViewUILogic extends DataViewUILogicBase {
|
|
|
34
34
|
this.clearSelection = () => {
|
|
35
35
|
this.selectionController.clear();
|
|
36
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* "New" adds the card and puts its title in editing, as a group's own
|
|
39
|
+
* "New" does: it no longer opens the card (product owner, recette P3-15).
|
|
40
|
+
* Nothing is written but the row.
|
|
41
|
+
*/
|
|
37
42
|
this.addRow = (position) => {
|
|
38
43
|
if (this.readonly)
|
|
39
44
|
return;
|
|
40
45
|
const rowId = this.view.rowAdd(position);
|
|
46
|
+
this.ui$.value?.requestUpdate();
|
|
41
47
|
if (rowId) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
rowId,
|
|
48
|
+
requestAnimationFrame(() => {
|
|
49
|
+
this.selectionController.editCardTitle(rowId);
|
|
45
50
|
});
|
|
46
51
|
}
|
|
47
|
-
this.ui$.value?.requestUpdate();
|
|
48
52
|
return rowId;
|
|
49
53
|
};
|
|
50
54
|
this.focusFirstCell = () => {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { menu, popFilterableSimpleMenu, } from '../../../../affine-components/context-menu/index.js';
|
|
2
2
|
import { ArrowRightBigIcon, DeleteIcon, ExpandFullIcon, MoveLeftIcon, MoveRightIcon, } from '@blocksuite/icons/lit';
|
|
3
3
|
import { html } from 'lit';
|
|
4
|
+
import { DATA_VIEW_CARD_EXPAND, DATA_VIEW_CARD_MOVE_TO, DATA_VIEW_ROW_INSERT_BEFORE, DATA_VIEW_ROW_INSERT_AFTER, DATA_VIEW_CARD_DELETE, DATA_VIEW_UNGROUPED, } from '../../../translations.js';
|
|
5
|
+
import { wordingFrom } from '../../../core/utils/wording.js';
|
|
4
6
|
export const openDetail = (kanbanViewLogic, rowId, selection) => {
|
|
5
7
|
const old = selection.selection;
|
|
6
8
|
selection.selection = undefined;
|
|
@@ -15,14 +17,14 @@ export const openDetail = (kanbanViewLogic, rowId, selection) => {
|
|
|
15
17
|
export const popCardMenu = (kanbanViewLogic, ele, rowId, selection) => {
|
|
16
18
|
popFilterableSimpleMenu(ele, [
|
|
17
19
|
menu.action({
|
|
18
|
-
name:
|
|
20
|
+
name: wordingFrom(ele.element)(DATA_VIEW_CARD_EXPAND),
|
|
19
21
|
prefix: ExpandFullIcon(),
|
|
20
22
|
select: () => {
|
|
21
23
|
openDetail(kanbanViewLogic, rowId, selection);
|
|
22
24
|
},
|
|
23
25
|
}),
|
|
24
26
|
menu.subMenu({
|
|
25
|
-
name:
|
|
27
|
+
name: wordingFrom(ele.element)(DATA_VIEW_CARD_MOVE_TO),
|
|
26
28
|
prefix: ArrowRightBigIcon(),
|
|
27
29
|
options: {
|
|
28
30
|
items: selection.view.groupTrait.groupsDataList$.value
|
|
@@ -35,7 +37,9 @@ export const popCardMenu = (kanbanViewLogic, ele, rowId, selection) => {
|
|
|
35
37
|
})
|
|
36
38
|
.map(group => {
|
|
37
39
|
return menu.action({
|
|
38
|
-
name: group.value != null
|
|
40
|
+
name: group.value != null
|
|
41
|
+
? group.name$.value
|
|
42
|
+
: wordingFrom(ele.element)(DATA_VIEW_UNGROUPED),
|
|
39
43
|
select: () => {
|
|
40
44
|
selection.moveCard(rowId, group.key);
|
|
41
45
|
},
|
|
@@ -47,7 +51,8 @@ export const popCardMenu = (kanbanViewLogic, ele, rowId, selection) => {
|
|
|
47
51
|
name: '',
|
|
48
52
|
items: [
|
|
49
53
|
menu.action({
|
|
50
|
-
name:
|
|
54
|
+
name: wordingFrom(ele.element)(DATA_VIEW_ROW_INSERT_BEFORE),
|
|
55
|
+
hide: () => selection.view.rowsLocked$.value,
|
|
51
56
|
prefix: html ` <div
|
|
52
57
|
style="transform: rotate(90deg);display:flex;align-items:center;"
|
|
53
58
|
>
|
|
@@ -58,7 +63,8 @@ export const popCardMenu = (kanbanViewLogic, ele, rowId, selection) => {
|
|
|
58
63
|
},
|
|
59
64
|
}),
|
|
60
65
|
menu.action({
|
|
61
|
-
name:
|
|
66
|
+
name: wordingFrom(ele.element)(DATA_VIEW_ROW_INSERT_AFTER),
|
|
67
|
+
hide: () => selection.view.rowsLocked$.value,
|
|
62
68
|
prefix: html ` <div
|
|
63
69
|
style="transform: rotate(90deg);display:flex;align-items:center;"
|
|
64
70
|
>
|
|
@@ -74,7 +80,7 @@ export const popCardMenu = (kanbanViewLogic, ele, rowId, selection) => {
|
|
|
74
80
|
name: '',
|
|
75
81
|
items: [
|
|
76
82
|
menu.action({
|
|
77
|
-
name:
|
|
83
|
+
name: wordingFrom(ele.element)(DATA_VIEW_CARD_DELETE),
|
|
78
84
|
class: {
|
|
79
85
|
'delete-item': true,
|
|
80
86
|
},
|
|
@@ -178,8 +178,9 @@ export class ListViewUI extends FlatViewUI {
|
|
|
178
178
|
</div>`;
|
|
179
179
|
}
|
|
180
180
|
renderNewRow(groupKey) {
|
|
181
|
-
if (this.view.readonly$.value)
|
|
181
|
+
if (this.view.readonly$.value || this.view.rowsLocked$.value) {
|
|
182
182
|
return nothing;
|
|
183
|
+
}
|
|
183
184
|
return html `<button
|
|
184
185
|
class="dv-list-new"
|
|
185
186
|
data-testid="dv-flat-new"
|
|
@@ -45,7 +45,7 @@ import { html } from 'lit/static-html.js';
|
|
|
45
45
|
import { propertyMenuItems } from '../../../core/common/property-menu.js';
|
|
46
46
|
import { wordingOf } from '../../../core/utils/wording.js';
|
|
47
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';
|
|
48
|
+
import { DATA_VIEW_INSERT_LEFT, DATA_VIEW_INSERT_RIGHT, DATA_VIEW_PROPERTY_SETTINGS, VIEWS_BAR_MOVE_LEFT, VIEWS_BAR_MOVE_RIGHT, DATA_VIEW_NUMBER_FORMAT, } from '../../../translations.js';
|
|
49
49
|
import { MOBILE_TOUCH_TARGET } from '../consts.js';
|
|
50
50
|
let MobileTableColumnHeader = (() => {
|
|
51
51
|
let _classSuper = SignalWatcher(WithDisposable(ShadowlessElement));
|
|
@@ -103,12 +103,12 @@ let MobileTableColumnHeader = (() => {
|
|
|
103
103
|
afterType: enableNumberFormatting
|
|
104
104
|
? [
|
|
105
105
|
menu.subMenu({
|
|
106
|
-
name:
|
|
106
|
+
name: wording(DATA_VIEW_NUMBER_FORMAT),
|
|
107
107
|
hide: () => !this.column.dataUpdate ||
|
|
108
108
|
this.column.type$.value !== 'number',
|
|
109
109
|
options: {
|
|
110
110
|
title: {
|
|
111
|
-
text:
|
|
111
|
+
text: wording(DATA_VIEW_NUMBER_FORMAT),
|
|
112
112
|
},
|
|
113
113
|
items: [
|
|
114
114
|
numberFormatConfig(this.column),
|
|
@@ -120,7 +120,7 @@ let MobileTableColumnHeader = (() => {
|
|
|
120
120
|
style="font-size: var(--affine-font-base); scale: 1.2;"
|
|
121
121
|
>${format.symbol}</span
|
|
122
122
|
>`,
|
|
123
|
-
name: format.
|
|
123
|
+
name: wording(format.labelWording),
|
|
124
124
|
select: () => {
|
|
125
125
|
if (data.format === format.type)
|
|
126
126
|
return;
|
|
@@ -140,6 +140,7 @@ let MobileTableColumnHeader = (() => {
|
|
|
140
140
|
items: [
|
|
141
141
|
menu.action({
|
|
142
142
|
name: wording(DATA_VIEW_INSERT_LEFT),
|
|
143
|
+
hide: () => this.tableViewManager.propertiesLocked$.value,
|
|
143
144
|
prefix: InsertLeftIcon(),
|
|
144
145
|
select: () => {
|
|
145
146
|
this.tableViewManager.propertyAdd({
|
|
@@ -162,6 +163,7 @@ let MobileTableColumnHeader = (() => {
|
|
|
162
163
|
}),
|
|
163
164
|
menu.action({
|
|
164
165
|
name: wording(DATA_VIEW_INSERT_RIGHT),
|
|
166
|
+
hide: () => this.tableViewManager.propertiesLocked$.value,
|
|
165
167
|
prefix: InsertRightIcon(),
|
|
166
168
|
select: () => {
|
|
167
169
|
this.tableViewManager.propertyAdd({
|
|
@@ -44,10 +44,11 @@ import { property } from 'lit/decorators.js';
|
|
|
44
44
|
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
|
-
import { wordingOf } from '../../../core/utils/wording.js';
|
|
48
|
-
import { DATA_VIEW_GROUP_COLLAPSE, DATA_VIEW_GROUP_EXPAND, DATA_VIEW_NEW_PAGE, } from '../../../translations.js';
|
|
47
|
+
import { wordingOf, wordingFrom } from '../../../core/utils/wording.js';
|
|
48
|
+
import { DATA_VIEW_GROUP_COLLAPSE, DATA_VIEW_GROUP_EXPAND, DATA_VIEW_NEW_PAGE, DATA_VIEW_GROUP_DELETE_CARDS, } from '../../../translations.js';
|
|
49
49
|
import { getCollapsedState, setCollapsedState } from '../collapsed-state.js';
|
|
50
50
|
import { LEFT_TOOL_BAR_WIDTH } from '../consts.js';
|
|
51
|
+
import { TOOLBAR_UNGROUP } from '../../../../affine-shared/services/index.js';
|
|
51
52
|
const styles = css `
|
|
52
53
|
/* "+ New page" under the rows: a full row, 44px for a finger (P7). */
|
|
53
54
|
.data-view-table-group-add-row {
|
|
@@ -160,7 +161,7 @@ let MobileTableGroup = (() => {
|
|
|
160
161
|
></mobile-table-row>`;
|
|
161
162
|
})}
|
|
162
163
|
</div>
|
|
163
|
-
${this.view.readonly$.value
|
|
164
|
+
${this.view.readonly$.value || this.view.rowsLocked$.value
|
|
164
165
|
? null
|
|
165
166
|
: html ` <div
|
|
166
167
|
class="data-view-table-group-add-row dv-hover"
|
|
@@ -236,7 +237,7 @@ let MobileTableGroup = (() => {
|
|
|
236
237
|
const ele = e.currentTarget;
|
|
237
238
|
popFilterableSimpleMenu(popupTargetFromElement(ele), [
|
|
238
239
|
menu.action({
|
|
239
|
-
name:
|
|
240
|
+
name: wordingFrom(this)(TOOLBAR_UNGROUP),
|
|
240
241
|
hide: () => group.value == null,
|
|
241
242
|
select: () => {
|
|
242
243
|
group.rows.forEach(row => {
|
|
@@ -246,7 +247,7 @@ let MobileTableGroup = (() => {
|
|
|
246
247
|
}),
|
|
247
248
|
hideGroupAction(group, wordingOf(this.std)),
|
|
248
249
|
menu.action({
|
|
249
|
-
name:
|
|
250
|
+
name: wordingFrom(this)(DATA_VIEW_GROUP_DELETE_CARDS),
|
|
250
251
|
select: () => {
|
|
251
252
|
this.view.rowsDelete(group.rows.map(row => row.rowId));
|
|
252
253
|
this.requestUpdate();
|
|
@@ -120,7 +120,7 @@ let MobileTableHeader = (() => {
|
|
|
120
120
|
</div>
|
|
121
121
|
`;
|
|
122
122
|
})}
|
|
123
|
-
${this.readonly
|
|
123
|
+
${this.readonly || this.tableViewManager.propertiesLocked$.value
|
|
124
124
|
? nothing
|
|
125
125
|
: html `<div
|
|
126
126
|
@click="${this._onAddColumn}"
|
|
@@ -153,7 +153,7 @@ let MobileTableHeader = (() => {
|
|
|
153
153
|
* drawn the new column, so the sheet opened on the previous last property.
|
|
154
154
|
*/
|
|
155
155
|
this._onAddColumn = (__runInitializers(this, _std_extraInitializers), () => {
|
|
156
|
-
if (this.readonly)
|
|
156
|
+
if (this.readonly || this.tableViewManager.propertiesLocked$.value)
|
|
157
157
|
return;
|
|
158
158
|
const id = this.tableViewManager.propertyAdd('end');
|
|
159
159
|
if (!id)
|
package/dist/_pkgs/affine-database-engine/view-presets/table/mobile/table-view-ui-logic.d.ts
CHANGED
|
@@ -2,15 +2,16 @@ import type { InsertToPosition } from '../../../../affine-shared/utils/index.js'
|
|
|
2
2
|
import type { TemplateResult } from 'lit';
|
|
3
3
|
import type { GroupTrait } from '../../../core/group-by/trait.js';
|
|
4
4
|
import { DataViewUIBase, DataViewUILogicBase } from '../../../core/view/data-view-base.js';
|
|
5
|
-
import type
|
|
5
|
+
import { type TableViewSelectionWithType } from '../selection.js';
|
|
6
6
|
import type { TableSingleView } from '../table-view-manager.js';
|
|
7
7
|
export declare class MobileTableViewUILogic extends DataViewUILogicBase<TableSingleView, TableViewSelectionWithType> {
|
|
8
8
|
ui$: import("@preact/signals-core").Signal<MobileTableViewUI | undefined>;
|
|
9
9
|
private get readonly();
|
|
10
10
|
clearSelection: () => void;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
12
|
+
* "New" adds the row and puts its title in editing, as the table's own
|
|
13
|
+
* "New record" footer does: it no longer opens the row (product owner,
|
|
14
|
+
* recette P3-15). Nothing is written but the row.
|
|
14
15
|
*/
|
|
15
16
|
addRow: (position: InsertToPosition, groupKey?: string) => string | undefined;
|
|
16
17
|
focusFirstCell: () => void;
|
|
@@ -4,25 +4,49 @@ import { signal } from '@preact/signals-core';
|
|
|
4
4
|
import { repeat } from 'lit/directives/repeat.js';
|
|
5
5
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
6
6
|
import { html } from 'lit/static-html.js';
|
|
7
|
+
import { locateRow } from '../../../core/group-by/locate-row.js';
|
|
7
8
|
import { createUniComponentFromWebComponent, renderUniLit, } from '../../../core/index.js';
|
|
8
9
|
import { DataViewUIBase, DataViewUILogicBase, } from '../../../core/view/data-view-base.js';
|
|
9
10
|
import { LEFT_TOOL_BAR_WIDTH } from '../consts.js';
|
|
11
|
+
import { TableViewAreaSelection, } from '../selection.js';
|
|
10
12
|
import { mobileTableViewContainer, mobileTableViewHost, mobileTableViewWrapper, } from './table-view-style.js';
|
|
13
|
+
import { DATA_VIEW_GROUP_NEW } from '../../../translations.js';
|
|
14
|
+
import { wordingFrom } from '../../../core/utils/wording.js';
|
|
11
15
|
export class MobileTableViewUILogic extends DataViewUILogicBase {
|
|
12
16
|
constructor() {
|
|
13
17
|
super(...arguments);
|
|
14
18
|
this.ui$ = signal(undefined);
|
|
15
19
|
this.clearSelection = () => { };
|
|
16
20
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
21
|
+
* "New" adds the row and puts its title in editing, as the table's own
|
|
22
|
+
* "New record" footer does: it no longer opens the row (product owner,
|
|
23
|
+
* recette P3-15). Nothing is written but the row.
|
|
19
24
|
*/
|
|
20
25
|
this.addRow = (position, groupKey) => {
|
|
21
26
|
if (this.readonly)
|
|
22
27
|
return;
|
|
23
28
|
const rowId = this.view.rowAdd(position, groupKey);
|
|
24
|
-
if (rowId)
|
|
25
|
-
|
|
29
|
+
if (!rowId)
|
|
30
|
+
return;
|
|
31
|
+
requestAnimationFrame(() => {
|
|
32
|
+
const view = this.view;
|
|
33
|
+
const at = locateRow(view.groupTrait, view.rows$.peek(), rowId);
|
|
34
|
+
const columnIndex = view.properties$
|
|
35
|
+
.peek()
|
|
36
|
+
.findIndex(property => property.type$.peek() === 'title');
|
|
37
|
+
if (!at || columnIndex < 0)
|
|
38
|
+
return;
|
|
39
|
+
// The phone cells follow the logic's selection (`mobile/cell.ts`).
|
|
40
|
+
this.setSelection({
|
|
41
|
+
viewId: view.id,
|
|
42
|
+
type: 'table',
|
|
43
|
+
...TableViewAreaSelection.create({
|
|
44
|
+
groupKey: at.groupKey,
|
|
45
|
+
focus: { rowIndex: at.rowIndex, columnIndex },
|
|
46
|
+
isEditing: true,
|
|
47
|
+
}),
|
|
48
|
+
});
|
|
49
|
+
});
|
|
26
50
|
return rowId;
|
|
27
51
|
};
|
|
28
52
|
this.focusFirstCell = () => { };
|
|
@@ -64,7 +88,7 @@ export class MobileTableViewUILogic extends DataViewUILogicBase {
|
|
|
64
88
|
@click="${add}"
|
|
65
89
|
>
|
|
66
90
|
<div class="dv-icon-16" style="display:flex;">${AddCursorIcon()}</div>
|
|
67
|
-
<div
|
|
91
|
+
<div>${wordingFrom(this.ui$.value)(DATA_VIEW_GROUP_NEW)}</div>
|
|
68
92
|
</div>
|
|
69
93
|
</div>`;
|
|
70
94
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { TableViewAreaSelection, TableViewRowSelection, } from '../../selection.js';
|
|
2
|
+
import { DATA_VIEW_CELLS_COPIED, DATA_VIEW_ROWS_COPIED, } from '../../../../translations.js';
|
|
3
|
+
import { wordingFrom } from '../../../../core/utils/wording.js';
|
|
2
4
|
const BLOCKSUITE_DATABASE_TABLE = 'blocksuite/database/table';
|
|
3
5
|
const TEXT = 'text/plain';
|
|
4
6
|
export class TableClipboardController {
|
|
@@ -49,11 +51,13 @@ export class TableClipboardController {
|
|
|
49
51
|
})
|
|
50
52
|
.then(() => {
|
|
51
53
|
if (area[0]?.row) {
|
|
52
|
-
this.notification.toast(
|
|
54
|
+
this.notification.toast(wordingFrom(this.logic.ui$.value)(DATA_VIEW_ROWS_COPIED, {
|
|
55
|
+
count: area.length,
|
|
56
|
+
}));
|
|
53
57
|
}
|
|
54
58
|
else {
|
|
55
59
|
const count = area.flatMap(row => row.cells).length;
|
|
56
|
-
this.notification.toast(
|
|
60
|
+
this.notification.toast(wordingFrom(this.logic.ui$.value)(DATA_VIEW_CELLS_COPIED, { count }));
|
|
57
61
|
}
|
|
58
62
|
})
|
|
59
63
|
.catch(console.error);
|
|
@@ -188,6 +188,8 @@ export class TableSelectionController {
|
|
|
188
188
|
}
|
|
189
189
|
insertTo(groupKey, rowId, before) {
|
|
190
190
|
const id = this.view.rowAdd({ before, id: rowId });
|
|
191
|
+
if (!id)
|
|
192
|
+
return;
|
|
191
193
|
if (groupKey != null) {
|
|
192
194
|
this.view.groupTrait.moveCardTo(id, undefined, groupKey, {
|
|
193
195
|
before,
|
|
@@ -47,13 +47,14 @@ import { hideGroupAction } from '../../../core/group-by/group-visibility.js';
|
|
|
47
47
|
import { createDndContext } from '../../../core/utils/wc-dnd/dnd-context.js';
|
|
48
48
|
import { defaultActivators } from '../../../core/utils/wc-dnd/sensors/index.js';
|
|
49
49
|
import { linearMove } from '../../../core/utils/wc-dnd/utils/linear-move.js';
|
|
50
|
-
import { wordingOf } from '../../../core/utils/wording.js';
|
|
51
|
-
import { DATA_VIEW_GROUP_COLLAPSE, DATA_VIEW_GROUP_EXPAND, DATA_VIEW_NEW_RECORD, } from '../../../translations.js';
|
|
50
|
+
import { wordingOf, wordingFrom } from '../../../core/utils/wording.js';
|
|
51
|
+
import { DATA_VIEW_GROUP_COLLAPSE, DATA_VIEW_GROUP_EXPAND, DATA_VIEW_NEW_RECORD, DATA_VIEW_GROUP_DELETE_CARDS, } from '../../../translations.js';
|
|
52
52
|
import { getCollapsedState, setCollapsedState } from '../collapsed-state.js';
|
|
53
53
|
import { LEFT_TOOL_BAR_WIDTH } from '../consts.js';
|
|
54
54
|
import { TableViewAreaSelection } from '../selection.js';
|
|
55
55
|
import { DataViewColumnPreview } from './header/column-renderer.js';
|
|
56
56
|
import { getVerticalIndicator } from './header/vertical-indicator.js';
|
|
57
|
+
import { TOOLBAR_UNGROUP } from '../../../../affine-shared/services/index.js';
|
|
57
58
|
const styles = css `
|
|
58
59
|
affine-data-view-table-group:hover .group-header-op {
|
|
59
60
|
visibility: visible;
|
|
@@ -182,7 +183,7 @@ let TableGroup = (() => {
|
|
|
182
183
|
></data-view-table-row>`;
|
|
183
184
|
})}
|
|
184
185
|
</div>
|
|
185
|
-
${this.view.readonly$.value
|
|
186
|
+
${this.view.readonly$.value || this.view.rowsLocked$.value
|
|
186
187
|
? null
|
|
187
188
|
: html ` <div
|
|
188
189
|
class="data-view-table-group-add-row dv-hover"
|
|
@@ -290,7 +291,7 @@ let TableGroup = (() => {
|
|
|
290
291
|
const ele = e.currentTarget;
|
|
291
292
|
popFilterableSimpleMenu(popupTargetFromElement(ele), [
|
|
292
293
|
menu.action({
|
|
293
|
-
name:
|
|
294
|
+
name: wordingFrom(this)(TOOLBAR_UNGROUP),
|
|
294
295
|
hide: () => group.value == null,
|
|
295
296
|
select: () => {
|
|
296
297
|
group.rows.forEach(row => {
|
|
@@ -300,7 +301,7 @@ let TableGroup = (() => {
|
|
|
300
301
|
}),
|
|
301
302
|
hideGroupAction(group, wordingOf(this.std)),
|
|
302
303
|
menu.action({
|
|
303
|
-
name:
|
|
304
|
+
name: wordingFrom(this)(DATA_VIEW_GROUP_DELETE_CARDS),
|
|
304
305
|
select: () => {
|
|
305
306
|
this.view.rowsDelete(group.rows.map(row => row.rowId));
|
|
306
307
|
this.requestUpdate();
|
|
@@ -141,12 +141,16 @@ let DatabaseColumnHeader = (() => {
|
|
|
141
141
|
<div class="${cellDivider}" style="height: auto;"></div>
|
|
142
142
|
`;
|
|
143
143
|
})}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
144
|
+
${this.tableViewManager.propertiesLocked$.value
|
|
145
|
+
? // The column keeps its place, so the header stays aligned.
|
|
146
|
+
html `<div class="header-add-column-button"></div>`
|
|
147
|
+
: html `<div
|
|
148
|
+
@click="${this._onAddColumn}"
|
|
149
|
+
class="header-add-column-button dv-hover"
|
|
150
|
+
data-testid="dv-table-add-column"
|
|
151
|
+
>
|
|
152
|
+
${PlusIcon()}
|
|
153
|
+
</div>`}
|
|
150
154
|
<div class="scale-div" style="width: 1px;height: 1px;"></div>
|
|
151
155
|
</div>
|
|
152
156
|
`;
|
|
@@ -166,7 +170,7 @@ let DatabaseColumnHeader = (() => {
|
|
|
166
170
|
constructor() {
|
|
167
171
|
super(...arguments);
|
|
168
172
|
this._onAddColumn = (e) => {
|
|
169
|
-
if (this.readonly)
|
|
173
|
+
if (this.readonly || this.tableViewManager.propertiesLocked$.value)
|
|
170
174
|
return;
|
|
171
175
|
this.tableViewManager.propertyAdd('end');
|
|
172
176
|
const ele = e.currentTarget;
|
package/dist/_pkgs/affine-database-engine/view-presets/table/pc/header/database-header-column.js
CHANGED
|
@@ -50,11 +50,12 @@ import { renderUniLit } from '../../../../core/index.js';
|
|
|
50
50
|
import { sortTraitKey } from '../../../../core/sort/manager.js';
|
|
51
51
|
import { createSortUtils } from '../../../../core/sort/utils.js';
|
|
52
52
|
import { draggable, dragHandler, droppable, } from '../../../../core/utils/wc-dnd/dnd-context.js';
|
|
53
|
-
import { wordingOf } from '../../../../core/utils/wording.js';
|
|
53
|
+
import { wordingOf, propertyTypeName, wordingFrom, } from '../../../../core/utils/wording.js';
|
|
54
54
|
import { numberFormats } from '../../../../property-presets/number/utils/formats.js';
|
|
55
55
|
import { createDefaultShowQuickSettingBar, ShowQuickSettingBarKey, } from '../../../../widget-presets/quick-setting-bar/context.js';
|
|
56
56
|
import { DEFAULT_COLUMN_TITLE_HEIGHT } from '../../consts.js';
|
|
57
57
|
import { getTableGroupRect, getVerticalIndicator, startDragWidthAdjustmentBar, } from './vertical-indicator.js';
|
|
58
|
+
import { DATA_VIEW_NUMBER_FORMAT, DATA_VIEW_FILTER, DATA_VIEW_SORT_ASCENDING, DATA_VIEW_SORT_DESCENDING, DATA_VIEW_INSERT_LEFT, DATA_VIEW_INSERT_RIGHT, VIEWS_BAR_MOVE_LEFT, VIEWS_BAR_MOVE_RIGHT, } from '../../../../translations.js';
|
|
58
59
|
let DatabaseHeaderColumn = (() => {
|
|
59
60
|
let _classSuper = SignalWatcher(WithDisposable(ShadowlessElement));
|
|
60
61
|
let _column_decorators;
|
|
@@ -145,7 +146,7 @@ let DatabaseHeaderColumn = (() => {
|
|
|
145
146
|
...(enableNumberFormatting
|
|
146
147
|
? [
|
|
147
148
|
menu.subMenu({
|
|
148
|
-
name:
|
|
149
|
+
name: wordingFrom(this)(DATA_VIEW_NUMBER_FORMAT),
|
|
149
150
|
hide: () => !this.column.dataUpdate ||
|
|
150
151
|
this.column.type$.value !== 'number',
|
|
151
152
|
options: {
|
|
@@ -159,7 +160,7 @@ let DatabaseHeaderColumn = (() => {
|
|
|
159
160
|
style="font-size: var(--affine-font-base); scale: 1.2;"
|
|
160
161
|
>${format.symbol}</span
|
|
161
162
|
>`,
|
|
162
|
-
name: format.
|
|
163
|
+
name: wordingFrom(this)(format.labelWording),
|
|
163
164
|
select: () => {
|
|
164
165
|
if (data.format === format.type)
|
|
165
166
|
return;
|
|
@@ -179,17 +180,17 @@ let DatabaseHeaderColumn = (() => {
|
|
|
179
180
|
menu.group({
|
|
180
181
|
items: [
|
|
181
182
|
menu.action({
|
|
182
|
-
name:
|
|
183
|
+
name: wordingFrom(this)(DATA_VIEW_FILTER),
|
|
183
184
|
prefix: FilterIcon(),
|
|
184
185
|
select: () => this._addFilter(),
|
|
185
186
|
}),
|
|
186
187
|
menu.action({
|
|
187
|
-
name:
|
|
188
|
+
name: wordingFrom(this)(DATA_VIEW_SORT_ASCENDING),
|
|
188
189
|
prefix: SortIcon(),
|
|
189
190
|
select: () => this._addSort(false),
|
|
190
191
|
}),
|
|
191
192
|
menu.action({
|
|
192
|
-
name:
|
|
193
|
+
name: wordingFrom(this)(DATA_VIEW_SORT_DESCENDING),
|
|
193
194
|
prefix: SortIcon(),
|
|
194
195
|
select: () => this._addSort(true),
|
|
195
196
|
}),
|
|
@@ -198,7 +199,8 @@ let DatabaseHeaderColumn = (() => {
|
|
|
198
199
|
menu.group({
|
|
199
200
|
items: [
|
|
200
201
|
menu.action({
|
|
201
|
-
name:
|
|
202
|
+
name: wordingFrom(this)(DATA_VIEW_INSERT_LEFT),
|
|
203
|
+
hide: () => this.tableViewManager.propertiesLocked$.value,
|
|
202
204
|
prefix: InsertLeftIcon(),
|
|
203
205
|
select: () => {
|
|
204
206
|
this.tableViewManager.propertyAdd({
|
|
@@ -220,7 +222,8 @@ let DatabaseHeaderColumn = (() => {
|
|
|
220
222
|
},
|
|
221
223
|
}),
|
|
222
224
|
menu.action({
|
|
223
|
-
name:
|
|
225
|
+
name: wordingFrom(this)(DATA_VIEW_INSERT_RIGHT),
|
|
226
|
+
hide: () => this.tableViewManager.propertiesLocked$.value,
|
|
224
227
|
prefix: InsertRightIcon(),
|
|
225
228
|
select: () => {
|
|
226
229
|
this.tableViewManager.propertyAdd({
|
|
@@ -242,7 +245,7 @@ let DatabaseHeaderColumn = (() => {
|
|
|
242
245
|
},
|
|
243
246
|
}),
|
|
244
247
|
menu.action({
|
|
245
|
-
name:
|
|
248
|
+
name: wordingFrom(this)(VIEWS_BAR_MOVE_LEFT),
|
|
246
249
|
prefix: MoveLeftIcon(),
|
|
247
250
|
hide: () => this.column.isFirst$.value,
|
|
248
251
|
select: () => {
|
|
@@ -257,7 +260,7 @@ let DatabaseHeaderColumn = (() => {
|
|
|
257
260
|
},
|
|
258
261
|
}),
|
|
259
262
|
menu.action({
|
|
260
|
-
name:
|
|
263
|
+
name: wordingFrom(this)(VIEWS_BAR_MOVE_RIGHT),
|
|
261
264
|
prefix: MoveRightIcon(),
|
|
262
265
|
hide: () => this.column.isLast$.value,
|
|
263
266
|
select: () => {
|
|
@@ -379,15 +382,16 @@ let DatabaseHeaderColumn = (() => {
|
|
|
379
382
|
if (this.tableViewManager.readonly$.value) {
|
|
380
383
|
return;
|
|
381
384
|
}
|
|
382
|
-
if (this.column.type$.value === 'title') {
|
|
385
|
+
if (this.column.type$.value === 'title' || !this.column.typeCanSet) {
|
|
383
386
|
return;
|
|
384
387
|
}
|
|
385
388
|
event.stopPropagation();
|
|
389
|
+
const wording = wordingFrom(this);
|
|
386
390
|
popMenu(popupTargetFromElement(this), {
|
|
387
391
|
options: {
|
|
388
392
|
items: this.tableViewManager.propertyMetas$.value.map(config => {
|
|
389
393
|
return menu.action({
|
|
390
|
-
name: config.config
|
|
394
|
+
name: propertyTypeName(wording, config.config),
|
|
391
395
|
isSelected: config.type === this.column.type$.value,
|
|
392
396
|
prefix: renderUniLit(config.renderer.icon),
|
|
393
397
|
select: () => {
|
|
@@ -37,6 +37,8 @@ import { cssVarV2 } from '@toeverything/theme/v2';
|
|
|
37
37
|
import { css, html, LitElement, unsafeCSS } from 'lit';
|
|
38
38
|
import { property } from 'lit/decorators.js';
|
|
39
39
|
import { formatNumber } from '../../../../property-presets/number/utils/formatter.js';
|
|
40
|
+
import { DATA_VIEW_DECIMALS_DECREASE, DATA_VIEW_DECIMALS_INCREASE, } from '../../../../translations.js';
|
|
41
|
+
import { wordingFrom } from '../../../../core/utils/wording.js';
|
|
40
42
|
const IncreaseDecimalPlacesIcon = html `
|
|
41
43
|
<svg
|
|
42
44
|
width="24"
|
|
@@ -133,7 +135,7 @@ let DatabaseNumberFormatBar = (() => {
|
|
|
133
135
|
<div class="number-format-decimal-places">
|
|
134
136
|
<button
|
|
135
137
|
class="number-format-toolbar-button"
|
|
136
|
-
aria-label="
|
|
138
|
+
aria-label="${wordingFrom(this)(DATA_VIEW_DECIMALS_DECREASE)}"
|
|
137
139
|
@click=${this._decrementDecimalPlaces}
|
|
138
140
|
>
|
|
139
141
|
${DecreaseDecimalPlacesIcon}
|
|
@@ -141,7 +143,7 @@ let DatabaseNumberFormatBar = (() => {
|
|
|
141
143
|
|
|
142
144
|
<button
|
|
143
145
|
class="number-format-toolbar-button"
|
|
144
|
-
aria-label="
|
|
146
|
+
aria-label="${wordingFrom(this)(DATA_VIEW_DECIMALS_INCREASE)}"
|
|
145
147
|
@click=${this._incrementDecimalPlaces}
|
|
146
148
|
>
|
|
147
149
|
${IncreaseDecimalPlacesIcon}
|