wj-elements 0.1.128 → 0.1.129
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/dark.css +6 -1
- package/dist/{infinite-scroll.element-DcO1E5Es.js → infinite-scroll.element-R3y_ZQj6.js} +42 -14
- package/dist/light.css +5 -0
- package/dist/{list.element-TZXMx1rt.js → list.element-syl98NWS.js} +4 -1
- package/dist/localize.js +4 -3
- package/dist/{popup.element-l8v-dMoK.js → popup.element-C0a1z1y2.js} +191 -78
- package/dist/wje-accordion-item.js +1 -1
- package/dist/wje-animation.js +141 -13
- package/dist/wje-aside.js +1 -1
- package/dist/wje-avatar.js +5 -5
- package/dist/wje-badge.js +1 -1
- package/dist/wje-breadcrumb.js +16 -6
- package/dist/wje-breadcrumbs.js +4 -4
- package/dist/wje-button-group.js +2 -2
- package/dist/wje-button.js +64 -6
- package/dist/wje-card-content.js +1 -1
- package/dist/wje-card-controls.js +1 -1
- package/dist/wje-card-header.js +1 -1
- package/dist/wje-card-subtitle.js +1 -1
- package/dist/wje-card-title.js +1 -1
- package/dist/wje-carousel-item.js +1 -1
- package/dist/wje-carousel.js +1 -1
- package/dist/wje-checkbox.js +14 -11
- package/dist/wje-chip.js +1 -1
- package/dist/wje-col.js +9 -3
- package/dist/wje-color-picker.js +72 -42
- package/dist/wje-container.js +1 -1
- package/dist/wje-copy-button.js +3 -3
- package/dist/wje-dialog.js +89 -0
- package/dist/wje-divider.js +1 -1
- package/dist/wje-dropdown.js +21 -6
- package/dist/wje-element.js +284 -127
- package/dist/wje-fetchAndParseCSS.js +2 -1
- package/dist/wje-file-upload-item.js +5 -2
- package/dist/wje-file-upload.js +57 -13
- package/dist/wje-footer.js +1 -1
- package/dist/wje-form.js +1 -1
- package/dist/wje-format-digital.js +1 -1
- package/dist/wje-grid.js +1 -1
- package/dist/wje-header.js +1 -1
- package/dist/wje-icon-picker.js +6 -3
- package/dist/wje-icon.js +4 -1
- package/dist/wje-img-comparer.js +1 -3
- package/dist/wje-img.js +5 -2
- package/dist/wje-infinite-scroll.js +1 -1
- package/dist/wje-input-file.js +4 -1
- package/dist/wje-input.js +9 -4
- package/dist/wje-item.js +34 -3
- package/dist/wje-kanban.js +16 -31
- package/dist/wje-label.js +1 -10
- package/dist/wje-list.js +1 -1
- package/dist/wje-main.js +1 -1
- package/dist/wje-masonry.js +9 -9
- package/dist/wje-master.js +9 -117
- package/dist/wje-menu-button.js +4 -1
- package/dist/wje-menu-item.js +13 -4
- package/dist/wje-menu-label.js +1 -1
- package/dist/wje-menu.js +4 -1
- package/dist/wje-option.js +8 -4
- package/dist/wje-options.js +25 -11
- package/dist/wje-orgchart-group.js +2 -2
- package/dist/wje-orgchart-item.js +7 -4
- package/dist/wje-orgchart.js +1 -1
- package/dist/wje-popup.js +1 -1
- package/dist/wje-progress-bar.js +6 -2
- package/dist/wje-qr-code.js +2 -2
- package/dist/wje-radio-group.js +4 -1
- package/dist/wje-radio.js +1 -1
- package/dist/wje-rate.js +6 -3
- package/dist/wje-relative-time.js +37 -19
- package/dist/wje-reorder.js +73 -10
- package/dist/wje-route.js +1 -1
- package/dist/wje-router-link.js +1 -2
- package/dist/wje-routerx.js +3 -1
- package/dist/wje-row.js +1 -11
- package/dist/wje-select.js +15 -12
- package/dist/wje-slider.js +7 -4
- package/dist/wje-sliding-container.js +125 -49
- package/dist/wje-split-view.js +10 -2
- package/dist/wje-status.js +1 -1
- package/dist/wje-stepper.js +879 -766
- package/dist/wje-store.js +17 -18
- package/dist/wje-tab-group.js +4 -1
- package/dist/wje-tab-panel.js +1 -1
- package/dist/wje-tab.js +4 -1
- package/dist/wje-textarea.js +8 -2
- package/dist/wje-thumbnail.js +1 -9
- package/dist/wje-toast.js +24 -23
- package/dist/wje-toggle.js +7 -1
- package/dist/wje-toolbar-action.js +1 -1
- package/dist/wje-toolbar.js +1 -1
- package/dist/wje-tooltip.js +5 -1
- package/dist/wje-visually-hidden.js +1 -1
- package/package.json +16 -5
|
@@ -7,7 +7,7 @@ import FormatDigital from "./wje-format-digital.js";
|
|
|
7
7
|
import Button from "./wje-button.js";
|
|
8
8
|
import Slider from "./wje-slider.js";
|
|
9
9
|
import Icon from "./wje-icon.js";
|
|
10
|
-
const styles = '/*\n[ WJ File Upload Item ]\n*/\n\n:host {\n width: 100%;\n}\n\n.native-file-upload-item {\n display: grid;\n grid-template-columns: auto 1fr 1fr;\n grid-template-rows: auto auto auto;\n gap: 0 .5rem;\n grid-template-areas:\n "image name actions"\n "image size actions"\n "progress progress progress";\n padding: .5rem;\n border-width:
|
|
10
|
+
const styles = '/*\n[ WJ File Upload Item ]\n*/\n\n:host {\n width: 100%;\n}\n\n.native-file-upload-item {\n display: grid;\n grid-template-columns: auto 1fr 1fr;\n grid-template-rows: auto auto auto;\n gap: 0 .5rem;\n grid-template-areas:\n "image name actions"\n "image size actions"\n "progress progress progress";\n padding: .5rem;\n border-width: var(--wje-file-upload-item-border-width);\n border-style: var(--wje-file-upload-item-border-style);\n border-color: var(--wje-file-upload-item-border-color);\n border-radius: var(--wje-border-radius-medium);\n}\n\n.image {\n grid-area: image;\n align-items: center;\n display: flex;\n}\n\n::slotted([slot="img"]) {\n --wje-img-border-radius: var(--wje-border-radius-medium) !important;\n}\n\n.name {\n grid-area: name;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n font-weight: bold;\n}\n\n.size {\n grid-area: size;\n display: flex;\n}\n\n.actions {\n grid-area: actions;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n}\n\n.file-progress { grid-area: progress; }\n\n.file-info > span {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\nwje-slider {\n flex-basis: 100%;\n margin-top: .5rem;\n}\n\nwje-slider::part(slider) {\n color: yellow;\n}\n\nwje-slider::part(slider)::-webkit-slider-thumb {\n visibility: hidden;\n}\n\nwje-slider::part(slider)::-moz-range-thumb {\n visibility: hidden;\n}\n\nwje-slider::part(slider)::-ms-thumb {\n visibility: hidden;\n}\n\nwje-img {\n width: 50px;\n height: 50px;\n display: flex;\n align-items: center;\n padding: .25rem;\n border: 1px solid var(--wje-border-color);\n border-radius: var(--wje-border-radius-medium);\n}';
|
|
11
11
|
class FileUploadItem extends WJElement {
|
|
12
12
|
/**
|
|
13
13
|
* Creates an instance of FileUploadItem.
|
|
@@ -80,7 +80,7 @@ class FileUploadItem extends WJElement {
|
|
|
80
80
|
* @param {Object} params - The parameters for the component.
|
|
81
81
|
* @returns {DocumentFragment} The fragment containing the component.
|
|
82
82
|
*/
|
|
83
|
-
draw(
|
|
83
|
+
draw() {
|
|
84
84
|
let fragment = document.createDocumentFragment();
|
|
85
85
|
let native = document.createElement("div");
|
|
86
86
|
native.classList.add("native-file-upload-item");
|
|
@@ -129,6 +129,9 @@ class FileUploadItem extends WJElement {
|
|
|
129
129
|
}
|
|
130
130
|
/**
|
|
131
131
|
* Called after the component has been drawn.
|
|
132
|
+
* @params {Object} context - The context of the component.
|
|
133
|
+
* @params {Object} store - The store of the component.
|
|
134
|
+
* @params {Object} params - The parameters for the component.
|
|
132
135
|
*/
|
|
133
136
|
afterDraw() {
|
|
134
137
|
this.button.addEventListener("wje-button:click", this.onDelete);
|
package/dist/wje-file-upload.js
CHANGED
|
@@ -85,9 +85,9 @@ function upload(url, chunkSize = 1024 * 1024, wholeFile = false) {
|
|
|
85
85
|
if (wholeFile) {
|
|
86
86
|
return (file, preview) => uploadWholeFile(url, file, preview);
|
|
87
87
|
}
|
|
88
|
-
return (file, preview) => uploadFileInChunks(url,
|
|
88
|
+
return (file, preview) => uploadFileInChunks(url, file, preview, chunkSize);
|
|
89
89
|
}
|
|
90
|
-
async function uploadFileInChunks(url, chunkSize = 1024 * 1024
|
|
90
|
+
async function uploadFileInChunks(url, file, preview, chunkSize = 1024 * 1024) {
|
|
91
91
|
let offset = 0;
|
|
92
92
|
const totalChunks = Math.ceil(file.size / chunkSize);
|
|
93
93
|
const partResponses = [];
|
|
@@ -100,7 +100,7 @@ async function uploadFileInChunks(url, chunkSize = 1024 * 1024, file, preview) {
|
|
|
100
100
|
reader.read().then(function process({ done, value }) {
|
|
101
101
|
if (done) {
|
|
102
102
|
controller.close();
|
|
103
|
-
return;
|
|
103
|
+
return Promise.resolve();
|
|
104
104
|
}
|
|
105
105
|
uploadedBytes += value.byteLength;
|
|
106
106
|
const percentComplete = (offset + uploadedBytes) / file.size * 100;
|
|
@@ -150,7 +150,7 @@ function uploadWholeFile(url, file, preview) {
|
|
|
150
150
|
console.error("Error:", error);
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
|
-
const styles = '/*\n[ WJ File Upload ]\n*/\n\n:host {\n width: 100%;\n}\n\n.native-file-upload {\n width: 100%;\n
|
|
153
|
+
const styles = '/*\n[ WJ File Upload ]\n*/\n\n:host {\n width: 100%;\n}\n\n.native-file-upload {\n width: 100%;\n position: relative;\n border: 1px dashed var(--wje-border-color);\n border-radius: var(--wje-border-radius-medium);\n}\n\n.file-label {\n background: var(--wje-color-contrast-0);\n align-items: center;\n justify-content: center;\n display: flex;\n padding: 1rem;\n margin-bottom: .5rem;\n flex-direction: column;\n position: relative;\n}\n\n.file-preview {\n display: grid;\n grid-template-columns: auto 1fr 1fr;\n grid-template-rows: auto auto auto;\n gap: 0 0;\n grid-template-areas:\n "image name name"\n "image size size"\n "progress progress progress";\n}\n\n.file-image {\n grid-area: image;\n align-items: center;\n display: flex;\n}\n\n.file-name {\n grid-area: name;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.file-size {\n grid-area: size;\n display: flex;\n}\n\n.file-progress { grid-area: progress; }\n\nwje-icon {\n margin-right: .25rem;\n}\n\nwje-img {\n margin-right: .25rem;\n}\n\n.file-info > span {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\nwje-slider {\n flex-basis: 100%;\n margin-top: .5rem;\n}\n\n::part(slider) {\n &::-webkit-slider-thumb {\n visibility: hidden;\n }\n\n &::-moz-range-thumb {\n visibility: hidden;\n }\n\n &::-ms-thumb {\n visibility: hidden;\n }\n}\n\nwje-img {\n width: 50px;\n height: 50px;\n display: flex;\n align-items: center;\n padding: .25rem;\n border: 1px solid var(--wje-border-color);\n border-radius: var(--wje-border-radius-medium);\n}';
|
|
154
154
|
class FileUpload extends WJElement {
|
|
155
155
|
/**
|
|
156
156
|
* Constructor for FileUpload.
|
|
@@ -184,9 +184,13 @@ class FileUpload extends WJElement {
|
|
|
184
184
|
try {
|
|
185
185
|
this.handleSubmit(event);
|
|
186
186
|
} catch (err) {
|
|
187
|
-
return;
|
|
188
187
|
}
|
|
189
188
|
});
|
|
189
|
+
/**
|
|
190
|
+
* Method to create an upload promise.
|
|
191
|
+
* @param file
|
|
192
|
+
* @returns {Promise<unknown>}
|
|
193
|
+
*/
|
|
190
194
|
__publicField(this, "createUploadPromise", (file) => {
|
|
191
195
|
return new Promise((resolve, reject) => {
|
|
192
196
|
this.assertFilesValid(file);
|
|
@@ -197,7 +201,7 @@ class FileUpload extends WJElement {
|
|
|
197
201
|
this.dispatchEvent(new CustomEvent("file-upload:upload-started", { detail: file, bubbles: true, composed: true }));
|
|
198
202
|
(_a = this.onUploadStarted) == null ? void 0 : _a.call(this, file);
|
|
199
203
|
preview = this.createPreview(file, reader);
|
|
200
|
-
this.
|
|
204
|
+
this.appendChild(preview);
|
|
201
205
|
this.uploadFunction(file, preview).then((res) => {
|
|
202
206
|
var _a2;
|
|
203
207
|
this.dispatchEvent(new CustomEvent("file-upload:upladed-file-complete", { detail: res, bubbles: true, composed: true }));
|
|
@@ -259,33 +263,61 @@ class FileUpload extends WJElement {
|
|
|
259
263
|
return this.hasAttribute("max-file-size") ? fileSize * 1024 * 1024 : 1024 * 1024;
|
|
260
264
|
}
|
|
261
265
|
/**
|
|
262
|
-
*
|
|
263
|
-
*
|
|
266
|
+
* Setter for label attribute.
|
|
264
267
|
* @param {string} value - The URL to set as the upload URL.
|
|
265
268
|
*/
|
|
266
269
|
set uploadUrl(value) {
|
|
267
270
|
this.setAttribute("upload-url", value);
|
|
268
271
|
}
|
|
269
272
|
/**
|
|
270
|
-
*
|
|
271
|
-
*
|
|
273
|
+
* Gets the upload URL for the file upload element.
|
|
272
274
|
* @returns {string} The upload URL.
|
|
273
275
|
*/
|
|
274
276
|
get uploadUrl() {
|
|
275
277
|
return this.getAttribute("upload-url") ?? "/upload";
|
|
276
278
|
}
|
|
279
|
+
/**
|
|
280
|
+
* Sets the autoProcessFiles attribute.
|
|
281
|
+
* @param value
|
|
282
|
+
*/
|
|
277
283
|
set autoProcessFiles(value) {
|
|
278
284
|
this.setAttribute("auto-process-files", value);
|
|
279
285
|
}
|
|
286
|
+
/**
|
|
287
|
+
* Gets the autoProcessFiles attribute.
|
|
288
|
+
* @returns {any|boolean}
|
|
289
|
+
*/
|
|
280
290
|
get autoProcessFiles() {
|
|
281
291
|
return JSON.parse(this.getAttribute("auto-process-files")) ?? true;
|
|
282
292
|
}
|
|
293
|
+
/**
|
|
294
|
+
* Sets the uploaded files.
|
|
295
|
+
* @param value
|
|
296
|
+
*/
|
|
283
297
|
set uploadedFiles(value) {
|
|
284
298
|
this._uploadedFiles = value;
|
|
285
299
|
}
|
|
300
|
+
/**
|
|
301
|
+
* Return the uploaded files.
|
|
302
|
+
* @returns {[]}
|
|
303
|
+
*/
|
|
286
304
|
get uploadedFiles() {
|
|
287
305
|
return this._uploadedFiles;
|
|
288
306
|
}
|
|
307
|
+
/**
|
|
308
|
+
* Sets the to-chunk attribute.
|
|
309
|
+
* @param value
|
|
310
|
+
*/
|
|
311
|
+
set toChunk(value) {
|
|
312
|
+
this.setAttribute("to-chunk", value);
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Gets the to-chunk attribute.
|
|
316
|
+
* @returns {boolean}
|
|
317
|
+
*/
|
|
318
|
+
get toChunk() {
|
|
319
|
+
return this.hasAttribute("to-chunk");
|
|
320
|
+
}
|
|
289
321
|
/**
|
|
290
322
|
* Getter for cssStyleSheet.
|
|
291
323
|
* @returns {string} The CSS styles for the component.
|
|
@@ -307,7 +339,8 @@ class FileUpload extends WJElement {
|
|
|
307
339
|
this.isShadowRoot = "open";
|
|
308
340
|
}
|
|
309
341
|
beforeDraw() {
|
|
310
|
-
|
|
342
|
+
console.log("beforeDraw", this.toChunk, !this.toChunk);
|
|
343
|
+
this.uploadFunction = upload(this.uploadUrl, this.chunkSize, !this.toChunk);
|
|
311
344
|
}
|
|
312
345
|
/**
|
|
313
346
|
* Method to draw the component.
|
|
@@ -316,12 +349,13 @@ class FileUpload extends WJElement {
|
|
|
316
349
|
* @param {Object} params - The parameters for the component.
|
|
317
350
|
* @returns {DocumentFragment} The fragment containing the component.
|
|
318
351
|
*/
|
|
319
|
-
draw(
|
|
352
|
+
draw() {
|
|
320
353
|
let fragment = document.createDocumentFragment();
|
|
321
354
|
let native = document.createElement("div");
|
|
322
355
|
native.classList.add("native-file-upload");
|
|
323
356
|
native.setAttribute("part", "native");
|
|
324
357
|
let label = document.createElement("div");
|
|
358
|
+
label.setAttribute("part", "label");
|
|
325
359
|
label.classList.add("file-label");
|
|
326
360
|
label.setAttribute("part", "file-label");
|
|
327
361
|
let button = document.createElement("wje-button");
|
|
@@ -334,7 +368,9 @@ class FileUpload extends WJElement {
|
|
|
334
368
|
button.appendChild(slot);
|
|
335
369
|
button.appendChild(fileInput);
|
|
336
370
|
this.fileInput = fileInput;
|
|
337
|
-
let fileList = document.createElement("
|
|
371
|
+
let fileList = document.createElement("slot");
|
|
372
|
+
fileList.setAttribute("name", "item");
|
|
373
|
+
fileList.setAttribute("part", "items");
|
|
338
374
|
fileList.classList.add("file-list");
|
|
339
375
|
label.appendChild(slot);
|
|
340
376
|
label.appendChild(button);
|
|
@@ -349,6 +385,9 @@ class FileUpload extends WJElement {
|
|
|
349
385
|
}
|
|
350
386
|
/**
|
|
351
387
|
* Method to perform actions after the component is drawn.
|
|
388
|
+
* @params {Object} context - The context to draw in.
|
|
389
|
+
* @params {Object} store - The store to use.
|
|
390
|
+
* @params {Object} params - The parameters to use.
|
|
352
391
|
*/
|
|
353
392
|
afterDraw() {
|
|
354
393
|
this.button.addEventListener("click", () => {
|
|
@@ -392,6 +431,10 @@ class FileUpload extends WJElement {
|
|
|
392
431
|
event.preventDefault();
|
|
393
432
|
this.addFilesToQueue(this.fileInput.files);
|
|
394
433
|
}
|
|
434
|
+
/**
|
|
435
|
+
* Method to add files to the queue.
|
|
436
|
+
* @param files
|
|
437
|
+
*/
|
|
395
438
|
addFilesToQueue(files) {
|
|
396
439
|
var _a;
|
|
397
440
|
this._queuedFiles = [...files];
|
|
@@ -429,6 +472,7 @@ class FileUpload extends WJElement {
|
|
|
429
472
|
*/
|
|
430
473
|
createPreview(file, reader) {
|
|
431
474
|
let preview = document.createElement("wje-file-upload-item");
|
|
475
|
+
preview.setAttribute("slot", "item");
|
|
432
476
|
preview.setAttribute("name", file.name);
|
|
433
477
|
preview.setAttribute("size", file.size);
|
|
434
478
|
preview.setAttribute("uploaded", "0");
|
package/dist/wje-footer.js
CHANGED
|
@@ -45,7 +45,7 @@ class Footer extends WJElement {
|
|
|
45
45
|
* @param {Object} params - The parameters for drawing.
|
|
46
46
|
* @returns {DocumentFragment}
|
|
47
47
|
*/
|
|
48
|
-
draw(
|
|
48
|
+
draw() {
|
|
49
49
|
let fragment = document.createDocumentFragment();
|
|
50
50
|
let element = document.createElement("slot");
|
|
51
51
|
fragment.appendChild(element);
|
package/dist/wje-form.js
CHANGED
|
@@ -17,7 +17,7 @@ class Form extends WJElement {
|
|
|
17
17
|
setupAttributes() {
|
|
18
18
|
this.isShadowRoot = "open";
|
|
19
19
|
}
|
|
20
|
-
draw(
|
|
20
|
+
draw() {
|
|
21
21
|
let fragment = document.createDocumentFragment();
|
|
22
22
|
let element = document.createElement("slot");
|
|
23
23
|
fragment.appendChild(element);
|
|
@@ -72,7 +72,7 @@ class FormatDigital extends WJElement {
|
|
|
72
72
|
* @param {Object} params - The parameters for drawing.
|
|
73
73
|
* @returns {DocumentFragment}
|
|
74
74
|
*/
|
|
75
|
-
draw(
|
|
75
|
+
draw() {
|
|
76
76
|
let fragment = document.createDocumentFragment();
|
|
77
77
|
let element = document.createElement("div");
|
|
78
78
|
element.setAttribute("part", "native");
|
package/dist/wje-grid.js
CHANGED
package/dist/wje-header.js
CHANGED
|
@@ -45,7 +45,7 @@ class Header extends WJElement {
|
|
|
45
45
|
* @param {Object} params - The parameters for drawing.
|
|
46
46
|
* @returns {DocumentFragment}
|
|
47
47
|
*/
|
|
48
|
-
draw(
|
|
48
|
+
draw() {
|
|
49
49
|
let fragment = document.createDocumentFragment();
|
|
50
50
|
let element = document.createElement("header");
|
|
51
51
|
element.classList.add("native-header");
|
package/dist/wje-icon-picker.js
CHANGED
|
@@ -6,8 +6,8 @@ import "./wje-infinite-scroll.js";
|
|
|
6
6
|
import Input from "./wje-input.js";
|
|
7
7
|
import Tooltip from "./wje-tooltip.js";
|
|
8
8
|
import "./wje-popup.js";
|
|
9
|
-
import { I as InfiniteScroll } from "./infinite-scroll.element-
|
|
10
|
-
import { P as Popup } from "./popup.element-
|
|
9
|
+
import { I as InfiniteScroll } from "./infinite-scroll.element-R3y_ZQj6.js";
|
|
10
|
+
import { P as Popup } from "./popup.element-C0a1z1y2.js";
|
|
11
11
|
const styles = "/*\n[ Wj Icon Picker ]\n*/\n\n:host {\n --wje-icon-picker-radius: var(--wje-border-radius-small);\n --wje-icon-picker-icon-size: 1.5rem;\n --wje-icon-picker-border-width: 1px;\n --wje-icon-picker-border-style: solid;\n --wje-icon-picker-border-color: var(--wje-border-color);\n --wje-icon-picker-padding: .25rem;\n padding: 0 1rem;\n}\n\n.anchor {\n width: var(--wje-icon-picker-icon-size);\n height: var(--wje-icon-picker-icon-size);\n padding: var(--wje-icon-picker-padding);\n border-width: var(--wje-icon-picker-border-width);\n border-style: var(--wje-icon-picker-border-style);\n border-color: var(--wje-icon-picker-border-color);\n box-sizing: border-box;\n border-radius: var(--wje-icon-picker-radius);\n}\n\n.picker {\n width: 320px;\n height: 271px;\n box-shadow: 0 0 5px rgba(0,0,0,.05), 0 5px 20px rgba(0,0,0,.1);\n border-radius: var(--wje-icon-picker-radius);\n border-width: var(--wje-icon-picker-border-width);\n border-style: var(--wje-icon-picker-border-style);\n border-color: var(--wje-icon-picker-border-color);\n overflow: auto;\n padding: 1rem;\n background: var(--wje-background);\n}\n\n.icon-items {\n --icon-min-width: 2rem;\n display: grid;\n grid-gap: .5rem;\n grid-template-columns: repeat(auto-fit,minmax(var(--icon-min-width),1fr));\n}\n\n.icon-item {\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n color: inherit;\n padding: .25rem;\n min-height: var(--wje-icon-picker-icon-size);\n min-width: var(--wje-icon-picker-icon-size);\n text-decoration: none;\n\n &:hover {\n border-radius: .25rem;\n background: var(--wje-border-color);\n }\n}\n\n.wje-size {\n --wje-icon-size: 24px !important;\n}\n\nicon-item svg {\n width: var(--wje-icon-picker-icon-size);\n height: var(--wje-icon-picker-icon-size);\n}\n\nwje-input {\n --wje-input-border-radius: 4px;\n --wje-input-margin-bottom: 0;\n}\n\nwje-infinite-scroll {\n margin-top: 1rem;\n}\n\nwje-select {\n --wje-select-border-width: 0 0 1px 0 !important;\n --wje-select-border-radius: 0 !important;\n margin-bottom: 1rem;\n}\n\n.anchor wje-icon {\n --wje-icon-size: 100% !important;\n}";
|
|
12
12
|
class IconPicker extends WJElement {
|
|
13
13
|
/**
|
|
@@ -141,7 +141,7 @@ class IconPicker extends WJElement {
|
|
|
141
141
|
* @param {Object} params - The parameters for drawing.
|
|
142
142
|
* @returns {DocumentFragment}
|
|
143
143
|
*/
|
|
144
|
-
draw(
|
|
144
|
+
draw() {
|
|
145
145
|
let fragment = document.createDocumentFragment();
|
|
146
146
|
let native = document.createElement("div");
|
|
147
147
|
native.classList.add("native-color-picker");
|
|
@@ -193,6 +193,9 @@ class IconPicker extends WJElement {
|
|
|
193
193
|
}
|
|
194
194
|
/**
|
|
195
195
|
* Called after the component has been drawn.
|
|
196
|
+
* @params {Object} context - The context for drawing.
|
|
197
|
+
* @params {Object} store - The store for drawing.
|
|
198
|
+
* @params {Object} params - The parameters for drawing.
|
|
196
199
|
*/
|
|
197
200
|
afterDraw() {
|
|
198
201
|
this.addEventListener("wje-popup:show", (e) => {
|
package/dist/wje-icon.js
CHANGED
|
@@ -73,7 +73,7 @@ const getSvgContent = (url, sanitize) => {
|
|
|
73
73
|
iconContent.set(url, svgContent || "");
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
|
-
iconContent.set(url, "");
|
|
76
|
+
return iconContent.set(url, "");
|
|
77
77
|
});
|
|
78
78
|
requests.set(url, req);
|
|
79
79
|
}
|
|
@@ -166,6 +166,9 @@ class Icon extends WJElement {
|
|
|
166
166
|
}
|
|
167
167
|
/**
|
|
168
168
|
* Called after the component has been drawn.
|
|
169
|
+
* @params {Object} context - The context for drawing.
|
|
170
|
+
* @params {Object} store - The store for drawing.
|
|
171
|
+
* @params {Object} params - The parameters for drawing.
|
|
169
172
|
*/
|
|
170
173
|
afterDraw() {
|
|
171
174
|
let lazyImageObserver = new IntersectionObserver((entries, observer) => {
|
package/dist/wje-img-comparer.js
CHANGED
|
@@ -48,7 +48,6 @@ class ImgComparer extends WJElement {
|
|
|
48
48
|
__publicField(this, "className", "ImgComparer");
|
|
49
49
|
/**
|
|
50
50
|
* Handles the drag event.
|
|
51
|
-
*
|
|
52
51
|
* @param {Event} e - The event.
|
|
53
52
|
*/
|
|
54
53
|
__publicField(this, "handleDrag", (e) => {
|
|
@@ -65,7 +64,6 @@ class ImgComparer extends WJElement {
|
|
|
65
64
|
});
|
|
66
65
|
/**
|
|
67
66
|
* Clamps a number between a minimum and maximum value.
|
|
68
|
-
*
|
|
69
67
|
* @param {number} num - The number to clamp.
|
|
70
68
|
* @param {number} min - The minimum value.
|
|
71
69
|
* @param {number} max - The maximum value.
|
|
@@ -105,7 +103,7 @@ class ImgComparer extends WJElement {
|
|
|
105
103
|
* @param {Object} params - The parameters for drawing.
|
|
106
104
|
* @returns {DocumentFragment}
|
|
107
105
|
*/
|
|
108
|
-
draw(
|
|
106
|
+
draw() {
|
|
109
107
|
let fragment = document.createDocumentFragment();
|
|
110
108
|
let native = document.createElement("div");
|
|
111
109
|
native.classList.add("native-split-view");
|
package/dist/wje-img.js
CHANGED
|
@@ -44,7 +44,7 @@ class Img extends WJElement {
|
|
|
44
44
|
* @param {Object} params - The parameters for drawing.
|
|
45
45
|
* @returns {DocumentFragment}
|
|
46
46
|
*/
|
|
47
|
-
draw(
|
|
47
|
+
draw() {
|
|
48
48
|
let fragment = document.createDocumentFragment();
|
|
49
49
|
let native = document.createElement("img");
|
|
50
50
|
native.setAttribute("part", "native");
|
|
@@ -57,8 +57,11 @@ class Img extends WJElement {
|
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
59
|
* Called after the component has been drawn.
|
|
60
|
+
* @params {Object} context - The context for drawing.
|
|
61
|
+
* @params {Object} store - The store for drawing.
|
|
62
|
+
* @params {Object} params - The parameters for drawing.
|
|
60
63
|
*/
|
|
61
|
-
afterDraw(
|
|
64
|
+
afterDraw() {
|
|
62
65
|
let lazyImageObserver = new IntersectionObserver((entries, observer) => {
|
|
63
66
|
entries.forEach((entry) => {
|
|
64
67
|
if (entry.isIntersecting) {
|
package/dist/wje-input-file.js
CHANGED
|
@@ -53,7 +53,7 @@ class InputFile extends WJElement {
|
|
|
53
53
|
* @param {Object} params - The parameters
|
|
54
54
|
* @returns {Object} Document fragment
|
|
55
55
|
*/
|
|
56
|
-
draw(
|
|
56
|
+
draw() {
|
|
57
57
|
let fragment = document.createDocumentFragment();
|
|
58
58
|
let native = document.createElement("div");
|
|
59
59
|
native.setAttribute("part", "native");
|
|
@@ -84,6 +84,9 @@ class InputFile extends WJElement {
|
|
|
84
84
|
}
|
|
85
85
|
/**
|
|
86
86
|
* @summary After draw method
|
|
87
|
+
* @params {Object} context - The context
|
|
88
|
+
* @params {Object} store - The store
|
|
89
|
+
* @params {Object} params - The parameters
|
|
87
90
|
*/
|
|
88
91
|
afterDraw() {
|
|
89
92
|
this.input.addEventListener("click", () => {
|
package/dist/wje-input.js
CHANGED
|
@@ -75,7 +75,10 @@ class Input extends WJElement {
|
|
|
75
75
|
* @param {boolean} isInvalid - Whether the input is invalid.
|
|
76
76
|
*/
|
|
77
77
|
set invalid(isInvalid) {
|
|
78
|
-
|
|
78
|
+
if (isInvalid)
|
|
79
|
+
this.setAttribute("invalid", "");
|
|
80
|
+
else
|
|
81
|
+
this.removeAttribute("invalid");
|
|
79
82
|
}
|
|
80
83
|
/**
|
|
81
84
|
* Getter for the form attribute.
|
|
@@ -150,7 +153,6 @@ class Input extends WJElement {
|
|
|
150
153
|
* @returns {Array} The attributes to observe for changes.
|
|
151
154
|
*/
|
|
152
155
|
static get observedAttributes() {
|
|
153
|
-
return;
|
|
154
156
|
}
|
|
155
157
|
/**
|
|
156
158
|
* Sets up the attributes for the input.
|
|
@@ -172,7 +174,7 @@ class Input extends WJElement {
|
|
|
172
174
|
* @param {Object} params - The parameters to use.
|
|
173
175
|
* @returns {DocumentFragment} The drawn input.
|
|
174
176
|
*/
|
|
175
|
-
draw(
|
|
177
|
+
draw() {
|
|
176
178
|
let hasSlotStart = this.hasSlot(this, "start");
|
|
177
179
|
let hasSlotEnd = this.hasSlot(this, "end");
|
|
178
180
|
let hasSlotError = this.hasSlot(this, "error");
|
|
@@ -266,6 +268,9 @@ class Input extends WJElement {
|
|
|
266
268
|
}
|
|
267
269
|
/**
|
|
268
270
|
* Runs after the input is drawn.
|
|
271
|
+
* @params {Object} context - The context for drawing.
|
|
272
|
+
* @params {Object} store - The store for drawing.
|
|
273
|
+
* @params {Object} params - The parameters for drawing.
|
|
269
274
|
*/
|
|
270
275
|
afterDraw() {
|
|
271
276
|
this.input.addEventListener("focus", (e) => {
|
|
@@ -447,7 +452,7 @@ class Input extends WJElement {
|
|
|
447
452
|
formDisabledCallback(disabled) {
|
|
448
453
|
console.warn("formDisabledCallback not implemented yet");
|
|
449
454
|
}
|
|
450
|
-
dispatchEvent(
|
|
455
|
+
dispatchEvent(e) {
|
|
451
456
|
return false;
|
|
452
457
|
}
|
|
453
458
|
}
|
package/dist/wje-item.js
CHANGED
|
@@ -4,9 +4,23 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4
4
|
import WJElement from "./wje-element.js";
|
|
5
5
|
const styles = '/*\n[ WJ Item ]\n*/\n\n:host {\n display: block;\n position: relative;\n align-items: center;\n justify-content: space-between;\n outline: none;\n color: var(--wje-item-color);\n text-align: initial;\n text-decoration: none;\n overflow: hidden;\n box-sizing: border-box;\n width: 100%;\n}\n\n.item-native {\n border-radius: var(--wje-item-border-radius);\n padding-top: var(--wje-item-padding-top);\n padding-bottom: var(--wje-item-padding-bottom);\n padding-inline: var(--wje-item-padding-start) var(--wje-item-padding-end);\n margin: 0;\n display: flex;\n position: relative;\n align-items: inherit;\n justify-content: inherit;\n width: 100%;\n min-height: var(--wje-item-min-height);\n transition: var(--wje-item-transition);\n outline: none;\n background: var(--wje-item-background);\n overflow: inherit;\n box-sizing: border-box;\n z-index: 1;\n text-decoration: none;\n color: var(--wje-item-color);\n\n .item-inner {\n margin: 0;\n padding: var(--wje-item-inner-padding-top) var(--wje-item-inner-padding-end) var(--wje-item-inner-padding-bottom) var(--wje-item-inner-padding-start);\n\n display: flex;\n position: relative;\n\n flex: 1 1 0;\n flex-direction: inherit;\n align-items: inherit;\n align-self: stretch;\n\n min-height: inherit;\n\n border-width: var(--wje-item-border-width);\n border-style: var(--wje-item-border-style);\n border-color: var(--wje-item-border-color);\n\n box-shadow: var(--wje-item-inner-box-shadow);\n overflow: inherit;\n box-sizing: border-box;\n\n .input-wrapper {\n display: flex;\n flex: 1 1 0;\n flex-direction: inherit;\n align-items: inherit;\n align-self: stretch;\n text-overflow: ellipsis;\n overflow: inherit;\n box-sizing: border-box;\n }\n }\n\n .item-bottom {\n padding: 0 var(--wje-item-inner-padding-end) 0 var(--wje-item-padding-start);\n display: flex;\n justify-content: space-between;\n }\n}\n\n@media (any-hover: hover) {\n :host(:hover) .item-native {\n color: var(--wje-item-color);\n\n :after {\n transition: var(--wje-item-transition);\n z-index: -1;\n inset: 0;\n position: absolute;\n content: "";\n background: var(--wje-item-background-hover);\n opacity: 0.7;\n }\n }\n}\n\nbutton,\na {\n cursor: pointer;\n user-select: none;\n -webkit-user-drag: none;\n}\n\n::slotted([slot="start"]) {\n margin-inline: 0 1rem;\n}\n\n::slotted(wje-label:not([slot="end"])) {\n flex: 1 1 0;\n}';
|
|
6
6
|
class Item extends WJElement {
|
|
7
|
+
/**
|
|
8
|
+
* @constructor
|
|
9
|
+
* @summary Item constructor
|
|
10
|
+
*/
|
|
7
11
|
constructor() {
|
|
8
12
|
super();
|
|
13
|
+
/**
|
|
14
|
+
* @summary Class name
|
|
15
|
+
* @type {string}
|
|
16
|
+
*/
|
|
9
17
|
__publicField(this, "className", "Item");
|
|
18
|
+
/**
|
|
19
|
+
* Returns the list of attributes to observe for changes.
|
|
20
|
+
* @param selector
|
|
21
|
+
* @param el
|
|
22
|
+
* @returns {boolean}
|
|
23
|
+
*/
|
|
10
24
|
__publicField(this, "hostContext", (selector, el) => {
|
|
11
25
|
return el.closest(selector) !== null;
|
|
12
26
|
});
|
|
@@ -22,18 +36,35 @@ class Item extends WJElement {
|
|
|
22
36
|
this.routerDirection = "forward";
|
|
23
37
|
this.type = "button";
|
|
24
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Returns the CSS styles for the component.
|
|
41
|
+
* @returns {boolean}
|
|
42
|
+
*/
|
|
25
43
|
isClickable() {
|
|
26
44
|
return this.hasAttribute("href") || this.button;
|
|
27
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* @summary Get CSS stylesheet
|
|
48
|
+
* @static
|
|
49
|
+
* @returns {Object} styles
|
|
50
|
+
*/
|
|
28
51
|
static get cssStyleSheet() {
|
|
29
52
|
return styles;
|
|
30
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* @summary Setup attributes
|
|
56
|
+
*/
|
|
31
57
|
setupAttributes() {
|
|
32
58
|
this.isShadowRoot = "open";
|
|
33
59
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
60
|
+
/**
|
|
61
|
+
* Draws the component.
|
|
62
|
+
* @param {Object} context - The context for drawing.
|
|
63
|
+
* @param {Object} store - The store for drawing.
|
|
64
|
+
* @param {Object} params - The parameters for drawing.
|
|
65
|
+
* @returns {DocumentFragment}
|
|
66
|
+
*/
|
|
67
|
+
draw() {
|
|
37
68
|
const TagType = this.isClickable() ? this.hasAttribute("href") === void 0 ? "button" : "a" : "div";
|
|
38
69
|
if (this.hostContext("wje-list", this)) {
|
|
39
70
|
this.classList.add("wje-item-list");
|
package/dist/wje-kanban.js
CHANGED
|
@@ -158,21 +158,6 @@ class Kanban extends WJElement {
|
|
|
158
158
|
get response() {
|
|
159
159
|
return this._response;
|
|
160
160
|
}
|
|
161
|
-
// /**
|
|
162
|
-
// * Sets the URL for fetching data.
|
|
163
|
-
// * @param value {string}
|
|
164
|
-
// */
|
|
165
|
-
// set poolName(value) {
|
|
166
|
-
// this.setAttribute("pool-name", value);
|
|
167
|
-
// }
|
|
168
|
-
//
|
|
169
|
-
// /**
|
|
170
|
-
// * Gets the URL for fetching data.
|
|
171
|
-
// * @returns {string|string}
|
|
172
|
-
// */
|
|
173
|
-
// get poolName() {
|
|
174
|
-
// return this.getAttribute("pool-name") || "status";
|
|
175
|
-
// }
|
|
176
161
|
/**
|
|
177
162
|
* Sets the URL for fetching data.
|
|
178
163
|
* @param value {array}
|
|
@@ -229,7 +214,7 @@ class Kanban extends WJElement {
|
|
|
229
214
|
* @param {Object} params - The parameters for drawing.
|
|
230
215
|
* @returns {DocumentFragment}
|
|
231
216
|
*/
|
|
232
|
-
draw(
|
|
217
|
+
draw() {
|
|
233
218
|
let fragment = document.createDocumentFragment();
|
|
234
219
|
let native = document.createElement("div");
|
|
235
220
|
native.classList.add("native");
|
|
@@ -249,8 +234,8 @@ class Kanban extends WJElement {
|
|
|
249
234
|
/**
|
|
250
235
|
* Called after the component has been drawn.
|
|
251
236
|
*/
|
|
252
|
-
|
|
253
|
-
this.
|
|
237
|
+
afterDraw() {
|
|
238
|
+
this.ui = {
|
|
254
239
|
elBoard: this.shadowRoot.getElementById("board"),
|
|
255
240
|
elTotalCardCount: this.shadowRoot.getElementById("totalCards"),
|
|
256
241
|
elCardPlaceholder: null
|
|
@@ -275,10 +260,10 @@ class Kanban extends WJElement {
|
|
|
275
260
|
});
|
|
276
261
|
this.live("dragend", ".pool .card", (e) => {
|
|
277
262
|
e.target.style.opacity = "";
|
|
278
|
-
if (this.
|
|
279
|
-
this.
|
|
263
|
+
if (this.ui.elCardPlaceholder) {
|
|
264
|
+
this.ui.elCardPlaceholder.remove();
|
|
280
265
|
}
|
|
281
|
-
this.
|
|
266
|
+
this.ui.elCardPlaceholder = null;
|
|
282
267
|
this.isDragging = false;
|
|
283
268
|
});
|
|
284
269
|
this.live("dragover", ".pool, .pool .card, .pool .card-placeholder", (e) => {
|
|
@@ -398,16 +383,16 @@ class Kanban extends WJElement {
|
|
|
398
383
|
* @returns {null|*}
|
|
399
384
|
*/
|
|
400
385
|
getCardPlaceholder() {
|
|
401
|
-
if (!this.
|
|
402
|
-
this.
|
|
403
|
-
this.
|
|
404
|
-
this.
|
|
405
|
-
this.
|
|
386
|
+
if (!this.ui.elCardPlaceholder) {
|
|
387
|
+
this.ui.elCardPlaceholder = document.createElement("div");
|
|
388
|
+
this.ui.elCardPlaceholder.className = "card-placeholder";
|
|
389
|
+
this.ui.elCardPlaceholder.style.width = this.draggedElementWidth + "px";
|
|
390
|
+
this.ui.elCardPlaceholder.style.height = this.draggedElementHeight + "px";
|
|
406
391
|
} else {
|
|
407
|
-
this.
|
|
408
|
-
this.
|
|
392
|
+
this.ui.elCardPlaceholder.style.width = this.draggedElementWidth + "px";
|
|
393
|
+
this.ui.elCardPlaceholder.style.height = this.draggedElementHeight + "px";
|
|
409
394
|
}
|
|
410
|
-
return this.
|
|
395
|
+
return this.ui.elCardPlaceholder;
|
|
411
396
|
}
|
|
412
397
|
/**
|
|
413
398
|
* Adds a live event listener to the component.
|
|
@@ -417,7 +402,7 @@ class Kanban extends WJElement {
|
|
|
417
402
|
*/
|
|
418
403
|
live(eventType, selector, callback) {
|
|
419
404
|
const attachListener = (root) => {
|
|
420
|
-
root.addEventListener(eventType,
|
|
405
|
+
root.addEventListener(eventType, (e) => {
|
|
421
406
|
if (e.target.matches(selector)) {
|
|
422
407
|
callback.call(e.target, e);
|
|
423
408
|
}
|
|
@@ -425,7 +410,7 @@ class Kanban extends WJElement {
|
|
|
425
410
|
};
|
|
426
411
|
const traverseAndAttach = (root) => {
|
|
427
412
|
attachListener(root);
|
|
428
|
-
root.querySelectorAll("*").forEach(
|
|
413
|
+
root.querySelectorAll("*").forEach((node) => {
|
|
429
414
|
if (node.shadowRoot) {
|
|
430
415
|
traverseAndAttach(node.shadowRoot);
|
|
431
416
|
}
|
package/dist/wje-label.js
CHANGED
|
@@ -37,15 +37,6 @@ class Label extends WJElement {
|
|
|
37
37
|
setupAttributes() {
|
|
38
38
|
this.isShadowRoot = "open";
|
|
39
39
|
}
|
|
40
|
-
/**
|
|
41
|
-
* Prepares the component before drawing.
|
|
42
|
-
*
|
|
43
|
-
* @param {Object} context - The context for drawing.
|
|
44
|
-
* @param {Object} store - The store for drawing.
|
|
45
|
-
* @param {Object} params - The parameters for drawing.
|
|
46
|
-
*/
|
|
47
|
-
beforeDraw(context, store, params) {
|
|
48
|
-
}
|
|
49
40
|
/**
|
|
50
41
|
* Draws the component.
|
|
51
42
|
*
|
|
@@ -54,7 +45,7 @@ class Label extends WJElement {
|
|
|
54
45
|
* @param {Object} params - The parameters for drawing.
|
|
55
46
|
* @returns {DocumentFragment}
|
|
56
47
|
*/
|
|
57
|
-
draw(
|
|
48
|
+
draw() {
|
|
58
49
|
let fragment = document.createDocumentFragment();
|
|
59
50
|
if (this.color)
|
|
60
51
|
this.classList.add("wje-color-" + params.color, "wje-color");
|
package/dist/wje-list.js
CHANGED