set up a collection lib

This commit is contained in:
Mads Rasmussen
2023-04-27 22:04:14 +02:00
parent 773144146b
commit d098723885
16 changed files with 19 additions and 33 deletions

View File

@@ -0,0 +1 @@
export * from './collection.context';

View File

@@ -2,6 +2,7 @@ import { UUITextStyles } from '@umbraco-ui/uui-css';
import { css, html } from 'lit';
import { customElement, state } from 'lit/decorators.js';
import { UMB_COLLECTION_CONTEXT_TOKEN, UmbCollectionContext } from '@umbraco-cms/backoffice/collection';
import {
UmbTableColumn,
UmbTableConfig,
@@ -11,10 +12,6 @@ import {
UmbTableOrderedEvent,
UmbTableSelectedEvent,
} from '../../../../../shared/components/table';
import {
UMB_COLLECTION_CONTEXT_TOKEN,
UmbCollectionContext,
} from '../../../../../shared/components/collection/collection.context';
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';
import { DocumentTreeItemResponseModel, EntityTreeItemResponseModel } from '@umbraco-cms/backoffice/backend-api';

View File

@@ -2,13 +2,9 @@ import { UUITextStyles } from '@umbraco-ui/uui-css';
import { css, html } from 'lit';
import { customElement, state } from 'lit/decorators.js';
import { repeat } from 'lit/directives/repeat.js';
import {
UmbCollectionContext,
UMB_COLLECTION_CONTEXT_TOKEN,
} from '../../../shared/components/collection/collection.context';
import { UmbCollectionContext, UMB_COLLECTION_CONTEXT_TOKEN } from '@umbraco-cms/backoffice/collection';
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';
import { EntityTreeItemResponseModel } from '@umbraco-cms/backoffice/backend-api';
// TODO: this should be a lib import
@customElement('umb-media-grid-collection-view')
export class UmbMediaGridCollectionViewElement extends UmbLitElement {

View File

@@ -1,6 +1,7 @@
import { UUITextStyles } from '@umbraco-ui/uui-css';
import { css, html } from 'lit';
import { customElement, state } from 'lit/decorators.js';
import { UmbCollectionContext, UMB_COLLECTION_CONTEXT_TOKEN } from '@umbraco-cms/backoffice/collection';
import type {
UmbTableColumn,
UmbTableConfig,
@@ -11,10 +12,6 @@ import type {
UmbTableSelectedEvent,
} from '../../../shared/components/table';
import type { MediaDetails } from '../';
import {
UmbCollectionContext,
UMB_COLLECTION_CONTEXT_TOKEN,
} from '../../../shared/components/collection/collection.context';
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';
import { EntityTreeItemResponseModel } from '@umbraco-cms/backoffice/backend-api';

View File

@@ -2,7 +2,7 @@ import { UUITextStyles } from '@umbraco-ui/uui-css';
import { css, html } from 'lit';
import { customElement, state } from 'lit/decorators.js';
import { map } from 'rxjs';
import { UMB_COLLECTION_CONTEXT_TOKEN, UmbCollectionContext } from './collection.context';
import { UMB_COLLECTION_CONTEXT_TOKEN, UmbCollectionContext } from '@umbraco-cms/backoffice/collection';
import type { ManifestEntityBulkAction } from '@umbraco-cms/backoffice/extensions-registry';
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';
import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extensions-api';

View File

@@ -4,7 +4,7 @@ import { customElement, state, property } from 'lit/decorators.js';
import { map } from 'rxjs';
import './collection-selection-actions.element';
import './collection-toolbar.element';
import { UmbCollectionContext, UMB_COLLECTION_CONTEXT_TOKEN } from './collection.context';
import { UmbCollectionContext, UMB_COLLECTION_CONTEXT_TOKEN } from '@umbraco-cms/backoffice/collection';
import { createExtensionElement, umbExtensionsRegistry } from '@umbraco-cms/backoffice/extensions-api';
import type { ManifestCollectionView } from '@umbraco-cms/backoffice/extensions-registry';
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';

View File

@@ -2,7 +2,7 @@ import { UUITextStyles } from '@umbraco-ui/uui-css/lib';
import { css, html } from 'lit';
import { customElement, state } from 'lit/decorators.js';
import { ifDefined } from 'lit/directives/if-defined.js';
import { UMB_COLLECTION_CONTEXT_TOKEN, UmbCollectionContext } from '../collection.context';
import { UMB_COLLECTION_CONTEXT_TOKEN, UmbCollectionContext } from '@umbraco-cms/backoffice/collection';
import type { ManifestDashboardCollection } from '@umbraco-cms/backoffice/extensions-registry';
import type { FolderTreeItemResponseModel } from '@umbraco-cms/backoffice/backend-api';
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';

View File

@@ -2,11 +2,7 @@ import { css, html } from 'lit';
import { UUITextStyles } from '@umbraco-ui/uui-css/lib';
import { customElement } from 'lit/decorators.js';
import { ifDefined } from 'lit/directives/if-defined.js';
import {
UmbCollectionContext,
UMB_COLLECTION_CONTEXT_TOKEN,
} from '../../../../../../shared/components/collection/collection.context';
import { UmbCollectionContext, UMB_COLLECTION_CONTEXT_TOKEN } from '@umbraco-cms/backoffice/collection';
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';
import type { FolderTreeItemResponseModel } from '@umbraco-cms/backoffice/backend-api';
import type { ManifestWorkspaceViewCollection } from '@umbraco-cms/backoffice/extensions-registry';

View File

@@ -2,7 +2,7 @@ import { UUITextStyles } from '@umbraco-ui/uui-css';
import { css, html } from 'lit';
import { customElement, state } from 'lit/decorators.js';
import { UUIPopoverElement } from '@umbraco-ui/uui';
import { UMB_COLLECTION_CONTEXT_TOKEN } from '../../../shared/components/collection/collection.context';
import { UMB_COLLECTION_CONTEXT_TOKEN } from '@umbraco-cms/backoffice/collection';
import { UmbUserCollectionContext } from './user-collection.context';
import {
UMB_CREATE_USER_MODAL,

View File

@@ -1,8 +1,8 @@
import { UmbCollectionContext } from '@umbraco-cms/backoffice/collection';
import { USER_REPOSITORY_ALIAS } from '../repository/manifests';
import { UmbUserCollectionFilterModel } from '../types';
import { UmbControllerHostElement } from '@umbraco-cms/backoffice/controller';
import { UserResponseModel } from '@umbraco-cms/backoffice/backend-api';
import { USER_REPOSITORY_ALIAS } from '../repository/manifests';
import { UmbCollectionContext } from '../../../shared/components/collection/collection.context';
import { UmbUserCollectionFilterModel } from '../types';
export class UmbUserCollectionContext extends UmbCollectionContext<UserResponseModel, UmbUserCollectionFilterModel> {
constructor(host: UmbControllerHostElement) {

View File

@@ -1,10 +1,10 @@
import { css, html } from 'lit';
import { UUITextStyles } from '@umbraco-ui/uui-css/lib';
import { customElement, state } from 'lit/decorators.js';
import { UMB_COLLECTION_CONTEXT_TOKEN } from '@umbraco-cms/backoffice/collection';
import { UmbUserCollectionContext } from './user-collection.context';
import type { IRoute } from '@umbraco-cms/backoffice/router';
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';
import { UMB_COLLECTION_CONTEXT_TOKEN } from '../../../shared/components/collection/collection.context';
import { UmbUserCollectionContext } from './user-collection.context';
import './views/table/user-table-collection-view.element';
import './views/grid/user-grid-collection-view.element';

View File

@@ -3,7 +3,7 @@ import { UUITextStyles } from '@umbraco-ui/uui-css/lib';
import { customElement, state } from 'lit/decorators.js';
import { repeat } from 'lit/directives/repeat.js';
import { ifDefined } from 'lit/directives/if-defined.js';
import { UMB_COLLECTION_CONTEXT_TOKEN } from '../../../../../shared/components/collection/collection.context';
import { UMB_COLLECTION_CONTEXT_TOKEN } from '@umbraco-cms/backoffice/collection';
import { getLookAndColorFromUserStatus } from '../../../../utils';
import { UmbUserCollectionContext } from '../../user-collection.context';
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';

View File

@@ -1,6 +1,7 @@
import { css, html } from 'lit';
import { UUITextStyles } from '@umbraco-ui/uui-css/lib';
import { customElement, state } from 'lit/decorators.js';
import { UMB_COLLECTION_CONTEXT_TOKEN } from '@umbraco-cms/backoffice/collection';
import {
UmbTableElement,
UmbTableColumn,
@@ -14,17 +15,13 @@ import {
UmbUserGroupStore,
UMB_USER_GROUP_STORE_CONTEXT_TOKEN,
} from '../../../../user-groups/repository/user-group.store';
import {
UMB_COLLECTION_CONTEXT_TOKEN,
UmbCollectionContext,
} from '../../../../../shared/components/collection/collection.context';
import { UmbUserCollectionContext } from '../../user-collection.context';
import type { UserGroupEntity } from '@umbraco-cms/backoffice/models';
import './column-layouts/name/user-table-name-column-layout.element';
import './column-layouts/status/user-table-status-column-layout.element';
import { UmbLitElement } from '@umbraco-cms/internal/lit-element';
import { UserResponseModel } from '@umbraco-cms/backoffice/backend-api';
import { UmbUserCollectionContext } from '../../user-collection.context';
@customElement('umb-user-table-collection-view')
export class UmbUserTableCollectionViewElement extends UmbLitElement {

View File

@@ -42,6 +42,7 @@
"@umbraco-cms/backoffice/workspace": ["libs/workspace"],
"@umbraco-cms/backoffice/picker-input": ["libs/picker-input"],
"@umbraco-cms/backoffice/id": ["libs/id"],
"@umbraco-cms/backoffice/collection": ["libs/collection"],
"@umbraco-cms/internal/lit-element": ["src/core/lit-element"],
"@umbraco-cms/internal/modal": ["src/core/modal"],
"@umbraco-cms/internal/router": ["src/core/router"],

View File

@@ -58,6 +58,7 @@ export default {
'@umbraco-cms/backoffice/workspace': './libs/workspace/index.ts',
'@umbraco-cms/backoffice/picker-input': './libs/picker-input/index.ts',
'@umbraco-cms/backoffice/id': './libs/id/index.ts',
'@umbraco-cms/backoffice/collection': './libs/collection/index.ts',
'@umbraco-cms/internal/lit-element': './src/core/lit-element/index.ts',
'@umbraco-cms/internal/modal': './src/core/modal/index.ts',
'@umbraco-cms/internal/router': './src/core/router/index.ts',