@xplor-education/core-stencil-components 3.1.1 → 3.1.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/components/index.js +28 -3
- package/components/index.js.map +1 -1
- package/components/{p-B49oUO_9.js → p-AzuDJugb.js} +3 -3
- package/components/{p-B49oUO_9.js.map → p-AzuDJugb.js.map} +1 -1
- package/components/{p-D4jVa8dE.js → p-BQ6aLuGP.js} +4 -4
- package/components/{p-D4jVa8dE.js.map → p-BQ6aLuGP.js.map} +1 -1
- package/components/{p-VIJbFoA4.js → p-BZQ63ULK.js} +3 -3
- package/components/{p-VIJbFoA4.js.map → p-BZQ63ULK.js.map} +1 -1
- package/components/{p-Bs_ocvfe.js → p-CyGsSa4H.js} +7 -4
- package/components/p-CyGsSa4H.js.map +1 -0
- package/components/{p-B3zR7peH.js → p-oanCZPh6.js} +4 -4
- package/components/{p-B3zR7peH.js.map → p-oanCZPh6.js.map} +1 -1
- package/components/xplor-alert-message.js +2 -2
- package/components/xplor-avatar-and-name.js +2 -2
- package/components/xplor-avatar.js +1 -1
- package/components/xplor-badge-active.js +1 -1
- package/components/xplor-badge-archived.js +1 -1
- package/components/xplor-badge-deleted.js +1 -1
- package/components/xplor-badge-expired.js +1 -1
- package/components/xplor-badge-inactive.js +1 -1
- package/components/xplor-badge-recalled.js +1 -1
- package/components/xplor-badge-upcoming.js +1 -1
- package/components/xplor-badge-waitlist.js +1 -1
- package/components/xplor-badge.js +1 -1
- package/components/xplor-btn-back-to-parent.js +1 -1
- package/components/xplor-btn-back.js +1 -1
- package/components/xplor-btn-icon.js +1 -1
- package/components/xplor-btn-toggle-group.js +1 -1
- package/components/xplor-btn-toggle-secondary.js +1 -1
- package/components/xplor-btn-toggle.js +1 -1
- package/components/xplor-btn-tooltip.js +3 -3
- package/components/xplor-button.js +1 -1
- package/components/xplor-canvas-editor.d.ts +11 -0
- package/components/xplor-canvas-editor.js +369 -0
- package/components/xplor-canvas-editor.js.map +1 -0
- package/components/xplor-chat-widget.js +3 -3
- package/components/xplor-checkbox.js +1 -1
- package/components/xplor-combobox.js +5 -5
- package/components/xplor-datatable.js +2 -2
- package/components/xplor-date-picker.js +5 -5
- package/components/xplor-drag-and-drop-input.js +26 -5
- package/components/xplor-drag-and-drop-input.js.map +1 -1
- package/components/xplor-dropdown.js +1 -1
- package/components/xplor-expansion-panel.js +4 -4
- package/components/xplor-expansion-panels.js +1 -1
- package/components/xplor-file-upload.js +2 -2
- package/components/xplor-inline-checkbox.js +2 -2
- package/components/xplor-inline-date-picker.js +1 -1
- package/components/xplor-inline-switch.js +1 -1
- package/components/xplor-input-file.js +1 -1
- package/components/xplor-input-search.js +2 -2
- package/components/xplor-input-select.js +2 -2
- package/components/xplor-input-send.js +3 -3
- package/components/xplor-input-text-area.js +6 -3
- package/components/xplor-input-text-area.js.map +1 -1
- package/components/xplor-input-text-secondary.js +2 -2
- package/components/xplor-input-text.js +6 -3
- package/components/xplor-input-text.js.map +1 -1
- package/components/xplor-input-title.js +1 -1
- package/components/xplor-links.js +1 -1
- package/components/xplor-modal-persistent.js +1 -1
- package/components/xplor-nav-tabs.js +2 -2
- package/components/xplor-radio-btn.js +2 -2
- package/components/xplor-rich-text-editor.d.ts +11 -0
- package/components/xplor-rich-text-editor.js +23754 -0
- package/components/xplor-rich-text-editor.js.map +1 -0
- package/components/xplor-section-card.js +2 -2
- package/components/xplor-section-heading.js +2 -2
- package/components/xplor-table.js +5 -5
- package/components/xplor-text-bubble.js +2 -2
- package/components/xplor-text-field.js +2 -2
- package/components/xplor-time-picker.js +6 -6
- package/components/xplor-tooltip.js +1 -1
- package/dist/cjs/{index-BjAapk2n.js → index--_m3aUsf.js} +32 -7
- package/dist/cjs/index--_m3aUsf.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/xplor-alert-dialog_60.cjs.entry.js +29457 -0
- package/dist/cjs/xplor-alert-dialog_60.cjs.entry.js.map +1 -0
- package/dist/cjs/xplor-component-library.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/xplor-alert-message/xplor-alert-message.js +2 -2
- package/dist/collection/components/xplor-autocomplete/xplor-autocomplete.js +4 -4
- package/dist/collection/components/xplor-avatar/xplor-avatar.js +2 -2
- package/dist/collection/components/xplor-avatar-and-name/xplor-avatar-and-name.js +1 -1
- package/dist/collection/components/xplor-badge/xplor-badge.js +1 -1
- package/dist/collection/components/xplor-badge-active/xplor-badge-active.js +1 -1
- package/dist/collection/components/xplor-badge-archived/xplor-badge-archived.js +1 -1
- package/dist/collection/components/xplor-badge-deleted/xplor-badge-deleted.js +1 -1
- package/dist/collection/components/xplor-badge-expired/xplor-badge-expired.js +1 -1
- package/dist/collection/components/xplor-badge-inactive/xplor-badge-inactive.js +1 -1
- package/dist/collection/components/xplor-badge-recalled/xplor-badge-recalled.js +1 -1
- package/dist/collection/components/xplor-badge-session-booking/xplor-badge-session-booking.js +2 -2
- package/dist/collection/components/xplor-badge-upcoming/xplor-badge-upcoming.js +1 -1
- package/dist/collection/components/xplor-badge-waitlist/xplor-badge-waitlist.js +1 -1
- package/dist/collection/components/xplor-btn-back/xplor-btn-back.js +1 -1
- package/dist/collection/components/xplor-btn-back-to-parent/xplor-btn-back-to-parent.js +1 -1
- package/dist/collection/components/xplor-btn-icon/xplor-btn-icon.js +1 -1
- package/dist/collection/components/xplor-btn-menu/xplor-btn-menu.js +2 -2
- package/dist/collection/components/xplor-btn-toggle/xplor-btn-toggle.js +1 -1
- package/dist/collection/components/xplor-btn-toggle-group/xplor-btn-toggle-group.js +1 -1
- package/dist/collection/components/xplor-btn-toggle-secondary/xplor-btn-toggle-secondary.js +1 -1
- package/dist/collection/components/xplor-btn-tooltip/xplor-btn-tooltip.js +1 -1
- package/dist/collection/components/xplor-button/xplor-button.css +8 -3
- package/dist/collection/components/xplor-button/xplor-button.js +23 -1
- package/dist/collection/components/xplor-button/xplor-button.js.map +1 -1
- package/dist/collection/components/xplor-canvas-editor/xplor-canvas-editor.css +1224 -0
- package/dist/collection/components/xplor-canvas-editor/xplor-canvas-editor.js +520 -0
- package/dist/collection/components/xplor-canvas-editor/xplor-canvas-editor.js.map +1 -0
- package/dist/collection/components/xplor-canvas-editor/xplor-canvas-editor.stories.js +280 -0
- package/dist/collection/components/xplor-canvas-editor/xplor-canvas-editor.stories.js.map +1 -0
- package/dist/collection/components/xplor-chat-widget/xplor-chat-widget.js +1 -1
- package/dist/collection/components/xplor-checkbox/xplor-checkbox.js +1 -1
- package/dist/collection/components/xplor-combobox/xplor-combobox.js +7 -7
- package/dist/collection/components/xplor-datatable/xplor-datatable.js +5 -5
- package/dist/collection/components/xplor-date-picker/xplor-date-picker.js +4 -4
- package/dist/collection/components/xplor-drag-and-drop-input/xplor-drag-and-drop-input.css +62 -29
- package/dist/collection/components/xplor-drag-and-drop-input/xplor-drag-and-drop-input.js +25 -4
- package/dist/collection/components/xplor-drag-and-drop-input/xplor-drag-and-drop-input.js.map +1 -1
- package/dist/collection/components/xplor-dropdown/xplor-dropdown.js +1 -1
- package/dist/collection/components/xplor-expansion-panel/xplor-expansion-panel.js +4 -4
- package/dist/collection/components/xplor-expansion-panels/xplor-expansion-panels.js +1 -1
- package/dist/collection/components/xplor-file-upload/xplor-file-upload.js +4 -4
- package/dist/collection/components/xplor-inline-checkbox/xplor-inline-checkbox.js +2 -2
- package/dist/collection/components/xplor-inline-date-picker/xplor-inline-date-picker.js +1 -1
- package/dist/collection/components/xplor-inline-switch/xplor-inline-switch.js +1 -1
- package/dist/collection/components/xplor-input-file/xplor-input-file.js +1 -1
- package/dist/collection/components/xplor-input-search/xplor-input-search.js +2 -2
- package/dist/collection/components/xplor-input-select/xplor-input-select.js +3 -3
- package/dist/collection/components/xplor-input-send/xplor-input-send.js +2 -2
- package/dist/collection/components/xplor-input-text/xplor-input-text.css +41 -13
- package/dist/collection/components/xplor-input-text/xplor-input-text.js +5 -2
- package/dist/collection/components/xplor-input-text/xplor-input-text.js.map +1 -1
- package/dist/collection/components/xplor-input-text-area/xplor-input-text-area.css +39 -13
- package/dist/collection/components/xplor-input-text-area/xplor-input-text-area.js +5 -2
- package/dist/collection/components/xplor-input-text-area/xplor-input-text-area.js.map +1 -1
- package/dist/collection/components/xplor-input-text-secondary/xplor-input-text-secondary.js +2 -2
- package/dist/collection/components/xplor-input-title/xplor-input-title.js +1 -1
- package/dist/collection/components/xplor-links/xplor-links.js +1 -1
- package/dist/collection/components/xplor-modal-persistent/xplor-modal-persistent.js +1 -1
- package/dist/collection/components/xplor-nav-tabs/xplor-nav-tabs.js +3 -3
- package/dist/collection/components/xplor-radio-btn/xplor-radio-btn.js +2 -2
- package/dist/collection/components/xplor-rich-text-editor/xplor-rich-text-editor.css +1445 -0
- package/dist/collection/components/xplor-rich-text-editor/xplor-rich-text-editor.js +800 -0
- package/dist/collection/components/xplor-rich-text-editor/xplor-rich-text-editor.js.map +1 -0
- package/dist/collection/components/xplor-rich-text-editor/xplor-rich-text-editor.stories.js +260 -0
- package/dist/collection/components/xplor-rich-text-editor/xplor-rich-text-editor.stories.js.map +1 -0
- package/dist/collection/components/xplor-section-card/xplor-section-card.js +2 -2
- package/dist/collection/components/xplor-section-heading/xplor-section-heading.js +2 -2
- package/dist/collection/components/xplor-table/xplor-table.js +5 -5
- package/dist/collection/components/xplor-text-bubble/xplor-text-bubble.js +2 -2
- package/dist/collection/components/xplor-text-field/xplor-text-field.js +2 -2
- package/dist/collection/components/xplor-time-picker/xplor-time-picker.js +6 -6
- package/dist/collection/components/xplor-tooltip/xplor-tooltip.js +4 -4
- package/dist/collection/utils/slate-legacy-converter.js +223 -0
- package/dist/collection/utils/slate-legacy-converter.js.map +1 -0
- package/dist/components/index.js +28 -3
- package/dist/components/index.js.map +1 -1
- package/dist/components/{p--zhT6rvJ.js → p-DGaHlr-k.js} +4 -4
- package/dist/components/{p--zhT6rvJ.js.map → p-DGaHlr-k.js.map} +1 -1
- package/dist/components/{p-B5rS_jjI.js → p-DWaTb2EJ.js} +7 -4
- package/dist/components/p-DWaTb2EJ.js.map +1 -0
- package/dist/components/{p-J41B2nOt.js → p-DroQBoSo.js} +3 -3
- package/dist/components/{p-J41B2nOt.js.map → p-DroQBoSo.js.map} +1 -1
- package/dist/components/{p-DQ8MCJFX.js → p-TfYzqGwr.js} +3 -3
- package/dist/components/{p-DQ8MCJFX.js.map → p-TfYzqGwr.js.map} +1 -1
- package/dist/components/{p-DbQ6ZNvh.js → p-vl-J3tKJ.js} +4 -4
- package/dist/components/{p-DbQ6ZNvh.js.map → p-vl-J3tKJ.js.map} +1 -1
- package/dist/components/xplor-alert-message.js +2 -2
- package/dist/components/xplor-avatar-and-name.js +2 -2
- package/dist/components/xplor-avatar.js +1 -1
- package/dist/components/xplor-badge-active.js +1 -1
- package/dist/components/xplor-badge-archived.js +1 -1
- package/dist/components/xplor-badge-deleted.js +1 -1
- package/dist/components/xplor-badge-expired.js +1 -1
- package/dist/components/xplor-badge-inactive.js +1 -1
- package/dist/components/xplor-badge-recalled.js +1 -1
- package/dist/components/xplor-badge-upcoming.js +1 -1
- package/dist/components/xplor-badge-waitlist.js +1 -1
- package/dist/components/xplor-badge.js +1 -1
- package/dist/components/xplor-btn-back-to-parent.js +1 -1
- package/dist/components/xplor-btn-back.js +1 -1
- package/dist/components/xplor-btn-icon.js +1 -1
- package/dist/components/xplor-btn-toggle-group.js +1 -1
- package/dist/components/xplor-btn-toggle-secondary.js +1 -1
- package/dist/components/xplor-btn-toggle.js +1 -1
- package/dist/components/xplor-btn-tooltip.js +3 -3
- package/dist/components/xplor-button.js +1 -1
- package/dist/components/xplor-canvas-editor.d.ts +11 -0
- package/dist/components/xplor-canvas-editor.js +370 -0
- package/dist/components/xplor-canvas-editor.js.map +1 -0
- package/dist/components/xplor-chat-widget.js +3 -3
- package/dist/components/xplor-checkbox.js +1 -1
- package/dist/components/xplor-combobox.js +5 -5
- package/dist/components/xplor-datatable.js +2 -2
- package/dist/components/xplor-date-picker.js +5 -5
- package/dist/components/xplor-drag-and-drop-input.js +26 -5
- package/dist/components/xplor-drag-and-drop-input.js.map +1 -1
- package/dist/components/xplor-dropdown.js +1 -1
- package/dist/components/xplor-expansion-panel.js +4 -4
- package/dist/components/xplor-expansion-panels.js +1 -1
- package/dist/components/xplor-file-upload.js +2 -2
- package/dist/components/xplor-inline-checkbox.js +2 -2
- package/dist/components/xplor-inline-date-picker.js +1 -1
- package/dist/components/xplor-inline-switch.js +1 -1
- package/dist/components/xplor-input-file.js +1 -1
- package/dist/components/xplor-input-search.js +2 -2
- package/dist/components/xplor-input-select.js +2 -2
- package/dist/components/xplor-input-send.js +3 -3
- package/dist/components/xplor-input-text-area.js +6 -3
- package/dist/components/xplor-input-text-area.js.map +1 -1
- package/dist/components/xplor-input-text-secondary.js +2 -2
- package/dist/components/xplor-input-text.js +6 -3
- package/dist/components/xplor-input-text.js.map +1 -1
- package/dist/components/xplor-input-title.js +1 -1
- package/dist/components/xplor-links.js +1 -1
- package/dist/components/xplor-modal-persistent.js +1 -1
- package/dist/components/xplor-nav-tabs.js +2 -2
- package/dist/components/xplor-radio-btn.js +2 -2
- package/dist/components/xplor-rich-text-editor.d.ts +11 -0
- package/dist/components/xplor-rich-text-editor.js +23755 -0
- package/dist/components/xplor-rich-text-editor.js.map +1 -0
- package/dist/components/xplor-section-card.js +2 -2
- package/dist/components/xplor-section-heading.js +2 -2
- package/dist/components/xplor-table.js +5 -5
- package/dist/components/xplor-text-bubble.js +2 -2
- package/dist/components/xplor-text-field.js +2 -2
- package/dist/components/xplor-time-picker.js +6 -6
- package/dist/components/xplor-tooltip.js +1 -1
- package/dist/esm/{index-KRfMjDC2.js → index-QwDfQUbw.js} +32 -7
- package/dist/esm/index-QwDfQUbw.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/xplor-alert-dialog_60.entry.js +29396 -0
- package/dist/esm/xplor-alert-dialog_60.entry.js.map +1 -0
- package/dist/esm/xplor-component-library.js +3 -3
- package/dist/hydrate/index.js +24238 -97
- package/dist/hydrate/index.mjs +24238 -97
- package/dist/types/components/xplor-button/xplor-button.d.ts +2 -0
- package/dist/types/components/xplor-canvas-editor/xplor-canvas-editor.d.ts +63 -0
- package/dist/types/components/xplor-canvas-editor/xplor-canvas-editor.stories.d.ts +84 -0
- package/dist/types/components/xplor-drag-and-drop-input/xplor-drag-and-drop-input.d.ts +6 -0
- package/dist/types/components/xplor-rich-text-editor/xplor-rich-text-editor.d.ts +129 -0
- package/dist/types/components/xplor-rich-text-editor/xplor-rich-text-editor.stories.d.ts +105 -0
- package/dist/types/components.d.ts +290 -0
- package/dist/types/utils/slate-legacy-converter.d.ts +83 -0
- package/dist/xplor-component-library/p-QwDfQUbw.js +3 -0
- package/dist/xplor-component-library/p-QwDfQUbw.js.map +1 -0
- package/dist/xplor-component-library/p-df68ccde.entry.js +2 -0
- package/dist/xplor-component-library/p-df68ccde.entry.js.map +1 -0
- package/dist/xplor-component-library/xplor-component-library.css +1 -1
- package/dist/xplor-component-library/xplor-component-library.esm.js +1 -1
- package/package.json +7 -1
- package/components/p-Bs_ocvfe.js.map +0 -1
- package/dist/cjs/index-BjAapk2n.js.map +0 -1
- package/dist/cjs/xplor-alert-dialog_58.cjs.entry.js +0 -5389
- package/dist/cjs/xplor-alert-dialog_58.cjs.entry.js.map +0 -1
- package/dist/components/p-B5rS_jjI.js.map +0 -1
- package/dist/esm/index-KRfMjDC2.js.map +0 -1
- package/dist/esm/xplor-alert-dialog_58.entry.js +0 -5330
- package/dist/esm/xplor-alert-dialog_58.entry.js.map +0 -1
- package/dist/xplor-component-library/p-5b0cee73.entry.js +0 -2
- package/dist/xplor-component-library/p-5b0cee73.entry.js.map +0 -1
- package/dist/xplor-component-library/p-KRfMjDC2.js +0 -3
- package/dist/xplor-component-library/p-KRfMjDC2.js.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
const DEFAULT_ACCEPT_ALL = '*' + '/' + '*';
|
|
3
|
+
const HORIZONTAL_BREAKPOINT = 700;
|
|
3
4
|
export class XplorDragAndDropInput {
|
|
4
5
|
constructor() {
|
|
5
6
|
/**
|
|
@@ -24,6 +25,7 @@ export class XplorDragAndDropInput {
|
|
|
24
25
|
this.progress = -1;
|
|
25
26
|
this.dragover = false;
|
|
26
27
|
this.currentFile = null;
|
|
28
|
+
this.horizontal = false;
|
|
27
29
|
this.onDrop = (e) => {
|
|
28
30
|
var _a, _b;
|
|
29
31
|
e.preventDefault();
|
|
@@ -106,6 +108,23 @@ export class XplorDragAndDropInput {
|
|
|
106
108
|
return this.progress >= 0 && this.progress <= 100;
|
|
107
109
|
};
|
|
108
110
|
}
|
|
111
|
+
connectedCallback() {
|
|
112
|
+
this.resizeObserver = new ResizeObserver((entries) => {
|
|
113
|
+
for (const entry of entries) {
|
|
114
|
+
this.horizontal = entry.contentRect.width >= HORIZONTAL_BREAKPOINT;
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
componentDidLoad() {
|
|
119
|
+
const zone = this.el.querySelector('.drag-drop-zone');
|
|
120
|
+
if (zone) {
|
|
121
|
+
this.resizeObserver.observe(zone);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
disconnectedCallback() {
|
|
125
|
+
var _a;
|
|
126
|
+
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
127
|
+
}
|
|
109
128
|
/**
|
|
110
129
|
* Clears the currently selected file
|
|
111
130
|
*/
|
|
@@ -119,13 +138,13 @@ export class XplorDragAndDropInput {
|
|
|
119
138
|
render() {
|
|
120
139
|
const progressValue = Math.min(Math.max(this.progress, 0), 100);
|
|
121
140
|
const dropZoneLabel = this.ariaLabel || `${this.label}. Accepted file types: ${this.getAcceptsLabel()}. Or use the ${this.browseLabel} button.`;
|
|
122
|
-
return (h(Host, { key: '
|
|
141
|
+
return (h(Host, { key: 'ca319f6606c7dbfce3e098ac331df04851c7f883' }, h("div", { key: 'ab7995b34b56bfcf783d413d66e3ea1232d1f7ee', class: { 'drag-drop-zone': true, 'drag-drop-zone--horizontal': this.horizontal } }, h("div", { key: '56c926d929d6cd1fdf7abb793bf71957082ab332', class: {
|
|
123
142
|
'drag-drop-card': true,
|
|
124
143
|
'drag-drop-card--dragover': this.dragover,
|
|
125
144
|
'drag-drop-card--disabled': this.disabled,
|
|
126
|
-
}, onDrop: this.onDrop, onDragOver: this.onDragOver, onDragEnter: this.onDragEnter, onDragLeave: this.onDragLeave, role: "region", "aria-label": dropZoneLabel }, h("div", { key: '
|
|
145
|
+
}, onDrop: this.onDrop, onDragOver: this.onDragOver, onDragEnter: this.onDragEnter, onDragLeave: this.onDragLeave, role: "region", "aria-label": dropZoneLabel }, h("div", { key: 'd7fb1ad5b7190aed2eb6dfeed3b1fb60aea9741b', class: "drag-drop-card__content" }, h("div", { key: 'e9793c5e6da2444f2dc3a6fa9c87b780ebbcf6ac', class: "drag-drop-card__body" }, h("svg", { key: '86475864d73ae0ed327684db1e0b89e728ca67da', class: "drag-drop-card__icon", xmlns: "http://www.w3.org/2000/svg", width: "48", height: "48", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true" }, h("path", { key: 'ead2c5bf3a3850462148ba290a16de1dc656f4a9', d: "M19.35 10.04C18.67 6.59 15.64 4 12 4C9.11 4 6.6 5.64 5.35 8.04C2.34 8.36 0 10.91 0 14C0 17.31 2.69 20 6 20H19C21.76 20 24 17.76 24 15C24 12.36 21.95 10.22 19.35 10.04Z", fill: "currentColor", opacity: "0.3" }), h("path", { key: '94babbe372719d394d1d79d7c6c15ed32d58aa24', d: "M19.35 10.04C18.67 6.59 15.64 4 12 4C9.11 4 6.6 5.64 5.35 8.04C2.34 8.36 0 10.91 0 14C0 17.31 2.69 20 6 20H19C21.76 20 24 17.76 24 15C24 12.36 21.95 10.22 19.35 10.04ZM14 13V17H10V13H7L12 8L17 13H14Z", fill: "currentColor" })), h("div", { key: '6f1d9f5b68401dc8139d8fd5d4c10571284ae367', class: "drag-drop-card__text" }, h("h3", { key: '3e0d81d37e40513884fc587091b8d8593db83ee3', class: "drag-drop-card__title" }, this.label), this.accepts && this.accepts !== DEFAULT_ACCEPT_ALL && (h("p", { key: 'f5d808b35c569d2ab24499aff8a46f35b079ed90', class: "drag-drop-card__accepts" }, "Accepted file types: ", this.getAcceptsLabel())))), h("p", { key: '61fd2ae577886973c6396256d1d62d8b388a1cc2', class: "drag-drop-card__divider" }, "or"), h("div", { key: '44fd0339be61f3ea877a4264e39c294cf76f1a09', class: "drag-drop-card__action" }, h("xplor-button", { key: 'eaae9ef4676e8ab704f7145ca61bf29c941d6682', text: this.browseLabel, type: this.disabled ? 'disabled' : 'secondary', clickAction: this.openFileDialog, "aria-label": this.browseLabel }))))), this.currentFile && (h("div", { key: '26e53d9c4837f6374825ab79d08d738c9dbaf8da', class: "file-info", "aria-live": "polite" }, this.showProgress() && (h("p", { key: '3be4484290b10eadf7edf6b2e51e401a5e73944f', class: "file-info__status" }, "Uploading ", this.progress === 100 ? '1' : '0', " / 1")), h("div", { key: '91769f6bebf95d09452125d8853ad1063f138648', class: "file-info__card" }, h("div", { key: '98ecc133467eab8da00c941d727786ed02eb312a', class: "file-info__icon", "aria-hidden": "true" }, h("svg", { key: '1379507c795a90afcda408d352dbe421b7bf6b0c', xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor" }, h("path", { key: 'db2e4bd018a094553daf7c9558a502366b180780', d: "M14 2H6C4.9 2 4 2.9 4 4V20C4 21.1 4.9 22 6 22H18C19.1 22 20 21.1 20 20V8L14 2ZM6 20V4H13V9H18V20H6Z" }))), h("div", { key: '8f1b4caa023bafbeb1abfe0b3ad86947cbf3ccc7', class: "file-info__details" }, h("p", { key: '944afb1540e5c7096014ff4bca9a1355888c6295', class: "file-info__name" }, this.currentFile.name), h("p", { key: 'a436d9deca0315b5eea5f1cb415a3b795d3c61c9', class: "file-info__meta" }, this.formatFileSize(this.currentFile.size), this.currentFile.lastModified
|
|
127
146
|
? ` | Last modified: ${this.formatDate(this.currentFile.lastModified)}`
|
|
128
|
-
: ''), this.showProgress() && (h("div", { key: '
|
|
147
|
+
: ''), this.showProgress() && (h("div", { key: '511dfd62f57ada4dd544a8d936f96f21dcd10421', class: "file-info__progress-row" }, h("div", { key: 'ff667b1c0aa9f062fb1fc7c567fa9154b5d5f349', class: "file-info__progress-bar", role: "progressbar", "aria-valuenow": progressValue, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": `Upload progress: ${Math.round(progressValue)}%` }, h("div", { key: 'f854ed8afc19d8f8db7f45f49c1bd143fd5db6d5', class: "file-info__progress-fill", style: { width: `${progressValue}%` } })), h("span", { key: 'ac64c3bd5a4070c4429c3fd35a5d2096d3f2d23a', class: "file-info__progress-text", "aria-hidden": "true" }, Math.round(this.progress), "%")))), h("button", { key: 'ab52269526a3ce92b319fd64614bb13d925014c0', class: "file-info__remove", onClick: () => this.clearCurrentFile(), "aria-label": `Remove file ${this.currentFile.name}` }, h("svg", { key: '7713047f0dc58d2e44115483ea1297ca5d4e1b19', xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true" }, h("path", { key: '476df4151904b6d4753019ff04f85fb9ed1f3ad3', d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12Z" })))))), h("input", { key: '40a83940bb6c13a35b8ff1a6ef6ba4ad2b3fefdc', id: "drag-drop-file-select", type: "file", disabled: this.disabled, accept: this.accepts, class: "drag-drop-input-hidden", ref: (el) => (this.fileInputEl = el), onChange: this.onFileSelect, "aria-label": `${this.browseLabel} - ${this.label}`, tabindex: -1 })));
|
|
129
148
|
}
|
|
130
149
|
static get is() { return "xplor-drag-and-drop-input"; }
|
|
131
150
|
static get encapsulation() { return "scoped"; }
|
|
@@ -265,7 +284,8 @@ export class XplorDragAndDropInput {
|
|
|
265
284
|
static get states() {
|
|
266
285
|
return {
|
|
267
286
|
"dragover": {},
|
|
268
|
-
"currentFile": {}
|
|
287
|
+
"currentFile": {},
|
|
288
|
+
"horizontal": {}
|
|
269
289
|
};
|
|
270
290
|
}
|
|
271
291
|
static get events() {
|
|
@@ -327,5 +347,6 @@ export class XplorDragAndDropInput {
|
|
|
327
347
|
}
|
|
328
348
|
};
|
|
329
349
|
}
|
|
350
|
+
static get elementRef() { return "el"; }
|
|
330
351
|
}
|
|
331
352
|
//# sourceMappingURL=xplor-drag-and-drop-input.js.map
|
package/dist/collection/components/xplor-drag-and-drop-input/xplor-drag-and-drop-input.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xplor-drag-and-drop-input.js","sourceRoot":"","sources":["../../../src/components/xplor-drag-and-drop-input/xplor-drag-and-drop-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAgB,MAAM,EAAE,MAAM,eAAe,CAAC;AAE7F,MAAM,kBAAkB,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAO3C,MAAM,OAAO,qBAAqB;IALlC;QAME;;WAEG;QACK,aAAQ,GAAY,KAAK,CAAC;QAElC;;WAEG;QACK,YAAO,GAAW,kBAAkB,CAAC;QAE7C;;WAEG;QACK,UAAK,GAAW,+BAA+B,CAAC;QAExD;;WAEG;QACK,gBAAW,GAAW,cAAc,CAAC;QAO7C;;WAEG;QACK,aAAQ,GAAW,CAAC,CAAC,CAAC;QAErB,aAAQ,GAAY,KAAK,CAAC;QAC1B,gBAAW,GAAgB,IAAI,CAAC;QA0BjC,WAAM,GAAG,CAAC,CAAY,EAAE,EAAE;;YAChC,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;YAEtB,IAAI,IAAI,CAAC,QAAQ;gBAAE,OAAO;YAE1B,MAAM,IAAI,G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,WAAW,GAAG,EAAE,CAAC,EACpC,QAAQ,EAAE,IAAI,CAAC,YAAY,gBACf,GAAG,IAAI,CAAC,WAAW,MAAM,IAAI,CAAC,KAAK,EAAE,EACjD,QAAQ,EAAE,CAAC,CAAC,GACZ,CACG,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop, State, Event, EventEmitter, Method } from '@stencil/core';\n\nconst DEFAULT_ACCEPT_ALL = '*' + '/' + '*';\n\n@Component({\n tag: 'xplor-drag-and-drop-input',\n styleUrl: 'xplor-drag-and-drop-input.scss',\n scoped: true,\n})\nexport class XplorDragAndDropInput {\n /**\n * Disable the file upload\n */\n @Prop() disabled: boolean = false;\n\n /**\n * Accepted file types (e.g., 'image/png,.pdf')\n */\n @Prop() accepts: string = DEFAULT_ACCEPT_ALL;\n\n /**\n * Instruction text displayed in the drop zone\n */\n @Prop() label: string = 'Drag and drop your files here';\n\n /**\n * Browse button label text\n */\n @Prop() browseLabel: string = 'Browse Files';\n\n /**\n * Accessible label for the drop zone area\n */\n @Prop() ariaLabel: string;\n\n /**\n * Upload progress percentage (0-100). Set to -1 or leave undefined to hide the progress bar.\n */\n @Prop() progress: number = -1;\n\n @State() dragover: boolean = false;\n @State() currentFile: File | null = null;\n\n /**\n * Emitted when a file is selected via drop or click\n */\n @Event() fileSelect: EventEmitter<File>;\n\n /**\n * Emitted when the current file is cleared\n */\n @Event() fileClear: EventEmitter<void>;\n\n private fileInputEl: HTMLInputElement;\n\n /**\n * Clears the currently selected file\n */\n @Method()\n async clearCurrentFile() {\n this.currentFile = null;\n if (this.fileInputEl) {\n this.fileInputEl.value = '';\n }\n this.fileClear.emit();\n }\n\n private onDrop = (e: DragEvent) => {\n e.preventDefault();\n this.dragover = false;\n\n if (this.disabled) return;\n\n const file = e.dataTransfer?.files?.[0];\n if (file) {\n this.currentFile = file;\n this.fileSelect.emit(this.currentFile);\n }\n };\n\n private onDragOver = (e: DragEvent) => {\n e.preventDefault();\n if (!this.disabled) {\n this.dragover = true;\n }\n };\n\n private onDragEnter = (e: DragEvent) => {\n e.preventDefault();\n if (!this.disabled) {\n this.dragover = true;\n }\n };\n\n private onDragLeave = (e: DragEvent) => {\n e.preventDefault();\n this.dragover = false;\n };\n\n private onFileSelect = (e: Event) => {\n const input = e.target as HTMLInputElement;\n const file = input.files?.[0];\n if (file) {\n this.currentFile = file;\n this.fileSelect.emit(this.currentFile);\n }\n input.value = '';\n };\n\n private openFileDialog = () => {\n if (this.disabled) {\n return;\n }\n\n this.fileInputEl?.click();\n };\n\n private getAcceptsLabel = () => {\n const accepts = this.accepts?.trim();\n if (!accepts || accepts === DEFAULT_ACCEPT_ALL) {\n return '*';\n }\n\n return accepts;\n };\n\n private formatFileSize = (bytes: number): string => {\n if (bytes === 0) return '0 Bytes';\n const k = 1024;\n const sizes = ['Bytes', 'KB', 'MB', 'GB'];\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];\n };\n\n private formatDate = (timestamp: number): string => {\n const date = new Date(timestamp);\n const day = date.getDate();\n const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n const month = months[date.getMonth()];\n const year = date.getFullYear();\n\n const suffix = (day === 1 || day === 21 || day === 31) ? 'st'\n : (day === 2 || day === 22) ? 'nd'\n : (day === 3 || day === 23) ? 'rd'\n : 'th';\n\n const hours = date.getHours();\n const minutes = date.getMinutes().toString().padStart(2, '0');\n const seconds = date.getSeconds().toString().padStart(2, '0');\n const ampm = hours >= 12 ? 'PM' : 'AM';\n const displayHours = hours % 12 || 12;\n\n return `${day}${suffix} ${month} ${year}, ${displayHours}:${minutes}:${seconds} ${ampm}`;\n };\n\n private showProgress = (): boolean => {\n return this.progress >= 0 && this.progress <= 100;\n };\n\n render() {\n const progressValue = Math.min(Math.max(this.progress, 0), 100);\n const dropZoneLabel = this.ariaLabel || `${this.label}. Accepted file types: ${this.getAcceptsLabel()}. Or use the ${this.browseLabel} button.`;\n\n return (\n <Host>\n <div class=\"drag-drop-zone\">\n <div\n class={{\n 'drag-drop-card': true,\n 'drag-drop-card--dragover': this.dragover,\n 'drag-drop-card--disabled': this.disabled,\n }}\n onDrop={this.onDrop}\n onDragOver={this.onDragOver}\n onDragEnter={this.onDragEnter}\n onDragLeave={this.onDragLeave}\n role=\"region\"\n aria-label={dropZoneLabel}\n >\n <div class=\"drag-drop-card__content\">\n <svg\n class=\"drag-drop-card__icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"40\"\n height=\"40\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M19.35 10.04C18.67 6.59 15.64 4 12 4C9.11 4 6.6 5.64 5.35 8.04C2.34 8.36 0 10.91 0 14C0 17.31 2.69 20 6 20H19C21.76 20 24 17.76 24 15C24 12.36 21.95 10.22 19.35 10.04Z\"\n fill=\"currentColor\"\n opacity=\"0.3\"\n />\n <path\n d=\"M19.35 10.04C18.67 6.59 15.64 4 12 4C9.11 4 6.6 5.64 5.35 8.04C2.34 8.36 0 10.91 0 14C0 17.31 2.69 20 6 20H19C21.76 20 24 17.76 24 15C24 12.36 21.95 10.22 19.35 10.04ZM14 13V17H10V13H7L12 8L17 13H14Z\"\n fill=\"currentColor\"\n />\n </svg>\n <h3 class=\"drag-drop-card__title\">{this.label}</h3>\n {this.accepts && this.accepts !== DEFAULT_ACCEPT_ALL && (\n <p class=\"drag-drop-card__accepts\">Accepted file types: {this.getAcceptsLabel()}</p>\n )}\n <div class=\"drag-drop-card__action\">\n <xplor-button\n text={this.browseLabel}\n type={this.disabled ? 'disabled' : 'secondary'}\n clickAction={this.openFileDialog}\n aria-label={this.browseLabel}\n ></xplor-button>\n </div>\n </div>\n </div>\n </div>\n\n {this.currentFile && (\n <div class=\"file-info\" aria-live=\"polite\">\n {this.showProgress() && (\n <p class=\"file-info__status\">\n Uploading {this.progress === 100 ? '1' : '0'} / 1\n </p>\n )}\n <div class=\"file-info__card\">\n <div class=\"file-info__icon\" aria-hidden=\"true\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M14 2H6C4.9 2 4 2.9 4 4V20C4 21.1 4.9 22 6 22H18C19.1 22 20 21.1 20 20V8L14 2ZM6 20V4H13V9H18V20H6Z\" />\n </svg>\n </div>\n <div class=\"file-info__details\">\n <p class=\"file-info__name\">{this.currentFile.name}</p>\n <p class=\"file-info__meta\">\n {this.formatFileSize(this.currentFile.size)}\n {this.currentFile.lastModified\n ? ` | Last modified: ${this.formatDate(this.currentFile.lastModified)}`\n : ''}\n </p>\n {this.showProgress() && (\n <div class=\"file-info__progress-row\">\n <div\n class=\"file-info__progress-bar\"\n role=\"progressbar\"\n aria-valuenow={progressValue}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-label={`Upload progress: ${Math.round(progressValue)}%`}\n >\n <div\n class=\"file-info__progress-fill\"\n style={{ width: `${progressValue}%` }}\n ></div>\n </div>\n <span class=\"file-info__progress-text\" aria-hidden=\"true\">{Math.round(this.progress)}%</span>\n </div>\n )}\n </div>\n <button\n class=\"file-info__remove\"\n onClick={() => this.clearCurrentFile()}\n aria-label={`Remove file ${this.currentFile.name}`}\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n <path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12Z\" />\n </svg>\n </button>\n </div>\n </div>\n )}\n\n <input\n id=\"drag-drop-file-select\"\n type=\"file\"\n disabled={this.disabled}\n accept={this.accepts}\n class=\"drag-drop-input-hidden\"\n ref={(el) => (this.fileInputEl = el)}\n onChange={this.onFileSelect}\n aria-label={`${this.browseLabel} - ${this.label}`}\n tabindex={-1}\n />\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"xplor-drag-and-drop-input.js","sourceRoot":"","sources":["../../../src/components/xplor-drag-and-drop-input/xplor-drag-and-drop-input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAgB,MAAM,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAEtG,MAAM,kBAAkB,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAC3C,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAOlC,MAAM,OAAO,qBAAqB;IALlC;QAME;;WAEG;QACK,aAAQ,GAAY,KAAK,CAAC;QAElC;;WAEG;QACK,YAAO,GAAW,kBAAkB,CAAC;QAE7C;;WAEG;QACK,UAAK,GAAW,+BAA+B,CAAC;QAExD;;WAEG;QACK,gBAAW,GAAW,cAAc,CAAC;QAO7C;;WAEG;QACK,aAAQ,GAAW,CAAC,CAAC,CAAC;QAErB,aAAQ,GAAY,KAAK,CAAC;QAC1B,gBAAW,GAAgB,IAAI,CAAC;QAChC,eAAU,GAAY,KAAK,CAAC;QAgD7B,WAAM,GAAG,CAAC,CAAY,EAAE,EAAE;;YAChC,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;YAEtB,IAAI,IAAI,CAAC,QAAQ;gBAAE,OAAO;YAE1B,MAAM,IAAI,GAAG,MAAA,MAAA,CAAC,CAAC,YAAY,0CAAE,KAAK,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AC,0BAA0B,iBAAa,MAAM;gCAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC;oCAAS,CACzF,CACP,CACG;oBACN,+DACE,KAAK,EAAC,mBAAmB,EACzB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE,gBAC1B,eAAe,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE;wBAElD,4DAAK,KAAK,EAAC,4BAA4B,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,cAAc,iBAAa,MAAM;4BACvH,6DAAM,CAAC,EAAC,uGAAuG,GAAG,CAC9G,CACC,CACL,CACF,CACP;YAED,8DACE,EAAE,EAAC,uBAAuB,EAC1B,IAAI,EAAC,MAAM,EACX,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,MAAM,EAAE,IAAI,CAAC,OAAO,EACpB,KAAK,EAAC,wBAAwB,EAC9B,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC,EACpC,QAAQ,EAAE,IAAI,CAAC,YAAY,gBACf,GAAG,IAAI,CAAC,WAAW,MAAM,IAAI,CAAC,KAAK,EAAE,EACjD,QAAQ,EAAE,CAAC,CAAC,GACZ,CACG,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop, State, Event, EventEmitter, Method, Element } from '@stencil/core';\n\nconst DEFAULT_ACCEPT_ALL = '*' + '/' + '*';\nconst HORIZONTAL_BREAKPOINT = 700;\n\n@Component({\n tag: 'xplor-drag-and-drop-input',\n styleUrl: 'xplor-drag-and-drop-input.scss',\n scoped: true,\n})\nexport class XplorDragAndDropInput {\n /**\n * Disable the file upload\n */\n @Prop() disabled: boolean = false;\n\n /**\n * Accepted file types (e.g., 'image/png,.pdf')\n */\n @Prop() accepts: string = DEFAULT_ACCEPT_ALL;\n\n /**\n * Instruction text displayed in the drop zone\n */\n @Prop() label: string = 'Drag and drop your files here';\n\n /**\n * Browse button label text\n */\n @Prop() browseLabel: string = 'Browse Files';\n\n /**\n * Accessible label for the drop zone area\n */\n @Prop() ariaLabel: string;\n\n /**\n * Upload progress percentage (0-100). Set to -1 or leave undefined to hide the progress bar.\n */\n @Prop() progress: number = -1;\n\n @State() dragover: boolean = false;\n @State() currentFile: File | null = null;\n @State() horizontal: boolean = false;\n\n @Element() el: HTMLElement;\n\n /**\n * Emitted when a file is selected via drop or click\n */\n @Event() fileSelect: EventEmitter<File>;\n\n /**\n * Emitted when the current file is cleared\n */\n @Event() fileClear: EventEmitter<void>;\n\n private fileInputEl: HTMLInputElement;\n private resizeObserver: ResizeObserver;\n\n connectedCallback() {\n this.resizeObserver = new ResizeObserver((entries) => {\n for (const entry of entries) {\n this.horizontal = entry.contentRect.width >= HORIZONTAL_BREAKPOINT;\n }\n });\n }\n\n componentDidLoad() {\n const zone = this.el.querySelector('.drag-drop-zone');\n if (zone) {\n this.resizeObserver.observe(zone);\n }\n }\n\n disconnectedCallback() {\n this.resizeObserver?.disconnect();\n }\n\n /**\n * Clears the currently selected file\n */\n @Method()\n async clearCurrentFile() {\n this.currentFile = null;\n if (this.fileInputEl) {\n this.fileInputEl.value = '';\n }\n this.fileClear.emit();\n }\n\n private onDrop = (e: DragEvent) => {\n e.preventDefault();\n this.dragover = false;\n\n if (this.disabled) return;\n\n const file = e.dataTransfer?.files?.[0];\n if (file) {\n this.currentFile = file;\n this.fileSelect.emit(this.currentFile);\n }\n };\n\n private onDragOver = (e: DragEvent) => {\n e.preventDefault();\n if (!this.disabled) {\n this.dragover = true;\n }\n };\n\n private onDragEnter = (e: DragEvent) => {\n e.preventDefault();\n if (!this.disabled) {\n this.dragover = true;\n }\n };\n\n private onDragLeave = (e: DragEvent) => {\n e.preventDefault();\n this.dragover = false;\n };\n\n private onFileSelect = (e: Event) => {\n const input = e.target as HTMLInputElement;\n const file = input.files?.[0];\n if (file) {\n this.currentFile = file;\n this.fileSelect.emit(this.currentFile);\n }\n input.value = '';\n };\n\n private openFileDialog = () => {\n if (this.disabled) {\n return;\n }\n\n this.fileInputEl?.click();\n };\n\n private getAcceptsLabel = () => {\n const accepts = this.accepts?.trim();\n if (!accepts || accepts === DEFAULT_ACCEPT_ALL) {\n return '*';\n }\n\n return accepts;\n };\n\n private formatFileSize = (bytes: number): string => {\n if (bytes === 0) return '0 Bytes';\n const k = 1024;\n const sizes = ['Bytes', 'KB', 'MB', 'GB'];\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];\n };\n\n private formatDate = (timestamp: number): string => {\n const date = new Date(timestamp);\n const day = date.getDate();\n const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n const month = months[date.getMonth()];\n const year = date.getFullYear();\n\n const suffix = (day === 1 || day === 21 || day === 31) ? 'st'\n : (day === 2 || day === 22) ? 'nd'\n : (day === 3 || day === 23) ? 'rd'\n : 'th';\n\n const hours = date.getHours();\n const minutes = date.getMinutes().toString().padStart(2, '0');\n const seconds = date.getSeconds().toString().padStart(2, '0');\n const ampm = hours >= 12 ? 'PM' : 'AM';\n const displayHours = hours % 12 || 12;\n\n return `${day}${suffix} ${month} ${year}, ${displayHours}:${minutes}:${seconds} ${ampm}`;\n };\n\n private showProgress = (): boolean => {\n return this.progress >= 0 && this.progress <= 100;\n };\n\n render() {\n const progressValue = Math.min(Math.max(this.progress, 0), 100);\n const dropZoneLabel = this.ariaLabel || `${this.label}. Accepted file types: ${this.getAcceptsLabel()}. Or use the ${this.browseLabel} button.`;\n\n return (\n <Host>\n <div class={{ 'drag-drop-zone': true, 'drag-drop-zone--horizontal': this.horizontal }}>\n <div\n class={{\n 'drag-drop-card': true,\n 'drag-drop-card--dragover': this.dragover,\n 'drag-drop-card--disabled': this.disabled,\n }}\n onDrop={this.onDrop}\n onDragOver={this.onDragOver}\n onDragEnter={this.onDragEnter}\n onDragLeave={this.onDragLeave}\n role=\"region\"\n aria-label={dropZoneLabel}\n >\n <div class=\"drag-drop-card__content\">\n <div class=\"drag-drop-card__body\">\n <svg\n class=\"drag-drop-card__icon\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"48\"\n height=\"48\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M19.35 10.04C18.67 6.59 15.64 4 12 4C9.11 4 6.6 5.64 5.35 8.04C2.34 8.36 0 10.91 0 14C0 17.31 2.69 20 6 20H19C21.76 20 24 17.76 24 15C24 12.36 21.95 10.22 19.35 10.04Z\"\n fill=\"currentColor\"\n opacity=\"0.3\"\n />\n <path\n d=\"M19.35 10.04C18.67 6.59 15.64 4 12 4C9.11 4 6.6 5.64 5.35 8.04C2.34 8.36 0 10.91 0 14C0 17.31 2.69 20 6 20H19C21.76 20 24 17.76 24 15C24 12.36 21.95 10.22 19.35 10.04ZM14 13V17H10V13H7L12 8L17 13H14Z\"\n fill=\"currentColor\"\n />\n </svg>\n <div class=\"drag-drop-card__text\">\n <h3 class=\"drag-drop-card__title\">{this.label}</h3>\n {this.accepts && this.accepts !== DEFAULT_ACCEPT_ALL && (\n <p class=\"drag-drop-card__accepts\">Accepted file types: {this.getAcceptsLabel()}</p>\n )}\n </div>\n </div>\n <p class=\"drag-drop-card__divider\">or</p>\n <div class=\"drag-drop-card__action\">\n <xplor-button\n text={this.browseLabel}\n type={this.disabled ? 'disabled' : 'secondary'}\n clickAction={this.openFileDialog}\n aria-label={this.browseLabel}\n ></xplor-button>\n </div>\n </div>\n </div>\n </div>\n\n {this.currentFile && (\n <div class=\"file-info\" aria-live=\"polite\">\n {this.showProgress() && (\n <p class=\"file-info__status\">\n Uploading {this.progress === 100 ? '1' : '0'} / 1\n </p>\n )}\n <div class=\"file-info__card\">\n <div class=\"file-info__icon\" aria-hidden=\"true\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M14 2H6C4.9 2 4 2.9 4 4V20C4 21.1 4.9 22 6 22H18C19.1 22 20 21.1 20 20V8L14 2ZM6 20V4H13V9H18V20H6Z\" />\n </svg>\n </div>\n <div class=\"file-info__details\">\n <p class=\"file-info__name\">{this.currentFile.name}</p>\n <p class=\"file-info__meta\">\n {this.formatFileSize(this.currentFile.size)}\n {this.currentFile.lastModified\n ? ` | Last modified: ${this.formatDate(this.currentFile.lastModified)}`\n : ''}\n </p>\n {this.showProgress() && (\n <div class=\"file-info__progress-row\">\n <div\n class=\"file-info__progress-bar\"\n role=\"progressbar\"\n aria-valuenow={progressValue}\n aria-valuemin={0}\n aria-valuemax={100}\n aria-label={`Upload progress: ${Math.round(progressValue)}%`}\n >\n <div\n class=\"file-info__progress-fill\"\n style={{ width: `${progressValue}%` }}\n ></div>\n </div>\n <span class=\"file-info__progress-text\" aria-hidden=\"true\">{Math.round(this.progress)}%</span>\n </div>\n )}\n </div>\n <button\n class=\"file-info__remove\"\n onClick={() => this.clearCurrentFile()}\n aria-label={`Remove file ${this.currentFile.name}`}\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n <path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12Z\" />\n </svg>\n </button>\n </div>\n </div>\n )}\n\n <input\n id=\"drag-drop-file-select\"\n type=\"file\"\n disabled={this.disabled}\n accept={this.accepts}\n class=\"drag-drop-input-hidden\"\n ref={(el) => (this.fileInputEl = el)}\n onChange={this.onFileSelect}\n aria-label={`${this.browseLabel} - ${this.label}`}\n tabindex={-1}\n />\n </Host>\n );\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
export class XplorDropdown {
|
|
3
3
|
render() {
|
|
4
|
-
return (h(Host, { key: '
|
|
4
|
+
return (h(Host, { key: 'a4cdcfb36108dbb84eeea5a4afbcbc59652e9cb0' }, h("select", { key: '1ad560027207d9b0fe9d9986c9ab4e6ab947c71c', class: "xplor-dropdown", onChange: this.handleChange }, this.options.map((option) => (h("option", { value: option, selected: this.selected === option }, option))))));
|
|
5
5
|
}
|
|
6
6
|
static get is() { return "xplor-dropdown"; }
|
|
7
7
|
static get encapsulation() { return "shadow"; }
|
|
@@ -26,16 +26,16 @@ export class XplorExpansionPanel {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
render() {
|
|
29
|
-
return (h(Host, { key: '
|
|
29
|
+
return (h(Host, { key: 'ec0cf0741d58e980e3fe9897d3b79908f19eac8d' }, h("div", { key: 'a5e1676b6646e8d0414d774408a072d96d230ef3', class: {
|
|
30
30
|
'expansion-panel': true,
|
|
31
31
|
'expansion-panel--open': this.open,
|
|
32
32
|
'expansion-panel--disabled': this.disabled,
|
|
33
|
-
} }, h("button", { key: '
|
|
33
|
+
} }, h("button", { key: '5b56717fd245896ee650b5d5eb05343ec9995f15', class: "expansion-panel__header", onClick: this.handleToggle, disabled: this.disabled, "aria-expanded": this.open ? 'true' : 'false', "aria-controls": `${this.panelId}-content`, type: "button" }, h("div", { key: 'd24e0e3633e513039f0341304f164095f95984bd', class: "expansion-panel__header-content" }, h("slot", { key: 'a58f1a4fd78d57f8e4a89d1c325ea0f24347ccaf', name: "header" })), h("span", { key: '0b1d9eb011ef40275de9d827b3a901acf9662d64', class: {
|
|
34
34
|
'expansion-panel__icon': true,
|
|
35
35
|
'expansion-panel__icon--open': this.open,
|
|
36
|
-
} }, "\u25BC")), h("div", { key: '
|
|
36
|
+
} }, "\u25BC")), h("div", { key: '39a23cb9cd76993be5e684100f1b10c4591ac7b1', class: "expansion-panel__content", id: `${this.panelId}-content`, role: "region", "aria-labelledby": this.panelId, style: {
|
|
37
37
|
maxHeight: this.open ? `${this.contentHeight}px` : '0',
|
|
38
|
-
} }, h("div", { key: '
|
|
38
|
+
} }, h("div", { key: '11926bcbf205bb3acc9cba477b9f623c9d5c78ea', class: "expansion-panel__content-inner", ref: (el) => (this.contentEl = el) }, h("slot", { key: '6cc362dfb63dd256422b1dfdcb1532d794feddbe' }))))));
|
|
39
39
|
}
|
|
40
40
|
static get is() { return "xplor-expansion-panel"; }
|
|
41
41
|
static get encapsulation() { return "scoped"; }
|
|
@@ -33,7 +33,7 @@ export class XplorExpansionPanels {
|
|
|
33
33
|
this.value = this.multiple ? Array.from(this.openPanels) : Array.from(this.openPanels)[0] || '';
|
|
34
34
|
}
|
|
35
35
|
render() {
|
|
36
|
-
return (h(Host, { key: '
|
|
36
|
+
return (h(Host, { key: '915aad4dd0665cd44e3b784ce6f39e30972fa720' }, h("div", { key: 'f608e9bd9234b6a57bd06d4f7c843ac4b9ef5a38', class: "expansion-panels", "aria-label": "Accordion" }, h("slot", { key: '30b0c595f0c4e503dbe8e144c3805be2a8d4aed5' }))));
|
|
37
37
|
}
|
|
38
38
|
static get is() { return "xplor-expansion-panels"; }
|
|
39
39
|
static get encapsulation() { return "scoped"; }
|
|
@@ -134,11 +134,11 @@ export class XplorFileUpload {
|
|
|
134
134
|
return Math.round(bytes / Math.pow(k, i) * 100) / 100 + ' ' + sizes[i];
|
|
135
135
|
}
|
|
136
136
|
render() {
|
|
137
|
-
return (h(Host, { key: '
|
|
137
|
+
return (h(Host, { key: 'cf146eb8fadc05f46253e96a189508447ab7b3d4' }, h("div", { key: '672ebaac1aa611f51b673d5d23f04bf7874ab376', class: "file-upload" }, h("div", { key: '8c59c36125bb7e99940a8208e0db3978499b5728', class: {
|
|
138
138
|
'file-upload__dropzone': true,
|
|
139
139
|
'file-upload__dropzone--dragging': this.isDragging,
|
|
140
140
|
'file-upload__dropzone--disabled': this.disabled,
|
|
141
|
-
}, onDragOver: this.handleDragOver, onDragLeave: this.handleDragLeave, onDrop: this.handleDrop, "aria-label": `Drop zone for file upload. ${this.accepts !== '*/*' ? `Accepts: ${this.accepts}.` : ''} Maximum size: ${this.formatFileSize(this.maxSize)}` }, h("input", { key: '
|
|
141
|
+
}, onDragOver: this.handleDragOver, onDragLeave: this.handleDragLeave, onDrop: this.handleDrop, "aria-label": `Drop zone for file upload. ${this.accepts !== '*/*' ? `Accepts: ${this.accepts}.` : ''} Maximum size: ${this.formatFileSize(this.maxSize)}` }, h("input", { key: '1f3125b36debba5fb8931850154b6cc0a3ebcf40', ref: (el) => (this.fileInputEl = el), type: "file", accept: this.accepts, multiple: this.multiple, disabled: this.disabled, onChange: this.handleFileSelect, class: "file-upload__input" }), h("div", { key: '5956b2840433dfa4dd2d8874bcaa133dc13b2468', class: "file-upload__content" }, h("svg", { key: '90c23bc86b89941009eecaec7ac786c0822d3e7b', class: "file-upload__icon", width: "48", height: "48", viewBox: "0 0 24 24", fill: "none" }, h("path", { key: '6a638d3c13e465d9b2b8c2c0b298a3e9da5fd06f', d: "M12 15V3M12 3L8 7M12 3L16 7", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), h("path", { key: '535d50c699a4367b88e62f007a3d3d6d53347dbc', d: "M2 17L2 19C2 20.1046 2.89543 21 4 21L20 21C21.1046 21 22 20.1046 22 19L22 17", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round" })), h("p", { key: '83531b59abf5b300c2e850c057f90e1b82996210', class: "file-upload__text" }, "Drag & drop files here or", ' ', h("button", { key: '5ea856d24ce7b87ebdfae3274ec9199cad0c0b20', type: "button", class: "file-upload__button", onClick: this.handleButtonClick, disabled: this.disabled }, this.label)), h("p", { key: '3a5bf9ef84a50d26a7ab86bc97fa1b38db239c03', class: "file-upload__hint" }, "Max size: ", this.formatFileSize(this.maxSize), this.accepts !== '*/*' && ` • Accepts: ${this.accepts}`))), this.error && (h("div", { key: 'a78d9953e8356c6bb43ac13341fb9f211ae2694b', class: "file-upload__error", role: "alert" }, this.error)), this.files.length > 0 && (h("div", { key: '4d88ddac01a98bd991fed2fdf190cc9f095707a4', class: "file-upload__files" }, this.files.map((file) => (h("div", { key: file.id, class: "file-upload__file" }, file.dataUrl && (h("img", { src: file.dataUrl, alt: file.name, class: "file-upload__preview" })), h("div", { class: "file-upload__file-info" }, h("span", { class: "file-upload__file-name", title: file.name }, file.name), h("span", { class: "file-upload__file-size" }, this.formatFileSize(file.size))), h("button", { type: "button", class: "file-upload__remove", onClick: () => this.handleRemoveFile(file), "aria-label": `Remove ${file.name}` }, "\u00D7")))))))));
|
|
142
142
|
}
|
|
143
143
|
static get is() { return "xplor-file-upload"; }
|
|
144
144
|
static get encapsulation() { return "scoped"; }
|
|
@@ -300,7 +300,7 @@ export class XplorFileUpload {
|
|
|
300
300
|
"references": {
|
|
301
301
|
"UploadedFile": {
|
|
302
302
|
"location": "local",
|
|
303
|
-
"path": "/Users/
|
|
303
|
+
"path": "/Users/darryn.lee-warden/Documents/DEV/xplor_design_system/apps/core-stencil-components/src/components/xplor-file-upload/xplor-file-upload.tsx",
|
|
304
304
|
"id": "src/components/xplor-file-upload/xplor-file-upload.tsx::UploadedFile"
|
|
305
305
|
}
|
|
306
306
|
}
|
|
@@ -321,7 +321,7 @@ export class XplorFileUpload {
|
|
|
321
321
|
"references": {
|
|
322
322
|
"UploadedFile": {
|
|
323
323
|
"location": "local",
|
|
324
|
-
"path": "/Users/
|
|
324
|
+
"path": "/Users/darryn.lee-warden/Documents/DEV/xplor_design_system/apps/core-stencil-components/src/components/xplor-file-upload/xplor-file-upload.tsx",
|
|
325
325
|
"id": "src/components/xplor-file-upload/xplor-file-upload.tsx::UploadedFile"
|
|
326
326
|
}
|
|
327
327
|
}
|
|
@@ -33,9 +33,9 @@ export class XplorInlineCheckbox {
|
|
|
33
33
|
'xplor-inline-checkbox--disabled': this.disabled,
|
|
34
34
|
'xplor-inline-checkbox--checked': this.checked,
|
|
35
35
|
};
|
|
36
|
-
return (h(Host, { key: '
|
|
36
|
+
return (h(Host, { key: '6c625424d179755dd930d006c64b6a172f393b19' }, h("label", { key: 'c4fb7542f9e62050bdcaef33a46f80e9fa37fe90', class: containerClasses }, h("input", { key: '0c116552b286e2b7f43196cb4bf8eaf823cc6472', type: "checkbox", class: "xplor-inline-checkbox__input", checked: this.checked, value: this.value, disabled: this.disabled, indeterminate: this.indeterminate, onChange: this.handleChange, style: {
|
|
37
37
|
accentColor: this.color,
|
|
38
|
-
} }), this.label && h("span", { key: '
|
|
38
|
+
} }), this.label && h("span", { key: '1b8a24dffab83791a336d84dd92385f068ffc595', class: "xplor-inline-checkbox__label" }, this.label), h("slot", { key: '224e152167e79a599c6ad72cd60c3ed225a37a1b' }))));
|
|
39
39
|
}
|
|
40
40
|
static get is() { return "xplor-inline-checkbox"; }
|
|
41
41
|
static get encapsulation() { return "scoped"; }
|
|
@@ -206,7 +206,7 @@ export class XplorInlineDatePicker {
|
|
|
206
206
|
render() {
|
|
207
207
|
const sidebarDate = this.getSidebarDate();
|
|
208
208
|
const dayHeaders = this.startWeekOnSunday ? this.dayNames : this.dayNamesStartMonday;
|
|
209
|
-
return (h(Host, { key: '
|
|
209
|
+
return (h(Host, { key: '0e2c9ee42cbe61406ab4bac151dbf0e40475ed23' }, h("div", { key: '5e4a7875966f6f4a37f81446d58b68672c35dac3', class: "xplor-inline-date-picker", style: { '--picker-color': this.color } }, h("div", { key: 'fa29ee023214d89bed7ceb205578f8be89e09337', class: "xplor-inline-date-picker__sidebar" }, h("div", { key: '556e7992f45d9bc4ad0b0b9dd1fdd08d4b69c5d9', class: "xplor-inline-date-picker__sidebar-year" }, sidebarDate.year), h("div", { key: '0b581be2477f17c0d80dbce52fc2ad3d31e9b0a3', class: "xplor-inline-date-picker__sidebar-day" }, sidebarDate.day, ","), h("div", { key: 'd17c951c734d23365dce0c417e53e215a6d810c8', class: "xplor-inline-date-picker__sidebar-date" }, sidebarDate.date)), h("div", { key: '0829d8eac4d5300c425c0bc3540fb7e2a67a8127', class: "xplor-inline-date-picker__calendar" }, h("div", { key: '026c1ffc57ca6ebc8c81d9ca5168b06108fb98fa', class: "xplor-inline-date-picker__header" }, h("button", { key: 'a3093ab8152b08681ffb746bd2441e64ea0ad117', type: "button", class: "xplor-inline-date-picker__arrow", onClick: this.previousMonth, "aria-label": "Previous month" }, "\u2039"), h("div", { key: '924e78c2f181360b899816a64403470029667876', class: "xplor-inline-date-picker__title" }, this.monthNames[this.currentMonth], " ", this.currentYear), h("button", { key: 'b9d70ec267b289f7c9c920eb12ee19b0f94d2852', type: "button", class: "xplor-inline-date-picker__arrow", onClick: this.nextMonth, "aria-label": "Next month" }, "\u203A")), h("div", { key: 'd9cddf3b2ec7a57d489fdc9dfb97a48b4e04836a', class: "xplor-inline-date-picker__weekdays" }, dayHeaders.map((day) => (h("div", { class: "xplor-inline-date-picker__weekday" }, day)))), h("div", { key: 'bfed53b3822299f0c9c42f7662cff6b0e7dcdc48', class: "xplor-inline-date-picker__days", role: "grid" }, this.renderCalendarDays())))));
|
|
210
210
|
}
|
|
211
211
|
static get is() { return "xplor-inline-date-picker"; }
|
|
212
212
|
static get encapsulation() { return "scoped"; }
|
|
@@ -29,7 +29,7 @@ export class XplorInlineSwitch {
|
|
|
29
29
|
'xplor-inline-switch--disabled': this.disabled,
|
|
30
30
|
'xplor-inline-switch--checked': this.checked,
|
|
31
31
|
};
|
|
32
|
-
return (h(Host, { key: '
|
|
32
|
+
return (h(Host, { key: '40c4b15ff78042a8ef5ee7055e10f694bfdd1157' }, h("label", { key: '2105c92c9277a8ba7c4b69a8f72678181bf5b1a8', class: containerClasses, style: { '--switch-color': this.color } }, h("input", { key: '4165706883a4b517e8c5413d7e1421fff1b96bac', type: "checkbox", class: "xplor-inline-switch__input", checked: this.checked, value: this.value, disabled: this.disabled, onChange: this.handleChange }), h("span", { key: '94dab33872aee8012cd05101e8fbb69bd940b098', class: "xplor-inline-switch__track" }, h("span", { key: '82ef76b07835561676897ba35c268bb565a4150f', class: "xplor-inline-switch__thumb" })), this.label && h("span", { key: '1e0f0c5abf6f3c6af2d7313e750f29b03b42e4e9', class: "xplor-inline-switch__label" }, this.label), h("slot", { key: '6fcdc1730d652bcca0d5c629cc66266abb86574e' }))));
|
|
33
33
|
}
|
|
34
34
|
static get is() { return "xplor-inline-switch"; }
|
|
35
35
|
static get encapsulation() { return "scoped"; }
|
|
@@ -77,7 +77,7 @@ export class XplorInputFile {
|
|
|
77
77
|
};
|
|
78
78
|
const visibleFiles = this.selectedFiles.slice(0, this.maxChips);
|
|
79
79
|
const additionalCount = this.selectedFiles.length - this.maxChips;
|
|
80
|
-
return (h(Host, { key: '
|
|
80
|
+
return (h(Host, { key: '6046d07e1d0ffc22eb241e951c6adffad6c3e3de' }, h("div", { key: '7cedfc886300027a00eb38ac657c09b2445d37cf', class: containerClasses }, this.label && (h("label", { key: '2c0e0b16e4d2e9c4a7a49874a00a7ad9592021d1', class: "xplor-input-file__label", htmlFor: this.inputId }, this.label)), h("div", { key: '4aa03e8dd2c2b33ad6b21d5ff5e23f2f5777e7ed', class: "xplor-input-file__field" }, h("span", { key: '5e0ee10df523cf58f2b4858c2c3f7520734812ce', class: "xplor-input-file__icon" }, this.prependInnerIcon), h("div", { key: '30075554073f992c027c976bd776a70e55a54f96', class: "xplor-input-file__content" }, this.selectedFiles.length === 0 ? (h("span", { class: "xplor-input-file__placeholder" }, this.placeholder)) : (h("div", { class: "xplor-input-file__chips" }, visibleFiles.map((file) => (h("div", { class: "xplor-input-file__chip", key: file.name }, h("span", { class: "xplor-input-file__chip-text" }, file.name), this.showSize && file.size && (h("span", { class: "xplor-input-file__chip-size" }, "(", this.formatFileSize(file.size), ")"))))), additionalCount > 0 && (h("span", { class: "xplor-input-file__additional" }, "+", additionalCount, " additional file", additionalCount > 1 ? 's' : ''))))), this.selectedFiles.length > 0 && !this.disabled && (h("button", { key: 'fedfcf641b1a9e11f86e1d8f24b1591d5d3b7324', type: "button", class: "xplor-input-file__clear", onClick: this.handleClear, "aria-label": "Clear" }, "\u2715")), h("input", { key: '51216edbb463cc891afe25cbb740fc9e39188bc6', id: this.inputId, ref: (el) => (this.fileInputRef = el), type: "file", class: "xplor-input-file__input", multiple: this.multiple, accept: this.accept, disabled: this.disabled, onChange: this.handleFileChange, "aria-label": this.label || 'Choose file' })), this.counter && this.selectedFiles.length > 0 && (h("div", { key: '1eb9aa1da01c8892326a270675f9e6c02548276c', class: "xplor-input-file__counter" }, this.selectedFiles.length, " file", this.selectedFiles.length > 1 ? 's' : '', " selected")))));
|
|
81
81
|
}
|
|
82
82
|
static get is() { return "xplor-input-file"; }
|
|
83
83
|
static get encapsulation() { return "scoped"; }
|
|
@@ -48,9 +48,9 @@ export class XplorInputSearch {
|
|
|
48
48
|
'xplor-input-search--focused': this.isFocused,
|
|
49
49
|
'xplor-input-search--disabled': this.disabled,
|
|
50
50
|
};
|
|
51
|
-
return (h(Host, { key: '
|
|
51
|
+
return (h(Host, { key: '9a6ee3c5c790fd37995f34937090bd5400c87a3b' }, h("div", { key: 'e2dc574436c7acf421bbd1294a2eb2fed5449e88', class: containerClasses }, h("div", { key: 'aada1f1d2824b93e4595316a02a9dd7363b2afc0', class: "xplor-input-search__field" }, h("input", { key: 'ef5b78b7f259c38bcbf7757ea551a71db2a2e22c', id: this.inputId, type: "search", class: "xplor-input-search__input", value: this.value, placeholder: this.placeholder, disabled: this.disabled, onInput: this.handleInput, onKeyDown: this.handleKeyDown, onFocus: () => (this.isFocused = true), onBlur: () => (this.isFocused = false), style: {
|
|
52
52
|
backgroundColor: this.bgColor,
|
|
53
|
-
}, role: "searchbox", "aria-label": "Search" }), h("slot", { key: '
|
|
53
|
+
}, role: "searchbox", "aria-label": "Search" }), h("slot", { key: 'fd71c5fdbe26ca8a9a151ae6423d88736d145d61', name: "append-inner" }, h("button", { key: 'bba0473372fcf00b1499e73ed134ad8b0500b95f', type: "button", class: "xplor-input-search__button", onClick: this.handleSearch, disabled: this.disabled, "data-testid": "input-search-button", "aria-label": "Search" }, h("svg", { key: '6d5a1c9c1cf80194cc8451824e212e2b9d667ad6', viewBox: "0 0 24 24", class: "xplor-input-search__icon" }, h("path", { key: '7907dad7eec82444844b1938437a9ad28946d5cb', d: "M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z" }))))))));
|
|
54
54
|
}
|
|
55
55
|
static get is() { return "xplor-input-search"; }
|
|
56
56
|
static get encapsulation() { return "scoped"; }
|
|
@@ -223,7 +223,7 @@ export class XplorInputSelect {
|
|
|
223
223
|
if (!this.error && this.helperText)
|
|
224
224
|
describedByParts.push(helperId);
|
|
225
225
|
const ariaDescribedBy = describedByParts.length > 0 ? describedByParts.join(' ') : undefined;
|
|
226
|
-
return (h(Host, { key: '
|
|
226
|
+
return (h(Host, { key: '19c2267c0d4185dcb92a346a876b55c3371c071f' }, h("div", { key: 'fd506ff00dfbf41d28537f0ca9e30d72729285d9', class: containerClasses, ref: (el) => (this.selectRef = el) }, this.label && (h("label", { key: '33bdce10e83128e2a742a274e3ff3d918b8b4e45', class: "xplor-input-select__label", id: labelId }, this.label, this.required && h("span", { key: '9326a0077c2acd34f2f4a123f79e3342f7610557', class: "xplor-input-select__required" }, "*"))), h("div", { key: '7d632eed242ac59dbe8d856d2c354149b83a51bf', class: "xplor-input-select__field", onClick: this.toggleDropdown, ref: (el) => (this.fieldRef = el), role: "combobox", tabindex: this.disabled ? -1 : 0, "aria-expanded": this.isOpen ? 'true' : 'false', "aria-haspopup": "listbox", "aria-controls": this.isOpen ? listboxId : undefined, "aria-activedescendant": activeDescendantId, "aria-labelledby": this.label ? labelId : undefined, "aria-label": !this.label ? (this.ariaLabel || this.placeholder) : undefined, "aria-describedby": ariaDescribedBy, "aria-required": this.required ? 'true' : undefined, "aria-disabled": this.disabled ? 'true' : undefined }, h("div", { key: 'd07d43f99e57bec7338699b56d9bcf9f3e4b287a', class: "xplor-input-select__value" }, this.getDisplayValue()), h("span", { key: '342d784c9b51bb11aebef84ae658d2c5546e12d5', class: "xplor-input-select__arrow", "aria-hidden": "true" }, this.isOpen ? '▲' : '▼')), this.isOpen && this.menuPosition && (h("div", { key: '18d8c79f781f348e646771c274a7ec3fcc880fdf', class: "xplor-input-select__menu", role: "listbox", id: listboxId, "aria-label": this.label || this.ariaLabel || 'Options', "aria-multiselectable": this.multiple ? 'true' : undefined, style: {
|
|
227
227
|
position: 'fixed',
|
|
228
228
|
top: `${this.menuPosition.top}px`,
|
|
229
229
|
left: `${this.menuPosition.left}px`,
|
|
@@ -235,7 +235,7 @@ export class XplorInputSelect {
|
|
|
235
235
|
'xplor-input-select__option--selected': selected,
|
|
236
236
|
'xplor-input-select__option--highlighted': index === this.highlightedIndex,
|
|
237
237
|
}, onClick: () => this.handleOptionClick(option) }, this.multiple && (h("input", { type: "checkbox", class: "xplor-input-select__checkbox", checked: selected, readOnly: true, tabindex: -1, "aria-checked": selected ? 'true' : 'false', "aria-hidden": "true" })), h("div", { class: "xplor-input-select__option-content" }, h("div", { class: "xplor-input-select__option-title" }, option.title), option.subtitle && (h("div", { class: "xplor-input-select__option-subtitle" }, option.subtitle)))));
|
|
238
|
-
})))), showDetails && (h("div", { key: '
|
|
238
|
+
})))), showDetails && (h("div", { key: 'f2d51f7549e0fafdf125bf492cd3981e13a10ef9', class: "xplor-input-select__details" }, this.error && h("div", { key: '028e8f2d27dcfc3888f078c02311879a93935db4', class: "xplor-input-select__error-message", id: errorId, role: "alert" }, this.error), !this.error && this.helperText && h("div", { key: '200b65f2a002c6ba54a7d638e2cba2850bdf526f', class: "xplor-input-select__helper-text", id: helperId }, this.helperText))))));
|
|
239
239
|
}
|
|
240
240
|
static get is() { return "xplor-input-select"; }
|
|
241
241
|
static get encapsulation() { return "scoped"; }
|
|
@@ -340,7 +340,7 @@ export class XplorInputSelect {
|
|
|
340
340
|
"references": {
|
|
341
341
|
"SelectOption": {
|
|
342
342
|
"location": "local",
|
|
343
|
-
"path": "/Users/
|
|
343
|
+
"path": "/Users/darryn.lee-warden/Documents/DEV/xplor_design_system/apps/core-stencil-components/src/components/xplor-input-select/xplor-input-select.tsx",
|
|
344
344
|
"id": "src/components/xplor-input-select/xplor-input-select.tsx::SelectOption"
|
|
345
345
|
}
|
|
346
346
|
}
|
|
@@ -36,10 +36,10 @@ export class XplorInputSend {
|
|
|
36
36
|
this.internalValue = this.value;
|
|
37
37
|
}
|
|
38
38
|
render() {
|
|
39
|
-
return (h(Host, { key: '
|
|
39
|
+
return (h(Host, { key: '856b9171408964c11a5ed8d7fc06bdf559e9d43b' }, h("div", { key: '1f53244b4bf383f38c76339736b40ccc6c74bd63', class: {
|
|
40
40
|
'input-send': true,
|
|
41
41
|
'input-send--disabled': this.disabled,
|
|
42
|
-
} }, h("input", { key: '
|
|
42
|
+
} }, h("input", { key: 'ab7f0a797f7eb6e56516498abd0e5d29de0f9403', ref: (el) => (this.inputEl = el), type: "text", class: "input-send__input", placeholder: this.placeholder, value: this.internalValue, onInput: this.handleInput, onKeyDown: this.handleKeyDown, disabled: this.disabled, maxLength: this.maxLength, "aria-label": this.placeholder || 'Type a message' }), h("xplor-button", { key: '2213d6749d7e8412061d6d6adc97b93b18c573cb', class: "input-send__button", text: this.buttonText, type: this.disabled || !this.internalValue.trim() ? 'disabled' : this.buttonType, onClick: this.handleSend }))));
|
|
43
43
|
}
|
|
44
44
|
static get is() { return "xplor-input-send"; }
|
|
45
45
|
static get encapsulation() { return "scoped"; }
|
|
@@ -273,12 +273,6 @@ ul.mdc-list li.mdc-list-item {
|
|
|
273
273
|
.xplor-input-text {
|
|
274
274
|
display: flex;
|
|
275
275
|
flex-direction: column;
|
|
276
|
-
gap: 0.25rem;
|
|
277
|
-
}
|
|
278
|
-
.xplor-input-text__label {
|
|
279
|
-
font-size: 0.875rem;
|
|
280
|
-
color: rgba(0, 0, 0, 0.6);
|
|
281
|
-
margin-bottom: 0.25rem;
|
|
282
276
|
}
|
|
283
277
|
.xplor-input-text__required {
|
|
284
278
|
color: #d32f2f;
|
|
@@ -289,6 +283,21 @@ ul.mdc-list li.mdc-list-item {
|
|
|
289
283
|
display: flex;
|
|
290
284
|
align-items: center;
|
|
291
285
|
}
|
|
286
|
+
.xplor-input-text__label {
|
|
287
|
+
position: absolute;
|
|
288
|
+
left: 1rem;
|
|
289
|
+
top: 50%;
|
|
290
|
+
transform: translateY(-50%);
|
|
291
|
+
font-size: 1rem;
|
|
292
|
+
color: rgba(0, 0, 0, 0.6);
|
|
293
|
+
pointer-events: none;
|
|
294
|
+
padding: 0 0.25rem;
|
|
295
|
+
transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), top 0.15s cubic-bezier(0.4, 0, 0.2, 1), font-size 0.15s cubic-bezier(0.4, 0, 0.2, 1), color 0.15s cubic-bezier(0.4, 0, 0.2, 1);
|
|
296
|
+
max-width: calc(100% - 2rem);
|
|
297
|
+
overflow: hidden;
|
|
298
|
+
text-overflow: ellipsis;
|
|
299
|
+
white-space: nowrap;
|
|
300
|
+
}
|
|
292
301
|
.xplor-input-text__input {
|
|
293
302
|
width: 100%;
|
|
294
303
|
padding: 0.875rem 1rem;
|
|
@@ -297,18 +306,14 @@ ul.mdc-list li.mdc-list-item {
|
|
|
297
306
|
border: 1px solid rgba(0, 0, 0, 0.23);
|
|
298
307
|
border-radius: 1rem;
|
|
299
308
|
outline: none;
|
|
300
|
-
transition: border-color 0.
|
|
309
|
+
transition: border-color 0.15s cubic-bezier(0.4, 0, 0.2, 1), border-width 0.15s cubic-bezier(0.4, 0, 0.2, 1);
|
|
310
|
+
min-height: 3rem;
|
|
301
311
|
}
|
|
302
312
|
.xplor-input-text__input::placeholder {
|
|
303
313
|
color: rgba(0, 0, 0, 0.38);
|
|
304
314
|
}
|
|
305
315
|
.xplor-input-text__input:hover:not(:disabled) {
|
|
306
|
-
border-color: rgba(0, 0, 0, 0.
|
|
307
|
-
}
|
|
308
|
-
.xplor-input-text__input:focus {
|
|
309
|
-
border-color: #008480;
|
|
310
|
-
border-width: 2px;
|
|
311
|
-
padding: calc(0.875rem - 1px) calc(1rem - 1px);
|
|
316
|
+
border-color: rgba(0, 0, 0, 0.87);
|
|
312
317
|
}
|
|
313
318
|
.xplor-input-text__input:disabled {
|
|
314
319
|
background-color: rgba(0, 0, 0, 0.04);
|
|
@@ -318,9 +323,32 @@ ul.mdc-list li.mdc-list-item {
|
|
|
318
323
|
.xplor-input-text__input:read-only {
|
|
319
324
|
background-color: rgba(0, 0, 0, 0.04);
|
|
320
325
|
}
|
|
326
|
+
.xplor-input-text--floating .xplor-input-text__label {
|
|
327
|
+
top: 0;
|
|
328
|
+
transform: translateY(-50%);
|
|
329
|
+
font-size: 0.75rem;
|
|
330
|
+
}
|
|
331
|
+
.xplor-input-text--focused .xplor-input-text__input {
|
|
332
|
+
border-color: #008480;
|
|
333
|
+
border-width: 2px;
|
|
334
|
+
padding: calc(0.875rem - 1px) calc(1rem - 1px);
|
|
335
|
+
}
|
|
336
|
+
.xplor-input-text--focused .xplor-input-text__label {
|
|
337
|
+
color: #008480;
|
|
338
|
+
}
|
|
321
339
|
.xplor-input-text--error .xplor-input-text__input {
|
|
322
340
|
border-color: #d32f2f;
|
|
323
341
|
}
|
|
342
|
+
.xplor-input-text--error .xplor-input-text__label {
|
|
343
|
+
color: #d32f2f;
|
|
344
|
+
}
|
|
345
|
+
.xplor-input-text--error.xplor-input-text--focused .xplor-input-text__input {
|
|
346
|
+
border-color: #d32f2f;
|
|
347
|
+
border-width: 2px;
|
|
348
|
+
}
|
|
349
|
+
.xplor-input-text--disabled .xplor-input-text__label {
|
|
350
|
+
color: rgba(0, 0, 0, 0.38);
|
|
351
|
+
}
|
|
324
352
|
.xplor-input-text__details {
|
|
325
353
|
min-height: 1.25rem;
|
|
326
354
|
padding: 0 1rem;
|
|
@@ -74,16 +74,19 @@ export class XplorInputText {
|
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
render() {
|
|
77
|
+
const hasValue = this.value != null && this.value !== '';
|
|
78
|
+
const isFloating = this.isFocused || hasValue;
|
|
77
79
|
const containerClasses = {
|
|
78
80
|
'xplor-input-text': true,
|
|
79
81
|
'xplor-input-text--focused': this.isFocused,
|
|
82
|
+
'xplor-input-text--floating': isFloating,
|
|
80
83
|
'xplor-input-text--disabled': this.disabled,
|
|
81
84
|
'xplor-input-text--error': !!this.error,
|
|
82
85
|
};
|
|
83
86
|
const showDetails = this.hideDetails === false || (this.hideDetails === 'auto' && (this.error || this.helperText));
|
|
84
|
-
return (h(Host, { key: '
|
|
87
|
+
return (h(Host, { key: '764b3d65709568ba47eed1daec32340a9f4ddf3a' }, h("div", { key: '50aa5c726722ac0a1406b1aeb6f4652b0021c93c', class: containerClasses }, h("div", { key: 'e6879bbf287bd46a2398ce21e877a93eec23ccca', class: "xplor-input-text__field" }, h("input", { key: '847eb323f86c24317a67ec95ff7091680b816f18', id: this.inputId, type: this.type, class: "xplor-input-text__input", value: this.value, placeholder: isFloating ? this.placeholder : '', disabled: this.disabled, readonly: this.readonly, required: this.required, onInput: this.handleInput, onChange: this.handleChange, onFocus: this.handleFocus, onBlur: this.handleBlur, style: {
|
|
85
88
|
backgroundColor: this.bgColor,
|
|
86
|
-
}, "aria-invalid": this.error ? 'true' : undefined, "aria-required": this.required ? 'true' : undefined, "aria-describedby": this.error ? this.errorId : this.helperText ? this.helperId : undefined }), h("slot", { key: '
|
|
89
|
+
}, "aria-invalid": this.error ? 'true' : undefined, "aria-required": this.required ? 'true' : undefined, "aria-describedby": this.error ? this.errorId : this.helperText ? this.helperId : undefined }), this.label && (h("label", { key: '3f135039ab03449cad21ce93071bd7b597d65d40', class: "xplor-input-text__label", htmlFor: this.inputId, style: { backgroundColor: this.bgColor } }, this.label, this.required && h("span", { key: 'a3d04091abd40736d9b3d00c8796355c4ae8bf30', class: "xplor-input-text__required" }, "*"))), h("slot", { key: '290d13fe4c82231ff3341c60f9bffb319ab686d0', name: "append-inner" })), showDetails && (h("div", { key: 'c38de9592f5a0520e8ac18aa64f4d88c9db9b62e', class: "xplor-input-text__details" }, this.error && h("div", { key: '3535de57296c0b265d701dac604bdf65c4bd6801', class: "xplor-input-text__error-message", id: this.errorId }, this.error), !this.error && this.helperText && h("div", { key: '46003ab056e8677ef304a007610ff95b07434482', class: "xplor-input-text__helper-text", id: this.helperId }, this.helperText))), h("slot", { key: 'c4a0dda405f82c24df42e82b029ccc3e9cfcc7ad', name: "append" }))));
|
|
87
90
|
}
|
|
88
91
|
static get is() { return "xplor-input-text"; }
|
|
89
92
|
static get encapsulation() { return "scoped"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xplor-input-text.js","sourceRoot":"","sources":["../../../src/components/xplor-input-text/xplor-input-text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAgB,KAAK,EAAE,MAAM,eAAe,CAAC;AAErF,IAAI,kBAAkB,GAAG,CAAC,CAAC;AAO3B,MAAM,OAAO,cAAc;IAL3B;QAMU,YAAO,GAAG,oBAAoB,EAAE,kBAAkB,EAAE,CAAC;QACrD,YAAO,GAAG,GAAG,IAAI,CAAC,OAAO,QAAQ,CAAC;QAClC,aAAQ,GAAG,GAAG,IAAI,CAAC,OAAO,SAAS,CAAC;QAC5C;;WAEG;QACsB,UAAK,GAAW,EAAE,CAAC;QAE5C;;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DAAM,IAAI,EAAC,cAAc,GAAG,CACxB;gBAEL,WAAW,IAAI,CACd,4DAAK,KAAK,EAAC,2BAA2B;oBACnC,IAAI,CAAC,KAAK,IAAI,4DAAK,KAAK,EAAC,iCAAiC,EAAC,EAAE,EAAE,IAAI,CAAC,OAAO,IAAG,IAAI,CAAC,KAAK,CAAO;oBAC/F,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,UAAU,IAAI,4DAAK,KAAK,EAAC,+BAA+B,EAAC,EAAE,EAAE,IAAI,CAAC,QAAQ,IAAG,IAAI,CAAC,UAAU,CAAO,CACpH,CACP;gBAED,6DAAM,IAAI,EAAC,QAAQ,GAAG,CAClB,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop, Event, EventEmitter, State } from '@stencil/core';\n\nlet inputTextIdCounter = 0;\n\n@Component({\n tag: 'xplor-input-text',\n styleUrl: 'xplor-input-text.scss',\n scoped: true,\n})\nexport class XplorInputText {\n private inputId = `xplor-input-text-${++inputTextIdCounter}`;\n private errorId = `${this.inputId}-error`;\n private helperId = `${this.inputId}-helper`;\n /**\n * Input value\n */\n @Prop({ mutable: true }) value: string = '';\n\n /**\n * Input label\n */\n @Prop() label: string = '';\n\n /**\n * Input placeholder\n */\n @Prop() placeholder: string = '';\n\n /**\n * Input type (text, email, password, number, etc.)\n */\n @Prop() type: string = 'text';\n\n /**\n * Background color\n */\n @Prop() bgColor: string = 'white';\n\n /**\n * Border/focus color\n */\n @Prop() color: string = '#008480';\n\n /**\n * Whether the input is disabled\n */\n @Prop() disabled: boolean = false;\n\n /**\n * Whether the input is readonly\n */\n @Prop() readonly: boolean = false;\n\n /**\n * Whether to hide validation details\n */\n @Prop() hideDetails: boolean | 'auto' = 'auto';\n\n /**\n * Error message\n */\n @Prop() error: string = '';\n\n /**\n * Helper text\n */\n @Prop() helperText: string = '';\n\n /**\n * Whether the input is required\n */\n @Prop() required: boolean = false;\n\n /**\n * Input event\n */\n @Event() xplorInput: EventEmitter<string>;\n\n /**\n * Change event\n */\n @Event() xplorChange: EventEmitter<string>;\n\n /**\n * Focus event\n */\n @Event() xplorFocus: EventEmitter<FocusEvent>;\n\n /**\n * Blur event\n */\n @Event() xplorBlur: EventEmitter<FocusEvent>;\n\n @State() isFocused: boolean = false;\n\n private handleInput = (event: Event) => {\n const target = event.target as HTMLInputElement;\n this.value = target.value;\n this.xplorInput.emit(this.value);\n };\n\n private handleChange = (event: Event) => {\n const target = event.target as HTMLInputElement;\n this.value = target.value;\n this.xplorChange.emit(this.value);\n };\n\n private handleFocus = (event: FocusEvent) => {\n this.isFocused = true;\n this.xplorFocus.emit(event);\n };\n\n private handleBlur = (event: FocusEvent) => {\n this.isFocused = false;\n this.xplorBlur.emit(event);\n };\n\n render() {\n const hasValue = this.value != null && this.value !== '';\n const isFloating = this.isFocused || hasValue;\n\n const containerClasses = {\n 'xplor-input-text': true,\n 'xplor-input-text--focused': this.isFocused,\n 'xplor-input-text--floating': isFloating,\n 'xplor-input-text--disabled': this.disabled,\n 'xplor-input-text--error': !!this.error,\n };\n\n const showDetails = this.hideDetails === false || (this.hideDetails === 'auto' && (this.error || this.helperText));\n\n return (\n <Host>\n <div class={containerClasses}>\n <div class=\"xplor-input-text__field\">\n <input\n id={this.inputId}\n type={this.type}\n class=\"xplor-input-text__input\"\n value={this.value}\n placeholder={isFloating ? this.placeholder : ''}\n disabled={this.disabled}\n readonly={this.readonly}\n required={this.required}\n onInput={this.handleInput}\n onChange={this.handleChange}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n style={{\n backgroundColor: this.bgColor,\n }}\n aria-invalid={this.error ? 'true' : undefined}\n aria-required={this.required ? 'true' : undefined}\n aria-describedby={this.error ? this.errorId : this.helperText ? this.helperId : undefined}\n />\n {this.label && (\n <label\n class=\"xplor-input-text__label\"\n htmlFor={this.inputId}\n style={{ backgroundColor: this.bgColor }}\n >\n {this.label}\n {this.required && <span class=\"xplor-input-text__required\">*</span>}\n </label>\n )}\n <slot name=\"append-inner\" />\n </div>\n\n {showDetails && (\n <div class=\"xplor-input-text__details\">\n {this.error && <div class=\"xplor-input-text__error-message\" id={this.errorId}>{this.error}</div>}\n {!this.error && this.helperText && <div class=\"xplor-input-text__helper-text\" id={this.helperId}>{this.helperText}</div>}\n </div>\n )}\n\n <slot name=\"append\" />\n </div>\n </Host>\n );\n }\n}\n"]}
|