odant-work 1.0.91 → 1.0.92
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/#system/certs/russian_trusted_root_ca.pem +32 -32
- package/#system/mail.json.example +9 -9
- package/#system/package-manifest.json +332 -373
- package/#system/settings.json.example +3 -3
- package/$server/$folder/$class/$data/handlers/pages/form/objects/$handler/class.js +2158 -0
- package/$server/$folder/$class/$data/handlers/pages/form/objects/object/$handler/class.js +1377 -0
- package/$server/$folder/$class/$domain/class.js +4 -4
- package/$server/$folder/$class/$handler/$trigger/class.js +3 -3
- package/$server/$folder/$class/$handler/class.js +9 -9
- package/$server/$folder/$class/$handler/handlers/pages/editor/$handler/class.js +5 -5
- package/$server/$folder/$class/$handler/readme.md +23 -23
- package/$server/$folder/$class/$module/handlers/pages/form/system/{$handler/tabs/mcp/$handler/mcp.js → mcp/$handler/class.js} +251 -210
- package/$server/$folder/$class/$module/handlers/pages/form/system/{$handler/tabs/modules → modules}/$handler/class.js +1 -0
- package/$server/$folder/$class/$structure/$organization/handlers/pages/site/$handler/{site.js → class.js} +351 -364
- package/$server/$folder/$class/$structure/$server/handlers/pages/form/system/{$handler/tabs/license/$handler/license.js → license/$handler/class.js} +104 -103
- package/$server/$folder/$class/$structure/$server/handlers/pages/site/$handler/{site.js → class.js} +45 -30
- package/$server/$folder/$class/$structure/$user/class.js +2 -2
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/agent/$handler/class.js +3 -0
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/messengers/$handler/class.js +3 -0
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/modules/$handler/class.js +3 -0
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/{$handler/tabs/profile/$handler/profile.js → profile/$handler/class.js} +6 -2
- package/$server/$folder/$class/$structure/handlers/pages/data/$handler/class.js +308 -5
- package/$server/$folder/$class/$structure/handlers/pages/explorer/$handler/class.js +14 -3
- package/$server/$folder/$class/$structure/handlers/pages/form/calendar/$handler/class.js +1281 -7
- package/$server/$folder/$class/$structure/handlers/pages/form/calendar/$handler/readme.md +40 -40
- package/$server/$folder/$class/$structure/handlers/pages/form/chat/$handler/class.js +2216 -6
- package/$server/$folder/$class/$structure/handlers/pages/form/email/$handler/class.js +1304 -6
- package/$server/$folder/$class/$structure/handlers/pages/form/search/$handler/class.js +305 -5
- package/$server/$folder/$class/$structure/handlers/pages/form/system/{$handler/tabs/agent/$handler/agent.js → agent/$handler/class.js} +329 -320
- package/$server/$folder/$class/$structure/handlers/pages/form/system/{$handler/tabs/database/$handler/database.js → database/$handler/class.js} +510 -577
- package/$server/$folder/$class/$structure/handlers/pages/form/system/{$handler/tabs/messengers/$handler/messengers.js → messengers/$handler/class.js} +142 -143
- package/$server/$folder/$class/$structure/handlers/pages/form/system/modules/$handler/class.js +270 -0
- package/$server/$folder/$class/$structure/handlers/pages/form/system/staff/$handler/class.js +2114 -0
- package/$server/$folder/$class/$structure/handlers/pages/site/$handler/class.js +229 -4
- package/$server/$folder/$class/ai/config.js +19 -19
- package/$server/$folder/$class/ai/prompt/$method/class.js +41 -41
- package/$server/$folder/$class/ai/skills/approval-flow.md +14 -14
- package/$server/$folder/$class/ai/skills/backup-check.md +13 -13
- package/$server/$folder/$class/ai/skills/computer.md +27 -27
- package/$server/$folder/$class/ai/skills/delegate-task.md +15 -15
- package/$server/$folder/$class/ai/skills/external-signup.md +14 -14
- package/$server/$folder/$class/ai/skills/onboarding.md +15 -15
- package/$server/$folder/$class/ai/skills/orchestration.md +41 -41
- package/$server/$folder/$class/ai/system.md +1 -1
- package/$server/$folder/$class/class.js +0 -3
- package/$server/$folder/$class/handlers/pages/form/folder/$handler/class.js +3 -0
- package/$server/$folder/$class/handlers/pages/form/system/$handler/class.js +2 -4
- package/$server/$folder/$class/handlers/pages/form/system/{$handler/tabs/files → files}/$handler/class.js +2 -0
- package/$server/$folder/$class/handlers/pages/form/system/{$handler/tabs/requisites/$handler/requisites.js → requisites/$handler/class.js} +43 -36
- package/$server/$folder/$class/handlers/pages/storage/$handler/class.js +25 -6
- package/$server/$folder/$file/$audio/handlers/preview/$handler/class.js +3 -3
- package/$server/$folder/$file/$audio/handlers/preview/$handler/preview.js +88 -88
- package/$server/$folder/$file/$call/class.js +10 -10
- package/$server/$folder/$file/$call/handlers/preview/$handler/class.js +4 -4
- package/$server/$folder/$file/$call/triggers/on_save/$trigger/class.js +48 -48
- package/$server/$folder/$file/$data/class.js +16 -16
- package/$server/$folder/$file/$data/handlers/pages/form/editor/$handler/class.js +31 -4
- package/$server/$folder/$file/$devs/$js/class.js +2 -2
- package/$server/$folder/$file/$devs/$json/class.js +2 -2
- package/$server/$folder/$file/$devs/$ts/class.js +2 -2
- package/$server/$folder/$file/$devs/handlers/pages/form/file/$handler/class.js +30 -2
- package/$server/$folder/$file/$eml/class.js +17 -17
- package/$server/$folder/$file/$ics/class.js +44 -44
- package/$server/$folder/$file/$ics/handlers/pages/form/file/$handler/class.js +10 -2
- package/$server/$folder/$file/$ics/handlers/preview/$handler/class.js +3 -3
- package/$server/$folder/$file/$ics/handlers/preview/$handler/preview.js +67 -67
- package/$server/$folder/$file/$ics/readme.md +21 -21
- package/$server/$folder/$file/$image/$svg/class.js +11 -11
- package/$server/$folder/$file/$image/handlers/preview/$handler/class.js +3 -3
- package/$server/$folder/$file/$image/handlers/preview/$handler/preview.js +33 -33
- package/$server/$folder/$file/$ipynb/handlers/pages/form/file/$handler/class.js +82 -2
- package/$server/$folder/$file/$logs/class.js +39 -39
- package/$server/$folder/$file/$logs/handlers/methods/txt-test/$handler/class.js +4 -4
- package/$server/$folder/$file/$md/handlers/pages/form/file/$handler/class.js +60 -2
- package/$server/$folder/$file/$office/$outlook/$ics/class.js +227 -227
- package/$server/$folder/$file/$office/$word/$rtf/template.rtf +159 -159
- package/$server/$folder/$file/$office/handlers/pages/form/file/$handler/class.js +1699 -2
- package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/class.js +827 -2
- package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/readme.md +1 -1
- package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/ui/feed.js +17 -0
- package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/ui/panel.js +7 -1
- package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/ui/util.js +1 -0
- package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/ui/voice-policy.js +6 -2
- package/$server/$folder/$file/$task/handlers/preview/$handler/class.js +3 -3
- package/$server/$folder/$file/$task/readme.md +32 -32
- package/$server/$folder/$file/$txt/handlers/preview/$handler/class.js +3 -3
- package/$server/$folder/$file/$txt/handlers/preview/$handler/preview.js +41 -41
- package/$server/$folder/$file/$video/handlers/preview/$handler/class.js +4 -4
- package/$server/$folder/$file/$video/handlers/preview/$handler/preview.js +13 -13
- package/$server/$folder/$file/class.js +2 -2
- package/$server/$folder/$file/handlers/methods/download/$handler/class.js +2 -2
- package/$server/$folder/$file/handlers/methods/download/$handler/download.js +4 -4
- package/$server/$folder/$file/handlers/pages/form/$handler/class.js +2 -2
- package/$server/$folder/$file/handlers/pages/form/file/$handler/class.js +32 -2
- package/$server/$folder/$file/handlers/pages/form/folder/$handler/class.js +3 -0
- package/$server/$folder/$file/readme.md +31 -31
- package/$server/$folder/class.js +11 -11
- package/$server/$folder/handlers/pages/form/$handler/class.js +2469 -5
- package/$server/$folder/handlers/pages/form/folder/$handler/class.js +22 -0
- package/$server/$folder/lib/chat-item/chat-item.js +2 -2
- package/$server/$folder/lib/email/settings.js +82 -82
- package/$server/$folder/lib/file-viewer/file-viewer.js +8 -8
- package/$server/$folder/lib/icon/user/user.js +6 -6
- package/$server/$folder/lib/item-data-grid/item-data-grid.js +48 -48
- package/$server/$folder/lib/item-form/item-form.js +84 -84
- package/$server/$folder/lib/menu/menu.js +3 -2
- package/$server/$folder/lib/menu/readme.md +29 -29
- package/$server/$folder/lib/node/readme.md +29 -29
- package/$server/$folder/lib/pack/pack.js +4 -4
- package/$server/$folder/lib/site-loc/readme.md +16 -16
- package/.github/workflows/ci.yml +39 -39
- package/AGENTS.md +1 -1
- package/{models/$ai/$folder/$class/$ai/handlers/pages/form/system/$handler/tabs/ai/$handler/ai.js → MODELS/$ai/$folder/$class/$ai/handlers/pages/form/system/ai/$handler/class.js} +383 -430
- package/{models/$ai/$folder/$class/$provider/handlers/pages/form/system/$handler/tabs/ai/$handler/ai.js → MODELS/$ai/$folder/$class/$provider/handlers/pages/form/system/ai/$handler/class.js} +155 -166
- package/{models → MODELS}/$ai/$folder/$class/$provider/readme.md +16 -16
- package/{models/$ai/handlers/pages/form/system/$handler/tabs/ai/$handler/ai.js → MODELS/$ai/handlers/pages/form/system/ai/$handler/class.js} +34 -33
- package/{models → MODELS}/GigaChat/$provider/readme.md +24 -24
- package/{models/Local/$provider/handlers/pages/form/system/$handler/tabs/ai/$handler/ai.js → MODELS/Local/$provider/handlers/pages/form/system/ai/$handler/class.js} +569 -626
- package/MODULES/$domain/handlers/pages/form/system/{$handler/tabs/mcp → mcp}/$handler/class.js +1 -0
- package/MODULES/Geo//320/232/320/260/321/200/321/202/320/260/$catalog/handlers/pages/form/map/$handler/class.js +648 -20
- package/MODULES/KLADR/$module/handlers/pages/form/kladr/$handler/class.js +140 -6
- package/MODULES/Process//320/227/320/260/320/264/320/260/321/207/320/270 /320/270 /321/215/321/202/320/260/320/277/321/213/$catalog/handlers/pages/form/gantt/$handler/class.js" +305 -5
- package/MODULES/Process//320/227/320/260/320/264/320/260/321/207/320/270 /320/270 /321/215/321/202/320/260/320/277/321/213/$catalog/handlers/pages/form/scheduler/$handler/class.js" +241 -5
- package/MODULES/Process//320/241/321/205/320/265/320/274/321/213 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/320/276/320/262/$catalog/handlers/pages/form/bpmn/$handler/class.js" +515 -15
- package/MODULES/Register/CATALOGS/$catalog/$folder/$class/$data/$catalog/$virtual/handlers/pages/form/objects/$handler/class.js +3 -0
- package/MODULES/Register/CATALOGS/$catalog/$folder/$class/$data/$catalog/$virtual/handlers/pages/form/virtual/$handler/class.js +422 -5
- package/MODULES/Register/OPERATIONS//320/240/320/265/320/260/320/273/320/270/320/267/320/260/321/206/320/270/321/217//320/237/320/276/320/272/321/203/320/277/320/260/321/202/320/265/320/273/321/216/$operation/print//320/241/321/207/321/221/321/202 /320/275/320/260 /320/276/320/277/320/273/320/260/321/202/321/203.html" +40 -40
- package/MODULES/Register/OPERATIONS//320/240/320/265/320/260/320/273/320/270/320/267/320/260/321/206/320/270/321/217//320/237/320/276/320/272/321/203/320/277/320/260/321/202/320/265/320/273/321/216/$operation/print//320/242/320/276/320/262/320/260/321/200/320/275/320/260/321/217 /320/275/320/260/320/272/320/273/320/260/320/264/320/275/320/260/321/217.html" +56 -56
- package/MODULES/Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/analysis/$handler/class.js +13 -7
- package/MODULES/Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/postings/$handler/class.js +1791 -7
- package/MODULES/Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/turnovers/$handler/class.js +13 -7
- package/MODULES/Register/REGISTER/$register/handlers/pages/form/journal/$handler/class.js +776 -5
- package/MODULES/Register/REGISTER/$register/handlers/pages/form/sheet/$handler/class.js +807 -5
- package/MODULES/Register/REGISTER/68/01/$account/class.js +1 -1
- package/MODULES/Register/REGISTER/68/02/$account/class.js +1 -1
- package/MODULES/Register/REGISTER//320/232/320/260/320/264/321/200/320/276/320/262/321/213/320/271 /321/200/320/265/320/267/320/265/321/200/320/262/$account/class.js" +1 -1
- package/MODULES/Register/REGISTER//320/232/320/260/320/264/321/200/321/213//320/222 /320/276/321/202/320/277/321/203/321/201/320/272/320/265/$account/class.js" +1 -1
- package/MODULES/Register/REGISTER//320/232/320/260/320/264/321/200/321/213//320/240/320/260/320/261/320/276/321/202/320/260/321/216/321/202/$account/class.js +1 -1
- package/MODULES/Register/REGISTER//320/242/320/265/321/205/320/275/320/270/321/207/320/265/321/201/320/272/320/270/320/271/$account/class.js +1 -1
- package/MODULES/Register/STRUCTS/$struct/class.js +4 -4
- package/NODES/$node/$folder/$class/$node/class.js +35 -35
- package/NODES/$node/class.js +5 -5
- package/NODES/$node/handlers/pages/form/network/$handler/class.js +121 -4
- package/oda/benchmarks/dbmon/lib/ENV.js +213 -213
- package/oda/benchmarks/dbmon/lib/ga.js +11 -11
- package/oda/benchmarks/dbmon/lib/memory-stats.js +105 -105
- package/oda/benchmarks/dbmon/lib/monitor.js +69 -69
- package/oda/benchmarks/sierpinski/sierpinski.js +149 -149
- package/oda/components/editors/code-editor/code-editor.js +387 -387
- package/oda/components/editors/code-editor/src/ace.js +16 -16
- package/oda/components/editors/code-editor/src/beautify-css.js +1625 -1625
- package/oda/components/editors/code-editor/src/beautify-html.js +3122 -3122
- package/oda/components/editors/code-editor/src/beautify.js +4005 -4005
- package/oda/components/editors/code-editor/src/ext-beautify.js +7 -7
- package/oda/components/editors/code-editor/src/ext-code_lens.js +7 -7
- package/oda/components/editors/code-editor/src/ext-elastic_tabstops_lite.js +7 -7
- package/oda/components/editors/code-editor/src/ext-emmet.js +7 -7
- package/oda/components/editors/code-editor/src/ext-error_marker.js +7 -7
- package/oda/components/editors/code-editor/src/ext-hardwrap.js +7 -7
- package/oda/components/editors/code-editor/src/ext-keybinding_menu.js +7 -7
- package/oda/components/editors/code-editor/src/ext-language_tools.js +7 -7
- package/oda/components/editors/code-editor/src/ext-linking.js +7 -7
- package/oda/components/editors/code-editor/src/ext-modelist.js +7 -7
- package/oda/components/editors/code-editor/src/ext-options.js +7 -7
- package/oda/components/editors/code-editor/src/ext-prompt.js +7 -7
- package/oda/components/editors/code-editor/src/ext-rtl.js +7 -7
- package/oda/components/editors/code-editor/src/ext-searchbox.js +7 -7
- package/oda/components/editors/code-editor/src/ext-settings_menu.js +7 -7
- package/oda/components/editors/code-editor/src/ext-spellcheck.js +7 -7
- package/oda/components/editors/code-editor/src/ext-split.js +7 -7
- package/oda/components/editors/code-editor/src/ext-static_highlight.js +7 -7
- package/oda/components/editors/code-editor/src/ext-statusbar.js +7 -7
- package/oda/components/editors/code-editor/src/ext-textarea.js +7 -7
- package/oda/components/editors/code-editor/src/ext-themelist.js +7 -7
- package/oda/components/editors/code-editor/src/ext-whitespace.js +7 -7
- package/oda/components/editors/code-editor/src/keybinding-emacs.js +7 -7
- package/oda/components/editors/code-editor/src/keybinding-sublime.js +7 -7
- package/oda/components/editors/code-editor/src/keybinding-vim.js +7 -7
- package/oda/components/editors/code-editor/src/keybinding-vscode.js +7 -7
- package/oda/components/editors/code-editor/src/mode-css.js +7 -7
- package/oda/components/editors/code-editor/src/mode-html.js +7 -7
- package/oda/components/editors/code-editor/src/mode-javascript.js +7 -7
- package/oda/components/editors/code-editor/src/mode-json.js +7 -7
- package/oda/components/editors/code-editor/src/mode-markdown.js +7 -7
- package/oda/components/editors/code-editor/src/mode-svg.js +7 -7
- package/oda/components/editors/code-editor/src/mode-text.js +7 -7
- package/oda/components/editors/code-editor/src/mode-xml.js +7 -7
- package/oda/components/editors/code-editor/src/mode-xquery.js +7 -7
- package/oda/components/editors/code-editor/src/snippets/css.js +7 -7
- package/oda/components/editors/code-editor/src/snippets/html.js +7 -7
- package/oda/components/editors/code-editor/src/snippets/javascript.js +7 -7
- package/oda/components/editors/code-editor/src/snippets/json.js +7 -7
- package/oda/components/editors/code-editor/src/snippets/markdown.js +7 -7
- package/oda/components/editors/code-editor/src/snippets/svg.js +7 -7
- package/oda/components/editors/code-editor/src/snippets/text.js +7 -7
- package/oda/components/editors/code-editor/src/snippets/xml.js +7 -7
- package/oda/components/editors/code-editor/src/snippets/xquery.js +7 -7
- package/oda/components/editors/code-editor/src/theme-solarized_dark.js +7 -7
- package/oda/components/editors/code-editor/src/theme-solarized_light.js +7 -7
- package/oda/components/editors/markdown/markdown-editor/lib/font-awesome.min.css +3 -3
- package/oda/components/editors/markdown/markdown-editor/lib/readme.md +332 -332
- package/oda/components/editors/markdown/markdown-editor/markdown-editor.js +78 -78
- package/oda/components/editors/markdown/markdown-viewer/test.md +239 -239
- package/oda/components/editors/markdown/markdown.js +76 -76
- package/oda/components/inputs/block/readme.md +39 -39
- package/oda/components/inputs/checkbox/checkbox.js +92 -92
- package/oda/components/inputs/color/color.js +83 -83
- package/oda/components/inputs/date/date.js +40 -40
- package/oda/components/inputs/input/input.js +219 -219
- package/oda/components/inputs/link/link.js +1 -1
- package/oda/components/inputs/link/readme.md +42 -42
- package/oda/components/inputs/markdown-input/markdown-input.js +77 -77
- package/oda/components/inputs/numeric/numeric.js +141 -141
- package/oda/components/inputs/table-input/readme.md +39 -39
- package/oda/components/inputs/text/text.js +88 -88
- package/oda/components/inputs/toggle/toggle.js +101 -101
- package/oda/components/layouts/hexagon-layout/hexagon-layout.js +218 -218
- package/oda/components/menus/menu/index_old.html +140 -140
- package/oda/components/structure/controls-map.js +56 -56
- package/oda/components/structure/controls.js +29 -29
- package/oda/components/structure/readme.md +31 -31
- package/oda/components/structure/structure.js +64 -64
- package/oda/components/table/index.html +210 -210
- package/oda/components/table/lib/coerce.js +68 -68
- package/oda/components/table/lib/column.js +568 -568
- package/oda/components/table/readme.md +120 -120
- package/oda/components/table/router.js +86 -86
- package/oda/components/table/settings.js +89 -89
- package/oda/index.html +159 -159
- package/oda/tools/icons/icons-set/icons-set.js +60 -60
- package/oda/tools/icons/lib/svg/_makeSVG.html +41 -41
- package/oda/tools/icons/lib/svg/aws.svg +2679 -2679
- package/oda/tools/icons/lib/svg/info.json +46 -46
- package/oda/tools/jupyter/demo.ipynb +160 -160
- package/oda/tools/jupyter/lib/print_elements.js +73 -73
- package/oda/tools/jupyter/test-2.ipynb +305 -305
- package/oda/tools/jupyter/test.ipynb +603 -603
- package/oda/tools/styles/adoptedStyleSheets.js +333 -333
- package/oda/tools/tester/device-preview/devices.json +9 -9
- package/package.json +1 -1
- package/rules/rules.md +445 -445
- package/scripts/SYNC-README.md +107 -107
- package/scripts/agent-eval.mjs +223 -223
- package/scripts/dump-svn-chat.mjs +9 -9
- package/scripts/extract-chat-day.mjs +21 -21
- package/scripts/rag-bench.mjs +166 -166
- package/scripts/restore-chat.mjs +166 -166
- package/scripts/sync-svn-git.bat +129 -129
- package/scripts/test-merge.mjs +75 -75
- package/scripts/work-desktop-bridge.mjs +101 -101
- package/sources/client/class.js +3 -0
- package/sources/client/field.js +168 -168
- package/sources/client/handler.js +68 -32
- package/sources/client/index.js +32 -32
- package/sources/client/readme.md +16 -16
- package/sources/client.js +12 -0
- package/sources/core.js +91 -91
- package/sources/data/choices.js +125 -125
- package/sources/host/babel-merge.js +398 -353
- package/sources/host/config.js +48 -48
- package/sources/host/index-db.js +94 -94
- package/sources/host/net-guard.js +228 -228
- package/sources/host/package-install.js +63 -63
- package/sources/host/push.js +86 -86
- package/sources/host/readme.md +41 -41
- package/sources/host/secret-box.js +93 -93
- package/sources/host/server-id.js +26 -26
- package/sources/host/stun.js +33 -33
- package/sources/host/tls-ca.js +60 -60
- package/sources/host/vapid.js +14 -14
- package/sources/index.html +1 -1
- package/sources/modules/a2a/server.js +608 -608
- package/sources/modules/agent/connections.js +442 -442
- package/sources/modules/agent/diff.js +69 -69
- package/sources/modules/agent/eval.js +222 -222
- package/sources/modules/agent/hooks.js +131 -131
- package/sources/modules/agent/index.js +6 -3
- package/sources/modules/agent/log.js +43 -43
- package/sources/modules/agent/loop.js +65 -0
- package/sources/modules/agent/mcp-pool.js +253 -253
- package/sources/modules/agent/recovery.js +89 -89
- package/sources/modules/agent/scope.js +387 -0
- package/sources/modules/agent/session.js +350 -15
- package/sources/modules/agent/taint.js +100 -100
- package/sources/modules/agent/tools/branch.js +311 -311
- package/sources/modules/agent/tools/browser.js +254 -254
- package/sources/modules/agent/tools/computer.js +120 -120
- package/sources/modules/agent/tools/connect.js +316 -316
- package/sources/modules/agent/tools/dev/lsp.js +334 -334
- package/sources/modules/agent/tools/dev/patch.js +564 -564
- package/sources/modules/agent/tools/memory.js +153 -153
- package/sources/modules/agent/tools/meta.js +60 -0
- package/sources/modules/agent/tools/os-files.js +358 -358
- package/sources/modules/agent/tools/plugins.js +80 -80
- package/sources/modules/agent/tools/sandbox.js +268 -268
- package/sources/modules/agent/types.d.ts +183 -183
- package/sources/modules/agent/undo.js +254 -254
- package/sources/modules/agent/util.js +179 -179
- package/sources/modules/contacts/contacts.js +200 -200
- package/sources/modules/contacts/index.html +546 -546
- package/sources/modules/lan/discovery.js +192 -192
- package/sources/modules/lan/store.js +62 -62
- package/sources/modules/mcp/readme.md +70 -70
- package/sources/modules/mcp/server.js +525 -525
- package/sources/modules/mcp/tokens.js +140 -140
- package/sources/modules/nodes/identity.js +123 -123
- package/sources/modules/nodes/outbound.js +105 -105
- package/sources/modules/nodes/signing.js +71 -71
- package/sources/modules/rag/embed-worker.js +36 -36
- package/sources/modules/rag/readme.md +70 -70
- package/sources/modules/readme.md +21 -21
- package/sources/modules/sandbox/config.js +74 -74
- package/sources/modules/sandbox/driver.js +100 -100
- package/sources/modules/sandbox/images/work-computer/Dockerfile +34 -34
- package/sources/modules/sandbox/images/work-computer/entrypoint.sh +24 -24
- package/sources/modules/sandbox/manager.js +1089 -1089
- package/sources/modules/sandbox/readme.md +63 -63
- package/sources/modules/sandbox/vnc-proxy.js +296 -296
- package/sources/server/access/audit.js +138 -138
- package/sources/server/access/refs.js +106 -106
- package/sources/server/assert-class-id.js +23 -23
- package/sources/server/chat-threads.js +16 -5
- package/sources/server/class.js +4 -1
- package/sources/server/external-source.js +90 -90
- package/sources/server/file.js +1 -1
- package/sources/server/folder.js +75 -33
- package/sources/server/handler.js +25 -12
- package/sources/server/index.js +12 -12
- package/sources/server/memory-mark.js +34 -34
- package/sources/server/readme.md +110 -110
- package/sources/server/safe-node-name.js +67 -67
- package/sources/server/server.js +6 -6
- package/sources/server/upload-mark.js +24 -24
- package/sources/server/zip-guard.js +81 -81
- package/whitepaper.md +568 -568
- package/$server/$folder/$class/$module/handlers/pages/form/system/$handler/tabs/mcp/$handler/class.js +0 -9
- package/$server/$folder/$class/$module/handlers/pages/form/system/$handler/tabs/modules/$handler/modules.js +0 -1
- package/$server/$folder/$class/$structure/$server/handlers/pages/form/system/$handler/tabs/license/$handler/class.js +0 -6
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/$handler/tabs/agent/$handler/class.js +0 -3
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/$handler/tabs/messengers/$handler/class.js +0 -3
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/$handler/tabs/modules/$handler/class.js +0 -3
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/$handler/tabs/profile/$handler/class.js +0 -5
- package/$server/$folder/$class/$structure/handlers/pages/data/$handler/data.js +0 -313
- package/$server/$folder/$class/$structure/handlers/pages/explorer/$handler/explorer.js +0 -16
- package/$server/$folder/$class/$structure/handlers/pages/form/calendar/$handler/calendar.js +0 -1226
- package/$server/$folder/$class/$structure/handlers/pages/form/chat/$handler/chat.js +0 -2095
- package/$server/$folder/$class/$structure/handlers/pages/form/email/$handler/email.js +0 -1188
- package/$server/$folder/$class/$structure/handlers/pages/form/search/$handler/search.js +0 -289
- package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/agent/$handler/class.js +0 -6
- package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/database/$handler/class.js +0 -9
- package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/messengers/$handler/class.js +0 -6
- package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/modules/$handler/class.js +0 -5
- package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/modules/$handler/modules.js +0 -281
- package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/staff/$handler/class.js +0 -5
- package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/staff/$handler/staff.js +0 -2126
- package/$server/$folder/$class/$structure/handlers/pages/site/$handler/site.js +0 -240
- package/$server/$folder/$class/handlers/pages/form/object/$handler/class.js +0 -32
- package/$server/$folder/$class/handlers/pages/form/object/$handler/object.js +0 -1371
- package/$server/$folder/$class/handlers/pages/form/objects/$handler/class.js +0 -32
- package/$server/$folder/$class/handlers/pages/form/objects/$handler/objects.js +0 -2130
- package/$server/$folder/$class/handlers/pages/form/system/$handler/system.js +0 -309
- package/$server/$folder/$class/handlers/pages/form/system/$handler/tabs/files/$handler/files.js +0 -17
- package/$server/$folder/$class/handlers/pages/form/system/$handler/tabs/requisites/$handler/class.js +0 -16
- package/$server/$folder/$class/handlers/pages/storage/$handler/storage.js +0 -21
- package/$server/$folder/$file/$data/handlers/pages/form/editor/$handler/editor.js +0 -27
- package/$server/$folder/$file/$devs/handlers/pages/form/file/$handler/file.js +0 -31
- package/$server/$folder/$file/$ics/handlers/pages/form/file/$handler/file.js +0 -10
- package/$server/$folder/$file/$ipynb/handlers/pages/form/file/$handler/file.js +0 -72
- package/$server/$folder/$file/$md/handlers/pages/form/file/$handler/file.js +0 -63
- package/$server/$folder/$file/$office/handlers/pages/form/file/$handler/file.js +0 -1845
- package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/file.js +0 -760
- package/$server/$folder/$file/handlers/pages/form/file/$handler/file.js +0 -29
- package/$server/$folder/handlers/pages/form/$handler/form.js +0 -2122
- package/MODULES/$domain/handlers/pages/form/system/$handler/tabs/mcp/$handler/mcp.js +0 -1
- package/MODULES/Geo//320/232/320/260/321/200/321/202/320/260/$catalog/handlers/pages/form/map/$handler/map.js +0 -623
- package/MODULES/KLADR/$module/handlers/pages/form/kladr/$handler/kladr.js +0 -134
- package/MODULES/Process//320/227/320/260/320/264/320/260/321/207/320/270 /320/270 /321/215/321/202/320/260/320/277/321/213/$catalog/handlers/pages/form/gantt/$handler/gantt.js" +0 -293
- package/MODULES/Process//320/227/320/260/320/264/320/260/321/207/320/270 /320/270 /321/215/321/202/320/260/320/277/321/213/$catalog/handlers/pages/form/scheduler/$handler/scheduler.js" +0 -234
- package/MODULES/Process//320/241/321/205/320/265/320/274/321/213 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/320/276/320/262/$catalog/handlers/pages/form/bpmn/$handler/bpmn.js" +0 -406
- package/MODULES/Register/CATALOGS/$catalog/$folder/$class/$data/$catalog/$virtual/handlers/pages/form/virtual/$handler/virtual.js +0 -399
- package/MODULES/Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/analysis/$handler/analysis.js +0 -9
- package/MODULES/Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/postings/$handler/postings.js +0 -1700
- package/MODULES/Register/REGISTER/$register/$folder/$class/$data/$register/$account/handlers/pages/form/turnovers/$handler/turnovers.js +0 -9
- package/MODULES/Register/REGISTER/$register/handlers/pages/form/journal/$handler/journal.js +0 -723
- package/MODULES/Register/REGISTER/$register/handlers/pages/form/sheet/$handler/sheet.js +0 -808
- package/NODES/$node/handlers/pages/form/network/$handler/network.js +0 -110
- package/models/$ai/$folder/$class/$ai/handlers/pages/form/system/$handler/tabs/ai/$handler/class.js +0 -6
- package/models/$ai/$folder/$class/$provider/handlers/pages/form/system/$handler/tabs/ai/$handler/class.js +0 -6
- package/models/$ai/handlers/pages/form/system/$handler/tabs/ai/$handler/class.js +0 -6
- package/models/Local/$provider/handlers/pages/form/system/$handler/tabs/ai/$handler/class.js +0 -6
- /package/$server/$folder/$class/$structure/$organization/handlers/pages/form/system/{$handler/tabs/requisites → requisites}/$handler/class.js +0 -0
- /package/$server/$folder/$class/$structure/$server/handlers/pages/form/system/{$handler/tabs/database → database}/$handler/class.js +0 -0
- /package/{models → MODELS}/$ai/$folder/$class/$ai/class.js +0 -0
- /package/{models → MODELS}/$ai/$folder/$class/$ai/methods/chat/$method/class.js +0 -0
- /package/{models → MODELS}/$ai/$folder/$class/$provider/class.js +0 -0
- /package/{models → MODELS}/$ai/class.js +0 -0
- /package/{models → MODELS}/$ai/readme.md +0 -0
- /package/{models → MODELS}/GigaChat/$provider/$folder/$class/$ai/class.js +0 -0
- /package/{models → MODELS}/GigaChat/$provider/class.js +0 -0
- /package/{models → MODELS}/GigaChat/GigaChat 2 Lite/$ai/class.js +0 -0
- /package/{models → MODELS}/GigaChat/GigaChat 2 Max/$ai/class.js +0 -0
- /package/{models → MODELS}/GigaChat/GigaChat 2 Pro/$ai/class.js +0 -0
- /package/{models → MODELS}/GigaChat/GigaChat Embeddings/$ai/class.js +0 -0
- /package/{models → MODELS}/Local/$provider/$folder/$class/$ai/class.js +0 -0
- /package/{models → MODELS}/Local/$provider/class.js +0 -0
- /package/{models → MODELS}/Local/$provider/handlers/methods/transfer/$handler/class.js +0 -0
- /package/{models → MODELS}/MTS-AI/$provider/$folder/$class/$ai/class.js +0 -0
- /package/{models → MODELS}/MTS-AI/$provider/class.js +0 -0
- /package/{models → MODELS}/MTS-AI/Cotype Lite/$ai/class.js +0 -0
- /package/{models → MODELS}/MTS-AI/Cotype Pro 2/$ai/class.js +0 -0
- /package/{models → MODELS}/MTS-AI/Cotype Vision/$ai/class.js +0 -0
- /package/{models → MODELS}/T-Bank/$provider/$folder/$class/$ai/class.js +0 -0
- /package/{models → MODELS}/T-Bank/$provider/class.js +0 -0
- /package/{models → MODELS}/T-Bank/T-Lite 2.0/$ai/class.js +0 -0
- /package/{models → MODELS}/T-Bank/T-Pro 2.0/$ai/class.js +0 -0
- /package/{models → MODELS}/T-Bank/T-VoiceKit ASR/$ai/class.js +0 -0
- /package/{models → MODELS}/T-Bank/T-VoiceKit TTS/$ai/class.js +0 -0
- /package/{models → MODELS}/Yandex/$provider/$folder/$class/$ai/class.js +0 -0
- /package/{models → MODELS}/Yandex/$provider/class.js +0 -0
- /package/{models → MODELS}/Yandex/Alice AI (YandexGPT 5 Pro)/$ai/class.js +0 -0
- /package/{models → MODELS}/Yandex/Yandex Embeddings/$ai/class.js +0 -0
- /package/{models → MODELS}/Yandex/Yandex SpeechKit ASR/$ai/class.js +0 -0
- /package/{models → MODELS}/Yandex/Yandex SpeechKit TTS/$ai/class.js +0 -0
- /package/{models → MODELS}/Yandex/YandexART/$ai/class.js +0 -0
- /package/{models → MODELS}/Yandex/YandexGPT 5 Lite/$ai/class.js +0 -0
- /package/{models → MODELS}/Yandex/YandexGPT Reasoning/$ai/class.js +0 -0
- /package/{users → USERS}/$users/class.js +0 -0
|
@@ -1,7 +1,1281 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
const HOUR_HEIGHT = 56;
|
|
2
|
+
const HALF_HEIGHT = HOUR_HEIGHT / 2;
|
|
3
|
+
const CAT_COLORS = {
|
|
4
|
+
meeting: {
|
|
5
|
+
bg: '#eff6ff',
|
|
6
|
+
border: '#2563eb',
|
|
7
|
+
text: '#1e3a8a'
|
|
8
|
+
},
|
|
9
|
+
important: {
|
|
10
|
+
bg: '#fef2f2',
|
|
11
|
+
border: '#dc2626',
|
|
12
|
+
text: '#991b1b'
|
|
13
|
+
},
|
|
14
|
+
personal: {
|
|
15
|
+
bg: '#f5f3ff',
|
|
16
|
+
border: '#7c3aed',
|
|
17
|
+
text: '#5b21b6'
|
|
18
|
+
},
|
|
19
|
+
client: {
|
|
20
|
+
bg: '#ecfdf5',
|
|
21
|
+
border: '#059669',
|
|
22
|
+
text: '#065f46'
|
|
23
|
+
},
|
|
24
|
+
task: {
|
|
25
|
+
bg: '#fff7ed',
|
|
26
|
+
border: '#ea580c',
|
|
27
|
+
text: '#9a3412'
|
|
28
|
+
},
|
|
29
|
+
ai: {
|
|
30
|
+
bg: '#f0fdf4',
|
|
31
|
+
border: '#16a34a',
|
|
32
|
+
text: '#166534'
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
function _newUid() {
|
|
36
|
+
if (globalThis.crypto?.randomUUID) return globalThis.crypto.randomUUID();
|
|
37
|
+
return Date.now().toString(36) + '-' + Math.random().toString(36).slice(2, 10);
|
|
38
|
+
}
|
|
39
|
+
function _asDate(v) {
|
|
40
|
+
if (v instanceof Date && !isNaN(v)) return new Date(v.getTime());
|
|
41
|
+
if (typeof v === 'string' && /^\d{4}-\d{2}-\d{2}$/.test(v)) {
|
|
42
|
+
const [y, m, d] = v.split('-').map(Number);
|
|
43
|
+
return new Date(y, m - 1, d);
|
|
44
|
+
}
|
|
45
|
+
const d = v ? new Date(v) : new Date();
|
|
46
|
+
return isNaN(d) ? new Date() : d;
|
|
47
|
+
}
|
|
48
|
+
function _formatDate(date) {
|
|
49
|
+
const pad = n => String(n).padStart(2, '0');
|
|
50
|
+
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
|
|
51
|
+
}
|
|
52
|
+
function _weekStart(date) {
|
|
53
|
+
const d = new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
54
|
+
const day = d.getDay();
|
|
55
|
+
d.setDate(d.getDate() - (day === 0 ? 6 : day - 1));
|
|
56
|
+
return d;
|
|
57
|
+
}
|
|
58
|
+
function _weekEnd(date) {
|
|
59
|
+
const d = _weekStart(date);
|
|
60
|
+
d.setDate(d.getDate() + 6);
|
|
61
|
+
return d;
|
|
62
|
+
}
|
|
63
|
+
function _parseDay(str) {
|
|
64
|
+
const [y, m, d] = String(str).split('-').map(Number);
|
|
65
|
+
return new Date(y, m - 1, d);
|
|
66
|
+
}
|
|
67
|
+
function _formatTime(iso) {
|
|
68
|
+
if (!iso) return '';
|
|
69
|
+
const d = new Date(iso);
|
|
70
|
+
if (isNaN(d)) return '';
|
|
71
|
+
const pad = n => String(n).padStart(2, '0');
|
|
72
|
+
return `${pad(d.getHours())}:${pad(d.getMinutes())}`;
|
|
73
|
+
}
|
|
74
|
+
function _eventStyleVars(ev) {
|
|
75
|
+
const key = ev.kind === 'task' ? 'task' : ev.kind === 'schedule' ? 'ai' : ev.category || 'meeting';
|
|
76
|
+
return CAT_COLORS[key] || CAT_COLORS.meeting;
|
|
77
|
+
}
|
|
78
|
+
function _layoutDayEvents(dayEvents, dayDate) {
|
|
79
|
+
const dayStart = new Date(dayDate.getFullYear(), dayDate.getMonth(), dayDate.getDate()).getTime();
|
|
80
|
+
const dayEnd = dayStart + 86400_000;
|
|
81
|
+
const minHeight = 20;
|
|
82
|
+
const items = [];
|
|
83
|
+
for (const ev of dayEvents) {
|
|
84
|
+
if (ev.allDay) continue;
|
|
85
|
+
const s = Date.parse(ev.start);
|
|
86
|
+
const e = Date.parse(ev.end);
|
|
87
|
+
if (!Number.isFinite(s) || !Number.isFinite(e) || e <= dayStart || s >= dayEnd) continue;
|
|
88
|
+
const cs = Math.max(s, dayStart);
|
|
89
|
+
const ce = Math.min(e, dayEnd);
|
|
90
|
+
const startMin = (cs - dayStart) / 60000;
|
|
91
|
+
const endMin = Math.max(startMin + 20, (ce - dayStart) / 60000);
|
|
92
|
+
items.push({
|
|
93
|
+
ev,
|
|
94
|
+
startMin,
|
|
95
|
+
endMin,
|
|
96
|
+
top: startMin / 60 * HOUR_HEIGHT,
|
|
97
|
+
height: Math.max(minHeight, (endMin - startMin) / 60 * HOUR_HEIGHT - 2)
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
items.sort((a, b) => a.startMin - b.startMin || b.endMin - a.endMin);
|
|
101
|
+
|
|
102
|
+
// Группируем пересекающиеся события в кластеры и раскладываем по столбцам
|
|
103
|
+
const clusters = [];
|
|
104
|
+
let curCluster = [];
|
|
105
|
+
let clusterEnd = -1;
|
|
106
|
+
for (const it of items) {
|
|
107
|
+
if (!curCluster.length || it.startMin < clusterEnd) {
|
|
108
|
+
curCluster.push(it);
|
|
109
|
+
clusterEnd = Math.max(clusterEnd, it.endMin);
|
|
110
|
+
} else {
|
|
111
|
+
clusters.push(curCluster);
|
|
112
|
+
curCluster = [it];
|
|
113
|
+
clusterEnd = it.endMin;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
if (curCluster.length) clusters.push(curCluster);
|
|
117
|
+
const out = [];
|
|
118
|
+
for (const cluster of clusters) {
|
|
119
|
+
const cols = [];
|
|
120
|
+
for (const it of cluster) {
|
|
121
|
+
let colIdx = cols.findIndex(endT => endT <= it.startMin);
|
|
122
|
+
if (colIdx < 0) {
|
|
123
|
+
colIdx = cols.length;
|
|
124
|
+
cols.push(it.endMin);
|
|
125
|
+
} else {
|
|
126
|
+
cols[colIdx] = it.endMin;
|
|
127
|
+
}
|
|
128
|
+
it.col = colIdx;
|
|
129
|
+
}
|
|
130
|
+
const totalCols = Math.max(1, cols.length);
|
|
131
|
+
for (const it of cluster) {
|
|
132
|
+
const widthPct = 100 / totalCols;
|
|
133
|
+
const leftPct = it.col * widthPct;
|
|
134
|
+
out.push({
|
|
135
|
+
...it.ev,
|
|
136
|
+
top: it.top,
|
|
137
|
+
height: it.height,
|
|
138
|
+
leftPct,
|
|
139
|
+
widthPct,
|
|
140
|
+
timeLabel: `${_formatTime(it.ev.start)}–${_formatTime(it.ev.end)}`
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return out;
|
|
145
|
+
}
|
|
146
|
+
ODA({
|
|
147
|
+
is: 'oda-calendar-time-grid',
|
|
148
|
+
imports: 'oda//icon',
|
|
149
|
+
template: /* html */`
|
|
150
|
+
<style>
|
|
151
|
+
:host {
|
|
152
|
+
@apply --vertical;
|
|
153
|
+
@apply --flex;
|
|
154
|
+
overflow: auto;
|
|
155
|
+
position: relative;
|
|
156
|
+
user-select: none;
|
|
157
|
+
}
|
|
158
|
+
.sticky-top {
|
|
159
|
+
position: sticky;
|
|
160
|
+
top: 0;
|
|
161
|
+
z-index: 5;
|
|
162
|
+
background: var(--content-background, #ffffff);
|
|
163
|
+
border-bottom: 1px solid var(--subtle-border, #e2e8f0);
|
|
164
|
+
flex-shrink: 0;
|
|
165
|
+
}
|
|
166
|
+
.grid-row {
|
|
167
|
+
display: grid;
|
|
168
|
+
grid-template-columns: 56px repeat(var(--cols, 7), minmax(0, 1fr));
|
|
169
|
+
}
|
|
170
|
+
@media (max-width: 768px) {
|
|
171
|
+
.grid-row,
|
|
172
|
+
.body-grid {
|
|
173
|
+
min-width: calc(56px + var(--cols, 7) * 110px);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
.time-corner {
|
|
177
|
+
border-right: 1px solid var(--subtle-border, #e2e8f0);
|
|
178
|
+
font-size: 11px;
|
|
179
|
+
color: var(--muted-color);
|
|
180
|
+
display: flex;
|
|
181
|
+
align-items: flex-end;
|
|
182
|
+
justify-content: flex-end;
|
|
183
|
+
padding: 4px 6px;
|
|
184
|
+
}
|
|
185
|
+
.day-head {
|
|
186
|
+
display: flex;
|
|
187
|
+
flex-direction: column;
|
|
188
|
+
border-right: 1px solid var(--subtle-border, #e2e8f0);
|
|
189
|
+
min-width: 0;
|
|
190
|
+
}
|
|
191
|
+
.day-head:last-child { border-right: none; }
|
|
192
|
+
.day-label {
|
|
193
|
+
display: flex;
|
|
194
|
+
align-items: center;
|
|
195
|
+
justify-content: center;
|
|
196
|
+
gap: 6px;
|
|
197
|
+
padding: 8px 4px 6px;
|
|
198
|
+
font-size: 12.5px;
|
|
199
|
+
font-weight: 600;
|
|
200
|
+
}
|
|
201
|
+
.day-num {
|
|
202
|
+
width: 26px;
|
|
203
|
+
height: 26px;
|
|
204
|
+
border-radius: 50%;
|
|
205
|
+
display: inline-flex;
|
|
206
|
+
align-items: center;
|
|
207
|
+
justify-content: center;
|
|
208
|
+
font-weight: 700;
|
|
209
|
+
}
|
|
210
|
+
.day-head[today] .day-num {
|
|
211
|
+
background: var(--accent-color, #2563eb);
|
|
212
|
+
color: #ffffff;
|
|
213
|
+
}
|
|
214
|
+
.day-head[today] .day-name {
|
|
215
|
+
color: var(--accent-color, #2563eb);
|
|
216
|
+
}
|
|
217
|
+
.all-day-cell {
|
|
218
|
+
min-height: 26px;
|
|
219
|
+
padding: 2px 4px;
|
|
220
|
+
border-top: 1px solid var(--subtle-border, #e2e8f0);
|
|
221
|
+
display: flex;
|
|
222
|
+
flex-direction: column;
|
|
223
|
+
gap: 2px;
|
|
224
|
+
cursor: pointer;
|
|
225
|
+
background: var(--subtle-background, #f8fafc);
|
|
226
|
+
}
|
|
227
|
+
.all-day-chip {
|
|
228
|
+
font-size: 11px;
|
|
229
|
+
font-weight: 600;
|
|
230
|
+
padding: 2px 6px;
|
|
231
|
+
border-radius: 4px;
|
|
232
|
+
border-left: 3px solid;
|
|
233
|
+
overflow: hidden;
|
|
234
|
+
text-overflow: ellipsis;
|
|
235
|
+
white-space: nowrap;
|
|
236
|
+
cursor: pointer;
|
|
237
|
+
}
|
|
238
|
+
.body-grid {
|
|
239
|
+
display: grid;
|
|
240
|
+
grid-template-columns: 56px repeat(var(--cols, 7), minmax(0, 1fr));
|
|
241
|
+
position: relative;
|
|
242
|
+
flex: 1 0 auto;
|
|
243
|
+
}
|
|
244
|
+
.hours-col {
|
|
245
|
+
border-right: 1px solid var(--subtle-border, #e2e8f0);
|
|
246
|
+
background: var(--content-background, #ffffff);
|
|
247
|
+
}
|
|
248
|
+
.hour-mark {
|
|
249
|
+
height: 56px;
|
|
250
|
+
box-sizing: border-box;
|
|
251
|
+
padding: 2px 6px 0 0;
|
|
252
|
+
text-align: right;
|
|
253
|
+
font-size: 11px;
|
|
254
|
+
color: var(--muted-color, #64748b);
|
|
255
|
+
border-top: 1px solid transparent;
|
|
256
|
+
}
|
|
257
|
+
.day-col {
|
|
258
|
+
position: relative;
|
|
259
|
+
border-right: 1px solid var(--subtle-border, #e2e8f0);
|
|
260
|
+
height: 1344px;
|
|
261
|
+
}
|
|
262
|
+
.day-col:last-child { border-right: none; }
|
|
263
|
+
.day-col[today] {
|
|
264
|
+
background: color-mix(in srgb, var(--accent-color, #2563eb) 3%, transparent);
|
|
265
|
+
}
|
|
266
|
+
.half-slot {
|
|
267
|
+
height: 28px;
|
|
268
|
+
box-sizing: border-box;
|
|
269
|
+
cursor: pointer;
|
|
270
|
+
border-top: 1px dotted var(--subtle-border, #e2e8f0);
|
|
271
|
+
}
|
|
272
|
+
.half-slot.hour-start {
|
|
273
|
+
border-top: 1px solid var(--subtle-border, #e2e8f0);
|
|
274
|
+
}
|
|
275
|
+
.half-slot:first-child { border-top: none; }
|
|
276
|
+
.half-slot:hover {
|
|
277
|
+
background: color-mix(in srgb, var(--accent-color, #2563eb) 7%, transparent);
|
|
278
|
+
}
|
|
279
|
+
.ev-card {
|
|
280
|
+
position: absolute;
|
|
281
|
+
box-sizing: border-box;
|
|
282
|
+
padding: 3px 6px 6px;
|
|
283
|
+
border-radius: 6px;
|
|
284
|
+
border-left: 3px solid;
|
|
285
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
|
|
286
|
+
font-size: 11.5px;
|
|
287
|
+
overflow: hidden;
|
|
288
|
+
cursor: pointer;
|
|
289
|
+
z-index: 2;
|
|
290
|
+
transition: box-shadow 0.12s ease;
|
|
291
|
+
}
|
|
292
|
+
.ev-card:hover {
|
|
293
|
+
z-index: 4;
|
|
294
|
+
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.16);
|
|
295
|
+
}
|
|
296
|
+
.ev-title {
|
|
297
|
+
font-weight: 700;
|
|
298
|
+
line-height: 1.2;
|
|
299
|
+
overflow: hidden;
|
|
300
|
+
text-overflow: ellipsis;
|
|
301
|
+
white-space: nowrap;
|
|
302
|
+
}
|
|
303
|
+
.ev-meta {
|
|
304
|
+
font-size: 10.5px;
|
|
305
|
+
opacity: 0.85;
|
|
306
|
+
overflow: hidden;
|
|
307
|
+
text-overflow: ellipsis;
|
|
308
|
+
white-space: nowrap;
|
|
309
|
+
}
|
|
310
|
+
.ev-resize {
|
|
311
|
+
position: absolute;
|
|
312
|
+
left: 0;
|
|
313
|
+
right: 0;
|
|
314
|
+
bottom: 0;
|
|
315
|
+
height: 6px;
|
|
316
|
+
cursor: ns-resize;
|
|
317
|
+
}
|
|
318
|
+
.now-line {
|
|
319
|
+
position: absolute;
|
|
320
|
+
left: 0;
|
|
321
|
+
right: 0;
|
|
322
|
+
height: 2px;
|
|
323
|
+
background: #dc2626;
|
|
324
|
+
z-index: 3;
|
|
325
|
+
pointer-events: none;
|
|
326
|
+
}
|
|
327
|
+
.now-line::before {
|
|
328
|
+
content: '';
|
|
329
|
+
position: absolute;
|
|
330
|
+
left: -4px;
|
|
331
|
+
top: -3px;
|
|
332
|
+
width: 8px;
|
|
333
|
+
height: 8px;
|
|
334
|
+
border-radius: 50%;
|
|
335
|
+
background: #dc2626;
|
|
336
|
+
}
|
|
337
|
+
</style>
|
|
338
|
+
|
|
339
|
+
<div class="sticky-top">
|
|
340
|
+
<div class="grid-row" ~style="colsStyle">
|
|
341
|
+
<div class="time-corner">Весь день</div>
|
|
342
|
+
<div ~for="columns" class="day-head" :today="$for.item.isToday">
|
|
343
|
+
<div class="day-label">
|
|
344
|
+
<span class="day-name">{{$for.item.dayName}}</span>
|
|
345
|
+
<span class="day-num">{{$for.item.dayNum}}</span>
|
|
346
|
+
</div>
|
|
347
|
+
<div class="all-day-cell" @tap="onAllDayTap($for.item)">
|
|
348
|
+
<div ~for="$for.item.allDayEvents" class="all-day-chip"
|
|
349
|
+
:style="cardStyle($for.item)"
|
|
350
|
+
@tap.stop="openEv($for.item)">
|
|
351
|
+
{{$for.item.summary || 'Событие'}}
|
|
352
|
+
</div>
|
|
353
|
+
</div>
|
|
354
|
+
</div>
|
|
355
|
+
</div>
|
|
356
|
+
</div>
|
|
357
|
+
|
|
358
|
+
<div class="body-grid" ~style="colsStyle">
|
|
359
|
+
<div class="hours-col">
|
|
360
|
+
<div ~for="hours" class="hour-mark">{{$for.item}}</div>
|
|
361
|
+
</div>
|
|
362
|
+
<div ~for="columns" class="day-col" :today="$for.item.isToday"
|
|
363
|
+
@dragover.prevent="onDragOver($event)"
|
|
364
|
+
@drop.prevent="onDrop($event, $for.item)">
|
|
365
|
+
<div ~for="halfSlots" class="half-slot" ~class="{ 'hour-start': $for.item.isHour }"
|
|
366
|
+
@tap="onSlotTap($for.$for.item, $for.item)"></div>
|
|
367
|
+
|
|
368
|
+
<div ~if="$for.item.isToday && nowTop >= 0" class="now-line" :style="'top:' + nowTop + 'px;'"></div>
|
|
369
|
+
|
|
370
|
+
<div ~for="$for.item.timedEvents" class="ev-card"
|
|
371
|
+
:draggable="$for.item.kind === 'event'"
|
|
372
|
+
:style="timedCardStyle($for.item)"
|
|
373
|
+
@dragstart="onDragStart($event, $for.item)"
|
|
374
|
+
@tap.stop="openEv($for.item)">
|
|
375
|
+
<div class="ev-title">{{$for.item.summary || 'Событие'}}</div>
|
|
376
|
+
<div class="ev-meta">{{$for.item.timeLabel}}{{$for.item.location ? ' · ' + $for.item.location : ''}}</div>
|
|
377
|
+
<div ~if="$for.item.kind === 'event'" class="ev-resize" @pointerdown.stop="startResize($event, $for.item)"></div>
|
|
378
|
+
</div>
|
|
379
|
+
</div>
|
|
380
|
+
</div>
|
|
381
|
+
`,
|
|
382
|
+
events: [],
|
|
383
|
+
currentDate: null,
|
|
384
|
+
viewMode: 'week',
|
|
385
|
+
nowTop: -1,
|
|
386
|
+
_scrolledOnce: false,
|
|
387
|
+
_dragEv: null,
|
|
388
|
+
attached() {
|
|
389
|
+
this._updateNowLine();
|
|
390
|
+
this._nowTimer = setInterval(() => this._updateNowLine(), 60_000);
|
|
391
|
+
requestAnimationFrame(() => {
|
|
392
|
+
if (!this._scrolledOnce) {
|
|
393
|
+
this._scrolledOnce = true;
|
|
394
|
+
this.scrollTop = 8 * HOUR_HEIGHT;
|
|
395
|
+
}
|
|
396
|
+
});
|
|
397
|
+
},
|
|
398
|
+
detached() {
|
|
399
|
+
clearInterval(this._nowTimer);
|
|
400
|
+
},
|
|
401
|
+
_updateNowLine() {
|
|
402
|
+
const d = new Date();
|
|
403
|
+
this.nowTop = (d.getHours() * 60 + d.getMinutes()) / 60 * HOUR_HEIGHT;
|
|
404
|
+
},
|
|
405
|
+
get hours() {
|
|
406
|
+
const out = [];
|
|
407
|
+
for (let h = 0; h < 24; h++) out.push(String(h).padStart(2, '0') + ':00');
|
|
408
|
+
return out;
|
|
409
|
+
},
|
|
410
|
+
get halfSlots() {
|
|
411
|
+
const out = [];
|
|
412
|
+
for (let i = 0; i < 48; i++) out.push({
|
|
413
|
+
idx: i,
|
|
414
|
+
isHour: i % 2 === 0
|
|
415
|
+
});
|
|
416
|
+
return out;
|
|
417
|
+
},
|
|
418
|
+
get columns() {
|
|
419
|
+
const cur = _asDate(this.currentDate);
|
|
420
|
+
const todayStr = _formatDate(new Date());
|
|
421
|
+
const count = this.viewMode === 'day' ? 1 : this.viewMode === 'workweek' ? 5 : 7;
|
|
422
|
+
const start = this.viewMode === 'day' ? new Date(cur.getFullYear(), cur.getMonth(), cur.getDate()) : _weekStart(cur);
|
|
423
|
+
const list = Array.isArray(this.events) ? this.events : [];
|
|
424
|
+
const cols = [];
|
|
425
|
+
for (let i = 0; i < count; i++) {
|
|
426
|
+
const d = new Date(start.getFullYear(), start.getMonth(), start.getDate() + i);
|
|
427
|
+
const ds = _formatDate(d);
|
|
428
|
+
const dayStartMs = d.getTime();
|
|
429
|
+
const dayEndMs = dayStartMs + 86400_000;
|
|
430
|
+
const dayEvents = list.filter(ev => {
|
|
431
|
+
const s = Date.parse(ev.start);
|
|
432
|
+
const e = Date.parse(ev.end);
|
|
433
|
+
return Number.isFinite(s) && Number.isFinite(e) && e > dayStartMs && s < dayEndMs;
|
|
434
|
+
});
|
|
435
|
+
cols.push({
|
|
436
|
+
dateStr: ds,
|
|
437
|
+
fullDate: d,
|
|
438
|
+
dayNum: d.getDate(),
|
|
439
|
+
dayName: d.toLocaleDateString('ru-RU', {
|
|
440
|
+
weekday: 'short'
|
|
441
|
+
}),
|
|
442
|
+
isToday: ds === todayStr,
|
|
443
|
+
allDayEvents: dayEvents.filter(ev => ev.allDay),
|
|
444
|
+
timedEvents: _layoutDayEvents(dayEvents, d)
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
return cols;
|
|
448
|
+
},
|
|
449
|
+
get colsStyle() {
|
|
450
|
+
return `--cols: ${this.columns.length};`;
|
|
451
|
+
},
|
|
452
|
+
cardStyle(ev) {
|
|
453
|
+
const c = _eventStyleVars(ev);
|
|
454
|
+
return `background:${c.bg};border-left-color:${c.border};color:${c.text};`;
|
|
455
|
+
},
|
|
456
|
+
timedCardStyle(ev) {
|
|
457
|
+
const c = _eventStyleVars(ev);
|
|
458
|
+
return `top:${ev.top}px;height:${ev.height}px;left:calc(${ev.leftPct}% + 2px);width:calc(${ev.widthPct}% - 4px);background:${c.bg};border-left-color:${c.border};color:${c.text};`;
|
|
459
|
+
},
|
|
460
|
+
onAllDayTap(col) {
|
|
461
|
+
const s = new Date(col.fullDate);
|
|
462
|
+
s.setHours(0, 0, 0, 0);
|
|
463
|
+
const e = new Date(s);
|
|
464
|
+
e.setDate(e.getDate() + 1);
|
|
465
|
+
this.fire('add-event', {
|
|
466
|
+
start: s,
|
|
467
|
+
end: e,
|
|
468
|
+
allDay: true
|
|
469
|
+
});
|
|
470
|
+
},
|
|
471
|
+
onSlotTap(col, slot) {
|
|
472
|
+
const s = new Date(col.fullDate);
|
|
473
|
+
const h = Math.floor(slot.idx / 2);
|
|
474
|
+
const m = slot.idx % 2 * 30;
|
|
475
|
+
s.setHours(h, m, 0, 0);
|
|
476
|
+
const e = new Date(s.getTime() + 60 * 60_000);
|
|
477
|
+
this.fire('add-event', {
|
|
478
|
+
start: s,
|
|
479
|
+
end: e,
|
|
480
|
+
allDay: false
|
|
481
|
+
});
|
|
482
|
+
},
|
|
483
|
+
openEv(ev) {
|
|
484
|
+
this.fire('open-event', ev);
|
|
485
|
+
},
|
|
486
|
+
onDragStart(e, ev) {
|
|
487
|
+
if (ev.kind !== 'event') {
|
|
488
|
+
e.preventDefault();
|
|
489
|
+
return;
|
|
490
|
+
}
|
|
491
|
+
this._dragEv = ev;
|
|
492
|
+
e.dataTransfer?.setData('text/plain', ev.uid || 'event');
|
|
493
|
+
},
|
|
494
|
+
onDragOver(e) {
|
|
495
|
+
if (this._dragEv) e.preventDefault();
|
|
496
|
+
},
|
|
497
|
+
onDrop(e, col) {
|
|
498
|
+
const ev = this._dragEv;
|
|
499
|
+
this._dragEv = null;
|
|
500
|
+
if (!ev) return;
|
|
501
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
502
|
+
const y = Math.max(0, e.clientY - rect.top);
|
|
503
|
+
const halfIdx = Math.min(47, Math.floor(y / HALF_HEIGHT));
|
|
504
|
+
const durMs = Math.max(30 * 60_000, Date.parse(ev.end) - Date.parse(ev.start));
|
|
505
|
+
const nextStart = new Date(col.fullDate);
|
|
506
|
+
nextStart.setHours(Math.floor(halfIdx / 2), halfIdx % 2 * 30, 0, 0);
|
|
507
|
+
const nextEnd = new Date(nextStart.getTime() + durMs);
|
|
508
|
+
this.fire('move-event', {
|
|
509
|
+
ev,
|
|
510
|
+
start: nextStart.toISOTimezoneString(),
|
|
511
|
+
end: nextEnd.toISOTimezoneString()
|
|
512
|
+
});
|
|
513
|
+
},
|
|
514
|
+
startResize(e, ev) {
|
|
515
|
+
e.preventDefault();
|
|
516
|
+
const startY = e.clientY;
|
|
517
|
+
const origStartMs = Date.parse(ev.start);
|
|
518
|
+
const origEndMs = Date.parse(ev.end);
|
|
519
|
+
const onMove = mv => {
|
|
520
|
+
const dy = mv.clientY - startY;
|
|
521
|
+
const deltaMin = Math.round(dy / HOUR_HEIGHT * 60 / 15) * 15;
|
|
522
|
+
const nextEndMs = Math.max(origStartMs + 30 * 60_000, origEndMs + deltaMin * 60_000);
|
|
523
|
+
const card = e.target.closest('.ev-card');
|
|
524
|
+
if (card) card.style.height = Math.max(20, (nextEndMs - origStartMs) / 3600_000 * HOUR_HEIGHT - 2) + 'px';
|
|
525
|
+
};
|
|
526
|
+
const onUp = up => {
|
|
527
|
+
window.removeEventListener('pointermove', onMove);
|
|
528
|
+
window.removeEventListener('pointerup', onUp);
|
|
529
|
+
const dy = up.clientY - startY;
|
|
530
|
+
const deltaMin = Math.round(dy / HOUR_HEIGHT * 60 / 15) * 15;
|
|
531
|
+
if (!deltaMin) return;
|
|
532
|
+
const nextEndMs = Math.max(origStartMs + 30 * 60_000, origEndMs + deltaMin * 60_000);
|
|
533
|
+
this.fire('move-event', {
|
|
534
|
+
ev,
|
|
535
|
+
start: new Date(origStartMs).toISOTimezoneString(),
|
|
536
|
+
end: new Date(nextEndMs).toISOTimezoneString()
|
|
537
|
+
});
|
|
538
|
+
};
|
|
539
|
+
window.addEventListener('pointermove', onMove);
|
|
540
|
+
window.addEventListener('pointerup', onUp);
|
|
541
|
+
}
|
|
542
|
+
});
|
|
543
|
+
ODA({
|
|
544
|
+
is: 'oda-calendar-month-view',
|
|
545
|
+
template: /* html */`
|
|
546
|
+
<style>
|
|
547
|
+
:host {
|
|
548
|
+
@apply --vertical;
|
|
549
|
+
@apply --flex;
|
|
550
|
+
overflow: auto;
|
|
551
|
+
padding: 8px 12px 12px;
|
|
552
|
+
}
|
|
553
|
+
.month-grid {
|
|
554
|
+
display: grid;
|
|
555
|
+
grid-template-columns: repeat(7, minmax(0, 1fr));
|
|
556
|
+
grid-auto-rows: minmax(105px, 1fr);
|
|
557
|
+
gap: 1px;
|
|
558
|
+
background: var(--subtle-border, #e2e8f0);
|
|
559
|
+
border: 1px solid var(--subtle-border, #e2e8f0);
|
|
560
|
+
border-radius: 8px;
|
|
561
|
+
overflow: hidden;
|
|
562
|
+
flex: 1 0 auto;
|
|
563
|
+
}
|
|
564
|
+
.wday-head {
|
|
565
|
+
background: var(--subtle-background, #f8fafc);
|
|
566
|
+
padding: 6px 8px;
|
|
567
|
+
text-align: center;
|
|
568
|
+
font-size: 12px;
|
|
569
|
+
font-weight: 600;
|
|
570
|
+
color: var(--muted-color, #64748b);
|
|
571
|
+
min-height: auto;
|
|
572
|
+
grid-row: auto;
|
|
573
|
+
}
|
|
574
|
+
.month-head-row {
|
|
575
|
+
display: grid;
|
|
576
|
+
grid-template-columns: repeat(7, minmax(0, 1fr));
|
|
577
|
+
gap: 1px;
|
|
578
|
+
background: var(--subtle-border, #e2e8f0);
|
|
579
|
+
border: 1px solid var(--subtle-border, #e2e8f0);
|
|
580
|
+
border-bottom: none;
|
|
581
|
+
border-radius: 8px 8px 0 0;
|
|
582
|
+
overflow: hidden;
|
|
583
|
+
}
|
|
584
|
+
.day-cell {
|
|
585
|
+
background: var(--content-background, #ffffff);
|
|
586
|
+
padding: 6px;
|
|
587
|
+
display: flex;
|
|
588
|
+
flex-direction: column;
|
|
589
|
+
gap: 3px;
|
|
590
|
+
cursor: pointer;
|
|
591
|
+
min-width: 0;
|
|
592
|
+
}
|
|
593
|
+
.day-cell:hover { background: var(--subtle-background, #f8fafc); }
|
|
594
|
+
.day-cell.other { opacity: 0.48; }
|
|
595
|
+
.cell-num {
|
|
596
|
+
width: 24px;
|
|
597
|
+
height: 24px;
|
|
598
|
+
border-radius: 50%;
|
|
599
|
+
display: inline-flex;
|
|
600
|
+
align-items: center;
|
|
601
|
+
justify-content: center;
|
|
602
|
+
font-size: 12.5px;
|
|
603
|
+
font-weight: 600;
|
|
604
|
+
align-self: flex-end;
|
|
605
|
+
}
|
|
606
|
+
.day-cell.today .cell-num {
|
|
607
|
+
background: var(--accent-color, #2563eb);
|
|
608
|
+
color: #ffffff;
|
|
609
|
+
}
|
|
610
|
+
.chip {
|
|
611
|
+
font-size: 11px;
|
|
612
|
+
padding: 2px 5px;
|
|
613
|
+
border-radius: 4px;
|
|
614
|
+
border-left: 3px solid;
|
|
615
|
+
overflow: hidden;
|
|
616
|
+
text-overflow: ellipsis;
|
|
617
|
+
white-space: nowrap;
|
|
618
|
+
font-weight: 500;
|
|
619
|
+
}
|
|
620
|
+
.more {
|
|
621
|
+
font-size: 11px;
|
|
622
|
+
color: var(--muted-color);
|
|
623
|
+
padding-left: 4px;
|
|
624
|
+
}
|
|
625
|
+
</style>
|
|
626
|
+
<div class="month-head-row">
|
|
627
|
+
<div ~for="weekdays" class="wday-head">{{$for.item}}</div>
|
|
628
|
+
</div>
|
|
629
|
+
<div class="month-grid" style="border-top-left-radius:0;border-top-right-radius:0;">
|
|
630
|
+
<div ~for="days" class="day-cell" ~class="{ other: $for.item.otherMonth, today: $for.item.isToday }" @tap="selectDay($for.item.date)">
|
|
631
|
+
<span class="cell-num">{{$for.item.day}}</span>
|
|
632
|
+
<div ~for="$for.item.visibleChips" class="chip" :style="chipStyle($for.item)" @tap.stop="openEv($for.item)">
|
|
633
|
+
{{$for.item.allDay ? '' : ($for.item.timeShort + ' ')}}{{$for.item.summary || 'Событие'}}
|
|
634
|
+
</div>
|
|
635
|
+
<div ~if="$for.item.extraCount > 0" class="more">+ ещё {{$for.item.extraCount}}</div>
|
|
636
|
+
</div>
|
|
637
|
+
</div>
|
|
638
|
+
`,
|
|
639
|
+
currentDate: null,
|
|
640
|
+
events: [],
|
|
641
|
+
weekdays: ['Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс'],
|
|
642
|
+
get days() {
|
|
643
|
+
const cur = _asDate(this.currentDate);
|
|
644
|
+
const month = cur.getMonth();
|
|
645
|
+
const start = _weekStart(new Date(cur.getFullYear(), month, 1));
|
|
646
|
+
const end = _weekEnd(new Date(cur.getFullYear(), month + 1, 0));
|
|
647
|
+
const todayStr = _formatDate(new Date());
|
|
648
|
+
const list = Array.isArray(this.events) ? this.events : [];
|
|
649
|
+
const out = [];
|
|
650
|
+
for (let d = new Date(start); d <= end; d.setDate(d.getDate() + 1)) {
|
|
651
|
+
const date = new Date(d.getFullYear(), d.getMonth(), d.getDate());
|
|
652
|
+
const ds = _formatDate(date);
|
|
653
|
+
const sMs = date.getTime();
|
|
654
|
+
const eMs = sMs + 86400_000;
|
|
655
|
+
const dayEvs = list.filter(ev => {
|
|
656
|
+
const s = Date.parse(ev.start);
|
|
657
|
+
const e = Date.parse(ev.end);
|
|
658
|
+
return Number.isFinite(s) && Number.isFinite(e) && e > sMs && s < eMs;
|
|
659
|
+
}).map(ev => ({
|
|
660
|
+
...ev,
|
|
661
|
+
timeShort: _formatTime(ev.start)
|
|
662
|
+
}));
|
|
663
|
+
out.push({
|
|
664
|
+
day: date.getDate(),
|
|
665
|
+
date,
|
|
666
|
+
otherMonth: date.getMonth() !== month,
|
|
667
|
+
isToday: ds === todayStr,
|
|
668
|
+
visibleChips: dayEvs.slice(0, 4),
|
|
669
|
+
extraCount: Math.max(0, dayEvs.length - 4)
|
|
670
|
+
});
|
|
671
|
+
}
|
|
672
|
+
return out;
|
|
673
|
+
},
|
|
674
|
+
chipStyle(ev) {
|
|
675
|
+
const c = _eventStyleVars(ev);
|
|
676
|
+
return `background:${c.bg};border-left-color:${c.border};color:${c.text};`;
|
|
677
|
+
},
|
|
678
|
+
selectDay(date) {
|
|
679
|
+
const s = new Date(date);
|
|
680
|
+
s.setHours(0, 0, 0, 0);
|
|
681
|
+
const e = new Date(s);
|
|
682
|
+
e.setDate(e.getDate() + 1);
|
|
683
|
+
this.fire('add-event', {
|
|
684
|
+
start: s,
|
|
685
|
+
end: e,
|
|
686
|
+
allDay: true
|
|
687
|
+
});
|
|
688
|
+
},
|
|
689
|
+
openEv(ev) {
|
|
690
|
+
this.fire('open-event', ev);
|
|
691
|
+
}
|
|
692
|
+
});
|
|
693
|
+
export default {
|
|
694
|
+
icon: 'enterprise:calendar',
|
|
695
|
+
label: 'Календарь',
|
|
696
|
+
order: 3,
|
|
697
|
+
allowExternal: false,
|
|
698
|
+
component: {
|
|
699
|
+
imports: 'oda//icon, oda//button, ~/lib//calendar-form.js',
|
|
700
|
+
template: /* html */`
|
|
701
|
+
<style>
|
|
702
|
+
:host {
|
|
703
|
+
@apply --vertical;
|
|
704
|
+
@apply --flex;
|
|
705
|
+
overflow: hidden;
|
|
706
|
+
background: var(--content-background, #ffffff);
|
|
707
|
+
color: var(--content-color, #1e293b);
|
|
708
|
+
position: relative;
|
|
709
|
+
}
|
|
710
|
+
.cal-header {
|
|
711
|
+
@apply --horizontal;
|
|
712
|
+
align-items: center;
|
|
713
|
+
gap: 8px 10px;
|
|
714
|
+
padding: 8px 14px;
|
|
715
|
+
border-bottom: 1px solid var(--subtle-border, #e2e8f0);
|
|
716
|
+
background: var(--subtle-background, #f8fafc);
|
|
717
|
+
flex-wrap: wrap;
|
|
718
|
+
flex-shrink: 0;
|
|
719
|
+
max-width: 100%;
|
|
720
|
+
box-sizing: border-box;
|
|
721
|
+
}
|
|
722
|
+
.cal-group {
|
|
723
|
+
@apply --horizontal;
|
|
724
|
+
align-items: center;
|
|
725
|
+
flex-wrap: wrap;
|
|
726
|
+
gap: 4px;
|
|
727
|
+
max-width: 100%;
|
|
728
|
+
min-width: 0;
|
|
729
|
+
}
|
|
730
|
+
.btn-new {
|
|
731
|
+
@apply --horizontal;
|
|
732
|
+
align-items: center;
|
|
733
|
+
gap: 5px;
|
|
734
|
+
padding: 6px 13px;
|
|
735
|
+
border-radius: 8px;
|
|
736
|
+
border: none;
|
|
737
|
+
background: var(--accent-color, #2563eb);
|
|
738
|
+
color: var(--accent-back, #ffffff);
|
|
739
|
+
font: inherit;
|
|
740
|
+
font-size: 13px;
|
|
741
|
+
font-weight: 600;
|
|
742
|
+
cursor: pointer;
|
|
743
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
|
|
744
|
+
}
|
|
745
|
+
.btn-new:hover { filter: brightness(1.06); }
|
|
746
|
+
.btn-outline {
|
|
747
|
+
@apply --horizontal;
|
|
748
|
+
align-items: center;
|
|
749
|
+
gap: 5px;
|
|
750
|
+
padding: 5px 10px;
|
|
751
|
+
border-radius: 7px;
|
|
752
|
+
border: 1px solid var(--subtle-border, #cbd5e1);
|
|
753
|
+
background: var(--content-background, #ffffff);
|
|
754
|
+
color: inherit;
|
|
755
|
+
font: inherit;
|
|
756
|
+
font-size: 12.5px;
|
|
757
|
+
font-weight: 500;
|
|
758
|
+
cursor: pointer;
|
|
759
|
+
}
|
|
760
|
+
.btn-outline:hover { background: var(--accent-soft); }
|
|
761
|
+
.btn-outline.active {
|
|
762
|
+
border-color: var(--accent-color, #2563eb);
|
|
763
|
+
color: var(--accent-color, #2563eb);
|
|
764
|
+
background: color-mix(in srgb, var(--accent-color, #2563eb) 10%, var(--content-background, #ffffff));
|
|
765
|
+
font-weight: 600;
|
|
766
|
+
}
|
|
767
|
+
.period-title {
|
|
768
|
+
font-size: 15px;
|
|
769
|
+
font-weight: 700;
|
|
770
|
+
margin: 0 4px;
|
|
771
|
+
white-space: nowrap;
|
|
772
|
+
}
|
|
773
|
+
.date-jump {
|
|
774
|
+
border: 1px solid var(--subtle-border, #cbd5e1);
|
|
775
|
+
border-radius: 6px;
|
|
776
|
+
padding: 3px 6px;
|
|
777
|
+
font: inherit;
|
|
778
|
+
font-size: 12px;
|
|
779
|
+
background: var(--content-background, #ffffff);
|
|
780
|
+
color: inherit;
|
|
781
|
+
cursor: pointer;
|
|
782
|
+
}
|
|
783
|
+
.layer-pill {
|
|
784
|
+
@apply --horizontal;
|
|
785
|
+
align-items: center;
|
|
786
|
+
gap: 5px;
|
|
787
|
+
padding: 4px 9px;
|
|
788
|
+
border-radius: 999px;
|
|
789
|
+
border: 1px solid var(--subtle-border, #cbd5e1);
|
|
790
|
+
background: var(--content-background, #ffffff);
|
|
791
|
+
font: inherit;
|
|
792
|
+
font-size: 12px;
|
|
793
|
+
cursor: pointer;
|
|
794
|
+
opacity: 0.65;
|
|
795
|
+
transition: opacity 0.12s ease, border-color 0.12s ease;
|
|
796
|
+
}
|
|
797
|
+
.layer-pill.on {
|
|
798
|
+
opacity: 1;
|
|
799
|
+
font-weight: 600;
|
|
800
|
+
border-color: var(--border-color, #94a3b8);
|
|
801
|
+
}
|
|
802
|
+
.layer-dot {
|
|
803
|
+
width: 8px;
|
|
804
|
+
height: 8px;
|
|
805
|
+
border-radius: 50%;
|
|
806
|
+
}
|
|
807
|
+
.seg-tabs {
|
|
808
|
+
@apply --horizontal;
|
|
809
|
+
align-items: center;
|
|
810
|
+
flex-wrap: wrap;
|
|
811
|
+
padding: 2px;
|
|
812
|
+
border-radius: 8px;
|
|
813
|
+
border: 1px solid var(--subtle-border, #cbd5e1);
|
|
814
|
+
background: var(--content-background, #ffffff);
|
|
815
|
+
gap: 2px;
|
|
816
|
+
}
|
|
817
|
+
.seg-btn {
|
|
818
|
+
border: none;
|
|
819
|
+
background: transparent;
|
|
820
|
+
color: inherit;
|
|
821
|
+
font: inherit;
|
|
822
|
+
font-size: 12.5px;
|
|
823
|
+
font-weight: 500;
|
|
824
|
+
padding: 4px 10px;
|
|
825
|
+
border-radius: 6px;
|
|
826
|
+
cursor: pointer;
|
|
827
|
+
}
|
|
828
|
+
.seg-btn.active {
|
|
829
|
+
background: var(--accent-color, #2563eb);
|
|
830
|
+
color: var(--accent-back, #ffffff);
|
|
831
|
+
font-weight: 600;
|
|
832
|
+
}
|
|
833
|
+
.att-popover {
|
|
834
|
+
position: absolute;
|
|
835
|
+
top: 50px;
|
|
836
|
+
right: 12px;
|
|
837
|
+
z-index: 20;
|
|
838
|
+
width: min(260px, calc(100vw - 24px));
|
|
839
|
+
max-height: min(320px, 60dvh);
|
|
840
|
+
overflow-y: auto;
|
|
841
|
+
background: var(--content-background, #ffffff);
|
|
842
|
+
border: 1px solid var(--border-color, #cbd5e1);
|
|
843
|
+
border-radius: 10px;
|
|
844
|
+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
|
|
845
|
+
padding: 10px;
|
|
846
|
+
display: flex;
|
|
847
|
+
flex-direction: column;
|
|
848
|
+
gap: 6px;
|
|
849
|
+
font-size: 12.5px;
|
|
850
|
+
box-sizing: border-box;
|
|
851
|
+
}
|
|
852
|
+
@media (max-width: 768px) {
|
|
853
|
+
.period-title {
|
|
854
|
+
font-size: 13.5px;
|
|
855
|
+
white-space: normal;
|
|
856
|
+
}
|
|
857
|
+
.seg-btn {
|
|
858
|
+
padding: 4px 7px;
|
|
859
|
+
font-size: 12px;
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
.att-row {
|
|
863
|
+
@apply --horizontal;
|
|
864
|
+
align-items: center;
|
|
865
|
+
gap: 8px;
|
|
866
|
+
padding: 5px 8px;
|
|
867
|
+
border-radius: 6px;
|
|
868
|
+
cursor: pointer;
|
|
869
|
+
}
|
|
870
|
+
.att-row:hover { background: var(--subtle-background, #f1f5f9); }
|
|
871
|
+
.att-row.selected {
|
|
872
|
+
background: color-mix(in srgb, var(--accent-color, #2563eb) 12%, transparent);
|
|
873
|
+
color: var(--accent-color, #2563eb);
|
|
874
|
+
font-weight: 600;
|
|
875
|
+
}
|
|
876
|
+
</style>
|
|
877
|
+
|
|
878
|
+
<div class="cal-header">
|
|
879
|
+
<div class="cal-group">
|
|
880
|
+
<button type="button" class="btn-new" @tap="openCreate()" title="Создать новую встречу">
|
|
881
|
+
<oda-icon icon="icons:add" icon-size="16"></oda-icon>
|
|
882
|
+
<span>Встреча</span>
|
|
883
|
+
</button>
|
|
884
|
+
<button type="button" class="btn-outline" @tap="goToday()">Сегодня</button>
|
|
885
|
+
<button type="button" class="btn-outline" @tap="stepDate(-1)" title="Назад" style="padding: 5px 7px;">
|
|
886
|
+
<oda-icon icon="icons:chevron-left" icon-size="16"></oda-icon>
|
|
887
|
+
</button>
|
|
888
|
+
<button type="button" class="btn-outline" @tap="stepDate(1)" title="Вперёд" style="padding: 5px 7px;">
|
|
889
|
+
<oda-icon icon="icons:chevron-right" icon-size="16"></oda-icon>
|
|
890
|
+
</button>
|
|
891
|
+
<span class="period-title">{{periodTitle}}</span>
|
|
892
|
+
<input class="date-jump" type="date" :value="day" @change="onDateJump($event)" title="Перейти к дате">
|
|
893
|
+
</div>
|
|
894
|
+
|
|
895
|
+
<div style="flex: 1;"></div>
|
|
896
|
+
|
|
897
|
+
<div class="cal-group">
|
|
898
|
+
<button type="button" class="layer-pill" ~class="{ on: showEvents }" @tap="showEvents = !showEvents" title="Встречи и события">
|
|
899
|
+
<span class="layer-dot" style="background:#2563eb;"></span>
|
|
900
|
+
<span>Встречи</span>
|
|
901
|
+
</button>
|
|
902
|
+
<button type="button" class="layer-pill" ~class="{ on: showTasks }" @tap="showTasks = !showTasks" title="Задачи узла">
|
|
903
|
+
<span class="layer-dot" style="background:#ea580c;"></span>
|
|
904
|
+
<span>Задачи</span>
|
|
905
|
+
</button>
|
|
906
|
+
<button type="button" class="layer-pill" ~class="{ on: showSchedules }" @tap="showSchedules = !showSchedules" title="Расписания ИИ-двойника">
|
|
907
|
+
<span class="layer-dot" style="background:#16a34a;"></span>
|
|
908
|
+
<span>Расписания ИИ</span>
|
|
909
|
+
</button>
|
|
910
|
+
</div>
|
|
911
|
+
|
|
912
|
+
<div class="cal-group" ~if="contacts.length">
|
|
913
|
+
<button type="button" class="btn-outline" ~class="{ active: selected_users.length > 0 || showPeopleMenu }" @tap="showPeopleMenu = !showPeopleMenu" title="Фильтр по участникам">
|
|
914
|
+
<oda-icon icon="icons:supervisor-account" icon-size="15"></oda-icon>
|
|
915
|
+
<span>{{selected_users.length ? 'Участники (' + selected_users.length + ')' : 'Участники'}}</span>
|
|
916
|
+
</button>
|
|
917
|
+
</div>
|
|
918
|
+
|
|
919
|
+
<div class="seg-tabs">
|
|
920
|
+
<button type="button" class="seg-btn" ~class="{ active: viewMode === 'day' }" @tap="setViewMode('day')">День</button>
|
|
921
|
+
<button type="button" class="seg-btn" ~class="{ active: viewMode === 'workweek' }" @tap="setViewMode('workweek')">Раб. неделя</button>
|
|
922
|
+
<button type="button" class="seg-btn" ~class="{ active: viewMode === 'week' }" @tap="setViewMode('week')">Неделя</button>
|
|
923
|
+
<button type="button" class="seg-btn" ~class="{ active: viewMode === 'month' }" @tap="setViewMode('month')">Месяц</button>
|
|
924
|
+
</div>
|
|
925
|
+
|
|
926
|
+
<button type="button" class="btn-outline" @tap="reloadEvents()" title="Обновить календарь" style="padding: 5px 8px;">
|
|
927
|
+
<oda-icon icon="icons:refresh" icon-size="15"></oda-icon>
|
|
928
|
+
</button>
|
|
929
|
+
</div>
|
|
930
|
+
|
|
931
|
+
<div ~if="showPeopleMenu" class="att-popover">
|
|
932
|
+
<div style="display:flex;align-items:center;justify-content:space-between;font-weight:700;">
|
|
933
|
+
<span>Фильтр по сотрудникам</span>
|
|
934
|
+
<button type="button" class="btn-outline" style="padding:2px 6px;font-size:11px;" ~if="selected_users.length" @tap="clearUsers()">Сбросить</button>
|
|
935
|
+
</div>
|
|
936
|
+
<div ~for="contacts" class="att-row" ~class="{ selected: selected_users.includes($for.item.id) }" @tap="toggleUserFilter($for.item.id)">
|
|
937
|
+
<span>{{selected_users.includes($for.item.id) ? '☑' : '☐'}}</span>
|
|
938
|
+
<span>{{$for.item.label || $for.item.id}}</span>
|
|
939
|
+
</div>
|
|
940
|
+
</div>
|
|
941
|
+
|
|
942
|
+
<oda-calendar-month-view ~if="viewMode === 'month'" flex :events="visibleEvents" :current-date="currentDate"
|
|
943
|
+
@add-event="onAddEvent($event)" @open-event="onOpenEvent($event)"></oda-calendar-month-view>
|
|
944
|
+
|
|
945
|
+
<oda-calendar-time-grid ~if="viewMode !== 'month'" flex :events="visibleEvents" :current-date="currentDate" :view-mode="viewMode"
|
|
946
|
+
@add-event="onAddEvent($event)" @open-event="onOpenEvent($event)" @move-event="onMoveEvent($event)"></oda-calendar-time-grid>
|
|
947
|
+
`,
|
|
948
|
+
viewMode: {
|
|
949
|
+
$def: 'week',
|
|
950
|
+
$save: true,
|
|
951
|
+
set() {
|
|
952
|
+
this.events = undefined;
|
|
953
|
+
}
|
|
954
|
+
},
|
|
955
|
+
currentDate: {
|
|
956
|
+
$def: null,
|
|
957
|
+
set() {
|
|
958
|
+
this.events = undefined;
|
|
959
|
+
}
|
|
960
|
+
},
|
|
961
|
+
selected_users: {
|
|
962
|
+
$def: [],
|
|
963
|
+
set() {
|
|
964
|
+
this.events = undefined;
|
|
965
|
+
}
|
|
966
|
+
},
|
|
967
|
+
showEvents: true,
|
|
968
|
+
showTasks: {
|
|
969
|
+
$def: true,
|
|
970
|
+
$save: true,
|
|
971
|
+
set() {
|
|
972
|
+
this.events = undefined;
|
|
973
|
+
}
|
|
974
|
+
},
|
|
975
|
+
showSchedules: {
|
|
976
|
+
$def: true,
|
|
977
|
+
$save: true,
|
|
978
|
+
set() {
|
|
979
|
+
this.events = undefined;
|
|
980
|
+
}
|
|
981
|
+
},
|
|
982
|
+
showPeopleMenu: false,
|
|
983
|
+
contacts: [],
|
|
984
|
+
_userChangedViewMode: false,
|
|
985
|
+
setViewMode(m) {
|
|
986
|
+
this._userChangedViewMode = true;
|
|
987
|
+
this.viewMode = m;
|
|
988
|
+
},
|
|
989
|
+
async attached() {
|
|
990
|
+
if (!this.currentDate) this.currentDate = new Date();
|
|
991
|
+
if (typeof window !== 'undefined' && window.innerWidth <= 768 && !this._userChangedViewMode && this.viewMode === 'week') this.viewMode = 'day';
|
|
992
|
+
if (typeof globalThis.WORK?.visible_contacts === 'function') {
|
|
993
|
+
try {
|
|
994
|
+
const list = await globalThis.WORK.visible_contacts();
|
|
995
|
+
if (Array.isArray(list)) this.contacts = list.filter(c => c && c.id && !c.external);
|
|
996
|
+
} catch {/* ignore */}
|
|
997
|
+
}
|
|
998
|
+
},
|
|
999
|
+
get day() {
|
|
1000
|
+
return _formatDate(_asDate(this.currentDate));
|
|
1001
|
+
},
|
|
1002
|
+
get dayFrom() {
|
|
1003
|
+
const date = _asDate(this.currentDate);
|
|
1004
|
+
const mode = this.viewMode;
|
|
1005
|
+
if (mode === 'week' || mode === 'workweek') return _formatDate(_weekStart(date));
|
|
1006
|
+
if (mode === 'month') {
|
|
1007
|
+
const first = new Date(date.getFullYear(), date.getMonth(), 1);
|
|
1008
|
+
return _formatDate(_weekStart(first));
|
|
1009
|
+
}
|
|
1010
|
+
return this.day;
|
|
1011
|
+
},
|
|
1012
|
+
get dayTo() {
|
|
1013
|
+
const date = _asDate(this.currentDate);
|
|
1014
|
+
const mode = this.viewMode;
|
|
1015
|
+
if (mode === 'workweek') {
|
|
1016
|
+
const friday = _weekStart(date);
|
|
1017
|
+
friday.setDate(friday.getDate() + 4);
|
|
1018
|
+
return _formatDate(friday);
|
|
1019
|
+
}
|
|
1020
|
+
if (mode === 'week') return _formatDate(_weekEnd(date));
|
|
1021
|
+
if (mode === 'month') {
|
|
1022
|
+
const last = new Date(date.getFullYear(), date.getMonth() + 1, 0);
|
|
1023
|
+
return _formatDate(_weekEnd(last));
|
|
1024
|
+
}
|
|
1025
|
+
return this.day;
|
|
1026
|
+
},
|
|
1027
|
+
get periodTitle() {
|
|
1028
|
+
const d = _asDate(this.currentDate);
|
|
1029
|
+
if (this.viewMode === 'day') {
|
|
1030
|
+
return d.toLocaleDateString('ru-RU', {
|
|
1031
|
+
day: 'numeric',
|
|
1032
|
+
month: 'long',
|
|
1033
|
+
year: 'numeric'
|
|
1034
|
+
});
|
|
1035
|
+
}
|
|
1036
|
+
if (this.viewMode === 'month') {
|
|
1037
|
+
const s = d.toLocaleDateString('ru-RU', {
|
|
1038
|
+
month: 'long',
|
|
1039
|
+
year: 'numeric'
|
|
1040
|
+
});
|
|
1041
|
+
return s.charAt(0).toUpperCase() + s.slice(1);
|
|
1042
|
+
}
|
|
1043
|
+
const f = _parseDay(this.dayFrom);
|
|
1044
|
+
const t = _parseDay(this.dayTo);
|
|
1045
|
+
if (f.getMonth() === t.getMonth()) return `${f.getDate()}–${t.getDate()} ${t.toLocaleDateString('ru-RU', {
|
|
1046
|
+
month: 'long',
|
|
1047
|
+
year: 'numeric'
|
|
1048
|
+
})}`;
|
|
1049
|
+
return `${f.toLocaleDateString('ru-RU', {
|
|
1050
|
+
day: 'numeric',
|
|
1051
|
+
month: 'short'
|
|
1052
|
+
})} – ${t.toLocaleDateString('ru-RU', {
|
|
1053
|
+
day: 'numeric',
|
|
1054
|
+
month: 'short',
|
|
1055
|
+
year: 'numeric'
|
|
1056
|
+
})}`;
|
|
1057
|
+
},
|
|
1058
|
+
get visibleEvents() {
|
|
1059
|
+
const all = Array.isArray(this.events) ? this.events : [];
|
|
1060
|
+
return all.filter(ev => {
|
|
1061
|
+
if (ev.kind === 'task') return this.showTasks;
|
|
1062
|
+
if (ev.kind === 'schedule') return this.showSchedules;
|
|
1063
|
+
return this.showEvents;
|
|
1064
|
+
});
|
|
1065
|
+
},
|
|
1066
|
+
get events() {
|
|
1067
|
+
const dayFrom = this.dayFrom;
|
|
1068
|
+
const dayTo = this.dayTo;
|
|
1069
|
+
const selected_users = this.selected_users;
|
|
1070
|
+
const includeTasks = this.showTasks;
|
|
1071
|
+
const includeSchedules = this.showSchedules;
|
|
1072
|
+
const source = this.$item;
|
|
1073
|
+
if (!dayFrom || !dayTo || !source) return [];
|
|
1074
|
+
return (async () => {
|
|
1075
|
+
this._boundOnLogsChanged ||= () => {
|
|
1076
|
+
this.events = undefined;
|
|
1077
|
+
};
|
|
1078
|
+
if (source !== this._historyFolder) {
|
|
1079
|
+
this._historyFolder?.unlisten?.('changed', this._boundOnLogsChanged);
|
|
1080
|
+
source?.listen?.('changed', this._boundOnLogsChanged);
|
|
1081
|
+
this._historyFolder = source;
|
|
1082
|
+
}
|
|
1083
|
+
if (typeof source.fetch === 'function') {
|
|
1084
|
+
try {
|
|
1085
|
+
const res = await source.fetch('calendar_list', {}, JSON.stringify({
|
|
1086
|
+
from: dayFrom,
|
|
1087
|
+
to: dayTo,
|
|
1088
|
+
includeTasks,
|
|
1089
|
+
includeSchedules,
|
|
1090
|
+
attendees: selected_users
|
|
1091
|
+
}));
|
|
1092
|
+
const list = Array.isArray(res?.events) ? res.events : [];
|
|
1093
|
+
return this.events = list;
|
|
1094
|
+
} catch {/* fallback to logs */}
|
|
1095
|
+
}
|
|
1096
|
+
const rows = await source.logs?.({
|
|
1097
|
+
mode: 'bodies',
|
|
1098
|
+
from: dayFrom,
|
|
1099
|
+
to: dayTo,
|
|
1100
|
+
ext: 'ics'
|
|
1101
|
+
}).catch(() => []);
|
|
1102
|
+
const out = [];
|
|
1103
|
+
for (const row of rows || []) {
|
|
1104
|
+
try {
|
|
1105
|
+
const c = typeof row.content === 'string' ? JSON.parse(row.content) : row.content;
|
|
1106
|
+
if (!c || c.status === 'cancelled' || !c.start || !c.end) continue;
|
|
1107
|
+
out.push({
|
|
1108
|
+
kind: 'event',
|
|
1109
|
+
...c,
|
|
1110
|
+
path: row.path,
|
|
1111
|
+
row
|
|
1112
|
+
});
|
|
1113
|
+
} catch {/* ignore */}
|
|
1114
|
+
}
|
|
1115
|
+
return this.events = out;
|
|
1116
|
+
})();
|
|
1117
|
+
},
|
|
1118
|
+
detached() {
|
|
1119
|
+
this._historyFolder?.unlisten?.('changed', this._boundOnLogsChanged);
|
|
1120
|
+
this._historyFolder = null;
|
|
1121
|
+
},
|
|
1122
|
+
reloadEvents() {
|
|
1123
|
+
this.events = undefined;
|
|
1124
|
+
},
|
|
1125
|
+
goToday() {
|
|
1126
|
+
this.currentDate = new Date();
|
|
1127
|
+
},
|
|
1128
|
+
stepDate(dir) {
|
|
1129
|
+
const d = _asDate(this.currentDate);
|
|
1130
|
+
if (this.viewMode === 'day') d.setDate(d.getDate() + dir);else if (this.viewMode === 'week' || this.viewMode === 'workweek') d.setDate(d.getDate() + 7 * dir);else d.setMonth(d.getMonth() + dir);
|
|
1131
|
+
this.currentDate = d;
|
|
1132
|
+
},
|
|
1133
|
+
onDateJump(e) {
|
|
1134
|
+
if (e.target.value) this.currentDate = _parseDay(e.target.value);
|
|
1135
|
+
},
|
|
1136
|
+
toggleUserFilter(uid) {
|
|
1137
|
+
const cur = [...this.selected_users];
|
|
1138
|
+
const i = cur.indexOf(uid);
|
|
1139
|
+
if (i >= 0) cur.splice(i, 1);else cur.push(uid);
|
|
1140
|
+
this.selected_users = cur;
|
|
1141
|
+
},
|
|
1142
|
+
clearUsers() {
|
|
1143
|
+
this.selected_users = [];
|
|
1144
|
+
},
|
|
1145
|
+
openCreate() {
|
|
1146
|
+
const start = _asDate(this.currentDate);
|
|
1147
|
+
const now = new Date();
|
|
1148
|
+
start.setHours(Math.max(9, Math.min(18, now.getHours() + 1)), 0, 0, 0);
|
|
1149
|
+
const end = new Date(start.getTime() + 60 * 60_000);
|
|
1150
|
+
this.showMeeting({
|
|
1151
|
+
start,
|
|
1152
|
+
end,
|
|
1153
|
+
allDay: false
|
|
1154
|
+
});
|
|
1155
|
+
},
|
|
1156
|
+
onAddEvent(e) {
|
|
1157
|
+
this.showMeeting(e?.detail?.value || e?.detail || {});
|
|
1158
|
+
},
|
|
1159
|
+
async onOpenEvent(e) {
|
|
1160
|
+
const ev = e?.detail?.value || e?.detail;
|
|
1161
|
+
if (!ev) return;
|
|
1162
|
+
if (ev.kind === 'task' && ev.path) {
|
|
1163
|
+
const item = await globalThis.WORK?.get_item?.(ev.path).catch(() => null);
|
|
1164
|
+
if (item && typeof window?.execute === 'function') window.execute(item);
|
|
1165
|
+
return;
|
|
1166
|
+
}
|
|
1167
|
+
if (ev.kind === 'schedule') {
|
|
1168
|
+
ODA.showMessage?.(`Расписание ИИ: «${ev.summary}» (${_formatTime(ev.start)})`);
|
|
1169
|
+
return;
|
|
1170
|
+
}
|
|
1171
|
+
await this.showMeeting(ev);
|
|
1172
|
+
},
|
|
1173
|
+
async onMoveEvent(e) {
|
|
1174
|
+
const d = e?.detail?.value || e?.detail;
|
|
1175
|
+
if (!d?.ev || !d.start || !d.end || d.ev.kind !== 'event') return;
|
|
1176
|
+
const payload = {
|
|
1177
|
+
...d.ev,
|
|
1178
|
+
start: d.start,
|
|
1179
|
+
end: d.end,
|
|
1180
|
+
status: 'confirmed'
|
|
1181
|
+
};
|
|
1182
|
+
try {
|
|
1183
|
+
await this.$item.fetch('calendar_save', {}, JSON.stringify(payload));
|
|
1184
|
+
this.events = undefined;
|
|
1185
|
+
} catch (err) {
|
|
1186
|
+
ODA.showMessage?.(err?.message || String(err));
|
|
1187
|
+
}
|
|
1188
|
+
},
|
|
1189
|
+
async showMeeting(arg) {
|
|
1190
|
+
const isEdit = Boolean(arg && arg.uid && arg.start);
|
|
1191
|
+
let el;
|
|
1192
|
+
let uid;
|
|
1193
|
+
if (isEdit) {
|
|
1194
|
+
uid = arg.uid;
|
|
1195
|
+
const editPayload = {
|
|
1196
|
+
...arg,
|
|
1197
|
+
start: arg.masterStart || arg.start,
|
|
1198
|
+
end: arg.masterEnd || arg.end
|
|
1199
|
+
};
|
|
1200
|
+
el = ODA.createElement('calendar-form', {
|
|
1201
|
+
events: [editPayload],
|
|
1202
|
+
canCancel: true
|
|
1203
|
+
});
|
|
1204
|
+
} else {
|
|
1205
|
+
uid = _newUid();
|
|
1206
|
+
const detail = arg || {};
|
|
1207
|
+
const start = detail.start ? new Date(detail.start) : new Date();
|
|
1208
|
+
let end;
|
|
1209
|
+
if (detail.allDay) {
|
|
1210
|
+
start.setHours(0, 0, 0, 0);
|
|
1211
|
+
end = detail.end ? new Date(detail.end) : new Date(start);
|
|
1212
|
+
if (!detail.end) end.setDate(end.getDate() + 1);else end.setHours(0, 0, 0, 0);
|
|
1213
|
+
if (end <= start) end.setDate(start.getDate() + 1);
|
|
1214
|
+
} else {
|
|
1215
|
+
end = detail.end ? new Date(detail.end) : new Date(start.getTime() + 60 * 60_000);
|
|
1216
|
+
}
|
|
1217
|
+
el = ODA.createElement('calendar-form', {
|
|
1218
|
+
events: [{
|
|
1219
|
+
start: start.toISOTimezoneString(),
|
|
1220
|
+
end: end.toISOTimezoneString(),
|
|
1221
|
+
allDay: !!detail.allDay,
|
|
1222
|
+
category: 'meeting',
|
|
1223
|
+
recurrence: 'none',
|
|
1224
|
+
reminderMin: 15,
|
|
1225
|
+
attendees: [],
|
|
1226
|
+
externalEmails: []
|
|
1227
|
+
}]
|
|
1228
|
+
});
|
|
1229
|
+
}
|
|
1230
|
+
try {
|
|
1231
|
+
await WORK.showDialog(el, {
|
|
1232
|
+
TITLE: {
|
|
1233
|
+
label: isEdit ? 'Редактирование встречи' : 'Новая встреча',
|
|
1234
|
+
icon: 'enterprise:calendar'
|
|
1235
|
+
},
|
|
1236
|
+
OK: {
|
|
1237
|
+
label: 'Сохранить',
|
|
1238
|
+
icon: 'icons:save'
|
|
1239
|
+
},
|
|
1240
|
+
CANCEL: {
|
|
1241
|
+
label: 'Отмена',
|
|
1242
|
+
icon: 'icons:close'
|
|
1243
|
+
}
|
|
1244
|
+
});
|
|
1245
|
+
} catch {
|
|
1246
|
+
return;
|
|
1247
|
+
}
|
|
1248
|
+
const persist = el.eventToPersist(el.events[0]);
|
|
1249
|
+
const startDate = new Date(persist.start);
|
|
1250
|
+
const endDate = new Date(persist.end);
|
|
1251
|
+
if (isNaN(startDate) || isNaN(endDate) || endDate <= startDate) {
|
|
1252
|
+
ODA.showMessage?.('Время окончания должно быть позже начала');
|
|
1253
|
+
return;
|
|
1254
|
+
}
|
|
1255
|
+
const status = el.cancelled ? 'cancelled' : 'confirmed';
|
|
1256
|
+
const payload = {
|
|
1257
|
+
...persist,
|
|
1258
|
+
uid,
|
|
1259
|
+
status,
|
|
1260
|
+
summary: persist.summary || (status === 'cancelled' ? 'Отменено' : 'Встреча'),
|
|
1261
|
+
time: startDate.getTime()
|
|
1262
|
+
};
|
|
1263
|
+
try {
|
|
1264
|
+
if (typeof this.$item.fetch === 'function') {
|
|
1265
|
+
await this.$item.fetch('calendar_save', {}, JSON.stringify(payload));
|
|
1266
|
+
} else {
|
|
1267
|
+
await this.$item.save_file(new File([JSON.stringify(payload)], `${uid}.ics`, {
|
|
1268
|
+
type: 'application/json'
|
|
1269
|
+
}), {
|
|
1270
|
+
time: startDate.getTime(),
|
|
1271
|
+
encoding: 'utf-8',
|
|
1272
|
+
message: JSON.stringify(payload)
|
|
1273
|
+
});
|
|
1274
|
+
}
|
|
1275
|
+
this.events = undefined;
|
|
1276
|
+
} catch (err) {
|
|
1277
|
+
ODA.showMessage?.(err?.message || String(err));
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
};
|