@umbraco-cms/backoffice 14.0.0--preview004-0d5e0b19 → 14.0.0--preview004-e91a3686

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.
@@ -7706,6 +7706,84 @@
7706
7706
  }
7707
7707
  ]
7708
7708
  },
7709
+ {
7710
+ "name": "umb-input-member",
7711
+ "path": "./../src/packages/members/members/components/input-member/input-member.element.ts",
7712
+ "attributes": [
7713
+ {
7714
+ "name": "min",
7715
+ "description": "This is a minimum amount of selected items in this input.",
7716
+ "type": "number",
7717
+ "default": "\"0\""
7718
+ },
7719
+ {
7720
+ "name": "max",
7721
+ "description": "This is a maximum amount of selected items in this input.",
7722
+ "type": "number",
7723
+ "default": "\"Infinity\""
7724
+ },
7725
+ {
7726
+ "name": "min-message",
7727
+ "description": "Min validation message.",
7728
+ "type": "boolean",
7729
+ "default": "\"\""
7730
+ },
7731
+ {
7732
+ "name": "maxMessage",
7733
+ "description": "Max validation message.",
7734
+ "type": "boolean",
7735
+ "default": "\"\""
7736
+ },
7737
+ {
7738
+ "name": "value",
7739
+ "type": "string"
7740
+ }
7741
+ ],
7742
+ "properties": [
7743
+ {
7744
+ "name": "min",
7745
+ "attribute": "min",
7746
+ "description": "This is a minimum amount of selected items in this input.",
7747
+ "type": "number",
7748
+ "default": "\"0\""
7749
+ },
7750
+ {
7751
+ "name": "max",
7752
+ "attribute": "max",
7753
+ "description": "This is a maximum amount of selected items in this input.",
7754
+ "type": "number",
7755
+ "default": "\"Infinity\""
7756
+ },
7757
+ {
7758
+ "name": "minMessage",
7759
+ "attribute": "min-message",
7760
+ "description": "Min validation message.",
7761
+ "type": "boolean",
7762
+ "default": "\"\""
7763
+ },
7764
+ {
7765
+ "name": "maxMessage",
7766
+ "attribute": "maxMessage",
7767
+ "description": "Max validation message.",
7768
+ "type": "boolean",
7769
+ "default": "\"\""
7770
+ },
7771
+ {
7772
+ "name": "selectedIds",
7773
+ "type": "string[]"
7774
+ },
7775
+ {
7776
+ "name": "value",
7777
+ "attribute": "value",
7778
+ "type": "string"
7779
+ },
7780
+ {
7781
+ "name": "styles",
7782
+ "type": "array",
7783
+ "default": "[null]"
7784
+ }
7785
+ ]
7786
+ },
7709
7787
  {
7710
7788
  "name": "umb-member-workspace-editor",
7711
7789
  "path": "./../src/packages/members/members/workspace/member-workspace-editor.element.ts",
@@ -1 +1,2 @@
1
+ import './members/components/index.js';
1
2
  export declare const manifests: (import("../core/index.js").ManifestSectionSidebarApp | import("../core/index.js").ManifestDashboard | import("../core/index.js").ManifestEntityAction | import("../core/index.js").ManifestMenu | import("../core/index.js").ManifestMenuItemTreeKind | import("../core/index.js").ManifestSection | import("../core/index.js").ManifestStore | import("../core/index.js").ManifestTree | import("../core/index.js").ManifestTreeItem | import("../core/index.js").ManifestTreeStore | import("../core/index.js").ManifestWorkspace | import("../core/index.js").ManifestWorkspaceAction | import("../core/index.js").ManifestWorkspaceView | import("../core/index.js").ManifestRepository<import("../../libs/extension-api/index.js").UmbApi>)[];
@@ -3,6 +3,7 @@ import { manifests as menuSectionManifests } from './menu.manifests.js';
3
3
  import { manifests as memberGroupManifests } from './member-groups/manifests.js';
4
4
  import { manifests as memberTypeManifests } from './member-types/manifests.js';
5
5
  import { manifests as memberManifests } from './members/manifests.js';
6
+ import './members/components/index.js';
6
7
  export const manifests = [
7
8
  ...memberSectionManifests,
8
9
  ...menuSectionManifests,
@@ -0,0 +1,2 @@
1
+ import './input-member/input-member.element.js';
2
+ export * from './input-member/input-member.element.js';
@@ -0,0 +1,2 @@
1
+ import './input-member/input-member.element.js';
2
+ export * from './input-member/input-member.element.js';
@@ -0,0 +1,53 @@
1
+ import { UmbLitElement } from '../../../../../shared/lit-element/index.js';
2
+ import type { MemberItemResponseModel } from '../../../../../external/backend-api/index.js';
3
+ declare const UmbInputMemberElement_base: (new (...args: any[]) => import("../../../../../external/uui/index.js").FormControlMixinInterface) & typeof UmbLitElement;
4
+ export declare class UmbInputMemberElement extends UmbInputMemberElement_base {
5
+ #private;
6
+ /**
7
+ * This is a minimum amount of selected items in this input.
8
+ * @type {number}
9
+ * @attr
10
+ * @default 0
11
+ */
12
+ get min(): number;
13
+ set min(value: number);
14
+ /**
15
+ * Min validation message.
16
+ * @type {boolean}
17
+ * @attr
18
+ * @default
19
+ */
20
+ minMessage: string;
21
+ /**
22
+ * This is a maximum amount of selected items in this input.
23
+ * @type {number}
24
+ * @attr
25
+ * @default Infinity
26
+ */
27
+ get max(): number;
28
+ set max(value: number);
29
+ /**
30
+ * Max validation message.
31
+ * @type {boolean}
32
+ * @attr
33
+ * @default
34
+ */
35
+ maxMessage: string;
36
+ get selectedIds(): Array<string>;
37
+ set selectedIds(ids: Array<string>);
38
+ set value(idsString: string);
39
+ private _items?;
40
+ constructor();
41
+ protected _openPicker(): void;
42
+ protected _requestRemoveItem(item: MemberItemResponseModel): void;
43
+ protected getFormElement(): undefined;
44
+ render(): import("lit-html").TemplateResult<1>;
45
+ private _renderItem;
46
+ static styles: import("@lit/reactive-element/css-tag").CSSResult[];
47
+ }
48
+ export default UmbInputMemberElement;
49
+ declare global {
50
+ interface HTMLElementTagNameMap {
51
+ 'umb-input-member': UmbInputMemberElement;
52
+ }
53
+ }
@@ -0,0 +1,162 @@
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 { css, html, customElement, property, state, ifDefined, repeat } from '../../../../../external/lit/index.js';
8
+ import { FormControlMixin } from '../../../../../external/uui/index.js';
9
+ import { UmbLitElement } from '../../../../../shared/lit-element/index.js';
10
+ import { splitStringToArray } from '../../../../../shared/utils/index.js';
11
+ let UmbInputMemberElement = class UmbInputMemberElement extends FormControlMixin(UmbLitElement) {
12
+ /**
13
+ * This is a minimum amount of selected items in this input.
14
+ * @type {number}
15
+ * @attr
16
+ * @default 0
17
+ */
18
+ get min() {
19
+ //return this.#pickerContext.min;
20
+ return 0;
21
+ }
22
+ set min(value) {
23
+ //this.#pickerContext.min = value;
24
+ }
25
+ /**
26
+ * This is a maximum amount of selected items in this input.
27
+ * @type {number}
28
+ * @attr
29
+ * @default Infinity
30
+ */
31
+ get max() {
32
+ //return this.#pickerContext.max;
33
+ return Infinity;
34
+ }
35
+ set max(value) {
36
+ //this.#pickerContext.max = value;
37
+ }
38
+ get selectedIds() {
39
+ //return this.#pickerContext.getSelection();
40
+ return [];
41
+ }
42
+ set selectedIds(ids) {
43
+ //this.#pickerContext.setSelection(ids);
44
+ }
45
+ set value(idsString) {
46
+ // Its with full purpose we don't call super.value, as thats being handled by the observation of the context selection.
47
+ this.selectedIds = splitStringToArray(idsString);
48
+ }
49
+ // TODO: Create the `UmbMemberPickerContext` [LK]
50
+ //#pickerContext = new UmbMemberPickerContext(this);
51
+ constructor() {
52
+ super();
53
+ /**
54
+ * Min validation message.
55
+ * @type {boolean}
56
+ * @attr
57
+ * @default
58
+ */
59
+ this.minMessage = 'This field need more items';
60
+ /**
61
+ * Max validation message.
62
+ * @type {boolean}
63
+ * @attr
64
+ * @default
65
+ */
66
+ this.maxMessage = 'This field exceeds the allowed amount of items';
67
+ // this.addValidator(
68
+ // 'rangeUnderflow',
69
+ // () => this.minMessage,
70
+ // () => !!this.min && this.#pickerContext.getSelection().length < this.min,
71
+ // );
72
+ // this.addValidator(
73
+ // 'rangeOverflow',
74
+ // () => this.maxMessage,
75
+ // () => !!this.max && this.#pickerContext.getSelection().length > this.max,
76
+ // );
77
+ // this.observe(this.#pickerContext.selection, (selection) => (super.value = selection.join(',')));
78
+ // this.observe(this.#pickerContext.selectedItems, (selectedItems) => (this._items = selectedItems));
79
+ }
80
+ _openPicker() {
81
+ console.log("member.openPicker");
82
+ // this.#pickerContext.openPicker({
83
+ // hideTreeRoot: true,
84
+ // });
85
+ }
86
+ _requestRemoveItem(item) {
87
+ console.log("member.requestRemoveItem", item);
88
+ //this.#pickerContext.requestRemoveItem(item.id!);
89
+ }
90
+ getFormElement() {
91
+ return undefined;
92
+ }
93
+ render() {
94
+ return html `
95
+ ${this.#renderItems()}
96
+ ${this.#renderAddButton()}
97
+ `;
98
+ }
99
+ #renderItems() {
100
+ if (!this._items)
101
+ return;
102
+ // TODO: Add sorting. [LK]
103
+ return html `<uui-ref-list
104
+ >${repeat(this._items, (item) => item.id, (item) => this._renderItem(item))}
105
+ </uui-ref-list>`;
106
+ }
107
+ #renderAddButton() {
108
+ if (this.max > 0 && this.selectedIds.length >= this.max)
109
+ return;
110
+ return html `<uui-button
111
+ id="add-button"
112
+ look="placeholder"
113
+ @click=${this._openPicker}
114
+ label=${this.localize.term('general_add')}></uui-button>`;
115
+ }
116
+ _renderItem(item) {
117
+ if (!item.id)
118
+ return;
119
+ return html `
120
+ <uui-ref-node name=${ifDefined(item.name)} detail=${ifDefined(item.id)}>
121
+ <!-- TODO: implement is deleted <uui-tag size="s" slot="tag" color="danger">Deleted</uui-tag> -->
122
+ <uui-action-bar slot="actions">
123
+ <uui-button
124
+ @click=${() => this._requestRemoveItem(item)}
125
+ label="Remove member ${item.name}"
126
+ >Remove</uui-button
127
+ >
128
+ </uui-action-bar>
129
+ </uui-ref-node>
130
+ `;
131
+ }
132
+ static { this.styles = [
133
+ css `
134
+ #add-button {
135
+ width: 100%;
136
+ }
137
+ `,
138
+ ]; }
139
+ };
140
+ __decorate([
141
+ property({ type: Number })
142
+ ], UmbInputMemberElement.prototype, "min", null);
143
+ __decorate([
144
+ property({ type: String, attribute: 'min-message' })
145
+ ], UmbInputMemberElement.prototype, "minMessage", void 0);
146
+ __decorate([
147
+ property({ type: Number })
148
+ ], UmbInputMemberElement.prototype, "max", null);
149
+ __decorate([
150
+ property({ type: String, attribute: 'min-message' })
151
+ ], UmbInputMemberElement.prototype, "maxMessage", void 0);
152
+ __decorate([
153
+ property()
154
+ ], UmbInputMemberElement.prototype, "value", null);
155
+ __decorate([
156
+ state()
157
+ ], UmbInputMemberElement.prototype, "_items", void 0);
158
+ UmbInputMemberElement = __decorate([
159
+ customElement('umb-input-member')
160
+ ], UmbInputMemberElement);
161
+ export { UmbInputMemberElement };
162
+ export default UmbInputMemberElement;
@@ -1 +1,3 @@
1
+ import './components/index.js';
2
+ export * from './components/index.js';
1
3
  export * from './repository/index.js';
@@ -1 +1,3 @@
1
+ import './components/index.js';
2
+ export * from './components/index.js';
1
3
  export * from './repository/index.js';
@@ -3,5 +3,5 @@ import { UmbEntityActionBase } from '../../../core/entity-action/index.js';
3
3
  import { UmbControllerHostElement } from '../../../../libs/controller-api/index.js';
4
4
  export declare class UmbLanguageCreateEntityAction extends UmbEntityActionBase<UmbLanguageRepository> {
5
5
  constructor(host: UmbControllerHostElement, repositoryAlias: string, unique: string);
6
- getHref(): Promise<string>;
6
+ execute(): Promise<void>;
7
7
  }
@@ -4,8 +4,8 @@ export class UmbLanguageCreateEntityAction extends UmbEntityActionBase {
4
4
  constructor(host, repositoryAlias, unique) {
5
5
  super(host, repositoryAlias, unique);
6
6
  }
7
- // TODO: Generate the href or retrieve it from something?
8
- async getHref() {
9
- return 'section/settings/workspace/language/create';
7
+ async execute() {
8
+ // TODO: Generate the href or retrieve it from something?
9
+ history.pushState(null, '', `section/settings/workspace/language/create`);
10
10
  }
11
11
  }
@@ -53,7 +53,7 @@ export class UmbSelectionManager extends UmbBaseController {
53
53
  return;
54
54
  if (value === undefined)
55
55
  throw new Error('Value cannot be undefined');
56
- const newSelection = this.getMultiple() ? value : [value[0]];
56
+ const newSelection = this.getMultiple() ? value : value.slice(0, 1);
57
57
  this.#selection.next(newSelection);
58
58
  }
59
59
  /**