@lazhus/kg-ui 0.7.0 → 0.7.2

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.
@@ -853,7 +853,7 @@
853
853
  ],
854
854
  "superclass": {
855
855
  "name": "LitElement",
856
- "module": "src/components/kg-colorpicker.js"
856
+ "package": "lit"
857
857
  },
858
858
  "tagName": "kg-colorpicker",
859
859
  "customElement": true
@@ -1528,7 +1528,7 @@
1528
1528
  ],
1529
1529
  "superclass": {
1530
1530
  "name": "LitElement",
1531
- "module": "src/components/kg-datepicker.js"
1531
+ "package": "lit"
1532
1532
  },
1533
1533
  "tagName": "kg-datepicker",
1534
1534
  "customElement": true
@@ -2938,7 +2938,7 @@
2938
2938
  ],
2939
2939
  "superclass": {
2940
2940
  "name": "LitElement",
2941
- "module": "src/components/kg-radio-group.js"
2941
+ "package": "lit"
2942
2942
  },
2943
2943
  "tagName": "kg-radio-group",
2944
2944
  "customElement": true
@@ -3548,7 +3548,7 @@
3548
3548
  ],
3549
3549
  "superclass": {
3550
3550
  "name": "LitElement",
3551
- "module": "src/components/kg-slider.js"
3551
+ "package": "lit"
3552
3552
  },
3553
3553
  "tagName": "kg-slider",
3554
3554
  "customElement": true
@@ -0,0 +1 @@
1
+ import{isServer as t}from"lit";const e=e=>class extends e{static get properties(){return{name:{type:String},value:{type:String},disabled:{type:Boolean,reflect:!0},required:{type:Boolean,reflect:!0},type:{type:String}}}static get formAssociated(){return!0}constructor(){super(),this.name="",this.value="",this.disabled=!1,this.required=!1,this.type="text",!t&&this.attachInternals&&(this.internals=this.attachInternals())}get form(){return this.internals?this.internals.form:null}updated(t){super.updated(t),(t.has("value")||t.has("disabled"))&&this._updateFormValue()}_updateFormValue(){!t&&this.internals&&this.internals.setFormValue(this.value)}formResetCallback(){this.value=this.getAttribute("value")||""}formStateRestoreCallback(t){this.value=t}setValidity(e,i,s){!t&&this.internals&&this.internals.setValidity(e,i,s)}checkValidity(){return!this.internals||this.internals.checkValidity()}reportValidity(){return!this.internals||this.internals.reportValidity()}};export{e as F};
@@ -1,4 +1,4 @@
1
- var t=Object.defineProperty,o=(o,r,e)=>((o,r,e)=>r in o?t(o,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[r]=e)(o,"symbol"!=typeof r?r+"":r,e);import{css as r,html as e,LitElement as a}from"lit";import{classMap as i}from"lit/directives/class-map.js";import{F as n}from"../chunks/FormAssociated-Ca1JavvX.js";class s extends(n(a)){constructor(){super(),this.color="",this.size="medium",this.hasText=!1,this.hasLeft=!1,this.hasRight=!1,this.type="button"}_handleSlotChange(t){const o=t.target,r=o.assignedNodes({flatten:!0}).filter(t=>t.nodeType===Node.ELEMENT_NODE||t.nodeType===Node.TEXT_NODE&&t.textContent.trim().length>0).length>0;o.name?"left"===o.name?this.hasLeft=r:"right"===o.name&&(this.hasRight=r):this.hasText=r}render(){const t=["primary","secondary","tertiary","error"].includes(this.color),o=this.color&&!t,r=!this.hasText&&(this.hasLeft||this.hasRight),a={[this.color]:t,"custom-color":o,[this.size]:!!this.size,fullwidth:this.fullwidth,circular:this.circular,square:this.square,loading:this.loading,basic:this.basic,text:this.text,inverted:this.inverted,disabled:this.disabled,"icon-only":r},n=o?`border: none; --kg-custom-color: ${this.color};`:"";return e`
1
+ var t=Object.defineProperty,o=(o,r,e)=>((o,r,e)=>r in o?t(o,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[r]=e)(o,"symbol"!=typeof r?r+"":r,e);import{css as r,html as e,LitElement as a}from"lit";import{classMap as i}from"lit/directives/class-map.js";import{F as n}from"../chunks/FormAssociated-DT543PBW.js";class s extends(n(a)){constructor(){super(),this.color="",this.size="medium",this.hasText=!1,this.hasLeft=!1,this.hasRight=!1,this.type="button"}_handleSlotChange(t){const o=t.target,r=o.assignedNodes({flatten:!0}).filter(t=>t.nodeType===Node.ELEMENT_NODE||t.nodeType===Node.TEXT_NODE&&t.textContent.trim().length>0).length>0;o.name?"left"===o.name?this.hasLeft=r:"right"===o.name&&(this.hasRight=r):this.hasText=r}render(){const t=["primary","secondary","tertiary","error"].includes(this.color),o=this.color&&!t,r=!this.hasText&&(this.hasLeft||this.hasRight),a={[this.color]:t,"custom-color":o,[this.size]:!!this.size,fullwidth:this.fullwidth,circular:this.circular,square:this.square,loading:this.loading,basic:this.basic,text:this.text,inverted:this.inverted,disabled:this.disabled,"icon-only":r},n=o?`border: none; --kg-custom-color: ${this.color};`:"";return e`
2
2
  <button
3
3
  class="${i(a)}"
4
4
  style="${n}"
@@ -1,4 +1,4 @@
1
- var e=Object.defineProperty,t=(t,r,c)=>((t,r,c)=>r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:c}):t[r]=c)(t,"symbol"!=typeof r?r+"":r,c);import{LitElement as r,css as c,html as i}from"lit";import{classMap as o}from"lit/directives/class-map.js";import{F as a}from"../chunks/FormAssociated-Ca1JavvX.js";class s extends(a(r)){constructor(){super(),this.checked=!1,this.indeterminate=!1,this.value="on"}formResetCallback(){this.checked=this.hasAttribute("checked"),this._updateFormValue()}formStateRestoreCallback(e){"checked"===e?this.checked=!0:"unchecked"===e&&(this.checked=!1),this._updateFormValue()}updated(e){e.has("checked")&&this._updateFormValue(),super.updated(e)}_updateFormValue(){const e=this.checked?this.value||"on":null;this.internals.setFormValue(e,this.checked?"checked":"unchecked"),this.required&&!this.checked?this.internals.setValidity({valueMissing:!0},"Please check this box.",this.shadowRoot.querySelector(".checkbox-box")):this.internals.setValidity({})}toggle(){this.disabled||(this.checked=!this.checked,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("change",{detail:{checked:this.checked},bubbles:!0,composed:!0})))}render(){const e=`--checkbox-active-color: ${r=this.color,r?r.startsWith("#")||r.startsWith("rgb")||r.startsWith("hsl")?r:{primary:"var(--kg-primary)",secondary:"var(--kg-secondary)",tertiary:"var(--kg-tertiary)",error:"#e74c3c",red:"#e74c3c",green:"#2ecc71",blue:"#3498db",orange:"#f39c12",purple:"#9b59b6"}[r]||`var(--kg-${r}, ${r})`:"var(--kg-primary)"};`,t={"kg-checkbox-container":!0,checked:this.checked,disabled:this.disabled,indeterminate:this.indeterminate};var r;return i`
1
+ var e=Object.defineProperty,t=(t,r,c)=>((t,r,c)=>r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:c}):t[r]=c)(t,"symbol"!=typeof r?r+"":r,c);import{LitElement as r,css as c,html as i}from"lit";import{classMap as o}from"lit/directives/class-map.js";import{F as a}from"../chunks/FormAssociated-DT543PBW.js";class s extends(a(r)){constructor(){super(),this.checked=!1,this.indeterminate=!1,this.value="on"}formResetCallback(){this.checked=this.hasAttribute("checked"),this._updateFormValue()}formStateRestoreCallback(e){"checked"===e?this.checked=!0:"unchecked"===e&&(this.checked=!1),this._updateFormValue()}updated(e){e.has("checked")&&this._updateFormValue(),super.updated(e)}_updateFormValue(){const e=this.checked?this.value||"on":null;this.internals.setFormValue(e,this.checked?"checked":"unchecked"),this.required&&!this.checked?this.internals.setValidity({valueMissing:!0},"Please check this box.",this.shadowRoot.querySelector(".checkbox-box")):this.internals.setValidity({})}toggle(){this.disabled||(this.checked=!this.checked,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("change",{detail:{checked:this.checked},bubbles:!0,composed:!0})))}render(){const e=`--checkbox-active-color: ${r=this.color,r?r.startsWith("#")||r.startsWith("rgb")||r.startsWith("hsl")?r:{primary:"var(--kg-primary)",secondary:"var(--kg-secondary)",tertiary:"var(--kg-tertiary)",error:"#e74c3c",red:"#e74c3c",green:"#2ecc71",blue:"#3498db",orange:"#f39c12",purple:"#9b59b6"}[r]||`var(--kg-${r}, ${r})`:"var(--kg-primary)"};`,t={"kg-checkbox-container":!0,checked:this.checked,disabled:this.disabled,indeterminate:this.indeterminate};var r;return i`
2
2
  <div
3
3
  class="${o(t)}"
4
4
  style="${e}"
@@ -1,6 +1,6 @@
1
- var e=Object.defineProperty,o=(o,t,i)=>((o,t,i)=>t in o?e(o,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):o[t]=i)(o,"symbol"!=typeof t?t+"":t,i);import{F as t}from"../chunks/FormAssociated-Ca1JavvX.js";class i extends(t(LitElement)){constructor(){super(),this.value="#1367FF",this.open=!1,this._presets=["#1367FF","#FF0000","#00FF00","#FFA500","#800080","#000000","#FFFFFF","#808080","#FFC0CB","#00FFFF","#FFFF00","#A52A2A","#3498db","#2ecc71","#e74c3c","#f1c40f","#9b59b6","#34495e"],this._handleOutsideClick=this._handleOutsideClick.bind(this)}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleOutsideClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleOutsideClick)}_handleOutsideClick(e){this.open&&!e.composedPath().includes(this)&&(this.open=!1)}_togglePopup(e){e&&e.stopPropagation(),this.open=!this.open}_selectColor(e){this.value=e,this._dispatchChange()}_handleInput(e){this.value=e.target.value,this._dispatchChange()}_dispatchChange(){this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))}render(){return html`
1
+ var e=Object.defineProperty,o=(o,i,r)=>((o,i,r)=>i in o?e(o,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[i]=r)(o,"symbol"!=typeof i?i+"":i,r);import{LitElement as i,css as r,html as t}from"lit";import{F as s}from"../chunks/FormAssociated-DT543PBW.js";class a extends(s(i)){constructor(){super(),this.value="#1367FF",this.open=!1,this._presets=["#1367FF","#FF0000","#00FF00","#FFA500","#800080","#000000","#FFFFFF","#808080","#FFC0CB","#00FFFF","#FFFF00","#A52A2A","#3498db","#2ecc71","#e74c3c","#f1c40f","#9b59b6","#34495e"],this._handleOutsideClick=this._handleOutsideClick.bind(this)}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleOutsideClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleOutsideClick)}_handleOutsideClick(e){this.open&&!e.composedPath().includes(this)&&(this.open=!1)}_togglePopup(e){e&&e.stopPropagation(),this.open=!this.open}_selectColor(e){this.value=e,this._dispatchChange()}_handleInput(e){this.value=e.target.value,this._dispatchChange()}_dispatchChange(){this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))}render(){return t`
2
2
  <div class="kg-color-container ${this.disabled?"disabled":""}" style="position: relative;">
3
- ${this.label?html`<span class="label-text">${this.label}</span>`:""}
3
+ ${this.label?t`<span class="label-text">${this.label}</span>`:""}
4
4
 
5
5
  <div class="picker-trigger" @click="${this._togglePopup}">
6
6
  <div class="color-swatch" style="background-color: ${this.value}"></div>
@@ -9,7 +9,7 @@ var e=Object.defineProperty,o=(o,t,i)=>((o,t,i)=>t in o?e(o,t,{enumerable:!0,con
9
9
 
10
10
  <div class="picker-popup ${this.open?"open":""}" @click="${e=>e.stopPropagation()}">
11
11
  <div class="swatch-grid">
12
- ${this._presets.map(e=>html`
12
+ ${this._presets.map(e=>t`
13
13
  <div
14
14
  class="preset-swatch"
15
15
  style="background-color: ${e}"
@@ -31,7 +31,7 @@ var e=Object.defineProperty,o=(o,t,i)=>((o,t,i)=>t in o?e(o,t,{enumerable:!0,con
31
31
  </div>
32
32
  </div>
33
33
  </div>
34
- `}}o(i,"properties",{label:{type:String},open:{type:Boolean}}),o(i,"styles",css`
34
+ `}}o(a,"properties",{label:{type:String},open:{type:Boolean}}),o(a,"styles",r`
35
35
  :host {
36
36
  display: inline-block;
37
37
  font-family: inherit;
@@ -173,4 +173,4 @@ var e=Object.defineProperty,o=(o,t,i)=>((o,t,i)=>t in o?e(o,t,{enumerable:!0,con
173
173
  opacity: 0.5;
174
174
  pointer-events: none;
175
175
  }
176
- `),"undefined"==typeof customElements||customElements.get("kg-colorpicker")||customElements.define("kg-colorpicker",i);export{i as kgcolorpicker};
176
+ `),"undefined"==typeof customElements||customElements.get("kg-colorpicker")||customElements.define("kg-colorpicker",a);export{a as kgcolorpicker};
@@ -1,29 +1,29 @@
1
- var e=Object.defineProperty,t=(t,a,s)=>((t,a,s)=>a in t?e(t,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[a]=s)(t,"symbol"!=typeof a?a+"":a,s);import{F as a}from"../chunks/FormAssociated-Ca1JavvX.js";class s extends(a(LitElement)){constructor(){super(),this.open=!1,this.disabled=!1,this.mode="date",this.locale="tr-TR",this.placeholder="Tarih seçiniz...",this.min="",this.max="",this._viewDate=/* @__PURE__ */new Date,this.value="",this._handleOutsideClick=this._handleOutsideClick.bind(this)}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleOutsideClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleOutsideClick)}_handleOutsideClick(e){this.open&&!e.composedPath().includes(this)&&(this.open=!1)}togglePopup(e){e&&e.stopPropagation(),this.disabled||(this.open=!this.open)}_handleInputKeydown(e){["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","Home","End"].includes(e.key)||(e.ctrlKey||e.metaKey)&&["a","c","v","x"].includes(e.key.toLowerCase())||/^\d$/.test(e.key)||e.preventDefault()}_getDateFormat(){const e=new Date(2023,11,31),t=new Intl.DateTimeFormat(this.locale).formatToParts(e),a=t.filter(e=>"literal"!==e.type).map(e=>e.type),s=t.find(e=>"literal"===e.type);let i=s?s.value:".";return i=i.includes(".")?".":i.includes("/")?"/":i.includes("-")?"-":".",{parts:a,separator:i}}_handleManualInput(e){let t=e.detail.value;t=t.replace(/\D/g,"");const{parts:a,separator:s}=this._getDateFormat(),i="year"===a[0];let r="";if(t.length>0&&(i?t.length<=4?r=t:t.length<=6?r=`${t.slice(0,4)}${s}${t.slice(4)}`:t.length<=8&&(r=`${t.slice(0,4)}${s}${t.slice(4,6)}${s}${t.slice(6)}`):t.length<=2?r=t:t.length<=4?r=`${t.slice(0,2)}${s}${t.slice(2)}`:t.length<=8&&(r=`${t.slice(0,2)}${s}${t.slice(2,4)}${s}${t.slice(4)}`),this.showTime&&t.length>8)){const e=r,a=t.slice(8);r=a.length<=2?`${e} ${a}`:`${e} ${a.slice(0,2)}:${a.slice(2,4)}`}if(t.length>=8){let e,n,o;if(i)o=parseInt(t.slice(0,4)),n=parseInt(t.slice(4,6)),e=parseInt(t.slice(6,8));else{const s=parseInt(t.slice(0,2)),i=parseInt(t.slice(2,4)),r=parseInt(t.slice(4,8));"day"===a[0]?(e=s,n=i,o=r):(n=s,e=i,o=r)}e>31&&(e=31),0===e&&(e=1),n>12&&(n=12),0===n&&(n=1),o>2100&&(o=2100);const l=String(e).padStart(2,"0"),c=String(n).padStart(2,"0"),d=String(o);if(r=i?`${d}${s}${c}${s}${l}`:"day"===a[0]?`${l}${s}${c}${s}${d}`:`${c}${s}${l}${s}${d}`,this.showTime&&t.length>8){r.split(" ")[1];let e=parseInt(t.slice(8,10)||"0"),a=parseInt(t.slice(10,12)||"0");e>23&&(e=23),a>59&&(a=59);const s=String(e).padStart(2,"0"),i=String(a).padStart(2,"0");t.length<=10?r+=` ${s}`:r+=` ${s}:${i}`}}if(this.value=r||t,this.value.length>=8){const e=this.value.split(" ")[0].split(s);if(this.value.split(" ")[1]?.split(":"),3===e.length){let e,t,a;if(i){"year"===currentParts[0]?(a=parseInt(dateComponents[0]),t=parseInt(dateComponents[1]),e=parseInt(dateComponents[2])):"day"===currentParts[0]?(e=parseInt(dateComponents[0]),t=parseInt(dateComponents[1]),a=parseInt(dateComponents[2])):(t=parseInt(dateComponents[0]),e=parseInt(dateComponents[1]),a=parseInt(dateComponents[2]));let s=0,i=0;if(timePartStr){const e=timePartStr.split(":");e.length>=2&&(s=parseInt(e[0]),i=parseInt(e[1]))}if(a>999){let r=new Date(a,t-1,e,s,i);if(!isNaN(r.getTime())){if(this.min){const e=this._parseDateStr(this.min);e&&new Date(r.getFullYear(),r.getMonth(),r.getDate())<new Date(e.getFullYear(),e.getMonth(),e.getDate())&&(r=new Date(e))}if(this.max){const e=this._parseDateStr(this.max);e&&new Date(r.getFullYear(),r.getMonth(),r.getDate())>new Date(e.getFullYear(),e.getMonth(),e.getDate())&&(r=new Date(e))}this._viewDate=r,this._selectedDate=r;const e=this._formatValue(r);this.value!==e&&(this.value=e),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value,date:this._selectedDate},bubbles:!0,composed:!0}))}}}}}}_changeMonth(e){const t=new Date(this._viewDate);t.setMonth(t.getMonth()+e),this._viewDate=t}_setViewMonth(e){const t=new Date(this._viewDate);t.setMonth(parseInt(e)),this._viewDate=t}_setViewYear(e){const t=new Date(this._viewDate);t.setFullYear(parseInt(e)),this._viewDate=t}_setTime(e,t){const a=new Date(this._viewDate);if("hour"===e&&a.setHours(parseInt(t)),"minute"===e&&a.setMinutes(parseInt(t)),this._viewDate=a,this._selectedDate){const a=new Date(this._selectedDate);"hour"===e&&a.setHours(parseInt(t)),"minute"===e&&a.setMinutes(parseInt(t)),this._selectedDate=a,this.value=this._formatValue(a)}}_formatValue(e){if(!e)return"";const{separator:t,parts:a}=this._getDateFormat(),s=String(e.getDate()).padStart(2,"0"),i=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getFullYear());let n="";return n="year"===a[0]?`${r}${t}${i}${t}${s}`:"day"===a[0]?`${s}${t}${i}${t}${r}`:`${i}${t}${s}${t}${r}`,"year"===this.mode?String(r):"month"===this.mode?`${i}${t}${r}`:(this.showTime&&(n+=` ${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`),n)}_handleToday(e){e&&e.stopPropagation();const t=/* @__PURE__ */new Date;this._viewDate=t,this._selectDate(t.getDate(),!0)}_handleDone(e){e&&e.stopPropagation(),this.open=!1}_handleKeydown(e){if(!this.open)return void("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.open=!0));if("Escape"===e.key)return void(this.open=!1);const t=new Date(this._viewDate);let a=!0;switch(e.key){case"ArrowLeft":t.setDate(t.getDate()-1);break;case"ArrowRight":t.setDate(t.getDate()+1);break;case"ArrowUp":t.setDate(t.getDate()-7);break;case"ArrowDown":t.setDate(t.getDate()+7);break;case"Enter":const e=new Date(this._viewDate);this._isDisabled(e)||this._selectDate(this._viewDate.getDate(),!0);break;default:a=!1}a&&(e.preventDefault(),this._viewDate=t)}_parseDateStr(e){return e?(e.match(/^\d{4}-\d{2}-\d{2}$/),new Date(e)):null}_isDisabled(e){if(!e)return!1;const t=this._parseDateStr(this.min),a=this._parseDateStr(this.max),s=new Date(e.getFullYear(),e.getMonth(),e.getDate());return!!(t&&s<new Date(t.getFullYear(),t.getMonth(),t.getDate()))||!!(a&&s>new Date(a.getFullYear(),a.getMonth(),a.getDate()))}_selectDate(e,t){if(!t)return;const a=new Date(this._viewDate);"date"===this.mode&&a.setDate(e),this._isDisabled(a)||(this._selectedDate=a,this.value=this._formatValue(a),this.showTime&&"date"===this.mode||(this.open=!1),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value,date:this._selectedDate},bubbles:!0,composed:!0})))}_selectMonth(e){const t=new Date(this._viewDate);t.setMonth(e),this._viewDate=t,this._selectedDate=t,this.value=this._formatValue(t),this.open=!1,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value,date:this._selectedDate},bubbles:!0,composed:!0}))}_selectYear(e){const t=new Date(this._viewDate);t.setFullYear(e),this._viewDate=t,this._selectedDate=t,this.value=this._formatValue(t),this.open=!1,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value,date:this._selectedDate},bubbles:!0,composed:!0}))}_renderCalendar(){const e=this._viewDate.getFullYear(),t=this._viewDate.getMonth(),a=this._viewDate.getDate(),s=Array.from({length:12},(e,t)=>{const a=new Date(2e3,t,1);return new Intl.DateTimeFormat(this.locale,{month:"long"}).format(a)});new Intl.DateTimeFormat(this.locale,{weekday:"narrow"}).format(new Date(2024,0,7)),new Intl.DateTimeFormat(this.locale,{weekday:"narrow"}).format(new Date(2024,0,7));let i=1;(this.locale.startsWith("en-US")||this.locale.startsWith("ja")||this.locale.startsWith("zh"))&&(i=0);const r=[];for(let v=0;v<7;v++){const e=new Date(2024,0,7+v+i);r.push(new Intl.DateTimeFormat(this.locale,{weekday:"short"}).format(e))}let n=(new Date(e,t,1).getDay()-i+7)%7;const o=new Date(e,t+1,0).getDate(),l=new Date(e,t,0).getDate(),c=[];for(let v=n-1;v>=0;v--)c.push({day:l-v,current:!1});for(let v=1;v<=o;v++)c.push({day:v,current:!0});const d=42-c.length;for(let v=1;v<=d;v++)c.push({day:v,current:!1});const h=/* @__PURE__ */(new Date).getFullYear(),p=[];for(let v=h-50;v<=h+50;v++)p.push(v);const g=/* @__PURE__ */new Date,u=a=>a===g.getDate()&&t===g.getMonth()&&e===g.getFullYear(),m=a=>!!this._selectedDate&&a===this._selectedDate.getDate()&&t===this._selectedDate.getMonth()&&e===this._selectedDate.getFullYear();return html`
1
+ var e=Object.defineProperty,t=(t,a,s)=>((t,a,s)=>a in t?e(t,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[a]=s)(t,"symbol"!=typeof a?a+"":a,s);import{LitElement as a,css as s,html as i}from"lit";import{F as r}from"../chunks/FormAssociated-DT543PBW.js";class n extends(r(a)){constructor(){super(),this.open=!1,this.disabled=!1,this.mode="date",this.locale="tr-TR",this.placeholder="Tarih seçiniz...",this.min="",this.max="",this._viewDate=/* @__PURE__ */new Date,this.value="",this._handleOutsideClick=this._handleOutsideClick.bind(this)}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleOutsideClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleOutsideClick)}_handleOutsideClick(e){this.open&&!e.composedPath().includes(this)&&(this.open=!1)}togglePopup(e){e&&e.stopPropagation(),this.disabled||(this.open=!this.open)}_handleInputKeydown(e){["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","Home","End"].includes(e.key)||(e.ctrlKey||e.metaKey)&&["a","c","v","x"].includes(e.key.toLowerCase())||/^\d$/.test(e.key)||e.preventDefault()}_getDateFormat(){const e=new Date(2023,11,31),t=new Intl.DateTimeFormat(this.locale).formatToParts(e),a=t.filter(e=>"literal"!==e.type).map(e=>e.type),s=t.find(e=>"literal"===e.type);let i=s?s.value:".";return i=i.includes(".")?".":i.includes("/")?"/":i.includes("-")?"-":".",{parts:a,separator:i}}_handleManualInput(e){let t=e.detail.value;t=t.replace(/\D/g,"");const{parts:a,separator:s}=this._getDateFormat(),i="year"===a[0];let r="";if(t.length>0&&(i?t.length<=4?r=t:t.length<=6?r=`${t.slice(0,4)}${s}${t.slice(4)}`:t.length<=8&&(r=`${t.slice(0,4)}${s}${t.slice(4,6)}${s}${t.slice(6)}`):t.length<=2?r=t:t.length<=4?r=`${t.slice(0,2)}${s}${t.slice(2)}`:t.length<=8&&(r=`${t.slice(0,2)}${s}${t.slice(2,4)}${s}${t.slice(4)}`),this.showTime&&t.length>8)){const e=r,a=t.slice(8);r=a.length<=2?`${e} ${a}`:`${e} ${a.slice(0,2)}:${a.slice(2,4)}`}if(t.length>=8){let e,n,o;if(i)o=parseInt(t.slice(0,4)),n=parseInt(t.slice(4,6)),e=parseInt(t.slice(6,8));else{const s=parseInt(t.slice(0,2)),i=parseInt(t.slice(2,4)),r=parseInt(t.slice(4,8));"day"===a[0]?(e=s,n=i,o=r):(n=s,e=i,o=r)}e>31&&(e=31),0===e&&(e=1),n>12&&(n=12),0===n&&(n=1),o>2100&&(o=2100);const l=String(e).padStart(2,"0"),c=String(n).padStart(2,"0"),d=String(o);if(r=i?`${d}${s}${c}${s}${l}`:"day"===a[0]?`${l}${s}${c}${s}${d}`:`${c}${s}${l}${s}${d}`,this.showTime&&t.length>8){r.split(" ")[1];let e=parseInt(t.slice(8,10)||"0"),a=parseInt(t.slice(10,12)||"0");e>23&&(e=23),a>59&&(a=59);const s=String(e).padStart(2,"0"),i=String(a).padStart(2,"0");t.length<=10?r+=` ${s}`:r+=` ${s}:${i}`}}if(this.value=r||t,this.value.length>=8){const e=this.value.split(" ")[0].split(s);if(this.value.split(" ")[1]?.split(":"),3===e.length){let e,t,a;if(i){"year"===currentParts[0]?(a=parseInt(dateComponents[0]),t=parseInt(dateComponents[1]),e=parseInt(dateComponents[2])):"day"===currentParts[0]?(e=parseInt(dateComponents[0]),t=parseInt(dateComponents[1]),a=parseInt(dateComponents[2])):(t=parseInt(dateComponents[0]),e=parseInt(dateComponents[1]),a=parseInt(dateComponents[2]));let s=0,i=0;if(timePartStr){const e=timePartStr.split(":");e.length>=2&&(s=parseInt(e[0]),i=parseInt(e[1]))}if(a>999){let r=new Date(a,t-1,e,s,i);if(!isNaN(r.getTime())){if(this.min){const e=this._parseDateStr(this.min);e&&new Date(r.getFullYear(),r.getMonth(),r.getDate())<new Date(e.getFullYear(),e.getMonth(),e.getDate())&&(r=new Date(e))}if(this.max){const e=this._parseDateStr(this.max);e&&new Date(r.getFullYear(),r.getMonth(),r.getDate())>new Date(e.getFullYear(),e.getMonth(),e.getDate())&&(r=new Date(e))}this._viewDate=r,this._selectedDate=r;const e=this._formatValue(r);this.value!==e&&(this.value=e),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value,date:this._selectedDate},bubbles:!0,composed:!0}))}}}}}}_changeMonth(e){const t=new Date(this._viewDate);t.setMonth(t.getMonth()+e),this._viewDate=t}_setViewMonth(e){const t=new Date(this._viewDate);t.setMonth(parseInt(e)),this._viewDate=t}_setViewYear(e){const t=new Date(this._viewDate);t.setFullYear(parseInt(e)),this._viewDate=t}_setTime(e,t){const a=new Date(this._viewDate);if("hour"===e&&a.setHours(parseInt(t)),"minute"===e&&a.setMinutes(parseInt(t)),this._viewDate=a,this._selectedDate){const a=new Date(this._selectedDate);"hour"===e&&a.setHours(parseInt(t)),"minute"===e&&a.setMinutes(parseInt(t)),this._selectedDate=a,this.value=this._formatValue(a)}}_formatValue(e){if(!e)return"";const{separator:t,parts:a}=this._getDateFormat(),s=String(e.getDate()).padStart(2,"0"),i=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getFullYear());let n="";return n="year"===a[0]?`${r}${t}${i}${t}${s}`:"day"===a[0]?`${s}${t}${i}${t}${r}`:`${i}${t}${s}${t}${r}`,"year"===this.mode?String(r):"month"===this.mode?`${i}${t}${r}`:(this.showTime&&(n+=` ${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`),n)}_handleToday(e){e&&e.stopPropagation();const t=/* @__PURE__ */new Date;this._viewDate=t,this._selectDate(t.getDate(),!0)}_handleDone(e){e&&e.stopPropagation(),this.open=!1}_handleKeydown(e){if(!this.open)return void("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.open=!0));if("Escape"===e.key)return void(this.open=!1);const t=new Date(this._viewDate);let a=!0;switch(e.key){case"ArrowLeft":t.setDate(t.getDate()-1);break;case"ArrowRight":t.setDate(t.getDate()+1);break;case"ArrowUp":t.setDate(t.getDate()-7);break;case"ArrowDown":t.setDate(t.getDate()+7);break;case"Enter":const e=new Date(this._viewDate);this._isDisabled(e)||this._selectDate(this._viewDate.getDate(),!0);break;default:a=!1}a&&(e.preventDefault(),this._viewDate=t)}_parseDateStr(e){return e?(e.match(/^\d{4}-\d{2}-\d{2}$/),new Date(e)):null}_isDisabled(e){if(!e)return!1;const t=this._parseDateStr(this.min),a=this._parseDateStr(this.max),s=new Date(e.getFullYear(),e.getMonth(),e.getDate());return!!(t&&s<new Date(t.getFullYear(),t.getMonth(),t.getDate()))||!!(a&&s>new Date(a.getFullYear(),a.getMonth(),a.getDate()))}_selectDate(e,t){if(!t)return;const a=new Date(this._viewDate);"date"===this.mode&&a.setDate(e),this._isDisabled(a)||(this._selectedDate=a,this.value=this._formatValue(a),this.showTime&&"date"===this.mode||(this.open=!1),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value,date:this._selectedDate},bubbles:!0,composed:!0})))}_selectMonth(e){const t=new Date(this._viewDate);t.setMonth(e),this._viewDate=t,this._selectedDate=t,this.value=this._formatValue(t),this.open=!1,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value,date:this._selectedDate},bubbles:!0,composed:!0}))}_selectYear(e){const t=new Date(this._viewDate);t.setFullYear(e),this._viewDate=t,this._selectedDate=t,this.value=this._formatValue(t),this.open=!1,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value,date:this._selectedDate},bubbles:!0,composed:!0}))}_renderCalendar(){const e=this._viewDate.getFullYear(),t=this._viewDate.getMonth(),a=this._viewDate.getDate(),s=Array.from({length:12},(e,t)=>{const a=new Date(2e3,t,1);return new Intl.DateTimeFormat(this.locale,{month:"long"}).format(a)});new Intl.DateTimeFormat(this.locale,{weekday:"narrow"}).format(new Date(2024,0,7)),new Intl.DateTimeFormat(this.locale,{weekday:"narrow"}).format(new Date(2024,0,7));let r=1;(this.locale.startsWith("en-US")||this.locale.startsWith("ja")||this.locale.startsWith("zh"))&&(r=0);const n=[];for(let i=0;i<7;i++){const e=new Date(2024,0,7+i+r);n.push(new Intl.DateTimeFormat(this.locale,{weekday:"short"}).format(e))}let o=(new Date(e,t,1).getDay()-r+7)%7;const l=new Date(e,t+1,0).getDate(),c=new Date(e,t,0).getDate(),d=[];for(let i=o-1;i>=0;i--)d.push({day:c-i,current:!1});for(let i=1;i<=l;i++)d.push({day:i,current:!0});const h=42-d.length;for(let i=1;i<=h;i++)d.push({day:i,current:!1});const p=/* @__PURE__ */(new Date).getFullYear(),g=[];for(let i=p-50;i<=p+50;i++)g.push(i);const u=/* @__PURE__ */new Date,m=a=>a===u.getDate()&&t===u.getMonth()&&e===u.getFullYear(),v=a=>!!this._selectedDate&&a===this._selectedDate.getDate()&&t===this._selectedDate.getMonth()&&e===this._selectedDate.getFullYear();return i`
2
2
  <div class="calendar-header">
3
3
  <button class="nav-btn" @click="${e=>{e.stopPropagation(),this._changeMonth(-1)}}">←</button>
4
4
  <div class="month-year">
5
5
  <select class="header-select" @click="${e=>e.stopPropagation()}" @change="${e=>this._setViewMonth(e.target.value)}">
6
- ${s.map((e,a)=>html`<option value="${a}" ?selected="${a===t}">${e}</option>`)}
6
+ ${s.map((e,a)=>i`<option value="${a}" ?selected="${a===t}">${e}</option>`)}
7
7
  </select>
8
8
  <select class="header-select" @click="${e=>e.stopPropagation()}" @change="${e=>this._setViewYear(e.target.value)}">
9
- ${p.map(t=>html`<option value="${t}" ?selected="${t===e}">${t}</option>`)}
9
+ ${g.map(t=>i`<option value="${t}" ?selected="${t===e}">${t}</option>`)}
10
10
  </select>
11
11
  </div>
12
12
  <button class="nav-btn" @click="${e=>{e.stopPropagation(),this._changeMonth(1)}}">→</button>
13
13
  </div>
14
14
  <div class="calendar-grid">
15
- ${r.map(e=>html`<div class="weekday">${e}</div>`)}
16
- ${c.map(s=>html`
17
- <div class="${classMap({day:!0,"other-month":!s.current,today:s.current&&u(s.day),selected:s.current&&m(s.day),focused:s.current&&s.day===a,disabled:s.current&&this._isDisabled(new Date(e,t,s.day))})}" @click="${e=>{e.stopPropagation(),this._selectDate(s.day,s.current)}}">
15
+ ${n.map(e=>i`<div class="weekday">${e}</div>`)}
16
+ ${d.map(s=>i`
17
+ <div class="${classMap({day:!0,"other-month":!s.current,today:s.current&&m(s.day),selected:s.current&&v(s.day),focused:s.current&&s.day===a,disabled:s.current&&this._isDisabled(new Date(e,t,s.day))})}" @click="${e=>{e.stopPropagation(),this._selectDate(s.day,s.current)}}">
18
18
  ${s.day}
19
19
  </div>
20
20
  `)}
21
21
  </div>
22
22
 
23
- ${this.showTime?html`
23
+ ${this.showTime?i`
24
24
  <div class="time-picker" @click="${e=>e.stopPropagation()}">
25
25
  <select class="time-select" @change="${e=>this._setTime("hour",e.target.value)}">
26
- ${Array.from({length:24},(e,t)=>html`
26
+ ${Array.from({length:24},(e,t)=>i`
27
27
  <option value="${t}" ?selected="${t===this._viewDate.getHours()}">
28
28
  ${String(t).padStart(2,"0")}
29
29
  </option>
@@ -31,7 +31,7 @@ var e=Object.defineProperty,t=(t,a,s)=>((t,a,s)=>a in t?e(t,a,{enumerable:!0,con
31
31
  </select>
32
32
  <span class="time-separator">:</span>
33
33
  <select class="time-select" @change="${e=>this._setTime("minute",e.target.value)}">
34
- ${Array.from({length:60},(e,t)=>html`
34
+ ${Array.from({length:60},(e,t)=>i`
35
35
  <option value="${t}" ?selected="${t===this._viewDate.getMinutes()}">
36
36
  ${String(t).padStart(2,"0")}
37
37
  </option>
@@ -42,28 +42,28 @@ var e=Object.defineProperty,t=(t,a,s)=>((t,a,s)=>a in t?e(t,a,{enumerable:!0,con
42
42
 
43
43
  <div style="margin-top: 1rem; border-top: 1px solid var(--kg-border); padding-top: 0.75rem; display: flex; justify-content: center; gap: 8px;">
44
44
  <kg-button size="mini" basic fullwidth @click="${this._handleToday}">Bugün</kg-button>
45
- ${this.showTime?html`
45
+ ${this.showTime?i`
46
46
  <kg-button size="mini" color="primary" fullwidth @click="${this._handleDone}">Tamam</kg-button>
47
47
  `:""}
48
48
  </div>
49
- `}_renderMonthView(){this._viewDate.getMonth();const e=Array.from({length:12},(e,t)=>{const a=new Date(2e3,t,1);return new Intl.DateTimeFormat(this.locale,{month:"long"}).format(a)}),t=this._viewDate.getFullYear(),a=[];for(let i=t-10;i<=t+10;i++)a.push(i);const s=e=>!!this._selectedDate&&e===this._selectedDate.getMonth()&&t===this._selectedDate.getFullYear();return html`
49
+ `}_renderMonthView(){this._viewDate.getMonth();const e=Array.from({length:12},(e,t)=>{const a=new Date(2e3,t,1);return new Intl.DateTimeFormat(this.locale,{month:"long"}).format(a)}),t=this._viewDate.getFullYear(),a=[];for(let i=t-10;i<=t+10;i++)a.push(i);const s=e=>!!this._selectedDate&&e===this._selectedDate.getMonth()&&t===this._selectedDate.getFullYear();return i`
50
50
  <div class="calendar-header">
51
51
  <button class="nav-btn" @click="${e=>{e.stopPropagation(),this._setViewYear(t-1)}}">←</button>
52
52
  <div class="month-year">
53
53
  <select class="header-select" @click="${e=>e.stopPropagation()}" @change="${e=>this._setViewYear(e.target.value)}">
54
- ${a.map(e=>html`<option value="${e}" ?selected="${e===t}">${e}</option>`)}
54
+ ${a.map(e=>i`<option value="${e}" ?selected="${e===t}">${e}</option>`)}
55
55
  </select>
56
56
  </div>
57
57
  <button class="nav-btn" @click="${e=>{e.stopPropagation(),this._setViewYear(t+1)}}">→</button>
58
58
  </div>
59
59
  <div class="selector-grid">
60
- ${e.map((e,t)=>html`
60
+ ${e.map((e,t)=>i`
61
61
  <div class="selector-item ${s(t)?"selected":""}" @click="${e=>{e.stopPropagation(),this._selectMonth(t)}}">
62
62
  ${e}
63
63
  </div>
64
64
  `)}
65
65
  </div>
66
- `}_renderYearView(){const e=this._viewDate.getFullYear(),t=12*Math.floor(e/12),a=[];for(let i=0;i<12;i++)a.push(t+i);const s=e=>!!this._selectedDate&&e===this._selectedDate.getFullYear();return html`
66
+ `}_renderYearView(){const e=this._viewDate.getFullYear(),t=12*Math.floor(e/12),a=[];for(let i=0;i<12;i++)a.push(t+i);const s=e=>!!this._selectedDate&&e===this._selectedDate.getFullYear();return i`
67
67
  <div class="calendar-header">
68
68
  <button class="nav-btn" @click="${t=>{t.stopPropagation(),this._setViewYear(e-12)}}">←</button>
69
69
  <div class="month-year">
@@ -72,13 +72,13 @@ var e=Object.defineProperty,t=(t,a,s)=>((t,a,s)=>a in t?e(t,a,{enumerable:!0,con
72
72
  <button class="nav-btn" @click="${t=>{t.stopPropagation(),this._setViewYear(e+12)}}">→</button>
73
73
  </div>
74
74
  <div class="selector-grid">
75
- ${a.map(e=>html`
75
+ ${a.map(e=>i`
76
76
  <div class="selector-item ${s(e)?"selected":""}" @click="${t=>{t.stopPropagation(),this._selectYear(e)}}">
77
77
  ${e}
78
78
  </div>
79
79
  `)}
80
80
  </div>
81
- `}render(){let e;return e="year"===this.mode?this._renderYearView():"month"===this.mode?this._renderMonthView():this._renderCalendar(),html`
81
+ `}render(){let e;return e="year"===this.mode?this._renderYearView():"month"===this.mode?this._renderMonthView():this._renderCalendar(),i`
82
82
  <div
83
83
  class="datepicker-trigger ${this.disabled?"disabled":""}"
84
84
  @keydown="${this._handleKeydown}"
@@ -107,7 +107,7 @@ var e=Object.defineProperty,t=(t,a,s)=>((t,a,s)=>a in t?e(t,a,{enumerable:!0,con
107
107
  <div class="${classMap({"datepicker-popup":!0,open:this.open})}">
108
108
  ${e}
109
109
  </div>
110
- `}}t(s,"properties",{open:{type:Boolean,reflect:!0},placeholder:{type:String},label:{type:String},showTime:{type:Boolean},mode:{type:String},locale:{type:String},min:{type:String},max:{type:String},_viewDate:{type:Object},_selectedDate:{type:Object}}),t(s,"styles",css`
110
+ `}}t(n,"properties",{open:{type:Boolean,reflect:!0},placeholder:{type:String},label:{type:String},showTime:{type:Boolean},mode:{type:String},locale:{type:String},min:{type:String},max:{type:String},_viewDate:{type:Object},_selectedDate:{type:Object}}),t(n,"styles",s`
111
111
  :host {
112
112
  display: inline-block;
113
113
  width: 100%;
@@ -346,4 +346,4 @@ var e=Object.defineProperty,t=(t,a,s)=>((t,a,s)=>a in t?e(t,a,{enumerable:!0,con
346
346
  font-weight: 700;
347
347
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
348
348
  }
349
- `),"undefined"==typeof customElements||customElements.get("kg-datepicker")||customElements.define("kg-datepicker",s);export{s as kgdatepicker};
349
+ `),"undefined"==typeof customElements||customElements.get("kg-datepicker")||customElements.define("kg-datepicker",n);export{n as kgdatepicker};
@@ -1,4 +1,4 @@
1
- var e=Object.defineProperty,i=(i,t,r)=>((i,t,r)=>t in i?e(i,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[t]=r)(i,"symbol"!=typeof t?t+"":t,r);import{LitElement as t,css as r,html as s}from"lit";import{F as a}from"../chunks/FormAssociated-Ca1JavvX.js";class l extends(a(t)){constructor(){super(),this.placeholder="Dosya seçin...",this.accept="*",this.multiple=!1,this.hideChips=!1,this.files=[],this._previews=/* @__PURE__ */new Map}disconnectedCallback(){super.disconnectedCallback(),this._revokePreviews()}_updateFormValue(){if(this.files.length>0){const e=new FormData;this.files.forEach(i=>e.append(this.name,i)),this.internals.setFormValue(e)}else this.internals.setFormValue(null)}updated(e){e.has("files")&&(this._updatePreviews(),this._updateFormValue()),super.updated(e)}_revokePreviews(){this._previews.forEach(e=>URL.revokeObjectURL(e)),this._previews.clear()}_updatePreviews(){this._revokePreviews();const e=/* @__PURE__ */new Map;this.files.forEach(i=>{i.type.startsWith("image/")&&e.set(i,URL.createObjectURL(i))}),this._previews=e,this.requestUpdate()}_handleFileChange(e){const i=Array.from(e.target.files);this._addFiles(i),e.target.value=""}_addFiles(e){this.disabled||0===e.length||(this.files=this.multiple?e:[e[0]],this._emitChange())}_removeFile(e){this.files=this.files.filter((i,t)=>t!==e),this._emitChange()}_emitChange(){this.dispatchEvent(new CustomEvent("kg-change",{detail:{files:this.files},bubbles:!0,composed:!0}))}_triggerUpload(){this.disabled||this.shadowRoot.querySelector("input").click()}_onDragOver(e){e.preventDefault(),this.disabled||this.shadowRoot.querySelector(".upload-wrapper").classList.add("active")}_onDragLeave(){this.shadowRoot.querySelector(".upload-wrapper").classList.remove("active")}_onDrop(e){if(e.preventDefault(),this._onDragLeave(),this.disabled)return;const i=Array.from(e.dataTransfer.files);this._addFiles(i)}render(){const e=this.files.length>0,i=e?this.multiple?`${this.files.length} Dosya Seçildi`:this.files[0].name:this.placeholder;return s`
1
+ var e=Object.defineProperty,i=(i,t,r)=>((i,t,r)=>t in i?e(i,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[t]=r)(i,"symbol"!=typeof t?t+"":t,r);import{LitElement as t,css as r,html as s}from"lit";import{F as a}from"../chunks/FormAssociated-DT543PBW.js";class l extends(a(t)){constructor(){super(),this.placeholder="Dosya seçin...",this.accept="*",this.multiple=!1,this.hideChips=!1,this.files=[],this._previews=/* @__PURE__ */new Map}disconnectedCallback(){super.disconnectedCallback(),this._revokePreviews()}_updateFormValue(){if(this.files.length>0){const e=new FormData;this.files.forEach(i=>e.append(this.name,i)),this.internals.setFormValue(e)}else this.internals.setFormValue(null)}updated(e){e.has("files")&&(this._updatePreviews(),this._updateFormValue()),super.updated(e)}_revokePreviews(){this._previews.forEach(e=>URL.revokeObjectURL(e)),this._previews.clear()}_updatePreviews(){this._revokePreviews();const e=/* @__PURE__ */new Map;this.files.forEach(i=>{i.type.startsWith("image/")&&e.set(i,URL.createObjectURL(i))}),this._previews=e,this.requestUpdate()}_handleFileChange(e){const i=Array.from(e.target.files);this._addFiles(i),e.target.value=""}_addFiles(e){this.disabled||0===e.length||(this.files=this.multiple?e:[e[0]],this._emitChange())}_removeFile(e){this.files=this.files.filter((i,t)=>t!==e),this._emitChange()}_emitChange(){this.dispatchEvent(new CustomEvent("kg-change",{detail:{files:this.files},bubbles:!0,composed:!0}))}_triggerUpload(){this.disabled||this.shadowRoot.querySelector("input").click()}_onDragOver(e){e.preventDefault(),this.disabled||this.shadowRoot.querySelector(".upload-wrapper").classList.add("active")}_onDragLeave(){this.shadowRoot.querySelector(".upload-wrapper").classList.remove("active")}_onDrop(e){if(e.preventDefault(),this._onDragLeave(),this.disabled)return;const i=Array.from(e.dataTransfer.files);this._addFiles(i)}render(){const e=this.files.length>0,i=e?this.multiple?`${this.files.length} Dosya Seçildi`:this.files[0].name:this.placeholder;return s`
2
2
  <div class="container">
3
3
  ${this.label?s`<label class="label">${this.label}</label>`:""}
4
4
 
@@ -1,4 +1,4 @@
1
- var e=Object.defineProperty,t=(t,i,r)=>((t,i,r)=>i in t?e(t,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[i]=r)(t,"symbol"!=typeof i?i+"":i,r);import{LitElement as i,css as r,html as o}from"lit";import{classMap as n}from"lit/directives/class-map.js";import{F as a}from"../chunks/FormAssociated-Ca1JavvX.js";class s extends(a(i)){constructor(){super(),this.placeholder="",this.hasLeft=!1,this.hasRight=!1,this._showPassword=!1}_handleKeyDown(e){"number"===this.type&&("e"!==e.key&&"E"!==e.key&&(!this.positive||"-"!==e.key&&"_"!==e.key)&&(!this.integer||"."!==e.key&&","!==e.key)||e.preventDefault())}_handleInput(e){let t=e.target.value;"number"===this.type&&(this.integer?this.positive?t=t.replace(/\D/g,""):(t=t.replace(/[^\d-]/g,""),t.indexOf("-")>0&&(t=t.slice(0,t.indexOf("-"))+t.slice(t.indexOf("-")+1))):this.positive&&(t=t.replace(/-/g,"")),e.target.value!==t&&(e.target.value=t)),this.value=t,this.dispatchEvent(new CustomEvent("kg-input",{detail:{value:this.value},bubbles:!0,composed:!0}))}_handleSlotChange(e){const t=e.target;if(!t)return;const i=t.assignedNodes({flatten:!0}).some(e=>e.nodeType===Node.ELEMENT_NODE||e.nodeType===Node.TEXT_NODE&&e.textContent.trim().length>0);"left"===t.name&&(this.hasLeft=i),"right"===t.name&&(this.hasRight=i)}_togglePassword(){this._showPassword=!this._showPassword}render(){const e={"ui-input":!0,[this.size]:!!this.size,disabled:this.disabled,loading:this.loading,error:this.error,fullwidth:this.fullwidth,inverted:this.inverted},t="number"===this.type,i="password"===this.type?this._showPassword?"text":"password":t?"text":this.type,r="password"===this.type?this.hasRight?"5rem":"3rem":this.hasRight?"3rem":"1rem",a=t?this.integer?"numeric":"decimal":"";return o`
1
+ var e=Object.defineProperty,t=(t,i,r)=>((t,i,r)=>i in t?e(t,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[i]=r)(t,"symbol"!=typeof i?i+"":i,r);import{LitElement as i,css as r,html as o}from"lit";import{classMap as n}from"lit/directives/class-map.js";import{F as a}from"../chunks/FormAssociated-DT543PBW.js";class s extends(a(i)){constructor(){super(),this.placeholder="",this.hasLeft=!1,this.hasRight=!1,this._showPassword=!1}_handleKeyDown(e){"number"===this.type&&("e"!==e.key&&"E"!==e.key&&(!this.positive||"-"!==e.key&&"_"!==e.key)&&(!this.integer||"."!==e.key&&","!==e.key)||e.preventDefault())}_handleInput(e){let t=e.target.value;"number"===this.type&&(this.integer?this.positive?t=t.replace(/\D/g,""):(t=t.replace(/[^\d-]/g,""),t.indexOf("-")>0&&(t=t.slice(0,t.indexOf("-"))+t.slice(t.indexOf("-")+1))):this.positive&&(t=t.replace(/-/g,"")),e.target.value!==t&&(e.target.value=t)),this.value=t,this.dispatchEvent(new CustomEvent("kg-input",{detail:{value:this.value},bubbles:!0,composed:!0}))}_handleSlotChange(e){const t=e.target;if(!t)return;const i=t.assignedNodes({flatten:!0}).some(e=>e.nodeType===Node.ELEMENT_NODE||e.nodeType===Node.TEXT_NODE&&e.textContent.trim().length>0);"left"===t.name&&(this.hasLeft=i),"right"===t.name&&(this.hasRight=i)}_togglePassword(){this._showPassword=!this._showPassword}render(){const e={"ui-input":!0,[this.size]:!!this.size,disabled:this.disabled,loading:this.loading,error:this.error,fullwidth:this.fullwidth,inverted:this.inverted},t="number"===this.type,i="password"===this.type?this._showPassword?"text":"password":t?"text":this.type,r="password"===this.type?this.hasRight?"5rem":"3rem":this.hasRight?"3rem":"1rem",a=t?this.integer?"numeric":"decimal":"";return o`
2
2
  <div class="kg-input-container" style="--loading-offset: ${r}">
3
3
  ${this.label?o`<label class="input-label">${this.label}</label>`:""}
4
4
  <div class="${n(e)}">
@@ -1,11 +1,11 @@
1
- var e=Object.defineProperty,t=(t,i,r)=>((t,i,r)=>i in t?e(t,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[i]=r)(t,"symbol"!=typeof i?i+"":i,r);import{F as i}from"../chunks/FormAssociated-Ca1JavvX.js";class r extends(i(LitElement)){constructor(){super(),this.direction="vertical",this.value="",this.addEventListener("kg-radio-select",this._handleRadioSelect)}_handleRadioSelect(e){const t=e.detail.value;this.value=t,this._updateChildren(),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))}_updateChildren(){this.querySelectorAll("kg-radio").forEach(e=>{e.checked=e.value===this.value})}firstUpdated(){this._updateChildren()}updated(e){e.has("value")&&this._updateChildren()}render(){return html`
1
+ var e=Object.defineProperty,t=(t,i,r)=>((t,i,r)=>i in t?e(t,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[i]=r)(t,"symbol"!=typeof i?i+"":i,r);import{LitElement as i,css as r,html as a}from"lit";import{F as o}from"../chunks/FormAssociated-DT543PBW.js";class l extends(o(i)){constructor(){super(),this.direction="vertical",this.value="",this.addEventListener("kg-radio-select",this._handleRadioSelect)}_handleRadioSelect(e){const t=e.detail.value;this.value=t,this._updateChildren(),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))}_updateChildren(){this.querySelectorAll("kg-radio").forEach(e=>{e.checked=e.value===this.value})}firstUpdated(){this._updateChildren()}updated(e){e.has("value")&&this._updateChildren()}render(){return a`
2
2
  <div class="kg-radio-group">
3
- ${this.label?html`<span class="group-label">${this.label}</span>`:""}
3
+ ${this.label?a`<span class="group-label">${this.label}</span>`:""}
4
4
  <div class="kg-radio-group-container ${this.direction}">
5
5
  <slot></slot>
6
6
  </div>
7
7
  </div>
8
- `}}t(r,"properties",{direction:{type:String},label:{type:String}}),t(r,"styles",css`
8
+ `}}t(l,"properties",{direction:{type:String},label:{type:String}}),t(l,"styles",r`
9
9
  :host {
10
10
  display: block;
11
11
  }
@@ -34,4 +34,4 @@ var e=Object.defineProperty,t=(t,i,r)=>((t,i,r)=>i in t?e(t,i,{enumerable:!0,con
34
34
  text-transform: uppercase;
35
35
  letter-spacing: 0.05em;
36
36
  }
37
- `),"undefined"==typeof customElements||customElements.get("kg-radio-group")||customElements.define("kg-radio-group",r);export{r as kgradiogroup};
37
+ `),"undefined"==typeof customElements||customElements.get("kg-radio-group")||customElements.define("kg-radio-group",l);export{l as kgradiogroup};
@@ -1,4 +1,4 @@
1
- var e=Object.defineProperty,r=(r,t,i)=>((r,t,i)=>t in r?e(r,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[t]=i)(r,"symbol"!=typeof t?t+"":t,i);import{LitElement as t,css as i,html as a}from"lit";import{classMap as c}from"lit/directives/class-map.js";import{F as s}from"../chunks/FormAssociated-Ca1JavvX.js";const o=class e extends(s(t)){constructor(){super(),this.checked=!1}_handleClick(){this.disabled||this.checked||(this.checked=!0,this._uncheckOthers(),this.dispatchEvent(new CustomEvent("kg-radio-select",{detail:{value:this.value},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:{checked:!0},bubbles:!0,composed:!0})))}_uncheckOthers(){const r=this.name;r&&(this.internals.form||this.getRootNode()).querySelectorAll(`kg-radio[name="${r}"]`).forEach(r=>{r!==this&&r instanceof e&&(r.checked=!1)})}_updateFormValue(){const e=this.checked?this.value:null;this.internals.setFormValue(e,this.checked?"checked":"unchecked")}updated(e){e.has("checked")&&this._updateFormValue(),super.updated(e)}formResetCallback(){this.checked=this.hasAttribute("checked"),this._updateFormValue()}formStateRestoreCallback(e){"checked"===e?this.checked=!0:"unchecked"===e&&(this.checked=!1),this._updateFormValue()}render(){const e={"kg-radio-container":!0,checked:this.checked,disabled:this.disabled},r=this.color?`--radio-active-color: ${t=this.color,t?t.startsWith("#")||t.startsWith("rgb")||t.startsWith("hsl")?t:{primary:"var(--kg-primary)",secondary:"var(--kg-secondary)",tertiary:"var(--kg-tertiary)",error:"#e74c3c",red:"#e74c3c",green:"#2ecc71",blue:"#3498db",orange:"#f39c12",purple:"#9b59b6"}[t]||`var(--kg-${t}, ${t})`:"var(--kg-primary)"}`:"";var t;return a`
1
+ var e=Object.defineProperty,r=(r,t,i)=>((r,t,i)=>t in r?e(r,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[t]=i)(r,"symbol"!=typeof t?t+"":t,i);import{LitElement as t,css as i,html as a}from"lit";import{classMap as c}from"lit/directives/class-map.js";import{F as s}from"../chunks/FormAssociated-DT543PBW.js";const o=class e extends(s(t)){constructor(){super(),this.checked=!1}_handleClick(){this.disabled||this.checked||(this.checked=!0,this._uncheckOthers(),this.dispatchEvent(new CustomEvent("kg-radio-select",{detail:{value:this.value},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:{checked:!0},bubbles:!0,composed:!0})))}_uncheckOthers(){const r=this.name;r&&(this.internals.form||this.getRootNode()).querySelectorAll(`kg-radio[name="${r}"]`).forEach(r=>{r!==this&&r instanceof e&&(r.checked=!1)})}_updateFormValue(){const e=this.checked?this.value:null;this.internals.setFormValue(e,this.checked?"checked":"unchecked")}updated(e){e.has("checked")&&this._updateFormValue(),super.updated(e)}formResetCallback(){this.checked=this.hasAttribute("checked"),this._updateFormValue()}formStateRestoreCallback(e){"checked"===e?this.checked=!0:"unchecked"===e&&(this.checked=!1),this._updateFormValue()}render(){const e={"kg-radio-container":!0,checked:this.checked,disabled:this.disabled},r=this.color?`--radio-active-color: ${t=this.color,t?t.startsWith("#")||t.startsWith("rgb")||t.startsWith("hsl")?t:{primary:"var(--kg-primary)",secondary:"var(--kg-secondary)",tertiary:"var(--kg-tertiary)",error:"#e74c3c",red:"#e74c3c",green:"#2ecc71",blue:"#3498db",orange:"#f39c12",purple:"#9b59b6"}[t]||`var(--kg-${t}, ${t})`:"var(--kg-primary)"}`:"";var t;return a`
2
2
  <div
3
3
  class="${c(e)}"
4
4
  style="${r}"
@@ -1,4 +1,4 @@
1
- var e=Object.defineProperty,t=(t,i,s)=>((t,i,s)=>i in t?e(t,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[i]=s)(t,"symbol"!=typeof i?i+"":i,s);import{LitElement as i,css as s,html as r}from"lit";import"lit/directives/class-map.js";import{F as a}from"../chunks/FormAssociated-Ca1JavvX.js";class o extends(a(i)){constructor(){super(),this.options=[],this.value=null,this.placeholder="Seçiniz...",this.multiple=!1,this.searchable=!1,this._open=!1,this._searchQuery="",this._handleOutsideClick=this._handleOutsideClick.bind(this)}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleOutsideClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleOutsideClick)}_updateFormValue(){if(this.multiple&&Array.isArray(this.value)){const e=new FormData;this.value.forEach(t=>e.append(this.name,t)),this.internals.setFormValue(e)}else this.internals.setFormValue(this.value)}_handleOutsideClick(e){this._open&&(e.composedPath().includes(this)||this._closeDropdown())}_toggleDropdown(e){this.disabled||(this._open=!this._open,this._open&&(this._searchQuery="",setTimeout(()=>{const e=this.shadowRoot.querySelector(".search-input");e&&e.focus()},100)))}_closeDropdown(){this._open=!1}_selectOption(e,t){if(t.stopPropagation(),this.multiple){let t=Array.isArray(this.value)?[...this.value]:[];const i=t.indexOf(e.value);i>-1?t.splice(i,1):t.push(e.value),this.value=t}else this.value=e.value,this._closeDropdown();this._dispatchChange()}_dispatchChange(){this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))}_handleSearch(e){this._searchQuery=e.target.value.toLowerCase()}_removeTag(e,t){t.stopPropagation();let i=[...this.value];const s=i.indexOf(e);s>-1&&(i.splice(s,1),this.value=i,this._dispatchChange())}render(){const e=e=>this.multiple&&Array.isArray(this.value)?this.value.includes(e):this.value===e,t=(()=>{if(!this.value)return null;if(this.multiple&&Array.isArray(this.value))return this.options.filter(e=>this.value.includes(e.value));const e=this.options.find(e=>e.value===this.value);return e?e.label:null})(),i=(this.options||[]).filter(e=>e.label.toLowerCase().includes(this._searchQuery||""));return r`
1
+ var e=Object.defineProperty,t=(t,i,s)=>((t,i,s)=>i in t?e(t,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[i]=s)(t,"symbol"!=typeof i?i+"":i,s);import{LitElement as i,css as s,html as r}from"lit";import"lit/directives/class-map.js";import{F as a}from"../chunks/FormAssociated-DT543PBW.js";class o extends(a(i)){constructor(){super(),this.options=[],this.value=null,this.placeholder="Seçiniz...",this.multiple=!1,this.searchable=!1,this._open=!1,this._searchQuery="",this._handleOutsideClick=this._handleOutsideClick.bind(this)}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._handleOutsideClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleOutsideClick)}_updateFormValue(){if(this.multiple&&Array.isArray(this.value)){const e=new FormData;this.value.forEach(t=>e.append(this.name,t)),this.internals.setFormValue(e)}else this.internals.setFormValue(this.value)}_handleOutsideClick(e){this._open&&(e.composedPath().includes(this)||this._closeDropdown())}_toggleDropdown(e){this.disabled||(this._open=!this._open,this._open&&(this._searchQuery="",setTimeout(()=>{const e=this.shadowRoot.querySelector(".search-input");e&&e.focus()},100)))}_closeDropdown(){this._open=!1}_selectOption(e,t){if(t.stopPropagation(),this.multiple){let t=Array.isArray(this.value)?[...this.value]:[];const i=t.indexOf(e.value);i>-1?t.splice(i,1):t.push(e.value),this.value=t}else this.value=e.value,this._closeDropdown();this._dispatchChange()}_dispatchChange(){this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))}_handleSearch(e){this._searchQuery=e.target.value.toLowerCase()}_removeTag(e,t){t.stopPropagation();let i=[...this.value];const s=i.indexOf(e);s>-1&&(i.splice(s,1),this.value=i,this._dispatchChange())}render(){const e=e=>this.multiple&&Array.isArray(this.value)?this.value.includes(e):this.value===e,t=(()=>{if(!this.value)return null;if(this.multiple&&Array.isArray(this.value))return this.options.filter(e=>this.value.includes(e.value));const e=this.options.find(e=>e.value===this.value);return e?e.label:null})(),i=(this.options||[]).filter(e=>e.label.toLowerCase().includes(this._searchQuery||""));return r`
2
2
  <div class="kg-select-container">
3
3
  ${this.label?r`<label class="select-label">${this.label}</label>`:""}
4
4
 
@@ -1,13 +1,13 @@
1
- var e=Object.defineProperty,t=(t,i,r)=>((t,i,r)=>i in t?e(t,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[i]=r)(t,"symbol"!=typeof i?i+"":i,r);import{F as i}from"../chunks/FormAssociated-Ca1JavvX.js";class r extends(i(LitElement)){constructor(){super(),this.min=0,this.max=100,this.step=1,this.value=50,this.hideValue=!1,this.showPins=!1}_handleInput(e){this.value=Number(e.target.value),this.dispatchEvent(new CustomEvent("kg-input",{detail:{value:this.value},bubbles:!0,composed:!0}))}render(){const e=(this.value-this.min)/(this.max-this.min)*100,t=`--slider-active-color: ${i=this.color,i?i.startsWith("#")||i.startsWith("rgb")||i.startsWith("hsl")?i:{primary:"var(--kg-primary)",secondary:"var(--kg-secondary)",tertiary:"var(--kg-tertiary)",error:"#e74c3c",red:"#e74c3c",green:"#2ecc71",blue:"#3498db",orange:"#f39c12",purple:"#9b59b6"}[i]||`var(--kg-${i}, ${i})`:"var(--kg-primary)"};`;var i;return html`
1
+ var e=Object.defineProperty,t=(t,i,r)=>((t,i,r)=>i in t?e(t,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[i]=r)(t,"symbol"!=typeof i?i+"":i,r);import{LitElement as i,css as r,html as a}from"lit";import{F as s}from"../chunks/FormAssociated-DT543PBW.js";class n extends(s(i)){constructor(){super(),this.min=0,this.max=100,this.step=1,this.value=50,this.hideValue=!1,this.showPins=!1}_handleInput(e){this.value=Number(e.target.value),this.dispatchEvent(new CustomEvent("kg-input",{detail:{value:this.value},bubbles:!0,composed:!0}))}render(){const e=(this.value-this.min)/(this.max-this.min)*100,t=`--slider-active-color: ${i=this.color,i?i.startsWith("#")||i.startsWith("rgb")||i.startsWith("hsl")?i:{primary:"var(--kg-primary)",secondary:"var(--kg-secondary)",tertiary:"var(--kg-tertiary)",error:"#e74c3c",red:"#e74c3c",green:"#2ecc71",blue:"#3498db",orange:"#f39c12",purple:"#9b59b6"}[i]||`var(--kg-${i}, ${i})`:"var(--kg-primary)"};`;var i;return a`
2
2
  <div class="kg-slider-container ${this.disabled?"disabled":""}" style="${t}">
3
3
  <div class="slider-header">
4
- ${this.label?html`<label class="slider-label">${this.label}</label>`:""}
5
- ${this.hideValue?"":html`<span class="current-value">${this.value}</span>`}
4
+ ${this.label?a`<label class="slider-label">${this.label}</label>`:""}
5
+ ${this.hideValue?"":a`<span class="current-value">${this.value}</span>`}
6
6
  </div>
7
7
  <div class="slider-wrapper">
8
- ${this.showPins?html`
8
+ ${this.showPins?a`
9
9
  <div class="pins-container">
10
- ${[...Array(5)].map(()=>html`<div class="pin"></div>`)}
10
+ ${[...Array(5)].map(()=>a`<div class="pin"></div>`)}
11
11
  </div>
12
12
  `:""}
13
13
  <div class="checked-track" style="width: ${e}%"></div>
@@ -22,7 +22,7 @@ var e=Object.defineProperty,t=(t,i,r)=>((t,i,r)=>i in t?e(t,i,{enumerable:!0,con
22
22
  />
23
23
  </div>
24
24
  </div>
25
- `}}t(r,"properties",{min:{type:Number},max:{type:Number},step:{type:Number},label:{type:String},color:{type:String},hideValue:{type:Boolean,reflect:!0,attribute:"hide-value"},showPins:{type:Boolean,attribute:"show-pins"}}),t(r,"styles",css`
25
+ `}}t(n,"properties",{min:{type:Number},max:{type:Number},step:{type:Number},label:{type:String},color:{type:String},hideValue:{type:Boolean,reflect:!0,attribute:"hide-value"},showPins:{type:Boolean,attribute:"show-pins"}}),t(n,"styles",r`
26
26
  :host {
27
27
  display: block;
28
28
  margin: 1rem 0;
@@ -150,4 +150,4 @@ var e=Object.defineProperty,t=(t,i,r)=>((t,i,r)=>i in t?e(t,i,{enumerable:!0,con
150
150
  opacity: 0.3;
151
151
  border-radius: 50%;
152
152
  }
153
- `),"undefined"==typeof customElements||customElements.get("kg-slider")||customElements.define("kg-slider",r);export{r as kgslider};
153
+ `),"undefined"==typeof customElements||customElements.get("kg-slider")||customElements.define("kg-slider",n);export{n as kgslider};
@@ -1,4 +1,4 @@
1
- var e=Object.defineProperty,t=(t,s,r)=>((t,s,r)=>s in t?e(t,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[s]=r)(t,"symbol"!=typeof s?s+"":s,r);import{LitElement as s,css as r,html as i}from"lit";import"lit/directives/class-map.js";import{F as c}from"../chunks/FormAssociated-Ca1JavvX.js";class a extends(c(s)){constructor(){super(),this.checked=!1,this.color="primary",this.value="on"}formResetCallback(){this.checked=this.hasAttribute("checked"),this._updateFormValue()}formStateRestoreCallback(e){"checked"===e?this.checked=!0:"unchecked"===e&&(this.checked=!1),this._updateFormValue()}updated(e){e.has("checked")&&this._updateFormValue(),super.updated(e)}_updateFormValue(){const e=this.checked?this.value||"on":null;this.internals.setFormValue(e,this.checked?"checked":"unchecked")}_toggle(){this.disabled||(this.checked=!this.checked,this.dispatchEvent(new CustomEvent("change",{detail:{checked:this.checked},bubbles:!0,composed:!0})))}render(){const e=(s=this.color)&&"primary"!==s?s.startsWith("#")||s.startsWith("rgb")||s.startsWith("hsl")?s:{secondary:"var(--kg-secondary)",tertiary:"var(--kg-tertiary)",error:"#e74c3c",red:"#e74c3c",green:"#2ecc71",blue:"#3498db",orange:"#f39c12",purple:"#9b59b6"}[s]||`var(--kg-${s}, ${s})`:"var(--kg-primary)",t=this.checked?`--switch-active-color: ${e};`:"";var s;return i`
1
+ var e=Object.defineProperty,t=(t,s,r)=>((t,s,r)=>s in t?e(t,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[s]=r)(t,"symbol"!=typeof s?s+"":s,r);import{LitElement as s,css as r,html as i}from"lit";import"lit/directives/class-map.js";import{F as c}from"../chunks/FormAssociated-DT543PBW.js";class a extends(c(s)){constructor(){super(),this.checked=!1,this.color="primary",this.value="on"}formResetCallback(){this.checked=this.hasAttribute("checked"),this._updateFormValue()}formStateRestoreCallback(e){"checked"===e?this.checked=!0:"unchecked"===e&&(this.checked=!1),this._updateFormValue()}updated(e){e.has("checked")&&this._updateFormValue(),super.updated(e)}_updateFormValue(){const e=this.checked?this.value||"on":null;this.internals.setFormValue(e,this.checked?"checked":"unchecked")}_toggle(){this.disabled||(this.checked=!this.checked,this.dispatchEvent(new CustomEvent("change",{detail:{checked:this.checked},bubbles:!0,composed:!0})))}render(){const e=(s=this.color)&&"primary"!==s?s.startsWith("#")||s.startsWith("rgb")||s.startsWith("hsl")?s:{secondary:"var(--kg-secondary)",tertiary:"var(--kg-tertiary)",error:"#e74c3c",red:"#e74c3c",green:"#2ecc71",blue:"#3498db",orange:"#f39c12",purple:"#9b59b6"}[s]||`var(--kg-${s}, ${s})`:"var(--kg-primary)",t=this.checked?`--switch-active-color: ${e};`:"";var s;return i`
2
2
  <div
3
3
  class="kg-switch-wrapper"
4
4
  style="${t}"
@@ -1,4 +1,4 @@
1
- var e=Object.defineProperty,t=(t,r,a)=>((t,r,a)=>r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[r]=a)(t,"symbol"!=typeof r?r+"":r,a);import{LitElement as r,css as a,html as i}from"lit";import{classMap as o}from"lit/directives/class-map.js";import{F as l}from"../chunks/FormAssociated-Ca1JavvX.js";class s extends(l(r)){constructor(){super(),this.placeholder="",this.rows=3,this.error=!1,this.fullwidth=!1,this.inverted=!1,this.resize="vertical"}_handleInput(e){this.value=e.target.value,this.dispatchEvent(new CustomEvent("kg-input",{detail:{value:this.value},bubbles:!0,composed:!0}))}render(){const e={"ui-textarea":!0,disabled:this.disabled,error:this.error,fullwidth:this.fullwidth,inverted:this.inverted};return i`
1
+ var e=Object.defineProperty,t=(t,r,a)=>((t,r,a)=>r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[r]=a)(t,"symbol"!=typeof r?r+"":r,a);import{LitElement as r,css as a,html as i}from"lit";import{classMap as o}from"lit/directives/class-map.js";import{F as l}from"../chunks/FormAssociated-DT543PBW.js";class s extends(l(r)){constructor(){super(),this.placeholder="",this.rows=3,this.error=!1,this.fullwidth=!1,this.inverted=!1,this.resize="vertical"}_handleInput(e){this.value=e.target.value,this.dispatchEvent(new CustomEvent("kg-input",{detail:{value:this.value},bubbles:!0,composed:!0}))}render(){const e={"ui-textarea":!0,disabled:this.disabled,error:this.error,fullwidth:this.fullwidth,inverted:this.inverted};return i`
2
2
  <div class="kg-textarea-container">
3
3
  ${this.label?i`<label class="textarea-label">${this.label}</label>`:""}
4
4
  <div class="${o(e)}">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lazhus/kg-ui",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -1 +0,0 @@
1
- import{isServer as t}from"lit";const e=e=>class extends e{static get properties(){return{name:{type:String,reflect:!0},value:{type:String,reflect:!0},disabled:{type:Boolean,reflect:!0},required:{type:Boolean,reflect:!0},type:{type:String,reflect:!0}}}static get formAssociated(){return!0}constructor(){super(),this.name="",this.value="",this.disabled=!1,this.required=!1,this.type="text",!t&&this.attachInternals&&(this.internals=this.attachInternals())}get form(){return this.internals?this.internals.form:null}updated(t){super.updated(t),(t.has("value")||t.has("disabled"))&&this._updateFormValue()}_updateFormValue(){!t&&this.internals&&this.internals.setFormValue(this.value)}formResetCallback(){this.value=this.getAttribute("value")||""}formStateRestoreCallback(t){this.value=t}setValidity(e,i,s){!t&&this.internals&&this.internals.setValidity(e,i,s)}checkValidity(){return!this.internals||this.internals.checkValidity()}reportValidity(){return!this.internals||this.internals.reportValidity()}};export{e as F};