@logosphere-ui/core 0.0.0-alpha.4 → 0.0.0-alpha.40
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/AGENTS.md +1167 -0
- package/dist/AGENTS.md +1167 -0
- package/dist/atoms/Badge/badge.d.ts +1 -1
- package/dist/atoms/Button/button.d.ts +5 -3
- package/dist/atoms/Checkbox/checkbox.d.ts +13 -3
- package/dist/atoms/FormField/formfield.d.ts +12 -0
- package/dist/atoms/Slider/index.d.ts +1 -0
- package/dist/atoms/Slider/slider.d.ts +54 -0
- package/dist/badge-B0Bj-HAT.js +72 -0
- package/dist/badge-DWkKpZTX.cjs +13 -0
- package/dist/badge.cjs +1 -1
- package/dist/badge.js +1 -1
- package/dist/breadcrumb-BOuCLUJh.cjs +12 -0
- package/dist/breadcrumb-BeJqq-5C.js +41 -0
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/button-MBxtvVqn.cjs +10 -0
- package/dist/button-QWCkFTeJ.js +58 -0
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/calendar-DcDT4o-U.cjs +88 -0
- package/dist/calendar-DsriSHZ4.js +652 -0
- package/dist/calendar.cjs +1 -0
- package/dist/calendar.js +4 -0
- package/dist/card-BUWvno93.cjs +43 -0
- package/dist/{card-CUhlTJyJ.js → card-R_cKrdHK.js} +26 -25
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/chatbot-BPVC2wqM.cjs +183 -0
- package/dist/chatbot-yup4Nz00.js +564 -0
- package/dist/chatbot.cjs +1 -1
- package/dist/chatbot.js +2 -2
- package/dist/checkbox-BAbPDN6x.cjs +53 -0
- package/dist/checkbox-CTfbav6M.js +152 -0
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/chip-group-BqYKZKmu.cjs +26 -0
- package/dist/chip-group-CC5RBhN_.js +89 -0
- package/dist/chip-group.cjs +1 -0
- package/dist/chip-group.js +4 -0
- package/dist/combobox-Bah9Akr-.cjs +113 -0
- package/dist/combobox-Nxhk75IH.js +460 -0
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.js +1 -1
- package/dist/datepicker-BExZseRQ.js +382 -0
- package/dist/datepicker-BOQ13sIm.cjs +85 -0
- package/dist/datepicker.cjs +1 -1
- package/dist/datepicker.js +2 -2
- package/dist/{download-manager-A4fOxGWJ.js → download-manager-BPg-6Qfg.js} +4 -4
- package/dist/download-manager-DDeTYRPs.cjs +97 -0
- package/dist/download-manager.cjs +1 -1
- package/dist/download-manager.js +1 -1
- package/dist/drawer-DBrOkz0z.cjs +32 -0
- package/dist/drawer-DHsESNFL.js +114 -0
- package/dist/drawer.cjs +1 -0
- package/dist/drawer.js +4 -0
- package/dist/formfield-JXiv9mvJ.cjs +33 -0
- package/dist/formfield-ss2mFweu.js +161 -0
- package/dist/formfield.cjs +1 -1
- package/dist/formfield.js +1 -1
- package/dist/icon.cjs +1 -0
- package/dist/icon.js +4 -0
- package/dist/index.cjs +291 -1
- package/dist/index.d.ts +15 -0
- package/dist/index.js +909 -32
- package/dist/index.umd.js +1545 -521
- package/dist/input-D9lFcDHU.js +278 -0
- package/dist/input-Dg-jos9u.cjs +60 -0
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/left-menu.cjs +1 -0
- package/dist/left-menu.js +5 -0
- package/dist/leftmenu-CMx2K5Ws.js +301 -0
- package/dist/leftmenu-DCfTelzi.cjs +83 -0
- package/dist/modal-BJNCTlBX.cjs +84 -0
- package/dist/modal-DNjURVZy.js +250 -0
- package/dist/modal.cjs +1 -1
- package/dist/modal.js +1 -1
- package/dist/molecules/Accordion/accordion.d.ts +42 -0
- package/dist/molecules/Accordion/index.d.ts +2 -0
- package/dist/molecules/Chip/chip-group.d.ts +29 -0
- package/dist/molecules/Chip/index.d.ts +2 -0
- package/dist/molecules/Collapse/collapse.d.ts +42 -0
- package/dist/molecules/Collapse/index.d.ts +2 -0
- package/dist/molecules/Input/input.d.ts +24 -1
- package/dist/molecules/InputGroup/index.d.ts +1 -0
- package/dist/molecules/InputGroup/input-group.d.ts +40 -0
- package/dist/molecules/Pagination/index.d.ts +1 -0
- package/dist/molecules/Pagination/pagination.d.ts +60 -0
- package/dist/molecules/Popover/popover.d.ts +1 -0
- package/dist/molecules/SplitButton/index.d.ts +2 -0
- package/dist/molecules/SplitButton/split-button.d.ts +53 -0
- package/dist/molecules/Stepper/index.d.ts +2 -0
- package/dist/molecules/Stepper/stepper.d.ts +34 -0
- package/dist/molecules/Textarea/text-area.d.ts +5 -2
- package/dist/molecules/TimePicker/index.d.ts +2 -0
- package/dist/molecules/TimePicker/timepicker.d.ts +62 -0
- package/dist/organisms/Calendar/calendar.d.ts +54 -0
- package/dist/organisms/Calendar/index.d.ts +1 -0
- package/dist/organisms/Calendar/shared.d.ts +9 -0
- package/dist/organisms/Chatbot/chatbot.d.ts +10 -1
- package/dist/organisms/Chatbot/index.d.ts +1 -1
- package/dist/organisms/Combobox/combobox.d.ts +39 -0
- package/dist/organisms/DatePicker/datepicker.d.ts +35 -33
- package/dist/organisms/Drawer/drawer.d.ts +30 -0
- package/dist/organisms/Drawer/index.d.ts +1 -0
- package/dist/organisms/LeftMenu/index.d.ts +2 -0
- package/dist/organisms/LeftMenu/leftmenu-item.d.ts +14 -0
- package/dist/organisms/LeftMenu/leftmenu.d.ts +45 -0
- package/dist/organisms/Modal/modal.d.ts +29 -4
- package/dist/organisms/Tab/tab.d.ts +13 -1
- package/dist/organisms/Toast/index.d.ts +2 -0
- package/dist/organisms/Toast/toast-container.d.ts +42 -0
- package/dist/organisms/Toast/toast.d.ts +48 -0
- package/dist/organisms/TreeMenu/index.d.ts +1 -0
- package/dist/organisms/TreeMenu/tree-menu.d.ts +41 -0
- package/dist/pagination-B91sZD5E.js +360 -0
- package/dist/pagination-Cnh-o-Nq.cjs +169 -0
- package/dist/pagination.cjs +1 -0
- package/dist/pagination.js +4 -0
- package/dist/{popover-B7tCqk3R.js → popover-CSgoaROl.js} +42 -39
- package/dist/popover-DwDyLpQq.cjs +30 -0
- package/dist/popover.cjs +1 -1
- package/dist/popover.js +1 -1
- package/dist/shared/icons/index.d.ts +1 -0
- package/dist/shared/types/button.types.d.ts +7 -0
- package/dist/styles/main.css +186 -182
- package/dist/switch-Do6SCkPJ.cjs +17 -0
- package/dist/switch-uYVuohJ-.js +68 -0
- package/dist/switch.cjs +1 -1
- package/dist/switch.js +1 -1
- package/dist/tab-BvRVHpWs.cjs +41 -0
- package/dist/tab-Byh4UgFB.js +204 -0
- package/dist/tab.cjs +1 -1
- package/dist/tab.js +1 -1
- package/dist/text-area-CHkrGi3S.js +239 -0
- package/dist/text-area-DvOiCcKP.cjs +51 -0
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timepicker-CAat7fcK.js +320 -0
- package/dist/timepicker-Co7lW5Rp.cjs +119 -0
- package/dist/timepicker.cjs +1 -0
- package/dist/timepicker.js +4 -0
- package/dist/toast-container-DxFwLT5S.js +274 -0
- package/dist/toast-container-aY1lGjRi.cjs +64 -0
- package/dist/toast.cjs +1 -0
- package/dist/toast.js +6 -0
- package/dist/tree-menu-Dqy14_m2.cjs +47 -0
- package/dist/tree-menu-Psek8QB9.js +154 -0
- package/dist/tree-menu.cjs +1 -0
- package/dist/tree-menu.js +4 -0
- package/dist/ui-icon-Cd5YhUeQ.cjs +22 -0
- package/dist/ui-icon-Ckljc9hg.js +74 -0
- package/package.json +104 -12
- package/dist/badge-BbhaO73N.cjs +0 -13
- package/dist/badge-DE7Tgd8Z.js +0 -71
- package/dist/breadcrumb-B-4yqoJZ.js +0 -41
- package/dist/breadcrumb-Cop-B1J7.cjs +0 -12
- package/dist/button-C1EwOosO.js +0 -58
- package/dist/button-CDRccsk9.cjs +0 -10
- package/dist/card-n8ka8Zk-.cjs +0 -43
- package/dist/chatbot-Da_itUdJ.cjs +0 -160
- package/dist/chatbot-zkxngMRH.js +0 -481
- package/dist/checkbox-7Rb3WKGx.js +0 -119
- package/dist/checkbox-CdDTRdKV.cjs +0 -37
- package/dist/combobox-BJbI-Tgi.js +0 -268
- package/dist/combobox-pmE7bgEL.cjs +0 -99
- package/dist/datepicker-DFJx45C-.js +0 -750
- package/dist/datepicker-b9JGTTMx.cjs +0 -115
- package/dist/download-manager-BSIMTGaK.cjs +0 -97
- package/dist/formfield-D_7NFFoe.cjs +0 -27
- package/dist/formfield-d8fp9FTV.js +0 -118
- package/dist/input-BcnI1w3_.cjs +0 -46
- package/dist/input-Bj_7u8Iv.js +0 -192
- package/dist/modal-Bfc6WQSL.js +0 -110
- package/dist/modal-DQ8VFL-P.cjs +0 -39
- package/dist/popover-C2p5Pmts.cjs +0 -30
- package/dist/switch-Cpl53nRW.js +0 -64
- package/dist/switch-Rnnn10bn.cjs +0 -17
- package/dist/tab-BKdN4xAz.js +0 -176
- package/dist/tab-DcjAlXzU.cjs +0 -40
- package/dist/text-area-BkHdLnZj.cjs +0 -44
- package/dist/text-area-CC24lj8v.js +0 -204
package/dist/tab-DcjAlXzU.cjs
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";const s=require("lit"),n=require("lit/decorators.js"),c=".tab{width:100%;font-family:var(--font-family-base)}.tab__list{display:flex;overflow-x:auto;overflow-y:hidden;border-bottom:1px solid var(--color-border);scroll-behavior:smooth;-webkit-overflow-scrolling:touch;scrollbar-width:none;-ms-overflow-style:none}.tab__list::-webkit-scrollbar{display:none}.tab__button{display:inline-flex;flex-direction:row;align-items:center;gap:var(--spacing-2);padding:var(--spacing-3) var(--spacing-4);min-width:120px;position:relative;cursor:pointer;border:none;border-bottom:2px solid transparent;background:transparent;font-family:var(--font-family-base);white-space:nowrap;transition:background-color var(--transition-speed-base) var(--transition-timing),border-color var(--transition-speed-base) var(--transition-timing)}.tab__button:hover:not(.tab__button--disabled):not(.tab__button--active){background-color:var(--color-tertiary-bg)}.tab__button--active{border-bottom-color:var(--color-primary)}.tab__button--disabled{cursor:not-allowed;opacity:.4;pointer-events:none}.tab__icon{font-size:var(--font-size-xl);flex-shrink:0;color:inherit;line-height:1}.tab__content{display:flex;flex-direction:column;align-items:flex-start}.tab__label{font-weight:var(--font-weight-medium);font-size:var(--font-size-sm);color:var(--color-body-text)}.tab__label--inactive{color:var(--color-tertiary)}.tab__description{font-size:var(--font-size-xs);text-align:left;color:var(--color-tertiary)}.tab__description--active{color:var(--color-secondary)}.tab__panel{padding:var(--spacing-4);outline:none}.tab__panel--hidden{display:none}";var h=Object.defineProperty,p=Object.getOwnPropertyDescriptor,r=(d,e,a,t)=>{for(var i=t>1?void 0:t?p(e,a):e,o=d.length-1,l;o>=0;o--)(l=d[o])&&(i=(t?l(e,a,i):l(i))||i);return t&&i&&h(e,a,i),i};exports.LogosphereTab=class extends s.LitElement{constructor(){super(...arguments),this.tabs=[],this.activeTab="",this.lazy=!0,this.variant="default",this._focusedIndex=0,this._renderedTabs=new Set}connectedCallback(){super.connectedCallback(),!this.activeTab&&this.tabs.length>0&&(this.activeTab=this.tabs[0].id)}willUpdate(e){if(super.willUpdate(e),e.has("activeTab")&&this.activeTab){this._renderedTabs.add(this.activeTab);const a=this.tabs.findIndex(t=>t.id===this.activeTab);a!==-1&&(this._focusedIndex=a)}e.has("tabs")&&this.tabs.length>0&&(this.tabs.some(t=>t.id===this.activeTab)||(this.activeTab=this.tabs[0].id),this._focusedIndex=this.tabs.findIndex(t=>t.id===this.activeTab))}handleTabClick(e,a){if(a)return;const t=this.activeTab;this.activeTab=e,this._focusedIndex=this.tabs.findIndex(i=>i.id===e),this.dispatchEvent(new CustomEvent("tab-change",{detail:{oldTab:t,newTab:e},bubbles:!0,composed:!0}))}handleKeyDown(e){const{tabs:a}=this;if(a.filter(o=>!o.disabled).length===0)return;let t=this._focusedIndex;const i=this._focusedIndex;switch(e.key){case"ArrowLeft":e.preventDefault();do t=t>0?t-1:a.length-1;while(a[t]?.disabled&&t!==i);break;case"ArrowRight":e.preventDefault();do t=t<a.length-1?t+1:0;while(a[t]?.disabled&&t!==i);break;case"Home":for(e.preventDefault(),t=0;a[t]?.disabled&&t<a.length-1;)t++;break;case"End":for(e.preventDefault(),t=a.length-1;a[t]?.disabled&&t>0;)t--;break;default:return}if(t!==this._focusedIndex&&!a[t]?.disabled){const o=this.activeTab;this._focusedIndex=t,this.activeTab=a[t].id,this.updateComplete.then(()=>{this.shadowRoot?.querySelector(`[role="tab"][data-tab-id="${a[t].id}"]`)?.focus()}),this.dispatchEvent(new CustomEvent("tab-change",{detail:{oldTab:o,newTab:a[t].id},bubbles:!0,composed:!0}))}}scrollTabIntoView(e){this.updateComplete.then(()=>{const a=this.shadowRoot?.querySelector(`[role="tab"][data-tab-id="${e}"]`);if(a&&this.tablist){const t=this.tablist.getBoundingClientRect(),i=a.getBoundingClientRect();i.left<t.left?this.tablist.scrollLeft-=t.left-i.left+16:i.right>t.right&&(this.tablist.scrollLeft+=i.right-t.right+16)}})}renderTabButton(e,a){const t=this.activeTab===e.id,i=this._focusedIndex===a,o=["tab__button",t?"tab__button--active":"",e.disabled?"tab__button--disabled":""].filter(Boolean).join(" "),l=["tab__label",t?"":"tab__label--inactive"].filter(Boolean).join(" "),b=["tab__description",t?"tab__description--active":""].filter(Boolean).join(" ");return s.html`
|
|
2
|
-
<button
|
|
3
|
-
role="tab"
|
|
4
|
-
class=${o}
|
|
5
|
-
data-tab-id=${e.id}
|
|
6
|
-
aria-selected=${t?"true":"false"}
|
|
7
|
-
aria-controls="panel-${e.id}"
|
|
8
|
-
tabindex=${t||i?"0":"-1"}
|
|
9
|
-
?disabled=${e.disabled}
|
|
10
|
-
@click=${()=>this.handleTabClick(e.id,e.disabled)}
|
|
11
|
-
@focus=${()=>this.scrollTabIntoView(e.id)}
|
|
12
|
-
>
|
|
13
|
-
${e.icon?s.html`<i class="${e.icon} tab__icon"></i>`:s.nothing}
|
|
14
|
-
<div class="tab__content">
|
|
15
|
-
<span class=${l}>${e.label}</span>
|
|
16
|
-
${e.description?s.html`<span class=${b}>${e.description}</span>`:s.nothing}
|
|
17
|
-
</div>
|
|
18
|
-
</button>
|
|
19
|
-
`}renderTabPanel(e){const a=this.activeTab===e.id;if(!(!this.lazy||this._renderedTabs.has(e.id)))return s.nothing;const i=["tab__panel",a?"":"tab__panel--hidden"].filter(Boolean).join(" ");return s.html`
|
|
20
|
-
<div
|
|
21
|
-
role="tabpanel"
|
|
22
|
-
id="panel-${e.id}"
|
|
23
|
-
aria-labelledby="tab-${e.id}"
|
|
24
|
-
class=${i}
|
|
25
|
-
tabindex="0"
|
|
26
|
-
>
|
|
27
|
-
<slot name=${`panel-${e.id}`}>
|
|
28
|
-
${typeof e.content=="string"?s.html`${e.content}`:s.nothing}
|
|
29
|
-
</slot>
|
|
30
|
-
</div>
|
|
31
|
-
`}render(){return s.html`
|
|
32
|
-
<div class="tab">
|
|
33
|
-
<div role="tablist" aria-label="Tabs" class="tab__list" @keydown=${this.handleKeyDown}>
|
|
34
|
-
${this.tabs.map((e,a)=>this.renderTabButton(e,a))}
|
|
35
|
-
</div>
|
|
36
|
-
<div class="tab__panels">${this.tabs.map(e=>this.renderTabPanel(e))}</div>
|
|
37
|
-
</div>
|
|
38
|
-
`}};exports.LogosphereTab.styles=[s.css`
|
|
39
|
-
${s.unsafeCSS(c)}
|
|
40
|
-
`];r([n.property({type:Array})],exports.LogosphereTab.prototype,"tabs",2);r([n.property({type:String})],exports.LogosphereTab.prototype,"activeTab",2);r([n.property({type:Boolean})],exports.LogosphereTab.prototype,"lazy",2);r([n.property({type:String})],exports.LogosphereTab.prototype,"variant",2);r([n.state()],exports.LogosphereTab.prototype,"_focusedIndex",2);r([n.state()],exports.LogosphereTab.prototype,"_renderedTabs",2);r([n.query('[role="tablist"]')],exports.LogosphereTab.prototype,"tablist",2);exports.LogosphereTab=r([n.customElement("logosphere-tab")],exports.LogosphereTab);
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";const i=require("lit"),t=require("lit/decorators.js"),p=require("lit/directives/live.js"),u=".textarea__field{width:100%;background:transparent;border:none;outline:none;font-size:var(--font-size-sm);font-family:var(--font-family-base);color:var(--color-body-text);box-sizing:border-box;line-height:1.5}.textarea__field::placeholder{color:var(--color-tertiary)}.textarea__field:disabled{cursor:not-allowed}.textarea__field--resize-none{resize:none}.textarea__field--resize-vertical{resize:vertical}.textarea__field--resize-horizontal{resize:horizontal}.textarea__field--resize-both{resize:both}.textarea__field--auto-resize{resize:none;overflow:hidden}.textarea__clear-btn{border:none;background:transparent;color:var(--color-gray-400);cursor:pointer;padding:0;display:inline-flex;align-items:flex-start;align-self:flex-start;margin-top:var(--spacing-1);outline:none;flex-shrink:0;transition:color var(--transition-speed-fast) var(--transition-timing)}.textarea__clear-btn:hover{color:var(--color-gray-600)}";var d=Object.defineProperty,y=Object.getOwnPropertyDescriptor,r=(l,e,a,o)=>{for(var s=o>1?void 0:o?y(e,a):e,n=l.length-1,h;n>=0;n--)(h=l[n])&&(s=(o?h(e,a,s):h(s))||s);return o&&s&&d(e,a,s),s};exports.TextArea=class extends i.LitElement{constructor(){super(...arguments),this.value="",this.placeholder="",this.name="",this.autocomplete="",this.rows=3,this.wrap="soft",this.resize="vertical",this.autoResize=!1,this.size="default",this.variant="default",this.showClear=!1,this.label="",this.helper="",this.error="",this.required=!1,this.disabled=!1,this.readonly=!1,this._internalError="",this.handleInput=e=>{const a=e.target;this.value=a.value,this.autoResize&&this.adjustHeight(),this._internalError&&(this._internalError="",this._textareaElement.setCustomValidity("")),this.dispatchEvent(new CustomEvent("input",{bubbles:!0,composed:!0,detail:{value:this.value,originalEvent:e}}))},this.handleChange=e=>{const a=e.target;this.value=a.value,a.checkValidity()||(this._internalError=a.validationMessage),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{value:this.value,originalEvent:e}}))},this.handleKeyDown=e=>{this.dispatchEvent(new CustomEvent("keydown",{bubbles:!0,composed:!0,detail:{key:e.key,originalEvent:e}}))},this.handleKeyUp=e=>{this.dispatchEvent(new CustomEvent("keyup",{bubbles:!0,composed:!0,detail:{key:e.key,originalEvent:e}}))},this.handleClear=()=>{this.value="",this._textareaElement&&(this._textareaElement.value="",this.autoResize&&this.adjustHeight()),this.dispatchEvent(new CustomEvent("clear",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("input",{bubbles:!0,composed:!0,detail:{value:"",originalEvent:null}}))}}get textareaElement(){return this._textareaElement}focus(){this._textareaElement?.focus()}blur(){this._textareaElement?.blur()}select(){this._textareaElement?.select()}setSelectionRange(e,a,o){this._textareaElement?.setSelectionRange(e,a,o)}checkValidity(){return this._textareaElement?.checkValidity()??!0}reportValidity(){return this._textareaElement?.reportValidity()??!0}setCustomValidity(e){this._textareaElement?.setCustomValidity(e),this._internalError=e,this.requestUpdate()}adjustHeight(){!this.autoResize||!this._textareaElement||(this._textareaElement.style.height="auto",this._textareaElement.style.height=`${this._textareaElement.scrollHeight}px`)}updated(e){super.updated(e),e.has("value")&&this.autoResize&&this.adjustHeight()}getResizeClass(){return this.autoResize?"textarea__field--auto-resize":{none:"textarea__field--resize-none",vertical:"textarea__field--resize-vertical",horizontal:"textarea__field--resize-horizontal",both:"textarea__field--resize-both"}[this.resize]}render(){const e=this.error||this._internalError,a=this.showClear&&this.value&&!this.disabled&&!this.readonly,o=`textarea__field ${this.getResizeClass()}`;return i.html`
|
|
2
|
-
<logosphere-formfield
|
|
3
|
-
.label=${this.label}
|
|
4
|
-
.helper=${this.helper}
|
|
5
|
-
.error=${e}
|
|
6
|
-
.required=${this.required}
|
|
7
|
-
.disabled=${this.disabled}
|
|
8
|
-
.readonly=${this.readonly}
|
|
9
|
-
.placeholder=${this.placeholder}
|
|
10
|
-
.size=${this.size}
|
|
11
|
-
.variant=${this.variant}
|
|
12
|
-
>
|
|
13
|
-
<textarea
|
|
14
|
-
class="${o}"
|
|
15
|
-
.value=${p.live(this.value)}
|
|
16
|
-
placeholder=${this.placeholder||i.nothing}
|
|
17
|
-
name=${this.name||i.nothing}
|
|
18
|
-
autocomplete=${this.autocomplete||i.nothing}
|
|
19
|
-
?required=${this.required}
|
|
20
|
-
?disabled=${this.disabled}
|
|
21
|
-
?readonly=${this.readonly}
|
|
22
|
-
minlength=${this.minlength??i.nothing}
|
|
23
|
-
maxlength=${this.maxlength??i.nothing}
|
|
24
|
-
rows=${this.rows}
|
|
25
|
-
cols=${this.cols??i.nothing}
|
|
26
|
-
wrap=${this.wrap}
|
|
27
|
-
@input=${this.handleInput}
|
|
28
|
-
@change=${this.handleChange}
|
|
29
|
-
@keydown=${this.handleKeyDown}
|
|
30
|
-
@keyup=${this.handleKeyUp}
|
|
31
|
-
></textarea>
|
|
32
|
-
${a?i.html`
|
|
33
|
-
<button
|
|
34
|
-
type="button"
|
|
35
|
-
slot="suffix"
|
|
36
|
-
class="textarea__clear-btn"
|
|
37
|
-
@click=${this.handleClear}
|
|
38
|
-
tabindex="-1"
|
|
39
|
-
>
|
|
40
|
-
<ui-icon name="uil-times" size="14"></ui-icon>
|
|
41
|
-
</button>
|
|
42
|
-
`:i.nothing}
|
|
43
|
-
</logosphere-formfield>
|
|
44
|
-
`}};exports.TextArea.styles=[i.css`${i.unsafeCSS(u)}`];r([t.query("textarea")],exports.TextArea.prototype,"_textareaElement",2);r([t.property({type:String})],exports.TextArea.prototype,"value",2);r([t.property({type:String})],exports.TextArea.prototype,"placeholder",2);r([t.property({type:String})],exports.TextArea.prototype,"name",2);r([t.property({type:String})],exports.TextArea.prototype,"autocomplete",2);r([t.property({type:Number})],exports.TextArea.prototype,"minlength",2);r([t.property({type:Number})],exports.TextArea.prototype,"maxlength",2);r([t.property({type:Number})],exports.TextArea.prototype,"rows",2);r([t.property({type:Number})],exports.TextArea.prototype,"cols",2);r([t.property({type:String})],exports.TextArea.prototype,"wrap",2);r([t.property({type:String})],exports.TextArea.prototype,"resize",2);r([t.property({type:Boolean})],exports.TextArea.prototype,"autoResize",2);r([t.property({type:String})],exports.TextArea.prototype,"size",2);r([t.property({type:String})],exports.TextArea.prototype,"variant",2);r([t.property({type:Boolean})],exports.TextArea.prototype,"showClear",2);r([t.property({type:String})],exports.TextArea.prototype,"label",2);r([t.property({type:String})],exports.TextArea.prototype,"helper",2);r([t.property({type:String})],exports.TextArea.prototype,"error",2);r([t.property({type:Boolean})],exports.TextArea.prototype,"required",2);r([t.property({type:Boolean})],exports.TextArea.prototype,"disabled",2);r([t.property({type:Boolean})],exports.TextArea.prototype,"readonly",2);r([t.state()],exports.TextArea.prototype,"_internalError",2);exports.TextArea=r([t.customElement("logosphere-textarea")],exports.TextArea);
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
import { LitElement as d, nothing as l, html as u, unsafeCSS as y, css as c } from "lit";
|
|
2
|
-
import { query as m, property as a, state as _, customElement as v } from "lit/decorators.js";
|
|
3
|
-
import { live as f } from "lit/directives/live.js";
|
|
4
|
-
const b = ".textarea__field{width:100%;background:transparent;border:none;outline:none;font-size:var(--font-size-sm);font-family:var(--font-family-base);color:var(--color-body-text);box-sizing:border-box;line-height:1.5}.textarea__field::placeholder{color:var(--color-tertiary)}.textarea__field:disabled{cursor:not-allowed}.textarea__field--resize-none{resize:none}.textarea__field--resize-vertical{resize:vertical}.textarea__field--resize-horizontal{resize:horizontal}.textarea__field--resize-both{resize:both}.textarea__field--auto-resize{resize:none;overflow:hidden}.textarea__clear-btn{border:none;background:transparent;color:var(--color-gray-400);cursor:pointer;padding:0;display:inline-flex;align-items:flex-start;align-self:flex-start;margin-top:var(--spacing-1);outline:none;flex-shrink:0;transition:color var(--transition-speed-fast) var(--transition-timing)}.textarea__clear-btn:hover{color:var(--color-gray-600)}";
|
|
5
|
-
var x = Object.defineProperty, g = Object.getOwnPropertyDescriptor, r = (e, i, s, n) => {
|
|
6
|
-
for (var o = n > 1 ? void 0 : n ? g(i, s) : i, h = e.length - 1, p; h >= 0; h--)
|
|
7
|
-
(p = e[h]) && (o = (n ? p(i, s, o) : p(o)) || o);
|
|
8
|
-
return n && o && x(i, s, o), o;
|
|
9
|
-
};
|
|
10
|
-
let t = class extends d {
|
|
11
|
-
constructor() {
|
|
12
|
-
super(...arguments), this.value = "", this.placeholder = "", this.name = "", this.autocomplete = "", this.rows = 3, this.wrap = "soft", this.resize = "vertical", this.autoResize = !1, this.size = "default", this.variant = "default", this.showClear = !1, this.label = "", this.helper = "", this.error = "", this.required = !1, this.disabled = !1, this.readonly = !1, this._internalError = "", this.handleInput = (e) => {
|
|
13
|
-
const i = e.target;
|
|
14
|
-
this.value = i.value, this.autoResize && this.adjustHeight(), this._internalError && (this._internalError = "", this._textareaElement.setCustomValidity("")), this.dispatchEvent(new CustomEvent("input", {
|
|
15
|
-
bubbles: !0,
|
|
16
|
-
composed: !0,
|
|
17
|
-
detail: { value: this.value, originalEvent: e }
|
|
18
|
-
}));
|
|
19
|
-
}, this.handleChange = (e) => {
|
|
20
|
-
const i = e.target;
|
|
21
|
-
this.value = i.value, i.checkValidity() || (this._internalError = i.validationMessage), this.dispatchEvent(new CustomEvent("change", {
|
|
22
|
-
bubbles: !0,
|
|
23
|
-
composed: !0,
|
|
24
|
-
detail: { value: this.value, originalEvent: e }
|
|
25
|
-
}));
|
|
26
|
-
}, this.handleKeyDown = (e) => {
|
|
27
|
-
this.dispatchEvent(new CustomEvent("keydown", {
|
|
28
|
-
bubbles: !0,
|
|
29
|
-
composed: !0,
|
|
30
|
-
detail: { key: e.key, originalEvent: e }
|
|
31
|
-
}));
|
|
32
|
-
}, this.handleKeyUp = (e) => {
|
|
33
|
-
this.dispatchEvent(new CustomEvent("keyup", {
|
|
34
|
-
bubbles: !0,
|
|
35
|
-
composed: !0,
|
|
36
|
-
detail: { key: e.key, originalEvent: e }
|
|
37
|
-
}));
|
|
38
|
-
}, this.handleClear = () => {
|
|
39
|
-
this.value = "", this._textareaElement && (this._textareaElement.value = "", this.autoResize && this.adjustHeight()), this.dispatchEvent(new CustomEvent("clear", { bubbles: !0, composed: !0 })), this.dispatchEvent(new CustomEvent("input", {
|
|
40
|
-
bubbles: !0,
|
|
41
|
-
composed: !0,
|
|
42
|
-
detail: { value: "", originalEvent: null }
|
|
43
|
-
}));
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
get textareaElement() {
|
|
47
|
-
return this._textareaElement;
|
|
48
|
-
}
|
|
49
|
-
focus() {
|
|
50
|
-
this._textareaElement?.focus();
|
|
51
|
-
}
|
|
52
|
-
blur() {
|
|
53
|
-
this._textareaElement?.blur();
|
|
54
|
-
}
|
|
55
|
-
select() {
|
|
56
|
-
this._textareaElement?.select();
|
|
57
|
-
}
|
|
58
|
-
setSelectionRange(e, i, s) {
|
|
59
|
-
this._textareaElement?.setSelectionRange(e, i, s);
|
|
60
|
-
}
|
|
61
|
-
checkValidity() {
|
|
62
|
-
return this._textareaElement?.checkValidity() ?? !0;
|
|
63
|
-
}
|
|
64
|
-
reportValidity() {
|
|
65
|
-
return this._textareaElement?.reportValidity() ?? !0;
|
|
66
|
-
}
|
|
67
|
-
setCustomValidity(e) {
|
|
68
|
-
this._textareaElement?.setCustomValidity(e), this._internalError = e, this.requestUpdate();
|
|
69
|
-
}
|
|
70
|
-
adjustHeight() {
|
|
71
|
-
!this.autoResize || !this._textareaElement || (this._textareaElement.style.height = "auto", this._textareaElement.style.height = `${this._textareaElement.scrollHeight}px`);
|
|
72
|
-
}
|
|
73
|
-
updated(e) {
|
|
74
|
-
super.updated(e), e.has("value") && this.autoResize && this.adjustHeight();
|
|
75
|
-
}
|
|
76
|
-
getResizeClass() {
|
|
77
|
-
return this.autoResize ? "textarea__field--auto-resize" : {
|
|
78
|
-
none: "textarea__field--resize-none",
|
|
79
|
-
vertical: "textarea__field--resize-vertical",
|
|
80
|
-
horizontal: "textarea__field--resize-horizontal",
|
|
81
|
-
both: "textarea__field--resize-both"
|
|
82
|
-
}[this.resize];
|
|
83
|
-
}
|
|
84
|
-
render() {
|
|
85
|
-
const e = this.error || this._internalError, i = this.showClear && this.value && !this.disabled && !this.readonly, s = `textarea__field ${this.getResizeClass()}`;
|
|
86
|
-
return u`
|
|
87
|
-
<logosphere-formfield
|
|
88
|
-
.label=${this.label}
|
|
89
|
-
.helper=${this.helper}
|
|
90
|
-
.error=${e}
|
|
91
|
-
.required=${this.required}
|
|
92
|
-
.disabled=${this.disabled}
|
|
93
|
-
.readonly=${this.readonly}
|
|
94
|
-
.placeholder=${this.placeholder}
|
|
95
|
-
.size=${this.size}
|
|
96
|
-
.variant=${this.variant}
|
|
97
|
-
>
|
|
98
|
-
<textarea
|
|
99
|
-
class="${s}"
|
|
100
|
-
.value=${f(this.value)}
|
|
101
|
-
placeholder=${this.placeholder || l}
|
|
102
|
-
name=${this.name || l}
|
|
103
|
-
autocomplete=${this.autocomplete || l}
|
|
104
|
-
?required=${this.required}
|
|
105
|
-
?disabled=${this.disabled}
|
|
106
|
-
?readonly=${this.readonly}
|
|
107
|
-
minlength=${this.minlength ?? l}
|
|
108
|
-
maxlength=${this.maxlength ?? l}
|
|
109
|
-
rows=${this.rows}
|
|
110
|
-
cols=${this.cols ?? l}
|
|
111
|
-
wrap=${this.wrap}
|
|
112
|
-
@input=${this.handleInput}
|
|
113
|
-
@change=${this.handleChange}
|
|
114
|
-
@keydown=${this.handleKeyDown}
|
|
115
|
-
@keyup=${this.handleKeyUp}
|
|
116
|
-
></textarea>
|
|
117
|
-
${i ? u`
|
|
118
|
-
<button
|
|
119
|
-
type="button"
|
|
120
|
-
slot="suffix"
|
|
121
|
-
class="textarea__clear-btn"
|
|
122
|
-
@click=${this.handleClear}
|
|
123
|
-
tabindex="-1"
|
|
124
|
-
>
|
|
125
|
-
<ui-icon name="uil-times" size="14"></ui-icon>
|
|
126
|
-
</button>
|
|
127
|
-
` : l}
|
|
128
|
-
</logosphere-formfield>
|
|
129
|
-
`;
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
t.styles = [c`${y(b)}`];
|
|
133
|
-
r([
|
|
134
|
-
m("textarea")
|
|
135
|
-
], t.prototype, "_textareaElement", 2);
|
|
136
|
-
r([
|
|
137
|
-
a({ type: String })
|
|
138
|
-
], t.prototype, "value", 2);
|
|
139
|
-
r([
|
|
140
|
-
a({ type: String })
|
|
141
|
-
], t.prototype, "placeholder", 2);
|
|
142
|
-
r([
|
|
143
|
-
a({ type: String })
|
|
144
|
-
], t.prototype, "name", 2);
|
|
145
|
-
r([
|
|
146
|
-
a({ type: String })
|
|
147
|
-
], t.prototype, "autocomplete", 2);
|
|
148
|
-
r([
|
|
149
|
-
a({ type: Number })
|
|
150
|
-
], t.prototype, "minlength", 2);
|
|
151
|
-
r([
|
|
152
|
-
a({ type: Number })
|
|
153
|
-
], t.prototype, "maxlength", 2);
|
|
154
|
-
r([
|
|
155
|
-
a({ type: Number })
|
|
156
|
-
], t.prototype, "rows", 2);
|
|
157
|
-
r([
|
|
158
|
-
a({ type: Number })
|
|
159
|
-
], t.prototype, "cols", 2);
|
|
160
|
-
r([
|
|
161
|
-
a({ type: String })
|
|
162
|
-
], t.prototype, "wrap", 2);
|
|
163
|
-
r([
|
|
164
|
-
a({ type: String })
|
|
165
|
-
], t.prototype, "resize", 2);
|
|
166
|
-
r([
|
|
167
|
-
a({ type: Boolean })
|
|
168
|
-
], t.prototype, "autoResize", 2);
|
|
169
|
-
r([
|
|
170
|
-
a({ type: String })
|
|
171
|
-
], t.prototype, "size", 2);
|
|
172
|
-
r([
|
|
173
|
-
a({ type: String })
|
|
174
|
-
], t.prototype, "variant", 2);
|
|
175
|
-
r([
|
|
176
|
-
a({ type: Boolean })
|
|
177
|
-
], t.prototype, "showClear", 2);
|
|
178
|
-
r([
|
|
179
|
-
a({ type: String })
|
|
180
|
-
], t.prototype, "label", 2);
|
|
181
|
-
r([
|
|
182
|
-
a({ type: String })
|
|
183
|
-
], t.prototype, "helper", 2);
|
|
184
|
-
r([
|
|
185
|
-
a({ type: String })
|
|
186
|
-
], t.prototype, "error", 2);
|
|
187
|
-
r([
|
|
188
|
-
a({ type: Boolean })
|
|
189
|
-
], t.prototype, "required", 2);
|
|
190
|
-
r([
|
|
191
|
-
a({ type: Boolean })
|
|
192
|
-
], t.prototype, "disabled", 2);
|
|
193
|
-
r([
|
|
194
|
-
a({ type: Boolean })
|
|
195
|
-
], t.prototype, "readonly", 2);
|
|
196
|
-
r([
|
|
197
|
-
_()
|
|
198
|
-
], t.prototype, "_internalError", 2);
|
|
199
|
-
t = r([
|
|
200
|
-
v("logosphere-textarea")
|
|
201
|
-
], t);
|
|
202
|
-
export {
|
|
203
|
-
t as T
|
|
204
|
-
};
|