@umbraco-cms/backoffice 14.0.0--preview004-64d63c8e → 14.0.0--preview004-07058ebe
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/custom-elements.json +200 -3
- package/dist-cms/packages/core/components/index.d.ts +1 -0
- package/dist-cms/packages/core/components/index.js +1 -0
- package/dist-cms/packages/core/components/input-image-cropper/image-cropper-focus-setter.element.d.ts +3 -3
- package/dist-cms/packages/core/components/input-image-cropper/image-cropper-focus-setter.element.js +24 -16
- package/dist-cms/packages/core/components/input-image-cropper/input-image-cropper.element.js +2 -2
- package/dist-cms/packages/core/components/multiple-color-picker-input/index.d.ts +2 -0
- package/dist-cms/packages/core/components/multiple-color-picker-input/index.js +2 -0
- package/dist-cms/packages/core/components/multiple-color-picker-input/multiple-color-picker-input.element.d.ts +65 -0
- package/dist-cms/packages/core/components/multiple-color-picker-input/multiple-color-picker-input.element.js +207 -0
- package/dist-cms/packages/core/components/multiple-color-picker-input/multiple-color-picker-item-input.element.d.ts +39 -0
- package/dist-cms/packages/core/components/multiple-color-picker-input/multiple-color-picker-item-input.element.js +209 -0
- package/dist-cms/packages/core/property-editor/schemas/Umbraco.ColorPicker.js +1 -1
- package/dist-cms/packages/core/property-editor/uis/color-editor/manifests.d.ts +2 -0
- package/dist-cms/packages/core/property-editor/uis/color-editor/manifests.js +11 -0
- package/dist-cms/packages/core/property-editor/uis/color-editor/property-editor-ui-color-editor.element.d.ts +20 -0
- package/dist-cms/packages/core/property-editor/uis/color-editor/property-editor-ui-color-editor.element.js +48 -0
- package/dist-cms/packages/core/property-editor/uis/image-crops-configuration/property-editor-ui-image-crops-configuration.element.js +5 -5
- package/dist-cms/packages/core/property-editor/uis/manifests.js +2 -0
- package/dist-cms/packages/core/property-editor/uis/tiny-mce/config/max-image-size/property-editor-ui-tiny-mce-maximagesize-configuration.element.js +1 -1
- package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
- package/dist-cms/vscode-html-custom-data.json +84 -1
- package/package.json +1 -1
|
@@ -0,0 +1,209 @@
|
|
|
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, nothing, customElement, property, query, ifDefined } from '../../../../external/lit/index.js';
|
|
8
|
+
import { FormControlMixin, } from '../../../../external/uui/index.js';
|
|
9
|
+
import { UMB_MODAL_MANAGER_CONTEXT_TOKEN, UMB_CONFIRM_MODAL, } from '../../modal/index.js';
|
|
10
|
+
import { UmbChangeEvent, UmbInputEvent, UmbDeleteEvent } from '../../event/index.js';
|
|
11
|
+
import { UmbLitElement } from '../../../../shared/lit-element/index.js';
|
|
12
|
+
/**
|
|
13
|
+
* @element umb-multiple-color-picker-item-input
|
|
14
|
+
*/
|
|
15
|
+
let UmbMultipleColorPickerItemInputElement = class UmbMultipleColorPickerItemInputElement extends FormControlMixin(UmbLitElement) {
|
|
16
|
+
constructor() {
|
|
17
|
+
super();
|
|
18
|
+
/**
|
|
19
|
+
* Disables the input
|
|
20
|
+
* @type {boolean}
|
|
21
|
+
* @attr
|
|
22
|
+
* @default false
|
|
23
|
+
*/
|
|
24
|
+
this.disabled = false;
|
|
25
|
+
/**
|
|
26
|
+
* Disables the input
|
|
27
|
+
* @type {boolean}
|
|
28
|
+
* @attr
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
this.readonly = false;
|
|
32
|
+
this.showLabels = true;
|
|
33
|
+
this.consumeContext(UMB_MODAL_MANAGER_CONTEXT_TOKEN, (instance) => {
|
|
34
|
+
this._modalContext = instance;
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
#onDelete() {
|
|
38
|
+
const modalContext = this._modalContext?.open(UMB_CONFIRM_MODAL, {
|
|
39
|
+
data: {
|
|
40
|
+
headline: `${this.localize.term('actions_delete')} ${this.value || ''}`,
|
|
41
|
+
content: this.localize.term('content_nestedContentDeleteItem'),
|
|
42
|
+
color: 'danger',
|
|
43
|
+
confirmLabel: this.localize.term('actions_delete'),
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
modalContext?.onSubmit().then(() => {
|
|
47
|
+
this.dispatchEvent(new UmbDeleteEvent());
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
#onLabelInput(event) {
|
|
51
|
+
event.stopPropagation();
|
|
52
|
+
this.label = event.target.value;
|
|
53
|
+
this.dispatchEvent(new UmbInputEvent());
|
|
54
|
+
}
|
|
55
|
+
#onLabelChange(event) {
|
|
56
|
+
event.stopPropagation();
|
|
57
|
+
this.label = event.target.value;
|
|
58
|
+
this.dispatchEvent(new UmbChangeEvent());
|
|
59
|
+
}
|
|
60
|
+
#onValueChange(event) {
|
|
61
|
+
event.stopPropagation();
|
|
62
|
+
this.value = event.target.value;
|
|
63
|
+
this.dispatchEvent(new UmbChangeEvent());
|
|
64
|
+
}
|
|
65
|
+
#onValueInput(event) {
|
|
66
|
+
event.stopPropagation();
|
|
67
|
+
this.value = event.target.value;
|
|
68
|
+
this.dispatchEvent(new UmbInputEvent());
|
|
69
|
+
}
|
|
70
|
+
#onColorInput(event) {
|
|
71
|
+
event.stopPropagation();
|
|
72
|
+
this.value = this._colorPicker.value;
|
|
73
|
+
this.dispatchEvent(new UmbChangeEvent());
|
|
74
|
+
}
|
|
75
|
+
// Prevent valid events from bubbling outside the message element
|
|
76
|
+
#onValid(event) {
|
|
77
|
+
event.stopPropagation();
|
|
78
|
+
}
|
|
79
|
+
// Prevent invalid events from bubbling outside the message element
|
|
80
|
+
#onInvalid(event) {
|
|
81
|
+
event.stopPropagation();
|
|
82
|
+
}
|
|
83
|
+
async focus() {
|
|
84
|
+
await this.updateComplete;
|
|
85
|
+
this._input?.focus();
|
|
86
|
+
}
|
|
87
|
+
getFormElement() {
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
#onColorClick() {
|
|
91
|
+
this._colorPicker.click();
|
|
92
|
+
}
|
|
93
|
+
render() {
|
|
94
|
+
//TODO: Using native input=color element instead of uui-color-picker due to its huge size and bad adaptability as a pop up
|
|
95
|
+
return html `
|
|
96
|
+
<uui-form-validation-message id="validation-message" @invalid=${this.#onInvalid} @valid=${this.#onValid}>
|
|
97
|
+
<div id="item">
|
|
98
|
+
${this.disabled || this.readonly ? nothing : html `<uui-icon name="icon-navigation"></uui-icon>`}
|
|
99
|
+
<div class="color-wrapper">
|
|
100
|
+
<uui-input
|
|
101
|
+
id="input"
|
|
102
|
+
value=${this.value}
|
|
103
|
+
label=${this.localize.term('general_value')}
|
|
104
|
+
placeholder=${this.localize.term('general_value')}
|
|
105
|
+
@input="${this.#onValueInput}"
|
|
106
|
+
@change="${this.#onValueChange}"
|
|
107
|
+
required="${this.required}"
|
|
108
|
+
required-message="Value is missing">
|
|
109
|
+
<uui-color-swatch
|
|
110
|
+
slot="prepend"
|
|
111
|
+
label=${this.value}
|
|
112
|
+
value="${this.value}"
|
|
113
|
+
@click=${this.#onColorClick}></uui-color-swatch>
|
|
114
|
+
</uui-input>
|
|
115
|
+
<input aria-hidden="${true}" type="color" id="color" value=${this.value} @input=${this.#onColorInput} />
|
|
116
|
+
</div>
|
|
117
|
+
${this.showLabels
|
|
118
|
+
? html ` <uui-input
|
|
119
|
+
label=${this.localize.term('placeholders_label')}
|
|
120
|
+
placeholder=${this.localize.term('placeholders_label')}
|
|
121
|
+
value=${ifDefined(this.label)}
|
|
122
|
+
@input="${this.#onLabelInput}"
|
|
123
|
+
@change="${this.#onLabelChange}"
|
|
124
|
+
?disabled=${this.disabled}
|
|
125
|
+
?readonly=${this.readonly}></uui-input>`
|
|
126
|
+
: nothing}
|
|
127
|
+
${this.readonly
|
|
128
|
+
? nothing
|
|
129
|
+
: html `<uui-button
|
|
130
|
+
label="${this.localize.term('actions_delete')} ${this.value}"
|
|
131
|
+
look="primary"
|
|
132
|
+
color="danger"
|
|
133
|
+
@click="${this.#onDelete}"
|
|
134
|
+
?disabled=${this.disabled}
|
|
135
|
+
compact>
|
|
136
|
+
<uui-icon name="icon-trash"></uui-icon>
|
|
137
|
+
</uui-button>`}
|
|
138
|
+
</div>
|
|
139
|
+
</uui-form-validation-message>
|
|
140
|
+
`;
|
|
141
|
+
}
|
|
142
|
+
static { this.styles = [
|
|
143
|
+
css `
|
|
144
|
+
:host {
|
|
145
|
+
display: flex;
|
|
146
|
+
align-items: center;
|
|
147
|
+
margin-bottom: var(--uui-size-space-3);
|
|
148
|
+
gap: var(--uui-size-space-3);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
#item {
|
|
152
|
+
position: relative;
|
|
153
|
+
display: flex;
|
|
154
|
+
gap: var(--uui-size-1);
|
|
155
|
+
align-items: center;
|
|
156
|
+
}
|
|
157
|
+
uui-input {
|
|
158
|
+
flex: 1;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
uui-color-swatch {
|
|
162
|
+
padding: var(--uui-size-1);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.color-wrapper {
|
|
166
|
+
position: relative;
|
|
167
|
+
flex: 1;
|
|
168
|
+
display: flex;
|
|
169
|
+
flex-direction: column;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
uui-input,
|
|
173
|
+
#validation-message {
|
|
174
|
+
flex: 1;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
input[type='color'] {
|
|
178
|
+
visibility: hidden;
|
|
179
|
+
width: 0px;
|
|
180
|
+
padding: 0;
|
|
181
|
+
margin: 0;
|
|
182
|
+
position: absolute;
|
|
183
|
+
}
|
|
184
|
+
`,
|
|
185
|
+
]; }
|
|
186
|
+
};
|
|
187
|
+
__decorate([
|
|
188
|
+
property({ type: Boolean, reflect: true })
|
|
189
|
+
], UmbMultipleColorPickerItemInputElement.prototype, "disabled", void 0);
|
|
190
|
+
__decorate([
|
|
191
|
+
property({ type: Boolean, reflect: true })
|
|
192
|
+
], UmbMultipleColorPickerItemInputElement.prototype, "readonly", void 0);
|
|
193
|
+
__decorate([
|
|
194
|
+
property({ type: String })
|
|
195
|
+
], UmbMultipleColorPickerItemInputElement.prototype, "label", void 0);
|
|
196
|
+
__decorate([
|
|
197
|
+
query('#input')
|
|
198
|
+
], UmbMultipleColorPickerItemInputElement.prototype, "_input", void 0);
|
|
199
|
+
__decorate([
|
|
200
|
+
query('#color')
|
|
201
|
+
], UmbMultipleColorPickerItemInputElement.prototype, "_colorPicker", void 0);
|
|
202
|
+
__decorate([
|
|
203
|
+
property({ type: Boolean })
|
|
204
|
+
], UmbMultipleColorPickerItemInputElement.prototype, "showLabels", void 0);
|
|
205
|
+
UmbMultipleColorPickerItemInputElement = __decorate([
|
|
206
|
+
customElement('umb-multiple-color-picker-item-input')
|
|
207
|
+
], UmbMultipleColorPickerItemInputElement);
|
|
208
|
+
export { UmbMultipleColorPickerItemInputElement };
|
|
209
|
+
export default UmbMultipleColorPickerItemInputElement;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const manifest = {
|
|
2
|
+
type: 'propertyEditorUi',
|
|
3
|
+
alias: 'Umb.PropertyEditorUi.ColorEditor',
|
|
4
|
+
name: 'Color Editor Property Editor UI',
|
|
5
|
+
js: () => import('./property-editor-ui-color-editor.element.js'),
|
|
6
|
+
meta: {
|
|
7
|
+
label: 'Color Editor',
|
|
8
|
+
icon: 'icon-page-add',
|
|
9
|
+
group: 'Umbraco.DropDown.Flexible',
|
|
10
|
+
},
|
|
11
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { UmbPropertyEditorUiElement } from '../../../extension-registry/index.js';
|
|
2
|
+
import { UmbLitElement } from '../../../../../shared/lit-element/index.js';
|
|
3
|
+
import type { UmbSwatchDetails } from '../../../../../shared/models/index.js';
|
|
4
|
+
import type { UmbPropertyEditorConfigCollection } from '../../index.js';
|
|
5
|
+
/**
|
|
6
|
+
* @element umb-property-editor-ui-color-editor
|
|
7
|
+
*/
|
|
8
|
+
export declare class UmbPropertyEditorUIColorEditorElement extends UmbLitElement implements UmbPropertyEditorUiElement {
|
|
9
|
+
#private;
|
|
10
|
+
value: Array<UmbSwatchDetails>;
|
|
11
|
+
private _showLabels;
|
|
12
|
+
set config(config: UmbPropertyEditorConfigCollection | undefined);
|
|
13
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
14
|
+
}
|
|
15
|
+
export default UmbPropertyEditorUIColorEditorElement;
|
|
16
|
+
declare global {
|
|
17
|
+
interface HTMLElementTagNameMap {
|
|
18
|
+
'umb-property-editor-ui-color-editor': UmbPropertyEditorUIColorEditorElement;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
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 { html, customElement, property, state } from '../../../../../external/lit/index.js';
|
|
8
|
+
import { UmbLitElement } from '../../../../../shared/lit-element/index.js';
|
|
9
|
+
/**
|
|
10
|
+
* @element umb-property-editor-ui-color-editor
|
|
11
|
+
*/
|
|
12
|
+
let UmbPropertyEditorUIColorEditorElement = class UmbPropertyEditorUIColorEditorElement extends UmbLitElement {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.#defaultShowLabels = true;
|
|
16
|
+
this.value = [];
|
|
17
|
+
this._showLabels = this.#defaultShowLabels;
|
|
18
|
+
}
|
|
19
|
+
#defaultShowLabels;
|
|
20
|
+
set config(config) {
|
|
21
|
+
this._showLabels = config?.getValueByAlias('useLabel') ?? this.#defaultShowLabels;
|
|
22
|
+
this.value = config?.getValueByAlias('items') ?? [];
|
|
23
|
+
}
|
|
24
|
+
#onChange(event) {
|
|
25
|
+
this.value = event.target.items;
|
|
26
|
+
this.dispatchEvent(new CustomEvent('property-value-change'));
|
|
27
|
+
}
|
|
28
|
+
render() {
|
|
29
|
+
return html `<umb-multiple-color-picker-input
|
|
30
|
+
?showLabels=${this._showLabels}
|
|
31
|
+
.items="${this.value ?? []}"
|
|
32
|
+
@change=${this.#onChange}></umb-multiple-color-picker-input>`;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
__decorate([
|
|
36
|
+
property({ type: Array })
|
|
37
|
+
], UmbPropertyEditorUIColorEditorElement.prototype, "value", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
state()
|
|
40
|
+
], UmbPropertyEditorUIColorEditorElement.prototype, "_showLabels", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
property({ attribute: false })
|
|
43
|
+
], UmbPropertyEditorUIColorEditorElement.prototype, "config", null);
|
|
44
|
+
UmbPropertyEditorUIColorEditorElement = __decorate([
|
|
45
|
+
customElement('umb-property-editor-ui-color-editor')
|
|
46
|
+
], UmbPropertyEditorUIColorEditorElement);
|
|
47
|
+
export { UmbPropertyEditorUIColorEditorElement };
|
|
48
|
+
export default UmbPropertyEditorUIColorEditorElement;
|
|
@@ -87,17 +87,17 @@ let UmbPropertyEditorUIImageCropsConfigurationElement = class UmbPropertyEditorU
|
|
|
87
87
|
<form @submit=${this.#onSubmit}>
|
|
88
88
|
<div class="input">
|
|
89
89
|
<uui-label for="alias">Alias</uui-label>
|
|
90
|
-
<uui-input id="alias" name="alias" type="text" autocomplete="false" value=""></uui-input>
|
|
90
|
+
<uui-input label="Alias" id="alias" name="alias" type="text" autocomplete="false" value=""></uui-input>
|
|
91
91
|
</div>
|
|
92
92
|
<div class="input">
|
|
93
93
|
<uui-label for="width">Width</uui-label>
|
|
94
|
-
<uui-input id="width" name="width" type="number" autocomplete="false" value="">
|
|
94
|
+
<uui-input label="Width" id="width" name="width" type="number" autocomplete="false" value="">
|
|
95
95
|
<span class="append" slot="append">px</span>
|
|
96
96
|
</uui-input>
|
|
97
97
|
</div>
|
|
98
98
|
<div class="input">
|
|
99
99
|
<uui-label for="height">Height</uui-label>
|
|
100
|
-
<uui-input id="height" name="height" type="number" autocomplete="false" value="">
|
|
100
|
+
<uui-input label="Height" id="height" name="height" type="number" autocomplete="false" value="">
|
|
101
101
|
<span class="append" slot="append">px</span>
|
|
102
102
|
</uui-input>
|
|
103
103
|
</div>
|
|
@@ -111,8 +111,8 @@ let UmbPropertyEditorUIImageCropsConfigurationElement = class UmbPropertyEditorU
|
|
|
111
111
|
<span class="crop-alias">${item.alias}</span>
|
|
112
112
|
<span class="crop-size">(${item.width} x ${item.height}px)</span>
|
|
113
113
|
<div class="crop-actions">
|
|
114
|
-
<uui-button @click=${() => this.#onEdit(item)}>Edit</uui-button>
|
|
115
|
-
<uui-button color="danger" @click=${() => this.#onRemove(item.alias)}>Remove</uui-button>
|
|
114
|
+
<uui-button label="Edit" @click=${() => this.#onEdit(item)}>Edit</uui-button>
|
|
115
|
+
<uui-button label="Remove" color="danger" @click=${() => this.#onRemove(item.alias)}>Remove</uui-button>
|
|
116
116
|
</div>
|
|
117
117
|
</div>
|
|
118
118
|
`)}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { manifest as colorPicker } from './color-picker/manifests.js';
|
|
2
|
+
import { manifest as colorEditor } from './color-editor/manifests.js';
|
|
2
3
|
import { manifest as datePicker } from './date-picker/manifests.js';
|
|
3
4
|
import { manifest as eyeDropper } from './eye-dropper/manifests.js';
|
|
4
5
|
import { manifest as multiUrlPicker } from './multi-url-picker/manifests.js';
|
|
@@ -32,6 +33,7 @@ import { manifest as memberPicker } from './member-picker/manifests.js';
|
|
|
32
33
|
import { manifest as memberGroupPicker } from './member-group-picker/manifests.js';
|
|
33
34
|
export const manifests = [
|
|
34
35
|
colorPicker,
|
|
36
|
+
colorEditor,
|
|
35
37
|
datePicker,
|
|
36
38
|
eyeDropper,
|
|
37
39
|
multiUrlPicker,
|
|
@@ -16,7 +16,7 @@ let UmbPropertyEditorUITinyMceMaxImageSizeConfigurationElement = class UmbProper
|
|
|
16
16
|
this.value = 0;
|
|
17
17
|
}
|
|
18
18
|
render() {
|
|
19
|
-
return html `<uui-input type="number" placeholder="Max size" .value=${this.value}></uui-input>`;
|
|
19
|
+
return html `<uui-input label="Max size" type="number" placeholder="Max size" .value=${this.value}></uui-input>`;
|
|
20
20
|
}
|
|
21
21
|
static { this.styles = [UmbTextStyles]; }
|
|
22
22
|
};
|