@six-group/ui-library 4.2.4 → 4.2.5
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/loader.cjs.js +1 -1
- package/dist/cjs/six-avatar.cjs.entry.js +1 -1
- package/dist/cjs/six-badge.cjs.entry.js +2 -2
- package/dist/cjs/six-button.cjs.entry.js +2 -2
- package/dist/cjs/six-card.cjs.entry.js +1 -1
- package/dist/cjs/six-checkbox_2.cjs.entry.js +2 -2
- package/dist/cjs/six-details.cjs.entry.js +3 -3
- package/dist/cjs/six-dialog.cjs.entry.js +2 -2
- package/dist/cjs/six-drawer.cjs.entry.js +2 -2
- package/dist/cjs/six-dropdown_2.cjs.entry.js +13 -4
- package/dist/cjs/six-dropdown_2.cjs.entry.js.map +1 -1
- package/dist/cjs/six-error-page.cjs.entry.js +1 -1
- package/dist/cjs/six-error.cjs.entry.js +1 -1
- package/dist/cjs/six-file-list.cjs.entry.js +1 -1
- package/dist/cjs/six-file-upload.cjs.entry.js +4 -6
- package/dist/cjs/six-file-upload.cjs.entry.js.map +1 -1
- package/dist/cjs/six-footer.cjs.entry.js +1 -1
- package/dist/cjs/six-group-label.cjs.entry.js +1 -1
- package/dist/cjs/six-icon-button.cjs.entry.js +3 -3
- package/dist/cjs/six-icon.cjs.entry.js +2 -2
- package/dist/cjs/six-input.cjs.entry.js +13 -4
- package/dist/cjs/six-input.cjs.entry.js.map +1 -1
- package/dist/cjs/six-language-switcher.cjs.entry.js +1 -1
- package/dist/cjs/six-search-field.cjs.entry.js +1 -1
- package/dist/cjs/six-select.cjs.entry.js +6 -6
- package/dist/cjs/six-tab-group.cjs.entry.js +2 -2
- package/dist/cjs/six-textarea.cjs.entry.js +1 -1
- package/dist/cjs/six-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/ui-library.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/six-avatar/six-avatar.js +1 -1
- package/dist/collection/components/six-badge/six-badge.js +2 -2
- package/dist/collection/components/six-button/six-button.js +2 -2
- package/dist/collection/components/six-card/six-card.js +1 -1
- package/dist/collection/components/six-checkbox/six-checkbox.js +2 -2
- package/dist/collection/components/six-details/six-details.js +3 -3
- package/dist/collection/components/six-dialog/six-dialog.js +2 -2
- package/dist/collection/components/six-drawer/six-drawer.js +2 -2
- package/dist/collection/components/six-error/six-error.js +1 -1
- package/dist/collection/components/six-error-page/six-error-page.js +1 -1
- package/dist/collection/components/six-file-list/six-file-list.js +1 -1
- package/dist/collection/components/six-file-upload/six-file-upload.js +4 -6
- package/dist/collection/components/six-file-upload/six-file-upload.js.map +1 -1
- package/dist/collection/components/six-footer/six-footer.js +1 -1
- package/dist/collection/components/six-group-label/six-group-label.js +1 -1
- package/dist/collection/components/six-icon/six-icon.js +2 -2
- package/dist/collection/components/six-icon-button/six-icon-button.js +3 -3
- package/dist/collection/components/six-input/six-input.css +1 -0
- package/dist/collection/components/six-input/six-input.js +40 -4
- package/dist/collection/components/six-input/six-input.js.map +1 -1
- package/dist/collection/components/six-language-switcher/six-language-switcher.js +1 -1
- package/dist/collection/components/six-menu/six-menu.js +13 -4
- package/dist/collection/components/six-menu/six-menu.js.map +1 -1
- package/dist/collection/components/six-menu/test/six-menu.spec.js +1 -1
- package/dist/collection/components/six-menu/test/six-menu.spec.js.map +1 -1
- package/dist/collection/components/six-search-field/six-search-field.js +1 -1
- package/dist/collection/components/six-select/six-select.js +6 -6
- package/dist/collection/components/six-tab-group/six-tab-group.js +2 -2
- package/dist/collection/components/six-textarea/six-textarea.css +5 -0
- package/dist/components/six-avatar.js +1 -1
- package/dist/components/six-badge.js +2 -2
- package/dist/components/six-button2.js +2 -2
- package/dist/components/six-card.js +1 -1
- package/dist/components/six-checkbox2.js +2 -2
- package/dist/components/six-details2.js +3 -3
- package/dist/components/six-dialog.js +2 -2
- package/dist/components/six-drawer.js +2 -2
- package/dist/components/six-error-page.js +1 -1
- package/dist/components/six-error2.js +1 -1
- package/dist/components/six-file-list.js +1 -1
- package/dist/components/six-file-upload.js +4 -6
- package/dist/components/six-file-upload.js.map +1 -1
- package/dist/components/six-footer.js +1 -1
- package/dist/components/six-group-label.js +1 -1
- package/dist/components/six-icon-button2.js +3 -3
- package/dist/components/six-icon2.js +2 -2
- package/dist/components/six-input2.js +14 -4
- package/dist/components/six-input2.js.map +1 -1
- package/dist/components/six-language-switcher.js +1 -1
- package/dist/components/six-menu2.js +13 -4
- package/dist/components/six-menu2.js.map +1 -1
- package/dist/components/six-search-field.js +1 -1
- package/dist/components/six-select.js +6 -6
- package/dist/components/six-tab-group.js +2 -2
- package/dist/components/six-textarea.js +1 -1
- package/dist/components/six-textarea.js.map +1 -1
- package/dist/components.json +52 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/six-avatar.entry.js +1 -1
- package/dist/esm/six-badge.entry.js +2 -2
- package/dist/esm/six-button.entry.js +2 -2
- package/dist/esm/six-card.entry.js +1 -1
- package/dist/esm/six-checkbox_2.entry.js +2 -2
- package/dist/esm/six-details.entry.js +3 -3
- package/dist/esm/six-dialog.entry.js +2 -2
- package/dist/esm/six-drawer.entry.js +2 -2
- package/dist/esm/six-dropdown_2.entry.js +13 -4
- package/dist/esm/six-dropdown_2.entry.js.map +1 -1
- package/dist/esm/six-error-page.entry.js +1 -1
- package/dist/esm/six-error.entry.js +1 -1
- package/dist/esm/six-file-list.entry.js +1 -1
- package/dist/esm/six-file-upload.entry.js +4 -6
- package/dist/esm/six-file-upload.entry.js.map +1 -1
- package/dist/esm/six-footer.entry.js +1 -1
- package/dist/esm/six-group-label.entry.js +1 -1
- package/dist/esm/six-icon-button.entry.js +3 -3
- package/dist/esm/six-icon.entry.js +2 -2
- package/dist/esm/six-input.entry.js +13 -4
- package/dist/esm/six-input.entry.js.map +1 -1
- package/dist/esm/six-language-switcher.entry.js +1 -1
- package/dist/esm/six-search-field.entry.js +1 -1
- package/dist/esm/six-select.entry.js +6 -6
- package/dist/esm/six-tab-group.entry.js +2 -2
- package/dist/esm/six-textarea.entry.js +1 -1
- package/dist/esm/six-textarea.entry.js.map +1 -1
- package/dist/esm/ui-library.js +1 -1
- package/dist/types/components/six-input/six-input.d.ts +9 -1
- package/dist/types/components/six-menu/six-menu.d.ts +1 -1
- package/dist/types/components.d.ts +7 -1
- package/dist/ui-library/p-037afc74.entry.js +2 -0
- package/dist/ui-library/p-037afc74.entry.js.map +1 -0
- package/dist/ui-library/{p-785810fa.entry.js → p-049c8910.entry.js} +2 -2
- package/dist/ui-library/{p-82bd8781.entry.js → p-0c129b61.entry.js} +2 -2
- package/dist/ui-library/p-11344bb8.entry.js +2 -0
- package/dist/ui-library/p-18b9189f.entry.js +2 -0
- package/dist/ui-library/p-18b9189f.entry.js.map +1 -0
- package/dist/ui-library/p-1adc26f2.entry.js +2 -0
- package/dist/ui-library/p-1adc26f2.entry.js.map +1 -0
- package/dist/ui-library/p-347e568f.entry.js +2 -0
- package/dist/ui-library/p-36d5f98a.entry.js +2 -0
- package/dist/ui-library/{p-c1d68730.entry.js → p-37433242.entry.js} +2 -2
- package/dist/ui-library/{p-a8863197.entry.js → p-416b0439.entry.js} +2 -2
- package/dist/ui-library/{p-03d1b956.entry.js → p-4bc7bbdb.entry.js} +2 -2
- package/dist/ui-library/{p-b4bc4915.entry.js → p-63ee5e7e.entry.js} +2 -2
- package/dist/ui-library/{p-7561b336.entry.js → p-6b40c40c.entry.js} +2 -2
- package/dist/ui-library/p-6b40c40c.entry.js.map +1 -0
- package/dist/ui-library/{p-39ff5f61.entry.js → p-7bdd1116.entry.js} +2 -2
- package/dist/ui-library/{p-c35a7cef.entry.js → p-99f6fe01.entry.js} +2 -2
- package/dist/ui-library/{p-9bc1639b.entry.js → p-b335ed9c.entry.js} +2 -2
- package/dist/ui-library/{p-19560508.entry.js → p-b7c68f74.entry.js} +2 -2
- package/dist/ui-library/{p-45003bae.entry.js → p-d1a2f84b.entry.js} +2 -2
- package/dist/ui-library/{p-d07b549f.entry.js → p-d88b9c16.entry.js} +2 -2
- package/dist/ui-library/{p-3603dd96.entry.js → p-d9586999.entry.js} +2 -2
- package/dist/ui-library/{p-8fb96142.entry.js → p-e14d78e9.entry.js} +2 -2
- package/dist/ui-library/{p-6888b9ee.entry.js → p-e9b8ad98.entry.js} +2 -2
- package/dist/ui-library/{p-ac00076d.entry.js → p-ebbe9bdc.entry.js} +2 -2
- package/dist/ui-library/ui-library.esm.js +1 -1
- package/dist/ui-library/ui-library.esm.js.map +1 -1
- package/package.json +1 -1
- package/dist/ui-library/p-060069d4.entry.js +0 -2
- package/dist/ui-library/p-060069d4.entry.js.map +0 -1
- package/dist/ui-library/p-2c25cb61.entry.js +0 -2
- package/dist/ui-library/p-2c25cb61.entry.js.map +0 -1
- package/dist/ui-library/p-7561b336.entry.js.map +0 -1
- package/dist/ui-library/p-89db9a8b.entry.js +0 -2
- package/dist/ui-library/p-a7e2f511.entry.js +0 -2
- package/dist/ui-library/p-a7e2f511.entry.js.map +0 -1
- package/dist/ui-library/p-ab921403.entry.js +0 -2
- package/dist/ui-library/p-fe37dadf.entry.js +0 -2
- /package/dist/ui-library/{p-785810fa.entry.js.map → p-049c8910.entry.js.map} +0 -0
- /package/dist/ui-library/{p-82bd8781.entry.js.map → p-0c129b61.entry.js.map} +0 -0
- /package/dist/ui-library/{p-fe37dadf.entry.js.map → p-11344bb8.entry.js.map} +0 -0
- /package/dist/ui-library/{p-89db9a8b.entry.js.map → p-347e568f.entry.js.map} +0 -0
- /package/dist/ui-library/{p-ab921403.entry.js.map → p-36d5f98a.entry.js.map} +0 -0
- /package/dist/ui-library/{p-c1d68730.entry.js.map → p-37433242.entry.js.map} +0 -0
- /package/dist/ui-library/{p-a8863197.entry.js.map → p-416b0439.entry.js.map} +0 -0
- /package/dist/ui-library/{p-03d1b956.entry.js.map → p-4bc7bbdb.entry.js.map} +0 -0
- /package/dist/ui-library/{p-b4bc4915.entry.js.map → p-63ee5e7e.entry.js.map} +0 -0
- /package/dist/ui-library/{p-39ff5f61.entry.js.map → p-7bdd1116.entry.js.map} +0 -0
- /package/dist/ui-library/{p-c35a7cef.entry.js.map → p-99f6fe01.entry.js.map} +0 -0
- /package/dist/ui-library/{p-9bc1639b.entry.js.map → p-b335ed9c.entry.js.map} +0 -0
- /package/dist/ui-library/{p-19560508.entry.js.map → p-b7c68f74.entry.js.map} +0 -0
- /package/dist/ui-library/{p-45003bae.entry.js.map → p-d1a2f84b.entry.js.map} +0 -0
- /package/dist/ui-library/{p-d07b549f.entry.js.map → p-d88b9c16.entry.js.map} +0 -0
- /package/dist/ui-library/{p-3603dd96.entry.js.map → p-d9586999.entry.js.map} +0 -0
- /package/dist/ui-library/{p-8fb96142.entry.js.map → p-e14d78e9.entry.js.map} +0 -0
- /package/dist/ui-library/{p-6888b9ee.entry.js.map → p-e9b8ad98.entry.js.map} +0 -0
- /package/dist/ui-library/{p-ac00076d.entry.js.map → p-ebbe9bdc.entry.js.map} +0 -0
|
@@ -103,14 +103,14 @@ const SixCheckbox = /*@__PURE__*/ proxyCustomElement(class SixCheckbox extends H
|
|
|
103
103
|
this.hasErrorSlot = hasSlot(this.host, 'error-text');
|
|
104
104
|
}
|
|
105
105
|
render() {
|
|
106
|
-
return (h(FormControl, { key: '
|
|
106
|
+
return (h(FormControl, { key: '12e158f9bba9dae3abb2db723d16597b232b92f3', inputId: this.inputId, label: this.label, labelId: this.labelId, hasLabelSlot: this.hasLabelSlot, errorTextId: this.errorTextId, hasErrorTextSlot: this.hasErrorSlot, errorText: this.errorText, errorTextCount: this.errorTextCount, size: "medium", disabled: this.disabled, required: this.required, displayError: this.invalid }, h("label", { key: 'a6227229bf66e4faf9eb71a5b2c313d471fed2e9', part: "base", class: {
|
|
107
107
|
checkbox: true,
|
|
108
108
|
'checkbox--checked': this.checked,
|
|
109
109
|
'checkbox--disabled': this.disabled,
|
|
110
110
|
'checkbox--focused': this.hasFocus,
|
|
111
111
|
'checkbox--invalid': this.invalid,
|
|
112
112
|
'checkbox--indeterminate': this.indeterminate,
|
|
113
|
-
}, htmlFor: this.inputId, onMouseDown: this.handleMouseDown }, h("span", { key: '
|
|
113
|
+
}, htmlFor: this.inputId, onMouseDown: this.handleMouseDown }, h("span", { key: '1d2ff238550165afeff4670e6a7071368d8a9372', part: "control", class: "checkbox__control" }, this.checked && (h("span", { part: "checked-icon", class: "checkbox__icon" }, h("svg", { viewBox: "0 0 16 16" }, h("g", { stroke: "none", "stroke-width": "1", fill: "none", "fill-rule": "evenodd", "stroke-linecap": "round" }, h("g", { stroke: "currentColor", "stroke-width": "2" }, h("g", { transform: "translate(3.428571, 3.428571)" }, h("path", { d: "M0,5.71428571 L3.42857143,9.14285714" }), h("path", { d: "M9.14285714,0 L3.42857143,9.14285714" }))))))), !this.checked && this.indeterminate && (h("span", { part: "indeterminate-icon", class: "checkbox__icon" }, h("svg", { viewBox: "0 0 16 16" }, h("g", { stroke: "none", "stroke-width": "1", fill: "none", "fill-rule": "evenodd", "stroke-linecap": "round" }, h("g", { stroke: "currentColor", "stroke-width": "2" }, h("g", { transform: "translate(2.285714, 6.857143)" }, h("path", { d: "M10.2857143,1.14285714 L1.14285714,1.14285714" }))))))), h("input", { key: 'e6184461c925112762cca5da17cdd5b287a7e88a', ref: (el) => (this.nativeInput = el), id: this.inputId, type: "checkbox", name: this.name, value: this.value, checked: this.checked, disabled: this.disabled, required: this.required, role: "checkbox", "aria-checked": this.checked ? 'true' : 'false', "aria-labelledby": this.labelId, onChange: this.handleChange, onBlur: this.handleBlur, onFocus: this.handleFocus })), h("span", { key: 'f65e7b7349bb3bc10d1828cb928c377879579944', part: "text", id: this.textId, class: "checkbox__text" }, h("slot", { key: 'b67fbb40e8c47748e6713b708fc7d64be688dd82' })))));
|
|
114
114
|
}
|
|
115
115
|
get host() { return this; }
|
|
116
116
|
static get watchers() { return {
|
|
@@ -126,15 +126,15 @@ const SixDetails = /*@__PURE__*/ proxyCustomElement(class SixDetails extends HTM
|
|
|
126
126
|
}
|
|
127
127
|
render() {
|
|
128
128
|
const summaryIcon = this.hasContent && (this.summaryIcon || 'expand_more');
|
|
129
|
-
return (h("div", { key: '
|
|
129
|
+
return (h("div", { key: '92a28f916e7e652eb51b406dc8877ff64f0f9db5', ref: (el) => (this.details = el), part: "base", class: {
|
|
130
130
|
details: true,
|
|
131
131
|
'details--open': this.open,
|
|
132
132
|
'details--disabled': this.disabled,
|
|
133
133
|
inline: this.inline,
|
|
134
|
-
} }, h("header", { key: '
|
|
134
|
+
} }, h("header", { key: '3c08227521ad4a0e75eedf579a26b8bfa3696951', ref: (el) => (this.header = el), part: "header", id: `${this.componentId}-header`, class: "details__header", role: "button", "aria-expanded": this.open ? 'true' : 'false', "aria-controls": `${this.componentId}-content`, "aria-disabled": this.disabled ? 'true' : 'false', tabIndex: this.disabled ? -1 : 0, onClick: this.handleSummaryClick, onKeyDown: this.handleSummaryKeyDown }, h("div", { key: 'c8afed1372b13cf66ef070599e1f8c8a35ec88cf', part: "summary", class: "details__summary" }, h("slot", { key: '451ff79c969e8aef9be619cabc4dc886955de6d6', name: "summary" }, this.summary)), h("span", { key: 'fcd037bf37620c67373d02856ddee1b7544a4bdb', part: "summary-icon", class: {
|
|
135
135
|
'details__summary-icon': true,
|
|
136
136
|
'details__summary-icon--animate': this.animateSummaryIcon,
|
|
137
|
-
} }, h("slot", { key: '
|
|
137
|
+
} }, h("slot", { key: '771df5950db728b27f232bf8074d88352ce9a232', name: "summary-icon", onSlotchange: () => (this.animateSummaryIcon = false) }, summaryIcon && h("six-icon", { size: this.summaryIconSize }, summaryIcon)))), h("div", { key: '3a118577721028ce5bcb85846fb07d5fbc3473b9', ref: (el) => (this.body = el), class: "details__body", onTransitionEnd: this.handleBodyTransitionEnd }, h("div", { key: 'f40759fb26ddc69c06dc5e8f3765f5e7dfb20653', part: "content", id: `${this.componentId}-content`, class: "details__content", role: "region", "aria-labelledby": `${this.componentId}-header` }, h("slot", { key: '22822aa5b33578fe54b0850f61f025c6efff1bc0' })))));
|
|
138
138
|
}
|
|
139
139
|
get host() { return this; }
|
|
140
140
|
static get watchers() { return {
|
|
@@ -117,12 +117,12 @@ const SixDialog$1 = /*@__PURE__*/ proxyCustomElement(class SixDialog extends HTM
|
|
|
117
117
|
unlockBodyScrolling(this.host);
|
|
118
118
|
}
|
|
119
119
|
render() {
|
|
120
|
-
return (h("div", { key: '
|
|
120
|
+
return (h("div", { key: '366fe2997ccfc4b0444ee6ee9753e8d2c42e7744', ref: (el) => (this.dialog = el), part: "base", class: {
|
|
121
121
|
dialog: true,
|
|
122
122
|
'dialog--open': this.open,
|
|
123
123
|
'dialog--visible': this.isVisible,
|
|
124
124
|
'dialog--has-footer': this.hasFooter,
|
|
125
|
-
}, onKeyDown: this.handleKeyDown, onTransitionEnd: this.handleTransitionEnd }, h("div", { key: '
|
|
125
|
+
}, onKeyDown: this.handleKeyDown, onTransitionEnd: this.handleTransitionEnd }, h("div", { key: 'ed354ed231bd6c86d85405ef52b1b371dbb0fb0a', part: "overlay", class: "dialog__overlay", onClick: this.handleOverlayClick }), h("div", { key: '214bbdc1bde36c1068dad584d9d9242a0dcc5d9a', ref: (el) => (this.panel = el), part: "panel", class: "dialog__panel", role: "dialog", "aria-modal": "true", "aria-hidden": this.open ? 'false' : 'true', "aria-label": this.noHeader ? this.label : null, "aria-labelledby": !this.noHeader ? `${this.componentId}-title` : null, tabIndex: 0 }, !this.noHeader && (h("header", { part: "header", class: "dialog__header" }, h("span", { part: "title", class: "dialog__title", id: `${this.componentId}-title` }, h("slot", { name: "label" }, this.label || String.fromCharCode(65279))), h("six-icon-button", { exportparts: "base:close-button", class: "dialog__close", name: "close", onClick: this.handleCloseClick }))), h("div", { key: '1da84dc52118a26045bc6b4c813beed899210f05', part: "body", class: "dialog__body" }, h("slot", { key: 'd97bfb117a544eb5fd076658b12467febe94802e' })), h("footer", { key: 'b896718eaba5a6ecdead652954cf5c43d23a4c73', part: "footer", class: "dialog__footer" }, h("slot", { key: '850c447acea6ced8d76714fa759e109920c80e80', name: "footer", onSlotchange: this.handleSlotChange })))));
|
|
126
126
|
}
|
|
127
127
|
get host() { return this; }
|
|
128
128
|
static get watchers() { return {
|
|
@@ -127,7 +127,7 @@ const SixDrawer$1 = /*@__PURE__*/ proxyCustomElement(class SixDrawer extends HTM
|
|
|
127
127
|
this.open ? this.sixAfterShow.emit() : this.sixAfterHide.emit();
|
|
128
128
|
}
|
|
129
129
|
render() {
|
|
130
|
-
return (h("div", { key: '
|
|
130
|
+
return (h("div", { key: 'afcb4d6d40f9565966e7aa231699418ee822f33b', ref: (el) => (this.drawer = el), part: "base", class: {
|
|
131
131
|
drawer: true,
|
|
132
132
|
'drawer--open': this.open,
|
|
133
133
|
'drawer--visible': this.isVisible,
|
|
@@ -138,7 +138,7 @@ const SixDrawer$1 = /*@__PURE__*/ proxyCustomElement(class SixDrawer extends HTM
|
|
|
138
138
|
'drawer--contained': this.contained,
|
|
139
139
|
'drawer--fixed': !this.contained,
|
|
140
140
|
'drawer--has-footer': this.hasFooter,
|
|
141
|
-
}, onKeyDown: this.handleKeyDown, onTransitionEnd: this.handleTransitionEnd }, h("div", { key: '
|
|
141
|
+
}, onKeyDown: this.handleKeyDown, onTransitionEnd: this.handleTransitionEnd }, h("div", { key: 'e3df8e3f8af0d4504d19f1db1b4192afe9a1eec6', part: "overlay", class: "drawer__overlay", onClick: this.handleOverlayClick, tabIndex: -1 }), h("div", { key: '88aa87eab0fe6f78c9c56ed3837f5988efc5bbb3', ref: (el) => (this.panel = el), part: "panel", class: "drawer__panel", role: "dialog", "aria-modal": "true", "aria-hidden": this.open ? 'false' : 'true', "aria-label": this.noHeader ? this.label : null, "aria-labelledby": !this.noHeader ? `${this.componentId}-title` : null, tabIndex: 0 }, !this.noHeader && (h("header", { part: "header", class: "drawer__header" }, h("span", { part: "title", class: "drawer__title", id: `${this.componentId}-title` }, h("slot", { name: "label" }, this.label || String.fromCharCode(65279))), h("six-icon-button", { exportparts: "base:close-button", class: "drawer__close", name: "close", onClick: this.handleCloseClick }))), h("div", { key: '8d6ff883a2f1a4472e1d9256760fbb9d7a7ee958', part: "body", class: "drawer__body" }, h("slot", { key: 'b562f75c9bb781184e16befd9f1fecd28d03d38c' })), h("footer", { key: '9884e994cbb705cb8dbb7c992e134708f595634a', part: "footer", class: "drawer__footer" }, h("slot", { key: 'f4dd2e0201788041304153a67f2150eeb255ad1d', name: "footer", onSlotchange: this.handleSlotChange })))));
|
|
142
142
|
}
|
|
143
143
|
get host() { return this; }
|
|
144
144
|
static get watchers() { return {
|
|
@@ -96,7 +96,7 @@ const SixErrorPage$1 = /*@__PURE__*/ proxyCustomElement(class SixErrorPage exten
|
|
|
96
96
|
return DESCRIPTION_PER_ERROR_CODE[this.errorCode][this.language];
|
|
97
97
|
}
|
|
98
98
|
render() {
|
|
99
|
-
return (h("div", { key: '
|
|
99
|
+
return (h("div", { key: '78c3882cc5c70834df70c92ce3ac0d70730484b1', part: "container" }, h("div", { key: 'e2f4e4ab784458d4b5d899c270e30ca9850e21e0', class: "six-error-page__icon-container", part: "icon-container" }, h("six-picto", { key: 'b8c8192746d6aaec5b852102ae18c170fb87c183', size: "4xl", class: "six-error-page__icon", part: "icon" }, this.getIconName())), h("div", { key: '2610494ebf7457c0a62484c9694638a79f332236', class: "six-error-page__title", part: "title" }, this.getErrorTitle()), h("div", { key: 'b125301cc8f3808ce2c38afa11407b7e681995b2', class: "six-error-page__description", part: "description" }, this.getErrorDescription())));
|
|
100
100
|
}
|
|
101
101
|
static get style() { return SixErrorPageStyle0; }
|
|
102
102
|
}, [1, "six-error-page", {
|
|
@@ -10,7 +10,7 @@ const SixError = /*@__PURE__*/ proxyCustomElement(class SixError extends HTMLEle
|
|
|
10
10
|
this.__attachShadow();
|
|
11
11
|
}
|
|
12
12
|
render() {
|
|
13
|
-
return (h("div", { key: '
|
|
13
|
+
return (h("div", { key: '06af414764195145d2bad6237e632be9f4d150f1', class: "six-error-container" }, h("slot", { key: '95c3422046e15a9fae5c123f0ef518e7d5aa9d8b' })));
|
|
14
14
|
}
|
|
15
15
|
static get style() { return SixErrorStyle0; }
|
|
16
16
|
}, [1, "six-error"]);
|
|
@@ -10,7 +10,7 @@ const SixFileList$1 = /*@__PURE__*/ proxyCustomElement(class SixFileList extends
|
|
|
10
10
|
this.__attachShadow();
|
|
11
11
|
}
|
|
12
12
|
render() {
|
|
13
|
-
return (h("div", { key: '
|
|
13
|
+
return (h("div", { key: '7e19379918c57f9a92daed80298c38323a80c546', class: "six-files-list__container" }, h("slot", { key: 'd1542c14a4765d26c907d471413662c12daf0e2b' })));
|
|
14
14
|
}
|
|
15
15
|
static get style() { return SixFileListStyle0; }
|
|
16
16
|
}, [1, "six-file-list"]);
|
|
@@ -21,8 +21,6 @@ const SixFileUpload$1 = /*@__PURE__*/ proxyCustomElement(class SixFileUpload ext
|
|
|
21
21
|
validType = true;
|
|
22
22
|
}
|
|
23
23
|
this.hasError = validType || hasSlot(this.host, 'error-text');
|
|
24
|
-
console.log(this.errorText);
|
|
25
|
-
console.log(this.hasError);
|
|
26
24
|
};
|
|
27
25
|
this.handleFiles = (files) => {
|
|
28
26
|
if (this.disabled || files.length === 0 || this.uploading) {
|
|
@@ -124,17 +122,17 @@ const SixFileUpload$1 = /*@__PURE__*/ proxyCustomElement(class SixFileUpload ext
|
|
|
124
122
|
render() {
|
|
125
123
|
const Container = this.compact ? 'six-button' : 'six-card';
|
|
126
124
|
const errorMessages = (Array.isArray(this.errorText) ? this.errorText : [this.errorText]).filter((text) => text != null && text.trim() !== '');
|
|
127
|
-
return (h("div", { key: '
|
|
125
|
+
return (h("div", { key: 'eb14977865630579c21ac9bb4a711d1c31878cb2', class: {
|
|
128
126
|
'six-file-upload': true,
|
|
129
127
|
'six-file-upload--disabled': this.disabled || this.uploading,
|
|
130
|
-
} }, h(Container, { key: '
|
|
128
|
+
} }, h(Container, { key: '7e5399fe2defdcf4c653056c6593e819c45964f0', disabled: this.disabled || this.uploading, "aria-invalid": this.invalid ? 'true' : 'false', class: {
|
|
131
129
|
'six-file-upload__container--compact': this.compact,
|
|
132
130
|
'six-file-upload__container--full': !this.compact,
|
|
133
|
-
} }, this.compact && !this.uploading && (h("span", { slot: "prefix" }, h("six-icon", { class: "six-file-upload__label-icon" }, "arrow_circle_up"))), h("div", { key: '
|
|
131
|
+
} }, this.compact && !this.uploading && (h("span", { slot: "prefix" }, h("six-icon", { class: "six-file-upload__label-icon" }, "arrow_circle_up"))), h("div", { key: '6a1870eaebbbdf1bafb6b893342af3730211402e', class: {
|
|
134
132
|
'six-file-upload__drop-zone': true,
|
|
135
133
|
'six-file-upload__drop-zone--hover': this.isOver,
|
|
136
134
|
'six-file-upload__drop-zone--compact': this.compact,
|
|
137
|
-
} }, this.uploading ? (h("span", { class: "six-file-upload__drop-zone__spinner-container" }, h("six-spinner", null), " Uploading...")) : (h("div", null, h("span", null, this.renderLabel()), h("input", { class: "six-file-upload__input", type: "file", name: "resume", disabled: this.disabled, accept: this.accept, multiple: this.multiple, onChange: this.onChange, ref: (el) => (this.fileInput = el) }))))), h("div", { key: '
|
|
135
|
+
} }, this.uploading ? (h("span", { class: "six-file-upload__drop-zone__spinner-container" }, h("six-spinner", null), " Uploading...")) : (h("div", null, h("span", null, this.renderLabel()), h("input", { class: "six-file-upload__input", type: "file", name: "resume", disabled: this.disabled, accept: this.accept, multiple: this.multiple, onChange: this.onChange, ref: (el) => (this.fileInput = el) }))))), h("div", { key: '063123eb020e8f370733294760d96709a8c22b0a', "aria-hidden": this.invalid ? 'false' : 'true' }, h("slot", { key: '4ac9dad1011635a2974f2d642c5748fa7e5aff3d', name: "error-text" }, errorMessages.map((text) => (h("six-error", null, h("div", { class: "six-file-upload__error-text" }, text))))))));
|
|
138
136
|
}
|
|
139
137
|
get host() { return this; }
|
|
140
138
|
static get style() { return SixFileUploadStyle0; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"six-file-upload.js","mappings":";;;;;;AAAA,MAAM,gBAAgB,GAAG,4jEAA4jE,CAAC;AACtlE,4BAAe,gBAAgB;;MC4BlBA,eAAa;;;;;;QAwE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EAAC,QAAQ,IACjB,gBAAU,KAAK,EAAC,6BAA6B,sBAA2B,CACnE,CACR,EACD,4DACE,KAAK,EAAE;gBACL,4BAA4B,EAAE,IAAI;gBAClC,mCAAmC,EAAE,IAAI,CAAC,MAAM;gBAChD,qCAAqC,EAAE,IAAI,CAAC,OAAO;aACpD,IAEA,IAAI,CAAC,SAAS,IACb,YAAM,KAAK,EAAC,+CAA+C,IACzD,sBAAe,kBACV,KAEP,eACE,gBAAO,IAAI,CAAC,WAAW,EAAE,CAAQ,EACjC,aACE,KAAK,EAAC,wBAAwB,EAC9B,IAAI,EAAC,MAAM,EACX,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC,GAClC,CACE,CACP,CACG,CACI,EACZ,2EAAkB,IAAI,CAAC,OAAO,GAAG,OAAO,GAAG,MAAM,IAC/C,6DAAM,IAAI,EAAC,YAAY,IACpB,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,MACtB,qBACE,WAAK,KAAK,EAAC,6BAA6B,IAAE,IAAI,CAAO,CAC3C,CACb,CAAC,CACG,CACH,CACF,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SixFileUpload"],"sources":["src/components/six-file-upload/six-file-upload.scss?tag=six-file-upload&encapsulation=scoped","src/components/six-file-upload/six-file-upload.tsx"],"sourcesContent":["@import 'src/global/component';\n\n$over-color: var(--six-color-action-light-to-be-defined);\n$disabled-color: var(--six-color-inactive);\n$transition: 0.3s;\n$margin: 1rem;\n\n:host {\n position: static;\n display: block;\n}\n\n.six-file-upload {\n six-card {\n box-shadow: none;\n padding: 0;\n width: 100%;\n }\n\n &__label {\n &--highlighted {\n color: var(--six-color-action-600);\n }\n }\n\n &__container {\n &--full {\n border: dashed 1px var(--six-color-web-rock-500);\n }\n }\n\n &__label-icon {\n margin-right: 0.5rem;\n }\n\n &__drop-zone {\n padding: 2rem 0;\n display: flex;\n justify-content: center;\n width: 100%;\n transition: background-color $transition;\n\n &__spinner-container {\n display: flex;\n align-items: center;\n\n six-spinner {\n margin-right: var(--six-spacing-x-small);\n }\n }\n\n &--compact {\n padding: 0;\n }\n }\n\n &__input {\n cursor: pointer;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n user-select: none;\n height: 100%;\n opacity: 0;\n outline: none;\n }\n\n &--disabled &__drop-zone {\n background-color: $disabled-color;\n cursor: not-allowed;\n }\n\n &:not(.six-file-upload--disabled) &__drop-zone:hover,\n &__drop-zone--hover {\n background-color: $over-color;\n\n &.six-file-upload__drop-zone--compact {\n background-color: inherit;\n }\n }\n\n &--disabled &__input {\n cursor: not-allowed;\n }\n\n &__error-text {\n font-size: var(--six-input-help-text-font-size-medium);\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Listen, Prop, State } from '@stencil/core';\nimport { hasSlot } from '../../utils/slot';\n\ninterface ISingleFile {\n file: File;\n}\n\ninterface IMultipleFiles {\n files: FileList;\n}\n\nexport type SixFileUploadSuccessPayload = ISingleFile | IMultipleFiles;\n\nexport interface SixFileUploadFailurePayload {\n reason: string;\n}\n\n/**\n * @since 2.0.0\n * @status experimental\n *\n * @slot error-text - Error text that is shown when the status is set to invalid. Alternatively, you can use the error-text prop.\n */\n@Component({\n tag: 'six-file-upload',\n styleUrl: 'six-file-upload.scss',\n scoped: true,\n shadow: false,\n})\nexport class SixFileUpload {\n @Element() readonly host!: HTMLSixFileUploadElement;\n\n private fileInput?: HTMLInputElement;\n\n @State() isOver = false;\n @State() hasError = false;\n\n /** Set to true if file control should be small. */\n @Prop() readonly compact: boolean = false;\n\n /** Label of the drop area. */\n @Prop() readonly label?: string;\n\n /** Set when button is disabled. */\n @Prop() readonly disabled = false;\n\n /** Accepted MIME-Types. */\n @Prop() readonly accept?: string;\n\n /** More than one file allowed. */\n @Prop() readonly multiple = false;\n\n /** Allowed max file size in bytes. */\n @Prop() readonly maxFileSize?: number;\n\n /** Set to true to draw the control in a loading state. */\n @Prop({ reflect: true }) uploading = false;\n\n /** The error message shown, if `invalid` is set to true. */\n @Prop() errorText: string | string[] = '';\n\n /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */\n @Prop({ reflect: true }) invalid = false;\n\n /** Triggers when a file is added. */\n @Event({ eventName: 'six-file-upload-success' }) success!: EventEmitter<SixFileUploadSuccessPayload>;\n\n /** Triggers when an uploaded file doesn't match MIME type or max file size. */\n @Event({ eventName: 'six-file-upload-failure' }) failure!: EventEmitter<SixFileUploadFailurePayload>;\n\n @Listen('dragenter', { capture: false })\n dragenterHandler() {\n if (!this.disabled) {\n this.isOver = true;\n }\n }\n\n @Listen('dragover', { capture: false })\n dragoverHandler() {\n if (!this.disabled) {\n this.isOver = true;\n }\n }\n\n @Listen('dragleave', { capture: false })\n dragleaveHandler() {\n if (!this.disabled) {\n this.isOver = false;\n }\n }\n\n @Listen('drop', { capture: false })\n dropHandler({ dataTransfer }: DragEvent) {\n if (!this.disabled) {\n this.isOver = false;\n if (dataTransfer != null) {\n this.handleFiles(dataTransfer.files);\n }\n }\n }\n\n private handleSlotChange = () => {\n let validType = false;\n\n if (\n this.errorText != null &&\n ((typeof this.errorText == 'string' && this.errorText.trim().length > 0) ||\n (typeof this.errorText == 'object' && this.errorText.length > 0))\n ) {\n validType = true;\n }\n\n this.hasError = validType || hasSlot(this.host, 'error-text');\n console.log(this.errorText);\n console.log(this.hasError);\n };\n\n private handleFiles = (files: FileList) => {\n if (this.disabled || files.length === 0 || this.uploading) {\n return;\n }\n\n if (!this.multiple && files.length > 1) {\n return this.failure.emit({ reason: 'Only one file is allowed.' });\n }\n\n for (const file of files) {\n if (file == null) {\n return;\n }\n\n let acceptedTypesList: string[] = [];\n if (this.accept != null) {\n acceptedTypesList = this.accept.replace(/\\s/g, '').split(',');\n }\n\n if (acceptedTypesList.length > 0 && acceptedTypesList.indexOf(file.type) === -1) {\n const reason = files.length > 1 ? 'One or more files have invalid MIME type.' : 'File has invalid MIME type.';\n return this.failure.emit({ reason });\n }\n\n if (this.maxFileSize != null && file.size > this.maxFileSize) {\n const reason = files.length > 1 ? 'One or more files are too big' : 'File is too big.';\n return this.failure.emit({ reason });\n }\n }\n\n const eventPayload: SixFileUploadSuccessPayload = this.multiple ? { files } : { file: files[0] };\n this.success.emit(eventPayload);\n };\n\n componentWillLoad() {\n this.handleSlotChange();\n }\n\n componentDidLoad() {\n ['dragenter', 'dragover', 'dragleave', 'drop'].forEach((eventName) => {\n this.host.addEventListener(eventName, this.preventDefaults, false);\n document.body.addEventListener(eventName, this.preventDefaults, false);\n });\n this.host.shadowRoot?.addEventListener('slotchange', this.handleSlotChange);\n }\n\n disconnectedCallback() {\n ['dragenter', 'dragover', 'dragleave', 'drop'].forEach((eventName) => {\n this.host.removeEventListener(eventName, this.preventDefaults, false);\n document.body.removeEventListener(eventName, this.preventDefaults, false);\n });\n this.host.shadowRoot?.removeEventListener('slotchange', this.handleSlotChange);\n }\n\n private preventDefaults(e: Event) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n private onChange = () => {\n if (this.fileInput?.files != null) {\n const files = this.fileInput.files;\n this.handleFiles(files);\n this.fileInput.value = '';\n }\n };\n\n private renderLabel() {\n return (\n this.label ??\n (this.compact ? (\n 'Upload'\n ) : (\n <span>\n Drop files to upload, or <span class=\"six-file-upload__label--highlighted\">browse</span>\n </span>\n ))\n );\n }\n\n render() {\n const Container = this.compact ? 'six-button' : 'six-card';\n\n const errorMessages = (Array.isArray(this.errorText) ? this.errorText : [this.errorText]).filter(\n (text) => text != null && text.trim() !== ''\n );\n\n return (\n <div\n class={{\n 'six-file-upload': true,\n 'six-file-upload--disabled': this.disabled || this.uploading,\n }}\n >\n <Container\n disabled={this.disabled || this.uploading}\n aria-invalid={this.invalid ? 'true' : 'false'}\n class={{\n 'six-file-upload__container--compact': this.compact,\n 'six-file-upload__container--full': !this.compact,\n }}\n >\n {this.compact && !this.uploading && (\n <span slot=\"prefix\">\n <six-icon class=\"six-file-upload__label-icon\">arrow_circle_up</six-icon>\n </span>\n )}\n <div\n class={{\n 'six-file-upload__drop-zone': true,\n 'six-file-upload__drop-zone--hover': this.isOver,\n 'six-file-upload__drop-zone--compact': this.compact,\n }}\n >\n {this.uploading ? (\n <span class=\"six-file-upload__drop-zone__spinner-container\">\n <six-spinner /> Uploading...\n </span>\n ) : (\n <div>\n <span>{this.renderLabel()}</span>\n <input\n class=\"six-file-upload__input\"\n type=\"file\"\n name=\"resume\"\n disabled={this.disabled}\n accept={this.accept}\n multiple={this.multiple}\n onChange={this.onChange}\n ref={(el) => (this.fileInput = el)}\n />\n </div>\n )}\n </div>\n </Container>\n <div aria-hidden={this.invalid ? 'false' : 'true'}>\n <slot name=\"error-text\">\n {errorMessages.map((text) => (\n <six-error>\n <div class=\"six-file-upload__error-text\">{text}</div>\n </six-error>\n ))}\n </slot>\n </div>\n </div>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"six-file-upload.js","mappings":";;;;;;AAAA,MAAM,gBAAgB,GAAG,4jEAA4jE,CAAC;AACtlE,4BAAe,gBAAgB;;MC4BlBA,eAAa;;;;;;QAwEhB,qBAAgB,GAAG;YACzB,IAAI,SAAS,GAAG,KAAK,CAAC;YAEtB,IACE,IAAI,CAAC,SAAS,IAAI,IAAI;iBACrB,CAAC,OAAO,IAAI,CAAC,SAAS,IAAI,QAAQ,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC;qBACpE,OAAO,IAAI,CAAC,SAAS,IAAI,QAAQ,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EACnE;gBACA,SAAS,GAAG,IAAI,CAAC;aAClB;YAED,IAAI,C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AE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC,GAClC,CACE,CACP,CACG,CACI,EACZ,2EAAkB,IAAI,CAAC,OAAO,GAAG,OAAO,GAAG,MAAM,IAC/C,6DAAM,IAAI,EAAC,YAAY,IACpB,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,MACtB,qBACE,WAAK,KAAK,EAAC,6BAA6B,IAAE,IAAI,CAAO,CAC3C,CACb,CAAC,CACG,CACH,CACF,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SixFileUpload"],"sources":["src/components/six-file-upload/six-file-upload.scss?tag=six-file-upload&encapsulation=scoped","src/components/six-file-upload/six-file-upload.tsx"],"sourcesContent":["@import 'src/global/component';\n\n$over-color: var(--six-color-action-light-to-be-defined);\n$disabled-color: var(--six-color-inactive);\n$transition: 0.3s;\n$margin: 1rem;\n\n:host {\n position: static;\n display: block;\n}\n\n.six-file-upload {\n six-card {\n box-shadow: none;\n padding: 0;\n width: 100%;\n }\n\n &__label {\n &--highlighted {\n color: var(--six-color-action-600);\n }\n }\n\n &__container {\n &--full {\n border: dashed 1px var(--six-color-web-rock-500);\n }\n }\n\n &__label-icon {\n margin-right: 0.5rem;\n }\n\n &__drop-zone {\n padding: 2rem 0;\n display: flex;\n justify-content: center;\n width: 100%;\n transition: background-color $transition;\n\n &__spinner-container {\n display: flex;\n align-items: center;\n\n six-spinner {\n margin-right: var(--six-spacing-x-small);\n }\n }\n\n &--compact {\n padding: 0;\n }\n }\n\n &__input {\n cursor: pointer;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n user-select: none;\n height: 100%;\n opacity: 0;\n outline: none;\n }\n\n &--disabled &__drop-zone {\n background-color: $disabled-color;\n cursor: not-allowed;\n }\n\n &:not(.six-file-upload--disabled) &__drop-zone:hover,\n &__drop-zone--hover {\n background-color: $over-color;\n\n &.six-file-upload__drop-zone--compact {\n background-color: inherit;\n }\n }\n\n &--disabled &__input {\n cursor: not-allowed;\n }\n\n &__error-text {\n font-size: var(--six-input-help-text-font-size-medium);\n }\n}\n","import { Component, Element, Event, EventEmitter, h, Listen, Prop, State } from '@stencil/core';\nimport { hasSlot } from '../../utils/slot';\n\ninterface ISingleFile {\n file: File;\n}\n\ninterface IMultipleFiles {\n files: FileList;\n}\n\nexport type SixFileUploadSuccessPayload = ISingleFile | IMultipleFiles;\n\nexport interface SixFileUploadFailurePayload {\n reason: string;\n}\n\n/**\n * @since 2.0.0\n * @status experimental\n *\n * @slot error-text - Error text that is shown when the status is set to invalid. Alternatively, you can use the error-text prop.\n */\n@Component({\n tag: 'six-file-upload',\n styleUrl: 'six-file-upload.scss',\n scoped: true,\n shadow: false,\n})\nexport class SixFileUpload {\n @Element() readonly host!: HTMLSixFileUploadElement;\n\n private fileInput?: HTMLInputElement;\n\n @State() isOver = false;\n @State() hasError = false;\n\n /** Set to true if file control should be small. */\n @Prop() readonly compact: boolean = false;\n\n /** Label of the drop area. */\n @Prop() readonly label?: string;\n\n /** Set when button is disabled. */\n @Prop() readonly disabled = false;\n\n /** Accepted MIME-Types. */\n @Prop() readonly accept?: string;\n\n /** More than one file allowed. */\n @Prop() readonly multiple = false;\n\n /** Allowed max file size in bytes. */\n @Prop() readonly maxFileSize?: number;\n\n /** Set to true to draw the control in a loading state. */\n @Prop({ reflect: true }) uploading = false;\n\n /** The error message shown, if `invalid` is set to true. */\n @Prop() errorText: string | string[] = '';\n\n /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */\n @Prop({ reflect: true }) invalid = false;\n\n /** Triggers when a file is added. */\n @Event({ eventName: 'six-file-upload-success' }) success!: EventEmitter<SixFileUploadSuccessPayload>;\n\n /** Triggers when an uploaded file doesn't match MIME type or max file size. */\n @Event({ eventName: 'six-file-upload-failure' }) failure!: EventEmitter<SixFileUploadFailurePayload>;\n\n @Listen('dragenter', { capture: false })\n dragenterHandler() {\n if (!this.disabled) {\n this.isOver = true;\n }\n }\n\n @Listen('dragover', { capture: false })\n dragoverHandler() {\n if (!this.disabled) {\n this.isOver = true;\n }\n }\n\n @Listen('dragleave', { capture: false })\n dragleaveHandler() {\n if (!this.disabled) {\n this.isOver = false;\n }\n }\n\n @Listen('drop', { capture: false })\n dropHandler({ dataTransfer }: DragEvent) {\n if (!this.disabled) {\n this.isOver = false;\n if (dataTransfer != null) {\n this.handleFiles(dataTransfer.files);\n }\n }\n }\n\n private handleSlotChange = () => {\n let validType = false;\n\n if (\n this.errorText != null &&\n ((typeof this.errorText == 'string' && this.errorText.trim().length > 0) ||\n (typeof this.errorText == 'object' && this.errorText.length > 0))\n ) {\n validType = true;\n }\n\n this.hasError = validType || hasSlot(this.host, 'error-text');\n };\n\n private handleFiles = (files: FileList) => {\n if (this.disabled || files.length === 0 || this.uploading) {\n return;\n }\n\n if (!this.multiple && files.length > 1) {\n return this.failure.emit({ reason: 'Only one file is allowed.' });\n }\n\n for (const file of files) {\n if (file == null) {\n return;\n }\n\n let acceptedTypesList: string[] = [];\n if (this.accept != null) {\n acceptedTypesList = this.accept.replace(/\\s/g, '').split(',');\n }\n\n if (acceptedTypesList.length > 0 && acceptedTypesList.indexOf(file.type) === -1) {\n const reason = files.length > 1 ? 'One or more files have invalid MIME type.' : 'File has invalid MIME type.';\n return this.failure.emit({ reason });\n }\n\n if (this.maxFileSize != null && file.size > this.maxFileSize) {\n const reason = files.length > 1 ? 'One or more files are too big' : 'File is too big.';\n return this.failure.emit({ reason });\n }\n }\n\n const eventPayload: SixFileUploadSuccessPayload = this.multiple ? { files } : { file: files[0] };\n this.success.emit(eventPayload);\n };\n\n componentWillLoad() {\n this.handleSlotChange();\n }\n\n componentDidLoad() {\n ['dragenter', 'dragover', 'dragleave', 'drop'].forEach((eventName) => {\n this.host.addEventListener(eventName, this.preventDefaults, false);\n document.body.addEventListener(eventName, this.preventDefaults, false);\n });\n this.host.shadowRoot?.addEventListener('slotchange', this.handleSlotChange);\n }\n\n disconnectedCallback() {\n ['dragenter', 'dragover', 'dragleave', 'drop'].forEach((eventName) => {\n this.host.removeEventListener(eventName, this.preventDefaults, false);\n document.body.removeEventListener(eventName, this.preventDefaults, false);\n });\n this.host.shadowRoot?.removeEventListener('slotchange', this.handleSlotChange);\n }\n\n private preventDefaults(e: Event) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n private onChange = () => {\n if (this.fileInput?.files != null) {\n const files = this.fileInput.files;\n this.handleFiles(files);\n this.fileInput.value = '';\n }\n };\n\n private renderLabel() {\n return (\n this.label ??\n (this.compact ? (\n 'Upload'\n ) : (\n <span>\n Drop files to upload, or <span class=\"six-file-upload__label--highlighted\">browse</span>\n </span>\n ))\n );\n }\n\n render() {\n const Container = this.compact ? 'six-button' : 'six-card';\n\n const errorMessages = (Array.isArray(this.errorText) ? this.errorText : [this.errorText]).filter(\n (text) => text != null && text.trim() !== ''\n );\n\n return (\n <div\n class={{\n 'six-file-upload': true,\n 'six-file-upload--disabled': this.disabled || this.uploading,\n }}\n >\n <Container\n disabled={this.disabled || this.uploading}\n aria-invalid={this.invalid ? 'true' : 'false'}\n class={{\n 'six-file-upload__container--compact': this.compact,\n 'six-file-upload__container--full': !this.compact,\n }}\n >\n {this.compact && !this.uploading && (\n <span slot=\"prefix\">\n <six-icon class=\"six-file-upload__label-icon\">arrow_circle_up</six-icon>\n </span>\n )}\n <div\n class={{\n 'six-file-upload__drop-zone': true,\n 'six-file-upload__drop-zone--hover': this.isOver,\n 'six-file-upload__drop-zone--compact': this.compact,\n }}\n >\n {this.uploading ? (\n <span class=\"six-file-upload__drop-zone__spinner-container\">\n <six-spinner /> Uploading...\n </span>\n ) : (\n <div>\n <span>{this.renderLabel()}</span>\n <input\n class=\"six-file-upload__input\"\n type=\"file\"\n name=\"resume\"\n disabled={this.disabled}\n accept={this.accept}\n multiple={this.multiple}\n onChange={this.onChange}\n ref={(el) => (this.fileInput = el)}\n />\n </div>\n )}\n </div>\n </Container>\n <div aria-hidden={this.invalid ? 'false' : 'true'}>\n <slot name=\"error-text\">\n {errorMessages.map((text) => (\n <six-error>\n <div class=\"six-file-upload__error-text\">{text}</div>\n </six-error>\n ))}\n </slot>\n </div>\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -10,7 +10,7 @@ const SixFooter$1 = /*@__PURE__*/ proxyCustomElement(class SixFooter extends HTM
|
|
|
10
10
|
this.__attachShadow();
|
|
11
11
|
}
|
|
12
12
|
render() {
|
|
13
|
-
return (h("footer", { key: '
|
|
13
|
+
return (h("footer", { key: '83474fa81c726623db04c5a06cfd72d9163257e4', class: "six-footer" }, h("slot", { key: '8a463c3b9f6ee3c00fd9222eca173f7b912bf54e' })));
|
|
14
14
|
}
|
|
15
15
|
static get style() { return SixFooterStyle0; }
|
|
16
16
|
}, [1, "six-footer"]);
|
|
@@ -42,7 +42,7 @@ const SixGroupLabel$1 = /*@__PURE__*/ proxyCustomElement(class SixGroupLabel ext
|
|
|
42
42
|
(_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.removeEventListener('slotchange', this.handleSlotChange);
|
|
43
43
|
}
|
|
44
44
|
render() {
|
|
45
|
-
return (h(FormControl, { key: '
|
|
45
|
+
return (h(FormControl, { key: 'edc2f21913a2e4a40b516b69ac640950f8351a00', inputId: this.wrapperLabelId, label: this.label, labelId: this.labelId, hasLabelSlot: this.hasLabelSlot, helpTextId: this.helpTextId, helpText: this.helpText, hasHelpTextSlot: this.hasHelpTextSlot, size: this.size, disabled: this.disabled, required: this.required }, h("slot", { key: 'a7fd4d86c9fcf071eb80239340d54925091c465d' })));
|
|
46
46
|
}
|
|
47
47
|
get host() { return this; }
|
|
48
48
|
static get watchers() { return {
|
|
@@ -33,11 +33,11 @@ const SixIconButton = /*@__PURE__*/ proxyCustomElement(class SixIconButton exten
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
render() {
|
|
36
|
-
const html = this.html && h("span", { key: '
|
|
37
|
-
return (h("div", { key: '
|
|
36
|
+
const html = this.html && h("span", { key: '4017a659b676c98bca3f6d09639b030bb38f84ba', innerHTML: this.html });
|
|
37
|
+
return (h("div", { key: '5f199fc510e875764f571230a2ee2044cae9ff1b', onClick: this.handleClickEvent, class: { 'icon-button-wrapper--disabled': this.disabled } }, h("button", { key: 'f17232563ee2b360b173a7fdf1c03f87f3ab294b', ref: (el) => (this.button = el), part: "base", disabled: this.disabled, class: {
|
|
38
38
|
'icon-button': true,
|
|
39
39
|
'icon-button--disabled': this.disabled,
|
|
40
|
-
}, type: "button", "aria-label": this.label }, h("six-icon", { key: '
|
|
40
|
+
}, type: "button", "aria-label": this.label }, h("six-icon", { key: 'ca6836332c0270d700c09555b8325b1d16e9fa38', "aria-hidden": "true", size: this.size }, this.name), h("slot", { key: '20148ec0f5a72cc351a220ddf38daaba35455695' }), html)));
|
|
41
41
|
}
|
|
42
42
|
static get style() { return SixIconButtonStyle0; }
|
|
43
43
|
}, [1, "six-icon-button", {
|
|
@@ -12,7 +12,7 @@ const SixIcon = /*@__PURE__*/ proxyCustomElement(class SixIcon extends HTMLEleme
|
|
|
12
12
|
this.filled = false;
|
|
13
13
|
}
|
|
14
14
|
render() {
|
|
15
|
-
return (h("i", { key: '
|
|
15
|
+
return (h("i", { key: '0ad2a9d136a1cc69769040f67f86c4ea5abfd954', class: {
|
|
16
16
|
'material-icons': true,
|
|
17
17
|
'material-icons-outlined': !this.filled,
|
|
18
18
|
'material-icons-filled': this.filled,
|
|
@@ -24,7 +24,7 @@ const SixIcon = /*@__PURE__*/ proxyCustomElement(class SixIcon extends HTMLEleme
|
|
|
24
24
|
'icon--xxlarge': this.size === 'xxLarge',
|
|
25
25
|
'icon--xxxlarge': this.size === 'xxxLarge',
|
|
26
26
|
'icon--inherit': this.size === 'inherit',
|
|
27
|
-
} }, h("slot", { key: '
|
|
27
|
+
} }, h("slot", { key: 'aecf0f5e3b4cdffd223434fa09283306e92be51e' })));
|
|
28
28
|
}
|
|
29
29
|
static get style() { return SixIconStyle0; }
|
|
30
30
|
}, [1, "six-icon", {
|
|
@@ -6,7 +6,7 @@ import { s as submitForm } from './form.js';
|
|
|
6
6
|
import { d as defineCustomElement$2 } from './six-error2.js';
|
|
7
7
|
import { d as defineCustomElement$1 } from './six-icon2.js';
|
|
8
8
|
|
|
9
|
-
const sixInputCss = ":host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:border-box}.form-control .form-control__label{display:none}.form-control .form-control__help-text{display:none}.form-control .form-control__error-text{display:none;text-align:left}.form-control--has-label .form-control__label{display:inline-block;color:var(--six-input-label-color);font-weight:var(--six-font-weight-bold);margin-bottom:var(--six-spacing-x-small)}.form-control--has-label .form-control__label__required::after{color:var(--six-color-danger-800);content:\"*\";transform:scale(1.1);margin-left:var(--six-spacing-xxx-small);position:absolute}.form-control--has-label.form-control--small .form-control__label{font-size:var(--six-input-label-font-size-small)}.form-control--has-label.form-control--medium .form-control__label{font-size:var(--six-input-label-font-size-medium)}.form-control--has-label.form-control--large .form-control_label{font-size:var(--six-input-label-font-size-large)}.form-control--has-help-text .form-control__help-text{display:block;color:var(--six-input-help-text-color);margin-top:var(--six-spacing-x-small)}.form-control--has-help-text .form-control__help-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-help-text.form-control--small .form-control__help-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-help-text.form-control--medium .form-control__help-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-help-text.form-control--large .form-control__help-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--has-error-text .form-control__error-text{display:block;margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text .form-control__error-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text.form-control--small .form-control__error-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-error-text.form-control--medium .form-control__error-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-error-text.form-control--large .form-control__error-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--disabled .form-control__help-text{color:var(--six-input-help-text-color-disabled)}.form-control--disabled .form-control__label{color:var(--six-input-label-color-disabled)}.form-control--invalid:not(.form-control--disabled) .form-control__label{color:var(--six-input-label-color)}:host{display:block}.input{display:inline-flex;align-items:stretch;justify-content:start;position:relative;width:100%;font-family:var(--six-font-family);font-weight:var(--six-input-font-weight);letter-spacing:var(--six-input-letter-spacing);background-color:var(--six-input-background-color);border:solid var(--six-border-width) var(--six-input-border-color);vertical-align:middle;overflow:hidden;transition:var(--six-transition-fast) color, var(--six-transition-fast) border, var(--six-transition-fast) box-shadow;cursor:text}.input--line{border:none;border-bottom:solid var(--six-border-width) var(--six-input-border-color)}.input:hover:not(.input--disabled){background-color:var(--six-input-background-color-hover);border-color:var(--six-input-border-color-hover)}.input:hover:not(.input--disabled) .input__control{color:var(--six-input-color-hover)}.input:hover.input--dropdown-search{border-color:transparent}.input--dropdown-search{border-color:transparent}.input--dropdown-search.input--focused{border-color:var(--six-input-border-color)}.input.input--focused:not(.input--disabled){background-color:var(--six-input-background-color-focus);border-bottom-color:var(--six-input-border-color-focus);box-shadow:0 1px 0 0 var(--six-input-border-color-focus)}.input.input--focused:not(.input--disabled):not(.input--line){border-color:var(--six-input-border-color-focus);box-shadow:var(--six-input-focus-shadow)}.input.input--focused:not(.input--disabled) .input__control{color:var(--six-input-color-focus)}.input.input--disabled{background-color:var(--six-input-background-color-disabled);border-color:var(--six-input-border-color-disabled);cursor:not-allowed}.input.input--disabled .input__control{color:var(--six-input-color-disabled)}.input.input--disabled .input__control::placeholder{color:var(--six-input-placeholder-color-disabled)}.input.input--invalid:not(.input--disabled):not(.input--focused){border-bottom-color:var(--six-input-border-color-danger)}.input.input--invalid:not(.input--disabled):not(.input--focused):not(.input--line){border-color:var(--six-input-border-color-danger)}.input__control{flex:1 1 auto;font-family:inherit;font-size:inherit;font-weight:inherit;min-width:0;color:var(--six-input-color);border:none;background:none;box-shadow:none;padding:0;margin:0;cursor:inherit;-webkit-appearance:none}.input__control::-webkit-search-decoration,.input__control::-webkit-search-cancel-button,.input__control::-webkit-search-results-button,.input__control::-webkit-search-results-decoration{-webkit-appearance:none}.input__control:-webkit-autofill,.input__control:-webkit-autofill:hover,.input__control:-webkit-autofill:focus,.input__control:-webkit-autofill:active{box-shadow:0 0 0 var(--six-height-large) var(--six-input-background-color-hover) inset !important;-webkit-text-fill-color:var(--six-color-primary-500)}.input__control::placeholder{color:var(--six-input-placeholder-color);user-select:none}.input__control:focus{outline:none}.input__control::-ms-reveal{display:none}.input__prefix,.input__suffix{display:inline-flex;flex:0 0 auto;align-items:center;cursor:default}.input__prefix ::slotted(six-icon),.input__suffix ::slotted(six-icon){color:var(--six-input-icon-color)}.input.input--disabled ::slotted(six-icon){cursor:not-allowed}.input--small{border-radius:var(--six-input-border-radius-small);font-size:var(--six-input-font-size-small);height:var(--six-height-small)}.input--small .input__control{height:calc(var(--six-height-small) - var(--six-border-width) * 2);margin:0 var(--six-input-spacing-small)}.input--small .input__control__prefix{margin:0 var(--six-input-prefix-spacing-small)}.input--small .input__clear,.input--small .input__password-toggle{margin-right:var(--six-input-spacing-small)}.input--small .input__prefix ::slotted(*){margin-left:var(--six-input-prefix-spacing-small)}.input--small .input__suffix ::slotted(*){margin-right:var(--six-input-prefix-spacing-small)}.input--medium{border-radius:var(--six-input-border-radius-medium);font-size:var(--six-input-font-size-medium);height:var(--six-height-medium)}.input--medium .input__control{height:calc(var(--six-height-medium) - var(--six-border-width) * 2);margin:0 var(--six-input-spacing-medium)}.input--medium .input__control__prefix{margin:0 var(--six-input-prefix-spacing-medium)}.input--medium .input__clear,.input--medium .input__password-toggle{margin-right:var(--six-input-spacing-medium)}.input--medium .input__prefix ::slotted(*){margin-left:var(--six-input-prefix-spacing-medium)}.input--medium .input__suffix ::slotted(*){margin-right:var(--six-input-prefix-spacing-medium)}.input--large{border-radius:var(--six-input-border-radius-large);font-size:var(--six-input-font-size-large);height:var(--six-height-large)}.input--large .input__control{height:calc(var(--six-height-large) - var(--six-border-width) * 2);margin:0 var(--six-input-spacing-large)}.input--large .input__control__prefix{margin:0 var(--six-input-prefix-spacing-large)}.input--large .input__clear,.input--large .input__password-toggle{margin-right:var(--six-input-spacing-large)}.input--large .input__prefix ::slotted(*){margin-left:var(--six-input-prefix-spacing-large)}.input--large .input__suffix ::slotted(*){margin-right:var(--six-input-prefix-spacing-large)}.input--pill.input--small{border-radius:var(--six-height-small)}.input--pill.input--medium{border-radius:var(--six-height-medium)}.input--pill.input--large{border-radius:var(--six-height-large)}.input__clear,.input__password-toggle{display:inline-flex;align-items:center;font-size:inherit;color:var(--six-input-icon-color);border:none;background:none;padding:0;transition:var(--six-transition-fast) color;cursor:pointer}.input__clear:hover,.input__password-toggle:hover{color:var(--six-input-icon-color-hover)}.input__clear:focus,.input__password-toggle:focus{outline:none}.input--empty .input__clear{visibility:hidden}";
|
|
9
|
+
const sixInputCss = ":host{position:relative;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:border-box}.form-control .form-control__label{display:none}.form-control .form-control__help-text{display:none}.form-control .form-control__error-text{display:none;text-align:left}.form-control--has-label .form-control__label{display:inline-block;color:var(--six-input-label-color);font-weight:var(--six-font-weight-bold);margin-bottom:var(--six-spacing-x-small)}.form-control--has-label .form-control__label__required::after{color:var(--six-color-danger-800);content:\"*\";transform:scale(1.1);margin-left:var(--six-spacing-xxx-small);position:absolute}.form-control--has-label.form-control--small .form-control__label{font-size:var(--six-input-label-font-size-small)}.form-control--has-label.form-control--medium .form-control__label{font-size:var(--six-input-label-font-size-medium)}.form-control--has-label.form-control--large .form-control_label{font-size:var(--six-input-label-font-size-large)}.form-control--has-help-text .form-control__help-text{display:block;color:var(--six-input-help-text-color);margin-top:var(--six-spacing-x-small)}.form-control--has-help-text .form-control__help-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-help-text.form-control--small .form-control__help-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-help-text.form-control--medium .form-control__help-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-help-text.form-control--large .form-control__help-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--has-error-text .form-control__error-text{display:block;margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text .form-control__error-text ::slotted(*){margin-top:var(--six-spacing-xxx-small)}.form-control--has-error-text.form-control--small .form-control__error-text{font-size:var(--six-input-help-text-font-size-small)}.form-control--has-error-text.form-control--medium .form-control__error-text{font-size:var(--six-input-help-text-font-size-medium)}.form-control--has-error-text.form-control--large .form-control__error-text{font-size:var(--six-input-help-text-font-size-large)}.form-control--disabled .form-control__help-text{color:var(--six-input-help-text-color-disabled)}.form-control--disabled .form-control__label{color:var(--six-input-label-color-disabled)}.form-control--invalid:not(.form-control--disabled) .form-control__label{color:var(--six-input-label-color)}:host{display:block}.input{display:inline-flex;align-items:stretch;justify-content:start;position:relative;width:100%;font-family:var(--six-font-family);font-weight:var(--six-input-font-weight);letter-spacing:var(--six-input-letter-spacing);background-color:var(--six-input-background-color);border:solid var(--six-border-width) var(--six-input-border-color);vertical-align:middle;overflow:hidden;transition:var(--six-transition-fast) color, var(--six-transition-fast) border, var(--six-transition-fast) box-shadow;cursor:text}.input--line{border:none;border-bottom:solid var(--six-border-width) var(--six-input-border-color)}.input:hover:not(.input--disabled){background-color:var(--six-input-background-color-hover);border-color:var(--six-input-border-color-hover)}.input:hover:not(.input--disabled) .input__control{color:var(--six-input-color-hover)}.input:hover.input--dropdown-search{border-color:transparent}.input--dropdown-search{border-color:transparent}.input--dropdown-search.input--focused{border-color:var(--six-input-border-color)}.input.input--focused:not(.input--disabled){background-color:var(--six-input-background-color-focus);border-bottom-color:var(--six-input-border-color-focus);box-shadow:0 1px 0 0 var(--six-input-border-color-focus)}.input.input--focused:not(.input--disabled):not(.input--line){border-color:var(--six-input-border-color-focus);box-shadow:var(--six-input-focus-shadow)}.input.input--focused:not(.input--disabled) .input__control{color:var(--six-input-color-focus)}.input.input--disabled{background-color:var(--six-input-background-color-disabled);border-color:var(--six-input-border-color-disabled);cursor:not-allowed}.input.input--disabled .input__control{color:var(--six-input-color-disabled)}.input.input--disabled .input__control::placeholder{color:var(--six-input-placeholder-color-disabled)}.input.input--invalid:not(.input--disabled):not(.input--focused){border-bottom-color:var(--six-input-border-color-danger)}.input.input--invalid:not(.input--disabled):not(.input--focused):not(.input--line){border-color:var(--six-input-border-color-danger)}.input__control{flex:1 1 auto;width:100%;font-family:inherit;font-size:inherit;font-weight:inherit;min-width:0;color:var(--six-input-color);border:none;background:none;box-shadow:none;padding:0;margin:0;cursor:inherit;-webkit-appearance:none}.input__control::-webkit-search-decoration,.input__control::-webkit-search-cancel-button,.input__control::-webkit-search-results-button,.input__control::-webkit-search-results-decoration{-webkit-appearance:none}.input__control:-webkit-autofill,.input__control:-webkit-autofill:hover,.input__control:-webkit-autofill:focus,.input__control:-webkit-autofill:active{box-shadow:0 0 0 var(--six-height-large) var(--six-input-background-color-hover) inset !important;-webkit-text-fill-color:var(--six-color-primary-500)}.input__control::placeholder{color:var(--six-input-placeholder-color);user-select:none}.input__control:focus{outline:none}.input__control::-ms-reveal{display:none}.input__prefix,.input__suffix{display:inline-flex;flex:0 0 auto;align-items:center;cursor:default}.input__prefix ::slotted(six-icon),.input__suffix ::slotted(six-icon){color:var(--six-input-icon-color)}.input.input--disabled ::slotted(six-icon){cursor:not-allowed}.input--small{border-radius:var(--six-input-border-radius-small);font-size:var(--six-input-font-size-small);height:var(--six-height-small)}.input--small .input__control{height:calc(var(--six-height-small) - var(--six-border-width) * 2);margin:0 var(--six-input-spacing-small)}.input--small .input__control__prefix{margin:0 var(--six-input-prefix-spacing-small)}.input--small .input__clear,.input--small .input__password-toggle{margin-right:var(--six-input-spacing-small)}.input--small .input__prefix ::slotted(*){margin-left:var(--six-input-prefix-spacing-small)}.input--small .input__suffix ::slotted(*){margin-right:var(--six-input-prefix-spacing-small)}.input--medium{border-radius:var(--six-input-border-radius-medium);font-size:var(--six-input-font-size-medium);height:var(--six-height-medium)}.input--medium .input__control{height:calc(var(--six-height-medium) - var(--six-border-width) * 2);margin:0 var(--six-input-spacing-medium)}.input--medium .input__control__prefix{margin:0 var(--six-input-prefix-spacing-medium)}.input--medium .input__clear,.input--medium .input__password-toggle{margin-right:var(--six-input-spacing-medium)}.input--medium .input__prefix ::slotted(*){margin-left:var(--six-input-prefix-spacing-medium)}.input--medium .input__suffix ::slotted(*){margin-right:var(--six-input-prefix-spacing-medium)}.input--large{border-radius:var(--six-input-border-radius-large);font-size:var(--six-input-font-size-large);height:var(--six-height-large)}.input--large .input__control{height:calc(var(--six-height-large) - var(--six-border-width) * 2);margin:0 var(--six-input-spacing-large)}.input--large .input__control__prefix{margin:0 var(--six-input-prefix-spacing-large)}.input--large .input__clear,.input--large .input__password-toggle{margin-right:var(--six-input-spacing-large)}.input--large .input__prefix ::slotted(*){margin-left:var(--six-input-prefix-spacing-large)}.input--large .input__suffix ::slotted(*){margin-right:var(--six-input-prefix-spacing-large)}.input--pill.input--small{border-radius:var(--six-height-small)}.input--pill.input--medium{border-radius:var(--six-height-medium)}.input--pill.input--large{border-radius:var(--six-height-large)}.input__clear,.input__password-toggle{display:inline-flex;align-items:center;font-size:inherit;color:var(--six-input-icon-color);border:none;background:none;padding:0;transition:var(--six-transition-fast) color;cursor:pointer}.input__clear:hover,.input__password-toggle:hover{color:var(--six-input-icon-color-hover)}.input__clear:focus,.input__password-toggle:focus{outline:none}.input--empty .input__clear{visibility:hidden}";
|
|
10
10
|
const SixInputStyle0 = sixInputCss;
|
|
11
11
|
|
|
12
12
|
const ICON_SIZES = {
|
|
@@ -161,6 +161,15 @@ const SixInput = /*@__PURE__*/ proxyCustomElement(class SixInput extends HTMLEle
|
|
|
161
161
|
var _a;
|
|
162
162
|
return (_a = this.nativeInput) === null || _a === void 0 ? void 0 : _a.setSelectionRange(selectionStart, selectionEnd, selectionDirection);
|
|
163
163
|
}
|
|
164
|
+
/** Returns the start and end positions of the text selection */
|
|
165
|
+
async getSelectionRange() {
|
|
166
|
+
var _a, _b, _c, _d, _e, _f;
|
|
167
|
+
return {
|
|
168
|
+
selectionStart: (_b = (_a = this.nativeInput) === null || _a === void 0 ? void 0 : _a.selectionStart) !== null && _b !== void 0 ? _b : undefined,
|
|
169
|
+
selectionEnd: (_d = (_c = this.nativeInput) === null || _c === void 0 ? void 0 : _c.selectionEnd) !== null && _d !== void 0 ? _d : undefined,
|
|
170
|
+
selectionDirection: (_f = (_e = this.nativeInput) === null || _e === void 0 ? void 0 : _e.selectionDirection) !== null && _f !== void 0 ? _f : undefined,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
164
173
|
/** Replaces a range of text with a new string. */
|
|
165
174
|
async setRangeText(replacement, start, end, selectMode = 'preserve') {
|
|
166
175
|
if (this.nativeInput == null) {
|
|
@@ -178,7 +187,7 @@ const SixInput = /*@__PURE__*/ proxyCustomElement(class SixInput extends HTMLEle
|
|
|
178
187
|
return ((_a = this.value) !== null && _a !== void 0 ? _a : '').toString();
|
|
179
188
|
}
|
|
180
189
|
render() {
|
|
181
|
-
return (h(FormControl, { key: '
|
|
190
|
+
return (h(FormControl, { key: '73c1694ce5e466407258d8d38303f3adcf50e150', inputId: this.inputId, label: this.label, labelId: this.labelId, hasLabelSlot: this.hasLabelSlot, helpTextId: this.helpTextId, helpText: this.helpText, hasHelpTextSlot: this.hasHelpTextSlot, errorTextId: this.errorTextId, errorText: this.errorText, errorTextCount: this.errorTextCount, hasErrorTextSlot: this.hasErrorSlot, size: this.size, disabled: this.disabled, required: this.required, displayError: this.invalid }, h("div", { key: '0326b1027576d6de7980845a6dd95c9019c3169c', part: "base", class: {
|
|
182
191
|
input: true,
|
|
183
192
|
// Sizes
|
|
184
193
|
'input--small': this.size === 'small',
|
|
@@ -192,10 +201,10 @@ const SixInput = /*@__PURE__*/ proxyCustomElement(class SixInput extends HTMLEle
|
|
|
192
201
|
'input--focused': this.hasFocus,
|
|
193
202
|
'input--empty': this.getValue().length === 0,
|
|
194
203
|
'input--invalid': this.invalid,
|
|
195
|
-
} }, h("span", { key: '
|
|
204
|
+
} }, h("span", { key: '1949ec04d935c5cd2a225dfe967bfb7c53b815e1', part: "prefix", class: "input__prefix" }, h("slot", { key: 'cd1a905c2a3001271aa9c700fc5fa7dd3c010515', name: "prefix" })), h("input", { key: '5d4e05793017d078f06263ef72414cfedcb3cd30', part: "input", ref: (el) => (this.nativeInput = el), id: this.inputId, size: 1, class: {
|
|
196
205
|
input__control: true,
|
|
197
206
|
input__control__prefix: hasSlot(this.host, 'prefix'),
|
|
198
|
-
}, type: this.type === 'password' && this.isPasswordVisible ? 'text' : this.type, name: this.name, placeholder: this.placeholder, disabled: this.disabled, readonly: this.readonly, minLength: this.minlength, maxLength: this.maxlength, min: this.min, max: this.max, step: this.step, value: this.getValue(), autoCapitalize: this.autocapitalize, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, autoFocus: this.autofocus, spellcheck: this.spellcheck, pattern: this.pattern, required: this.required, inputMode: this.inputmode, "aria-labelledby": this.labelId, "aria-describedby": this.helpTextId, "aria-invalid": this.invalid ? 'true' : 'false', onChange: this.handleChange, onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, onKeyDown: this.handleKeyDown, "data-testid": "input-control" }), this.clearable && (h("button", { part: "clear-button", class: "input__clear", type: "button", onClick: this.handleClearClick, tabindex: "-1", "data-testid": "input-clear-button" }, h("slot", { name: "clear-icon" }, h("six-icon", { size: ICON_SIZES[this.size] }, "clear")))), this.togglePassword && (h("button", { part: "password-toggle-button", class: "input__password-toggle", type: "button", onClick: this.handlePasswordToggle, tabindex: "-1" }, this.isPasswordVisible ? (h("slot", { name: "show-password-icon" }, h("six-icon", { size: ICON_SIZES[this.size] }, "visibility_off"))) : (h("slot", { name: "hide-password-icon" }, h("six-icon", { size: ICON_SIZES[this.size] }, "visibility"))))), h("span", { key: '
|
|
207
|
+
}, type: this.type === 'password' && this.isPasswordVisible ? 'text' : this.type, name: this.name, placeholder: this.placeholder, disabled: this.disabled, readonly: this.readonly, minLength: this.minlength, maxLength: this.maxlength, min: this.min, max: this.max, step: this.step, value: this.getValue(), autoCapitalize: this.autocapitalize, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, autoFocus: this.autofocus, spellcheck: this.spellcheck, pattern: this.pattern, required: this.required, inputMode: this.inputmode, "aria-labelledby": this.labelId, "aria-describedby": this.helpTextId, "aria-invalid": this.invalid ? 'true' : 'false', onChange: this.handleChange, onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, onKeyDown: this.handleKeyDown, "data-testid": "input-control" }), this.clearable && (h("button", { part: "clear-button", class: "input__clear", type: "button", onClick: this.handleClearClick, tabindex: "-1", "data-testid": "input-clear-button" }, h("slot", { name: "clear-icon" }, h("six-icon", { size: ICON_SIZES[this.size] }, "clear")))), this.togglePassword && (h("button", { part: "password-toggle-button", class: "input__password-toggle", type: "button", onClick: this.handlePasswordToggle, tabindex: "-1" }, this.isPasswordVisible ? (h("slot", { name: "show-password-icon" }, h("six-icon", { size: ICON_SIZES[this.size] }, "visibility_off"))) : (h("slot", { name: "hide-password-icon" }, h("six-icon", { size: ICON_SIZES[this.size] }, "visibility"))))), h("span", { key: '6aa1bd188f4c2e55699f5dc7ad96e835efb9eab2', part: "suffix", class: "input__suffix" }, h("slot", { key: '75b65bd7d31eac83dfc37eddbd68c7a24126b0e5', name: "suffix" })))));
|
|
199
208
|
}
|
|
200
209
|
get host() { return this; }
|
|
201
210
|
static get watchers() { return {
|
|
@@ -245,6 +254,7 @@ const SixInput = /*@__PURE__*/ proxyCustomElement(class SixInput extends HTMLEle
|
|
|
245
254
|
"removeFocus": [64],
|
|
246
255
|
"select": [64],
|
|
247
256
|
"setSelectionRange": [64],
|
|
257
|
+
"getSelectionRange": [64],
|
|
248
258
|
"setRangeText": [64]
|
|
249
259
|
}, undefined, {
|
|
250
260
|
"helpText": ["handleLabelChange"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"six-input2.js","m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,IAAI,CAAC,UAAU,EACvB,SAAS,EAAE,IAAI,CAAC,aAAa,iBACjB,eAAe,GAC3B,EAED,IAAI,CAAC,SAAS,KACb,cACE,IAAI,EAAC,cAAc,EACnB,KAAK,EAAC,cAAc,EACpB,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAC9B,QAAQ,EAAC,IAAI,iBACD,oBAAoB,IAEhC,YAAM,IAAI,EAAC,YAAY,IACrB,gBAAU,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,YAAkB,CAClD,CACA,CACV,EAEA,IAAI,CAAC,cAAc,KAClB,cACE,IAAI,EAAC,wBAAwB,EAC7B,KAAK,EAAC,wBAAwB,EAC9B,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,IAAI,CAAC,oBAAoB,EAClC,QAAQ,EAAC,IAAI,IAEZ,IAAI,CAAC,iBAAiB,IACrB,YAAM,IAAI,EAAC,oBAAoB,IAC7B,gBAAU,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,qBAA2B,CAC3D,KAEP,YAAM,IAAI,EAAC,oBAAoB,IAC7B,gBAAU,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAuB,CACvD,CACR,CACM,CACV,EAED,6DAAM,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,eAAe,IACvC,6DAAM,IAAI,EAAC,QAAQ,GAAG,CACjB,CACH,CACM,EACd;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/six-input/six-input.scss?tag=six-input&encapsulation=shadow","src/components/six-input/six-input.tsx"],"sourcesContent":["@import 'src/global/component';\n@import '../../functional-components/form-control/form-control';\n\n:host {\n display: block;\n}\n\n.input {\n display: inline-flex;\n align-items: stretch;\n justify-content: start;\n position: relative;\n width: 100%;\n font-family: var(--six-font-family);\n font-weight: var(--six-input-font-weight);\n letter-spacing: var(--six-input-letter-spacing);\n background-color: var(--six-input-background-color);\n border: solid var(--six-border-width) var(--six-input-border-color);\n vertical-align: middle;\n overflow: hidden;\n transition: var(--six-transition-fast) color, var(--six-transition-fast) border, var(--six-transition-fast) box-shadow;\n cursor: text;\n\n &--line {\n border: none;\n border-bottom: solid var(--six-border-width) var(--six-input-border-color);\n }\n\n &:hover:not(.input--disabled) {\n background-color: var(--six-input-background-color-hover);\n border-color: var(--six-input-border-color-hover);\n\n .input__control {\n color: var(--six-input-color-hover);\n }\n }\n\n &:hover.input--dropdown-search {\n border-color: transparent;\n }\n\n &--dropdown-search {\n border-color: transparent;\n }\n\n &--dropdown-search.input--focused {\n border-color: var(--six-input-border-color);\n }\n\n &.input--focused:not(.input--disabled) {\n background-color: var(--six-input-background-color-focus);\n\n border-bottom-color: var(--six-input-border-color-focus);\n box-shadow: 0 1px 0 0 var(--six-input-border-color-focus);\n\n &:not(.input--line) {\n border-color: var(--six-input-border-color-focus);\n box-shadow: var(--six-input-focus-shadow);\n }\n\n .input__control {\n color: var(--six-input-color-focus);\n }\n }\n\n &.input--disabled {\n background-color: var(--six-input-background-color-disabled);\n border-color: var(--six-input-border-color-disabled);\n cursor: not-allowed;\n\n .input__control {\n color: var(--six-input-color-disabled);\n\n &::placeholder {\n color: var(--six-input-placeholder-color-disabled);\n }\n }\n }\n\n &.input--invalid:not(.input--disabled):not(.input--focused) {\n border-bottom-color: var(--six-input-border-color-danger);\n\n &:not(.input--line) {\n border-color: var(--six-input-border-color-danger);\n }\n }\n}\n\n.input__control {\n flex: 1 1 auto;\n font-family: inherit;\n font-size: inherit;\n font-weight: inherit;\n min-width: 0;\n color: var(--six-input-color);\n border: none;\n background: none;\n box-shadow: none;\n padding: 0;\n margin: 0;\n cursor: inherit;\n -webkit-appearance: none;\n\n &::-webkit-search-decoration,\n &::-webkit-search-cancel-button,\n &::-webkit-search-results-button,\n &::-webkit-search-results-decoration {\n -webkit-appearance: none;\n }\n\n &:-webkit-autofill,\n &:-webkit-autofill:hover,\n &:-webkit-autofill:focus,\n &:-webkit-autofill:active {\n box-shadow: 0 0 0 var(--six-height-large) var(--six-input-background-color-hover) inset !important;\n -webkit-text-fill-color: var(--six-color-primary-500);\n }\n\n &::placeholder {\n color: var(--six-input-placeholder-color);\n user-select: none;\n }\n\n &:focus {\n outline: none;\n }\n\n &::-ms-reveal {\n display: none;\n }\n}\n\n.input__prefix,\n.input__suffix {\n display: inline-flex;\n flex: 0 0 auto;\n align-items: center;\n cursor: default;\n\n ::slotted(six-icon) {\n color: var(--six-input-icon-color);\n }\n}\n\n.input {\n &.input--disabled {\n ::slotted(six-icon) {\n cursor: not-allowed;\n }\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Size modifiers\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.input--small {\n border-radius: var(--six-input-border-radius-small);\n font-size: var(--six-input-font-size-small);\n height: var(--six-height-small);\n\n .input__control {\n height: calc(var(--six-height-small) - var(--six-border-width) * 2);\n margin: 0 var(--six-input-spacing-small);\n }\n\n .input__control__prefix {\n margin: 0 var(--six-input-prefix-spacing-small);\n }\n\n .input__clear,\n .input__password-toggle {\n margin-right: var(--six-input-spacing-small);\n }\n\n .input__prefix ::slotted(*) {\n margin-left: var(--six-input-prefix-spacing-small);\n }\n\n .input__suffix ::slotted(*) {\n margin-right: var(--six-input-prefix-spacing-small);\n }\n}\n\n.input--medium {\n border-radius: var(--six-input-border-radius-medium);\n font-size: var(--six-input-font-size-medium);\n height: var(--six-height-medium);\n\n .input__control {\n height: calc(var(--six-height-medium) - var(--six-border-width) * 2);\n margin: 0 var(--six-input-spacing-medium);\n }\n\n .input__control__prefix {\n margin: 0 var(--six-input-prefix-spacing-medium);\n }\n\n .input__clear,\n .input__password-toggle {\n margin-right: var(--six-input-spacing-medium);\n }\n\n .input__prefix ::slotted(*) {\n margin-left: var(--six-input-prefix-spacing-medium);\n }\n\n .input__suffix ::slotted(*) {\n margin-right: var(--six-input-prefix-spacing-medium);\n }\n}\n\n.input--large {\n border-radius: var(--six-input-border-radius-large);\n font-size: var(--six-input-font-size-large);\n height: var(--six-height-large);\n\n .input__control {\n height: calc(var(--six-height-large) - var(--six-border-width) * 2);\n margin: 0 var(--six-input-spacing-large);\n }\n\n .input__control__prefix {\n margin: 0 var(--six-input-prefix-spacing-large);\n }\n\n .input__clear,\n .input__password-toggle {\n margin-right: var(--six-input-spacing-large);\n }\n\n .input__prefix ::slotted(*) {\n margin-left: var(--six-input-prefix-spacing-large);\n }\n\n .input__suffix ::slotted(*) {\n margin-right: var(--six-input-prefix-spacing-large);\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Pill modifier\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.input--pill {\n &.input--small {\n border-radius: var(--six-height-small);\n }\n\n &.input--medium {\n border-radius: var(--six-height-medium);\n }\n\n &.input--large {\n border-radius: var(--six-height-large);\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Clearable + Password Toggle\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.input__clear,\n.input__password-toggle {\n display: inline-flex;\n align-items: center;\n font-size: inherit;\n color: var(--six-input-icon-color);\n border: none;\n background: none;\n padding: 0;\n transition: var(--six-transition-fast) color;\n cursor: pointer;\n\n &:hover {\n color: var(--six-input-icon-color-hover);\n }\n\n &:focus {\n outline: none;\n }\n}\n\n.input--empty .input__clear {\n visibility: hidden;\n}\n","import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport FormControl from '../../functional-components/form-control/form-control';\nimport { hasSlot } from '../../utils/slot';\nimport { EmptyPayload } from '../../utils/types';\nimport { EventListeners } from '../../utils/event-listeners';\nimport { submitForm } from '../../utils/form';\n\nconst ICON_SIZES: Record<'small' | 'medium' | 'large', 'xSmall' | 'small' | 'medium'> = {\n large: 'medium',\n medium: 'small',\n small: 'xSmall',\n};\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot label - The input's label. Alternatively, you can use the label prop.\n * @slot prefix - Used to prepend an icon or similar element to the input.\n * @slot suffix - Used to append an icon or similar element to the input.\n * @slot clear-icon - An icon to use in lieu of the default clear icon.\n * @slot show-password-icon - An icon to use in lieu of the default show password icon.\n * @slot hide-password-icon - An icon to use in lieu of the default hide password icon.\n * @slot help-text - Help text that describes how to use the input. Alternatively, you can use the help-text prop.\n * @slot error-text - Error text that is shown when the status is set to invalid. Alternatively, you can use the error-text prop.\n *\n * @part base - The component's base wrapper.\n * @part form-control - The form control that wraps the label, input, error-text and help-text.\n * @part label - The input label.\n * @part input - The input control.\n * @part prefix - The input prefix container.\n * @part clear-button - The clear button.\n * @part password-toggle-button - The password toggle button.\n * @part suffix - The input suffix container.\n * @part help-text - The input help text.\n * @part error-text - The input error text.\n */\n\n@Component({\n tag: 'six-input',\n styleUrl: 'six-input.scss',\n shadow: true,\n})\nexport class SixInput {\n private inputId = `input-${++id}`;\n private labelId = `input-label-${id}`;\n private helpTextId = `input-help-text-${id}`;\n private errorTextId = `input-error-text-${id}`;\n private nativeInput?: HTMLInputElement;\n private eventListeners = new EventListeners();\n\n @Element() host!: HTMLSixInputElement;\n\n @State() hasFocus = false;\n @State() hasHelpTextSlot = false;\n @State() hasLabelSlot = false;\n @State() hasErrorSlot = false;\n @State() isPasswordVisible = false;\n\n /** The input's type. */\n @Prop({ reflect: true }) type: 'email' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'url' = 'text';\n\n /** The input's size. */\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /** The input's name attribute. */\n @Prop({ reflect: true }) name = '';\n\n /** The input's value attribute. */\n @Prop({ mutable: true, reflect: true }) value = '';\n\n /** Set to true to draw a pill-style input with rounded edges. */\n @Prop({ reflect: true }) pill = false;\n\n /** The input's help text. Alternatively, you can use the help-text slot. */\n @Prop() helpText = '';\n\n /** The input's placeholder text. */\n @Prop() placeholder?: string;\n\n /** Set to true to disable the input. */\n @Prop({ reflect: true }) disabled = false;\n\n /** Set to true to make the input readonly. */\n @Prop({ reflect: true }) readonly = false;\n\n /** The minimum length of input that will be considered valid. */\n @Prop({ reflect: true }) minlength?: number;\n\n /** The maximum length of input that will be considered valid. */\n @Prop({ reflect: true }) maxlength?: number;\n\n /** The input's minimum value. */\n @Prop({ reflect: true }) min?: number;\n\n /** The input's maximum value. */\n @Prop({ reflect: true }) max?: number;\n\n /** The input's step attribute. */\n @Prop({ reflect: true }) step?: number;\n\n /** A pattern to validate input against. */\n @Prop({ reflect: true }) pattern?: string;\n\n /**\n * Internal: Styles the input for the dropdown filter search.\n */\n @Prop() dropdownSearch = false;\n\n /** Set to true to show an asterisk beneath the label. */\n @Prop() required = false;\n\n /** The input's autocaptialize attribute. */\n @Prop() autocapitalize = 'off';\n\n /** The input's autocorrect attribute. */\n @Prop() autocorrect: 'on' | 'off' = 'off';\n\n /** The input's autocomplete attribute. */\n @Prop() autocomplete = 'off';\n\n /** The input's autofocus attribute. */\n @Prop() autofocus = false;\n\n /** Enables spell checking on the input. */\n @Prop() spellcheck = false;\n\n /** The label text. */\n @Prop() label = '';\n\n /** The error message shown, if `invalid` is set to true. */\n @Prop() errorText: string | string[] = '';\n\n /** The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1 */\n @Prop() errorTextCount?: number;\n\n /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */\n @Prop({ reflect: true }) invalid = false;\n\n /** Set to true to add a clear button when the input is populated. */\n @Prop() clearable = false;\n\n /** Set to true to add a password toggle button for password inputs. */\n @Prop() togglePassword = false;\n\n /** The input's inputmode attribute. */\n @Prop() inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';\n\n /** Set to render as line */\n @Prop() line = false;\n\n @Watch('helpText')\n @Watch('errorText')\n @Watch('label')\n handleLabelChange() {\n this.handleSlotChange();\n }\n\n @Watch('value')\n handleValueChange() {\n this.value = this.getValue();\n if (this.nativeInput != null && this.nativeInput.value !== this.value) {\n this.nativeInput.value = this.value;\n }\n }\n\n /** Emitted when the control's value changes. Access the new value via event.target.value. */\n @Event({ eventName: 'six-input-change' }) sixChange!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the clear button is activated. */\n @Event({ eventName: 'six-input-clear' }) sixClear!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control receives input. Access the new value via event.target.value. */\n @Event({ eventName: 'six-input-input' }) sixInput!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control gains focus. */\n @Event({ eventName: 'six-input-focus' }) sixFocus!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control loses focus. Access the new value via event.target.value. */\n @Event({ eventName: 'six-input-blur' }) sixBlur!: EventEmitter<EmptyPayload>;\n\n connectedCallback() {\n this.host.shadowRoot?.addEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.forward('six-input-input', 'input', this.host);\n this.eventListeners.forward('six-input-change', 'change', this.host);\n this.eventListeners.forward('six-input-focus', 'focus', this.host);\n this.eventListeners.forward('six-input-blur', 'blur', this.host);\n }\n\n componentWillLoad() {\n this.handleSlotChange();\n }\n\n disconnectedCallback() {\n this.host.shadowRoot?.removeEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.removeAll();\n }\n\n /** Sets focus on the input. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.nativeInput?.focus(options);\n }\n\n /** Removes focus from the input. */\n @Method()\n async removeFocus() {\n this.nativeInput?.blur();\n }\n\n /** Selects all the text in the input. */\n @Method()\n async select() {\n return this.nativeInput?.select();\n }\n\n /** Sets the start and end positions of the text selection (0-based). */\n @Method()\n async setSelectionRange(\n selectionStart: number,\n selectionEnd: number,\n selectionDirection: 'forward' | 'backward' | 'none' = 'none'\n ) {\n return this.nativeInput?.setSelectionRange(selectionStart, selectionEnd, selectionDirection);\n }\n\n /** Replaces a range of text with a new string. */\n @Method()\n async setRangeText(\n replacement: string,\n start: number,\n end: number,\n selectMode: 'select' | 'start' | 'end' | 'preserve' = 'preserve'\n ) {\n if (this.nativeInput == null) {\n return;\n }\n this.nativeInput.setRangeText(replacement, start, end, selectMode);\n if (this.getValue() !== this.nativeInput.value) {\n this.value = this.nativeInput.value;\n this.sixChange.emit();\n this.sixInput.emit();\n }\n }\n\n private handleChange = (event: Event) => {\n event.stopPropagation();\n if (this.nativeInput != null) {\n this.value = this.nativeInput.value;\n this.sixChange.emit();\n }\n };\n\n private handleInput = (event: Event) => {\n event.stopPropagation();\n if (this.nativeInput != null) {\n this.value = this.nativeInput.value;\n this.sixInput.emit();\n }\n };\n\n private handleBlur = () => {\n this.hasFocus = false;\n this.sixBlur.emit();\n };\n\n private handleFocus = () => {\n this.hasFocus = true;\n this.sixFocus.emit();\n };\n\n private handleClearClick = (event: MouseEvent) => {\n this.value = '';\n this.sixClear.emit();\n this.sixInput.emit();\n this.sixChange.emit();\n if (this.nativeInput != null) {\n this.nativeInput.focus();\n }\n event.stopPropagation();\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n const hasModifier = event.metaKey || event.ctrlKey || event.shiftKey || event.altKey;\n if (event.key === 'Enter' && !hasModifier) {\n setTimeout(() => {\n if (!event.defaultPrevented && !event.isComposing) {\n submitForm(this.host);\n }\n });\n }\n };\n\n private handlePasswordToggle = () => {\n this.isPasswordVisible = !this.isPasswordVisible;\n };\n\n private handleSlotChange = () => {\n this.hasHelpTextSlot = hasSlot(this.host, 'help-text');\n this.hasLabelSlot = hasSlot(this.host, 'label');\n this.hasErrorSlot = hasSlot(this.host, 'error-text');\n };\n\n private getValue(): string {\n return (this.value ?? '').toString();\n }\n\n render() {\n return (\n <FormControl\n inputId={this.inputId}\n label={this.label}\n labelId={this.labelId}\n hasLabelSlot={this.hasLabelSlot}\n helpTextId={this.helpTextId}\n helpText={this.helpText}\n hasHelpTextSlot={this.hasHelpTextSlot}\n errorTextId={this.errorTextId}\n errorText={this.errorText}\n errorTextCount={this.errorTextCount}\n hasErrorTextSlot={this.hasErrorSlot}\n size={this.size}\n disabled={this.disabled}\n required={this.required}\n displayError={this.invalid}\n >\n <div\n part=\"base\"\n class={{\n input: true,\n\n // Sizes\n 'input--small': this.size === 'small',\n 'input--medium': this.size === 'medium',\n 'input--large': this.size === 'large',\n\n // States\n 'input--line': this.line,\n 'input--pill': this.pill,\n 'input--disabled': this.disabled,\n 'input--dropdown-search': this.dropdownSearch,\n 'input--focused': this.hasFocus,\n 'input--empty': this.getValue().length === 0,\n 'input--invalid': this.invalid,\n }}\n >\n <span part=\"prefix\" class=\"input__prefix\">\n <slot name=\"prefix\" />\n </span>\n\n <input\n part=\"input\"\n ref={(el) => (this.nativeInput = el)}\n id={this.inputId}\n size={1} // needed for firefox to overrule the default of 20\n class={{\n input__control: true,\n input__control__prefix: hasSlot(this.host, 'prefix'),\n }}\n type={this.type === 'password' && this.isPasswordVisible ? 'text' : this.type}\n name={this.name}\n placeholder={this.placeholder}\n disabled={this.disabled}\n readonly={this.readonly}\n minLength={this.minlength}\n maxLength={this.maxlength}\n min={this.min}\n max={this.max}\n step={this.step}\n value={this.getValue()}\n autoCapitalize={this.autocapitalize}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n spellcheck={this.spellcheck}\n pattern={this.pattern}\n required={this.required}\n inputMode={this.inputmode}\n aria-labelledby={this.labelId}\n aria-describedby={this.helpTextId}\n aria-invalid={this.invalid ? 'true' : 'false'}\n onChange={this.handleChange}\n onInput={this.handleInput}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n onKeyDown={this.handleKeyDown}\n data-testid=\"input-control\"\n />\n\n {this.clearable && (\n <button\n part=\"clear-button\"\n class=\"input__clear\"\n type=\"button\"\n onClick={this.handleClearClick}\n tabindex=\"-1\"\n data-testid=\"input-clear-button\"\n >\n <slot name=\"clear-icon\">\n <six-icon size={ICON_SIZES[this.size]}>clear</six-icon>\n </slot>\n </button>\n )}\n\n {this.togglePassword && (\n <button\n part=\"password-toggle-button\"\n class=\"input__password-toggle\"\n type=\"button\"\n onClick={this.handlePasswordToggle}\n tabindex=\"-1\"\n >\n {this.isPasswordVisible ? (\n <slot name=\"show-password-icon\">\n <six-icon size={ICON_SIZES[this.size]}>visibility_off</six-icon>\n </slot>\n ) : (\n <slot name=\"hide-password-icon\">\n <six-icon size={ICON_SIZES[this.size]}>visibility</six-icon>\n </slot>\n )}\n </button>\n )}\n\n <span part=\"suffix\" class=\"input__suffix\">\n <slot name=\"suffix\" />\n </span>\n </div>\n </FormControl>\n );\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"six-input2.js","mappings":";;;;;;;;AAAA,MAAM,WAAW,GAAG,4tQAA4tQ,CAAC;AACjvQ,uBAAe,WAAW;;ACM1B,MAAM,UAAU,GAAwE;IACtF,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,OAAO;IACf,KAAK,EAAE,QAAQ;CAChB,CAAC;AASF,IAAI,EAAE,GAAG,CAAC,CAAC;MAkCE,QAAQ;;;;;;;;;;QACX,YAAO,GAAG,SAAS,EAAE,EAAE,EAAE,CAAC;QAC1B,YAAO,GAAG,eAAe,EAAE,EAAE,CAAC;QAC9B,eAAU,GAAG,mBAAmB,EAAE,EAAE,CAAC;QACrC,gBAAW,GAAG,oBAAoB,EAAE,EAAE,CAAC;QAEvC,mBAAc,GAAG,IAAI,cAAc,EAAE,CAAC;QA8MtC,iBAAY,GAAG,CAAC,KAAY;YAClC,KAAK,CAAC,eAAe,EAAE,CAAC;YACxB,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,EAAE;gBAC5B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;gBACpC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;aACvB;SACF,CAAC;QAEM,gBAAW,GAAG,CAAC,KAAY;YACjC,KAAK,CAAC,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AAI,CAAC,oBAAoB,EAClC,QAAQ,EAAC,IAAI,IAEZ,IAAI,CAAC,iBAAiB,IACrB,YAAM,IAAI,EAAC,oBAAoB,IAC7B,gBAAU,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,qBAA2B,CAC3D,KAEP,YAAM,IAAI,EAAC,oBAAoB,IAC7B,gBAAU,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAuB,CACvD,CACR,CACM,CACV,EAED,6DAAM,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,eAAe,IACvC,6DAAM,IAAI,EAAC,QAAQ,GAAG,CACjB,CACH,CACM,EACd;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/six-input/six-input.scss?tag=six-input&encapsulation=shadow","src/components/six-input/six-input.tsx"],"sourcesContent":["@import 'src/global/component';\n@import '../../functional-components/form-control/form-control';\n\n:host {\n display: block;\n}\n\n.input {\n display: inline-flex;\n align-items: stretch;\n justify-content: start;\n position: relative;\n width: 100%;\n font-family: var(--six-font-family);\n font-weight: var(--six-input-font-weight);\n letter-spacing: var(--six-input-letter-spacing);\n background-color: var(--six-input-background-color);\n border: solid var(--six-border-width) var(--six-input-border-color);\n vertical-align: middle;\n overflow: hidden;\n transition: var(--six-transition-fast) color, var(--six-transition-fast) border, var(--six-transition-fast) box-shadow;\n cursor: text;\n\n &--line {\n border: none;\n border-bottom: solid var(--six-border-width) var(--six-input-border-color);\n }\n\n &:hover:not(.input--disabled) {\n background-color: var(--six-input-background-color-hover);\n border-color: var(--six-input-border-color-hover);\n\n .input__control {\n color: var(--six-input-color-hover);\n }\n }\n\n &:hover.input--dropdown-search {\n border-color: transparent;\n }\n\n &--dropdown-search {\n border-color: transparent;\n }\n\n &--dropdown-search.input--focused {\n border-color: var(--six-input-border-color);\n }\n\n &.input--focused:not(.input--disabled) {\n background-color: var(--six-input-background-color-focus);\n\n border-bottom-color: var(--six-input-border-color-focus);\n box-shadow: 0 1px 0 0 var(--six-input-border-color-focus);\n\n &:not(.input--line) {\n border-color: var(--six-input-border-color-focus);\n box-shadow: var(--six-input-focus-shadow);\n }\n\n .input__control {\n color: var(--six-input-color-focus);\n }\n }\n\n &.input--disabled {\n background-color: var(--six-input-background-color-disabled);\n border-color: var(--six-input-border-color-disabled);\n cursor: not-allowed;\n\n .input__control {\n color: var(--six-input-color-disabled);\n\n &::placeholder {\n color: var(--six-input-placeholder-color-disabled);\n }\n }\n }\n\n &.input--invalid:not(.input--disabled):not(.input--focused) {\n border-bottom-color: var(--six-input-border-color-danger);\n\n &:not(.input--line) {\n border-color: var(--six-input-border-color-danger);\n }\n }\n}\n\n.input__control {\n flex: 1 1 auto;\n width: 100%;\n font-family: inherit;\n font-size: inherit;\n font-weight: inherit;\n min-width: 0;\n color: var(--six-input-color);\n border: none;\n background: none;\n box-shadow: none;\n padding: 0;\n margin: 0;\n cursor: inherit;\n -webkit-appearance: none;\n\n &::-webkit-search-decoration,\n &::-webkit-search-cancel-button,\n &::-webkit-search-results-button,\n &::-webkit-search-results-decoration {\n -webkit-appearance: none;\n }\n\n &:-webkit-autofill,\n &:-webkit-autofill:hover,\n &:-webkit-autofill:focus,\n &:-webkit-autofill:active {\n box-shadow: 0 0 0 var(--six-height-large) var(--six-input-background-color-hover) inset !important;\n -webkit-text-fill-color: var(--six-color-primary-500);\n }\n\n &::placeholder {\n color: var(--six-input-placeholder-color);\n user-select: none;\n }\n\n &:focus {\n outline: none;\n }\n\n &::-ms-reveal {\n display: none;\n }\n}\n\n.input__prefix,\n.input__suffix {\n display: inline-flex;\n flex: 0 0 auto;\n align-items: center;\n cursor: default;\n\n ::slotted(six-icon) {\n color: var(--six-input-icon-color);\n }\n}\n\n.input {\n &.input--disabled {\n ::slotted(six-icon) {\n cursor: not-allowed;\n }\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Size modifiers\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.input--small {\n border-radius: var(--six-input-border-radius-small);\n font-size: var(--six-input-font-size-small);\n height: var(--six-height-small);\n\n .input__control {\n height: calc(var(--six-height-small) - var(--six-border-width) * 2);\n margin: 0 var(--six-input-spacing-small);\n }\n\n .input__control__prefix {\n margin: 0 var(--six-input-prefix-spacing-small);\n }\n\n .input__clear,\n .input__password-toggle {\n margin-right: var(--six-input-spacing-small);\n }\n\n .input__prefix ::slotted(*) {\n margin-left: var(--six-input-prefix-spacing-small);\n }\n\n .input__suffix ::slotted(*) {\n margin-right: var(--six-input-prefix-spacing-small);\n }\n}\n\n.input--medium {\n border-radius: var(--six-input-border-radius-medium);\n font-size: var(--six-input-font-size-medium);\n height: var(--six-height-medium);\n\n .input__control {\n height: calc(var(--six-height-medium) - var(--six-border-width) * 2);\n margin: 0 var(--six-input-spacing-medium);\n }\n\n .input__control__prefix {\n margin: 0 var(--six-input-prefix-spacing-medium);\n }\n\n .input__clear,\n .input__password-toggle {\n margin-right: var(--six-input-spacing-medium);\n }\n\n .input__prefix ::slotted(*) {\n margin-left: var(--six-input-prefix-spacing-medium);\n }\n\n .input__suffix ::slotted(*) {\n margin-right: var(--six-input-prefix-spacing-medium);\n }\n}\n\n.input--large {\n border-radius: var(--six-input-border-radius-large);\n font-size: var(--six-input-font-size-large);\n height: var(--six-height-large);\n\n .input__control {\n height: calc(var(--six-height-large) - var(--six-border-width) * 2);\n margin: 0 var(--six-input-spacing-large);\n }\n\n .input__control__prefix {\n margin: 0 var(--six-input-prefix-spacing-large);\n }\n\n .input__clear,\n .input__password-toggle {\n margin-right: var(--six-input-spacing-large);\n }\n\n .input__prefix ::slotted(*) {\n margin-left: var(--six-input-prefix-spacing-large);\n }\n\n .input__suffix ::slotted(*) {\n margin-right: var(--six-input-prefix-spacing-large);\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Pill modifier\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.input--pill {\n &.input--small {\n border-radius: var(--six-height-small);\n }\n\n &.input--medium {\n border-radius: var(--six-height-medium);\n }\n\n &.input--large {\n border-radius: var(--six-height-large);\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Clearable + Password Toggle\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.input__clear,\n.input__password-toggle {\n display: inline-flex;\n align-items: center;\n font-size: inherit;\n color: var(--six-input-icon-color);\n border: none;\n background: none;\n padding: 0;\n transition: var(--six-transition-fast) color;\n cursor: pointer;\n\n &:hover {\n color: var(--six-input-icon-color-hover);\n }\n\n &:focus {\n outline: none;\n }\n}\n\n.input--empty .input__clear {\n visibility: hidden;\n}\n","import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport FormControl from '../../functional-components/form-control/form-control';\nimport { hasSlot } from '../../utils/slot';\nimport { EmptyPayload } from '../../utils/types';\nimport { EventListeners } from '../../utils/event-listeners';\nimport { submitForm } from '../../utils/form';\n\nconst ICON_SIZES: Record<'small' | 'medium' | 'large', 'xSmall' | 'small' | 'medium'> = {\n large: 'medium',\n medium: 'small',\n small: 'xSmall',\n};\n\nexport type SelectionRangeDirection = 'forward' | 'backward' | 'none';\nexport type SelectionRange = {\n selectionStart: number | undefined;\n selectionEnd: number | undefined;\n selectionDirection: SelectionRangeDirection | undefined;\n};\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot label - The input's label. Alternatively, you can use the label prop.\n * @slot prefix - Used to prepend an icon or similar element to the input.\n * @slot suffix - Used to append an icon or similar element to the input.\n * @slot clear-icon - An icon to use in lieu of the default clear icon.\n * @slot show-password-icon - An icon to use in lieu of the default show password icon.\n * @slot hide-password-icon - An icon to use in lieu of the default hide password icon.\n * @slot help-text - Help text that describes how to use the input. Alternatively, you can use the help-text prop.\n * @slot error-text - Error text that is shown when the status is set to invalid. Alternatively, you can use the error-text prop.\n *\n * @part base - The component's base wrapper.\n * @part form-control - The form control that wraps the label, input, error-text and help-text.\n * @part label - The input label.\n * @part input - The input control.\n * @part prefix - The input prefix container.\n * @part clear-button - The clear button.\n * @part password-toggle-button - The password toggle button.\n * @part suffix - The input suffix container.\n * @part help-text - The input help text.\n * @part error-text - The input error text.\n */\n\n@Component({\n tag: 'six-input',\n styleUrl: 'six-input.scss',\n shadow: true,\n})\nexport class SixInput {\n private inputId = `input-${++id}`;\n private labelId = `input-label-${id}`;\n private helpTextId = `input-help-text-${id}`;\n private errorTextId = `input-error-text-${id}`;\n private nativeInput?: HTMLInputElement;\n private eventListeners = new EventListeners();\n\n @Element() host!: HTMLSixInputElement;\n\n @State() hasFocus = false;\n @State() hasHelpTextSlot = false;\n @State() hasLabelSlot = false;\n @State() hasErrorSlot = false;\n @State() isPasswordVisible = false;\n\n /** The input's type. */\n @Prop({ reflect: true }) type: 'email' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'url' = 'text';\n\n /** The input's size. */\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /** The input's name attribute. */\n @Prop({ reflect: true }) name = '';\n\n /** The input's value attribute. */\n @Prop({ mutable: true, reflect: true }) value = '';\n\n /** Set to true to draw a pill-style input with rounded edges. */\n @Prop({ reflect: true }) pill = false;\n\n /** The input's help text. Alternatively, you can use the help-text slot. */\n @Prop() helpText = '';\n\n /** The input's placeholder text. */\n @Prop() placeholder?: string;\n\n /** Set to true to disable the input. */\n @Prop({ reflect: true }) disabled = false;\n\n /** Set to true to make the input readonly. */\n @Prop({ reflect: true }) readonly = false;\n\n /** The minimum length of input that will be considered valid. */\n @Prop({ reflect: true }) minlength?: number;\n\n /** The maximum length of input that will be considered valid. */\n @Prop({ reflect: true }) maxlength?: number;\n\n /** The input's minimum value. */\n @Prop({ reflect: true }) min?: number;\n\n /** The input's maximum value. */\n @Prop({ reflect: true }) max?: number;\n\n /** The input's step attribute. */\n @Prop({ reflect: true }) step?: number;\n\n /** A pattern to validate input against. */\n @Prop({ reflect: true }) pattern?: string;\n\n /**\n * Internal: Styles the input for the dropdown filter search.\n */\n @Prop() dropdownSearch = false;\n\n /** Set to true to show an asterisk beneath the label. */\n @Prop() required = false;\n\n /** The input's autocaptialize attribute. */\n @Prop() autocapitalize = 'off';\n\n /** The input's autocorrect attribute. */\n @Prop() autocorrect: 'on' | 'off' = 'off';\n\n /** The input's autocomplete attribute. */\n @Prop() autocomplete = 'off';\n\n /** The input's autofocus attribute. */\n @Prop() autofocus = false;\n\n /** Enables spell checking on the input. */\n @Prop() spellcheck = false;\n\n /** The label text. */\n @Prop() label = '';\n\n /** The error message shown, if `invalid` is set to true. */\n @Prop() errorText: string | string[] = '';\n\n /** The number of error texts to be shown (if the error-text slot isn't used). Defaults to 1 */\n @Prop() errorTextCount?: number;\n\n /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */\n @Prop({ reflect: true }) invalid = false;\n\n /** Set to true to add a clear button when the input is populated. */\n @Prop() clearable = false;\n\n /** Set to true to add a password toggle button for password inputs. */\n @Prop() togglePassword = false;\n\n /** The input's inputmode attribute. */\n @Prop() inputmode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';\n\n /** Set to render as line */\n @Prop() line = false;\n\n @Watch('helpText')\n @Watch('errorText')\n @Watch('label')\n handleLabelChange() {\n this.handleSlotChange();\n }\n\n @Watch('value')\n handleValueChange() {\n this.value = this.getValue();\n if (this.nativeInput != null && this.nativeInput.value !== this.value) {\n this.nativeInput.value = this.value;\n }\n }\n\n /** Emitted when the control's value changes. Access the new value via event.target.value. */\n @Event({ eventName: 'six-input-change' }) sixChange!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the clear button is activated. */\n @Event({ eventName: 'six-input-clear' }) sixClear!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control receives input. Access the new value via event.target.value. */\n @Event({ eventName: 'six-input-input' }) sixInput!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control gains focus. */\n @Event({ eventName: 'six-input-focus' }) sixFocus!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control loses focus. Access the new value via event.target.value. */\n @Event({ eventName: 'six-input-blur' }) sixBlur!: EventEmitter<EmptyPayload>;\n\n connectedCallback() {\n this.host.shadowRoot?.addEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.forward('six-input-input', 'input', this.host);\n this.eventListeners.forward('six-input-change', 'change', this.host);\n this.eventListeners.forward('six-input-focus', 'focus', this.host);\n this.eventListeners.forward('six-input-blur', 'blur', this.host);\n }\n\n componentWillLoad() {\n this.handleSlotChange();\n }\n\n disconnectedCallback() {\n this.host.shadowRoot?.removeEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.removeAll();\n }\n\n /** Sets focus on the input. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.nativeInput?.focus(options);\n }\n\n /** Removes focus from the input. */\n @Method()\n async removeFocus() {\n this.nativeInput?.blur();\n }\n\n /** Selects all the text in the input. */\n @Method()\n async select() {\n return this.nativeInput?.select();\n }\n\n /** Sets the start and end positions of the text selection (0-based). */\n @Method()\n async setSelectionRange(\n selectionStart: number,\n selectionEnd: number,\n selectionDirection: SelectionRangeDirection = 'none'\n ) {\n return this.nativeInput?.setSelectionRange(selectionStart, selectionEnd, selectionDirection);\n }\n\n /** Returns the start and end positions of the text selection */\n @Method()\n async getSelectionRange(): Promise<SelectionRange> {\n return {\n selectionStart: this.nativeInput?.selectionStart ?? undefined,\n selectionEnd: this.nativeInput?.selectionEnd ?? undefined,\n selectionDirection: this.nativeInput?.selectionDirection ?? undefined,\n };\n }\n\n /** Replaces a range of text with a new string. */\n @Method()\n async setRangeText(\n replacement: string,\n start: number,\n end: number,\n selectMode: 'select' | 'start' | 'end' | 'preserve' = 'preserve'\n ) {\n if (this.nativeInput == null) {\n return;\n }\n this.nativeInput.setRangeText(replacement, start, end, selectMode);\n if (this.getValue() !== this.nativeInput.value) {\n this.value = this.nativeInput.value;\n this.sixChange.emit();\n this.sixInput.emit();\n }\n }\n\n private handleChange = (event: Event) => {\n event.stopPropagation();\n if (this.nativeInput != null) {\n this.value = this.nativeInput.value;\n this.sixChange.emit();\n }\n };\n\n private handleInput = (event: Event) => {\n event.stopPropagation();\n if (this.nativeInput != null) {\n this.value = this.nativeInput.value;\n this.sixInput.emit();\n }\n };\n\n private handleBlur = () => {\n this.hasFocus = false;\n this.sixBlur.emit();\n };\n\n private handleFocus = () => {\n this.hasFocus = true;\n this.sixFocus.emit();\n };\n\n private handleClearClick = (event: MouseEvent) => {\n this.value = '';\n this.sixClear.emit();\n this.sixInput.emit();\n this.sixChange.emit();\n if (this.nativeInput != null) {\n this.nativeInput.focus();\n }\n event.stopPropagation();\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n const hasModifier = event.metaKey || event.ctrlKey || event.shiftKey || event.altKey;\n if (event.key === 'Enter' && !hasModifier) {\n setTimeout(() => {\n if (!event.defaultPrevented && !event.isComposing) {\n submitForm(this.host);\n }\n });\n }\n };\n\n private handlePasswordToggle = () => {\n this.isPasswordVisible = !this.isPasswordVisible;\n };\n\n private handleSlotChange = () => {\n this.hasHelpTextSlot = hasSlot(this.host, 'help-text');\n this.hasLabelSlot = hasSlot(this.host, 'label');\n this.hasErrorSlot = hasSlot(this.host, 'error-text');\n };\n\n private getValue(): string {\n return (this.value ?? '').toString();\n }\n\n render() {\n return (\n <FormControl\n inputId={this.inputId}\n label={this.label}\n labelId={this.labelId}\n hasLabelSlot={this.hasLabelSlot}\n helpTextId={this.helpTextId}\n helpText={this.helpText}\n hasHelpTextSlot={this.hasHelpTextSlot}\n errorTextId={this.errorTextId}\n errorText={this.errorText}\n errorTextCount={this.errorTextCount}\n hasErrorTextSlot={this.hasErrorSlot}\n size={this.size}\n disabled={this.disabled}\n required={this.required}\n displayError={this.invalid}\n >\n <div\n part=\"base\"\n class={{\n input: true,\n\n // Sizes\n 'input--small': this.size === 'small',\n 'input--medium': this.size === 'medium',\n 'input--large': this.size === 'large',\n\n // States\n 'input--line': this.line,\n 'input--pill': this.pill,\n 'input--disabled': this.disabled,\n 'input--dropdown-search': this.dropdownSearch,\n 'input--focused': this.hasFocus,\n 'input--empty': this.getValue().length === 0,\n 'input--invalid': this.invalid,\n }}\n >\n <span part=\"prefix\" class=\"input__prefix\">\n <slot name=\"prefix\" />\n </span>\n\n <input\n part=\"input\"\n ref={(el) => (this.nativeInput = el)}\n id={this.inputId}\n size={1} // needed for firefox to overrule the default of 20\n class={{\n input__control: true,\n input__control__prefix: hasSlot(this.host, 'prefix'),\n }}\n type={this.type === 'password' && this.isPasswordVisible ? 'text' : this.type}\n name={this.name}\n placeholder={this.placeholder}\n disabled={this.disabled}\n readonly={this.readonly}\n minLength={this.minlength}\n maxLength={this.maxlength}\n min={this.min}\n max={this.max}\n step={this.step}\n value={this.getValue()}\n autoCapitalize={this.autocapitalize}\n autoComplete={this.autocomplete}\n autoCorrect={this.autocorrect}\n autoFocus={this.autofocus}\n spellcheck={this.spellcheck}\n pattern={this.pattern}\n required={this.required}\n inputMode={this.inputmode}\n aria-labelledby={this.labelId}\n aria-describedby={this.helpTextId}\n aria-invalid={this.invalid ? 'true' : 'false'}\n onChange={this.handleChange}\n onInput={this.handleInput}\n onFocus={this.handleFocus}\n onBlur={this.handleBlur}\n onKeyDown={this.handleKeyDown}\n data-testid=\"input-control\"\n />\n\n {this.clearable && (\n <button\n part=\"clear-button\"\n class=\"input__clear\"\n type=\"button\"\n onClick={this.handleClearClick}\n tabindex=\"-1\"\n data-testid=\"input-clear-button\"\n >\n <slot name=\"clear-icon\">\n <six-icon size={ICON_SIZES[this.size]}>clear</six-icon>\n </slot>\n </button>\n )}\n\n {this.togglePassword && (\n <button\n part=\"password-toggle-button\"\n class=\"input__password-toggle\"\n type=\"button\"\n onClick={this.handlePasswordToggle}\n tabindex=\"-1\"\n >\n {this.isPasswordVisible ? (\n <slot name=\"show-password-icon\">\n <six-icon size={ICON_SIZES[this.size]}>visibility_off</six-icon>\n </slot>\n ) : (\n <slot name=\"hide-password-icon\">\n <six-icon size={ICON_SIZES[this.size]}>visibility</six-icon>\n </slot>\n )}\n </button>\n )}\n\n <span part=\"suffix\" class=\"input__suffix\">\n <slot name=\"suffix\" />\n </span>\n </div>\n </FormControl>\n );\n }\n}\n"],"version":3}
|
|
@@ -45,7 +45,7 @@ const SixLanguageSwitcher$1 = /*@__PURE__*/ proxyCustomElement(class SixLanguage
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
render() {
|
|
48
|
-
return (h("div", { key: '
|
|
48
|
+
return (h("div", { key: '5ba97f481c478180a10697b498756392192f69f0', part: "container", class: "language-switcher__container" }, this.languages.map((lang, index) => {
|
|
49
49
|
const language = typeof lang === 'string' ? lang : lang.key;
|
|
50
50
|
return (h("div", { onClick: this.handleLanguageSwitching(language, typeof lang === 'string' ? lang : lang.value), onKeyDown: (e) => {
|
|
51
51
|
if (e.key === 'Enter' || e.key === ' ') {
|