@nanoporetech-digital/components 8.0.0-alpha.2 → 8.0.0-alpha.3
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/cjs/{fade-C3xL9ihU.js → fade-CqKYrZYq.js} +1 -1
- package/dist/cjs/{fullscreen-pHBD1-3e.js → fullscreen-D-fHJ_IJ.js} +1 -1
- package/dist/cjs/index-IR1lkhwT.js +4 -4
- package/dist/cjs/{lazyload-D2pj9J7r.js → lazyload-DK1ITMfR.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/nano-avatar_5.cjs.entry.js +7 -7
- package/dist/cjs/nano-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/nano-collapsible-comparison.cjs.entry.js +1 -1
- package/dist/cjs/nano-components.cjs.js +1 -1
- package/dist/cjs/nano-cta.cjs.entry.js +2 -1
- package/dist/cjs/{nano-data-table-BkyqQiTG.js → nano-data-table-C_KLyFMO.js} +6 -3
- package/dist/cjs/nano-data-table.cjs.entry.js +1 -1
- package/dist/cjs/nano-datalist_3.cjs.entry.js +8 -8
- package/dist/cjs/nano-file-upload.cjs.entry.js +48 -29
- package/dist/cjs/nano-footer.cjs.entry.js +3 -3
- package/dist/cjs/nano-global-nav.cjs.entry.js +1 -1
- package/dist/cjs/nano-icon_3.cjs.entry.js +2 -2
- package/dist/cjs/nano-progress-bar.cjs.entry.js +3 -17
- package/dist/cjs/nano-rating.cjs.entry.js +4 -4
- package/dist/cjs/nano-resize-observe_2.cjs.entry.js +3 -3
- package/dist/cjs/nano-slide.cjs.entry.js +1 -1
- package/dist/cjs/{nano-slides-B3-XISfn.js → nano-slides-BhpvytBB.js} +7 -7
- package/dist/cjs/nano-slides.cjs.entry.js +1 -1
- package/dist/cjs/nano-sortable.cjs.entry.js +1 -1
- package/dist/cjs/nano-spinner.cjs.entry.js +1 -1
- package/dist/cjs/nano-sticker.cjs.entry.js +2 -2
- package/dist/cjs/nano-tab-content.cjs.entry.js +2 -2
- package/dist/cjs/nano-tab.cjs.entry.js +2 -2
- package/dist/cjs/nano-table.cjs.entry.js +2 -2
- package/dist/cjs/{page-dots-DHz-mQDL.js → page-dots-DeSuT5bE.js} +1 -1
- package/dist/cjs/{style-BccHkuhC.js → style-Bf3iH5GX.js} +16 -2
- package/dist/cjs/{table.worker-NnDnfSFs.js → table.worker-C5ofbi7M.js} +1 -1
- package/dist/collection/components/cta/cta.js +2 -1
- package/dist/collection/components/data-table/table.js +5 -2
- package/dist/collection/components/datalist/datalist.js +6 -6
- package/dist/collection/components/file-upload/file-upload.css +140 -215
- package/dist/collection/components/file-upload/file-upload.js +66 -44
- package/dist/collection/components/footer/footer.css +2 -3
- package/dist/collection/components/footer/footer.js +4 -3
- package/dist/collection/components/progress-bar/progress-bar.css +78 -33
- package/dist/collection/components/progress-bar/progress-bar.js +18 -61
- package/dist/collection/components/rating/rating.js +4 -4
- package/dist/collection/components/resize-observe/resize-observe.js +1 -1
- package/dist/collection/components/select/select.js +7 -7
- package/dist/collection/components/skeleton/skeleton.js +2 -2
- package/dist/collection/components/slides/slide.js +1 -1
- package/dist/collection/components/slides/slides.js +3 -3
- package/dist/collection/components/sortable/sortable.js +1 -1
- package/dist/collection/components/spinner/spinner.js +1 -1
- package/dist/collection/components/sticker/sticker.js +2 -2
- package/dist/collection/components/table/table.js +2 -2
- package/dist/collection/components/tabs/tab-content.js +2 -2
- package/dist/collection/components/tabs/tab.js +2 -2
- package/dist/collection/components/tag/tag.js +2 -2
- package/dist/collection/components/tooltip/tooltip.js +2 -2
- package/dist/collection/utils/style.js +16 -2
- package/dist/components/cta.js +2 -1
- package/dist/components/datalist.js +6 -6
- package/dist/components/nano-data-table.js +5 -2
- package/dist/components/nano-file-upload.js +58 -33
- package/dist/components/nano-footer.js +5 -4
- package/dist/components/nano-rating.js +4 -4
- package/dist/components/nano-slide.js +1 -1
- package/dist/components/nano-sortable.js +1 -1
- package/dist/components/nano-tab-content.js +2 -2
- package/dist/components/nano-tab.js +2 -2
- package/dist/components/nano-table.js +2 -2
- package/dist/components/progress-bar.js +7 -23
- package/dist/components/resize-observe.js +1 -1
- package/dist/components/select.js +7 -7
- package/dist/components/skeleton.js +2 -2
- package/dist/components/slides.js +3 -3
- package/dist/components/spinner.js +1 -1
- package/dist/components/sticker.js +2 -2
- package/dist/components/style.js +16 -2
- package/dist/components/tag.js +2 -2
- package/dist/components/tooltip.js +2 -2
- package/dist/esm/{fade-BTgTGh6q.js → fade-CnaZvOTY.js} +1 -1
- package/dist/esm/{fullscreen-BTpZyXkc.js → fullscreen-BIFliVxG.js} +1 -1
- package/dist/esm/index-DXvE-U_j.js +4 -4
- package/dist/esm/{lazyload-BYoZ43fz.js → lazyload-D_Ju_KaC.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/nano-avatar_5.entry.js +7 -7
- package/dist/esm/nano-breadcrumb.entry.js +1 -1
- package/dist/esm/nano-collapsible-comparison.entry.js +1 -1
- package/dist/esm/nano-components.js +1 -1
- package/dist/esm/nano-cta.entry.js +2 -1
- package/dist/esm/{nano-data-table-DDBCyBmN.js → nano-data-table-CJbVKIuu.js} +6 -3
- package/dist/esm/nano-data-table.entry.js +1 -1
- package/dist/esm/nano-datalist_3.entry.js +8 -8
- package/dist/esm/nano-file-upload.entry.js +48 -29
- package/dist/esm/nano-footer.entry.js +4 -4
- package/dist/esm/nano-global-nav.entry.js +1 -1
- package/dist/esm/nano-icon_3.entry.js +2 -2
- package/dist/esm/nano-progress-bar.entry.js +4 -18
- package/dist/esm/nano-rating.entry.js +4 -4
- package/dist/esm/nano-resize-observe_2.entry.js +3 -3
- package/dist/esm/nano-slide.entry.js +1 -1
- package/dist/esm/{nano-slides-CvZxKg4X.js → nano-slides-B9KjZVqC.js} +7 -7
- package/dist/esm/nano-slides.entry.js +1 -1
- package/dist/esm/nano-sortable.entry.js +1 -1
- package/dist/esm/nano-spinner.entry.js +1 -1
- package/dist/esm/nano-sticker.entry.js +2 -2
- package/dist/esm/nano-tab-content.entry.js +2 -2
- package/dist/esm/nano-tab.entry.js +2 -2
- package/dist/esm/nano-table.entry.js +2 -2
- package/dist/esm/{page-dots-_tkpExQM.js → page-dots-BmS6HUrx.js} +1 -1
- package/dist/esm/{style-BrRDhFfF.js → style-xLaX004n.js} +16 -2
- package/dist/esm/{table.worker-webIEBZt.js → table.worker-CsTdjWrS.js} +1 -1
- package/dist/nano-components/{fade-BTgTGh6q.js → fade-CnaZvOTY.js} +1 -1
- package/dist/nano-components/{fullscreen-BTpZyXkc.js → fullscreen-BIFliVxG.js} +1 -1
- package/dist/nano-components/{lazyload-BYoZ43fz.js → lazyload-D_Ju_KaC.js} +1 -1
- package/dist/nano-components/nano-avatar_5.entry.js +1 -1
- package/dist/nano-components/nano-breadcrumb.entry.js +1 -1
- package/dist/nano-components/nano-collapsible-comparison.entry.js +1 -1
- package/dist/nano-components/nano-components.css +23 -19
- package/dist/nano-components/nano-components.esm.js +1 -1
- package/dist/nano-components/nano-cta.entry.js +1 -1
- package/dist/nano-components/{nano-data-table-DDBCyBmN.js → nano-data-table-CJbVKIuu.js} +1 -1
- package/dist/nano-components/nano-data-table.entry.js +1 -1
- package/dist/nano-components/nano-datalist_3.entry.js +1 -1
- package/dist/nano-components/nano-file-upload.entry.js +1 -1
- package/dist/nano-components/nano-footer.entry.js +1 -1
- package/dist/nano-components/nano-global-nav.entry.js +1 -1
- package/dist/nano-components/nano-icon_3.entry.js +1 -1
- package/dist/nano-components/nano-progress-bar.entry.js +1 -1
- package/dist/nano-components/nano-rating.entry.js +1 -1
- package/dist/nano-components/nano-resize-observe_2.entry.js +1 -1
- package/dist/nano-components/nano-slide.entry.js +1 -1
- package/dist/nano-components/{nano-slides-CvZxKg4X.js → nano-slides-B9KjZVqC.js} +3 -3
- package/dist/nano-components/nano-slides.entry.js +1 -1
- package/dist/nano-components/nano-sortable.entry.js +1 -1
- package/dist/nano-components/nano-spinner.entry.js +1 -1
- package/dist/nano-components/nano-sticker.entry.js +1 -1
- package/dist/nano-components/nano-tab-content.entry.js +1 -1
- package/dist/nano-components/nano-tab.entry.js +1 -1
- package/dist/nano-components/nano-table.entry.js +1 -1
- package/dist/nano-components/{page-dots-_tkpExQM.js → page-dots-BmS6HUrx.js} +1 -1
- package/dist/nano-components/style-xLaX004n.js +4 -0
- package/dist/nano-components/{table.worker-webIEBZt.js → table.worker-CsTdjWrS.js} +1 -1
- package/dist/style/components.css +1 -1
- package/dist/style/components.css.map +1 -1
- package/dist/style/core.css +1 -1
- package/dist/style/core.css.map +1 -1
- package/dist/style/dark.css +1 -1
- package/dist/style/dark.css.map +1 -1
- package/dist/style/light.css +1 -1
- package/dist/style/light.css.map +1 -1
- package/dist/style/nano.css +1 -1
- package/dist/style/nano.css.map +1 -1
- package/dist/types/components/file-upload/file-upload.d.ts +14 -9
- package/dist/types/components/progress-bar/progress-bar.d.ts +6 -13
- package/dist/types/components.d.ts +43 -53
- package/docs-json.json +111 -172
- package/docs-vscode.json +16 -9
- package/hydrate/index.js +132 -110
- package/hydrate/index.mjs +132 -110
- package/package.json +3 -3
- package/dist/collection/components/file-upload/file-upload-list.js +0 -3
- package/dist/nano-components/style-BrRDhFfF.js +0 -4
- package/dist/types/components/file-upload/file-upload-list.d.ts +0 -0
@@ -18,11 +18,14 @@ catch {
|
|
18
18
|
}
|
19
19
|
}
|
20
20
|
/**
|
21
|
-
*
|
21
|
+
* Enables the selection of files for upload.
|
22
22
|
*
|
23
|
-
*
|
24
|
-
*
|
25
|
-
*
|
23
|
+
* @version 1.0.0
|
24
|
+
* @status stable
|
25
|
+
*
|
26
|
+
* @slot label - A label for the file input. If not provided, the `label` prop will be used.
|
27
|
+
* @slot helper - A helper text to display below the input.
|
28
|
+
* @slot - The default slot can be used to add additional content, such as instructions or a message.
|
26
29
|
*/
|
27
30
|
export class FileUpload {
|
28
31
|
inputEl;
|
@@ -59,12 +62,18 @@ export class FileUpload {
|
|
59
62
|
capture;
|
60
63
|
/** The maximum file size allowed per file (Megabytes) */
|
61
64
|
maxFileSize = 1;
|
62
|
-
/** The maximum
|
65
|
+
/** The maximum number of files that can be selected. Defaults to 1 */
|
63
66
|
maxFiles = 1;
|
67
|
+
_label = '';
|
64
68
|
/** String to place within a label element. */
|
65
|
-
label
|
69
|
+
get label() {
|
70
|
+
return this.required && !this._label.endsWith('*') ? this._label + ' *' : this._label;
|
71
|
+
}
|
72
|
+
set label(value) {
|
73
|
+
this._label = value;
|
74
|
+
}
|
66
75
|
/** Placeholder only used within single file uploads. */
|
67
|
-
placeholder = 'Choose a file
|
76
|
+
placeholder = 'Choose a file';
|
68
77
|
/** Visually hide the label - but make it accessible. */
|
69
78
|
hideLabel = false;
|
70
79
|
/** If `true`, the user must select a file to upload before submitting a form. */
|
@@ -73,11 +82,11 @@ export class FileUpload {
|
|
73
82
|
disabled = false;
|
74
83
|
/** If `true`, a clear icon will appear in the input when there is a value.
|
75
84
|
* Clicking it clears the input. Only used within single file uploads. */
|
76
|
-
|
85
|
+
clearable = false;
|
77
86
|
/** Whether to show validation errors underneath input */
|
78
87
|
showInlineError = true;
|
79
88
|
/** When should the field perform validation */
|
80
|
-
validateOn = '
|
89
|
+
validateOn = 'submitThenDirty';
|
81
90
|
/** The form element to associate with this input (its form owner). Must be the id of a form. */
|
82
91
|
form;
|
83
92
|
shouldValidate() {
|
@@ -89,7 +98,7 @@ export class FileUpload {
|
|
89
98
|
this.showInlineValidation();
|
90
99
|
});
|
91
100
|
}
|
92
|
-
_invalid =
|
101
|
+
_invalid = null;
|
93
102
|
/** This will be true when the control is in an invalid state.
|
94
103
|
* Validity is determined by the `required` prop. Or if custom validity message is set. @readonly */
|
95
104
|
get invalid() {
|
@@ -169,7 +178,6 @@ export class FileUpload {
|
|
169
178
|
async showError(message) {
|
170
179
|
if (this.inputEl) {
|
171
180
|
this.inputEl.setCustomValidity(message);
|
172
|
-
this.validate();
|
173
181
|
this.showInlineValidation();
|
174
182
|
}
|
175
183
|
}
|
@@ -221,7 +229,7 @@ export class FileUpload {
|
|
221
229
|
checkFileType(type) {
|
222
230
|
if (!this.accept)
|
223
231
|
return true;
|
224
|
-
return this.accept.match(type) && this.accept.match(type).length > 0;
|
232
|
+
return !!type && this.accept.match(type) && this.accept.match(type).length > 0;
|
225
233
|
}
|
226
234
|
validate = () => {
|
227
235
|
this.errorMessage = '';
|
@@ -231,24 +239,36 @@ export class FileUpload {
|
|
231
239
|
error = this.inputEl.validationMessage;
|
232
240
|
}
|
233
241
|
else {
|
234
|
-
this.fileList.
|
235
|
-
error =
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
242
|
+
if (this.fileList.length > this.maxFiles) {
|
243
|
+
error = `Maximum number of files exceeded (${this.maxFiles})`;
|
244
|
+
}
|
245
|
+
else {
|
246
|
+
this.fileList.forEach((fileItem) => {
|
247
|
+
let listeItemError = null;
|
248
|
+
if (!this.checkFileSize(fileItem.file.size)) {
|
249
|
+
listeItemError =
|
250
|
+
'Maximum file size exceeded. Max file size is ' +
|
251
|
+
this.maxFileSize +
|
252
|
+
'Mb';
|
253
|
+
}
|
254
|
+
else if (!this.checkFileType(fileItem.file.type)) {
|
255
|
+
listeItemError = `File type is not allowed (${this.accept})`;
|
256
|
+
}
|
257
|
+
fileItem.validationMessage = listeItemError;
|
258
|
+
fileItem.valid = !listeItemError;
|
259
|
+
if (listeItemError) {
|
260
|
+
error = listeItemError;
|
261
|
+
}
|
262
|
+
});
|
263
|
+
}
|
249
264
|
}
|
250
|
-
if (error)
|
265
|
+
if (error) {
|
251
266
|
this.inputEl.setCustomValidity(error);
|
267
|
+
}
|
268
|
+
else {
|
269
|
+
this.inputEl.setCustomValidity('');
|
270
|
+
this.errorMessage = '';
|
271
|
+
}
|
252
272
|
};
|
253
273
|
showInlineValidation(ev) {
|
254
274
|
if (this.validateOn === 'submitThenDirty')
|
@@ -364,9 +384,10 @@ export class FileUpload {
|
|
364
384
|
h("div", { class: 'file-upload__' + eleType + '-wrap' }, h("label", { class: `file-upload__` + eleType, htmlFor: this.fileInputId, id: labelId, onDrop: (e) => {
|
365
385
|
this.onDrop(e);
|
366
386
|
this.onDragStop(e);
|
367
|
-
}, onDragEnd: this.onDragStop, onDragLeave: this.onDragStop, onDragEnter: this.onDragStart, onDragOver: this.onDragStart }, (!!this.label || (this.hasLabelSlot && eleType !== 'drop')) && (h("div", { class: `file-upload__label ${this.hideLabel ? 'visually-hide' : ''}` }, !!this.label && !!this.label.length ? this.label : '', !this.label && this.hasLabelSlot && eleType !== 'drop' && (h("slot", { name: "label" })))), eleType === 'drop' && (h("div", { class: "file-upload__drop-area" }, h("div", null, this.hasLabelSlot && h("slot", { name: "label" })), h("div", null, "Drag and drop or\u00A0", h("span", null, "browse")))), eleType === 'btn' && (h("div", { class: `file-upload__button button--keyline button--icon-start ${this.hasFocus ? 'button--focus' : ''}` }, h("
|
387
|
+
}, onDragEnd: this.onDragStop, onDragLeave: this.onDragStop, onDragEnter: this.onDragStart, onDragOver: this.onDragStart }, (!!this.label || (this.hasLabelSlot && eleType !== 'drop')) && (h("div", { class: `file-upload__label ${this.hideLabel ? 'visually-hide' : ''}` }, !!this.label && !!this.label.length ? this.label : '', !this.label && this.hasLabelSlot && eleType !== 'drop' && (h("slot", { name: "label" })))), eleType === 'drop' && (h("div", { class: "file-upload__drop-area" }, h("div", null, this.hasLabelSlot && h("slot", { name: "label" })), h("div", null, "Drag and drop or\u00A0", h("span", null, "browse")))), eleType === 'btn' && (h("div", { class: `file-upload__button button--keyline button--icon-start ${this.hasFocus ? 'button--focus' : ''}` }, h("nano-cta", { secondary: true, class: `file-upload__btn-content` }, h("div", { class: "button", disabled: this.disabled }, this.fileList.length
|
368
388
|
? this.fileList[0].file.name
|
369
|
-
: this.placeholder), !!this.value && this.
|
389
|
+
: this.placeholder)), !!this.value && this.clearable && !this.disabled && (h("button", { type: "button", class: "icon file-upload__clear-btn", tabindex: "0", "aria-label": "Clear selected file", onClick: this.onClearClick }, h("nano-icon", { name: "light/xmark" }))), !this.disabled && this.showInlineError &&
|
390
|
+
(this._invalid ? (h("nano-icon", { name: "solid/circle-xmark", class: "file-upload__icon file-upload__icon-error" })) : (h("nano-icon", { name: "solid/circle-check", class: "file-upload__icon file-upload__icon-success" }))))), h("input", { "aria-labelledby": labelId + ' ' + moreId + ' ' + listId, type: "file", id: this.fileInputId, accept: this.accept, class: "file-upload__input", multiple: this.maxFiles > 1, disabled: this.disabled, name: this.canChangeFileList ? undefined : this.name, form: this.form, ref: (input) => {
|
370
391
|
if (this.canChangeFileList) {
|
371
392
|
this.publicInputEl = input;
|
372
393
|
return;
|
@@ -393,11 +414,12 @@ export class FileUpload {
|
|
393
414
|
];
|
394
415
|
};
|
395
416
|
render() {
|
396
|
-
return (h(Host, { key: '
|
417
|
+
return (h(Host, { key: '4f495870314e3f688517b34be6749cf2b77810ea', class: "nano-file-upload" }, h("div", { key: '9baa63fe75b200913f82abb4304d73e22fbb4be4', class: {
|
397
418
|
'file-upload': true,
|
398
419
|
'file-upload--dragging': this.isDragging,
|
399
420
|
'file-upload--focus': this.hasFocus,
|
400
|
-
'file-upload--invalid': this._invalid,
|
421
|
+
'file-upload--invalid': this._invalid === true,
|
422
|
+
'file-upload--valid': this._invalid === false,
|
401
423
|
} }, this.maxFiles > 1 ? h(this.dropArea, null) : h(this.button, null))));
|
402
424
|
}
|
403
425
|
static get is() { return "nano-file-upload"; }
|
@@ -504,7 +526,7 @@ export class FileUpload {
|
|
504
526
|
"optional": false,
|
505
527
|
"docs": {
|
506
528
|
"tags": [],
|
507
|
-
"text": "The maximum
|
529
|
+
"text": "The maximum number of files that can be selected. Defaults to 1"
|
508
530
|
},
|
509
531
|
"getter": false,
|
510
532
|
"setter": false,
|
@@ -520,14 +542,14 @@ export class FileUpload {
|
|
520
542
|
"resolved": "string",
|
521
543
|
"references": {}
|
522
544
|
},
|
523
|
-
"required":
|
545
|
+
"required": false,
|
524
546
|
"optional": false,
|
525
547
|
"docs": {
|
526
548
|
"tags": [],
|
527
549
|
"text": "String to place within a label element."
|
528
550
|
},
|
529
|
-
"getter":
|
530
|
-
"setter":
|
551
|
+
"getter": true,
|
552
|
+
"setter": true,
|
531
553
|
"reflect": false
|
532
554
|
},
|
533
555
|
"placeholder": {
|
@@ -548,7 +570,7 @@ export class FileUpload {
|
|
548
570
|
"getter": false,
|
549
571
|
"setter": false,
|
550
572
|
"reflect": false,
|
551
|
-
"defaultValue": "'Choose a file
|
573
|
+
"defaultValue": "'Choose a file'"
|
552
574
|
},
|
553
575
|
"hideLabel": {
|
554
576
|
"type": "boolean",
|
@@ -610,9 +632,9 @@ export class FileUpload {
|
|
610
632
|
"reflect": true,
|
611
633
|
"defaultValue": "false"
|
612
634
|
},
|
613
|
-
"
|
635
|
+
"clearable": {
|
614
636
|
"type": "boolean",
|
615
|
-
"attribute": "
|
637
|
+
"attribute": "clearable",
|
616
638
|
"mutable": false,
|
617
639
|
"complexType": {
|
618
640
|
"original": "boolean",
|
@@ -668,7 +690,7 @@ export class FileUpload {
|
|
668
690
|
"getter": false,
|
669
691
|
"setter": false,
|
670
692
|
"reflect": false,
|
671
|
-
"defaultValue": "'
|
693
|
+
"defaultValue": "'submitThenDirty'"
|
672
694
|
},
|
673
695
|
"form": {
|
674
696
|
"type": "string",
|
@@ -690,12 +712,12 @@ export class FileUpload {
|
|
690
712
|
"reflect": false
|
691
713
|
},
|
692
714
|
"invalid": {
|
693
|
-
"type": "
|
715
|
+
"type": "any",
|
694
716
|
"attribute": "invalid",
|
695
717
|
"mutable": false,
|
696
718
|
"complexType": {
|
697
|
-
"original": "
|
698
|
-
"resolved": "
|
719
|
+
"original": "any",
|
720
|
+
"resolved": "any",
|
699
721
|
"references": {}
|
700
722
|
},
|
701
723
|
"required": false,
|
@@ -710,7 +732,7 @@ export class FileUpload {
|
|
710
732
|
"getter": true,
|
711
733
|
"setter": false,
|
712
734
|
"reflect": true,
|
713
|
-
"defaultValue": "
|
735
|
+
"defaultValue": "null"
|
714
736
|
},
|
715
737
|
"validityMessage": {
|
716
738
|
"type": "string",
|
@@ -80,12 +80,11 @@
|
|
80
80
|
}
|
81
81
|
}
|
82
82
|
:host .upper {
|
83
|
-
background-color: var(--nano-color-base-rgb-1000);
|
84
83
|
border-block-start: 1px solid var(--nano-color-neutral-200);
|
85
84
|
}
|
86
85
|
:host .lower {
|
87
|
-
background-color: var(--nano-color-
|
88
|
-
color: var(--nano-color-
|
86
|
+
background-color: var(--nano-color-basic-black);
|
87
|
+
color: var(--nano-color-basic-white);
|
89
88
|
}
|
90
89
|
:host .top,
|
91
90
|
:host .middle,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/*!
|
2
2
|
* Custom elements for Nanopore-Digital Web applications
|
3
3
|
*/
|
4
|
-
import { h } from "@stencil/core";
|
4
|
+
import { h, Build, getAssetPath } from "@stencil/core";
|
5
5
|
import { addGlobalStylesheetToShadow } from "../../utils/style";
|
6
6
|
/**
|
7
7
|
* The footer is used to provide navigation, copyright info and links to social media platforms.
|
@@ -22,10 +22,11 @@ import { addGlobalStylesheetToShadow } from "../../utils/style";
|
|
22
22
|
export class NanoFooter {
|
23
23
|
host;
|
24
24
|
componentWillLoad() {
|
25
|
-
|
25
|
+
if (Build.isBrowser)
|
26
|
+
addGlobalStylesheetToShadow(this.host.shadowRoot);
|
26
27
|
}
|
27
28
|
render() {
|
28
|
-
return (h("footer", { key: '
|
29
|
+
return (h("footer", { key: '7df3395d83480c2efaffd3a745dcb8486492ec8d', class: "footer" }, h("div", { key: '2277f9b209312a0be9c503590f9871c3da7ab7c5', class: "upper" }, h("div", { key: '43ca2ad3f23948f23d787c3179f6012021fe0786', class: "top" }, h("div", { key: '05ee9cb69076053c9accbae4d188232d344e7bf0', class: "top-start" }, h("slot", { key: 'a34bf50a87e10191e65d0be67f88c16abcf48304', name: "top-start_heading" }), h("slot", { key: 'db386e86277ae22fa9b5e7723c78ec48b4ff5444', name: "top-start_content" })), h("div", { key: '061fd17bfdb8ad8af11dce8cd3abac07d7c58290', class: "top-center" }, h("slot", { key: '885c3acef88311528147a249ca29003ec64b10c0', name: "top-center_heading" }), h("slot", { key: '8d4f513adfd5f24880ca76a214d2d2051d3b9ad7', name: "top-center_content" })), h("div", { key: 'f6138faa2e07af7e9e46a20e1510708f58ddba27', class: "top-end" }, h("slot", { key: 'aa7570bfa51e27ec2745b2563db6736c1b7def19', name: "top-end_heading" }), h("slot", { key: '9dd64f4ad61d9a0d5dd1b305e9089c5190e89738', name: "top-end_content" })))), h("div", { key: 'bbf554d8a85ee66cf0a38f82a8de608615510722', class: "lower nano-theme-dark" }, h("div", { key: '4a46e9541cc2fa7b45cfa3fd3a8628e5aed47eae', class: "middle" }, h("div", { key: 'ef13e5c2a35f64533bba7522fa34c964c4ee8acc', class: "middle-start" }, h("img", { key: '2bf403ca600f0588be99898b4e0a42ee5f64f736', src: getAssetPath('../nano-assets/ont-logo-light.svg'), alt: "Oxford Nanopore Technologies logo. Featuring a stylised representation of a nanopore,\n (a tiny protein channel embedded in a membrane) through which DNA or RNA molecules are passed in for sequencing.", height: "46" })), h("div", { key: 'c3796b77148a0ba37fba2a7d1f3583233294de22', class: "middle-center" }, h("a", { key: 'abd8ff0fcbb1b3e7365090310c67ae0c29a8073f', href: "https://x.com/nanopore", target: "_blank" }, h("nano-icon", { key: '78ec0f32afa4da8f87fce46f36c2958a61cadaef', name: "brands/x-twitter", size: "large", ariaLabel: "X (formerly Twitter)" })), h("a", { key: '28315142cc17313a65d9039601b26bbe2400d715', href: "https://bsky.app/profile/nanoporetech.com", target: "_blank" }, h("nano-icon", { key: '155bedeeea937afe7740c867f9780ad26dd6eadf', name: "brands/bluesky", size: "large", ariaLabel: "Bluesky" })), h("a", { key: '4047f00cd32d045bd46660aaa9eb17536a5555f4', href: "https://www.youtube.com/channel/UC5yMlYjHSgFfZ37LYq-dzig", target: "_blank" }, h("nano-icon", { key: '63e9bb9f849a10b70b1a5cd32c1f9545587f8902', name: "brands/youtube", size: "large", ariaLabel: "YouTube" })), h("a", { key: 'fd2f4d639c13c99523a9f026457414aa805171bc', href: "https://www.facebook.com/Oxford-Nanopore-Technologies-251034380246/", target: "_blank" }, h("nano-icon", { key: '71a31a51945079e3419ce150a7908db2125a6523', name: "brands/facebook", size: "large", ariaLabel: "Facebook" })), h("a", { key: '426b6c582345b1e32bbd0e6ca206a75cd56ed434', href: "https://www.linkedin.com/company/oxford-nanopore-technologies", target: "_blank" }, h("nano-icon", { key: 'ec8256f6a70d0bb68beacab2a8c8adc381d26661', name: "brands/linkedin", size: "large", ariaLabel: "LinkedIn" })), h("a", { key: 'ddf5456cb764238fb5d932b2b44cf5466e82ad2f', href: "https://www.instagram.com/oxfordnanopore", target: "_blank" }, h("nano-icon", { key: '293464c660b8734f0bae8eb612c8377e763b8053', name: "brands/instagram", size: "large", ariaLabel: "Instagram" }))), h("div", { key: '6b7ed0e2ad110329ce9c5e4e085278d4e7dd4568', class: "middle-end" }, h("slot", { key: '15c3d94e8f35ee98fafdc6f062d9639b0ac54b63', name: "middle-end" }))), h("div", { key: 'a72b24bd18b825b160608a1b20e221b37c070bc4', class: "bottom" }, h("div", { key: 'a63f935bacfc660dc1c45e0dcb43514272837fdd', class: "bottom-start" }, h("slot", { key: '1fb95aa9e6da5ae676470cf532c47ecbe5ae0015', name: "bottom-start" }, h("p", { key: 'd78582a9baa27c818155577a7a49ccbc6b0fe141' }, "\u00A9 2008 - 2025 Oxford Nanopore Technologies plc. All rights reserved. Registered Office: Gosling Building, Edmund Halley Road, Oxford Science Park, OX4 4DQ, UK | Registered No. 05386273 | VAT No 336942382. Oxford Nanopore Technologies, the Wheel icon, EPI2ME, Flongle, GridION, Metrichor, MinION, MinIT, MinKNOW, Plongle, PromethION, SmidgION, Ubik and VolTRAX are registered trademarks of Oxford Nanopore Technologies plc in various countries. Oxford Nanopore Technologies products are not intended for use for health assessment or to diagnose, treat, mitigate, cure, or prevent any disease or condition."))), h("div", { key: '08a48aaf322de5c4292e24803e8ca6da40e1e3c5', class: "bottom-end" }, h("slot", { key: '81873c5375cc33b1f1b533354b960a66eadaf94b', name: "bottom-end" }))))));
|
29
30
|
}
|
30
31
|
static get is() { return "nano-footer"; }
|
31
32
|
static get encapsulation() { return "shadow"; }
|
@@ -37,46 +37,65 @@
|
|
37
37
|
scroll-behavior: auto !important;
|
38
38
|
}
|
39
39
|
}/**
|
40
|
-
* @prop --
|
41
|
-
* @prop --track-color:
|
42
|
-
* @prop --
|
43
|
-
* @prop --
|
40
|
+
* @prop --indicator-color: Color of the progress indicator. Defaults to var(--nano-color-primary-1000);
|
41
|
+
* @prop --track-color: Color of the progress track. Defaults to var(--nano-color-neutral-300);
|
42
|
+
* @prop --border-radius: Border radius of the progress bar. Defaults to 1.25rem;
|
43
|
+
* @prop --height: Height of the progress bar. Defaults to 0.625rem;
|
44
44
|
*/
|
45
|
-
|
46
|
-
--
|
47
|
-
--track-color:
|
48
|
-
--
|
49
|
-
--
|
50
|
-
display:
|
51
|
-
}
|
52
|
-
|
53
|
-
.progress-bar {
|
45
|
+
nano-progress-bar {
|
46
|
+
--indicator-color: var(--nano-color-primary-1000);
|
47
|
+
--track-color: var(--nano-color-neutral-300);
|
48
|
+
--border-radius: 1.25rem;
|
49
|
+
--height: 0.625rem;
|
50
|
+
display: grid;
|
54
51
|
position: relative;
|
52
|
+
overflow: clip;
|
53
|
+
border-radius: var(--border-radius);
|
54
|
+
height: var(--height);
|
55
|
+
font-size: var(--height);
|
56
|
+
}
|
57
|
+
nano-progress-bar[size=small] {
|
58
|
+
--height: 0.3125rem;
|
59
|
+
}
|
60
|
+
nano-progress-bar[size=large] {
|
61
|
+
--height: 0.9375rem;
|
62
|
+
}
|
63
|
+
nano-progress-bar progress {
|
64
|
+
appearance: none;
|
65
|
+
width: 100%;
|
66
|
+
height: inherit;
|
67
|
+
border-radius: var(--border-radius);
|
55
68
|
background-color: var(--track-color);
|
56
|
-
|
57
|
-
border-radius: var(--nano-layer-border-radius, var(--nano-border-radius-medium, 4px));
|
58
|
-
overflow: hidden;
|
69
|
+
grid-area: 1/1;
|
59
70
|
}
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
overflow: hidden;
|
69
|
-
transition: 0.4s width, 0.4s background-color;
|
70
|
-
transform: translateZ(0);
|
71
|
-
-webkit-user-select: none;
|
72
|
-
user-select: none;
|
73
|
-
transform-origin: left;
|
71
|
+
nano-progress-bar > label {
|
72
|
+
grid-area: 1/1;
|
73
|
+
position: absolute;
|
74
|
+
inset: 0;
|
75
|
+
}
|
76
|
+
nano-progress-bar > label progress {
|
77
|
+
position: absolute;
|
78
|
+
inset: 0;
|
74
79
|
}
|
75
|
-
|
76
|
-
|
80
|
+
nano-progress-bar:has(progress:not([value]))::after {
|
81
|
+
content: "";
|
82
|
+
width: 100%;
|
83
|
+
inset: 0;
|
84
|
+
display: block;
|
85
|
+
transform: translateZ(0);
|
77
86
|
animation: indeterminate 2.5s infinite cubic-bezier(0.37, 0, 0.63, 1);
|
87
|
+
background-color: var(--indicator-color);
|
88
|
+
grid-area: 1/1;
|
89
|
+
border-radius: none;
|
90
|
+
}
|
91
|
+
nano-progress-bar progress:not([value])::-webkit-progress-bar {
|
92
|
+
border-radius: var(--border-radius);
|
93
|
+
background-color: var(--track-color);
|
94
|
+
}
|
95
|
+
nano-progress-bar progress:not([value])::-moz-progress-bar {
|
96
|
+
border-radius: var(--border-radius);
|
97
|
+
background-color: var(--track-color);
|
78
98
|
}
|
79
|
-
|
80
99
|
@keyframes indeterminate {
|
81
100
|
0% {
|
82
101
|
scale: 1 1;
|
@@ -86,4 +105,30 @@
|
|
86
105
|
scale: 1 1;
|
87
106
|
transform: translateX(100%) translateZ(0);
|
88
107
|
}
|
108
|
+
}
|
109
|
+
nano-progress-bar progress[value]::-webkit-progress-bar {
|
110
|
+
border-radius: var(--border-radius);
|
111
|
+
background-color: var(--track-color);
|
112
|
+
}
|
113
|
+
nano-progress-bar progress[value]::-webkit-progress-value {
|
114
|
+
background-color: var(--indicator-color);
|
115
|
+
-webkit-transition: inline-size var(--nano-transition-fast);
|
116
|
+
transition: inline-size var(--nano-transition-fast);
|
117
|
+
}
|
118
|
+
nano-progress-bar progress[value]::-moz-progress-bar {
|
119
|
+
background-color: var(--indicator-color);
|
120
|
+
-moz-transition: inline-size var(--nano-transition-fast);
|
121
|
+
transition: inline-size var(--nano-transition-fast);
|
122
|
+
}
|
123
|
+
nano-progress-bar[show-percent] progress[value]::before {
|
124
|
+
content: attr(value) "%";
|
125
|
+
position: absolute;
|
126
|
+
inline-size: attr(value %);
|
127
|
+
min-inline-size: 6%;
|
128
|
+
top: 50%;
|
129
|
+
translate: 0 -50%;
|
130
|
+
text-align: center;
|
131
|
+
transition: inline-size var(--nano-transition-fast);
|
132
|
+
font-size: 0.75em;
|
133
|
+
color: var(--nano-color-base-0);
|
89
134
|
}
|
@@ -1,40 +1,18 @@
|
|
1
|
-
/*!
|
2
|
-
* Custom elements for Nanopore-Digital Web applications
|
3
|
-
*/
|
4
|
-
import { Host } from "@stencil/core";
|
5
|
-
import { h } from "../../utils/renderer";
|
6
1
|
/**
|
7
2
|
* Shows the status of an ongoing operation.
|
8
3
|
*
|
9
|
-
* @version
|
10
|
-
* @status
|
11
|
-
*
|
12
|
-
* @slot - A label to show inside the indicator.
|
4
|
+
* @version 8.0.0
|
5
|
+
* @status new
|
6
|
+
* @type CSS Only
|
13
7
|
*
|
14
|
-
* @
|
15
|
-
* @part indicator - The progress bar indicator.
|
16
|
-
* @part label - The progress bar label.
|
8
|
+
* @slot - Used for mandatory `<progress>` element and optional `<label>`
|
17
9
|
*/
|
18
10
|
export class ProgressBar {
|
19
|
-
host;
|
20
|
-
/** The progress bar's percentage, 0 to 100. */
|
21
|
-
value = 0;
|
22
|
-
/** When true, percentage is ignored, the label is hidden, and the progress bar is drawn in an indeterminate state. */
|
23
|
-
indeterminate = false;
|
24
11
|
/** Whether to show the progress bar's current percent as text. Will be overwritten if you use the default slot. */
|
25
12
|
showPercent = false;
|
26
|
-
|
27
|
-
|
28
|
-
'progress-bar': true,
|
29
|
-
'progress-bar--indeterminate': this.indeterminate,
|
30
|
-
}, role: "progressbar", title: this.host.title || undefined, "aria-label": "Progress", "aria-valuemin": "0", "aria-valuemax": "100", "aria-valuenow": this.indeterminate ? null : this.value }, h("div", { key: 'dd80b47ed6627db8d93bf20a7ef096d44757ec56', part: "indicator", class: "progress-bar__indicator", style: {
|
31
|
-
width: !this.indeterminate ? `${this.value}%` : undefined,
|
32
|
-
} }, h("span", { key: '7b967332cff45da08a49008ac727f247750347ae', part: "label", class: "progress-bar__label" }, h("slot", { key: '5d2c53909892f8c81e151ec64a337e656e7e4dae' }, !this.indeterminate && this.showPercent
|
33
|
-
? `${this.value}%`
|
34
|
-
: ''))))));
|
35
|
-
}
|
13
|
+
/** The height of the progress-bar */
|
14
|
+
size = 'medium';
|
36
15
|
static get is() { return "nano-progress-bar"; }
|
37
|
-
static get encapsulation() { return "shadow"; }
|
38
16
|
static get originalStyleUrls() {
|
39
17
|
return {
|
40
18
|
"$": ["progress-bar.scss"]
|
@@ -47,29 +25,9 @@ export class ProgressBar {
|
|
47
25
|
}
|
48
26
|
static get properties() {
|
49
27
|
return {
|
50
|
-
"
|
51
|
-
"type": "number",
|
52
|
-
"attribute": "value",
|
53
|
-
"mutable": false,
|
54
|
-
"complexType": {
|
55
|
-
"original": "number",
|
56
|
-
"resolved": "number",
|
57
|
-
"references": {}
|
58
|
-
},
|
59
|
-
"required": false,
|
60
|
-
"optional": false,
|
61
|
-
"docs": {
|
62
|
-
"tags": [],
|
63
|
-
"text": "The progress bar's percentage, 0 to 100."
|
64
|
-
},
|
65
|
-
"getter": false,
|
66
|
-
"setter": false,
|
67
|
-
"reflect": false,
|
68
|
-
"defaultValue": "0"
|
69
|
-
},
|
70
|
-
"indeterminate": {
|
28
|
+
"showPercent": {
|
71
29
|
"type": "boolean",
|
72
|
-
"attribute": "
|
30
|
+
"attribute": "show-percent",
|
73
31
|
"mutable": false,
|
74
32
|
"complexType": {
|
75
33
|
"original": "boolean",
|
@@ -80,34 +38,33 @@ export class ProgressBar {
|
|
80
38
|
"optional": false,
|
81
39
|
"docs": {
|
82
40
|
"tags": [],
|
83
|
-
"text": "
|
41
|
+
"text": "Whether to show the progress bar's current percent as text. Will be overwritten if you use the default slot."
|
84
42
|
},
|
85
43
|
"getter": false,
|
86
44
|
"setter": false,
|
87
|
-
"reflect":
|
45
|
+
"reflect": true,
|
88
46
|
"defaultValue": "false"
|
89
47
|
},
|
90
|
-
"
|
91
|
-
"type": "
|
92
|
-
"attribute": "
|
48
|
+
"size": {
|
49
|
+
"type": "string",
|
50
|
+
"attribute": "size",
|
93
51
|
"mutable": false,
|
94
52
|
"complexType": {
|
95
|
-
"original": "
|
96
|
-
"resolved": "
|
53
|
+
"original": "'small' | 'medium' | 'large'",
|
54
|
+
"resolved": "\"large\" | \"medium\" | \"small\"",
|
97
55
|
"references": {}
|
98
56
|
},
|
99
57
|
"required": false,
|
100
58
|
"optional": false,
|
101
59
|
"docs": {
|
102
60
|
"tags": [],
|
103
|
-
"text": "
|
61
|
+
"text": "The height of the progress-bar"
|
104
62
|
},
|
105
63
|
"getter": false,
|
106
64
|
"setter": false,
|
107
|
-
"reflect":
|
108
|
-
"defaultValue": "
|
65
|
+
"reflect": true,
|
66
|
+
"defaultValue": "'medium'"
|
109
67
|
}
|
110
68
|
};
|
111
69
|
}
|
112
|
-
static get elementRef() { return "host"; }
|
113
70
|
}
|
@@ -166,23 +166,23 @@ export class Rating {
|
|
166
166
|
else {
|
167
167
|
displayValue = this.isHovering ? this.hoverValue : this.value;
|
168
168
|
}
|
169
|
-
return (h(Host, { key: '
|
169
|
+
return (h(Host, { key: '1f1a4c5f6b8dea2419e75be53db6e74d4455c3c5', class: "nano-rating" }, h("div", { key: '6898eef81bc7e3d634b3054a4694f49db79929c8', class: "rating-wrap" }, h("div", { key: 'bbad068f69e99c12083bb53c00a25b2dff02ddb7', dir: this.isRtl ? 'rtl' : null, ref: (el) => (this.rating = el), part: "base", class: {
|
170
170
|
rating: true,
|
171
171
|
'rating--readonly': this.readonly,
|
172
172
|
'rating--disabled': this.disabled,
|
173
|
-
}, "aria-disabled": this.disabled ? 'true' : 'false', "aria-readonly": this.readonly ? 'true' : 'false', "aria-valuenow": this.value, "aria-valuemin": 0, "aria-valuemax": this.max, tabIndex: this.disabled ? -1 : 0, onClick: this.handleClick, onKeyDown: this.handleKeyDown, onMouseEnter: this.handleMouseEnter, onMouseLeave: this.handleMouseLeave, onMouseMove: this.handleMouseMove, onFocus: this.handleFocus, onBlur: this.handleBlur }, h("span", { key: '
|
173
|
+
}, "aria-disabled": this.disabled ? 'true' : 'false', "aria-readonly": this.readonly ? 'true' : 'false', "aria-valuenow": this.value, "aria-valuemin": 0, "aria-valuemax": this.max, tabIndex: this.disabled ? -1 : 0, onClick: this.handleClick, onKeyDown: this.handleKeyDown, onMouseEnter: this.handleMouseEnter, onMouseLeave: this.handleMouseLeave, onMouseMove: this.handleMouseMove, onFocus: this.handleFocus, onBlur: this.handleBlur }, h("span", { key: 'd2518d1ec73803cdc284c64ff4fcee9c86f6077d', class: "rating__symbols rating__symbols--inactive" }, counter.map((index) => (h("span", { class: {
|
174
174
|
rating__symbol: true,
|
175
175
|
'rating__symbol--hover': this.isHovering && Math.ceil(displayValue) === index + 1,
|
176
176
|
},
|
177
177
|
// Users can click the current value to clear the rating. When this happens, we set this.isHovering to
|
178
178
|
// false to prevent the hover state from confusing them as they move the mouse out of the control. This
|
179
179
|
// extra mouseenter will reinstate it if they happen to mouse over an adjacent symbol.
|
180
|
-
onMouseEnter: this.handleMouseEnter, innerHTML: this.symbol(index + 1) })))), h("span", { key: '
|
180
|
+
onMouseEnter: this.handleMouseEnter, innerHTML: this.symbol(index + 1) })))), h("span", { key: '046a97718d174445372c909eee0d061c4effd770', ref: (span) => (this.indicator = span), class: "rating__symbols rating__symbols--indicator", style: {
|
181
181
|
clip: this.clip(displayValue),
|
182
182
|
} }, counter.map((index) => (h("span", { class: {
|
183
183
|
rating__symbol: true,
|
184
184
|
'rating__symbol--hover': this.isHovering && Math.ceil(displayValue) === index + 1,
|
185
|
-
}, innerHTML: this.symbol(index + 1) })))), h("input", { key: '
|
185
|
+
}, innerHTML: this.symbol(index + 1) })))), h("input", { key: '8a0a62b7419a719e2a2cf08e361aae299dea7d65', type: "hidden", name: this.name, value: this.value, disabled: this.disabled || this.readonly })))));
|
186
186
|
}
|
187
187
|
static get is() { return "nano-rating"; }
|
188
188
|
static get encapsulation() { return "scoped"; }
|
@@ -227,7 +227,7 @@ export class ResizeObserve {
|
|
227
227
|
this.ro.disconnect();
|
228
228
|
}
|
229
229
|
render() {
|
230
|
-
return (h(Host, { key: '
|
230
|
+
return (h(Host, { key: '67ae39458d0f21c7100481c6aa68f9455e468d86', class: "nano-resize-observe" }, h("slot", { key: '503108cec78fcfda303a9e392e1903ec7acfc244' }), !!this.notifyContentFit &&
|
231
231
|
(this.contentFitX !== null || this.contentFitY !== null) && [
|
232
232
|
this.contentFitX ? (h("slot", { name: "content-fit-x" })) : (h("slot", { name: "content-nofit-x" })),
|
233
233
|
this.contentFitY ? (h("slot", { name: "content-fit-y" })) : (h("slot", { name: "content-nofit-y" })),
|