logosphere-ui 0.0.0-alpha.76 → 0.0.0-alpha.78
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/{breadcrumb-Di2PYA_6.js → breadcrumb-C67DoTnK.js} +1 -1
- package/dist/{breadcrumb-B7j6nFDr.cjs → breadcrumb-DZe_r3qQ.cjs} +1 -1
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/{button-CX9q2ftp.cjs → button-Fv9_uRXu.cjs} +1 -1
- package/dist/{button-pR86YJLU.js → button-YzOUufoq.js} +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/{card-J30IBYNn.cjs → card-BE-j77vi.cjs} +1 -1
- package/dist/{card-DUMt4YCY.js → card-SzuoXbSC.js} +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/{chatbot-CRih5jiK.js → chatbot-5rZ2PaDM.js} +4 -4
- package/dist/{chatbot-SmaCp8C2.cjs → chatbot-yKC2ZfxJ.cjs} +1 -1
- package/dist/chatbot.cjs +1 -1
- package/dist/chatbot.js +1 -1
- package/dist/{checkbox-CWAdW-BH.js → checkbox-GVt-6O_u.js} +1 -1
- package/dist/{checkbox-BB2zebQO.cjs → checkbox-j5rJhSeO.cjs} +1 -1
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{combobox-B-a4usLB.cjs → combobox-CWR1wuO9.cjs} +1 -1
- package/dist/{combobox-F9bYHwaw.js → combobox-zTfdwhDN.js} +3 -3
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.js +1 -1
- package/dist/{datepicker-DPqbq-N2.js → datepicker-B6WBpjSd.js} +1 -1
- package/dist/{datepicker-4VzjnsXz.cjs → datepicker-D7XAq7Bo.cjs} +1 -1
- package/dist/datepicker.cjs +1 -1
- package/dist/datepicker.js +1 -1
- package/dist/{download-manager-CT0Q2gnK.cjs → download-manager-ByHcedTM.cjs} +1 -1
- package/dist/{download-manager-DsCOLWuB.js → download-manager-KMIqWika.js} +1 -1
- package/dist/download-manager.cjs +1 -1
- package/dist/download-manager.js +1 -1
- package/dist/{formfield-xbaN7Zdg.js → formfield-Bz1d7fWp.js} +1 -1
- package/dist/{formfield-WaJS7Z-d.cjs → formfield-Dv-toh_b.cjs} +1 -1
- package/dist/formfield.cjs +1 -1
- package/dist/formfield.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +14 -14
- package/dist/index.umd.js +1 -1
- package/dist/{input-B8qznwmM.cjs → input-BfxT3lT0.cjs} +1 -1
- package/dist/{input-CKSwPJEk.js → input-CbvdySAR.js} +2 -2
- package/dist/{live-Drc9xna7.cjs → live-BaFK5SeW.cjs} +1 -1
- package/dist/{live-D-pJY3Tw.js → live-BdNo0pEX.js} +1 -1
- package/dist/logosphere-base.css +1 -1
- package/dist/logosphere-scoped.css +1 -1
- package/dist/{modal-UueIa_Df.js → modal-BWmeyvnc.js} +1 -1
- package/dist/{modal-Sajt4j8m.cjs → modal-kt1BGhsl.cjs} +1 -1
- package/dist/modal.cjs +1 -1
- package/dist/modal.js +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.js +13 -13
- package/dist/{switch-vYHEAGpY.cjs → switch-D_sHsqbh.cjs} +1 -1
- package/dist/{switch-F-Ki2Uyq.js → switch-j3vl1bwf.js} +1 -1
- package/dist/switch.cjs +1 -1
- package/dist/switch.js +1 -1
- package/dist/{tailwind-importer-DQVyNi8n.js → tailwind-importer-BWVGBePx.js} +1 -1
- package/dist/{tailwind-importer-okd32Eq0.cjs → tailwind-importer-DrTYO1vJ.cjs} +1 -1
- package/dist/{text-area-Cf-R3ZdJ.cjs → text-area-BPPge84R.cjs} +1 -1
- package/dist/{text-area-Cq5Smc1f.js → text-area-wmQG4Qsh.js} +2 -2
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/vue/index.cjs +1 -1
- package/dist/vue/index.js +12 -12
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement as i, html as t } from "lit";
|
|
2
2
|
import { property as m, customElement as v } from "lit/decorators.js";
|
|
3
|
-
import { t as f } from "./tailwind-importer-
|
|
3
|
+
import { t as f } from "./tailwind-importer-BWVGBePx.js";
|
|
4
4
|
var h = Object.defineProperty, u = Object.getOwnPropertyDescriptor, c = (e, s, p, a) => {
|
|
5
5
|
for (var r = a > 1 ? void 0 : a ? u(s, p) : s, o = e.length - 1, n; o >= 0; o--)
|
|
6
6
|
(n = e[o]) && (r = (a ? n(s, p, r) : n(r)) || r);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const s=require("lit"),i=require("lit/decorators.js"),m=require("./tailwind-importer-
|
|
1
|
+
"use strict";const s=require("lit"),i=require("lit/decorators.js"),m=require("./tailwind-importer-DrTYO1vJ.cjs");var o=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=(l,e,t,a)=>{for(var r=a>1?void 0:a?u(e,t):e,c=l.length-1,n;c>=0;c--)(n=l[c])&&(r=(a?n(e,t,r):n(r))||r);return a&&r&&o(e,t,r),r};exports.Breadcrumb=class extends s.LitElement{constructor(){super(...arguments),this.items=[]}render(){return s.html`
|
|
2
2
|
<div class="logoui-wrapper">
|
|
3
3
|
<nav class="flex items-center space-x-2 text-sm">
|
|
4
4
|
${this.items.map((e,t)=>s.html`
|
package/dist/breadcrumb.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./breadcrumb-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./breadcrumb-DZe_r3qQ.cjs");Object.defineProperty(exports,"Breadcrumb",{enumerable:!0,get:()=>e.Breadcrumb});
|
package/dist/breadcrumb.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const a=require("lit"),s=require("lit/decorators.js"),u=require("./tailwind-importer-
|
|
1
|
+
"use strict";const a=require("lit"),s=require("lit/decorators.js"),u=require("./tailwind-importer-DrTYO1vJ.cjs");var c=Object.defineProperty,y=Object.getOwnPropertyDescriptor,n=(o,e,i,r)=>{for(var t=r>1?void 0:r?y(e,i):e,p=o.length-1,l;p>=0;p--)(l=o[p])&&(t=(r?l(e,i,t):l(t))||t);return r&&t&&c(e,i,t),t};exports.Button=class extends a.LitElement{constructor(){super(...arguments),this.variant="solid",this.size="md",this.theme="primary",this.iconOnly=!1}getPaddingClasses(){return{sm:this.iconOnly?"p-1 leading-[16px]":"py-0.5 px-2 text-sm",md:this.iconOnly?"p-1.5 leading-[16px]":"py-1.5 px-3 text-sm",lg:this.iconOnly?"p-2 leading-[16px]":"py-2 px-4 text-base"}[this.size]}getVariantClass(){return`${this.theme}`}render(){return a.html`
|
|
2
2
|
<div class="logoui-wrapper">
|
|
3
3
|
<button
|
|
4
4
|
class="${"inline-flex text-white items-center justify-center rounded-[8px] font-semibold gap-2 transition-colors cursor-pointer"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement as m, html as d } from "lit";
|
|
2
2
|
import { property as o, customElement as g } from "lit/decorators.js";
|
|
3
|
-
import { t as y } from "./tailwind-importer-
|
|
3
|
+
import { t as y } from "./tailwind-importer-BWVGBePx.js";
|
|
4
4
|
var c = Object.defineProperty, h = Object.getOwnPropertyDescriptor, s = (i, r, p, n) => {
|
|
5
5
|
for (var t = n > 1 ? void 0 : n ? h(r, p) : r, l = i.length - 1, a; l >= 0; l--)
|
|
6
6
|
(a = i[l]) && (t = (n ? a(r, p, t) : a(t)) || t);
|
package/dist/button.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./button-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./button-Fv9_uRXu.cjs");Object.defineProperty(exports,"Button",{enumerable:!0,get:()=>e.Button});
|
package/dist/button.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const h=require("lit"),l=require("lit/decorators.js"),i=require("./tailwind-importer-
|
|
1
|
+
"use strict";const h=require("lit"),l=require("lit/decorators.js"),i=require("./tailwind-importer-DrTYO1vJ.cjs");var p=Object.defineProperty,g=Object.getOwnPropertyDescriptor,n=(a,e,t,s)=>{for(var r=s>1?void 0:s?g(e,t):e,o=a.length-1,d;o>=0;o--)(d=a[o])&&(r=(s?d(e,t,r):d(r))||r);return s&&r&&p(e,t,r),r};exports.Card=class extends h.LitElement{constructor(){super(...arguments),this.hasFooter=!1,this.hasHeader=!1}handleFooterChange(e){const t=e.target;this.hasFooter=t.assignedNodes({flatten:!0}).length>0}handleHeaderChange(e){const t=e.target;this.hasHeader=t.assignedNodes({flatten:!0}).length>0}render(){return h.html`
|
|
2
2
|
<div class="logoui-wrapper">
|
|
3
3
|
<div
|
|
4
4
|
class="w-full rounded-lg border border-gray/25 overflow-hidden shadow-sm grid grid-rows-[auto_1fr_auto]"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LitElement as n, html as i } from "lit";
|
|
2
2
|
import { state as p, customElement as g } from "lit/decorators.js";
|
|
3
|
-
import { t as f } from "./tailwind-importer-
|
|
3
|
+
import { t as f } from "./tailwind-importer-BWVGBePx.js";
|
|
4
4
|
var x = Object.defineProperty, v = Object.getOwnPropertyDescriptor, h = (r, e, a, o) => {
|
|
5
5
|
for (var t = o > 1 ? void 0 : o ? v(e, a) : e, d = r.length - 1, l; d >= 0; d--)
|
|
6
6
|
(l = r[d]) && (t = (o ? l(e, a, t) : l(t)) || t);
|
package/dist/card.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./card-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./card-BE-j77vi.cjs");Object.defineProperty(exports,"Card",{enumerable:!0,get:()=>e.Card});
|
package/dist/card.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { css as b, LitElement as v, html as c } from "lit";
|
|
2
2
|
import { property as p, state as l, query as m, customElement as C } from "lit/decorators.js";
|
|
3
|
-
import { t as w } from "./tailwind-importer-
|
|
4
|
-
import "./combobox-
|
|
5
|
-
import "./button-
|
|
6
|
-
import "./input-
|
|
3
|
+
import { t as w } from "./tailwind-importer-BWVGBePx.js";
|
|
4
|
+
import "./combobox-zTfdwhDN.js";
|
|
5
|
+
import "./button-YzOUufoq.js";
|
|
6
|
+
import "./input-CbvdySAR.js";
|
|
7
7
|
var D = Object.defineProperty, $ = Object.getOwnPropertyDescriptor, r = (t, e, n, s) => {
|
|
8
8
|
for (var i = s > 1 ? void 0 : s ? $(e, n) : e, a = t.length - 1, d; a >= 0; a--)
|
|
9
9
|
(d = t[a]) && (i = (s ? d(e, n, i) : d(i)) || i);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const l=require("lit"),o=require("lit/decorators.js"),b=require("./tailwind-importer-
|
|
1
|
+
"use strict";const l=require("lit"),o=require("lit/decorators.js"),b=require("./tailwind-importer-DrTYO1vJ.cjs");require("./combobox-CWR1wuO9.cjs");require("./button-Fv9_uRXu.cjs");require("./input-BfxT3lT0.cjs");var C=Object.defineProperty,y=Object.getOwnPropertyDescriptor,r=(d,t,s,i)=>{for(var e=i>1?void 0:i?y(t,s):t,n=d.length-1,a;n>=0;n--)(a=d[n])&&(e=(i?a(t,s,e):a(e))||e);return i&&e&&C(t,s,e),e};exports.LedsUiChatbot=class extends l.LitElement{constructor(){super(...arguments),this.returnUri="",this.questionPrompt="",this.products=[],this.openInitially=!1,this.showFeedbackButtons=!1,this.open=!1,this.fullscreen=!1,this.messages=[],this.isLoading=!1,this.inputText="",this.selectedProductId=""}connectedCallback(){super.connectedCallback()}async firstUpdated(){this.products.length==1&&(this.selectedProductId=this.products[0].id),this.open=this.openInitially,this.open&&await this.initConversation()}handleProductUpdate(){if(!this.products.length)return;this.products.some(s=>s.id===this.selectedProductId)||(this.messages=[],this.conversationId=void 0,this.open&&this.initConversation()),requestAnimationFrame(()=>this.updateComboboxItems())}updated(t){t.has("products")&&this.handleProductUpdate(),t.has("messages")&&this.scrollToBottom(),t.has("open")&&this.open&&!this.conversationId&&this.initConversation()}updateComboboxItems(){const t=this.productEl;if(t&&this.products?.length>1){const s=this.products.map(e=>({value:e.id,label:e.name}));t.items=s;const i=t.selectedItems?.()||[];if(i.length>0){const e=i[0]?.value;!this.products.some(a=>a.id===e)&&t.setSelected&&t.setSelected([])}}}onToggle(){this.open=!this.open,this.scrollToBottom()}onClose(){this.open=!1,this.fullscreen=!1}onToggleFullscreen(){this.fullscreen=!this.fullscreen}async onProductChange(t){const s=t.detail?.selected?.[0]?.value;s&&s!==this.selectedProductId&&(this.selectedProductId=s)}async ensureToken(t=!1){const s="logosphere_chatbot_token";if(t&&(this.assertionToken=void 0,localStorage.removeItem(s)),!t){const a=localStorage.getItem(s);if(a){this.assertionToken=a;return}}const i=`${this.returnUri}/api/chat/start`,n=await(await fetch(i)).json();if(!n.Success||!n.Data?.Token)throw new Error("Token alınamadı");this.assertionToken=n.Data.Token,localStorage.setItem(s,this.assertionToken)}async initConversation(){if(!this.isLoading){this.isLoading=!0;try{await this.ensureToken();const t=await this.postChat({ChatCompletionType:"NewConversation",Context:this.selectedProductId,QuestionPrompt:this.questionPrompt});this.conversationId=t.Data.ConversationId;const s=t.Data.Choices?.[0]?.Message?.Content;s&&this.addMessage(s,"assistant")}catch{this.addMessage("Bir hata oluştu, lütfen tekrar deneyiniz.","system")}finally{this.isLoading=!1}}}async postChat(t){await this.ensureToken();const s=`${this.returnUri}/api/chat/completions`,i=async()=>fetch(s,{method:"POST",headers:{"Content-Type":"application/json",client_assertion:this.assertionToken,client_assertion_type:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"},body:JSON.stringify(t)});let e=await i();if(e.status===401&&(await this.ensureToken(!0),e=await i()),!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}async sendMessage(){const t=this.inputText.trim();if(!(!t||!this.conversationId||this.isLoading)){if(!this.selectedProductId){this.addMessage("Lütfen önce bir ürün seçiniz.","system");return}this.addMessage(t,"user"),this.inputText="",this.isLoading=!0;try{const i=(await this.postChat({ChatCompletionType:"ConversationUpdate",Content:t,Context:this.selectedProductId,ConversationId:this.conversationId,QuestionPrompt:this.questionPrompt})).Data?.Choices?.[0]?.Message?.Content;this.addMessage(i||"Cevap alınamadı.","assistant")}catch{this.addMessage("Bağlantı hatası.","system")}finally{this.isLoading=!1}}}addMessage(t,s){this.messages=[...this.messages,{id:crypto.randomUUID(),content:t,role:s,timestamp:Date.now()}]}handleKeyDown(t){t.key==="Enter"&&!t.shiftKey&&(t.preventDefault(),this.sendMessage())}onInput(t){this.inputText=t.target?t.target.value:t.detail}scrollToBottom(){setTimeout(()=>{this.chatContainer&&(this.chatContainer.scrollTop=this.chatContainer.scrollHeight)},0)}formatContent(t){if(!t)return"";const i=t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").split(`
|
|
2
2
|
`);let e="",n=!1,a="";for(let u=0;u<i.length;u++){const c=i[u],f=c.trim()==="",p=c.match(/^\s*\d+\.\s+(.*)/),g=c.match(/^\s*[-*]\s+(.*)/);if(p||g){const h=p?"ol":"ul";(!n||a!==h)&&(n&&(e+=`</${a}>`),e+=`<${h} class="${h==="ol"?"list-decimal":"list-disc"} ml-5 my-0 space-y-0">`,n=!0,a=h);const m=p?p[1]:g[1];e+=`<li class="pl-1">${m}</li>`}else f?n||(e+="<br>"):(n&&(e+=`</${a}>`,n=!1,a=""),e+=`<p class="m-0">${c}</p>`)}return n&&(e+=`</${a}>`),e=e.replace(/\*\*(.*?)\*\*/g,'<strong class="font-semibold">$1</strong>').replace(/\*(.*?)\*/g,'<em class="italic">$1</em>').replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer" class="text-[var(--color-primary)] underline hover:text-blue-700 transition-colors">$1</a>'),e}onCopyMessage(t){navigator.clipboard.writeText(t)}render(){return l.html`
|
|
3
3
|
<div class="chatbot-container font-sans">
|
|
4
4
|
${this.open||this.fullscreen?l.html`
|
package/dist/chatbot.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chatbot-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chatbot-yKC2ZfxJ.cjs");Object.defineProperty(exports,"LedsUiChatbot",{enumerable:!0,get:()=>e.LedsUiChatbot});
|
package/dist/chatbot.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { css as o, LitElement as d, html as p } from "lit";
|
|
2
2
|
import { property as n, state as m, customElement as u } from "lit/decorators.js";
|
|
3
3
|
import { ref as b } from "lit/directives/ref.js";
|
|
4
|
-
import { t as k } from "./tailwind-importer-
|
|
4
|
+
import { t as k } from "./tailwind-importer-BWVGBePx.js";
|
|
5
5
|
var f = Object.defineProperty, y = Object.getOwnPropertyDescriptor, t = (i, r, l, a) => {
|
|
6
6
|
for (var s = a > 1 ? void 0 : a ? y(r, l) : r, c = i.length - 1, h; c >= 0; c--)
|
|
7
7
|
(h = i[c]) && (s = (a ? h(r, l, s) : h(s)) || s);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const l=require("lit"),t=require("lit/decorators.js"),a=require("lit/directives/ref.js"),d=require("./tailwind-importer-
|
|
1
|
+
"use strict";const l=require("lit"),t=require("lit/decorators.js"),a=require("lit/directives/ref.js"),d=require("./tailwind-importer-DrTYO1vJ.cjs");var p=Object.defineProperty,b=Object.getOwnPropertyDescriptor,i=(c,e,s,n)=>{for(var r=n>1?void 0:n?b(e,s):e,h=c.length-1,o;h>=0;h--)(o=c[h])&&(r=(n?o(e,s,r):o(r))||r);return n&&r&&p(e,s,r),r};exports.Checkbox=class extends l.LitElement{constructor(){super(...arguments),this.label="",this.value="",this.checked=!1,this.type="checkbox",this.disabled=!1,this.indeterminate=!1,this.internalChecked=!1}connectedCallback(){super.connectedCallback(),this.internalChecked=this.checked}firstUpdated(){this.setIndeterminate()}updated(e){e.has("indeterminate")&&this.setIndeterminate(),e.has("checked")&&(this.internalChecked=this.checked)}setIndeterminate(){this.inputElement&&(this.inputElement.indeterminate=this.indeterminate)}toggleChecked(){this.disabled||(this.indeterminate?(this.indeterminate=!1,this.internalChecked=!0):this.internalChecked=!this.internalChecked,this.dispatchEvent(new CustomEvent("change",{detail:{checked:this.internalChecked,indeterminate:this.indeterminate,value:this.value},bubbles:!0,composed:!0})))}render(){const e=`
|
|
2
2
|
form-check-input w-[16px] h-[16px]
|
|
3
3
|
${this.disabled?"cursor-not-allowed":"cursor-pointer"}
|
|
4
4
|
${this.internalChecked?"checked:accent-primary checked:border-blue-600":""}
|
package/dist/checkbox.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./checkbox-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./checkbox-j5rJhSeO.cjs");Object.defineProperty(exports,"Checkbox",{enumerable:!0,get:()=>e.Checkbox});
|
package/dist/checkbox.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const l=require("lit"),o=require("lit/decorators.js");require("./checkbox-
|
|
1
|
+
"use strict";const l=require("lit"),o=require("lit/decorators.js");require("./checkbox-j5rJhSeO.cjs");require("./button-Fv9_uRXu.cjs");const h=require("./tailwind-importer-DrTYO1vJ.cjs");var u=Object.defineProperty,c=Object.getOwnPropertyDescriptor,s=(p,e,t,i)=>{for(var r=i>1?void 0:i?c(e,t):e,a=p.length-1,n;a>=0;a--)(n=p[a])&&(r=(i?n(e,t,r):n(r))||r);return i&&r&&u(e,t,r),r};exports.Combobox=class extends l.LitElement{constructor(){super(...arguments),this.inputId="combo-"+Math.random().toString(36).substring(2),this.label="",this.placeholder="Seçim yapınız",this.required=!1,this.readOnly=!1,this.multiple=!1,this.filterable=!1,this.optionLabel="label",this.optionValue="value",this.emptyMessage="Sonuç yok",this.items=[],this.selected=[],this.inputValue="",this.isOpen=!1}selectedItems(){return this.selected}getReadonlyLabel(){return this.multiple?this.selected.map(e=>e[this.optionLabel]).join(", "):this.selected[0]?.[this.optionLabel]??""}toggle(){this.isOpen=!this.isOpen}isSelected(e){return this.selected.some(t=>t[this.optionValue]===e[this.optionValue])}toggleTag(e,t){t.stopPropagation();let i=[];this.multiple?this.isSelected(e)?i=this.selected.filter(r=>r[this.optionValue]!==e[this.optionValue]):i=[...this.selected,e]:(i=[e],this.isOpen=!1),this.setSelected(i)}removeTag(e,t){t.stopPropagation(),this.selected=this.selected.filter(i=>i[this.optionValue]!==e[this.optionValue])}setSelected(e){this.selected=e,this.dispatchEvent(new CustomEvent("selected",{detail:{selected:e},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0}))}onInputModelChange(e){this.inputValue=e}filteredItems(){return this.items.filter(e=>(e[this.optionLabel]??"").toString().toLowerCase().includes(this.inputValue.toLowerCase()))}render(){return l.html`
|
|
2
2
|
<div class="logoui-wrapper">
|
|
3
3
|
${this.label?l.html`<label
|
|
4
4
|
for="${this.inputId}"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LitElement as u, html as i } from "lit";
|
|
2
2
|
import { property as o, state as d, customElement as c } from "lit/decorators.js";
|
|
3
|
-
import "./checkbox-
|
|
4
|
-
import "./button-
|
|
5
|
-
import { t as g } from "./tailwind-importer-
|
|
3
|
+
import "./checkbox-GVt-6O_u.js";
|
|
4
|
+
import "./button-YzOUufoq.js";
|
|
5
|
+
import { t as g } from "./tailwind-importer-BWVGBePx.js";
|
|
6
6
|
var m = Object.defineProperty, b = Object.getOwnPropertyDescriptor, l = (e, t, r, a) => {
|
|
7
7
|
for (var p = a > 1 ? void 0 : a ? b(t, r) : t, n = e.length - 1, h; n >= 0; n--)
|
|
8
8
|
(h = e[n]) && (p = (a ? h(t, r, p) : h(p)) || p);
|
package/dist/combobox.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./combobox-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./combobox-CWR1wuO9.cjs");Object.defineProperty(exports,"Combobox",{enumerable:!0,get:()=>e.Combobox});
|
package/dist/combobox.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { css as Mt, LitElement as vt, nothing as ot, html as k } from "lit";
|
|
2
2
|
import { property as D, state as q, customElement as wt } from "lit/decorators.js";
|
|
3
3
|
import m from "dayjs";
|
|
4
|
-
import { t as Dt } from "./tailwind-importer-
|
|
4
|
+
import { t as Dt } from "./tailwind-importer-BWVGBePx.js";
|
|
5
5
|
function X(t) {
|
|
6
6
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const Y=require("lit"),m=require("lit/decorators.js"),_=require("dayjs"),yt=require("./tailwind-importer-okd32Eq0.cjs");function N(p){return p&&p.__esModule&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p}var G={exports:{}},gt=G.exports,ot;function Yt(){return ot||(ot=1,function(p,t){(function(e,r){p.exports=r()})(gt,function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(r,i,h){var s=i.prototype,l=s.format;h.en.formats=e,s.format=function(n){n===void 0&&(n="YYYY-MM-DDTHH:mm:ssZ");var f=this.$locale().formats,o=function(M,g){return M.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(b,B,w){var a=w&&w.toUpperCase();return B||g[w]||e[w]||g[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(u,c,d){return c||d.slice(1)})})}(n,f===void 0?{}:f);return l.call(this,o)}}})}(G)),G.exports}var Mt=Yt();const vt=N(Mt);var V={exports:{}},Dt=V.exports,ht;function wt(){return ht||(ht=1,function(p,t){(function(e,r){p.exports=r()})(Dt,function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,h=/\d\d/,s=/\d\d?/,l=/\d*[^-_:/,()\s\d]+/,n={},f=function(a){return(a=+a)+(a>68?1900:2e3)},o=function(a){return function(u){this[a]=+u}},M=[/[+-]\d\d:?(\d\d)?|Z/,function(a){(this.zone||(this.zone={})).offset=function(u){if(!u||u==="Z")return 0;var c=u.match(/([+-]|\d\d)/g),d=60*c[1]+(+c[2]||0);return d===0?0:c[0]==="+"?-d:d}(a)}],g=function(a){var u=n[a];return u&&(u.indexOf?u:u.s.concat(u.f))},b=function(a,u){var c,d=n.meridiem;if(d){for(var k=1;k<=24;k+=1)if(a.indexOf(d(k,0,u))>-1){c=k>12;break}}else c=a===(u?"pm":"PM");return c},B={A:[l,function(a){this.afternoon=b(a,!1)}],a:[l,function(a){this.afternoon=b(a,!0)}],Q:[i,function(a){this.month=3*(a-1)+1}],S:[i,function(a){this.milliseconds=100*+a}],SS:[h,function(a){this.milliseconds=10*+a}],SSS:[/\d{3}/,function(a){this.milliseconds=+a}],s:[s,o("seconds")],ss:[s,o("seconds")],m:[s,o("minutes")],mm:[s,o("minutes")],H:[s,o("hours")],h:[s,o("hours")],HH:[s,o("hours")],hh:[s,o("hours")],D:[s,o("day")],DD:[h,o("day")],Do:[l,function(a){var u=n.ordinal,c=a.match(/\d+/);if(this.day=c[0],u)for(var d=1;d<=31;d+=1)u(d).replace(/\[|\]/g,"")===a&&(this.day=d)}],w:[s,o("week")],ww:[h,o("week")],M:[s,o("month")],MM:[h,o("month")],MMM:[l,function(a){var u=g("months"),c=(g("monthsShort")||u.map(function(d){return d.slice(0,3)})).indexOf(a)+1;if(c<1)throw new Error;this.month=c%12||c}],MMMM:[l,function(a){var u=g("months").indexOf(a)+1;if(u<1)throw new Error;this.month=u%12||u}],Y:[/[+-]?\d+/,o("year")],YY:[h,function(a){this.year=f(a)}],YYYY:[/\d{4}/,o("year")],Z:M,ZZ:M};function w(a){var u,c;u=a,c=n&&n.formats;for(var d=(a=u.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(A,$,x){var D=x&&x.toUpperCase();return $||c[x]||e[x]||c[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(E,C,I){return C||I.slice(1)})})).match(r),k=d.length,L=0;L<k;L+=1){var T=d[L],O=B[T],S=O&&O[0],P=O&&O[1];d[L]=P?{regex:S,parser:P}:T.replace(/^\[|\]$/g,"")}return function(A){for(var $={},x=0,D=0;x<k;x+=1){var E=d[x];if(typeof E=="string")D+=E.length;else{var C=E.regex,I=E.parser,H=A.slice(D),q=C.exec(H)[0];I.call($,q),A=A.replace(q,"")}}return function(z){var R=z.afternoon;if(R!==void 0){var v=z.hours;R?v<12&&(z.hours+=12):v===12&&(z.hours=0),delete z.afternoon}}($),$}}return function(a,u,c){c.p.customParseFormat=!0,a&&a.parseTwoDigitYear&&(f=a.parseTwoDigitYear);var d=u.prototype,k=d.parse;d.parse=function(L){var T=L.date,O=L.utc,S=L.args;this.$u=O;var P=S[1];if(typeof P=="string"){var A=S[2]===!0,$=S[3]===!0,x=A||$,D=S[2];$&&(D=S[2]),n=this.$locale(),!A&&D&&(n=c.Ls[D]),this.$d=function(H,q,z,R){try{if(["x","X"].indexOf(q)>-1)return new Date((q==="X"?1e3:1)*H);var v=w(q)(H),Q=v.year,F=v.month,dt=v.day,pt=v.hours,ft=v.minutes,_t=v.seconds,mt=v.milliseconds,at=v.zone,nt=v.week,X=new Date,J=dt||(Q||F?1:X.getDate()),tt=Q||X.getFullYear(),j=0;Q&&!F||(j=F>0?F-1:X.getMonth());var U,et=pt||0,rt=ft||0,st=_t||0,it=mt||0;return at?new Date(Date.UTC(tt,j,J,et,rt,st,it+60*at.offset*1e3)):z?new Date(Date.UTC(tt,j,J,et,rt,st,it)):(U=new Date(tt,j,J,et,rt,st,it),nt&&(U=R(U).week(nt).toDate()),U)}catch{return new Date("")}}(T,P,O,c),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),x&&T!=this.format(P)&&(this.$d=new Date("")),n={}}else if(P instanceof Array)for(var E=P.length,C=1;C<=E;C+=1){S[1]=P[C-1];var I=c.apply(this,S);if(I.isValid()){this.$d=I.$d,this.$L=I.$L,this.init();break}C===E&&(this.$d=new Date(""))}else k.call(this,L)}}})}(V)),V.exports}var xt=wt();const bt=N(xt);var W={exports:{}},kt=W.exports,lt;function Lt(){return lt||(lt=1,function(p,t){(function(e,r){p.exports=r()})(kt,function(){return function(e,r,i){r.prototype.isBetween=function(h,s,l,n){var f=i(h),o=i(s),M=(n=n||"()")[0]==="(",g=n[1]===")";return(M?this.isAfter(f,l):!this.isBefore(f,l))&&(g?this.isBefore(o,l):!this.isAfter(o,l))||(M?this.isBefore(f,l):!this.isAfter(f,l))&&(g?this.isAfter(o,l):!this.isBefore(o,l))}}})}(W)),W.exports}var St=Lt();const Pt=N(St);var Z={exports:{}},$t=Z.exports,ut;function Et(){return ut||(ut=1,function(p,t){(function(e,r){p.exports=r()})($t,function(){var e="week",r="year";return function(i,h,s){var l=h.prototype;l.week=function(n){if(n===void 0&&(n=null),n!==null)return this.add(7*(n-this.week()),"day");var f=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var o=s(this).startOf(r).add(1,r).date(f),M=s(this).endOf(e);if(o.isBefore(M))return 1}var g=s(this).startOf(r).date(f).startOf(e).subtract(1,"millisecond"),b=this.diff(g,e,!0);return b<0?s(this).startOf("week").week():Math.ceil(b)},l.weeks=function(n){return n===void 0&&(n=null),this.week(n)}}})}(Z)),Z.exports}var Ct=Et();const Bt=N(Ct);var K={exports:{}},Ot=K.exports,ct;function At(){return ct||(ct=1,function(p,t){(function(e,r){p.exports=r(_)})(Ot,function(e){function r(s){return s&&typeof s=="object"&&"default"in s?s:{default:s}}var i=r(e),h={name:"tr",weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekStart:1,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(s){return s+"."}};return i.default.locale(h,null,!0),h})}(K)),K.exports}At();var It=Object.defineProperty,zt=Object.getOwnPropertyDescriptor,y=(p,t,e,r)=>{for(var i=r>1?void 0:r?zt(t,e):t,h=p.length-1,s;h>=0;h--)(s=p[h])&&(i=(r?s(t,e,i):s(i))||i);return r&&i&&It(t,e,i),i};_.extend(vt);_.extend(bt);_.extend(Pt);_.extend(Bt);_.locale("tr");exports.LedsDatePicker=class extends Y.LitElement{constructor(){super(...arguments),this.value=null,this.min=null,this.max=null,this.required=!1,this.disabled=!1,this.expandFactor=1.05,this.placeholder="GG/AA/YYYY veya GG.AA.YYYY",this.inputId="dp-"+Math.random().toString(36).slice(2),this.matchInputWidth=!0,this.isBetween=!1,this.disabledDays=[],this._open=!1,this._cursor=this._safeDay(this.value)??_(),this._popupPos=null,this._rangeStart=null,this._rangeEnd=null,this._viewMode="calendar",this._recalcPopupPos=()=>{const t=this.renderRoot.querySelector("#"+this.inputId);if(!t)return;const e=t.getBoundingClientRect(),r=this.renderRoot.querySelector("#"+this.inputId+"-ico"),i=window.innerWidth,h=window.innerHeight,s=8,l=r?r.getBoundingClientRect().left:e.left+e.width;let n=Math.max(0,l-e.left-s);n=Math.round(n*(this.expandFactor||1));const f=Math.round(e.right-e.left-s);let o=Math.min(n,f);o=Math.max(220,o);let M=Math.round(e.left);M+o>i-s&&(M=Math.max(s,Math.round(i-o-s)));const g=Math.max(0,h-(e.bottom+s)-s),b=Math.max(0,e.top-s-s),B=260;let w,a;g>=B||g>=b?(w=Math.round(e.bottom+s),a=Math.max(B,g)):(a=Math.max(B,b),w=Math.max(s,Math.round(e.top-s-a))),this._popupPos={left:M,top:w,width:o,maxH:a}},this._onScrollOrResize=()=>{this._open&&this._recalcPopupPos()},this._outsideClick=t=>{if(this._parseAndSetDate(),!this._open)return;t.composedPath().includes(this)||(this._viewMode="calendar",this._toggleOpen(!1))}}_safeDay(t){if(!t)return null;const r=_(t,["YYYY-MM-DD","DD/MM/YYYY","DD.MM.YYYY","DD MM YYYY","DD-MM-YYYY","DD/MM/YY","DD.MM.YY","DD MM YY","DD-MM-YY","YYYY/MM/DD","YYYY.MM.DD","YYYY MM DD"],!0);return r.isValid()?r:null}_emitChange(t){this.value=t,this.dispatchEvent(new CustomEvent("change",{detail:{value:t}}))}_emitRangeChange(){this._rangeStart&&this._rangeEnd&&this.dispatchEvent(new CustomEvent("rangeChange",{detail:{start:this._rangeStart,end:this._rangeEnd}}))}_toggleOpen(t){if(this.disabled)return;const e=t??!this._open;if(this._open=e,e){const r=this._safeDay(this.value);if(r?this._cursor=r.clone():this._cursor=_(),this.isBetween&&this._rangeStart){const i=this._safeDay(this._rangeStart);i&&(this._cursor=i.clone())}this._viewMode="calendar",this.updateComplete.then(()=>{this._recalcPopupPos(),window.requestAnimationFrame(()=>this._recalcPopupPos())})}}_onInput(t){t.target.value.trim()||(this._emitChange(null),this.isBetween&&(this._rangeStart=null,this._rangeEnd=null)),this._clearInputError()}_onKeydown(t){(t.key==="Tab"||t.key==="Enter")&&this._parseAndSetDate()}_parseAndSetDate(){const t=this.renderRoot.querySelector("#"+this.inputId);if(!t)return;const e=t.value.trim();if(!e){this._emitChange(null),this.isBetween&&(this._rangeStart=null,this._rangeEnd=null);return}const r=["DD/MM/YYYY","DD.MM.YYYY","DD MM YYYY","DD-MM-YYYY","DD/MM/YY","DD.MM.YY","DD MM YY","DD-MM-YY","YYYY-MM-DD","YYYY/MM/DD","YYYY.MM.DD","YYYY MM DD"];let i=null;for(const h of r){const s=_(e,h,!0);if(s.isValid()){i=s;break}}if(!i){const h=_(e);h.isValid()&&(i=h)}i&&this._withinBounds(i)?(this._emitChange(i.format("YYYY-MM-DD")),this._cursor=i,this.isBetween&&(this._rangeStart=null,this._rangeEnd=null),this._clearInputError()):this._showInputError("Geçersiz tarih formatı. Örnek: 19/09/2025, 19.09.2025, 19 09 2025")}_showInputError(t){const e=this.renderRoot.querySelector("#"+this.inputId);e&&(e.classList.add("border-red-500","bg-red-50"),e.classList.remove("border-gray-300"),this._showTooltip(t))}_clearInputError(){const t=this.renderRoot.querySelector("#"+this.inputId);t&&(t.classList.remove("border-red-500","bg-red-50"),t.classList.add("border-gray-300"),this._hideTooltip())}_showTooltip(t){this._hideTooltip();const e=this.renderRoot.querySelector("#"+this.inputId);if(!e)return;const r=document.createElement("div");r.id=this.inputId+"-tooltip",r.className="absolute z-50 px-2 py-1 text-xs text-white bg-red-600 rounded shadow-lg pointer-events-none",r.textContent=t;const i=e.getBoundingClientRect();r.style.left=i.left+"px",r.style.top=i.bottom+5+"px",document.body.appendChild(r),setTimeout(()=>this._hideTooltip(),3e3)}_hideTooltip(){const t=document.getElementById(this.inputId+"-tooltip");t&&t.remove()}_withinBounds(t){const e=this._safeDay(this.min),r=this._safeDay(this.max);return!(e&&t.isBefore(e,"day")||r&&t.isAfter(r,"day")||this.disabledDays.includes(t.day()))}_isInRange(t){if(!this.isBetween||!this._rangeStart||!this._rangeEnd)return null;const e=this._safeDay(this._rangeStart),r=this._safeDay(this._rangeEnd);return!e||!r?null:t.isSame(e,"day")?"start":t.isSame(r,"day")?"end":t.isBetween(e,r,"day","[]")?"between":null}_getDayClasses(t){const e=["relative","h-8","flex","items-center","justify-center","rounded-full","text-sm","transition"];if(!this._withinBounds(t))return this.disabledDays.includes(t.day())?e.push("text-gray-300","cursor-not-allowed","bg-gray-50"):e.push("text-gray-300","cursor-not-allowed"),e.join(" ");if(this.isBetween&&this._rangeStart&&t.isSame(this._safeDay(this._rangeStart),"day"))e.push("bg-primary","text-white");else{const r=this._isInRange(t);r?r==="start"?e.push("bg-primary","text-white","rounded-l-full","rounded-r-none"):r==="end"?e.push("bg-primary","text-white","rounded-r-full","rounded-l-none"):r==="between"&&e.push("bg-primary/20","text-primary","rounded-none"):t.isSame(this._safeDay(this.value),"day")?e.push("bg-primary","text-white"):t.isSame(_(),"day")?e.push("bg-gray-200","text-gray-800"):this.isBetween&&this._rangeStart&&!this._rangeEnd?e.push("hover:bg-primary/10","cursor-pointer"):e.push("hover:bg-gray-100","cursor-pointer")}return e.join(" ")}_select(t){if(this._withinBounds(t))if(this.isBetween)if(!this._rangeStart)this._rangeStart=t.format("YYYY-MM-DD"),this._cursor=t;else if(this._rangeEnd)this._rangeStart=t.format("YYYY-MM-DD"),this._rangeEnd=null,this._cursor=t;else{const e=this._safeDay(this._rangeStart);e&&t.isBefore(e,"day")?(this._rangeEnd=this._rangeStart,this._rangeStart=t.format("YYYY-MM-DD")):this._rangeEnd=t.format("YYYY-MM-DD"),this._cursor=t,this._viewMode="calendar",this._toggleOpen(!1),this._emitRangeChange()}else this._emitChange(t.format("YYYY-MM-DD")),this._cursor=t,this._viewMode="calendar",this._toggleOpen(!1)}_clear(){this._emitChange(null),this.isBetween&&(this._rangeStart=null,this._rangeEnd=null)}_today(){const t=_();this._withinBounds(t)&&this._select(t)}_monthStart(){return this._cursor.startOf("month")}_daysInGrid(){const t=this._monthStart(),e=t.subtract((t.day()+6)%7,"day"),r=[];for(let i=0;i<42;i++)r.push(e.add(i,"day"));return r}_displayValue(){if(this.isBetween&&this._rangeStart&&this._rangeEnd){const e=this._safeDay(this._rangeStart),r=this._safeDay(this._rangeEnd);if(e&&r)return`${e.format("DD/MM/YYYY")} - ${r.format("DD/MM/YYYY")}`}const t=this._safeDay(this.value);return t?t.format("DD/MM/YYYY"):""}_getMonths(){return["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"]}_getYears(){const e=this._cursor.year()-6,r=[];for(let i=0;i<12;i++)r.push(e+i);return r}_selectMonth(t){const e=this._safeDay(this.value)||_(),r=e.clone().month(t);this._cursor=r;const i=Math.min(e.date(),r.daysInMonth()),h=r.date(i);this._select(h),this._viewMode="calendar",this.requestUpdate()}_selectYear(t){const e=this._safeDay(this.value)||_(),r=e.clone().year(t);this._cursor=r;const i=Math.min(e.date(),r.daysInMonth()),h=r.date(i);this._select(h),this._viewMode="month",this.requestUpdate()}_navigateToMonthView(){this._viewMode="month",this.requestUpdate()}_navigateToYearView(){this._viewMode="year",this.requestUpdate()}_getHeaderLabel(){switch(this._viewMode){case"calendar":return this._cursor.format("MMMM YYYY");case"month":return this._cursor.format("YYYY");case"year":{const t=this._getYears();return`${t[0]}-${t[t.length-1]}`}default:return this._cursor.format("MMMM YYYY")}}_navigatePrevious(){switch(this._viewMode){case"calendar":this._cursor=this._cursor.subtract(1,"month");break;case"month":this._cursor=this._cursor.subtract(1,"year");break;case"year":this._cursor=this._cursor.subtract(12,"year");break}this.requestUpdate()}_navigateNext(){switch(this._viewMode){case"calendar":this._cursor=this._cursor.add(1,"month");break;case"month":this._cursor=this._cursor.add(1,"year");break;case"year":this._cursor=this._cursor.add(12,"year");break}this.requestUpdate()}_handleHeaderClick(){switch(this._viewMode){case"calendar":this._navigateToMonthView();break;case"month":this._navigateToYearView();break}}_keydownGrid(t){const e={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7};t.key in e?(t.preventDefault(),this._cursor=this._cursor.add(e[t.key],"day"),this.requestUpdate()):t.key==="Enter"||t.key===" "?(t.preventDefault(),this._select(this._cursor)):t.key==="Escape"?(t.preventDefault(),this._toggleOpen(!1)):t.key==="PageUp"?(t.preventDefault(),this._cursor=this._cursor.subtract(t.shiftKey?1:0,"year").subtract(1,"month")):t.key==="PageDown"?(t.preventDefault(),this._cursor=this._cursor.add(t.shiftKey?1:0,"year").add(1,"month")):t.key==="Home"?(t.preventDefault(),this._cursor=this._cursor.startOf("month")):t.key==="End"&&(t.preventDefault(),this._cursor=this._cursor.endOf("month"))}connectedCallback(){super.connectedCallback(),window.addEventListener("click",this._outsideClick,!0),window.addEventListener("scroll",this._onScrollOrResize,!0),window.addEventListener("resize",this._onScrollOrResize)}disconnectedCallback(){window.removeEventListener("click",this._outsideClick,!0),window.removeEventListener("scroll",this._onScrollOrResize,!0),window.removeEventListener("resize",this._onScrollOrResize),super.disconnectedCallback()}render(){const t=this._displayValue(),e=this._safeDay(this.value),r=this._daysInGrid(),i=this._safeDay(this.min),h=this._safeDay(this.max);return Y.html`
|
|
1
|
+
"use strict";const Y=require("lit"),m=require("lit/decorators.js"),_=require("dayjs"),yt=require("./tailwind-importer-DrTYO1vJ.cjs");function N(p){return p&&p.__esModule&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p}var G={exports:{}},gt=G.exports,ot;function Yt(){return ot||(ot=1,function(p,t){(function(e,r){p.exports=r()})(gt,function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(r,i,h){var s=i.prototype,l=s.format;h.en.formats=e,s.format=function(n){n===void 0&&(n="YYYY-MM-DDTHH:mm:ssZ");var f=this.$locale().formats,o=function(M,g){return M.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(b,B,w){var a=w&&w.toUpperCase();return B||g[w]||e[w]||g[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(u,c,d){return c||d.slice(1)})})}(n,f===void 0?{}:f);return l.call(this,o)}}})}(G)),G.exports}var Mt=Yt();const vt=N(Mt);var V={exports:{}},Dt=V.exports,ht;function wt(){return ht||(ht=1,function(p,t){(function(e,r){p.exports=r()})(Dt,function(){var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,h=/\d\d/,s=/\d\d?/,l=/\d*[^-_:/,()\s\d]+/,n={},f=function(a){return(a=+a)+(a>68?1900:2e3)},o=function(a){return function(u){this[a]=+u}},M=[/[+-]\d\d:?(\d\d)?|Z/,function(a){(this.zone||(this.zone={})).offset=function(u){if(!u||u==="Z")return 0;var c=u.match(/([+-]|\d\d)/g),d=60*c[1]+(+c[2]||0);return d===0?0:c[0]==="+"?-d:d}(a)}],g=function(a){var u=n[a];return u&&(u.indexOf?u:u.s.concat(u.f))},b=function(a,u){var c,d=n.meridiem;if(d){for(var k=1;k<=24;k+=1)if(a.indexOf(d(k,0,u))>-1){c=k>12;break}}else c=a===(u?"pm":"PM");return c},B={A:[l,function(a){this.afternoon=b(a,!1)}],a:[l,function(a){this.afternoon=b(a,!0)}],Q:[i,function(a){this.month=3*(a-1)+1}],S:[i,function(a){this.milliseconds=100*+a}],SS:[h,function(a){this.milliseconds=10*+a}],SSS:[/\d{3}/,function(a){this.milliseconds=+a}],s:[s,o("seconds")],ss:[s,o("seconds")],m:[s,o("minutes")],mm:[s,o("minutes")],H:[s,o("hours")],h:[s,o("hours")],HH:[s,o("hours")],hh:[s,o("hours")],D:[s,o("day")],DD:[h,o("day")],Do:[l,function(a){var u=n.ordinal,c=a.match(/\d+/);if(this.day=c[0],u)for(var d=1;d<=31;d+=1)u(d).replace(/\[|\]/g,"")===a&&(this.day=d)}],w:[s,o("week")],ww:[h,o("week")],M:[s,o("month")],MM:[h,o("month")],MMM:[l,function(a){var u=g("months"),c=(g("monthsShort")||u.map(function(d){return d.slice(0,3)})).indexOf(a)+1;if(c<1)throw new Error;this.month=c%12||c}],MMMM:[l,function(a){var u=g("months").indexOf(a)+1;if(u<1)throw new Error;this.month=u%12||u}],Y:[/[+-]?\d+/,o("year")],YY:[h,function(a){this.year=f(a)}],YYYY:[/\d{4}/,o("year")],Z:M,ZZ:M};function w(a){var u,c;u=a,c=n&&n.formats;for(var d=(a=u.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(A,$,x){var D=x&&x.toUpperCase();return $||c[x]||e[x]||c[D].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(E,C,I){return C||I.slice(1)})})).match(r),k=d.length,L=0;L<k;L+=1){var T=d[L],O=B[T],S=O&&O[0],P=O&&O[1];d[L]=P?{regex:S,parser:P}:T.replace(/^\[|\]$/g,"")}return function(A){for(var $={},x=0,D=0;x<k;x+=1){var E=d[x];if(typeof E=="string")D+=E.length;else{var C=E.regex,I=E.parser,H=A.slice(D),q=C.exec(H)[0];I.call($,q),A=A.replace(q,"")}}return function(z){var R=z.afternoon;if(R!==void 0){var v=z.hours;R?v<12&&(z.hours+=12):v===12&&(z.hours=0),delete z.afternoon}}($),$}}return function(a,u,c){c.p.customParseFormat=!0,a&&a.parseTwoDigitYear&&(f=a.parseTwoDigitYear);var d=u.prototype,k=d.parse;d.parse=function(L){var T=L.date,O=L.utc,S=L.args;this.$u=O;var P=S[1];if(typeof P=="string"){var A=S[2]===!0,$=S[3]===!0,x=A||$,D=S[2];$&&(D=S[2]),n=this.$locale(),!A&&D&&(n=c.Ls[D]),this.$d=function(H,q,z,R){try{if(["x","X"].indexOf(q)>-1)return new Date((q==="X"?1e3:1)*H);var v=w(q)(H),Q=v.year,F=v.month,dt=v.day,pt=v.hours,ft=v.minutes,_t=v.seconds,mt=v.milliseconds,at=v.zone,nt=v.week,X=new Date,J=dt||(Q||F?1:X.getDate()),tt=Q||X.getFullYear(),j=0;Q&&!F||(j=F>0?F-1:X.getMonth());var U,et=pt||0,rt=ft||0,st=_t||0,it=mt||0;return at?new Date(Date.UTC(tt,j,J,et,rt,st,it+60*at.offset*1e3)):z?new Date(Date.UTC(tt,j,J,et,rt,st,it)):(U=new Date(tt,j,J,et,rt,st,it),nt&&(U=R(U).week(nt).toDate()),U)}catch{return new Date("")}}(T,P,O,c),this.init(),D&&D!==!0&&(this.$L=this.locale(D).$L),x&&T!=this.format(P)&&(this.$d=new Date("")),n={}}else if(P instanceof Array)for(var E=P.length,C=1;C<=E;C+=1){S[1]=P[C-1];var I=c.apply(this,S);if(I.isValid()){this.$d=I.$d,this.$L=I.$L,this.init();break}C===E&&(this.$d=new Date(""))}else k.call(this,L)}}})}(V)),V.exports}var xt=wt();const bt=N(xt);var W={exports:{}},kt=W.exports,lt;function Lt(){return lt||(lt=1,function(p,t){(function(e,r){p.exports=r()})(kt,function(){return function(e,r,i){r.prototype.isBetween=function(h,s,l,n){var f=i(h),o=i(s),M=(n=n||"()")[0]==="(",g=n[1]===")";return(M?this.isAfter(f,l):!this.isBefore(f,l))&&(g?this.isBefore(o,l):!this.isAfter(o,l))||(M?this.isBefore(f,l):!this.isAfter(f,l))&&(g?this.isAfter(o,l):!this.isBefore(o,l))}}})}(W)),W.exports}var St=Lt();const Pt=N(St);var Z={exports:{}},$t=Z.exports,ut;function Et(){return ut||(ut=1,function(p,t){(function(e,r){p.exports=r()})($t,function(){var e="week",r="year";return function(i,h,s){var l=h.prototype;l.week=function(n){if(n===void 0&&(n=null),n!==null)return this.add(7*(n-this.week()),"day");var f=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var o=s(this).startOf(r).add(1,r).date(f),M=s(this).endOf(e);if(o.isBefore(M))return 1}var g=s(this).startOf(r).date(f).startOf(e).subtract(1,"millisecond"),b=this.diff(g,e,!0);return b<0?s(this).startOf("week").week():Math.ceil(b)},l.weeks=function(n){return n===void 0&&(n=null),this.week(n)}}})}(Z)),Z.exports}var Ct=Et();const Bt=N(Ct);var K={exports:{}},Ot=K.exports,ct;function At(){return ct||(ct=1,function(p,t){(function(e,r){p.exports=r(_)})(Ot,function(e){function r(s){return s&&typeof s=="object"&&"default"in s?s:{default:s}}var i=r(e),h={name:"tr",weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekStart:1,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(s){return s+"."}};return i.default.locale(h,null,!0),h})}(K)),K.exports}At();var It=Object.defineProperty,zt=Object.getOwnPropertyDescriptor,y=(p,t,e,r)=>{for(var i=r>1?void 0:r?zt(t,e):t,h=p.length-1,s;h>=0;h--)(s=p[h])&&(i=(r?s(t,e,i):s(i))||i);return r&&i&&It(t,e,i),i};_.extend(vt);_.extend(bt);_.extend(Pt);_.extend(Bt);_.locale("tr");exports.LedsDatePicker=class extends Y.LitElement{constructor(){super(...arguments),this.value=null,this.min=null,this.max=null,this.required=!1,this.disabled=!1,this.expandFactor=1.05,this.placeholder="GG/AA/YYYY veya GG.AA.YYYY",this.inputId="dp-"+Math.random().toString(36).slice(2),this.matchInputWidth=!0,this.isBetween=!1,this.disabledDays=[],this._open=!1,this._cursor=this._safeDay(this.value)??_(),this._popupPos=null,this._rangeStart=null,this._rangeEnd=null,this._viewMode="calendar",this._recalcPopupPos=()=>{const t=this.renderRoot.querySelector("#"+this.inputId);if(!t)return;const e=t.getBoundingClientRect(),r=this.renderRoot.querySelector("#"+this.inputId+"-ico"),i=window.innerWidth,h=window.innerHeight,s=8,l=r?r.getBoundingClientRect().left:e.left+e.width;let n=Math.max(0,l-e.left-s);n=Math.round(n*(this.expandFactor||1));const f=Math.round(e.right-e.left-s);let o=Math.min(n,f);o=Math.max(220,o);let M=Math.round(e.left);M+o>i-s&&(M=Math.max(s,Math.round(i-o-s)));const g=Math.max(0,h-(e.bottom+s)-s),b=Math.max(0,e.top-s-s),B=260;let w,a;g>=B||g>=b?(w=Math.round(e.bottom+s),a=Math.max(B,g)):(a=Math.max(B,b),w=Math.max(s,Math.round(e.top-s-a))),this._popupPos={left:M,top:w,width:o,maxH:a}},this._onScrollOrResize=()=>{this._open&&this._recalcPopupPos()},this._outsideClick=t=>{if(this._parseAndSetDate(),!this._open)return;t.composedPath().includes(this)||(this._viewMode="calendar",this._toggleOpen(!1))}}_safeDay(t){if(!t)return null;const r=_(t,["YYYY-MM-DD","DD/MM/YYYY","DD.MM.YYYY","DD MM YYYY","DD-MM-YYYY","DD/MM/YY","DD.MM.YY","DD MM YY","DD-MM-YY","YYYY/MM/DD","YYYY.MM.DD","YYYY MM DD"],!0);return r.isValid()?r:null}_emitChange(t){this.value=t,this.dispatchEvent(new CustomEvent("change",{detail:{value:t}}))}_emitRangeChange(){this._rangeStart&&this._rangeEnd&&this.dispatchEvent(new CustomEvent("rangeChange",{detail:{start:this._rangeStart,end:this._rangeEnd}}))}_toggleOpen(t){if(this.disabled)return;const e=t??!this._open;if(this._open=e,e){const r=this._safeDay(this.value);if(r?this._cursor=r.clone():this._cursor=_(),this.isBetween&&this._rangeStart){const i=this._safeDay(this._rangeStart);i&&(this._cursor=i.clone())}this._viewMode="calendar",this.updateComplete.then(()=>{this._recalcPopupPos(),window.requestAnimationFrame(()=>this._recalcPopupPos())})}}_onInput(t){t.target.value.trim()||(this._emitChange(null),this.isBetween&&(this._rangeStart=null,this._rangeEnd=null)),this._clearInputError()}_onKeydown(t){(t.key==="Tab"||t.key==="Enter")&&this._parseAndSetDate()}_parseAndSetDate(){const t=this.renderRoot.querySelector("#"+this.inputId);if(!t)return;const e=t.value.trim();if(!e){this._emitChange(null),this.isBetween&&(this._rangeStart=null,this._rangeEnd=null);return}const r=["DD/MM/YYYY","DD.MM.YYYY","DD MM YYYY","DD-MM-YYYY","DD/MM/YY","DD.MM.YY","DD MM YY","DD-MM-YY","YYYY-MM-DD","YYYY/MM/DD","YYYY.MM.DD","YYYY MM DD"];let i=null;for(const h of r){const s=_(e,h,!0);if(s.isValid()){i=s;break}}if(!i){const h=_(e);h.isValid()&&(i=h)}i&&this._withinBounds(i)?(this._emitChange(i.format("YYYY-MM-DD")),this._cursor=i,this.isBetween&&(this._rangeStart=null,this._rangeEnd=null),this._clearInputError()):this._showInputError("Geçersiz tarih formatı. Örnek: 19/09/2025, 19.09.2025, 19 09 2025")}_showInputError(t){const e=this.renderRoot.querySelector("#"+this.inputId);e&&(e.classList.add("border-red-500","bg-red-50"),e.classList.remove("border-gray-300"),this._showTooltip(t))}_clearInputError(){const t=this.renderRoot.querySelector("#"+this.inputId);t&&(t.classList.remove("border-red-500","bg-red-50"),t.classList.add("border-gray-300"),this._hideTooltip())}_showTooltip(t){this._hideTooltip();const e=this.renderRoot.querySelector("#"+this.inputId);if(!e)return;const r=document.createElement("div");r.id=this.inputId+"-tooltip",r.className="absolute z-50 px-2 py-1 text-xs text-white bg-red-600 rounded shadow-lg pointer-events-none",r.textContent=t;const i=e.getBoundingClientRect();r.style.left=i.left+"px",r.style.top=i.bottom+5+"px",document.body.appendChild(r),setTimeout(()=>this._hideTooltip(),3e3)}_hideTooltip(){const t=document.getElementById(this.inputId+"-tooltip");t&&t.remove()}_withinBounds(t){const e=this._safeDay(this.min),r=this._safeDay(this.max);return!(e&&t.isBefore(e,"day")||r&&t.isAfter(r,"day")||this.disabledDays.includes(t.day()))}_isInRange(t){if(!this.isBetween||!this._rangeStart||!this._rangeEnd)return null;const e=this._safeDay(this._rangeStart),r=this._safeDay(this._rangeEnd);return!e||!r?null:t.isSame(e,"day")?"start":t.isSame(r,"day")?"end":t.isBetween(e,r,"day","[]")?"between":null}_getDayClasses(t){const e=["relative","h-8","flex","items-center","justify-center","rounded-full","text-sm","transition"];if(!this._withinBounds(t))return this.disabledDays.includes(t.day())?e.push("text-gray-300","cursor-not-allowed","bg-gray-50"):e.push("text-gray-300","cursor-not-allowed"),e.join(" ");if(this.isBetween&&this._rangeStart&&t.isSame(this._safeDay(this._rangeStart),"day"))e.push("bg-primary","text-white");else{const r=this._isInRange(t);r?r==="start"?e.push("bg-primary","text-white","rounded-l-full","rounded-r-none"):r==="end"?e.push("bg-primary","text-white","rounded-r-full","rounded-l-none"):r==="between"&&e.push("bg-primary/20","text-primary","rounded-none"):t.isSame(this._safeDay(this.value),"day")?e.push("bg-primary","text-white"):t.isSame(_(),"day")?e.push("bg-gray-200","text-gray-800"):this.isBetween&&this._rangeStart&&!this._rangeEnd?e.push("hover:bg-primary/10","cursor-pointer"):e.push("hover:bg-gray-100","cursor-pointer")}return e.join(" ")}_select(t){if(this._withinBounds(t))if(this.isBetween)if(!this._rangeStart)this._rangeStart=t.format("YYYY-MM-DD"),this._cursor=t;else if(this._rangeEnd)this._rangeStart=t.format("YYYY-MM-DD"),this._rangeEnd=null,this._cursor=t;else{const e=this._safeDay(this._rangeStart);e&&t.isBefore(e,"day")?(this._rangeEnd=this._rangeStart,this._rangeStart=t.format("YYYY-MM-DD")):this._rangeEnd=t.format("YYYY-MM-DD"),this._cursor=t,this._viewMode="calendar",this._toggleOpen(!1),this._emitRangeChange()}else this._emitChange(t.format("YYYY-MM-DD")),this._cursor=t,this._viewMode="calendar",this._toggleOpen(!1)}_clear(){this._emitChange(null),this.isBetween&&(this._rangeStart=null,this._rangeEnd=null)}_today(){const t=_();this._withinBounds(t)&&this._select(t)}_monthStart(){return this._cursor.startOf("month")}_daysInGrid(){const t=this._monthStart(),e=t.subtract((t.day()+6)%7,"day"),r=[];for(let i=0;i<42;i++)r.push(e.add(i,"day"));return r}_displayValue(){if(this.isBetween&&this._rangeStart&&this._rangeEnd){const e=this._safeDay(this._rangeStart),r=this._safeDay(this._rangeEnd);if(e&&r)return`${e.format("DD/MM/YYYY")} - ${r.format("DD/MM/YYYY")}`}const t=this._safeDay(this.value);return t?t.format("DD/MM/YYYY"):""}_getMonths(){return["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"]}_getYears(){const e=this._cursor.year()-6,r=[];for(let i=0;i<12;i++)r.push(e+i);return r}_selectMonth(t){const e=this._safeDay(this.value)||_(),r=e.clone().month(t);this._cursor=r;const i=Math.min(e.date(),r.daysInMonth()),h=r.date(i);this._select(h),this._viewMode="calendar",this.requestUpdate()}_selectYear(t){const e=this._safeDay(this.value)||_(),r=e.clone().year(t);this._cursor=r;const i=Math.min(e.date(),r.daysInMonth()),h=r.date(i);this._select(h),this._viewMode="month",this.requestUpdate()}_navigateToMonthView(){this._viewMode="month",this.requestUpdate()}_navigateToYearView(){this._viewMode="year",this.requestUpdate()}_getHeaderLabel(){switch(this._viewMode){case"calendar":return this._cursor.format("MMMM YYYY");case"month":return this._cursor.format("YYYY");case"year":{const t=this._getYears();return`${t[0]}-${t[t.length-1]}`}default:return this._cursor.format("MMMM YYYY")}}_navigatePrevious(){switch(this._viewMode){case"calendar":this._cursor=this._cursor.subtract(1,"month");break;case"month":this._cursor=this._cursor.subtract(1,"year");break;case"year":this._cursor=this._cursor.subtract(12,"year");break}this.requestUpdate()}_navigateNext(){switch(this._viewMode){case"calendar":this._cursor=this._cursor.add(1,"month");break;case"month":this._cursor=this._cursor.add(1,"year");break;case"year":this._cursor=this._cursor.add(12,"year");break}this.requestUpdate()}_handleHeaderClick(){switch(this._viewMode){case"calendar":this._navigateToMonthView();break;case"month":this._navigateToYearView();break}}_keydownGrid(t){const e={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7};t.key in e?(t.preventDefault(),this._cursor=this._cursor.add(e[t.key],"day"),this.requestUpdate()):t.key==="Enter"||t.key===" "?(t.preventDefault(),this._select(this._cursor)):t.key==="Escape"?(t.preventDefault(),this._toggleOpen(!1)):t.key==="PageUp"?(t.preventDefault(),this._cursor=this._cursor.subtract(t.shiftKey?1:0,"year").subtract(1,"month")):t.key==="PageDown"?(t.preventDefault(),this._cursor=this._cursor.add(t.shiftKey?1:0,"year").add(1,"month")):t.key==="Home"?(t.preventDefault(),this._cursor=this._cursor.startOf("month")):t.key==="End"&&(t.preventDefault(),this._cursor=this._cursor.endOf("month"))}connectedCallback(){super.connectedCallback(),window.addEventListener("click",this._outsideClick,!0),window.addEventListener("scroll",this._onScrollOrResize,!0),window.addEventListener("resize",this._onScrollOrResize)}disconnectedCallback(){window.removeEventListener("click",this._outsideClick,!0),window.removeEventListener("scroll",this._onScrollOrResize,!0),window.removeEventListener("resize",this._onScrollOrResize),super.disconnectedCallback()}render(){const t=this._displayValue(),e=this._safeDay(this.value),r=this._daysInGrid(),i=this._safeDay(this.min),h=this._safeDay(this.max);return Y.html`
|
|
2
2
|
<div class="logoui-wrapper">
|
|
3
3
|
<div class="inline-block relative">
|
|
4
4
|
<!-- Input -->
|
package/dist/datepicker.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./datepicker-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./datepicker-D7XAq7Bo.cjs");Object.defineProperty(exports,"LedsDatePicker",{enumerable:!0,get:()=>e.LedsDatePicker});
|
package/dist/datepicker.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const l=require("lit"),h=require("lit/decorators.js"),f=require("./tailwind-importer-
|
|
1
|
+
"use strict";const l=require("lit"),h=require("lit/decorators.js"),f=require("./tailwind-importer-DrTYO1vJ.cjs");var w=Object.defineProperty,b=Object.getOwnPropertyDescriptor,g=(p,e,r,s)=>{for(var t=s>1?void 0:s?b(e,r):e,a=p.length-1,n;a>=0;a--)(n=p[a])&&(t=(s?n(e,r,t):n(t))||t);return s&&t&&w(e,r,t),t};exports.DownloadManager=class extends l.LitElement{constructor(){super(...arguments),this.chunkSize=2*1024*1024,this.maxConcurrentDownloads=3,this.maxConcurrentChunks=4,this.downloads=[],this.isAddingFiles=!1,this.activeDownloads=new Map,this.storageKey="download-manager-state"}connectedCallback(){super.connectedCallback(),this.loadState(),this.setupVisibilityChangeHandler()}disconnectedCallback(){super.disconnectedCallback(),this.saveState()}setupVisibilityChangeHandler(){document.addEventListener("visibilitychange",()=>{document.hidden&&this.saveState()})}loadState(){try{const e=globalThis.localStorage.getItem(this.storageKey);if(e){const r=JSON.parse(e);this.downloads=r.downloads||[],this.downloads.forEach(s=>{s.status==="downloading"&&(s.status="paused",console.log(`Download ${s.filename} was active, now paused due to browser restart`)),s.status==="error"&&s.error?.includes("Failed to fetch")&&(s.status="paused",s.error=void 0,console.log(`Reset error state for ${s.filename} due to browser restart`))})}}catch(e){console.error("Failed to load download state:",e)}}saveState(){try{const e={downloads:this.downloads.map(r=>({...r,status:r.status==="downloading"?"paused":r.status}))};globalThis.localStorage.setItem(this.storageKey,JSON.stringify(e))}catch(e){console.error("Failed to save download state:",e)}}async getFileSize(e){try{const r=await globalThis.fetch(e,{method:"HEAD",mode:"cors",credentials:"omit",signal:globalThis.AbortSignal.timeout(1e4)});if(r.ok){const s=r.headers.get("content-length");if(s){const t=parseInt(s);if(!isNaN(t)&&t>0)return t}}try{const s=await globalThis.fetch(e,{method:"GET",headers:{Range:"bytes=0-0"},mode:"cors",credentials:"omit",signal:globalThis.AbortSignal.timeout(1e4)});if(s.ok){const t=s.headers.get("content-range");if(t){const n=t.match(/\/(\d+)/);if(n){const d=parseInt(n[1]);if(!isNaN(d)&&d>0)return d}}const a=s.headers.get("content-length");if(a){const n=parseInt(a);if(!isNaN(n)&&n>0)return n}}}catch(s){console.warn("Range request also failed:",s)}return 0}catch(r){return r instanceof Error?r.name==="AbortError"?console.warn("File size request timed out for:",e):r.message.includes("ERR_EMPTY_RESPONSE")||(r.message.includes("ERR_NETWORK")?console.warn("Network error while getting file size:",e):r.message.includes("Failed to fetch")||console.warn("Failed to get file size:",r.message)):console.warn("Unknown error while getting file size:",r),0}}createChunks(e){const r=[];if(e===0)r.push({start:0,end:this.chunkSize-1,downloaded:0,status:"pending"});else for(let s=0;s<e;s+=this.chunkSize){const t=Math.min(s+this.chunkSize-1,e-1);r.push({start:s,end:t,downloaded:0,status:"pending"})}return r}async downloadChunk(e,r){const s=new globalThis.AbortController;try{const t=r.end>r.start?`bytes=${r.start+r.downloaded}-${r.end}`:`bytes=${r.start+r.downloaded}-`,a=await globalThis.fetch(e,{headers:{Range:t},signal:globalThis.AbortSignal.any([s.signal,globalThis.AbortSignal.timeout(6e4)]),mode:"cors",credentials:"omit"});if(!a.ok){if(a.status===416)return{data:new Uint8Array(0),isComplete:!0};throw new Error(`HTTP ${a.status}: ${a.statusText}`)}const n=await a.arrayBuffer(),d=new Uint8Array(n),o=a.headers.get("content-range");let c=!1,i;if(o){const u=o.match(/\/(\d+)/);if(u){i=parseInt(u[1]);const m=o.match(/(\d+)-(\d+)/);m&&(c=parseInt(m[2])>=i-1)}}else d.length===0&&(c=!0);return{data:d,isComplete:c,actualSize:i}}catch(t){if(t instanceof Error){if(t.name==="AbortError")throw t;if(t.message.includes("ERR_EMPTY_RESPONSE"))throw new Error("Server returned empty response - connection may be unstable");if(t.message.includes("ERR_NETWORK"))throw new Error("Network error - check your connection");if(t.message.includes("ERR_TIMED_OUT"))throw new Error("Request timed out - server may be slow")}throw new Error(`Chunk download failed: ${t instanceof Error?t.message:"Unknown error"}`)}}async downloadFile(e){const r=new globalThis.AbortController;this.activeDownloads.set(e.id,r);try{e.status="downloading",e.startTime=Date.now(),this.requestUpdate();const s=e.chunks.filter(o=>o.status==="pending"),t=new Set,a=async o=>{const c=e.chunks[o];if(!(!c||c.status!=="pending")){c.status="downloading",t.add(o),this.requestUpdate();try{if(e.status!=="downloading"){console.log(`Download paused, stopping chunk ${o}`);return}const i=await this.downloadChunk(e.url,c);if(e.status!=="downloading"){console.log(`Download paused after chunk ${o}`);return}if(c.downloaded=i.data.length,c.status="completed",e.downloaded+=c.downloaded,i.actualSize&&e.size===0&&(e.size=i.actualSize,e.size>this.chunkSize)){const u=this.createChunks(e.size).slice(1);e.chunks.push(...u)}t.delete(o),this.requestUpdate(),this.saveState(),(i.isComplete||e.chunks.every(u=>u.status==="completed"))&&(e.status="completed",e.endTime=Date.now(),this.requestUpdate(),this.saveState())}catch(i){c.status="error",t.delete(o),console.warn(`Chunk ${o} failed:`,i),e.chunks.filter(u=>u.status==="error").length===e.chunks.length&&(e.status="error",e.error=i instanceof Error?i.message:"All chunks failed"),this.requestUpdate(),this.saveState()}await new Promise(i=>setTimeout(i,1))}},n=[];let d=0;for(;d<s.length||t.size>0;){if(e.status!=="downloading"){console.log("Download paused, stopping main loop");break}for(;t.size<this.maxConcurrentChunks&&d<s.length&&e.status==="downloading";){const o=a(d);n.push(o),d++}if(t.size>0)try{await Promise.race([Promise.race(n),new Promise(o=>setTimeout(o,100))])}catch(o){console.warn("Chunk download error:",o)}await new Promise(o=>setTimeout(o,10))}}catch(s){(!(s instanceof Error)||s.name!=="AbortError")&&(e.status="error",e.error=s instanceof Error?s.message:"Unknown error",this.requestUpdate())}finally{this.activeDownloads.delete(e.id),this.saveState()}}pauseDownload(e){const r=this.activeDownloads.get(e);r&&(r.abort(),this.activeDownloads.delete(e));const s=this.downloads.find(t=>t.id===e);s&&s.status==="downloading"&&(s.status="paused",this.requestUpdate(),this.saveState(),console.log(`Download paused: ${s.filename}`))}resumeDownload(e){const r=this.downloads.find(s=>s.id===e);r&&r.status==="paused"&&this.downloadFile(r)}removeDownload(e){this.pauseDownload(e),this.downloads=this.downloads.filter(r=>r.id!==e),this.requestUpdate(),this.saveState()}clearCompleted(){this.downloads=this.downloads.filter(e=>e.status!=="completed"),this.requestUpdate(),this.saveState()}formatBytes(e){if(e===0)return"0 Bytes";const r=1024,s=["Bytes","KB","MB","GB"],t=Math.floor(Math.log(e)/Math.log(r));return parseFloat((e/Math.pow(r,t)).toFixed(2))+" "+s[t]}formatDuration(e){const r=Math.floor(e/1e3),s=Math.floor(r/60),t=Math.floor(s/60);return t>0?`${t}h ${s%60}m ${r%60}s`:s>0?`${s}m ${r%60}s`:`${r}s`}getProgressPercentage(e){return e.size===0?e.status==="completed"?100:0:Math.round(e.downloaded/e.size*100)}getDownloadSpeed(e){if(!e.startTime)return"0 KB/s";const r=(Date.now()-e.startTime)/1e3;if(r===0)return"0 KB/s";const s=e.downloaded/r;return this.formatBytes(s)+"/s"}getETA(e){if(!e.startTime||e.downloaded===0||e.size===0)return"Unknown";const r=(Date.now()-e.startTime)/1e3,s=e.downloaded/r,a=(e.size-e.downloaded)/s;return this.formatDuration(a*1e3)}async addDownload(e,r){try{this.isAddingFiles=!0,this.requestUpdate();try{new globalThis.URL(e)}catch{throw new Error("Invalid URL format")}const s=await this.getFileSize(e),a={id:`download_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,url:e,filename:r||e.split("/").pop()||"unknown",size:s,downloaded:0,status:"pending",chunks:this.createChunks(s)};this.downloads.push(a),this.requestUpdate(),this.saveState(),this.downloadFile(a)}catch(s){console.error("Failed to add download:",s);const t=s instanceof Error?s.message:"Unknown error occurred",a={id:`error_${Date.now()}`,url:e,filename:r||e.split("/").pop()||"unknown",size:0,downloaded:0,status:"error",chunks:[],error:t};this.downloads.push(a),this.requestUpdate(),this.saveState()}finally{this.isAddingFiles=!1,this.requestUpdate()}}handleAddDownload(e){e.preventDefault();const r=e.target,s=new globalThis.FormData(r),t=s.get("url"),a=s.get("filename");if(!t||t.trim()==="")return;const n=this.downloads.find(d=>d.url===t.trim());if(n&&n.status!=="error"){console.warn("Download already exists for this URL");return}this.addDownload(t.trim(),a?.trim()||void 0),r.reset()}render(){const e=this.downloads.filter(t=>t.status==="downloading").length,r=this.downloads.filter(t=>t.status==="completed").length,s=this.downloads.filter(t=>t.status==="paused").length;return l.html`
|
|
2
2
|
<div class="logoui-wrapper">
|
|
3
3
|
<div class="w-full max-w-4xl mx-auto p-6 bg-white rounded-lg shadow-lg">
|
|
4
4
|
<!-- Header -->
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { css as w, LitElement as b, html as c } from "lit";
|
|
2
2
|
import { property as p, state as f, customElement as v } from "lit/decorators.js";
|
|
3
|
-
import { t as y } from "./tailwind-importer-
|
|
3
|
+
import { t as y } from "./tailwind-importer-BWVGBePx.js";
|
|
4
4
|
var x = Object.defineProperty, $ = Object.getOwnPropertyDescriptor, g = (e, r, s, t) => {
|
|
5
5
|
for (var a = t > 1 ? void 0 : t ? $(r, s) : r, n = e.length - 1, i; n >= 0; n--)
|
|
6
6
|
(i = e[n]) && (a = (t ? i(r, s, a) : i(a)) || a);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./download-manager-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./download-manager-ByHcedTM.cjs");Object.defineProperty(exports,"DownloadManager",{enumerable:!0,get:()=>e.DownloadManager});
|
package/dist/download-manager.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { css as X, LitElement as Z, html as E } from "lit";
|
|
2
2
|
import { property as A, state as D, customElement as Y } from "lit/decorators.js";
|
|
3
|
-
import { t as G } from "./tailwind-importer-
|
|
3
|
+
import { t as G } from "./tailwind-importer-BWVGBePx.js";
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
* Copyright 2017 Google LLC
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const f=require("lit"),p=require("lit/decorators.js"),Z=require("./tailwind-importer-
|
|
1
|
+
"use strict";const f=require("lit"),p=require("lit/decorators.js"),Z=require("./tailwind-importer-DrTYO1vJ.cjs");/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
package/dist/formfield.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./formfield-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./formfield-Dv-toh_b.cjs");Object.defineProperty(exports,"FormField",{enumerable:!0,get:()=>e.FormField});
|
package/dist/formfield.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./button-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./button-Fv9_uRXu.cjs"),p=require("./modal-kt1BGhsl.cjs"),d=require("./checkbox-j5rJhSeO.cjs"),g=require("./switch-D_sHsqbh.cjs"),b=require("./card-BE-j77vi.cjs"),h=require("./breadcrumb-DZe_r3qQ.cjs"),m=require("./formfield-Dv-toh_b.cjs"),y=require("./input-BfxT3lT0.cjs"),f=require("./combobox-CWR1wuO9.cjs"),x=require("./text-area-BPPge84R.cjs"),C=require("./datepicker-D7XAq7Bo.cjs"),P=require("./download-manager-ByHcedTM.cjs"),n=require("lit"),t=require("lit/decorators.js"),B=require("./tailwind-importer-DrTYO1vJ.cjs"),v=require("./chatbot-yKC2ZfxJ.cjs");var L=Object.defineProperty,O=Object.getOwnPropertyDescriptor,r=(i,o,a,s)=>{for(var e=s>1?void 0:s?O(o,a):o,u=i.length-1,l;u>=0;u--)(l=i[u])&&(e=(s?l(o,a,e):l(e))||e);return s&&e&&L(o,a,e),e};exports.LogosphereBadge=class extends n.LitElement{constructor(){super(...arguments),this.variant="default",this.size="default",this.text="",this.closeable=!1,this.isRound=!1}handleClose(){this.onClose&&this.onClose(),this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}getVariantClasses(){switch(this.variant){case"warning":return"bg-warning-rgb text-warning-text-emphasis";case"success":return"bg-success-rgb text-success-text-emphasis";case"info":return"bg-info-rgb text-info-text-emphasis";case"danger":return"bg-danger-rgb text-danger-text-emphasis";case"default":default:return"bg-light text-secondary"}}getSizeClasses(){switch(this.size){case"small":return"px-1 py-0";case"default":default:return"px-2 py-1"}}getBorderRadiusClass(){return this.isRound?"rounded-[12px]":"rounded-[8px]"}render(){const o=this.getVariantClasses(),a=this.getSizeClasses(),s=this.getBorderRadiusClass();return n.html`
|
|
2
2
|
<div class="logoui-wrapper">
|
|
3
3
|
<div
|
|
4
4
|
class="inline-flex items-center gap-1 ${s} ${o} ${a}"
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { B as w } from "./button-
|
|
2
|
-
import { M as S } from "./modal-
|
|
3
|
-
import { C as $ } from "./checkbox-
|
|
4
|
-
import { S as R } from "./switch-
|
|
5
|
-
import { C as D } from "./card-
|
|
6
|
-
import { B as E } from "./breadcrumb-
|
|
7
|
-
import { F } from "./formfield-
|
|
8
|
-
import { L as T } from "./input-
|
|
9
|
-
import { C as V } from "./combobox-
|
|
10
|
-
import { T as I } from "./text-area-
|
|
11
|
-
import { L as q } from "./datepicker-
|
|
12
|
-
import { D as H } from "./download-manager-
|
|
1
|
+
import { B as w } from "./button-YzOUufoq.js";
|
|
2
|
+
import { M as S } from "./modal-BWmeyvnc.js";
|
|
3
|
+
import { C as $ } from "./checkbox-GVt-6O_u.js";
|
|
4
|
+
import { S as R } from "./switch-j3vl1bwf.js";
|
|
5
|
+
import { C as D } from "./card-SzuoXbSC.js";
|
|
6
|
+
import { B as E } from "./breadcrumb-C67DoTnK.js";
|
|
7
|
+
import { F } from "./formfield-Bz1d7fWp.js";
|
|
8
|
+
import { L as T } from "./input-CbvdySAR.js";
|
|
9
|
+
import { C as V } from "./combobox-zTfdwhDN.js";
|
|
10
|
+
import { T as I } from "./text-area-wmQG4Qsh.js";
|
|
11
|
+
import { L as q } from "./datepicker-B6WBpjSd.js";
|
|
12
|
+
import { D as H } from "./download-manager-KMIqWika.js";
|
|
13
13
|
import { LitElement as d, nothing as u, html as c } from "lit";
|
|
14
14
|
import { property as r, customElement as h } from "lit/decorators.js";
|
|
15
|
-
import { t as f } from "./tailwind-importer-
|
|
16
|
-
import { L as K } from "./chatbot-
|
|
15
|
+
import { t as f } from "./tailwind-importer-BWVGBePx.js";
|
|
16
|
+
import { L as K } from "./chatbot-5rZ2PaDM.js";
|
|
17
17
|
var m = Object.defineProperty, x = Object.getOwnPropertyDescriptor, s = (i, o, a, n) => {
|
|
18
18
|
for (var t = n > 1 ? void 0 : n ? x(o, a) : o, l = i.length - 1, p; l >= 0; l--)
|
|
19
19
|
(p = i[l]) && (t = (n ? p(o, a, t) : p(t)) || t);
|