Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:sparkles: Improve database calendar interactions and display settings https://github.com/siyuan-note/siyuan/issues/13740

Daniel2ff118adf08e
diff --git a/app/appearance/langs/ar.json b/app/appearance/langs/ar.json
index 8eaccb64df..06a70ef333 100644
--- a/app/appearance/langs/ar.json
+++ b/app/appearance/langs/ar.json
@@ -1,4 +1,6 @@
{
+ "calendarRowLimit": "عدد صفوف العناصر المعروضة",
+ "calendarNewOnDate": "إضافة عنصر في هذا التاريخ",
"leftRightSidebarLayout": "تخطيط الشريطين الجانبيين الأيسر والأيمن",
"calendarView": "التقويم",
"calendarToday": "اليوم",
diff --git a/app/appearance/langs/de.json b/app/appearance/langs/de.json
index 8adc8d2e07..8d084f5be2 100644
--- a/app/appearance/langs/de.json
+++ b/app/appearance/langs/de.json
@@ -1,4 +1,6 @@
{
+ "calendarRowLimit": "Angezeigte Eintragszeilen",
+ "calendarNewOnDate": "Eintrag an diesem Datum erstellen",
"leftRightSidebarLayout": "Layout der linken und rechten Seitenleiste",
"calendarView": "Kalender",
"calendarToday": "Heute",
diff --git a/app/appearance/langs/en.json b/app/appearance/langs/en.json
index 8b2595f325..ab9e5b3f7f 100644
--- a/app/appearance/langs/en.json
+++ b/app/appearance/langs/en.json
@@ -1,4 +1,6 @@
{
+ "calendarRowLimit": "Visible item rows",
+ "calendarNewOnDate": "New item on this date",
"leftRightSidebarLayout": "Left and right sidebar layout",
"calendarView": "Calendar",
"calendarToday": "Today",
diff --git a/app/appearance/langs/es.json b/app/appearance/langs/es.json
index b6eab93af0..6c4b13c79d 100644
--- a/app/appearance/langs/es.json
+++ b/app/appearance/langs/es.json
@@ -1,4 +1,6 @@
{
+ "calendarRowLimit": "Filas de elementos visibles",
+ "calendarNewOnDate": "Nuevo elemento en esta fecha",
"leftRightSidebarLayout": "Disposición de las barras laterales izquierda y derecha",
"calendarView": "Calendario",
"calendarToday": "Hoy",
diff --git a/app/appearance/langs/fr.json b/app/appearance/langs/fr.json
index 172fef1b5e..26fcd2e3b6 100644
--- a/app/appearance/langs/fr.json
+++ b/app/appearance/langs/fr.json
@@ -1,4 +1,6 @@
{
+ "calendarRowLimit": "Lignes d’éléments visibles",
+ "calendarNewOnDate": "Nouvel élément à cette date",
"leftRightSidebarLayout": "Disposition des barres latérales gauche et droite",
"calendarView": "Calendrier",
"calendarToday": "Aujourd’hui",
diff --git a/app/appearance/langs/he.json b/app/appearance/langs/he.json
index 42f622d2ff..6b3141936d 100644
--- a/app/appearance/langs/he.json
+++ b/app/appearance/langs/he.json
@@ -1,4 +1,6 @@
{
+ "calendarRowLimit": "שורות פריטים מוצגות",
+ "calendarNewOnDate": "פריט חדש בתאריך זה",
"leftRightSidebarLayout": "פריסת סרגלי הצד השמאלי והימני",
"calendarView": "לוח שנה",
"calendarToday": "היום",
diff --git a/app/appearance/langs/hi.json b/app/appearance/langs/hi.json
index d35b941604..abb737d93e 100644
--- a/app/appearance/langs/hi.json
+++ b/app/appearance/langs/hi.json
@@ -1,4 +1,6 @@
{
+ "calendarRowLimit": "दिखाई देने वाली आइटम पंक्तियाँ",
+ "calendarNewOnDate": "इस तारीख पर नया आइटम",
"leftRightSidebarLayout": "बाएं और दाएं साइडबार का लेआउट",
"calendarView": "कैलेंडर",
"calendarToday": "आज",
diff --git a/app/appearance/langs/id.json b/app/appearance/langs/id.json
index 2bd5c84f0c..4b3c2bd276 100644
--- a/app/appearance/langs/id.json
+++ b/app/appearance/langs/id.json
@@ -1,4 +1,6 @@
{
+ "calendarRowLimit": "Baris item yang ditampilkan",
+ "calendarNewOnDate": "Item baru pada tanggal ini",
"leftRightSidebarLayout": "Tata letak bilah sisi kiri dan kanan",
"calendarView": "Kalender",
"calendarToday": "Hari ini",
diff --git a/app/appearance/langs/it.json b/app/appearance/langs/it.json
index 51415215d4..dbab29f541 100644
--- a/app/appearance/langs/it.json
+++ b/app/appearance/langs/it.json
@@ -1,4 +1,6 @@
{
+ "calendarRowLimit": "Righe di elementi visibili",
+ "calendarNewOnDate": "Nuovo elemento in questa data",
"leftRightSidebarLayout": "Layout delle barre laterali sinistra e destra",
"calendarView": "Calendario",
"calendarToday": "Oggi",
diff --git a/app/appearance/langs/ja.json b/app/appearance/langs/ja.json
index aa05360b19..4cb0436bb4 100644
--- a/app/appearance/langs/ja.json
+++ b/app/appearance/langs/ja.json
@@ -1,4 +1,6 @@
{
+ "calendarRowLimit": "項目の表示行数",
+ "calendarNewOnDate": "この日付に項目を作成",
"leftRightSidebarLayout": "左右のサイドバーのレイアウト",
"calendarView": "カレンダー",
"calendarToday": "今日",
diff --git a/app/appearance/langs/ko.json b/app/appearance/langs/ko.json
index 394a144ff9..fd66b95eeb 100644
--- a/app/appearance/langs/ko.json
+++ b/app/appearance/langs/ko.json
@@ -1,4 +1,6 @@
{
+ "calendarRowLimit": "표시할 항목 행 수",
+ "calendarNewOnDate": "이 날짜에 새 항목 만들기",
"leftRightSidebarLayout": "왼쪽 및 오른쪽 사이드바 레이아웃",
"calendarView": "달력",
"calendarToday": "오늘",
diff --git a/app/appearance/langs/nl.json b/app/appearance/langs/nl.json
index 76d144cb77..9ad2089a45 100644
--- a/app/appearance/langs/nl.json
+++ b/app/appearance/langs/nl.json
@@ -1,4 +1,6 @@
{
+ "calendarRowLimit": "Zichtbare itemrijen",
+ "calendarNewOnDate": "Nieuw item op deze datum",
"leftRightSidebarLayout": "Indeling van linker- en rechterzijbalk",
"calendarView": "Kalender",
"calendarToday": "Vandaag",
diff --git a/app/appearance/langs/pl.json b/app/appearance/langs/pl.json
index e39578e0ec..86814a0fc9 100644
--- a/app/appearance/langs/pl.json
+++ b/app/appearance/langs/pl.json
@@ -1,4 +1,6 @@
{
+ "calendarRowLimit": "Widoczne wiersze elementów",
+ "calendarNewOnDate": "Nowy element w tym dniu",
"leftRightSidebarLayout": "Układ lewego i prawego panelu bocznego",
"calendarView": "Kalendarz",
"calendarToday": "Dzisiaj",
diff --git a/app/appearance/langs/pt-BR.json b/app/appearance/langs/pt-BR.json
index 980959d216..be48a72ea3 100644
--- a/app/appearance/langs/pt-BR.json
+++ b/app/appearance/langs/pt-BR.json
@@ -1,4 +1,6 @@
{
+ "calendarRowLimit": "Linhas de itens visíveis",
+ "calendarNewOnDate": "Novo item nesta data",
"leftRightSidebarLayout": "Layout das barras laterais esquerda e direita",
"calendarView": "Calendário",
"calendarToday": "Hoje",
diff --git a/app/appearance/langs/ru.json b/app/appearance/langs/ru.json
index e10cd3c499..d4b6830a28 100644
--- a/app/appearance/langs/ru.json
+++ b/app/appearance/langs/ru.json
@@ -1,4 +1,6 @@
{
+ "calendarRowLimit": "Число видимых строк записей",
+ "calendarNewOnDate": "Создать запись на эту дату",
"leftRightSidebarLayout": "Расположение левой и правой боковых панелей",
"calendarView": "Календарь",
"calendarToday": "Сегодня",
diff --git a/app/appearance/langs/sk.json b/app/appearance/langs/sk.json
index ffabd404c1..424e320938 100644
--- a/app/appearance/langs/sk.json
+++ b/app/appearance/langs/sk.json
@@ -1,4 +1,6 @@
{
+ "calendarRowLimit": "Počet zobrazených riadkov položiek",
+ "calendarNewOnDate": "Nová položka v tento deň",
"leftRightSidebarLayout": "Rozloženie ľavého a pravého bočného panela",
"calendarView": "Kalendár",
"calendarToday": "Dnes",
diff --git a/app/appearance/langs/sr.json b/app/appearance/langs/sr.json
index d3eda5584e..cb03f741c6 100644
--- a/app/appearance/langs/sr.json
+++ b/app/appearance/langs/sr.json
@@ -1,4 +1,6 @@
{
+ "calendarRowLimit": "Број видљивих редова ставки",
+ "calendarNewOnDate": "Нова ставка на овај датум",
"leftRightSidebarLayout": "Raspored leve i desne bočne trake",
"calendarView": "Календар",
"calendarToday": "Данас",
diff --git a/app/appearance/langs/th.json b/app/appearance/langs/th.json
index d9122b84a1..88b6d1f912 100644
--- a/app/appearance/langs/th.json
+++ b/app/appearance/langs/th.json
@@ -1,4 +1,6 @@
{
+ "calendarRowLimit": "จำนวนแถวรายการที่แสดง",
+ "calendarNewOnDate": "สร้างรายการในวันที่นี้",
"leftRightSidebarLayout": "เค้าโครงแถบด้านข้างซ้ายและขวา",
"calendarView": "ปฏิทิน",
"calendarToday": "วันนี้",
diff --git a/app/appearance/langs/tr.json b/app/appearance/langs/tr.json
index 67afe42d84..26938dbf8f 100644
--- a/app/appearance/langs/tr.json
+++ b/app/appearance/langs/tr.json
@@ -1,4 +1,6 @@
{
+ "calendarRowLimit": "Görünür öğe satırları",
+ "calendarNewOnDate": "Bu tarihte yeni öğe",
"leftRightSidebarLayout": "Sol ve sağ kenar çubuğu düzeni",
"calendarView": "Takvim",
"calendarToday": "Bugün",
diff --git a/app/appearance/langs/uk.json b/app/appearance/langs/uk.json
index ab00db4a5d..53b21d33b8 100644
--- a/app/appearance/langs/uk.json
+++ b/app/appearance/langs/uk.json
@@ -1,4 +1,6 @@
{
+ "calendarRowLimit": "Кількість видимих рядків записів",
+ "calendarNewOnDate": "Створити запис на цю дату",
"leftRightSidebarLayout": "Розташування лівої та правої бічних панелей",
"calendarView": "Календар",
"calendarToday": "Сьогодні",
diff --git a/app/appearance/langs/zh-CN.json b/app/appearance/langs/zh-CN.json
index 8999bc6ad1..6c86026af0 100644
--- a/app/appearance/langs/zh-CN.json
+++ b/app/appearance/langs/zh-CN.json
@@ -1,4 +1,6 @@
{
+ "calendarRowLimit": "条目显示行数",
+ "calendarNewOnDate": "在此日期新建条目",
"leftRightSidebarLayout": "左右栏布局",
"calendarView": "日历",
"calendarToday": "今天",
diff --git a/app/appearance/langs/zh-TW.json b/app/appearance/langs/zh-TW.json
index cdefa7b426..a68f7d5bf4 100644
--- a/app/appearance/langs/zh-TW.json
+++ b/app/appearance/langs/zh-TW.json
@@ -1,4 +1,6 @@
{
+ "calendarRowLimit": "項目顯示行數",
+ "calendarNewOnDate": "在此日期新增項目",
"leftRightSidebarLayout": "左右欄佈局",
"calendarView": "日曆",
"calendarToday": "今天",
diff --git a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20240208172514-9dsv6na.sy b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20240208172514-9dsv6na.sy
index 1533f6f7b0..10eb78d6ab 100644
--- a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20240208172514-9dsv6na.sy
+++ b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20240208172514-9dsv6na.sy
@@ -7,7 +7,7 @@
"id": "20240208172514-9dsv6na",
"title": "Database",
"type": "doc",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
@@ -687,7 +687,7 @@
"HeadingLevel": 3,
"Properties": {
"id": "20260920225154-tz8a00o",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
@@ -716,7 +716,7 @@
"ListData": {},
"Properties": {
"id": "20260920225154-qqxdh7e",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
@@ -802,7 +802,7 @@
},
"Properties": {
"id": "20260920225154-vblms0p",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
@@ -810,12 +810,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20260920225154-4wsrq3z",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
"Type": "NodeText",
- "Data": "Browsing: Use the previous/next buttons, Today, or the date picker. Month view collapses crowded dates; use the more button to expand that week. Dates follow your local time zone"
+ "Data": "Browsing: Use the previous/next buttons, Today, or the date picker. Month view collapses crowded dates; use the more button to expand that week. Dates follow your local time zone. Month view shows four, five, or six weeks as needed"
}
]
}
@@ -830,7 +830,7 @@
},
"Properties": {
"id": "20260920225154-ronkl9y",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
@@ -838,12 +838,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20260920225154-3lkyx9g",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
"Type": "NodeText",
- "Data": "Editing: Click an entry to open its existing database entry editor. With an ordinary date field, use the plus button on a day to create an entry, drag an entry to move its dates, or drag its end handles to adjust its range. Date changes support undo. On touch screens, use the move handle on the entry to drag it"
+ "Data": "Editing: Click an entry to open its existing database entry editor. With an ordinary date field, use the plus button on a day to create an entry, drag an entry to move its dates, or drag its end handles to adjust its range. Date changes support undo. On touch screens, use the move handle on the entry to drag it. New entries focus the primary field automatically. Dragging previews the resulting dates and highlights their cells; changes are saved on release. The context menu also offers copying, creating and binding documents, adding to another database, editing fields, and creating an entry on the selected date"
}
]
}
@@ -914,7 +914,7 @@
},
"Properties": {
"id": "20260920225154-3w6c98i",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
@@ -922,12 +922,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20260920225154-8p9e3ov",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
"Type": "NodeText",
- "Data": "View settings: Filtering, sorting, field visibility, and new-entry templates use the existing database settings. A single-select field can supply entry colors. Grouping is suspended in calendar layout, and its settings are retained when switching back"
+ "Data": "View settings: Filtering, sorting, field visibility, and new-entry templates use the existing database settings. A single-select field can supply entry colors. Grouping is suspended in calendar layout, and its settings are retained when switching back. Visible item rows can be set to 3, 5, 10, or all in the layout settings, with 3 as the default. This setting is saved per calendar view and only controls folding in month view; week view displays all entries, and the complete date range is still loaded"
}
]
}
diff --git a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20240208113259-nykkvaq.sy b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20240208113259-nykkvaq.sy
index 211af136d6..4f06f4e31e 100644
--- a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20240208113259-nykkvaq.sy
+++ b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20240208113259-nykkvaq.sy
@@ -7,7 +7,7 @@
"id": "20240208113259-nykkvaq",
"title": "数据库",
"type": "doc",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
@@ -687,7 +687,7 @@
"HeadingLevel": 3,
"Properties": {
"id": "20260920225154-xtg5hn3",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
@@ -716,7 +716,7 @@
"ListData": {},
"Properties": {
"id": "20260920225154-09h9ysf",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
@@ -802,7 +802,7 @@
},
"Properties": {
"id": "20260920225154-s45tw42",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
@@ -810,12 +810,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20260920225154-g06jlzk",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
"Type": "NodeText",
- "Data": "浏览日期:使用上一页、下一页、今天或日期选择器切换日期。月视图会折叠条目较多的日期,点击更多按钮可展开所在周。日期按当前设备的本地时区显示"
+ "Data": "浏览日期:使用上一页、下一页、今天或日期选择器切换日期。月视图会折叠条目较多的日期,点击更多按钮可展开所在周。日期按当前设备的本地时区显示。月视图按当月实际需要显示四、五或六周"
}
]
}
@@ -830,7 +830,7 @@
},
"Properties": {
"id": "20260920225154-4u642qz",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
@@ -838,12 +838,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20260920225154-gev35tw",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
"Type": "NodeText",
- "Data": "编辑条目:点击条目使用现有数据库条目编辑界面。使用普通日期字段时,可通过日期格内的加号创建条目,拖动条目调整日期,或拖动两端调整日期范围。日期修改支持撤销,触屏设备可拖动条目上的移动手柄"
+ "Data": "编辑条目:点击条目使用现有数据库条目编辑界面。使用普通日期字段时,可通过日期格内的加号创建条目,拖动条目调整日期,或拖动两端调整日期范围。日期修改支持撤销,触屏设备可拖动条目上的移动手柄。新建后自动聚焦主键字段;拖动时预览调整后的日期范围并高亮对应日期格,松手后保存。右键菜单还支持复制、新建文档并绑定、添加到其他数据库、编辑字段及在所选日期新建条目"
}
]
}
@@ -914,7 +914,7 @@
},
"Properties": {
"id": "20260920225154-t3u47pu",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
@@ -922,12 +922,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20260920225154-zbl70ln",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
"Type": "NodeText",
- "Data": "视图设置:沿用数据库的过滤、排序、字段显隐和新条目模板,可选择单选字段作为条目颜色来源。日历布局暂不应用分组,切换回其他布局时保留原有分组设置"
+ "Data": "视图设置:沿用数据库的过滤、排序、字段显隐和新条目模板,可选择单选字段作为条目颜色来源。日历布局暂不应用分组,切换回其他布局时保留原有分组设置。布局设置中的条目显示行数可选 3、5、10 或全部,默认为 3,保存在当前日历视图中。该设置仅控制月视图折叠,周视图显示全部条目,日期范围内的数据仍完整加载"
}
]
}
diff --git a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20240208171522-y7dxcno.sy b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20240208171522-y7dxcno.sy
index defb049f92..0c86199310 100644
--- a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20240208171522-y7dxcno.sy
+++ b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20240208171522-y7dxcno.sy
@@ -7,7 +7,7 @@
"id": "20240208171522-y7dxcno",
"title": "資料庫",
"type": "doc",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
@@ -687,7 +687,7 @@
"HeadingLevel": 3,
"Properties": {
"id": "20260920225154-xknvq29",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
@@ -716,7 +716,7 @@
"ListData": {},
"Properties": {
"id": "20260920225154-mpwyzfe",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
@@ -802,7 +802,7 @@
},
"Properties": {
"id": "20260920225154-aibikc5",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
@@ -810,12 +810,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20260920225154-t9xok0u",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
"Type": "NodeText",
- "Data": "瀏覽日期:使用上一頁、下一頁、今天或日期選擇器切換日期。月視圖會摺疊項目較多的日期,點擊更多按鈕可展開所在週。日期依目前裝置的本地時區顯示"
+ "Data": "瀏覽日期:使用上一頁、下一頁、今天或日期選擇器切換日期。月視圖會摺疊項目較多的日期,點擊更多按鈕可展開所在週。日期依目前裝置的本地時區顯示。月視圖依當月實際需要顯示四、五或六週"
}
]
}
@@ -830,7 +830,7 @@
},
"Properties": {
"id": "20260920225154-8jo2ad8",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
@@ -838,12 +838,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20260920225154-wxzch42",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
"Type": "NodeText",
- "Data": "編輯項目:點擊項目使用既有資料庫項目編輯介面。使用一般日期欄位時,可透過日期格內的加號建立項目,拖曳項目調整日期,或拖曳兩端調整日期範圍。日期修改支援復原,觸控裝置可拖曳項目上的移動把手"
+ "Data": "編輯項目:點擊項目使用既有資料庫項目編輯介面。使用一般日期欄位時,可透過日期格內的加號建立項目,拖曳項目調整日期,或拖曳兩端調整日期範圍。日期修改支援復原,觸控裝置可拖曳項目上的移動把手。新增後自動聚焦主鍵欄位;拖曳時預覽調整後的日期範圍並醒目提示對應日期格,放開後儲存。右鍵選單也支援複製、新建文件並綁定、新增至其他資料庫、編輯欄位及在所選日期新增項目"
}
]
}
@@ -914,7 +914,7 @@
},
"Properties": {
"id": "20260920225154-0na3b4b",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
@@ -922,12 +922,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20260920225154-dp0msus",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
"Type": "NodeText",
- "Data": "視圖設定:沿用資料庫的篩選、排序、欄位顯示與隱藏及新項目範本,可選擇單選欄位作為項目顏色來源。日曆佈局暫不套用分組,切換回其他佈局時保留原有分組設定"
+ "Data": "視圖設定:沿用資料庫的篩選、排序、欄位顯示與隱藏及新項目範本,可選擇單選欄位作為項目顏色來源。日曆佈局暫不套用分組,切換回其他佈局時保留原有分組設定。佈局設定中的項目顯示行數可選 3、5、10 或全部,預設為 3,儲存在目前日曆視圖中。此設定僅控制月視圖摺疊,週視圖顯示全部項目,日期範圍內的資料仍完整載入"
}
]
}
diff --git a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-3eaevtp.sy b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-3eaevtp.sy
index 95fb5ea747..f18905af3a 100644
--- a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-3eaevtp.sy
+++ b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-3eaevtp.sy
@@ -8,7 +8,7 @@
"id": "20240530101000-3eaevtp",
"title": "データベース",
"type": "doc",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
@@ -688,7 +688,7 @@
"HeadingLevel": 3,
"Properties": {
"id": "20260920225154-vntgfc2",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
@@ -717,7 +717,7 @@
"ListData": {},
"Properties": {
"id": "20260920225154-wh2lupo",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
@@ -803,7 +803,7 @@
},
"Properties": {
"id": "20260920225154-z254pew",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
@@ -811,12 +811,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20260920225154-6vyud50",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
"Type": "NodeText",
- "Data": "日付の移動:前へ、次へ、今日のボタンや日付選択で移動します。月表示でエントリが多い日は折りたたまれ、追加表示ボタンでその週を展開できます。日付は端末のローカルタイムゾーンで表示されます"
+ "Data": "日付の移動:前へ、次へ、今日のボタンや日付選択で移動します。月表示でエントリが多い日は折りたたまれ、追加表示ボタンでその週を展開できます。日付は端末のローカルタイムゾーンで表示されます。月表示は、その月に必要な4、5、6週を表示します"
}
]
}
@@ -831,7 +831,7 @@
},
"Properties": {
"id": "20260920225154-cng1h41",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
@@ -839,12 +839,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20260920225154-ibvcks0",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
"Type": "NodeText",
- "Data": "編集:エントリをクリックすると既存のデータベースエントリ編集画面が開きます。通常の日付フィールドでは、日付欄のプラスボタンで作成し、エントリのドラッグで日付を移動し、両端のドラッグで範囲を変更できます。日付の変更は元に戻せます。タッチ画面ではエントリの移動ハンドルをドラッグします"
+ "Data": "編集:エントリをクリックすると既存のデータベースエントリ編集画面が開きます。通常の日付フィールドでは、日付欄のプラスボタンで作成し、エントリのドラッグで日付を移動し、両端のドラッグで範囲を変更できます。日付の変更は元に戻せます。タッチ画面ではエントリの移動ハンドルをドラッグします。作成後は主キーフィールドに自動でフォーカスします。ドラッグ中は変更後の日付範囲をプレビューし、対象の日付欄を強調表示します。変更は放したときに保存されます。右クリックメニューからコピー、文書の作成と関連付け、別のデータベースへの追加、フィールドの編集、選択した日付での新規作成も行えます"
}
]
}
@@ -915,7 +915,7 @@
},
"Properties": {
"id": "20260920225154-fwx2u0n",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
@@ -923,12 +923,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20260920225154-v9bc5j0",
- "updated": "20260920225154"
+ "updated": "20260921201901"
},
"Children": [
{
"Type": "NodeText",
- "Data": "ビュー設定:既存のフィルター、ソート、フィールドの表示設定、新規エントリのテンプレートを使用します。単一選択フィールドをエントリの色に使えます。カレンダーではグループ化を適用せず、ほかのレイアウトに戻すと元のグループ設定が保持されています"
+ "Data": "ビュー設定:既存のフィルター、ソート、フィールドの表示設定、新規エントリのテンプレートを使用します。単一選択フィールドをエントリの色に使えます。カレンダーではグループ化を適用せず、ほかのレイアウトに戻すと元のグループ設定が保持されています。レイアウト設定の項目の表示行数は3、5、10、すべてから選べ、初期値は3です。設定はカレンダービューごとに保存され、月表示の折りたたみだけに適用されます。週表示は全項目を表示し、対象の日付範囲のデータは常にすべて読み込みます"
}
]
}
diff --git a/app/src/assets/scss/business/_av-calendar.scss b/app/src/assets/scss/business/_av-calendar.scss
index 421008143e..55ed1b0359 100644
--- a/app/src/assets/scss/business/_av-calendar.scss
+++ b/app/src/assets/scss/business/_av-calendar.scss
@@ -97,6 +97,7 @@
}
.av__calendar-week {
+ position: relative;
&:first-child {
border-top: 0;
}
@@ -280,16 +281,58 @@
}
.av__calendar-drop {
- background: var(--b3-theme-primary-light);
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ background: color-mix(in srgb, var(--b3-theme-primary) 12%, transparent);
outline: 1px solid var(--b3-theme-primary);
outline-offset: -1px;
}
+ .av__calendar-preview-layer {
+ position: absolute;
+ inset: 0;
+ pointer-events: none;
+ overflow: hidden;
+ z-index: 1;
+ }
+
+ .av__calendar-preview {
+ position: absolute;
+ box-sizing: border-box;
+ border-color: var(--b3-theme-primary);
+ box-shadow: var(--b3-point-shadow);
+ }
+
+ .av__calendar-item--dragging {
+ opacity: .35;
+ }
+
+ .av__calendar-item.av__gallery-item--select {
+ border-color: var(--b3-theme-primary);
+ }
+
.av__calendar--dragging {
cursor: grabbing;
+
+ .av__calendar-item {
+ cursor: grabbing;
+ }
+ }
+
+ .av__calendar--invalid,
+ .av__calendar--invalid .av__calendar-item {
+ cursor: not-allowed;
}
.av__calendar-more {
+ min-width: 0;
+ font-family: inherit;
+ font-size: 12px;
+ line-height: 20px;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
margin: 3px;
padding: 2px 6px;
border: 0;
diff --git a/app/src/editor/databaseRow.ts b/app/src/editor/databaseRow.ts
index ee17619fa8..38e8f472f8 100644
--- a/app/src/editor/databaseRow.ts
+++ b/app/src/editor/databaseRow.ts
@@ -6,6 +6,7 @@ import {Protyle} from "../protyle";
import {getEditorHorizontalPadding} from "../protyle/ui/padding";
import {searchMarkRender} from "../protyle/render/searchMarkRender";
import {registerDatabaseRowRefresh} from "../protyle/render/av/databaseRowRefresh";
+import {focusNewDatabasePrimary} from "../protyle/render/av/primaryFocus";
export const newDatabaseRowModel = (options: {
app: App,
@@ -20,6 +21,7 @@ export const newDatabaseRowModel = (options: {
matchedValueID?: string,
matchedKeyID?: string,
keywords?: string[],
+ focusPrimary?: boolean,
},
}) => {
let customModel: Custom;
@@ -70,6 +72,7 @@ export const newDatabaseRowModel = (options: {
previousBodyElement.replaceWith(element);
updateLayout(custom);
updateTitle(custom, element);
+ focusNewDatabasePrimary(custom.element, contextProtyle, data);
if (!data.keywords?.length) {
return;
}
diff --git a/app/src/protyle/render/av/action.ts b/app/src/protyle/render/av/action.ts
index 6ea60781d6..1d7288843a 100644
--- a/app/src/protyle/render/av/action.ts
+++ b/app/src/protyle/render/av/action.ts
@@ -859,6 +859,7 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle
export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement | undefined, position: IPosition, options?: {
blockElement?: HTMLElement;
anchorElement?: HTMLElement;
+ customize?: (menu: Menu) => void;
}) => {
hideElements(["hint"], protyle);
if (rowElement?.classList.contains("av__row--header")) {
@@ -869,6 +870,8 @@ export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement | undef
return false;
}
const avType = blockElement.getAttribute("data-av-type") as TAVView;
+ const editable = !protyle.disabled && !window.siyuan.isPublish &&
+ !protyle.options.history?.created && !protyle.options.history?.snapshot;
if (rowElement && isTableLikeView(avType)) {
if (!rowElement.classList.contains("av__row--select")) {
clearSelect(["row"], blockElement);
@@ -1134,14 +1137,16 @@ export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement | undef
});
}
- copyMenu.push({
- id: "duplicate",
- iconHTML: "",
- label: window.siyuan.languages.duplicateCopy,
- click: () => {
- duplicateRows(blockElement, protyle, selectedItemInfos.map(item => item.itemID));
- }
- });
+ if (editable) {
+ copyMenu.push({
+ id: "duplicate",
+ iconHTML: "",
+ label: window.siyuan.languages.duplicateCopy,
+ click: () => {
+ duplicateRows(blockElement, protyle, selectedItemInfos.map(item => item.itemID));
+ }
+ });
+ }
menu.addItem({
id: "copy",
@@ -1150,7 +1155,7 @@ export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement | undef
type: "submenu",
submenu: copyMenu
});
- if (!protyle.disabled) {
+ if (editable) {
const detachedItemIDs = selectedItems.filter(item => item.isDetached).map(item => item.itemID);
if (detachedItemIDs.length > 0) {
menu.addItem({
@@ -1229,7 +1234,7 @@ export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement | undef
});
}
});
- if (selectedItemInfos.length === 1) {
+ if (selectedItemInfos.length === 1 && avType !== "calendar") {
if (!primaryRows[0].isDetached) {
menu.addSeparator({id: "separator_1"});
}
@@ -1338,6 +1343,7 @@ ${window.siyuan.languages[isTableLikeView(avType) ? "insertRowAfter" : "insertIt
submenu: getAVEditFieldMenuItems(protyle, blockElement)
});
}
+ options?.customize?.(menu);
if (protyle) {
emitOpenMenu({
type: "open-menu-av",
diff --git a/app/src/protyle/render/av/batchEdit.ts b/app/src/protyle/render/av/batchEdit.ts
index 6c56b85957..80cbc28a30 100644
--- a/app/src/protyle/render/av/batchEdit.ts
+++ b/app/src/protyle/render/av/batchEdit.ts
@@ -40,7 +40,7 @@ const findItemCell = (view: IAVView, viewType: TAVView, itemID: string, fieldInd
}
return;
}
- const isTable = isTableLikeView(viewType);
+ const isTable = isTableLikeView(viewType) || viewType === "calendar";
if (isTable) {
const item = (view as IAVTable).rows?.find((currentItem) => currentItem.id === itemID);
return item?.cells[fieldIndex];
diff --git a/app/src/protyle/render/av/calendar/render.ts b/app/src/protyle/render/av/calendar/render.ts
index e295cffb9d..ca3098003a 100644
--- a/app/src/protyle/render/av/calendar/render.ts
+++ b/app/src/protyle/render/av/calendar/render.ts
@@ -1,7 +1,6 @@
import {Constants} from "../../../../constants";
import {openInputDialog} from "../../../../dialog/inputDialog";
import * as dayjs from "dayjs";
-import {Menu} from "../../../../plugin/Menu";
import {escapeAttr, escapeHtml} from "../../../../util/escape";
import {transaction} from "../../../wysiwyg/transaction";
import {renderCell} from "../cell";
@@ -13,9 +12,9 @@ import {openDatabaseRowByData} from "../openDatabaseRow";
import {avRender, genTabHeaderHTML, updateSearch} from "../render";
import {replaceAVContainer} from "../container";
import {renderAVRichTextElements} from "../richText";
-import {deleteRow} from "../row";
+import {avContextmenu} from "../action";
import {bindAvSearch} from "../search";
-import {getAVLoadedItemInfos, setAVData} from "../virtualScroll";
+import {setAVData} from "../virtualScroll";
import {addCalendarDays, calendarDay, calendarDayDistance, getCalendarInterval, ICalendarEvent, ICalendarSegment,
moveCalendarDate, packCalendarWeek, resizeCalendarDate} from "./date";
import {addCalendarDateField, bindCalendarSettings, getCalendarSettingsHTML, isCalendarDateColumn} from "./settings";
@@ -83,7 +82,8 @@ const getEventHTML = (segment: ICalendarSegment, view: IAVTable, editable: boole
</div>`;
};
-const bindCalendarDrag = (root: HTMLElement, protyle: IProtyle, blockElement: HTMLElement, events: Map<string, ICalendarEvent>) => {
+const bindCalendarDrag = (root: HTMLElement, protyle: IProtyle, blockElement: HTMLElement,
+ events: Map<string, ICalendarEvent>, view: IAVTable) => {
let suppressClick = false;
root.addEventListener("click", event => {
if (suppressClick) {
@@ -103,6 +103,10 @@ const bindCalendarDrag = (root: HTMLElement, protyle: IProtyle, blockElement: HT
}
const controller = new AbortController();
const getDay = (x: number, y: number) => {
+ const viewport = root.querySelector(".av__calendar-scroll").getBoundingClientRect();
+ if (x < viewport.left || x > viewport.right || y < viewport.top || y > viewport.bottom) {
+ return;
+ }
for (const week of root.querySelectorAll<HTMLElement>("[data-calendar-week]")) {
const rect = week.getBoundingClientRect();
if (y >= rect.top && y <= rect.bottom && x >= rect.left && x <= rect.right) {
@@ -113,17 +117,59 @@ const bindCalendarDrag = (root: HTMLElement, protyle: IProtyle, blockElement: HT
const origin = getDay(event.clientX, event.clientY);
let destination = origin;
let dragging = false;
+ const sourceItems = Array.from(root.querySelectorAll<HTMLElement>("[data-calendar-item]"))
+ .filter(element => element.dataset.calendarItem === entry.row.id);
+ const clearPreview = () => {
+ root.querySelectorAll(".av__calendar-preview-layer").forEach(element => element.remove());
+ };
+ const candidate = () => destination === undefined || origin === undefined ? undefined :
+ endpoint ? resizeCalendarDate(entry.date.value.date, endpoint, destination) :
+ moveCalendarDate(entry.date.value.date, calendarDayDistance(origin, destination));
+ const preview = () => {
+ clearPreview();
+ const date = candidate();
+ root.classList.toggle("av__calendar--invalid", !date);
+ if (!date) {
+ return;
+ }
+ const value = {...entry.date.value, date};
+ const next = {...entry, ...getCalendarInterval(value), date: {...entry.date, value}};
+ root.querySelectorAll<HTMLElement>("[data-calendar-week]").forEach(week => {
+ const segment = packCalendarWeek([next], Number(week.dataset.calendarWeek))[0];
+ if (!segment) {
+ return;
+ }
+ const layer = document.createElement("div");
+ layer.className = "av__calendar-preview-layer";
+ layer.setAttribute("aria-hidden", "true");
+ layer.innerHTML = `<div class="av__calendar-drop" style="left:${segment.column * 100 / 7}%;width:${segment.span * 100 / 7}%"></div>` +
+ getEventHTML(segment, view, false);
+ const card = layer.querySelector<HTMLElement>(".av__calendar-item");
+ card.classList.add("av__calendar-preview");
+ card.removeAttribute("data-calendar-item");
+ card.removeAttribute("data-id");
+ card.removeAttribute("tabindex");
+ card.style.left = `${segment.column * 100 / 7}%`;
+ card.style.width = `calc(${segment.span * 100 / 7}% - 4px)`;
+ card.style.top = `${week.querySelector(".av__calendar-days").getBoundingClientRect().height}px`;
+ week.append(layer);
+ });
+ };
const clean = () => {
controller.abort();
- root.classList.remove("av__calendar--dragging");
- root.querySelectorAll(".av__calendar-drop").forEach(element => element.classList.remove("av__calendar-drop"));
+ clearPreview();
+ root.classList.remove("av__calendar--dragging", "av__calendar--invalid");
+ sourceItems.forEach(element => element.classList.remove("av__calendar-item--dragging"));
if (dragging) {
suppressClick = true;
setTimeout(() => { suppressClick = false; });
}
};
document.addEventListener("pointermove", move => {
- if (move.pointerId !== event.pointerId || !root.isConnected) {
+ if (move.pointerId !== event.pointerId) {
+ return;
+ }
+ if (!root.isConnected) {
clean();
return;
}
@@ -133,25 +179,28 @@ const bindCalendarDrag = (root: HTMLElement, protyle: IProtyle, blockElement: HT
move.preventDefault();
dragging = true;
root.classList.add("av__calendar--dragging");
+ sourceItems.forEach(element => element.classList.add("av__calendar-item--dragging"));
destination = getDay(move.clientX, move.clientY);
- root.querySelectorAll<HTMLElement>("[data-calendar-day]").forEach(day => {
- day.classList.toggle("av__calendar-drop", Number(day.dataset.calendarDay) === destination);
- });
+ preview();
}, {signal: controller.signal, passive: false});
document.addEventListener("pointerup", up => {
if (up.pointerId !== event.pointerId) {
return;
}
- if (dragging && root.isConnected && destination !== undefined && origin !== undefined) {
- const date = endpoint ? resizeCalendarDate(entry.date.value.date, endpoint, destination) :
- moveCalendarDate(entry.date.value.date, calendarDayDistance(origin, destination));
+ destination = getDay(up.clientX, up.clientY);
+ if (dragging && root.isConnected) {
+ const date = candidate();
if (date && JSON.stringify(date) !== JSON.stringify(entry.date.value.date)) {
updateCalendarDate(protyle, blockElement, entry, date);
}
}
clean();
}, {signal: controller.signal});
- document.addEventListener("pointercancel", clean, {signal: controller.signal});
+ document.addEventListener("pointercancel", cancel => {
+ if (cancel.pointerId === event.pointerId) {
+ clean();
+ }
+ }, {signal: controller.signal});
window.addEventListener("blur", clean, {signal: controller.signal});
document.addEventListener("keydown", key => {
if (key.key === "Escape") {
@@ -165,6 +214,11 @@ const bindCalendarDrag = (root: HTMLElement, protyle: IProtyle, blockElement: HT
export const renderCalendar = async (blockElement: HTMLElement, protyle: IProtyle, data: IAV, cb?: (data: IAV) => void) => {
const view = data.view as IAVTable;
const state = getCalendarState(blockElement, data.viewID);
+ const rowLimit = view.calendar.rowLimit || 3;
+ if (state.rowLimit !== rowLimit) {
+ state.expandedWeeks.clear();
+ state.rowLimit = rowLimit;
+ }
const dateColumn = view.columns.find(field => field.id === view.calendar.dateKeyID && isCalendarDateColumn(field));
state.weekStart = view.calendar.weekStart;
state.dateType = dateColumn?.type;
@@ -209,8 +263,8 @@ export const renderCalendar = async (blockElement: HTMLElement, protyle: IProtyl
if (data.target?.status === "visible" && segments.some(segment => segment.event.row.id === data.target.itemID)) {
state.expandedWeeks.add(start);
}
- const expanded = state.mode === "week" || state.expandedWeeks.has(start);
- const visible = expanded ? segments : segments.filter(segment => segment.lane < 3);
+ const expanded = state.mode === "week" || rowLimit === -1 || state.expandedWeeks.has(start);
+ const visible = expanded ? segments : segments.filter(segment => segment.lane < rowLimit);
const maxLane = Math.max(0, ...visible.map(segment => segment.lane + 1));
const dayHeaders = Array.from({length: 7}, (_, day) => {
const timestamp = addCalendarDays(start, day);
@@ -221,7 +275,7 @@ export const renderCalendar = async (blockElement: HTMLElement, protyle: IProtyl
</div>`;
}).join("");
const overflow = Array.from({length: 7}, (_, day) => {
- const hidden = segments.filter(segment => segment.lane >= 3 && segment.column <= day && segment.column + segment.span > day).length;
+ const hidden = segments.filter(segment => segment.lane >= rowLimit && segment.column <= day && segment.column + segment.span > day).length;
return hidden && !expanded ? `<button class="av__calendar-more" data-calendar-expand="${start}" style="grid-column:${day + 1}">${escapeHtml(window.siyuan.languages.calendarMore.replace("${x}", hidden.toString()))}</button>` : "";
}).join("");
body += `<div class="av__calendar-week" data-calendar-week="${start}"><div class="av__calendar-days">${dayHeaders}</div>
@@ -263,7 +317,7 @@ export const renderCalendar = async (blockElement: HTMLElement, protyle: IProtyl
createAttributeViewItem({protyle, blockElement, templateID: data.defaultTemplateID,
position: {calendarDate: date}});
};
- bindCalendarDrag(root, protyle, blockElement, eventsByID);
+ bindCalendarDrag(root, protyle, blockElement, eventsByID, view);
root.addEventListener("click", event => {
event.stopPropagation();
const target = event.target as HTMLElement;
@@ -339,20 +393,22 @@ export const renderCalendar = async (blockElement: HTMLElement, protyle: IProtyl
return;
}
const entry = eventsByID.get(item.dataset.calendarItem);
- const menu = new Menu();
- menu.addItem({icon: "iconOpen", label: window.siyuan.languages.openBy,
- click: () => { void openCalendarItem(protyle, blockElement, entry); }});
- if (editable && dateColumn?.type === "date") {
- menu.addItem({icon: "iconTrashcan", label: window.siyuan.languages.calendarClearDate,
- click: () => updateCalendarDate(protyle, blockElement, entry,
- {...entry.date.value.date, isNotEmpty: false, isNotEmpty2: false})});
- }
- if (editable) {
- menu.addItem({icon: "iconTrashcan", label: window.siyuan.languages.delete,
- click: () => deleteRow(blockElement, protyle,
- getAVLoadedItemInfos(blockElement).filter(info => info.itemID === entry.row.id))});
- }
- menu.open({x: event.clientX, y: event.clientY});
+ avContextmenu(protyle, item, {x: event.clientX, y: event.clientY}, {customize: menu => {
+ menu.addSeparator();
+ menu.addItem({icon: "iconOpen", label: window.siyuan.languages.open,
+ click: () => { void openCalendarItem(protyle, blockElement, entry); }});
+ if (editable && dateColumn?.type === "date") {
+ const week = item.closest<HTMLElement>("[data-calendar-week]");
+ const rect = week.getBoundingClientRect();
+ const day = addCalendarDays(Number(week.dataset.calendarWeek),
+ Math.max(0, Math.min(6, Math.floor((event.clientX - rect.left) / (rect.width / 7)))));
+ menu.addItem({icon: "iconAdd", label: window.siyuan.languages.calendarNewOnDate,
+ click: () => create(day)});
+ menu.addItem({icon: "iconTrashcan", label: window.siyuan.languages.calendarClearDate,
+ click: () => updateCalendarDate(protyle, blockElement, entry,
+ {...entry.date.value.date, isNotEmpty: false, isNotEmpty2: false})});
+ }
+ }});
});
root.querySelector<HTMLSelectElement>("[data-calendar-mode]").addEventListener("change", event => {
state.mode = (event.target as HTMLSelectElement).value as "month" | "week";
diff --git a/app/src/protyle/render/av/calendar/settings.test.ts b/app/src/protyle/render/av/calendar/settings.test.ts
index 4addb0412e..63515cd17c 100644
--- a/app/src/protyle/render/av/calendar/settings.test.ts
+++ b/app/src/protyle/render/av/calendar/settings.test.ts
@@ -117,3 +117,26 @@ test("calendar binding changes preserve the previous invalid binding for undo",
assert.equal(settingsOf(transactions[0].undo[0]).dateKeyID, "missing-field");
assert.equal(settingsOf(transactions[0].do[0]).colorKeyID, "color");
});
+
+test("calendar row limits preserve old defaults, persist numeric choices and support undo", () => {
+ const {methods, transactions, menus} = setup();
+ const current = data();
+ let click: (event: {preventDefault: () => void; stopPropagation: () => void}) => void;
+ const button = {tagName: "BUTTON", dataset: {calendarSetting: "rowLimit"},
+ addEventListener: (_name: string, handler: typeof click) => { click = handler; }};
+ methods.bindCalendarSettings({protyle: {options: {}} as IProtyle, blockElement: block, data: current,
+ menuElement: {querySelectorAll: () => [button]} as unknown as Element});
+ click({preventDefault() { return; }, stopPropagation() { return; }});
+ assert.deepEqual(Array.from(menus[0], item => item.checked), [true, false, false, false]);
+ menus[0][0].click();
+ assert.equal(transactions.length, 0);
+ for (const [index, limit] of [3, 5, 10, -1].entries()) {
+ if (index === 0) {
+ continue;
+ }
+ menus[0][index].click();
+ assert.equal(settingsOf(transactions.at(-1).do[0]).rowLimit, limit);
+ assert.equal(settingsOf(transactions.at(-1).undo[0]).rowLimit, index === 1 ? undefined : [3, 5, 10, -1][index - 1]);
+ assert.equal(settingsOf(transactions.at(-1).do[0]).dateKeyID, "missing-field");
+ }
+});
diff --git a/app/src/protyle/render/av/calendar/settings.ts b/app/src/protyle/render/av/calendar/settings.ts
index d26e820f36..2df2da7340 100644
--- a/app/src/protyle/render/av/calendar/settings.ts
+++ b/app/src/protyle/render/av/calendar/settings.ts
@@ -19,6 +19,10 @@ const getCalendarSettingItems = (view: IAVTable): Array<{
}, {
key: "colorKeyID", label: window.siyuan.languages.calendarColorField,
choices: fields(view.columns.filter(field => field.type === "select")),
+ }, {
+ key: "rowLimit", label: window.siyuan.languages.calendarRowLimit,
+ choices: [3, 5, 10, -1].map(value => ({value: value.toString(),
+ label: value === -1 ? window.siyuan.languages.all : value.toString()})),
}, {
key: "weekStart", label: window.siyuan.languages.calendarWeekStart,
choices: Array.from({length: 7}, (_, day) => ({value: day.toString(),
@@ -27,7 +31,7 @@ const getCalendarSettingItems = (view: IAVTable): Array<{
};
export const getCalendarSettingsHTML = (view: IAVTable, asMenu = false) => getCalendarSettingItems(view).map(item => {
- const value = view.calendar[item.key].toString();
+ const value = (item.key === "rowLimit" ? view.calendar.rowLimit || 3 : view.calendar[item.key]).toString();
if (asMenu) {
const selected = item.choices.find(choice => choice.value === value);
return `<button class="b3-menu__item" data-calendar-setting="${item.key}">
@@ -62,10 +66,10 @@ export const bindCalendarSettings = (options: {
const view = options.data.view as IAVTable;
const previous = {...view.calendar};
const setting = item.key;
- if (previous[setting].toString() === value) {
+ if ((setting === "rowLimit" ? previous.rowLimit || 3 : previous[setting]).toString() === value) {
return;
}
- const next = {...previous, [setting]: setting === "weekStart" ? Number(value) : value};
+ const next = {...previous, [setting]: setting === "weekStart" || setting === "rowLimit" ? Number(value) : value};
const operation = {
action: "setAttrViewCalendar" as const,
avID: options.data.id,
@@ -82,7 +86,7 @@ export const bindCalendarSettings = (options: {
const view = options.data.view as IAVTable;
item.choices.forEach(choice => menu.addItem({
iconHTML: "", label: escapeHtml(choice.label),
- checked: view.calendar[item.key].toString() === choice.value,
+ checked: (item.key === "rowLimit" ? view.calendar.rowLimit || 3 : view.calendar[item.key]).toString() === choice.value,
click: () => update(choice.value),
}));
openViewSettingMenu(menu, select);
diff --git a/app/src/protyle/render/av/calendar/state.ts b/app/src/protyle/render/av/calendar/state.ts
index b467fcb006..94caf4d081 100644
--- a/app/src/protyle/render/av/calendar/state.ts
+++ b/app/src/protyle/render/av/calendar/state.ts
@@ -6,6 +6,7 @@ interface ICalendarState {
mode: "month" | "week";
weekStart: number;
dateType?: TAVCol;
+ rowLimit?: number;
expandedWeeks: Set<number>;
}
diff --git a/app/src/protyle/render/av/newItemTemplate.ts b/app/src/protyle/render/av/newItemTemplate.ts
index 95a832e576..132ace0188 100644
--- a/app/src/protyle/render/av/newItemTemplate.ts
+++ b/app/src/protyle/render/av/newItemTemplate.ts
@@ -951,6 +951,7 @@ export const createAttributeViewItem = (options: {
notebookID: options.protyle.notebookId, itemID: response.data.itemID, valueID: "",
title: response.data.content || window.siyuan.languages.untitled,
boundBlockID: response.data.blockID, isDetached: response.data.isDetached,
+ focusPrimary: true,
});
}
});
diff --git a/app/src/protyle/render/av/openDatabaseRow.ts b/app/src/protyle/render/av/openDatabaseRow.ts
index b528709769..2e19194fa3 100644
--- a/app/src/protyle/render/av/openDatabaseRow.ts
+++ b/app/src/protyle/render/av/openDatabaseRow.ts
@@ -13,6 +13,7 @@ import {Custom} from "../../../layout/dock/Custom";
/// #endif
import {searchMarkRender} from "../searchMarkRender";
import {registerDatabaseRowRefresh} from "./databaseRowRefresh";
+import {focusNewDatabasePrimary} from "./primaryFocus";
export interface IDatabaseRowOpenData {
avID: string;
@@ -26,6 +27,7 @@ export interface IDatabaseRowOpenData {
matchedValueID?: string;
matchedKeyID?: string;
keywords?: string[];
+ focusPrimary?: boolean;
}
const highlightDatabaseRow = (protyle: IProtyle, rootElement: HTMLElement, data: IDatabaseRowOpenData) => {
@@ -97,6 +99,7 @@ const openMobileDatabaseRow = (protyle: Pick<IProtyle, "app">, data: IDatabaseRo
rowElement.querySelector(".protyle-db-row__title span").textContent = currentTitle;
}
highlightDatabaseRow(contextProtyle, rowElement, data);
+ focusNewDatabasePrimary(rowElement, contextProtyle, data);
}, {
avID: data.avID,
itemID: data.itemID,
@@ -130,6 +133,7 @@ const showDatabaseRowPreview = (model: Editor, data: IDatabaseRowOpenData) => {
editorProtyle.contentElement.scrollTop = 0;
editorProtyle.databaseAttributePanel?.afterRender(() => {
highlightDatabaseRow(editorProtyle, editorProtyle.contentElement, data);
+ focusNewDatabasePrimary(editorProtyle.contentElement, editorProtyle, data);
});
};
@@ -194,6 +198,7 @@ export const openDatabaseRowByData = async (protyle: Pick<IProtyle, "app">, data
editorProtyle.contentElement.scrollTop = 0;
editorProtyle.databaseAttributePanel?.afterRender(() => {
highlightDatabaseRow(editorProtyle, editorProtyle.contentElement, data);
+ focusNewDatabasePrimary(editorProtyle.contentElement, editorProtyle, data);
});
}, true);
return true;
@@ -222,6 +227,7 @@ export const openDatabaseRowByData = async (protyle: Pick<IProtyle, "app">, data
matchedValueID: data.matchedValueID,
matchedKeyID: data.matchedKeyID,
keywords: data.keywords,
+ focusPrimary: data.focusPrimary,
},
},
afterOpen(model) {
diff --git a/app/src/protyle/render/av/primaryFocus.test.ts b/app/src/protyle/render/av/primaryFocus.test.ts
new file mode 100644
index 0000000000..d959024870
--- /dev/null
+++ b/app/src/protyle/render/av/primaryFocus.test.ts
@@ -0,0 +1,34 @@
+import * as assert from "node:assert/strict";
+import {test} from "node:test";
+import {readFileSync} from "node:fs";
+import {join} from "node:path";
+import {runInNewContext} from "node:vm";
+import * as ts from "typescript";
+
+test("new database items focus once without replacing template text or stealing focus on refresh", () => {
+ let focused = 0;
+ let caret = -1;
+ const input = {value: "Template title", focus: () => { focused++; },
+ setSelectionRange: (start: number, end: number) => { assert.equal(start, end); caret = start; }};
+ const root = {isConnected: true, querySelector: () => ({querySelector: () => input})} as unknown as Element;
+ const exports = {};
+ const window = {siyuan: {isPublish: false}};
+ runInNewContext(ts.transpileModule(readFileSync(join(__dirname, "primaryFocus.ts"), "utf8"), {
+ compilerOptions: {module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2022},
+ }).outputText, {exports, window, require: () => ({popTextCell: () => assert.fail("plain primary should use its input")})});
+ const {focusNewDatabasePrimary} = exports as typeof import("./primaryFocus");
+ const request = {avID: "av", itemID: "row", focusPrimary: true};
+ const protyle = {options: {}} as IProtyle;
+ focusNewDatabasePrimary(root, protyle, request);
+ assert.equal(focused, 1);
+ assert.equal(caret, input.value.length);
+ assert.equal(input.value, "Template title");
+ focusNewDatabasePrimary(root, protyle, request);
+ assert.equal(focused, 1);
+ for (const mode of ["disabled", "publish", "created", "snapshot"]) {
+ window.siyuan.isPublish = mode === "publish";
+ focusNewDatabasePrimary(root, {disabled: mode === "disabled", options: {history: {[mode]: "archive"}}} as IProtyle,
+ {...request, focusPrimary: true});
+ }
+ assert.equal(focused, 1);
+});
diff --git a/app/src/protyle/render/av/primaryFocus.ts b/app/src/protyle/render/av/primaryFocus.ts
new file mode 100644
index 0000000000..c9361362b6
--- /dev/null
+++ b/app/src/protyle/render/av/primaryFocus.ts
@@ -0,0 +1,24 @@
+import {popTextCell} from "./cell";
+
+// 新建条目只在首次完成渲染后进入主键编辑,刷新不重复聚焦,也不覆盖模板内容。
+export const focusNewDatabasePrimary = (root: Element, protyle: IProtyle,
+ request: {avID: string; itemID: string; focusPrimary?: boolean}) => {
+ if (!request.focusPrimary || !root.isConnected) {
+ return;
+ }
+ delete request.focusPrimary;
+ if (protyle.disabled || window.siyuan.isPublish || protyle.options.history?.created || protyle.options.history?.snapshot) {
+ return;
+ }
+ const field = root.querySelector<HTMLElement>(
+ `[data-av-id="${request.avID}"] [data-primary="true"] [data-row-id="${request.itemID}"]`);
+ if (field) {
+ const input = field.querySelector<HTMLInputElement>("input");
+ if (input && !input.disabled && !input.readOnly) {
+ input.focus();
+ input.setSelectionRange(input.value.length, input.value.length);
+ } else if (!input) {
+ popTextCell(protyle, [field], "block");
+ }
+ }
+};
diff --git a/app/src/types/api/index.d.ts b/app/src/types/api/index.d.ts
index 9cab067eb8..66921c59c8 100644
--- a/app/src/types/api/index.d.ts
+++ b/app/src/types/api/index.d.ts
@@ -250,9 +250,9 @@ export type AVCalendarRange = { "end": number; "start": number; "timeZone": stri
export type AVCalendarRangeInput = { "end": number; "start": number; "timeZone": string; };
-export type AVCalendarSettings = { "colorKeyID": string; "dateKeyID": string; "weekStart": number; };
+export type AVCalendarSettings = { "colorKeyID": string; "dateKeyID": string; "rowLimit"?: number; "weekStart": number; };
-export type AVCalendarSettingsInput = { "colorKeyID": string; "dateKeyID": string; "weekStart": number; };
+export type AVCalendarSettingsInput = { "colorKeyID": string; "dateKeyID": string; "rowLimit"?: number; "weekStart": number; };
export type AVCardCoverPosition = { "image": string; "x": number; "y": number; };
diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.ts
index 2b9ec6dd93..5cbe4c937b 100644
--- a/app/src/types/index.d.ts
+++ b/app/src/types/index.d.ts
@@ -1239,6 +1239,8 @@ interface IAVCalendarSettings {
colorKeyID: string;
/** 一周起始日,0 为星期日,1 为星期一,依次至 6 为星期六。 */
weekStart: number;
+ /** 月视图折叠前的条目行数:3、5、10 或 -1(全部);省略或 0 使用 3,周视图显示全部,不影响查询范围。 */
+ rowLimit?: number;
}
/**
diff --git a/kernel/api/av_contract_calendar.go b/kernel/api/av_contract_calendar.go
index c0c77f8990..e9da30dffd 100644
--- a/kernel/api/av_contract_calendar.go
+++ b/kernel/api/av_contract_calendar.go
@@ -23,7 +23,8 @@ func toContractAVCalendarSettings(value *av.CalendarSettings) *apicontract.AVCal
if nil == value {
return nil
}
- return &apicontract.AVCalendarSettings{DateKeyID: value.DateKeyID, ColorKeyID: value.ColorKeyID, WeekStart: value.WeekStart}
+ return &apicontract.AVCalendarSettings{DateKeyID: value.DateKeyID, ColorKeyID: value.ColorKeyID,
+ WeekStart: value.WeekStart, RowLimit: value.RowLimit}
}
func toContractAVLayoutCalendar(value *av.LayoutCalendar) *apicontract.AVLayoutCalendar {
diff --git a/kernel/api/contract_av_calendar_test.go b/kernel/api/contract_av_calendar_test.go
index 58411072bb..1ed5c6ebcd 100644
--- a/kernel/api/contract_av_calendar_test.go
+++ b/kernel/api/contract_av_calendar_test.go
@@ -38,7 +38,16 @@ func TestAVContractCalendarLayoutAndRange(t *testing.T) {
t.Fatal(err)
}
assertAVContractJSONEqual(t, current.Views[0], toContractAVView(current.Views[0]))
+ for _, limit := range []int{0, 3, 5, 10, -1} {
+ settings := current.Views[0].Calendar.Settings
+ settings.RowLimit = limit
+ assertAVContractJSONEqual(t, settings, toContractAVCalendarSettings(&settings))
+ }
assertAVContractJSONEqual(t, &av.Calendar{Table: result.Data.View}, avContractView(&av.Calendar{Table: result.Data.View}))
+ current.Views[0].Calendar.Settings.RowLimit = 5
+ if err = av.SaveAttributeView(current); err != nil {
+ t.Fatal(err)
+ }
path = "/api/av/renderAttributeView"
dateRange := &av.CalendarRange{Start: 1788220800000, End: 1791849600000, TimeZone: "Asia/Shanghai"}
response = callAttributeViewContextFilterAPI(t, path, map[string]any{
@@ -46,7 +55,8 @@ func TestAVContractCalendarLayoutAndRange(t *testing.T) {
}, renderAttributeView)
requireAPIContract(t, http.MethodPost, path, response)
decodeAttributeViewContextFilterAPIResponse(t, response, &result)
- if result.Code != 0 || result.Data.View.CalendarRange == nil || *result.Data.View.CalendarRange != *dateRange || len(result.Data.View.Rows) != 0 {
+ if result.Code != 0 || result.Data.View.CalendarRange == nil || *result.Data.View.CalendarRange != *dateRange ||
+ result.Data.View.Calendar.RowLimit != 5 || len(result.Data.View.Rows) != 0 {
t.Fatalf("calendar range or empty binding response: %s", response.Body.String())
}
file := av.GetAttributeViewDataPath(fixture.attrView.ID)
diff --git a/kernel/apicontract/av_calendar.go b/kernel/apicontract/av_calendar.go
index 246f7581e8..41b982d77e 100644
--- a/kernel/apicontract/av_calendar.go
+++ b/kernel/apicontract/av_calendar.go
@@ -11,6 +11,9 @@ type AVCalendarSettings struct {
ColorKeyID string `json:"colorKeyID"`
// 一周起始日,0 为星期日,1 为星期一,依次至 6 为星期六。
WeekStart int `json:"weekStart"`
+ // 月视图折叠前显示的条目行数,可选 3、5、10;-1 表示全部,省略或 0 按 3 行显示。
+ // 仅控制客户端折叠,不限制查询结果;周视图始终显示全部条目。
+ RowLimit int `json:"rowLimit,omitempty" api:"optional"`
}
// AVCalendarRange 是本次渲染的毫秒时间戳半开区间 [start, end),不持久化。
diff --git a/kernel/apicontract/schema.json b/kernel/apicontract/schema.json
index 35c4ea68de..7f463fda6b 100644
--- a/kernel/apicontract/schema.json
+++ b/kernel/apicontract/schema.json
@@ -6593,6 +6593,9 @@
"dateKeyID": {
"type": "string"
},
+ "rowLimit": {
+ "type": "integer"
+ },
"weekStart": {
"type": "integer"
}
@@ -6613,6 +6616,9 @@
"dateKeyID": {
"type": "string"
},
+ "rowLimit": {
+ "type": "integer"
+ },
"weekStart": {
"type": "integer"
}
diff --git a/kernel/av/layout_calendar.go b/kernel/av/layout_calendar.go
index d6822b8435..d1f9ceaef0 100644
--- a/kernel/av/layout_calendar.go
+++ b/kernel/av/layout_calendar.go
@@ -15,6 +15,12 @@ type CalendarSettings struct {
DateKeyID string `json:"dateKeyID"`
ColorKeyID string `json:"colorKeyID"`
WeekStart int `json:"weekStart"`
+ RowLimit int `json:"rowLimit,omitempty"`
+}
+
+// ValidRowLimit 保留旧设置的零值默认值,负一表示展开全部条目行。
+func (s CalendarSettings) ValidRowLimit() bool {
+ return s.RowLimit == 0 || s.RowLimit == -1 || s.RowLimit == 3 || s.RowLimit == 5 || s.RowLimit == 10
}
type LayoutCalendar struct {
@@ -151,7 +157,7 @@ func (attrView *AttributeView) ValidateCalendarLayouts() error {
}
if layout := view.Calendar; nil != layout {
if nil == layout.LayoutTable || nil == layout.BaseLayout || layout.Settings.WeekStart < 0 ||
- layout.Settings.WeekStart > 6 || layout.Spec != 0 {
+ layout.Settings.WeekStart > 6 || !layout.Settings.ValidRowLimit() || layout.Spec != 0 {
return fmt.Errorf("invalid calendar layout in view [%s]", view.ID)
}
for _, column := range layout.Columns {
diff --git a/kernel/av/layout_calendar_test.go b/kernel/av/layout_calendar_test.go
index d8c06d3294..36c7081d40 100644
--- a/kernel/av/layout_calendar_test.go
+++ b/kernel/av/layout_calendar_test.go
@@ -1,11 +1,36 @@
package av
import (
+ "encoding/json"
"reflect"
"testing"
"time"
)
+func TestCalendarRowLimitCompatibility(t *testing.T) {
+ var settings CalendarSettings
+ if err := json.Unmarshal([]byte(`{"dateKeyID":"date","colorKeyID":"","weekStart":1}`), &settings); err != nil {
+ t.Fatal(err)
+ }
+ if settings.RowLimit != 0 || !settings.ValidRowLimit() {
+ t.Fatal("existing calendar settings must retain the default row limit")
+ }
+ for _, limit := range []int{0, 3, 5, 10, -1} {
+ settings.RowLimit = limit
+ data, err := json.Marshal(settings)
+ var actual CalendarSettings
+ if err != nil || json.Unmarshal(data, &actual) != nil || actual != settings || !actual.ValidRowLimit() {
+ t.Fatalf("row limit round trip: %d", limit)
+ }
+ }
+ for _, limit := range []int{-2, 1, 4, 100} {
+ settings.RowLimit = limit
+ if settings.ValidRowLimit() {
+ t.Fatalf("invalid row limit accepted: %d", limit)
+ }
+ }
+}
+
func TestCalendarInterval(t *testing.T) {
location, err := time.LoadLocation("America/New_York")
if nil != err {
diff --git a/kernel/model/attribute_view_calendar.go b/kernel/model/attribute_view_calendar.go
index e2e4a39af4..59afd9fb87 100644
--- a/kernel/model/attribute_view_calendar.go
+++ b/kernel/model/attribute_view_calendar.go
@@ -50,6 +50,9 @@ func setAttrViewCalendar(operation *Operation) error {
if settings.WeekStart < 0 || settings.WeekStart > 6 {
return fmt.Errorf("invalid calendar week start")
}
+ if !settings.ValidRowLimit() {
+ return fmt.Errorf("invalid calendar row limit")
+ }
attrView, err := av.ParseAttributeView(operation.AvID)
if nil != err {
return err
diff --git a/kernel/model/attribute_view_calendar_fts5_test.go b/kernel/model/attribute_view_calendar_fts5_test.go
index 3c04e5f670..20d10d62c8 100644
--- a/kernel/model/attribute_view_calendar_fts5_test.go
+++ b/kernel/model/attribute_view_calendar_fts5_test.go
@@ -56,6 +56,11 @@ func TestAttributeViewCalendarDateUndoAndEncryptedReplay(t *testing.T) {
}
}
settings := original.Views[0].Calendar.Settings
+ nextSettings := settings
+ nextSettings.RowLimit = 5
+ setRows := func(value av.CalendarSettings) *Operation {
+ return &Operation{Action: "setAttrViewCalendar", AvID: original.ID, ViewID: original.Views[0].ID, Data: value}
+ }
key, _ := original.GetKeyValues(settings.DateKeyID)
value := key.Values[0]
before := *value.Date
@@ -66,14 +71,16 @@ func TestAttributeViewCalendarDateUndoAndEncryptedReplay(t *testing.T) {
return &Operation{Action: "updateAttrViewCell", AvID: original.ID, KeyID: key.Key.ID,
RowID: value.BlockID, ID: value.ID, Data: map[string]any{"type": "date", "date": date}}
}
- tx := &Transaction{DoOperations: []*Operation{operation(after)}, UndoOperations: []*Operation{operation(before)}, fromAPI: true}
+ tx := &Transaction{DoOperations: []*Operation{operation(after), setRows(nextSettings)},
+ UndoOperations: []*Operation{operation(before), setRows(settings)}, fromAPI: true}
if err := PerformTxSync(tx); err != nil {
t.Fatal(err)
}
for _, replay := range []struct {
operations []*Operation
expected av.ValueDate
- }{{tx.DoOperations, after}, {tx.UndoOperations, before}, {tx.DoOperations, after}} {
+ settings av.CalendarSettings
+ }{{tx.DoOperations, after, nextSettings}, {tx.UndoOperations, before, settings}, {tx.DoOperations, after, nextSettings}} {
if err := PerformTxSync(&Transaction{DoOperations: cloneOperations(replay.operations), isReplay: true}); err != nil {
t.Fatal(err)
}
@@ -85,7 +92,7 @@ func TestAttributeViewCalendarDateUndoAndEncryptedReplay(t *testing.T) {
storedKey, _ := stored.GetKeyValues(key.Key.ID)
actual := *storedKey.Values[0].Date
actual.FormattedContent = ""
- if !reflect.DeepEqual(actual, replay.expected) || stored.Views[0].Calendar.Settings != settings {
+ if !reflect.DeepEqual(actual, replay.expected) || stored.Views[0].Calendar.Settings != replay.settings {
t.Fatalf("date replay: actual=%+v expected=%+v settings=%+v", actual, replay.expected, stored.Views[0].Calendar.Settings)
}
}
@@ -174,6 +181,7 @@ func TestAttributeViewCalendarSetupUndo(t *testing.T) {
next := previous
next.DateKeyID = keyID
next.WeekStart = 0
+ next.RowLimit = 10
setting := func(value av.CalendarSettings) *Operation {
return &Operation{Action: "setAttrViewCalendar", AvID: database.ID, ViewID: view.ID, Data: value}
}