@nuraly/lumenui 0.3.5 → 0.3.7
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/nuralyui.bundle.js +2577 -1486
- package/dist/nuralyui.bundle.js.gz +0 -0
- package/dist/src/components/button/bundle.js +130 -39
- package/dist/src/components/button/bundle.js.gz +0 -0
- package/dist/src/components/button/button.component.js +7 -4
- package/dist/src/components/button/button.style.js +92 -2
- package/dist/src/components/canvas/base-canvas.component.d.ts +8 -0
- package/dist/src/components/canvas/base-canvas.component.js +75 -3
- package/dist/src/components/canvas/bundle.js +2540 -1201
- package/dist/src/components/canvas/bundle.js.gz +0 -0
- package/dist/src/components/canvas/controllers/collaboration.controller.d.ts +24 -11
- package/dist/src/components/canvas/controllers/collaboration.controller.js +176 -120
- package/dist/src/components/canvas/controllers/selection.controller.js +20 -0
- package/dist/src/components/canvas/interfaces/collaboration.interface.d.ts +8 -0
- package/dist/src/components/canvas/templates/index.d.ts +1 -0
- package/dist/src/components/canvas/templates/index.js +2 -0
- package/dist/src/components/canvas/templates/lock-overlay.template.d.ts +20 -0
- package/dist/src/components/canvas/templates/lock-overlay.template.js +33 -0
- package/dist/src/components/canvas/workflow-canvas.component.js +52 -24
- package/dist/src/components/canvas/workflow-canvas.style.js +62 -1
- package/dist/src/components/canvas/workflow-canvas.types.js +50 -4
- package/dist/src/components/chat-panel/bundle.js +10 -10
- package/dist/src/components/chat-panel/bundle.js.gz +0 -0
- package/dist/src/components/chat-panel/chat-panel.component.js +8 -8
- package/dist/src/components/chatbot/bundle.js +400 -242
- package/dist/src/components/chatbot/bundle.js.gz +0 -0
- package/dist/src/components/chatbot/chatbot.style.js +156 -22
- package/dist/src/components/chatbot/chatbot.types.d.ts +1 -0
- package/dist/src/components/chatbot/core/chatbot-core.controller.js +13 -7
- package/dist/src/components/chatbot/plugins/artifact-plugin.js +0 -19
- package/dist/src/components/chatbot/plugins/flight-card-plugin.js +0 -35
- package/dist/src/components/chatbot/plugins/markdown-plugin.js +0 -4
- package/dist/src/components/chatbot/plugins/print-job-card-plugin.js +0 -36
- package/dist/src/components/chatbot/plugins/selection-card-plugin.js +0 -34
- package/dist/src/components/chatbot/providers/workflow-socket-provider.js +1 -2
- package/dist/src/components/chatbot/templates/input-box.template.js +58 -30
- package/dist/src/components/chatbot/templates/message.template.js +41 -31
- package/dist/src/components/chatbot/templates/thread-sidebar.template.js +38 -39
- package/dist/src/components/colorpicker/bundle.js +15 -10
- package/dist/src/components/colorpicker/bundle.js.gz +0 -0
- package/dist/src/components/colorpicker/color-picker.component.js +15 -10
- package/dist/src/components/datepicker/bundle.js +10 -10
- package/dist/src/components/datepicker/bundle.js.gz +0 -0
- package/dist/src/components/datepicker/datepicker.component.js +14 -22
- package/dist/src/components/dropdown/bundle.js +15 -14
- package/dist/src/components/dropdown/bundle.js.gz +0 -0
- package/dist/src/components/dropdown/dropdown.component.js +10 -9
- package/dist/src/components/dropdown/dropdown.style.js +2 -2
- package/dist/src/components/file-upload/bundle.js +15 -14
- package/dist/src/components/file-upload/bundle.js.gz +0 -0
- package/dist/src/components/file-upload/file-upload.component.js +15 -14
- package/dist/src/components/icon/bundle.js +7 -7
- package/dist/src/components/icon/bundle.js.gz +0 -0
- package/dist/src/components/icon/icon-paths.js +15 -0
- package/dist/src/components/iconpicker/bundle.js +216 -124
- package/dist/src/components/iconpicker/bundle.js.gz +0 -0
- package/dist/src/components/iconpicker/icon-picker.component.js +4 -4
- package/dist/src/components/menu/bundle.js +5 -2
- package/dist/src/components/menu/bundle.js.gz +0 -0
- package/dist/src/components/menu/menu.component.js +5 -2
- package/dist/src/components/modal/bundle.js +16 -13
- package/dist/src/components/modal/bundle.js.gz +0 -0
- package/dist/src/components/modal/modal.component.js +16 -13
- package/dist/src/components/panel/bundle.js +28 -28
- package/dist/src/components/panel/bundle.js.gz +0 -0
- package/dist/src/components/popconfirm/bundle.js +135 -41
- package/dist/src/components/popconfirm/bundle.js.gz +0 -0
- package/dist/src/components/popconfirm/popconfirm.component.d.ts +15 -119
- package/dist/src/components/popconfirm/popconfirm.component.js +158 -162
- package/dist/src/components/popconfirm/popconfirm.style.js +94 -0
- package/dist/src/components/presence/bundle.js +2 -1
- package/dist/src/components/presence/bundle.js.gz +0 -0
- package/dist/src/components/presence/presence.component.js +2 -1
- package/dist/src/components/table/bundle.js +3 -2
- package/dist/src/components/table/bundle.js.gz +0 -0
- package/dist/src/components/table/table.component.js +3 -2
- package/dist/src/components/tabs/bundle.js +3 -3
- package/dist/src/components/tabs/bundle.js.gz +0 -0
- package/dist/src/components/timepicker/bundle.js +3 -3
- package/dist/src/components/timepicker/bundle.js.gz +0 -0
- package/package.json +1 -1
- package/packages/common/dist/VERSIONS.md +1 -1
- package/packages/common/dist/shared/controllers/dropdown.controller.d.ts +4 -0
- package/packages/common/dist/shared/controllers/dropdown.controller.d.ts.map +1 -1
- package/packages/common/dist/shared/controllers/dropdown.controller.js +29 -3
- package/packages/common/dist/shared/controllers/dropdown.controller.js.map +1 -1
|
@@ -37,28 +37,27 @@ function formatFileSize(bytes) {
|
|
|
37
37
|
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
38
38
|
return Math.round((bytes / Math.pow(k, i)) * 100) / 100 + ' ' + sizes[i];
|
|
39
39
|
}
|
|
40
|
-
/**
|
|
41
|
-
* Get icon name based on MIME type
|
|
42
|
-
*/
|
|
43
|
-
function getFileIcon(mimeType) {
|
|
44
|
-
if (mimeType.startsWith('image/'))
|
|
45
|
-
return 'image';
|
|
46
|
-
if (mimeType.startsWith('video/'))
|
|
47
|
-
return 'video';
|
|
48
|
-
if (mimeType.startsWith('audio/'))
|
|
49
|
-
return 'music';
|
|
50
|
-
if (mimeType === 'application/pdf')
|
|
51
|
-
return 'file-pdf';
|
|
52
|
-
if (mimeType.startsWith('text/'))
|
|
53
|
-
return 'file-text';
|
|
54
|
-
return 'file';
|
|
55
|
-
}
|
|
56
40
|
/**
|
|
57
41
|
* Check if file is an image
|
|
58
42
|
*/
|
|
59
43
|
function isImageFile(mimeType) {
|
|
60
44
|
return mimeType.startsWith('image/');
|
|
61
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Derive a short extension label for non-image thumbnails
|
|
48
|
+
*/
|
|
49
|
+
function getFileExtension(name, mimeType) {
|
|
50
|
+
const dot = name.lastIndexOf('.');
|
|
51
|
+
if (dot >= 0 && dot < name.length - 1) {
|
|
52
|
+
return name.slice(dot + 1).toUpperCase().slice(0, 4);
|
|
53
|
+
}
|
|
54
|
+
if (mimeType) {
|
|
55
|
+
const slash = mimeType.indexOf('/');
|
|
56
|
+
if (slash >= 0)
|
|
57
|
+
return mimeType.slice(slash + 1).toUpperCase().slice(0, 4);
|
|
58
|
+
}
|
|
59
|
+
return 'FILE';
|
|
60
|
+
}
|
|
62
61
|
/**
|
|
63
62
|
* Renders a single message
|
|
64
63
|
*/
|
|
@@ -87,33 +86,44 @@ export function renderMessage(message, handlers) {
|
|
|
87
86
|
${message.files && message.files.length > 0 ? html `
|
|
88
87
|
<div class="message__attachments" part="message-attachments" role="list" aria-label="${msg('Attached files')}">
|
|
89
88
|
${message.files.map((f) => html `
|
|
90
|
-
<nr-dropdown
|
|
91
|
-
trigger="hover"
|
|
89
|
+
<nr-dropdown
|
|
90
|
+
trigger="hover"
|
|
92
91
|
placement="top-end"
|
|
93
92
|
size="small"
|
|
94
93
|
class="message-file-preview-dropdown"
|
|
95
94
|
>
|
|
96
|
-
<
|
|
95
|
+
<div
|
|
97
96
|
slot="trigger"
|
|
98
|
-
class="
|
|
99
|
-
|
|
97
|
+
class="file-thumb file-thumb--message"
|
|
98
|
+
role="button"
|
|
99
|
+
tabindex="0"
|
|
100
|
+
title="${f.name}"
|
|
100
101
|
@click=${() => { var _a; return (_a = handlers.onFileClick) === null || _a === void 0 ? void 0 : _a.call(handlers, f); }}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
>
|
|
103
|
+
${isImageFile(f.mimeType) && (f.url || f.previewUrl) ? html `
|
|
104
|
+
<img
|
|
105
|
+
class="file-thumb__image"
|
|
106
|
+
src="${f.previewUrl || f.url}"
|
|
107
|
+
alt="${f.name}"
|
|
108
|
+
/>
|
|
109
|
+
` : html `
|
|
110
|
+
<div class="file-thumb__ext" data-ext="${getFileExtension(f.name, f.mimeType)}">
|
|
111
|
+
<span class="file-thumb__ext-label">${getFileExtension(f.name, f.mimeType)}</span>
|
|
112
|
+
</div>
|
|
113
|
+
`}
|
|
114
|
+
</div>
|
|
115
|
+
|
|
104
116
|
<div slot="content" class="message-file-preview-content">
|
|
105
117
|
${isImageFile(f.mimeType) && (f.url || f.previewUrl) ? html `
|
|
106
|
-
<img
|
|
107
|
-
src="${f.previewUrl || f.url}"
|
|
118
|
+
<img
|
|
119
|
+
src="${f.previewUrl || f.url}"
|
|
108
120
|
alt="${f.name}"
|
|
109
121
|
class="message-file-preview-image"
|
|
110
122
|
/>
|
|
111
123
|
` : html `
|
|
112
|
-
<
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
class="message-file-preview-icon"
|
|
116
|
-
></nr-icon>
|
|
124
|
+
<div class="file-preview-ext" data-ext="${getFileExtension(f.name, f.mimeType)}">
|
|
125
|
+
${getFileExtension(f.name, f.mimeType)}
|
|
126
|
+
</div>
|
|
117
127
|
`}
|
|
118
128
|
<div class="message-file-preview-info">
|
|
119
129
|
<div class="message-file-preview-name" title="${f.name}">${f.name}</div>
|
|
@@ -56,60 +56,59 @@ function renderThreadItem(thread, data, handlers) {
|
|
|
56
56
|
<div class="thread-item__title">${thread.title || msg('New Chat')}</div>
|
|
57
57
|
`}
|
|
58
58
|
<div class="thread-item__actions">
|
|
59
|
-
${handlers.
|
|
59
|
+
${handlers.onBookmarkThread && thread.bookmarked ? html `
|
|
60
60
|
<button
|
|
61
|
-
class="thread-item__action-btn"
|
|
62
|
-
title="${msg('
|
|
63
|
-
@click=${(e) => {
|
|
64
|
-
e.stopPropagation();
|
|
65
|
-
e.target.dispatchEvent(new CustomEvent('nr-thread-edit', {
|
|
66
|
-
bubbles: true,
|
|
67
|
-
composed: true,
|
|
68
|
-
detail: { threadId: thread.id }
|
|
69
|
-
}));
|
|
70
|
-
}}
|
|
71
|
-
part="thread-rename"
|
|
72
|
-
>
|
|
73
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/></svg>
|
|
74
|
-
</button>
|
|
75
|
-
` : ''}
|
|
76
|
-
${handlers.onBookmarkThread ? html `
|
|
77
|
-
<button
|
|
78
|
-
class="thread-item__action-btn ${thread.bookmarked ? 'thread-item__bookmark--active' : ''}"
|
|
79
|
-
title="${thread.bookmarked ? msg('Remove bookmark') : msg('Bookmark conversation')}"
|
|
61
|
+
class="thread-item__action-btn thread-item__bookmark--active"
|
|
62
|
+
title="${msg('Remove bookmark')}"
|
|
80
63
|
@click=${(e) => {
|
|
81
64
|
e.stopPropagation();
|
|
82
65
|
handlers.onBookmarkThread(thread.id);
|
|
83
66
|
}}
|
|
84
67
|
part="thread-bookmark"
|
|
85
68
|
>
|
|
86
|
-
|
|
87
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"/></svg>
|
|
88
|
-
` : html `
|
|
89
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"/></svg>
|
|
90
|
-
`}
|
|
69
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"/></svg>
|
|
91
70
|
</button>
|
|
92
71
|
` : ''}
|
|
93
|
-
${handlers.onDeleteThread ? html `
|
|
94
|
-
<nr-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
ok-type="danger"
|
|
100
|
-
placement="right"
|
|
72
|
+
${data.editingThreadId !== thread.id && (handlers.onRenameThread || handlers.onBookmarkThread || handlers.onDeleteThread) ? html `
|
|
73
|
+
<nr-dropdown
|
|
74
|
+
trigger="click"
|
|
75
|
+
placement="bottom-end"
|
|
76
|
+
size="small"
|
|
77
|
+
auto-close
|
|
101
78
|
@click=${(e) => e.stopPropagation()}
|
|
102
|
-
@nr-
|
|
79
|
+
@nr-dropdown-item-click=${(e) => {
|
|
80
|
+
var _a, _b;
|
|
81
|
+
const id = (_b = (_a = e.detail) === null || _a === void 0 ? void 0 : _a.item) === null || _b === void 0 ? void 0 : _b.id;
|
|
82
|
+
if (id === 'rename' && handlers.onRenameThread) {
|
|
83
|
+
e.target.dispatchEvent(new CustomEvent('nr-thread-edit', {
|
|
84
|
+
bubbles: true,
|
|
85
|
+
composed: true,
|
|
86
|
+
detail: { threadId: thread.id }
|
|
87
|
+
}));
|
|
88
|
+
}
|
|
89
|
+
else if (id === 'bookmark' && handlers.onBookmarkThread) {
|
|
90
|
+
handlers.onBookmarkThread(thread.id);
|
|
91
|
+
}
|
|
92
|
+
else if (id === 'delete' && handlers.onDeleteThread) {
|
|
93
|
+
handlers.onDeleteThread(thread.id);
|
|
94
|
+
}
|
|
95
|
+
}}
|
|
96
|
+
.items=${[
|
|
97
|
+
...(handlers.onRenameThread ? [{ id: 'rename', label: msg('Rename') }] : []),
|
|
98
|
+
...(handlers.onBookmarkThread ? [{ id: 'bookmark', label: thread.bookmarked ? msg('Remove bookmark') : msg('Bookmark') }] : []),
|
|
99
|
+
...(handlers.onDeleteThread ? [{ id: 'delete', label: msg('Delete') }] : []),
|
|
100
|
+
]}
|
|
103
101
|
>
|
|
104
102
|
<button
|
|
105
103
|
slot="trigger"
|
|
106
|
-
class="thread-item__action-btn thread-
|
|
107
|
-
title="${msg('
|
|
108
|
-
part="thread-
|
|
104
|
+
class="thread-item__action-btn thread-item__menu"
|
|
105
|
+
title="${msg('More options')}"
|
|
106
|
+
part="thread-menu"
|
|
107
|
+
aria-label="${msg('More options')}"
|
|
109
108
|
>
|
|
110
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="
|
|
109
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" stroke="none"><circle cx="5" cy="12" r="1.8"/><circle cx="12" cy="12" r="1.8"/><circle cx="19" cy="12" r="1.8"/></svg>
|
|
111
110
|
</button>
|
|
112
|
-
</nr-
|
|
111
|
+
</nr-dropdown>
|
|
113
112
|
` : ''}
|
|
114
113
|
</div>
|
|
115
114
|
</div>
|
|
@@ -211,11 +211,12 @@ var k=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.g
|
|
|
211
211
|
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
212
212
|
* SPDX-License-Identifier: MIT
|
|
213
213
|
*/var P=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let z=class extends((t=>p(d(b(f(t)))))(o)){constructor(){super(),this.requiredComponents=["nr-input","nr-icon"],this.color="#3498db",this.show=!1,this.defaultColorSets=[],this.disabled=!1,this.size="default",this.trigger="click",this.placement="auto",this.animation="fade",this.closeOnSelect=!1,this.closeOnOutsideClick=!0,this.closeOnEscape=!0,this.showInput=!0,this.showCopyButton=!0,this.format="hex",this.inputPlaceholder="Enter color",this.label="",this.helperText="",this.isValidColor=!0,this.dropdownController=new j(this),this.eventController=new A(this),this.handleTriggerClick=t=>{this.eventController.handleTriggerClick(t)},this.handleColorChanged=t=>{const e=t.detail.value;this.eventController.handleColorChange(e),this.closeOnSelect&&this.dropdownController.close()},this.handleInputChange=t=>{this.eventController.handleInputChange(t)},"undefined"!=typeof window&&Promise.resolve().then(function(){return lt})}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}updated(t){super.updated(t),t.has("color")&&this.validateColor()}open(){this.dropdownController.open()}close(){this.dropdownController.close()}toggle(){this.dropdownController.toggle()}validateColor(){return this.isValidColor=this.eventController.isValidColor(this.color),this.isValidColor}setupEventListeners(){(this.closeOnOutsideClick||this.closeOnEscape)&&this.eventController.setupEventListeners()}removeEventListeners(){this.eventController.removeEventListeners()}render(){const i={"color-picker-container":!0,"color-picker-container--disabled":this.disabled,"color-picker-container--open":this.show,[`color-picker-container--${this.size}`]:!0};return e`
|
|
214
|
-
<div class="${l(i)}" data-theme="${this.currentTheme}">
|
|
214
|
+
<div class="${l(i)}" part="container" data-theme="${this.currentTheme}">
|
|
215
215
|
${this.renderLabel()}
|
|
216
|
-
|
|
216
|
+
|
|
217
217
|
<nr-colorholder-box
|
|
218
218
|
class="color-holder"
|
|
219
|
+
part="trigger"
|
|
219
220
|
color="${this.color}"
|
|
220
221
|
.size=${this.size}
|
|
221
222
|
?disabled="${this.disabled}"
|
|
@@ -240,8 +241,9 @@ var k=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.g
|
|
|
240
241
|
${o?e`<span class="${l}">*</span>`:t}
|
|
241
242
|
</label>
|
|
242
243
|
`}(this.label,!1,{cssClass:"color-picker-label"})}renderDropdown(){return this.show?e`
|
|
243
|
-
<div
|
|
244
|
+
<div
|
|
244
245
|
class="dropdown-container"
|
|
246
|
+
part="panel"
|
|
245
247
|
role="dialog"
|
|
246
248
|
aria-label="Color picker"
|
|
247
249
|
>
|
|
@@ -250,24 +252,27 @@ var k=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.g
|
|
|
250
252
|
${this.renderColorInput()}
|
|
251
253
|
</div>
|
|
252
254
|
`:t}renderDefaultColorSets(){return this.defaultColorSets&&0!==this.defaultColorSets.length?e`
|
|
253
|
-
<nr-default-color-sets
|
|
254
|
-
|
|
255
|
+
<nr-default-color-sets
|
|
256
|
+
part="default-colors"
|
|
257
|
+
.defaultColorSets=${this.defaultColorSets}
|
|
255
258
|
@color-click="${this.handleColorChanged}"
|
|
256
259
|
aria-label="Preset colors">
|
|
257
260
|
</nr-default-color-sets>
|
|
258
261
|
`:t}renderColorPicker(){return e`
|
|
259
262
|
<hex-color-picker
|
|
263
|
+
part="picker"
|
|
260
264
|
color="${this.color}"
|
|
261
265
|
@color-changed="${this.handleColorChanged}"
|
|
262
266
|
aria-label="Color gradient picker">
|
|
263
267
|
</hex-color-picker>
|
|
264
268
|
`}renderColorInput(){return this.showInput?e`
|
|
265
|
-
<nr-input
|
|
266
|
-
|
|
267
|
-
|
|
269
|
+
<nr-input
|
|
270
|
+
part="input"
|
|
271
|
+
type="text"
|
|
272
|
+
.value="${this.color}"
|
|
268
273
|
placeholder="${this.inputPlaceholder}"
|
|
269
|
-
@nr-input="${this.handleInputChange}"
|
|
270
|
-
?withCopy=${this.showCopyButton}
|
|
274
|
+
@nr-input="${this.handleInputChange}"
|
|
275
|
+
?withCopy=${this.showCopyButton}
|
|
271
276
|
.state="${this.isValidColor?"default":"error"}"
|
|
272
277
|
aria-label="Color value input"
|
|
273
278
|
aria-invalid="${!this.isValidColor}">
|
|
Binary file
|
|
@@ -208,11 +208,12 @@ let ColorPicker = class ColorPicker extends NuralyUIBaseMixin(LitElement) {
|
|
|
208
208
|
[`color-picker-container--${this.size}`]: true,
|
|
209
209
|
};
|
|
210
210
|
return html `
|
|
211
|
-
<div class="${classMap(containerClasses)}" data-theme="${this.currentTheme}">
|
|
211
|
+
<div class="${classMap(containerClasses)}" part="container" data-theme="${this.currentTheme}">
|
|
212
212
|
${this.renderLabel()}
|
|
213
|
-
|
|
213
|
+
|
|
214
214
|
<nr-colorholder-box
|
|
215
215
|
class="color-holder"
|
|
216
|
+
part="trigger"
|
|
216
217
|
color="${this.color}"
|
|
217
218
|
.size=${this.size}
|
|
218
219
|
?disabled="${this.disabled}"
|
|
@@ -242,8 +243,9 @@ let ColorPicker = class ColorPicker extends NuralyUIBaseMixin(LitElement) {
|
|
|
242
243
|
if (!this.show)
|
|
243
244
|
return nothing;
|
|
244
245
|
return html `
|
|
245
|
-
<div
|
|
246
|
+
<div
|
|
246
247
|
class="dropdown-container"
|
|
248
|
+
part="panel"
|
|
247
249
|
role="dialog"
|
|
248
250
|
aria-label="Color picker"
|
|
249
251
|
>
|
|
@@ -261,8 +263,9 @@ let ColorPicker = class ColorPicker extends NuralyUIBaseMixin(LitElement) {
|
|
|
261
263
|
return nothing;
|
|
262
264
|
}
|
|
263
265
|
return html `
|
|
264
|
-
<nr-default-color-sets
|
|
265
|
-
|
|
266
|
+
<nr-default-color-sets
|
|
267
|
+
part="default-colors"
|
|
268
|
+
.defaultColorSets=${this.defaultColorSets}
|
|
266
269
|
@color-click="${this.handleColorChanged}"
|
|
267
270
|
aria-label="Preset colors">
|
|
268
271
|
</nr-default-color-sets>
|
|
@@ -274,6 +277,7 @@ let ColorPicker = class ColorPicker extends NuralyUIBaseMixin(LitElement) {
|
|
|
274
277
|
renderColorPicker() {
|
|
275
278
|
return html `
|
|
276
279
|
<hex-color-picker
|
|
280
|
+
part="picker"
|
|
277
281
|
color="${this.color}"
|
|
278
282
|
@color-changed="${this.handleColorChanged}"
|
|
279
283
|
aria-label="Color gradient picker">
|
|
@@ -287,12 +291,13 @@ let ColorPicker = class ColorPicker extends NuralyUIBaseMixin(LitElement) {
|
|
|
287
291
|
if (!this.showInput)
|
|
288
292
|
return nothing;
|
|
289
293
|
return html `
|
|
290
|
-
<nr-input
|
|
291
|
-
|
|
292
|
-
|
|
294
|
+
<nr-input
|
|
295
|
+
part="input"
|
|
296
|
+
type="text"
|
|
297
|
+
.value="${this.color}"
|
|
293
298
|
placeholder="${this.inputPlaceholder}"
|
|
294
|
-
@nr-input="${this.handleInputChange}"
|
|
295
|
-
?withCopy=${this.showCopyButton}
|
|
299
|
+
@nr-input="${this.handleInputChange}"
|
|
300
|
+
?withCopy=${this.showCopyButton}
|
|
296
301
|
.state="${!this.isValidColor ? "error" /* INPUT_STATE.Error */ : "default" /* INPUT_STATE.Default */}"
|
|
297
302
|
aria-label="Color value input"
|
|
298
303
|
aria-invalid="${!this.isValidColor}">
|