@umbraco-cms/backoffice 14.0.0--preview004-eaff2f45 → 14.0.0--preview004-8702aedd
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-cms/apps/backoffice/backoffice.element.js +1 -0
- package/dist-cms/custom-elements.json +103 -0
- package/dist-cms/mocks/browser-handlers.js +22 -20
- package/dist-cms/mocks/data/data-type.data.js +9 -0
- package/dist-cms/mocks/data/document-type/document-type.data.js +20 -0
- package/dist-cms/mocks/data/scripts.data.js +5 -5
- package/dist-cms/mocks/data/static-file.data.d.ts +15 -0
- package/dist-cms/mocks/data/static-file.data.js +46 -0
- package/dist-cms/mocks/data/utils.js +2 -2
- package/dist-cms/mocks/handlers/static-file.handlers.d.ts +1 -0
- package/dist-cms/mocks/handlers/static-file.handlers.js +35 -0
- package/dist-cms/packages/core/data-type/workspace/data-type-workspace.element.d.ts +0 -1
- package/dist-cms/packages/core/data-type/workspace/data-type-workspace.element.js +5 -5
- package/dist-cms/packages/core/modal/token/index.d.ts +10 -10
- package/dist-cms/packages/core/modal/token/index.js +10 -10
- package/dist-cms/packages/dictionary/dictionary/workspace/dictionary-workspace.element.js +4 -4
- package/dist-cms/packages/documents/document-types/workspace/document-type-workspace.element.js +5 -2
- package/dist-cms/packages/documents/documents/components/input-document/input-document.context.js +2 -1
- package/dist-cms/packages/documents/documents/property-editors/document-picker/property-editor-ui-document-picker.element.js +4 -4
- package/dist-cms/packages/documents/documents/repository/document.repository.js +2 -2
- package/dist-cms/packages/documents/documents/workspace/document-workspace.element.d.ts +0 -1
- package/dist-cms/packages/documents/documents/workspace/document-workspace.element.js +5 -3
- package/dist-cms/packages/media/media/workspace/media-workspace.element.js +5 -2
- package/dist-cms/packages/media/media-types/workspace/media-type-workspace.element.js +4 -4
- package/dist-cms/packages/members/member-groups/workspace/member-group-workspace.element.js +3 -3
- package/dist-cms/packages/members/member-types/workspace/member-type-workspace.element.js +3 -3
- package/dist-cms/packages/members/members/workspace/member-workspace.element.js +3 -3
- package/dist-cms/packages/settings/languages/workspace/language/language-workspace.element.js +5 -14
- package/dist-cms/packages/settings/relation-types/workspace/relation-type-workspace.element.d.ts +0 -1
- package/dist-cms/packages/settings/relation-types/workspace/relation-type-workspace.element.js +5 -5
- package/dist-cms/packages/static-file/components/index.d.ts +1 -0
- package/dist-cms/packages/static-file/components/index.js +1 -0
- package/dist-cms/packages/static-file/components/input-static-file/index.d.ts +2 -0
- package/dist-cms/packages/static-file/components/input-static-file/index.js +2 -0
- package/dist-cms/packages/static-file/components/input-static-file/input-static-file.context.d.ts +6 -0
- package/dist-cms/packages/static-file/components/input-static-file/input-static-file.context.js +8 -0
- package/dist-cms/packages/static-file/components/input-static-file/input-static-file.element.d.ts +50 -0
- package/dist-cms/packages/static-file/components/input-static-file/input-static-file.element.js +137 -0
- package/dist-cms/packages/static-file/entity.d.ts +2 -0
- package/dist-cms/packages/static-file/entity.js +2 -0
- package/dist-cms/packages/static-file/index.d.ts +3 -0
- package/dist-cms/packages/static-file/index.js +3 -0
- package/dist-cms/packages/static-file/manifests.d.ts +1 -0
- package/dist-cms/packages/static-file/manifests.js +4 -0
- package/dist-cms/packages/static-file/modals/index.d.ts +1 -0
- package/dist-cms/packages/static-file/modals/index.js +1 -0
- package/dist-cms/packages/static-file/modals/static-file-picker-modal.token.d.ts +5 -0
- package/dist-cms/packages/static-file/modals/static-file-picker-modal.token.js +11 -0
- package/dist-cms/packages/static-file/property-editors/manifests.d.ts +1 -0
- package/dist-cms/packages/static-file/property-editors/manifests.js +2 -0
- package/dist-cms/packages/static-file/property-editors/static-file-picker/manifests.d.ts +2 -0
- package/dist-cms/packages/static-file/property-editors/static-file-picker/manifests.js +11 -0
- package/dist-cms/packages/static-file/property-editors/static-file-picker/property-editor-ui-static-file-picker.element.d.ts +20 -0
- package/dist-cms/packages/static-file/property-editors/static-file-picker/property-editor-ui-static-file-picker.element.js +59 -0
- package/dist-cms/packages/static-file/repository/index.d.ts +2 -0
- package/dist-cms/packages/static-file/repository/index.js +2 -0
- package/dist-cms/packages/static-file/repository/manifests.d.ts +5 -0
- package/dist-cms/packages/static-file/repository/manifests.js +26 -0
- package/dist-cms/packages/static-file/repository/static-file-tree.repository.d.ts +18 -0
- package/dist-cms/packages/static-file/repository/static-file-tree.repository.js +21 -0
- package/dist-cms/packages/static-file/repository/static-file-tree.server.data-source.d.ts +18 -0
- package/dist-cms/packages/static-file/repository/static-file-tree.server.data-source.js +46 -0
- package/dist-cms/packages/static-file/repository/static-file-tree.store.d.ts +18 -0
- package/dist-cms/packages/static-file/repository/static-file-tree.store.js +19 -0
- package/dist-cms/packages/static-file/repository/types.d.ts +5 -0
- package/dist-cms/packages/static-file/repository/types.js +1 -0
- package/dist-cms/packages/static-file/tree/manifests.d.ts +2 -0
- package/dist-cms/packages/static-file/tree/manifests.js +11 -0
- package/dist-cms/packages/static-file/umbraco-package.d.ts +7 -0
- package/dist-cms/packages/static-file/umbraco-package.js +9 -0
- package/dist-cms/packages/templating/partial-views/workspace/partial-view-workspace.element.d.ts +0 -1
- package/dist-cms/packages/templating/partial-views/workspace/partial-view-workspace.element.js +5 -5
- package/dist-cms/packages/templating/scripts/workspace/script-workspace.element.js +5 -2
- package/dist-cms/packages/templating/stylesheets/tree/stylesheet-tree.server.data-source.d.ts +1 -1
- package/dist-cms/packages/templating/stylesheets/tree/stylesheet-tree.server.data-source.js +1 -1
- package/dist-cms/packages/templating/stylesheets/workspace/stylesheet-workspace.element.js +5 -2
- package/dist-cms/packages/templating/templates/workspace/template-workspace.element.d.ts +0 -1
- package/dist-cms/packages/templating/templates/workspace/template-workspace.element.js +5 -5
- package/dist-cms/packages/user/user/workspace/user-workspace.element.js +3 -3
- package/dist-cms/packages/user/user-group/workspace/user-group-workspace.element.js +4 -4
- package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
- package/dist-cms/vscode-html-custom-data.json +40 -0
- package/package.json +2 -1
- package/dist-cms/packages/documents/documents/repository/document.tree.store.d.ts +0 -18
- package/dist-cms/packages/documents/documents/repository/document.tree.store.js +0 -19
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { UmbRoute } from '../../../../shared/router/index.js';
|
|
2
2
|
import { UmbLitElement } from '../../../../shared/lit-element/index.js';
|
|
3
|
-
import './document-workspace-editor.element.js';
|
|
4
3
|
import { ManifestWorkspace } from '../../../core/extension-registry/index.js';
|
|
5
4
|
export declare class UmbDocumentWorkspaceElement extends UmbLitElement {
|
|
6
5
|
#private;
|
|
@@ -4,19 +4,21 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
+
import { UmbDocumentWorkspaceEditorElement } from './document-workspace-editor.element.js';
|
|
7
8
|
import { UmbTextStyles } from '../../../../shared/style/index.js';
|
|
8
9
|
import { html, customElement, state } from '../../../../external/lit/index.js';
|
|
9
10
|
import { UmbLitElement } from '../../../../shared/lit-element/index.js';
|
|
10
|
-
import './document-workspace-editor.element.js';
|
|
11
11
|
import { UmbWorkspaceIsNewRedirectController } from '../../../core/workspace/index.js';
|
|
12
12
|
import { UmbExtensionsApiInitializer, createExtensionApi } from '../../../../libs/extension-api/index.js';
|
|
13
13
|
import { umbExtensionsRegistry } from '../../../core/extension-registry/index.js';
|
|
14
14
|
let UmbDocumentWorkspaceElement = class UmbDocumentWorkspaceElement extends UmbLitElement {
|
|
15
15
|
constructor() {
|
|
16
16
|
super(...arguments);
|
|
17
|
+
this.#createElement = () => new UmbDocumentWorkspaceEditorElement();
|
|
17
18
|
this._routes = [];
|
|
18
19
|
}
|
|
19
20
|
#workspaceContext;
|
|
21
|
+
#createElement;
|
|
20
22
|
set manifest(manifest) {
|
|
21
23
|
createExtensionApi(manifest, [this]).then((context) => {
|
|
22
24
|
if (context) {
|
|
@@ -29,7 +31,7 @@ let UmbDocumentWorkspaceElement = class UmbDocumentWorkspaceElement extends UmbL
|
|
|
29
31
|
this._routes = [
|
|
30
32
|
{
|
|
31
33
|
path: 'create/:parentId/:documentTypeKey',
|
|
32
|
-
component:
|
|
34
|
+
component: this.#createElement,
|
|
33
35
|
setup: async (_component, info) => {
|
|
34
36
|
// TODO: Remember the perspective of permissions here, we need to check if the user has access to create a document of this type under this parent?
|
|
35
37
|
const parentId = info.match.params.parentId === 'null' ? null : info.match.params.parentId;
|
|
@@ -40,7 +42,7 @@ let UmbDocumentWorkspaceElement = class UmbDocumentWorkspaceElement extends UmbL
|
|
|
40
42
|
},
|
|
41
43
|
{
|
|
42
44
|
path: 'edit/:id',
|
|
43
|
-
component:
|
|
45
|
+
component: this.#createElement,
|
|
44
46
|
setup: (_component, info) => {
|
|
45
47
|
const id = info.match.params.id;
|
|
46
48
|
this.#workspaceContext.load(id);
|
|
@@ -4,6 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
+
import { UmbMediaWorkspaceEditorElement } from './media-workspace-editor.element.js';
|
|
7
8
|
import { UmbTextStyles } from '../../../../shared/style/index.js';
|
|
8
9
|
import { css, html, customElement, state } from '../../../../external/lit/index.js';
|
|
9
10
|
import { UmbLitElement } from '../../../../shared/lit-element/index.js';
|
|
@@ -13,9 +14,11 @@ import { UmbWorkspaceIsNewRedirectController } from '../../../core/workspace/ind
|
|
|
13
14
|
let UmbMediaWorkspaceElement = class UmbMediaWorkspaceElement extends UmbLitElement {
|
|
14
15
|
constructor() {
|
|
15
16
|
super(...arguments);
|
|
17
|
+
this.#createElement = () => new UmbMediaWorkspaceEditorElement();
|
|
16
18
|
this._routes = [];
|
|
17
19
|
}
|
|
18
20
|
#workspaceContext;
|
|
21
|
+
#createElement;
|
|
19
22
|
set manifest(manifest) {
|
|
20
23
|
createExtensionApi(manifest, [this]).then((context) => {
|
|
21
24
|
if (context) {
|
|
@@ -28,7 +31,7 @@ let UmbMediaWorkspaceElement = class UmbMediaWorkspaceElement extends UmbLitElem
|
|
|
28
31
|
this._routes = [
|
|
29
32
|
{
|
|
30
33
|
path: 'create/:parentId', // /:mediaTypeKey
|
|
31
|
-
component:
|
|
34
|
+
component: this.#createElement,
|
|
32
35
|
setup: async (_component, info) => {
|
|
33
36
|
// TODO: Remember the perspective of permissions here, we need to check if the user has access to create a document of this type under this parent?
|
|
34
37
|
const parentId = info.match.params.parentId === 'null' ? null : info.match.params.parentId;
|
|
@@ -39,7 +42,7 @@ let UmbMediaWorkspaceElement = class UmbMediaWorkspaceElement extends UmbLitElem
|
|
|
39
42
|
},
|
|
40
43
|
{
|
|
41
44
|
path: 'edit/:id',
|
|
42
|
-
component:
|
|
45
|
+
component: this.#createElement,
|
|
43
46
|
setup: (_component, info) => {
|
|
44
47
|
const id = info.match.params.id;
|
|
45
48
|
this.#workspaceContext.load(id);
|
|
@@ -14,11 +14,11 @@ let UmbMediaTypeWorkspaceElement = class UmbMediaTypeWorkspaceElement extends Um
|
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments);
|
|
16
16
|
this.#workspaceContext = new UmbMediaTypeWorkspaceContext(this);
|
|
17
|
-
this.#
|
|
17
|
+
this.#createElement = () => new UmbMediaTypeWorkspaceEditorElement();
|
|
18
18
|
this._routes = [
|
|
19
19
|
{
|
|
20
20
|
path: 'create/:parentId',
|
|
21
|
-
component:
|
|
21
|
+
component: this.#createElement,
|
|
22
22
|
setup: (_component, info) => {
|
|
23
23
|
const parentId = info.match.params.parentId === 'null' ? null : info.match.params.parentId;
|
|
24
24
|
this.#workspaceContext.create(parentId);
|
|
@@ -27,7 +27,7 @@ let UmbMediaTypeWorkspaceElement = class UmbMediaTypeWorkspaceElement extends Um
|
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
path: 'edit/:id',
|
|
30
|
-
component:
|
|
30
|
+
component: this.#createElement,
|
|
31
31
|
setup: (_component, info) => {
|
|
32
32
|
const id = info.match.params.id;
|
|
33
33
|
this.#workspaceContext.load(id);
|
|
@@ -36,7 +36,7 @@ let UmbMediaTypeWorkspaceElement = class UmbMediaTypeWorkspaceElement extends Um
|
|
|
36
36
|
];
|
|
37
37
|
}
|
|
38
38
|
#workspaceContext;
|
|
39
|
-
#
|
|
39
|
+
#createElement;
|
|
40
40
|
render() {
|
|
41
41
|
return html `<umb-router-slot .routes=${this._routes}></umb-router-slot>`;
|
|
42
42
|
}
|
|
@@ -13,11 +13,11 @@ let UmbMemberGroupWorkspaceElement = class UmbMemberGroupWorkspaceElement extend
|
|
|
13
13
|
constructor() {
|
|
14
14
|
super(...arguments);
|
|
15
15
|
this.#workspaceContext = new UmbMemberGroupWorkspaceContext(this);
|
|
16
|
-
this.#
|
|
16
|
+
this.#createElement = () => new UmbMemberGroupWorkspaceEditorElement();
|
|
17
17
|
this._routes = [
|
|
18
18
|
{
|
|
19
19
|
path: 'edit/:id',
|
|
20
|
-
component:
|
|
20
|
+
component: this.#createElement,
|
|
21
21
|
setup: (_component, info) => {
|
|
22
22
|
const id = info.match.params.id;
|
|
23
23
|
this.#workspaceContext.load(id);
|
|
@@ -26,7 +26,7 @@ let UmbMemberGroupWorkspaceElement = class UmbMemberGroupWorkspaceElement extend
|
|
|
26
26
|
];
|
|
27
27
|
}
|
|
28
28
|
#workspaceContext;
|
|
29
|
-
#
|
|
29
|
+
#createElement;
|
|
30
30
|
render() {
|
|
31
31
|
return html ` <umb-router-slot .routes=${this._routes}></umb-router-slot> `;
|
|
32
32
|
}
|
|
@@ -14,11 +14,11 @@ let UmbMemberTypeWorkspaceElement = class UmbMemberTypeWorkspaceElement extends
|
|
|
14
14
|
super(...arguments);
|
|
15
15
|
this.workspaceAlias = 'Umb.Workspace.MemberType';
|
|
16
16
|
this.#workspaceContext = new UmbMemberTypeWorkspaceContext(this);
|
|
17
|
-
this.#
|
|
17
|
+
this.#createElement = () => new UmbMemberTypeWorkspaceEditorElement();
|
|
18
18
|
this._routes = [
|
|
19
19
|
{
|
|
20
20
|
path: 'edit/:id',
|
|
21
|
-
component:
|
|
21
|
+
component: this.#createElement,
|
|
22
22
|
setup: (_component, info) => {
|
|
23
23
|
const id = info.match.params.id;
|
|
24
24
|
this.#workspaceContext.load(id);
|
|
@@ -27,7 +27,7 @@ let UmbMemberTypeWorkspaceElement = class UmbMemberTypeWorkspaceElement extends
|
|
|
27
27
|
];
|
|
28
28
|
}
|
|
29
29
|
#workspaceContext;
|
|
30
|
-
#
|
|
30
|
+
#createElement;
|
|
31
31
|
render() {
|
|
32
32
|
return html ` <umb-router-slot .routes=${this._routes}></umb-router-slot> `;
|
|
33
33
|
}
|
|
@@ -13,11 +13,11 @@ let UmbMemberWorkspaceElement = class UmbMemberWorkspaceElement extends UmbLitEl
|
|
|
13
13
|
constructor() {
|
|
14
14
|
super(...arguments);
|
|
15
15
|
this.#workspaceContext = new UmbMemberWorkspaceContext(this);
|
|
16
|
-
this.#
|
|
16
|
+
this.#createElement = () => new UmbMemberWorkspaceEditorElement();
|
|
17
17
|
this._routes = [
|
|
18
18
|
{
|
|
19
19
|
path: 'edit/:id',
|
|
20
|
-
component:
|
|
20
|
+
component: this.#createElement,
|
|
21
21
|
setup: (_component, info) => {
|
|
22
22
|
const id = info.match.params.id;
|
|
23
23
|
this.#workspaceContext.load(id);
|
|
@@ -26,7 +26,7 @@ let UmbMemberWorkspaceElement = class UmbMemberWorkspaceElement extends UmbLitEl
|
|
|
26
26
|
];
|
|
27
27
|
}
|
|
28
28
|
#workspaceContext;
|
|
29
|
-
#
|
|
29
|
+
#createElement;
|
|
30
30
|
render() {
|
|
31
31
|
return html ` <umb-router-slot .routes=${this._routes}></umb-router-slot> `;
|
|
32
32
|
}
|
package/dist-cms/packages/settings/languages/workspace/language/language-workspace.element.js
CHANGED
|
@@ -5,6 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { UmbLanguageWorkspaceContext } from './language-workspace.context.js';
|
|
8
|
+
import { UmbLanguageWorkspaceEditorElement } from './language-workspace-editor.element.js';
|
|
8
9
|
import { UmbTextStyles } from '../../../../../shared/style/index.js';
|
|
9
10
|
import { css, html, customElement, state } from '../../../../../external/lit/index.js';
|
|
10
11
|
import { UmbLitElement } from '../../../../../shared/lit-element/index.js';
|
|
@@ -13,17 +14,11 @@ let UmbLanguageWorkspaceElement = class UmbLanguageWorkspaceElement extends UmbL
|
|
|
13
14
|
constructor() {
|
|
14
15
|
super(...arguments);
|
|
15
16
|
this.#languageWorkspaceContext = new UmbLanguageWorkspaceContext(this);
|
|
16
|
-
this.#
|
|
17
|
-
if (this.#editorElement) {
|
|
18
|
-
return this.#editorElement;
|
|
19
|
-
}
|
|
20
|
-
this.#editorElement = new (await import('./language-workspace-editor.element.js')).default();
|
|
21
|
-
return this.#editorElement;
|
|
22
|
-
};
|
|
17
|
+
this.#createElement = () => new UmbLanguageWorkspaceEditorElement();
|
|
23
18
|
this._routes = [
|
|
24
19
|
{
|
|
25
20
|
path: 'edit/:isoCode',
|
|
26
|
-
component: this.#
|
|
21
|
+
component: this.#createElement,
|
|
27
22
|
setup: (_component, info) => {
|
|
28
23
|
this.removeControllerByAlias('_observeIsNew');
|
|
29
24
|
this.#languageWorkspaceContext.load(info.match.params.isoCode);
|
|
@@ -31,7 +26,7 @@ let UmbLanguageWorkspaceElement = class UmbLanguageWorkspaceElement extends UmbL
|
|
|
31
26
|
},
|
|
32
27
|
{
|
|
33
28
|
path: 'create',
|
|
34
|
-
component: this.#
|
|
29
|
+
component: this.#createElement,
|
|
35
30
|
setup: async () => {
|
|
36
31
|
this.#languageWorkspaceContext.create();
|
|
37
32
|
new UmbWorkspaceIsNewRedirectController(this, this.#languageWorkspaceContext, this.shadowRoot.querySelector('umb-router-slot'));
|
|
@@ -40,11 +35,7 @@ let UmbLanguageWorkspaceElement = class UmbLanguageWorkspaceElement extends UmbL
|
|
|
40
35
|
];
|
|
41
36
|
}
|
|
42
37
|
#languageWorkspaceContext;
|
|
43
|
-
|
|
44
|
-
* Workspace editor element, lazy loaded but shared across several user flows.
|
|
45
|
-
*/
|
|
46
|
-
#editorElement;
|
|
47
|
-
#getComponentElement;
|
|
38
|
+
#createElement;
|
|
48
39
|
render() {
|
|
49
40
|
return html `<umb-router-slot .routes=${this._routes}></umb-router-slot>`;
|
|
50
41
|
}
|
package/dist-cms/packages/settings/relation-types/workspace/relation-type-workspace.element.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { UmbLitElement } from '../../../../shared/lit-element/index.js';
|
|
2
2
|
import type { UmbRoute } from '../../../../shared/router/index.js';
|
|
3
|
-
import './relation-type-workspace-editor.element.js';
|
|
4
3
|
/**
|
|
5
4
|
* @element umb-relation-type-workspace
|
|
6
5
|
* @description - Element for displaying a Relation Type Workspace
|
package/dist-cms/packages/settings/relation-types/workspace/relation-type-workspace.element.js
CHANGED
|
@@ -5,10 +5,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { UmbRelationTypeWorkspaceContext } from './relation-type-workspace.context.js';
|
|
8
|
+
import { UmbRelationTypeWorkspaceEditorElement } from './relation-type-workspace-editor.element.js';
|
|
8
9
|
import { UmbTextStyles } from '../../../../shared/style/index.js';
|
|
9
10
|
import { css, html, customElement, state } from '../../../../external/lit/index.js';
|
|
10
11
|
import { UmbLitElement } from '../../../../shared/lit-element/index.js';
|
|
11
|
-
import './relation-type-workspace-editor.element.js';
|
|
12
12
|
import { UmbWorkspaceIsNewRedirectController } from '../../../core/workspace/index.js';
|
|
13
13
|
/**
|
|
14
14
|
* @element umb-relation-type-workspace
|
|
@@ -18,13 +18,13 @@ let UmbRelationTypeWorkspaceElement = class UmbRelationTypeWorkspaceElement exte
|
|
|
18
18
|
constructor() {
|
|
19
19
|
super(...arguments);
|
|
20
20
|
this.#workspaceContext = new UmbRelationTypeWorkspaceContext(this);
|
|
21
|
+
this.#createElement = () => new UmbRelationTypeWorkspaceEditorElement();
|
|
21
22
|
this.#routerPath = '';
|
|
22
|
-
this.#element = document.createElement('umb-relation-type-workspace-editor');
|
|
23
23
|
this.#key = '';
|
|
24
24
|
this._routes = [
|
|
25
25
|
{
|
|
26
26
|
path: 'create/:parentId',
|
|
27
|
-
component:
|
|
27
|
+
component: this.#createElement,
|
|
28
28
|
setup: (_component, info) => {
|
|
29
29
|
const parentId = info.match.params.parentId;
|
|
30
30
|
this.#workspaceContext.createScaffold(parentId);
|
|
@@ -33,7 +33,7 @@ let UmbRelationTypeWorkspaceElement = class UmbRelationTypeWorkspaceElement exte
|
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
path: 'edit/:id',
|
|
36
|
-
component:
|
|
36
|
+
component: this.#createElement,
|
|
37
37
|
setup: (_component, info) => {
|
|
38
38
|
const id = info.match.params.id;
|
|
39
39
|
this.#workspaceContext.load(id);
|
|
@@ -42,8 +42,8 @@ let UmbRelationTypeWorkspaceElement = class UmbRelationTypeWorkspaceElement exte
|
|
|
42
42
|
];
|
|
43
43
|
}
|
|
44
44
|
#workspaceContext;
|
|
45
|
+
#createElement;
|
|
45
46
|
#routerPath;
|
|
46
|
-
#element;
|
|
47
47
|
#key;
|
|
48
48
|
render() {
|
|
49
49
|
return html `<umb-router-slot
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './input-static-file/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './input-static-file/index.js';
|
package/dist-cms/packages/static-file/components/input-static-file/input-static-file.context.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { UmbPickerInputContext } from '../../../core/picker-input/index.js';
|
|
2
|
+
import type { UmbControllerHostElement } from '../../../../libs/controller-api/index.js';
|
|
3
|
+
import type { StaticFileItemResponseModel } from '../../../../external/backend-api/index.js';
|
|
4
|
+
export declare class UmbStaticFilePickerContext extends UmbPickerInputContext<StaticFileItemResponseModel> {
|
|
5
|
+
constructor(host: UmbControllerHostElement);
|
|
6
|
+
}
|
package/dist-cms/packages/static-file/components/input-static-file/input-static-file.context.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { UMB_STATIC_FILE_TREE_REPOSITORY_ALIAS } from '../../repository/index.js';
|
|
2
|
+
import { UMB_STATIC_FILE_PICKER_MODAL } from '../../modals/index.js';
|
|
3
|
+
import { UmbPickerInputContext } from '../../../core/picker-input/index.js';
|
|
4
|
+
export class UmbStaticFilePickerContext extends UmbPickerInputContext {
|
|
5
|
+
constructor(host) {
|
|
6
|
+
super(host, UMB_STATIC_FILE_TREE_REPOSITORY_ALIAS, UMB_STATIC_FILE_PICKER_MODAL);
|
|
7
|
+
}
|
|
8
|
+
}
|
package/dist-cms/packages/static-file/components/input-static-file/input-static-file.element.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { UmbLitElement } from '../../../../shared/lit-element/index.js';
|
|
2
|
+
declare const UmbInputStaticFileElement_base: (new (...args: any[]) => import("../../../../external/uui/index.js").FormControlMixinInterface) & typeof UmbLitElement;
|
|
3
|
+
export declare class UmbInputStaticFileElement extends UmbInputStaticFileElement_base {
|
|
4
|
+
#private;
|
|
5
|
+
/**
|
|
6
|
+
* This is a minimum amount of selected files in this input.
|
|
7
|
+
* @type {number}
|
|
8
|
+
* @attr
|
|
9
|
+
* @default 0
|
|
10
|
+
*/
|
|
11
|
+
get min(): number;
|
|
12
|
+
set min(value: number);
|
|
13
|
+
/**
|
|
14
|
+
* Min validation message.
|
|
15
|
+
* @type {boolean}
|
|
16
|
+
* @attr
|
|
17
|
+
* @default
|
|
18
|
+
*/
|
|
19
|
+
minMessage: string;
|
|
20
|
+
/**
|
|
21
|
+
* This is a maximum amount of selected files in this input.
|
|
22
|
+
* @type {number}
|
|
23
|
+
* @attr
|
|
24
|
+
* @default Infinity
|
|
25
|
+
*/
|
|
26
|
+
get max(): number;
|
|
27
|
+
set max(value: number);
|
|
28
|
+
/**
|
|
29
|
+
* Max validation message.
|
|
30
|
+
* @type {boolean}
|
|
31
|
+
* @attr
|
|
32
|
+
* @default
|
|
33
|
+
*/
|
|
34
|
+
maxMessage: string;
|
|
35
|
+
get selectedPaths(): Array<string>;
|
|
36
|
+
set selectedPaths(paths: Array<string>);
|
|
37
|
+
set value(pathsString: string);
|
|
38
|
+
private _items?;
|
|
39
|
+
constructor();
|
|
40
|
+
protected getFormElement(): undefined;
|
|
41
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
42
|
+
private _renderItem;
|
|
43
|
+
static styles: import("@lit/reactive-element/css-tag.js").CSSResult[];
|
|
44
|
+
}
|
|
45
|
+
export default UmbInputStaticFileElement;
|
|
46
|
+
declare global {
|
|
47
|
+
interface HTMLElementTagNameMap {
|
|
48
|
+
'umb-input-static-file': UmbInputStaticFileElement;
|
|
49
|
+
}
|
|
50
|
+
}
|
package/dist-cms/packages/static-file/components/input-static-file/input-static-file.element.js
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { UmbStaticFilePickerContext } from './input-static-file.context.js';
|
|
8
|
+
import { css, html, customElement, property, state, ifDefined, repeat } from '../../../../external/lit/index.js';
|
|
9
|
+
import { FormControlMixin } from '../../../../external/uui/index.js';
|
|
10
|
+
import { UmbLitElement } from '../../../../shared/lit-element/index.js';
|
|
11
|
+
import { splitStringToArray } from '../../../../shared/utils/index.js';
|
|
12
|
+
let UmbInputStaticFileElement = class UmbInputStaticFileElement extends FormControlMixin(UmbLitElement) {
|
|
13
|
+
/**
|
|
14
|
+
* This is a minimum amount of selected files in this input.
|
|
15
|
+
* @type {number}
|
|
16
|
+
* @attr
|
|
17
|
+
* @default 0
|
|
18
|
+
*/
|
|
19
|
+
get min() {
|
|
20
|
+
return this.#pickerContext.min;
|
|
21
|
+
}
|
|
22
|
+
set min(value) {
|
|
23
|
+
this.#pickerContext.min = value;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* This is a maximum amount of selected files in this input.
|
|
27
|
+
* @type {number}
|
|
28
|
+
* @attr
|
|
29
|
+
* @default Infinity
|
|
30
|
+
*/
|
|
31
|
+
get max() {
|
|
32
|
+
return this.#pickerContext.max;
|
|
33
|
+
}
|
|
34
|
+
set max(value) {
|
|
35
|
+
this.#pickerContext.max = value;
|
|
36
|
+
}
|
|
37
|
+
get selectedPaths() {
|
|
38
|
+
return this.#pickerContext.getSelection();
|
|
39
|
+
}
|
|
40
|
+
set selectedPaths(paths) {
|
|
41
|
+
this.#pickerContext.setSelection(paths);
|
|
42
|
+
}
|
|
43
|
+
set value(pathsString) {
|
|
44
|
+
// Its with full purpose we don't call super.value, as thats being handled by the observation of the context selection.
|
|
45
|
+
this.selectedPaths = splitStringToArray(pathsString);
|
|
46
|
+
}
|
|
47
|
+
#pickerContext;
|
|
48
|
+
constructor() {
|
|
49
|
+
super();
|
|
50
|
+
/**
|
|
51
|
+
* Min validation message.
|
|
52
|
+
* @type {boolean}
|
|
53
|
+
* @attr
|
|
54
|
+
* @default
|
|
55
|
+
*/
|
|
56
|
+
this.minMessage = 'This field need more files';
|
|
57
|
+
/**
|
|
58
|
+
* Max validation message.
|
|
59
|
+
* @type {boolean}
|
|
60
|
+
* @attr
|
|
61
|
+
* @default
|
|
62
|
+
*/
|
|
63
|
+
this.maxMessage = 'This field exceeds the allowed amount of files';
|
|
64
|
+
this.#pickerContext = new UmbStaticFilePickerContext(this);
|
|
65
|
+
this.addValidator('rangeUnderflow', () => this.minMessage, () => !!this.min && this.#pickerContext.getSelection().length < this.min);
|
|
66
|
+
this.addValidator('rangeOverflow', () => this.maxMessage, () => !!this.max && this.#pickerContext.getSelection().length > this.max);
|
|
67
|
+
this.observe(this.#pickerContext.selection, (selection) => (super.value = selection.join(',')));
|
|
68
|
+
this.observe(this.#pickerContext.selectedItems, (selectedItems) => (this._items = selectedItems));
|
|
69
|
+
}
|
|
70
|
+
getFormElement() {
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
render() {
|
|
74
|
+
return html `
|
|
75
|
+
${this._items
|
|
76
|
+
? html ` <uui-ref-list
|
|
77
|
+
>${repeat(this._items, (item) => item.path, (item) => this._renderItem(item))}
|
|
78
|
+
</uui-ref-list>`
|
|
79
|
+
: ''}
|
|
80
|
+
${this.#renderAddButton()}
|
|
81
|
+
`;
|
|
82
|
+
}
|
|
83
|
+
#renderAddButton() {
|
|
84
|
+
if (this.max > 0 && this.selectedPaths.length >= this.max)
|
|
85
|
+
return;
|
|
86
|
+
return html `<uui-button
|
|
87
|
+
id="add-button"
|
|
88
|
+
look="placeholder"
|
|
89
|
+
@click=${() => this.#pickerContext.openPicker()}
|
|
90
|
+
label=${this.localize.term('general_add')}></uui-button>`;
|
|
91
|
+
}
|
|
92
|
+
_renderItem(item) {
|
|
93
|
+
if (!item.path)
|
|
94
|
+
return;
|
|
95
|
+
return html `
|
|
96
|
+
<uui-ref-node name=${ifDefined(item.name)} detail=${ifDefined(item.path)}>
|
|
97
|
+
<!-- TODO: implement is trashed <uui-tag size="s" slot="tag" color="danger">Trashed</uui-tag> -->
|
|
98
|
+
<uui-action-bar slot="actions">
|
|
99
|
+
<uui-button @click=${() => this.#pickerContext.requestRemoveItem(item.path)} label="Remove file ${item.name}"
|
|
100
|
+
>Remove</uui-button
|
|
101
|
+
>
|
|
102
|
+
</uui-action-bar>
|
|
103
|
+
</uui-ref-node>
|
|
104
|
+
`;
|
|
105
|
+
}
|
|
106
|
+
static { this.styles = [
|
|
107
|
+
css `
|
|
108
|
+
#add-button {
|
|
109
|
+
width: 100%;
|
|
110
|
+
}
|
|
111
|
+
`,
|
|
112
|
+
]; }
|
|
113
|
+
};
|
|
114
|
+
__decorate([
|
|
115
|
+
property({ type: Number })
|
|
116
|
+
], UmbInputStaticFileElement.prototype, "min", null);
|
|
117
|
+
__decorate([
|
|
118
|
+
property({ type: String, attribute: 'min-message' })
|
|
119
|
+
], UmbInputStaticFileElement.prototype, "minMessage", void 0);
|
|
120
|
+
__decorate([
|
|
121
|
+
property({ type: Number })
|
|
122
|
+
], UmbInputStaticFileElement.prototype, "max", null);
|
|
123
|
+
__decorate([
|
|
124
|
+
property({ type: String, attribute: 'min-message' })
|
|
125
|
+
], UmbInputStaticFileElement.prototype, "maxMessage", void 0);
|
|
126
|
+
__decorate([
|
|
127
|
+
property()
|
|
128
|
+
// get value is handled by super class.
|
|
129
|
+
], UmbInputStaticFileElement.prototype, "value", null);
|
|
130
|
+
__decorate([
|
|
131
|
+
state()
|
|
132
|
+
], UmbInputStaticFileElement.prototype, "_items", void 0);
|
|
133
|
+
UmbInputStaticFileElement = __decorate([
|
|
134
|
+
customElement('umb-input-static-file')
|
|
135
|
+
], UmbInputStaticFileElement);
|
|
136
|
+
export { UmbInputStaticFileElement };
|
|
137
|
+
export default UmbInputStaticFileElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const manifests: (import("../core/index.js").ManifestPropertyEditorUi | import("../core/index.js").ManifestTree | import("../core/index.js").ManifestTreeItem | import("../core/index.js").ManifestTreeStore | import("../core/index.js").ManifestRepository<import("../../libs/extension-api/index.js").UmbApi>)[];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { manifests as propertyEditorManifests } from './property-editors/manifests.js';
|
|
2
|
+
import { manifests as repositoryManifests } from './repository/manifests.js';
|
|
3
|
+
import { manifests as treeManifests } from './tree/manifests.js';
|
|
4
|
+
export const manifests = [...repositoryManifests, ...propertyEditorManifests, ...treeManifests];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './static-file-picker-modal.token.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './static-file-picker-modal.token.js';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { StaticFileItemResponseModel } from '../../../external/backend-api/index.js';
|
|
2
|
+
import { UmbModalToken, UmbPickerModalValue, UmbTreePickerModalData } from '../../core/modal/index.js';
|
|
3
|
+
export type UmbStaticFilePickerModalData = UmbTreePickerModalData<StaticFileItemResponseModel>;
|
|
4
|
+
export type UmbStaticFilePickerModalValue = UmbPickerModalValue;
|
|
5
|
+
export declare const UMB_STATIC_FILE_PICKER_MODAL: UmbModalToken<UmbStaticFilePickerModalData, UmbPickerModalValue>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { UMB_STATIC_FILE_TREE_ALIAS } from '../index.js';
|
|
2
|
+
import { UmbModalToken } from '../../core/modal/index.js';
|
|
3
|
+
export const UMB_STATIC_FILE_PICKER_MODAL = new UmbModalToken('Umb.Modal.TreePicker', {
|
|
4
|
+
modal: {
|
|
5
|
+
type: 'sidebar',
|
|
6
|
+
size: 'small',
|
|
7
|
+
},
|
|
8
|
+
data: {
|
|
9
|
+
treeAlias: UMB_STATIC_FILE_TREE_ALIAS,
|
|
10
|
+
},
|
|
11
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const manifests: import("../../core/index.js").ManifestPropertyEditorUi[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const manifest = {
|
|
2
|
+
type: 'propertyEditorUi',
|
|
3
|
+
alias: 'Umb.PropertyEditorUi.StaticFilePicker',
|
|
4
|
+
name: 'Static File Picker Property Editor UI',
|
|
5
|
+
js: () => import('./property-editor-ui-static-file-picker.element.js'),
|
|
6
|
+
meta: {
|
|
7
|
+
label: 'Static File Picker',
|
|
8
|
+
icon: 'icon-document',
|
|
9
|
+
group: 'common',
|
|
10
|
+
},
|
|
11
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { UmbPropertyEditorUiElement } from '../../../core/extension-registry/index.js';
|
|
2
|
+
import { UmbLitElement } from '../../../../shared/lit-element/index.js';
|
|
3
|
+
import type { UmbPropertyEditorConfigCollection } from '../../../core/property-editor/index.js';
|
|
4
|
+
import '../../components/input-static-file/index.js';
|
|
5
|
+
export declare class UmbPropertyEditorUIStaticFilePickerElement extends UmbLitElement implements UmbPropertyEditorUiElement {
|
|
6
|
+
private _value;
|
|
7
|
+
get value(): Array<string>;
|
|
8
|
+
set value(value: Array<string>);
|
|
9
|
+
set config(config: UmbPropertyEditorConfigCollection | undefined);
|
|
10
|
+
private _limitMin?;
|
|
11
|
+
private _limitMax?;
|
|
12
|
+
private _onChange;
|
|
13
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
14
|
+
}
|
|
15
|
+
export default UmbPropertyEditorUIStaticFilePickerElement;
|
|
16
|
+
declare global {
|
|
17
|
+
interface HTMLElementTagNameMap {
|
|
18
|
+
'umb-property-editor-ui-static-file-picker': UmbPropertyEditorUIStaticFilePickerElement;
|
|
19
|
+
}
|
|
20
|
+
}
|