// // Copyright © 2020, 2021 Anticrm Platform Contributors. // Copyright © 2021, 2023 Hardcore Engineering Inc. // // Licensed under the Eclipse Public License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. You may // obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // // See the License for the specific language governing permissions and // limitations under the License. // import { Class, Doc, DocumentQuery, FindOptions, Mixin, Ref } from '@hcengineering/core' import { Asset, IntlString, Plugin, Resource, plugin } from '@hcengineering/platform' import { AnyComponent, PopupAlignment, PopupPosAlignment } from '@hcengineering/ui/src/types' import { Action, ActionCategory, ActivityAttributePresenter, Aggregation, AllValuesFunc, ArrayEditor, AttributeEditor, AttributeFilter, AttributeFilterPresenter, AttributePresenter, ClassFilters, ClassSortFuncs, CollectionEditor, CollectionPresenter, FilterMode, FilteredView, Groupping, IgnoreActions, InlineAttributEditor, LinkPresenter, LinkProvider, ListHeaderExtra, ListItemPresenter, ObjectEditor, ObjectEditorFooter, ObjectEditorHeader, ObjectFactory, ObjectIcon, ObjectIdentifier, ObjectPanel, ObjectPresenter, ObjectTitle, ObjectTooltip, ObjectValidator, ReferenceObjectProvider, AttrPresenter, PreviewPresenter, SpaceHeader, SpaceName, SpacePresenter, ViewAction, Viewlet, ViewletDescriptor, ViewletPreference, LinkIdProvider, CustomObjectLinkProvider } from './types' export * from './types' export * from './utils' /** * @public */ export const viewId = 'view' as Plugin /** * @public */ const view = plugin(viewId, { mixin: { ClassFilters: '' as Ref>, AttributeFilter: '' as Ref>, AttributeEditor: '' as Ref>, CollectionPresenter: '' as Ref>, CollectionEditor: '' as Ref>, InlineAttributEditor: '' as Ref>, ArrayEditor: '' as Ref>, AttributePresenter: '' as Ref>, ActivityAttributePresenter: '' as Ref>, ListItemPresenter: '' as Ref>, ObjectEditor: '' as Ref>, ObjectPresenter: '' as Ref>, ObjectEditorHeader: '' as Ref>, ObjectEditorFooter: '' as Ref>, ObjectPanelFooter: '' as Ref>, ObjectValidator: '' as Ref>, ObjectFactory: '' as Ref>, ObjectTitle: '' as Ref>, ObjectIdentifier: '' as Ref>, ReferenceObjectProvider: '' as Ref>, ObjectTooltip: '' as Ref>, SpaceHeader: '' as Ref>, SpaceName: '' as Ref>, IgnoreActions: '' as Ref>, PreviewPresenter: '' as Ref>, ListHeaderExtra: '' as Ref>, SortFuncs: '' as Ref>, AllValuesFunc: '' as Ref>, ObjectPanel: '' as Ref>, LinkProvider: '' as Ref>, LinkIdProvider: '' as Ref>, SpacePresenter: '' as Ref>, AttributeFilterPresenter: '' as Ref>, Aggregation: '' as Ref>, Groupping: '' as Ref>, ObjectIcon: '' as Ref>, CustomObjectLinkProvider: '' as Ref> }, class: { ViewletPreference: '' as Ref>, ViewletDescriptor: '' as Ref>, Viewlet: '' as Ref>, Action: '' as Ref>, ActionCategory: '' as Ref>, LinkPresenter: '' as Ref>, FilterMode: '' as Ref>, FilteredView: '' as Ref>, AttrPresenter: '' as Ref> }, action: { Delete: '' as Ref, Archive: '' as Ref, UnArchive: '' as Ref, Join: '' as Ref, Leave: '' as Ref, Move: '' as Ref, MoveLeft: '' as Ref, MoveRight: '' as Ref, MoveUp: '' as Ref, MoveDown: '' as Ref, SelectItem: '' as Ref, SelectItemAll: '' as Ref, SelectItemNone: '' as Ref, SelectUp: '' as Ref, SelectDown: '' as Ref, ShowPreview: '' as Ref, ShowActions: '' as Ref, Preview: '' as Ref, // Edit document Open: '' as Ref, OpenInNewTab: '' as Ref, RemoveRelation: '' as Ref }, viewlet: { Table: '' as Ref, List: '' as Ref, MasterDetail: '' as Ref, Tree: '' as Ref, Document: '' as Ref }, component: { ActionsPopup: '' as AnyComponent, ObjectPresenter: '' as AnyComponent, EditDoc: '' as AnyComponent, SpacePresenter: '' as AnyComponent, BooleanTruePresenter: '' as AnyComponent, ValueSelector: '' as AnyComponent, GrowPresenter: '' as AnyComponent, DividerPresenter: '' as AnyComponent, IconWithEmoji: '' as AnyComponent, AttachedDocPanel: '' as AnyComponent, ObjectMention: '' as AnyComponent, SearchSelector: '' as AnyComponent, FoldersBrowser: '' as AnyComponent, PersonIdPresenter: '' as AnyComponent, PersonIdFilter: '' as AnyComponent, RolePresenter: '' as AnyComponent }, ids: { IconWithEmoji: '' as Asset }, string: { CustomizeView: '' as IntlString, LabelNA: '' as IntlString, View: '' as IntlString, FilteredViews: '' as IntlString, NewFilteredView: '' as IntlString, FilteredViewName: '' as IntlString, Move: '' as IntlString, MoveClass: '' as IntlString, SelectToMove: '' as IntlString, Cancel: '' as IntlString, List: '' as IntlString, Grid: '' as IntlString, AddSavedView: '' as IntlString, Timeline: '' as IntlString, Public: '' as IntlString, Hide: '' as IntlString, Rename: '' as IntlString, Assigned: '' as IntlString, Open: '' as IntlString, OpenInNewTab: '' as IntlString, Created: '' as IntlString, Delete: '' as IntlString, Then: '' as IntlString, Or: '' as IntlString, Subscribed: '' as IntlString, HyperlinkPlaceholder: '' as IntlString, CopyToClipboard: '' as IntlString, NoGrouping: '' as IntlString, Type: '' as IntlString, UnArchive: '' as IntlString, Archive: '' as IntlString, Save: '' as IntlString, PublicView: '' as IntlString, Archived: '' as IntlString, MoreActions: '' as IntlString, Pin: '' as IntlString, Unpin: '' as IntlString, Join: '' as IntlString, Leave: '' as IntlString, Copied: '' as IntlString, And: '' as IntlString, Title: '' as IntlString, DeleteObject: '' as IntlString, DeleteObjectConfirm: '' as IntlString, RemoveRelationConfirmation: '' as IntlString, RemoveRelation: '' as IntlString, MasterDetail: '' as IntlString, Tree: '' as IntlString, Document: '' as IntlString, Loading: '' as IntlString }, icon: { Table: '' as Asset, List: '' as Asset, Card: '' as Asset, Timeline: '' as Asset, Delete: '' as Asset, MoreH: '' as Asset, Move: '' as Asset, Archive: '' as Asset, Statuses: '' as Asset, Setting: '' as Asset, Open: '' as Asset, Edit: '' as Asset, CopyId: '' as Asset, CopyLink: '' as Asset, ArrowRight: '' as Asset, Views: '' as Asset, Pin: '' as Asset, Model: '' as Asset, DevModel: '' as Asset, ViewButton: '' as Asset, Filter: '' as Asset, Configure: '' as Asset, Database: '' as Asset, Star: '' as Asset, Eye: '' as Asset, EyeCrossed: '' as Asset, Bubble: '' as Asset, CheckCircle: '' as Asset, Add: '' as Asset, Image: '' as Asset, Table2: '' as Asset, CodeBlock: '' as Asset, SeparatorLine: '' as Asset, Circle: '' as Asset, Join: '' as Asset, Leave: '' as Asset, Copy: '' as Asset, TodoList: '' as Asset, DetailsFilled: '' as Asset, Translate: '' as Asset, Undo: '' as Asset, Video: '' as Asset, Audio: '' as Asset, File: '' as Asset, PinTack: '' as Asset, Feather: '' as Asset, MasterDetail: '' as Asset, Tree: '' as Asset, Document: '' as Asset }, category: { General: '' as Ref, GeneralNavigation: '' as Ref, Navigation: '' as Ref, Editor: '' as Ref, MarkdownFormatting: '' as Ref }, filter: { FilterArrayAll: '' as Ref, FilterArrayAny: '' as Ref, FilterObjectIn: '' as Ref, FilterObjectNin: '' as Ref, FilterValueIn: '' as Ref, FilterValueNin: '' as Ref, FilterBefore: '' as Ref, FilterAfter: '' as Ref, FilterContains: '' as Ref, FilterNestedMatch: '' as Ref, FilterNestedDontMatch: '' as Ref, FilterDateOutdated: '' as Ref, FilterDateToday: '' as Ref, FilterDateYesterday: '' as Ref, FilterDateWeek: '' as Ref, FilterDateNextW: '' as Ref, FilterDateM: '' as Ref, FilterDateNextM: '' as Ref, FilterDateNotSpecified: '' as Ref, FilterDateCustom: '' as Ref, FilterDateBetween: '' as Ref }, popup: { PositionElementAlignment: '' as Resource<(e?: Event) => PopupAlignment | undefined> }, actionImpl: { CopyTextToClipboard: '' as ViewAction<{ textProvider: Resource<(doc: Doc, props: Record) => Promise> props?: Record }>, UpdateDocument: '' as ViewAction<{ key: string value: any ask?: boolean label?: IntlString message?: IntlString }>, ShowPanel: '' as ViewAction<{ component?: AnyComponent element?: PopupPosAlignment rightSection?: AnyComponent }>, ShowPopup: '' as ViewAction<{ component: AnyComponent element?: PopupPosAlignment | Resource<(e?: Event) => PopupAlignment | undefined> _id?: string _class?: string _space?: string value?: string values?: string props?: Record // Will copy values from selection document to props fillProps?: Record }>, ShowEditor: '' as ViewAction<{ element?: PopupPosAlignment | Resource<(e?: Event) => PopupAlignment | undefined> attribute: string props?: Record }>, ValueSelector: '' as ViewAction<{ attribute: string // Class object finder _class?: Ref> query?: DocumentQuery queryOptions?: FindOptions // Will copy values from selection document to query // If set of docs passed, will do $in for values. fillQuery?: Record // A list of fields with matched values to perform action. docMatches?: string[] searchField?: string // Cast doc to mixin castRequest?: Ref> // Or list of values to select from values?: { icon?: Asset, label: IntlString, id: number | string }[] placeholder?: IntlString }>, AttributeSelector: '' as ViewAction<{ attribute: string isAction?: boolean fillProps?: Record // Or list of values to select from values?: { icon?: Asset, label: IntlString, id: number | string }[] // If defined, documents will be set into value valueKey?: string }>, Delete: '' as ViewAction } }) export default view