@formicoidea/labre-core 0.47.1 → 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 +48 -4
- 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-block-embed-doc/embed-linked-doc-block/configs/new-doc.d.ts +25 -0
- package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/configs/new-doc.js +71 -0
- package/dist/_pkgs/affine-block-embed-doc/embed-linked-doc-block/configs/slash-menu.js +3 -11
- 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/index.d.ts +1 -1
- package/dist/_pkgs/affine-fragment-doc-title/index.js +1 -1
- package/dist/_pkgs/affine-fragment-doc-title/title-band/band-cell.d.ts +30 -0
- package/dist/_pkgs/affine-fragment-doc-title/title-band/band-cell.js +137 -0
- package/dist/_pkgs/affine-fragment-doc-title/title-band/format.d.ts +7 -19
- package/dist/_pkgs/affine-fragment-doc-title/title-band/format.js +0 -38
- package/dist/_pkgs/affine-fragment-doc-title/title-band/show-here.d.ts +19 -0
- package/dist/_pkgs/affine-fragment-doc-title/title-band/show-here.js +61 -0
- package/dist/_pkgs/affine-fragment-doc-title/title-band/title-band.d.ts +33 -18
- package/dist/_pkgs/affine-fragment-doc-title/title-band/title-band.js +263 -205
- package/dist/_pkgs/affine-fragment-doc-title/translations.d.ts +7 -4
- package/dist/_pkgs/affine-fragment-doc-title/translations.js +12 -9
- 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/linked-doc-creation-service.d.ts +15 -6
- package/dist/_pkgs/affine-shared/services/telemetry-service/database.d.ts +59 -0
- package/dist/_pkgs/affine-shared/services/title-band-service.d.ts +34 -7
- package/dist/_pkgs/affine-shared/utils/model/doc.d.ts +10 -2
- package/dist/_pkgs/affine-shared/utils/model/doc.js +17 -7
- 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 +25 -2
- package/dist/_pkgs/data-view/core/component/tags/multi-tag-select.js +81 -32
- 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 +4 -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/index.d.ts +1 -0
- package/dist/_pkgs/data-view/core/property/index.js +1 -0
- package/dist/_pkgs/data-view/core/property/standalone-cell.d.ts +109 -0
- package/dist/_pkgs/data-view/core/property/standalone-cell.js +324 -0
- 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 +14 -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 +3 -1
- package/dist/_pkgs/data-view/property-presets/select/cell-renderer.js +3 -1
- package/dist/_pkgs/data-view/property-presets/text/cell-renderer.js +3 -1
- 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
|
@@ -35,13 +35,16 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
35
35
|
import { menu, popFilterableSimpleMenu, popupTargetFromElement, } from '../../../../affine-components/context-menu/index.js';
|
|
36
36
|
import { SignalWatcher, WithDisposable } from '../../../../global/lit/index.js';
|
|
37
37
|
import { AddCursorIcon } from '@blocksuite/icons/lit';
|
|
38
|
-
import { ShadowlessElement } from '../../../../std/index.js';
|
|
38
|
+
import { ShadowlessElement, stdContext } from '../../../../std/index.js';
|
|
39
|
+
import { consume } from '@lit/context';
|
|
39
40
|
import { css, nothing } from 'lit';
|
|
40
41
|
import { property } from 'lit/decorators.js';
|
|
41
42
|
import { repeat } from 'lit/directives/repeat.js';
|
|
42
43
|
import { html } from 'lit/static-html.js';
|
|
43
44
|
import { GroupTitle } from '../../../core/group-by/group-title.js';
|
|
45
|
+
import { groupToggleStyles, hideGroupAction, renderGroupToggle, } from '../../../core/group-by/group-visibility.js';
|
|
44
46
|
import { dragHandler } from '../../../core/utils/wc-dnd/dnd-context.js';
|
|
47
|
+
import { wordingOf } from '../../../core/utils/wording.js';
|
|
45
48
|
const styles = css `
|
|
46
49
|
affine-data-view-kanban-group {
|
|
47
50
|
width: 260px;
|
|
@@ -114,9 +117,38 @@ const styles = css `
|
|
|
114
117
|
.sortable-drag {
|
|
115
118
|
background-color: var(--affine-background-primary-color);
|
|
116
119
|
}
|
|
120
|
+
|
|
121
|
+
.group-body[hidden] {
|
|
122
|
+
display: none;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@media (pointer: coarse) {
|
|
126
|
+
.group-header {
|
|
127
|
+
height: auto;
|
|
128
|
+
min-height: 44px;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.group-header-main {
|
|
133
|
+
flex: 1 1 auto;
|
|
134
|
+
min-width: 0;
|
|
135
|
+
display: flex;
|
|
136
|
+
align-items: center;
|
|
137
|
+
justify-content: space-between;
|
|
138
|
+
gap: 8px;
|
|
139
|
+
overflow: hidden;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.dv-kanban-hidden-groups {
|
|
143
|
+
width: 260px;
|
|
144
|
+
flex-shrink: 0;
|
|
145
|
+
}
|
|
117
146
|
`;
|
|
118
147
|
let KanbanGroup = (() => {
|
|
119
148
|
let _classSuper = SignalWatcher(WithDisposable(ShadowlessElement));
|
|
149
|
+
let _std_decorators;
|
|
150
|
+
let _std_initializers = [];
|
|
151
|
+
let _std_extraInitializers = [];
|
|
120
152
|
let _group_decorators;
|
|
121
153
|
let _group_initializers = [];
|
|
122
154
|
let _group_extraInitializers = [];
|
|
@@ -126,24 +158,35 @@ let KanbanGroup = (() => {
|
|
|
126
158
|
return class KanbanGroup extends _classSuper {
|
|
127
159
|
static {
|
|
128
160
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
161
|
+
_std_decorators = [consume({ context: stdContext })];
|
|
129
162
|
_group_decorators = [property({ attribute: false })];
|
|
130
163
|
_kanbanViewLogic_decorators = [property({ attribute: false })];
|
|
164
|
+
__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);
|
|
131
165
|
__esDecorate(this, null, _group_decorators, { kind: "accessor", name: "group", static: false, private: false, access: { has: obj => "group" in obj, get: obj => obj.group, set: (obj, value) => { obj.group = value; } }, metadata: _metadata }, _group_initializers, _group_extraInitializers);
|
|
132
166
|
__esDecorate(this, null, _kanbanViewLogic_decorators, { kind: "accessor", name: "kanbanViewLogic", static: false, private: false, access: { has: obj => "kanbanViewLogic" in obj, get: obj => obj.kanbanViewLogic, set: (obj, value) => { obj.kanbanViewLogic = value; } }, metadata: _metadata }, _kanbanViewLogic_initializers, _kanbanViewLogic_extraInitializers);
|
|
133
167
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
134
168
|
}
|
|
135
|
-
static { this.styles = styles; }
|
|
169
|
+
static { this.styles = [styles, groupToggleStyles]; }
|
|
170
|
+
#std_accessor_storage;
|
|
171
|
+
/** Absent outside an editor host: the wordings read English. */
|
|
172
|
+
get std() { return this.#std_accessor_storage; }
|
|
173
|
+
set std(value) { this.#std_accessor_storage = value; }
|
|
136
174
|
render() {
|
|
137
175
|
const cards = this.group.rows;
|
|
176
|
+
// Folded (personal, B8): the header and its count stay, the cards go.
|
|
177
|
+
const collapsed = this.group.manager.collapsed$(this.group.key).value;
|
|
138
178
|
return html `
|
|
139
179
|
<div class="group-header" ${dragHandler(this.group.key)}>
|
|
140
|
-
${
|
|
180
|
+
${renderGroupToggle(this.group, wordingOf(this.std))}
|
|
181
|
+
<div class="group-header-main">
|
|
182
|
+
${GroupTitle(this.group, {
|
|
141
183
|
readonly: this.view.readonly$.value,
|
|
142
184
|
clickAdd: this.clickAddCardInStart,
|
|
143
185
|
clickOps: this.clickGroupOptions,
|
|
144
186
|
})}
|
|
187
|
+
</div>
|
|
145
188
|
</div>
|
|
146
|
-
<div class="group-body">
|
|
189
|
+
<div class="group-body" ?hidden="${collapsed}">
|
|
147
190
|
${repeat(cards, row => row.rowId, row => {
|
|
148
191
|
return html `
|
|
149
192
|
<affine-data-view-kanban-card
|
|
@@ -178,7 +221,8 @@ let KanbanGroup = (() => {
|
|
|
178
221
|
}
|
|
179
222
|
constructor() {
|
|
180
223
|
super(...arguments);
|
|
181
|
-
this
|
|
224
|
+
this.#std_accessor_storage = __runInitializers(this, _std_initializers, void 0);
|
|
225
|
+
this.clickAddCard = (__runInitializers(this, _std_extraInitializers), () => {
|
|
182
226
|
const id = this.view.addCard('end', this.group.key);
|
|
183
227
|
requestAnimationFrame(() => {
|
|
184
228
|
const columnId = this.view.mainProperties$.value.titleColumn ||
|
|
@@ -194,7 +238,7 @@ let KanbanGroup = (() => {
|
|
|
194
238
|
};
|
|
195
239
|
});
|
|
196
240
|
this.requestUpdate();
|
|
197
|
-
};
|
|
241
|
+
});
|
|
198
242
|
this.clickAddCardInStart = () => {
|
|
199
243
|
const id = this.view.addCard('start', this.group.key);
|
|
200
244
|
requestAnimationFrame(() => {
|
|
@@ -225,6 +269,7 @@ let KanbanGroup = (() => {
|
|
|
225
269
|
this.requestUpdate();
|
|
226
270
|
},
|
|
227
271
|
}),
|
|
272
|
+
hideGroupAction(this.group, wordingOf(this.std)),
|
|
228
273
|
menu.action({
|
|
229
274
|
name: 'Delete Cards',
|
|
230
275
|
select: () => {
|
|
@@ -29,7 +29,7 @@ export class KanbanViewUILogic extends DataViewUILogicBase {
|
|
|
29
29
|
});
|
|
30
30
|
this.groups$ = computed(() => {
|
|
31
31
|
const groupTrait = this.groupTrait$.value;
|
|
32
|
-
return groupTrait?.
|
|
32
|
+
return groupTrait?.visibleGroups$.value || [];
|
|
33
33
|
});
|
|
34
34
|
this.clearSelection = () => {
|
|
35
35
|
this.selectionController.clear();
|
|
@@ -204,6 +204,10 @@ export class KanbanViewUI extends DataViewUIBase {
|
|
|
204
204
|
>
|
|
205
205
|
${this.renderGroups()}
|
|
206
206
|
${groupTrait ? this.logic.renderAddGroup(groupTrait) : ''}
|
|
207
|
+
<dv-hidden-groups
|
|
208
|
+
class="dv-kanban-hidden-groups"
|
|
209
|
+
.groupTrait="${groupTrait}"
|
|
210
|
+
></dv-hidden-groups>
|
|
207
211
|
</div>
|
|
208
212
|
`;
|
|
209
213
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FlatSingleView, type FlatViewDataType } from '../flat/flat-view-manager.js';
|
|
2
|
+
export declare const listViewType: {
|
|
3
|
+
type: "list";
|
|
4
|
+
createModel: <Data extends import("../../index.js").DataViewDataType>(model: import("../../index.js").DataViewModelConfig<Data>) => import("../../index.js").DataViewModel<"list", Data> & {
|
|
5
|
+
createMeta: (renderer: import("../../index.js").DataViewRendererConfig) => import("../../index.js").ViewMeta<"list", Data>;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export type ListViewData = FlatViewDataType<typeof listViewType.type>;
|
|
9
|
+
export declare class ListSingleView extends FlatSingleView<ListViewData> {
|
|
10
|
+
get type(): string;
|
|
11
|
+
}
|
|
12
|
+
export declare const listViewModel: import("../../index.js").DataViewModel<"list", ListViewData> & {
|
|
13
|
+
createMeta: (renderer: import("../../index.js").DataViewRendererConfig) => import("../../index.js").ViewMeta<"list", ListViewData>;
|
|
14
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { viewType } from '../../core/view/data-view.js';
|
|
2
|
+
import { VIEW_NAME_LIST } from '../../translations.js';
|
|
3
|
+
import { FlatSingleView, flatViewDefaultData, } from '../flat/flat-view-manager.js';
|
|
4
|
+
export const listViewType = viewType('list');
|
|
5
|
+
export class ListSingleView extends FlatSingleView {
|
|
6
|
+
get type() {
|
|
7
|
+
return this.data$.value?.mode ?? listViewType.type;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export const listViewModel = listViewType.createModel({
|
|
11
|
+
defaultName: VIEW_NAME_LIST[1],
|
|
12
|
+
defaultNameKey: VIEW_NAME_LIST[0],
|
|
13
|
+
dataViewManager: ListSingleView,
|
|
14
|
+
defaultData: flatViewDefaultData,
|
|
15
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function listEffects(): void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { FlatViewUI, FlatViewUILogic } from '../flat/flat-view-ui.js';
|
|
2
|
+
import type { ListSingleView } from './define.js';
|
|
3
|
+
/**
|
|
4
|
+
* The list preset (ADR 0035 §1, B7): one line per row, the title on the left
|
|
5
|
+
* and the visible properties on the right, each drawn by the cell a table
|
|
6
|
+
* draws, so a select is the table's tag and opens the table's tag menu. An
|
|
7
|
+
* empty value draws no chip, as in Notion's list: it is set from the opened
|
|
8
|
+
* row. Narrow screens wrap the chips under the title.
|
|
9
|
+
*/
|
|
10
|
+
export declare class ListViewUILogic extends FlatViewUILogic<ListSingleView> {
|
|
11
|
+
renderer: import("../../../affine-shared/types/uni-component.js").UniComponent<unknown, {}>;
|
|
12
|
+
}
|
|
13
|
+
export declare class ListViewUI extends FlatViewUI<ListViewUILogic> {
|
|
14
|
+
static styles: import("lit").CSSResult[];
|
|
15
|
+
connectedCallback(): void;
|
|
16
|
+
private renderRow;
|
|
17
|
+
private renderNewRow;
|
|
18
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
19
|
+
}
|
|
20
|
+
declare global {
|
|
21
|
+
interface HTMLElementTagNameMap {
|
|
22
|
+
'dv-list-view-ui': ListViewUI;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { PlusIcon } from '@blocksuite/icons/lit';
|
|
2
|
+
import { cssVarV2 } from '@toeverything/theme/v2';
|
|
3
|
+
import { css, html, nothing, unsafeCSS } from 'lit';
|
|
4
|
+
import { repeat } from 'lit/directives/repeat.js';
|
|
5
|
+
import { groupToggleStyles } from '../../core/group-by/group-visibility.js';
|
|
6
|
+
import { createUniComponentFromWebComponent } from '../../core/utils/uni-component/uni-component.js';
|
|
7
|
+
import { DATA_VIEW_NEW_PAGE } from '../../translations.js';
|
|
8
|
+
import { flatGroupStyles, flatOpenButtonStyles, FlatViewUI, FlatViewUILogic, } from '../flat/flat-view-ui.js';
|
|
9
|
+
/**
|
|
10
|
+
* The list preset (ADR 0035 §1, B7): one line per row, the title on the left
|
|
11
|
+
* and the visible properties on the right, each drawn by the cell a table
|
|
12
|
+
* draws, so a select is the table's tag and opens the table's tag menu. An
|
|
13
|
+
* empty value draws no chip, as in Notion's list: it is set from the opened
|
|
14
|
+
* row. Narrow screens wrap the chips under the title.
|
|
15
|
+
*/
|
|
16
|
+
export class ListViewUILogic extends FlatViewUILogic {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this.renderer = createUniComponentFromWebComponent(ListViewUI);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export class ListViewUI extends FlatViewUI {
|
|
23
|
+
static { this.styles = [
|
|
24
|
+
flatOpenButtonStyles,
|
|
25
|
+
flatGroupStyles,
|
|
26
|
+
groupToggleStyles,
|
|
27
|
+
css `
|
|
28
|
+
dv-list-view-ui {
|
|
29
|
+
display: block;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.dv-list {
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-direction: column;
|
|
35
|
+
padding: 4px 0 8px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.dv-list-row {
|
|
39
|
+
position: relative;
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
gap: 8px;
|
|
43
|
+
min-height: 36px;
|
|
44
|
+
padding: 2px 40px 2px 8px;
|
|
45
|
+
box-sizing: border-box;
|
|
46
|
+
border-bottom: 1px solid
|
|
47
|
+
${unsafeCSS(cssVarV2.layer.insideBorder.border)};
|
|
48
|
+
cursor: pointer;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.dv-list-row-title {
|
|
52
|
+
flex: 1 1 auto;
|
|
53
|
+
min-width: 0;
|
|
54
|
+
overflow: hidden;
|
|
55
|
+
font-size: var(--data-view-cell-text-size);
|
|
56
|
+
line-height: var(--data-view-cell-text-line-height);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.dv-list-row-properties {
|
|
60
|
+
display: flex;
|
|
61
|
+
flex: 0 1 auto;
|
|
62
|
+
align-items: center;
|
|
63
|
+
justify-content: flex-end;
|
|
64
|
+
gap: 8px;
|
|
65
|
+
min-width: 0;
|
|
66
|
+
max-width: 60%;
|
|
67
|
+
overflow: hidden;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.dv-list-row-property {
|
|
71
|
+
display: flex;
|
|
72
|
+
align-items: center;
|
|
73
|
+
flex: 0 1 auto;
|
|
74
|
+
min-width: 0;
|
|
75
|
+
max-width: 200px;
|
|
76
|
+
overflow: hidden;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.dv-list-row .dv-flat-open {
|
|
80
|
+
top: 50%;
|
|
81
|
+
transform: translateY(-50%);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.dv-list-row:focus-within .dv-flat-open {
|
|
85
|
+
visibility: visible;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.dv-list-new {
|
|
89
|
+
display: flex;
|
|
90
|
+
align-items: center;
|
|
91
|
+
gap: 4px;
|
|
92
|
+
min-height: 36px;
|
|
93
|
+
padding: 0 8px;
|
|
94
|
+
border: none;
|
|
95
|
+
background: transparent;
|
|
96
|
+
color: var(--affine-text-secondary-color);
|
|
97
|
+
font-family: inherit;
|
|
98
|
+
font-size: var(--data-view-cell-text-size);
|
|
99
|
+
text-align: start;
|
|
100
|
+
cursor: pointer;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.dv-list-new svg {
|
|
104
|
+
width: 16px;
|
|
105
|
+
height: 16px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@media (hover: hover) {
|
|
109
|
+
.dv-list-row:hover,
|
|
110
|
+
.dv-list-new:hover {
|
|
111
|
+
background-color: var(--affine-hover-color);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.dv-list-row:hover .dv-flat-open {
|
|
115
|
+
visibility: visible;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@media (pointer: coarse) {
|
|
120
|
+
.dv-list-row,
|
|
121
|
+
.dv-list-new {
|
|
122
|
+
min-height: 44px;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
@media (max-width: 640px) {
|
|
127
|
+
.dv-list-row {
|
|
128
|
+
flex-wrap: wrap;
|
|
129
|
+
padding-top: 6px;
|
|
130
|
+
padding-bottom: 6px;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.dv-list-row-title {
|
|
134
|
+
flex-basis: 100%;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.dv-list-row-properties {
|
|
138
|
+
flex-wrap: wrap;
|
|
139
|
+
justify-content: flex-start;
|
|
140
|
+
max-width: 100%;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
`,
|
|
144
|
+
]; }
|
|
145
|
+
connectedCallback() {
|
|
146
|
+
super.connectedCallback();
|
|
147
|
+
this.dataset.testid = 'dv-list-view';
|
|
148
|
+
}
|
|
149
|
+
renderRow(rowId) {
|
|
150
|
+
const view = this.view;
|
|
151
|
+
const title = view.titleProperty$.value;
|
|
152
|
+
// A value still loading keeps its chip, as a skeleton.
|
|
153
|
+
const chips = view.bodyProperties$.value.filter(property => {
|
|
154
|
+
const cell = property.cellGetOrCreate(rowId);
|
|
155
|
+
return cell.status$?.value === 'pending' || !cell.isEmpty$.value;
|
|
156
|
+
});
|
|
157
|
+
return html `<div
|
|
158
|
+
class="dv-list-row"
|
|
159
|
+
data-testid="dv-list-row"
|
|
160
|
+
data-row-id="${rowId}"
|
|
161
|
+
@click="${this.onRowClick}"
|
|
162
|
+
>
|
|
163
|
+
<div class="dv-list-row-title">
|
|
164
|
+
${title ? this.renderCell(title, rowId, true) : nothing}
|
|
165
|
+
</div>
|
|
166
|
+
${chips.length
|
|
167
|
+
? html `<div class="dv-list-row-properties">
|
|
168
|
+
${repeat(chips, property => property.id, property => html `<div class="dv-list-row-property">
|
|
169
|
+
${this.renderCell(property, rowId)}
|
|
170
|
+
</div>`)}
|
|
171
|
+
</div>`
|
|
172
|
+
: nothing}
|
|
173
|
+
${this.renderOpenButton(rowId)}
|
|
174
|
+
</div>`;
|
|
175
|
+
}
|
|
176
|
+
renderNewRow(groupKey) {
|
|
177
|
+
if (this.view.readonly$.value)
|
|
178
|
+
return nothing;
|
|
179
|
+
return html `<button
|
|
180
|
+
class="dv-list-new"
|
|
181
|
+
data-testid="dv-flat-new"
|
|
182
|
+
@click="${() => this.logic.addRow('end', groupKey)}"
|
|
183
|
+
>
|
|
184
|
+
${PlusIcon()}<span>${this.wording(DATA_VIEW_NEW_PAGE)}</span>
|
|
185
|
+
</button>`;
|
|
186
|
+
}
|
|
187
|
+
render() {
|
|
188
|
+
return html `${this.renderHeaderWidget()}
|
|
189
|
+
${this.renderGrouped((rows, group) => html `<div class="dv-list">
|
|
190
|
+
${repeat(rows, row => row.rowId, row => this.renderRow(row.rowId))}
|
|
191
|
+
${this.renderNewRow(group?.key)}
|
|
192
|
+
</div>`)}`;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const listViewMeta: import("../../index.js").ViewMeta<"list", import("./define.js").ListViewData>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createIcon } from '../../core/utils/uni-icon.js';
|
|
2
|
+
import { listViewModel } from './define.js';
|
|
3
|
+
import { ListViewUILogic } from './list-view.js';
|
|
4
|
+
// One UI for both: the chips wrap under the title on a narrow screen.
|
|
5
|
+
export const listViewMeta = listViewModel.createMeta({
|
|
6
|
+
icon: createIcon('DatabaseListViewIcon'),
|
|
7
|
+
pcLogic: () => ListViewUILogic,
|
|
8
|
+
// Named, not left to the pc fallback: a touch screen draws this UI on
|
|
9
|
+
// purpose (B5, `mobile-editing.unit.spec.ts`).
|
|
10
|
+
mobileLogic: () => ListViewUILogic,
|
|
11
|
+
});
|
|
@@ -1,18 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Gets the collapsed state for a specific table group from sessionStorage.
|
|
7
|
-
* @param viewId - The ID of the table view
|
|
8
|
-
* @param groupKey - The key of the group
|
|
9
|
-
* @returns The collapsed state as a boolean, or false if not found or invalid
|
|
2
|
+
* The table's two entry points into the shared, per-device group fold
|
|
3
|
+
* (`core/group-by/collapsed-state.ts`, ADR 0035 B8), kept so the pc and
|
|
4
|
+
* mobile table groups read and write it as before.
|
|
10
5
|
*/
|
|
11
6
|
export declare function getCollapsedState(viewId: string, groupKey: string): boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Sets the collapsed state for a specific table group in sessionStorage.
|
|
14
|
-
* @param viewId - The ID of the table view
|
|
15
|
-
* @param groupKey - The key of the group
|
|
16
|
-
* @param collapsed - The collapsed state to store
|
|
17
|
-
*/
|
|
18
7
|
export declare function setCollapsedState(viewId: string, groupKey: string, collapsed: boolean): void;
|
|
@@ -1,36 +1,12 @@
|
|
|
1
|
+
import { groupCollapsed$, groupCollapsedSet, } from '../../core/group-by/collapsed-state.js';
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Gets the collapsed state for a specific table group from sessionStorage.
|
|
7
|
-
* @param viewId - The ID of the table view
|
|
8
|
-
* @param groupKey - The key of the group
|
|
9
|
-
* @returns The collapsed state as a boolean, or false if not found or invalid
|
|
3
|
+
* The table's two entry points into the shared, per-device group fold
|
|
4
|
+
* (`core/group-by/collapsed-state.ts`, ADR 0035 B8), kept so the pc and
|
|
5
|
+
* mobile table groups read and write it as before.
|
|
10
6
|
*/
|
|
11
7
|
export function getCollapsedState(viewId, groupKey) {
|
|
12
|
-
|
|
13
|
-
const value = sessionStorage.getItem(`affine:table-group:${viewId}:${groupKey}:collapsed`);
|
|
14
|
-
if (!value)
|
|
15
|
-
return false;
|
|
16
|
-
const parsed = JSON.parse(value);
|
|
17
|
-
return typeof parsed === 'boolean' ? parsed : false;
|
|
18
|
-
}
|
|
19
|
-
catch {
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
8
|
+
return groupCollapsed$(viewId, groupKey).peek();
|
|
22
9
|
}
|
|
23
|
-
/**
|
|
24
|
-
* Sets the collapsed state for a specific table group in sessionStorage.
|
|
25
|
-
* @param viewId - The ID of the table view
|
|
26
|
-
* @param groupKey - The key of the group
|
|
27
|
-
* @param collapsed - The collapsed state to store
|
|
28
|
-
*/
|
|
29
10
|
export function setCollapsedState(viewId, groupKey, collapsed) {
|
|
30
|
-
|
|
31
|
-
sessionStorage.setItem(`affine:table-group:${viewId}:${groupKey}:collapsed`, JSON.stringify(collapsed));
|
|
32
|
-
}
|
|
33
|
-
catch {
|
|
34
|
-
// ignore
|
|
35
|
-
}
|
|
11
|
+
groupCollapsedSet(viewId, groupKey, collapsed);
|
|
36
12
|
}
|
|
@@ -4,6 +4,8 @@ export declare const DEFAULT_COLUMN_WIDTH = 180;
|
|
|
4
4
|
export declare const DEFAULT_COLUMN_MIN_WIDTH = 100;
|
|
5
5
|
/** column title height */
|
|
6
6
|
export declare const DEFAULT_COLUMN_TITLE_HEIGHT = 34;
|
|
7
|
+
/** A finger's minimum target on the mobile renderers (B5, ADR 0035 §1). */
|
|
8
|
+
export declare const MOBILE_TOUCH_TARGET = 44;
|
|
7
9
|
/** column title height */
|
|
8
10
|
export declare const DEFAULT_ADD_BUTTON_WIDTH = 40;
|
|
9
11
|
export declare const LEFT_TOOL_BAR_WIDTH = 24;
|
|
@@ -4,6 +4,8 @@ export const DEFAULT_COLUMN_WIDTH = 180;
|
|
|
4
4
|
export const DEFAULT_COLUMN_MIN_WIDTH = 100;
|
|
5
5
|
/** column title height */
|
|
6
6
|
export const DEFAULT_COLUMN_TITLE_HEIGHT = 34;
|
|
7
|
+
/** A finger's minimum target on the mobile renderers (B5, ADR 0035 §1). */
|
|
8
|
+
export const MOBILE_TOUCH_TARGET = 44;
|
|
7
9
|
/** column title height */
|
|
8
10
|
export const DEFAULT_ADD_BUTTON_WIDTH = 40;
|
|
9
11
|
export const LEFT_TOOL_BAR_WIDTH = 24;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { viewType } from '../../core/view/data-view.js';
|
|
2
|
+
import { VIEW_NAME_TABLE } from '../../translations.js';
|
|
2
3
|
import { TableSingleView } from './table-view-manager.js';
|
|
3
4
|
export const tableViewType = viewType('table');
|
|
4
5
|
export const tableViewModel = tableViewType.createModel({
|
|
5
|
-
defaultName:
|
|
6
|
+
defaultName: VIEW_NAME_TABLE[1],
|
|
7
|
+
defaultNameKey: VIEW_NAME_TABLE[0],
|
|
6
8
|
dataViewManager: TableSingleView,
|
|
7
9
|
defaultData: viewManager => {
|
|
8
10
|
return {
|
|
@@ -37,7 +37,7 @@ import { ShadowlessElement } from '../../../../std/index.js';
|
|
|
37
37
|
import { computed, effect, signal } from '@preact/signals-core';
|
|
38
38
|
import { css } from 'lit';
|
|
39
39
|
import { property } from 'lit/decorators.js';
|
|
40
|
-
import { renderUniLit, } from '../../../core/index.js';
|
|
40
|
+
import { renderCellStatus, renderUniLit, } from '../../../core/index.js';
|
|
41
41
|
import { TableViewAreaSelection } from '../selection.js';
|
|
42
42
|
let MobileTableCell = (() => {
|
|
43
43
|
let _classSuper = SignalWatcher(WithDisposable(ShadowlessElement));
|
|
@@ -136,6 +136,9 @@ let MobileTableCell = (() => {
|
|
|
136
136
|
return;
|
|
137
137
|
}
|
|
138
138
|
const { view } = renderer;
|
|
139
|
+
const status = renderCellStatus(this.cell$.value);
|
|
140
|
+
if (status)
|
|
141
|
+
return status;
|
|
139
142
|
this.view.lockRows(this.isEditing$.value);
|
|
140
143
|
this.dataset['editing'] = `${this.isEditing$.value}`;
|
|
141
144
|
const props = {
|
|
@@ -43,7 +43,7 @@ import { styleMap } from 'lit/directives/style-map.js';
|
|
|
43
43
|
import { html } from 'lit/static-html.js';
|
|
44
44
|
import { inputConfig, typeConfig } from '../../../core/common/property-menu.js';
|
|
45
45
|
import { numberFormats } from '../../../property-presets/number/utils/formats.js';
|
|
46
|
-
import {
|
|
46
|
+
import { MOBILE_TOUCH_TARGET } from '../consts.js';
|
|
47
47
|
let MobileTableColumnHeader = (() => {
|
|
48
48
|
let _classSuper = SignalWatcher(WithDisposable(ShadowlessElement));
|
|
49
49
|
let _column_decorators;
|
|
@@ -249,7 +249,7 @@ let MobileTableColumnHeader = (() => {
|
|
|
249
249
|
render() {
|
|
250
250
|
const column = this.column;
|
|
251
251
|
const style = styleMap({
|
|
252
|
-
height:
|
|
252
|
+
height: MOBILE_TOUCH_TARGET + 'px',
|
|
253
253
|
});
|
|
254
254
|
return html `
|
|
255
255
|
<div
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { ShadowlessElement } from '../../../../std/index.js';
|
|
1
|
+
import { type BlockStdScope, ShadowlessElement } from '../../../../std/index.js';
|
|
2
2
|
import type { Group } from '../../../core/group-by/trait.js';
|
|
3
3
|
import type { Row } from '../../../core/index.js';
|
|
4
4
|
import type { MobileTableViewUILogic } from './table-view-ui-logic.js';
|
|
5
5
|
declare const MobileTableGroup_base: typeof ShadowlessElement & import("../../../../global/utils/types.js").Constructor<import("../../../../global/lit/with-disposable.js").DisposableClass>;
|
|
6
6
|
export declare class MobileTableGroup extends MobileTableGroup_base {
|
|
7
7
|
static styles: import("lit").CSSResult;
|
|
8
|
+
/** Absent outside an editor host: the wordings read English. */
|
|
9
|
+
accessor std: BlockStdScope;
|
|
8
10
|
collapsed$: import("@preact/signals-core").Signal<boolean>;
|
|
9
11
|
private storageLoaded;
|
|
10
12
|
/**
|
|
@@ -35,13 +35,17 @@ var __runInitializers = (this && this.__runInitializers) || function (thisArg, i
|
|
|
35
35
|
import { menu, popFilterableSimpleMenu, popupTargetFromElement, } from '../../../../affine-components/context-menu/index.js';
|
|
36
36
|
import { SignalWatcher, WithDisposable } from '../../../../global/lit/index.js';
|
|
37
37
|
import { PlusIcon, ToggleDownIcon, ToggleRightIcon, } from '@blocksuite/icons/lit';
|
|
38
|
-
import { ShadowlessElement } from '../../../../std/index.js';
|
|
38
|
+
import { ShadowlessElement, stdContext } from '../../../../std/index.js';
|
|
39
|
+
import { consume } from '@lit/context';
|
|
39
40
|
import { signal } from '@preact/signals-core';
|
|
40
41
|
import { cssVarV2 } from '@toeverything/theme/v2';
|
|
41
42
|
import { css, html, nothing, unsafeCSS } from 'lit';
|
|
42
43
|
import { property } from 'lit/decorators.js';
|
|
43
44
|
import { repeat } from 'lit/directives/repeat.js';
|
|
44
45
|
import { GroupTitle } from '../../../core/group-by/group-title.js';
|
|
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, } from '../../../translations.js';
|
|
45
49
|
import { getCollapsedState, setCollapsedState } from '../collapsed-state.js';
|
|
46
50
|
import { LEFT_TOOL_BAR_WIDTH } from '../consts.js';
|
|
47
51
|
const styles = css `
|
|
@@ -94,6 +98,9 @@ const styles = css `
|
|
|
94
98
|
`;
|
|
95
99
|
let MobileTableGroup = (() => {
|
|
96
100
|
let _classSuper = SignalWatcher(WithDisposable(ShadowlessElement));
|
|
101
|
+
let _std_decorators;
|
|
102
|
+
let _std_initializers = [];
|
|
103
|
+
let _std_extraInitializers = [];
|
|
97
104
|
let _group_decorators;
|
|
98
105
|
let _group_initializers = [];
|
|
99
106
|
let _group_extraInitializers = [];
|
|
@@ -103,13 +110,19 @@ let MobileTableGroup = (() => {
|
|
|
103
110
|
return class MobileTableGroup extends _classSuper {
|
|
104
111
|
static {
|
|
105
112
|
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
113
|
+
_std_decorators = [consume({ context: stdContext })];
|
|
106
114
|
_group_decorators = [property({ attribute: false })];
|
|
107
115
|
_tableViewLogic_decorators = [property({ attribute: false })];
|
|
116
|
+
__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);
|
|
108
117
|
__esDecorate(this, null, _group_decorators, { kind: "accessor", name: "group", static: false, private: false, access: { has: obj => "group" in obj, get: obj => obj.group, set: (obj, value) => { obj.group = value; } }, metadata: _metadata }, _group_initializers, _group_extraInitializers);
|
|
109
118
|
__esDecorate(this, null, _tableViewLogic_decorators, { kind: "accessor", name: "tableViewLogic", static: false, private: false, access: { has: obj => "tableViewLogic" in obj, get: obj => obj.tableViewLogic, set: (obj, value) => { obj.tableViewLogic = value; } }, metadata: _metadata }, _tableViewLogic_initializers, _tableViewLogic_extraInitializers);
|
|
110
119
|
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
111
120
|
}
|
|
112
121
|
static { this.styles = styles; }
|
|
122
|
+
#std_accessor_storage;
|
|
123
|
+
/** Absent outside an editor host: the wordings read English. */
|
|
124
|
+
get std() { return this.#std_accessor_storage; }
|
|
125
|
+
set std(value) { this.#std_accessor_storage = value; }
|
|
113
126
|
/**
|
|
114
127
|
* Read the stored collapsed state once, as soon as the group and its view
|
|
115
128
|
* are both known. Reading it earlier would key the lookup on a missing view
|
|
@@ -190,7 +203,8 @@ let MobileTableGroup = (() => {
|
|
|
190
203
|
}
|
|
191
204
|
constructor() {
|
|
192
205
|
super(...arguments);
|
|
193
|
-
this
|
|
206
|
+
this.#std_accessor_storage = __runInitializers(this, _std_initializers, void 0);
|
|
207
|
+
this.collapsed$ = (__runInitializers(this, _std_extraInitializers), signal(false));
|
|
194
208
|
this.storageLoaded = false;
|
|
195
209
|
this._toggleCollapse = (e) => {
|
|
196
210
|
e?.stopPropagation();
|
|
@@ -225,6 +239,7 @@ let MobileTableGroup = (() => {
|
|
|
225
239
|
});
|
|
226
240
|
},
|
|
227
241
|
}),
|
|
242
|
+
hideGroupAction(group, wordingOf(this.std)),
|
|
228
243
|
menu.action({
|
|
229
244
|
name: 'Delete Cards',
|
|
230
245
|
select: () => {
|
|
@@ -246,9 +261,9 @@ let MobileTableGroup = (() => {
|
|
|
246
261
|
class="group-toggle-btn"
|
|
247
262
|
role="button"
|
|
248
263
|
aria-expanded=${this.collapsed$.value ? 'false' : 'true'}
|
|
249
|
-
aria-label=${this.collapsed$.value
|
|
250
|
-
?
|
|
251
|
-
:
|
|
264
|
+
aria-label=${wordingOf(this.std)(this.collapsed$.value
|
|
265
|
+
? DATA_VIEW_GROUP_EXPAND
|
|
266
|
+
: DATA_VIEW_GROUP_COLLAPSE)}
|
|
252
267
|
tabindex="0"
|
|
253
268
|
@click=${this._toggleCollapse}
|
|
254
269
|
@keydown=${(e) => {
|