@everymatrix/helper-date-navigator 0.2.6 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{helper-date-navigator-212cbc53.js → helper-date-navigator-ad70f19b.js} +1 -1
- package/dist/cjs/helper-date-navigator.cjs.entry.js +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/esm/{helper-date-navigator-6fa6fff7.js → helper-date-navigator-4f3c3c05.js} +1 -1
- package/dist/esm/helper-date-navigator.entry.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/helper-date-navigator/{helper-date-navigator-6fa6fff7.js → helper-date-navigator-4f3c3c05.js} +1 -1
- package/dist/helper-date-navigator/helper-date-navigator.entry.js +1 -1
- package/dist/helper-date-navigator/index.esm.js +1 -1
- package/package.json +1 -1
|
@@ -6817,7 +6817,7 @@ function getAdoptStyleSubscription(stylingContainer, domain) {
|
|
|
6817
6817
|
|
|
6818
6818
|
const shadowRoot = stylingContainer.getRootNode();
|
|
6819
6819
|
const cacheStyleObject = window[StyleCacheKey];
|
|
6820
|
-
let cachedStyle = cacheStyleObject[domain]
|
|
6820
|
+
let cachedStyle = cacheStyleObject[domain] && cacheStyleObject[domain].sheet;
|
|
6821
6821
|
|
|
6822
6822
|
if (!cachedStyle) {
|
|
6823
6823
|
cachedStyle = new CSSStyleSheet();
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -6815,7 +6815,7 @@ function getAdoptStyleSubscription(stylingContainer, domain) {
|
|
|
6815
6815
|
|
|
6816
6816
|
const shadowRoot = stylingContainer.getRootNode();
|
|
6817
6817
|
const cacheStyleObject = window[StyleCacheKey];
|
|
6818
|
-
let cachedStyle = cacheStyleObject[domain]
|
|
6818
|
+
let cachedStyle = cacheStyleObject[domain] && cacheStyleObject[domain].sheet;
|
|
6819
6819
|
|
|
6820
6820
|
if (!cachedStyle) {
|
|
6821
6821
|
cachedStyle = new CSSStyleSheet();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { H as helper_date_navigator } from './helper-date-navigator-
|
|
1
|
+
export { H as helper_date_navigator } from './helper-date-navigator-4f3c3c05.js';
|
|
2
2
|
import './index-aec7c9dd.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { H as HelperDateNavigator } from './helper-date-navigator-
|
|
1
|
+
export { H as HelperDateNavigator } from './helper-date-navigator-4f3c3c05.js';
|
|
2
2
|
import './index-aec7c9dd.js';
|
|
@@ -6654,4 +6654,4 @@ Lt("vaadin-tabs",A`
|
|
|
6654
6654
|
</div>
|
|
6655
6655
|
|
|
6656
6656
|
<div on-click="_scrollForward" part="forward-button" aria-hidden="true"></div>
|
|
6657
|
-
`}static get is(){return"vaadin-tabs"}}g(bl);const gl="__WIDGET_GLOBAL_STYLE_CACHE__";function yl(t,e){if(t){const i=document.createElement("style");i.innerHTML=e,t.appendChild(i)}}function _l(t,e){if(!t||!e)return;const i=new URL(e);fetch(i.href).then((t=>t.text())).then((e=>{const i=document.createElement("style");i.innerHTML=e,t&&t.appendChild(i)})).catch((t=>{console.error("There was an error while trying to load client styling from URL",t)}))}function wl(t,e,i,s=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!s)return i=function(t,e){const i=document.createElement("style");return window.emMessageBus.subscribe(e,(e=>{t&&(i.innerHTML=e,t.appendChild(i))}))}(t,e),i;window[gl]||(window[gl]={}),i=function(t,e){return window.emMessageBus.subscribe(e,(i=>{if(!t)return;const s=t.getRootNode(),o=window[gl];let r=o[e]?.sheet;r?o[e].refCount=o[e].refCount+1:(r=new CSSStyleSheet,r.replaceSync(i),o[e]={sheet:r,refCount:1});const n=s.adoptedStyleSheets||[];n.includes(r)||(s.adoptedStyleSheets=[...n,r])}))}(t,e);const o=i.unsubscribe.bind(i);return i.unsubscribe=()=>{if(window[gl][e]){const t=window[gl][e];t.refCount>1?t.refCount=t.refCount-1:delete window[gl][e]}o()},i}const xl=["ro","en","fr","ar","hr"],kl={en:{weeks:["Su","Mo","Tu","We","Th","Fr","Sa"]}},Cl=r({icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"},{extraSVGAttrs:{width:"16px",height:"16px",fill:"currentColor"}}),Al=r({icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},{extraSVGAttrs:{width:"16px",height:"16px",fill:"currentColor"}}),Sl=r({icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z"}}]},name:"calendar",theme:"outlined"},{extraSVGAttrs:{width:"18px",height:"18px",fill:"var(--emw--color-primary-variant, #1367e7)"}}),zl=class{constructor(i){t(this,i),this.changeDate=e(this,"changeDate",7),this.handleNext=e(this,"next",7),this.handlePrev=e(this,"prev",7),this.handleOutsideClick=t=>{if(!this.showCalendar)return;const e=t.composedPath?t.composedPath():[],i=e.includes(this.calendarRef),s=e.some((t=>{var e,i;return t instanceof HTMLElement&&((null===(e=t.getAttribute("part"))||void 0===e?void 0:e.includes("item"))||(null===(i=t.getAttribute("part"))||void 0===i?void 0:i.includes("overlay")))}));i||s||(this.showCalendar=!1)},this.onYearMinus=()=>{const t=this.yearOptions.map((t=>Number(t.value)));this.alterDate.year-1<Math.min(...t)||(this.alterDate.year--,this.loadRecords())},this.onYearPlus=()=>{const t=this.yearOptions.map((t=>Number(t.value)));this.alterDate.year+1>Math.max(...t)||(this.alterDate.year++,this.loadRecords())},this.onMonthMinus=()=>{0===this.alterDate.month?(this.onYearMinus(),this.alterDate.month=11):(this.alterDate.month--,this.loadRecords())},this.onMonthPlus=()=>{11===this.alterDate.month?(this.onYearPlus(),this.alterDate.month=0):(this.alterDate.month++,this.loadRecords())},this.onYearChange=t=>{this.alterDate.year=parseInt(t.detail.value),this.loadRecords()},this.onMonthChange=t=>{this.alterDate.month=parseInt(t.detail.value)-1,this.loadRecords()},this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.translationUrl="",this.language="en",this.date="",this.defaultHighlightDates=void 0,this.highlightDates=[],this.weeks=void 0,this.days=[],this.alterDate={year:0,month:0,day:0},this.curDate={year:0,month:0,day:0},this.recordInfo=[],this.showCalendar=!1}handleClientStylingChange(t,e){t!=e&&yl(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&_l(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&wl(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}handleGameIdStringChange(t,e){t!=e&&this.setHighlightDates()}componentWillLoad(){(async t=>{if(t)try{const i=await fetch(t);if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);const s=await i.json();e=s,Object.keys(e).forEach((t=>{for(let i in e[t])kl[t][i]=e[t][i]}))}catch(t){console.error("Failed to fetch or parse translations from URL:",t)}var e})(this.translationUrl),this.weeks=(()=>{const t=this.language;let e=kl[void 0!==t&&xl.includes(t)?t:"en"].weeks;return e})();const t=this.date?new Date(this.date):new Date;this.alterDate={year:t.getFullYear(),month:t.getMonth(),day:t.getDate()},this.curDate=Object.assign({},this.alterDate),this.loadRecords()}handleDateChange(){const t=this.date?new Date(this.date):new Date;this.alterDate={year:t.getFullYear(),month:t.getMonth(),day:t.getDate()},this.curDate=Object.assign({},this.alterDate),this.loadRecords()}setHighlightDates(){if(this.defaultHighlightDates)try{this.highlightDates=JSON.parse(this.defaultHighlightDates)}catch(t){this.highlightDates=[]}}componentDidLoad(){this.stylingContainer&&(this.mbSource&&wl(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&yl(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&_l(this.stylingContainer,this.clientStylingUrl)),this.setHighlightDates(),document.addEventListener("click",this.handleOutsideClick)}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe(),document.removeEventListener("click",this.handleOutsideClick)}get yearOptions(){return Array.from({length:101},((t,e)=>this.alterDate.year-50+e)).map((t=>({label:String(t),value:String(t)})))}get monthOptions(){return Array.from({length:12},((t,e)=>e+1)).map((t=>({label:String(t),value:String(t)})))}loadRecords(){const{year:t,month:e}=this.alterDate;this.setDays(t,e)}setDays(t,e){this.days=[];const i=new Date(t,e,1).getDay(),s=new Date(t,e,1-i);for(let t=0;t<42;t++){const e=new Date(s);e.setDate(s.getDate()+t);const i={date:e.getDate(),month:e.getMonth(),year:e.getFullYear()};this.days.push(i)}}getFullDayOfMonth(t,e){return new Date(t,e,0).getDate()}showFormatedDate(t){return`${t.day}/${t.month+1}/${t.year}`}handleSelectDate(t,e,i){this.alterDate.day=t,this.curDate=Object.assign({},this.alterDate),this.showCalendar=!1;const s=this.highlightDates.map((t=>{const e=new Date(t);return{year:e.getFullYear(),month:e.getMonth(),day:e.getDate()}})).findIndex((s=>{const{year:o,month:r,day:n}=s;return e===r&&i===o&&t===n}));s>-1&&this.changeDate.emit(s)}tellIsCurDay(t,e,i){return this.curDate.day===t&&this.curDate.month===e&&this.curDate.year===i}tellIsHighLight(t,e,i){return!(!this.highlightDates||!this.highlightDates.length)&&this.highlightDates.map((t=>{const e=new Date(t);return{year:e.getFullYear(),month:e.getMonth(),day:e.getDate()}})).some((s=>{const{year:o,month:r,day:n}=s;return e===r&&i===o&&t===n}))}renderInner(){const t=["calendar",this.showCalendar?"calendar-visible":"calendar-leave"];return i("div",{class:"lottery-tipping-calendar",ref:t=>this.calendarRef=t},i("div",{class:"calling-input",onClick:()=>{this.showCalendar=!0}},i("div",{class:"calling-input-text"},this.showFormatedDate(this.curDate)),i("div",{class:"calling-input-icon",innerHTML:Sl})),i("div",{class:t.join(" ")},i("div",{class:"calendar-header"},i("div",{class:"date-controller year-minus",onClick:this.onYearMinus},"<"),i("div",{class:"date-controller month-minus",onClick:this.onMonthMinus},"<"),i("div",{class:"date-picker"},i("div",{class:"date-picker-year"},i("vaadin-select",{items:this.yearOptions,value:this.alterDate.year,style:{"--vaadin-field-default-width":"90px"},"on-value-changed":this.onYearChange.bind(this)})),i("div",{class:"date-picker-delimiter"},"-"),i("div",{class:"date-picker-month"},i("vaadin-select",{items:this.monthOptions,value:this.alterDate.month+1,style:{"--vaadin-field-default-width":"64px"},"on-value-changed":this.onMonthChange.bind(this)})),i("div",{class:"date-picker-delimiter"},"-"),i("div",{class:"date-picker-day"},this.alterDate.day)),i("div",{class:"date-controller month-plus",onClick:this.onMonthPlus},">"),i("div",{class:"date-controller year-plus",onClick:this.onYearPlus},">")),i("div",{class:"calendar-content"},i("div",{class:"calendar-content-week"},this.weeks.map((t=>i("div",{class:"week-item"},t)))),i("div",{class:"calendar-content-day"},this.days.map((t=>i("div",{class:{"day-item":!0,isCurDay:this.tellIsCurDay(t.date,t.month,t.year),isHighLight:this.tellIsHighLight(t.date,t.month,t.year)},onClick:()=>this.handleSelectDate(t.date,t.month,t.year)},t.date)))))))}render(){return i("div",{key:"da34c4c86cac49411fb15ab8bceda89e379befc6",class:"date-selection"},i("div",{key:"29f06ef7a5df466018ae6561b54fcbdfbab9f23b",class:"date-selection-leftIcon",innerHTML:Cl,onClick:()=>this.handlePrev.emit()}),i("div",{key:"c6d75d873c2683752c37d4083c57761c4f7e523b",class:"date-selection-calendar"},this.renderInner()),i("div",{key:"8b16b3e0761dd4c877f169aea84d028aaf193b69",class:"date-selection-rightIcon",innerHTML:Al,onClick:()=>this.handleNext.emit()}))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"],defaultHighlightDates:["handleGameIdStringChange"],date:["handleDateChange"]}}};zl.style='.lottery-tipping-calendar{position:relative;display:inline-block}.calendar-visible{opacity:1;visibility:visible}.calendar-leave{opacity:0;visibility:hidden}.calendar{position:absolute;top:40px;left:-50%;background:var(--emw--color-background, #fff);color:var(--emw--color-typography-secondary, #6f6f6f);padding:16px;width:fit-content;border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));border-radius:var(--emw--border-radius-small, 4px);box-shadow:2px 3px 5px rgba(0, 0, 0, 0.1);cursor:pointer;transition:opacity 0.2s ease, visibility 0.2s ease;z-index:99}.calendar-header{display:flex;align-items:center}.calendar-header .date-picker{display:flex;margin:0 18px;align-items:center}.calendar-header .date-picker-delimiter{font-size:16px;margin:auto 4px}.calendar-header .month-plus,.calendar-header .month-minus,.calendar-header .year-plus,.calendar-header .year-minus{cursor:pointer;font-size:14px}.calendar-header .month-plus:hover,.calendar-header .month-minus:hover,.calendar-header .year-plus:hover,.calendar-header .year-minus:hover{color:var(--emw-pool-game-acition-active, #005fdb);transition:color 0.2s}.calendar-header .year-minus,.calendar-header .month-plus{margin-right:6px}.calendar-content{padding:3px;width:fit-content}.calendar-content .day-item{text-align:center;line-height:40px;cursor:not-allowed;position:relative;pointer-events:none}.calendar-content .day-item:hover{background-color:var(--emw--color-background-secondary, #f5f5f5)}.calendar-content .day-item.isCurDay{border-radius:4px;background:var(--emw--color-secondary, #fff3b9);background-size:50%;color:var(--emw--color-typography-secondary, #6f6f6f);font-weight:600;box-shadow:2px 2px 2px var(--emw-calender-curday-box-shadow, rgba(0, 0, 0, 0.09));cursor:pointer;pointer-events:all}.calendar-content .day-item.isHighLight{cursor:pointer;pointer-events:all}.calendar-content .day-item.isHighLight::after{content:"";position:absolute;left:calc(50% - 4px);bottom:0;width:6px;height:6px;border-radius:50%;background-color:var(--emw--color-error, red)}.calendar-content-week{display:grid;grid-template-columns:repeat(7, 40px);grid-template-rows:repeat(1, 36px);justify-items:center;align-items:center;border-bottom:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));color:var(--emw--color-typography-secondary, #6f6f6f)}.calendar-content-day{margin-top:4px;display:grid;grid-template-rows:repeat(6, 40px);grid-template-columns:repeat(7, 40px)}.calling-input{height:36px;width:160px;display:flex;align-items:center;justify-content:space-between;padding:0px 4px;background-color:var(--emw--color-background, #f5f5f5);border-radius:var(--emw--border-radius-small, 4px);border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));cursor:pointer}.calling-input .input{color:var(--emw--color-typography, #000)}.calling-input-text{color:var(--emw--color-typography, #000)}.date-selection{display:flex;align-items:center;justify-content:center;gap:24px}.date-selection-leftIcon,.date-selection-rightIcon{cursor:pointer;color:var(--emw--color-typography, #000)}';export{zl as H}
|
|
6657
|
+
`}static get is(){return"vaadin-tabs"}}g(bl);const gl="__WIDGET_GLOBAL_STYLE_CACHE__";function yl(t,e){if(t){const i=document.createElement("style");i.innerHTML=e,t.appendChild(i)}}function _l(t,e){if(!t||!e)return;const i=new URL(e);fetch(i.href).then((t=>t.text())).then((e=>{const i=document.createElement("style");i.innerHTML=e,t&&t.appendChild(i)})).catch((t=>{console.error("There was an error while trying to load client styling from URL",t)}))}function wl(t,e,i,s=!1){if(!window.emMessageBus)return;if(!("adoptedStyleSheets"in Document.prototype)||!s)return i=function(t,e){const i=document.createElement("style");return window.emMessageBus.subscribe(e,(e=>{t&&(i.innerHTML=e,t.appendChild(i))}))}(t,e),i;window[gl]||(window[gl]={}),i=function(t,e){return window.emMessageBus.subscribe(e,(i=>{if(!t)return;const s=t.getRootNode(),o=window[gl];let r=o[e]&&o[e].sheet;r?o[e].refCount=o[e].refCount+1:(r=new CSSStyleSheet,r.replaceSync(i),o[e]={sheet:r,refCount:1});const n=s.adoptedStyleSheets||[];n.includes(r)||(s.adoptedStyleSheets=[...n,r])}))}(t,e);const o=i.unsubscribe.bind(i);return i.unsubscribe=()=>{if(window[gl][e]){const t=window[gl][e];t.refCount>1?t.refCount=t.refCount-1:delete window[gl][e]}o()},i}const xl=["ro","en","fr","ar","hr"],kl={en:{weeks:["Su","Mo","Tu","We","Th","Fr","Sa"]}},Cl=r({icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"},{extraSVGAttrs:{width:"16px",height:"16px",fill:"currentColor"}}),Al=r({icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},{extraSVGAttrs:{width:"16px",height:"16px",fill:"currentColor"}}),Sl=r({icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z"}}]},name:"calendar",theme:"outlined"},{extraSVGAttrs:{width:"18px",height:"18px",fill:"var(--emw--color-primary-variant, #1367e7)"}}),zl=class{constructor(i){t(this,i),this.changeDate=e(this,"changeDate",7),this.handleNext=e(this,"next",7),this.handlePrev=e(this,"prev",7),this.handleOutsideClick=t=>{if(!this.showCalendar)return;const e=t.composedPath?t.composedPath():[],i=e.includes(this.calendarRef),s=e.some((t=>{var e,i;return t instanceof HTMLElement&&((null===(e=t.getAttribute("part"))||void 0===e?void 0:e.includes("item"))||(null===(i=t.getAttribute("part"))||void 0===i?void 0:i.includes("overlay")))}));i||s||(this.showCalendar=!1)},this.onYearMinus=()=>{const t=this.yearOptions.map((t=>Number(t.value)));this.alterDate.year-1<Math.min(...t)||(this.alterDate.year--,this.loadRecords())},this.onYearPlus=()=>{const t=this.yearOptions.map((t=>Number(t.value)));this.alterDate.year+1>Math.max(...t)||(this.alterDate.year++,this.loadRecords())},this.onMonthMinus=()=>{0===this.alterDate.month?(this.onYearMinus(),this.alterDate.month=11):(this.alterDate.month--,this.loadRecords())},this.onMonthPlus=()=>{11===this.alterDate.month?(this.onYearPlus(),this.alterDate.month=0):(this.alterDate.month++,this.loadRecords())},this.onYearChange=t=>{this.alterDate.year=parseInt(t.detail.value),this.loadRecords()},this.onMonthChange=t=>{this.alterDate.month=parseInt(t.detail.value)-1,this.loadRecords()},this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.translationUrl="",this.language="en",this.date="",this.defaultHighlightDates=void 0,this.highlightDates=[],this.weeks=void 0,this.days=[],this.alterDate={year:0,month:0,day:0},this.curDate={year:0,month:0,day:0},this.recordInfo=[],this.showCalendar=!1}handleClientStylingChange(t,e){t!=e&&yl(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&_l(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&wl(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}handleGameIdStringChange(t,e){t!=e&&this.setHighlightDates()}componentWillLoad(){(async t=>{if(t)try{const i=await fetch(t);if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);const s=await i.json();e=s,Object.keys(e).forEach((t=>{for(let i in e[t])kl[t][i]=e[t][i]}))}catch(t){console.error("Failed to fetch or parse translations from URL:",t)}var e})(this.translationUrl),this.weeks=(()=>{const t=this.language;let e=kl[void 0!==t&&xl.includes(t)?t:"en"].weeks;return e})();const t=this.date?new Date(this.date):new Date;this.alterDate={year:t.getFullYear(),month:t.getMonth(),day:t.getDate()},this.curDate=Object.assign({},this.alterDate),this.loadRecords()}handleDateChange(){const t=this.date?new Date(this.date):new Date;this.alterDate={year:t.getFullYear(),month:t.getMonth(),day:t.getDate()},this.curDate=Object.assign({},this.alterDate),this.loadRecords()}setHighlightDates(){if(this.defaultHighlightDates)try{this.highlightDates=JSON.parse(this.defaultHighlightDates)}catch(t){this.highlightDates=[]}}componentDidLoad(){this.stylingContainer&&(this.mbSource&&wl(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&yl(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&_l(this.stylingContainer,this.clientStylingUrl)),this.setHighlightDates(),document.addEventListener("click",this.handleOutsideClick)}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe(),document.removeEventListener("click",this.handleOutsideClick)}get yearOptions(){return Array.from({length:101},((t,e)=>this.alterDate.year-50+e)).map((t=>({label:String(t),value:String(t)})))}get monthOptions(){return Array.from({length:12},((t,e)=>e+1)).map((t=>({label:String(t),value:String(t)})))}loadRecords(){const{year:t,month:e}=this.alterDate;this.setDays(t,e)}setDays(t,e){this.days=[];const i=new Date(t,e,1).getDay(),s=new Date(t,e,1-i);for(let t=0;t<42;t++){const e=new Date(s);e.setDate(s.getDate()+t);const i={date:e.getDate(),month:e.getMonth(),year:e.getFullYear()};this.days.push(i)}}getFullDayOfMonth(t,e){return new Date(t,e,0).getDate()}showFormatedDate(t){return`${t.day}/${t.month+1}/${t.year}`}handleSelectDate(t,e,i){this.alterDate.day=t,this.curDate=Object.assign({},this.alterDate),this.showCalendar=!1;const s=this.highlightDates.map((t=>{const e=new Date(t);return{year:e.getFullYear(),month:e.getMonth(),day:e.getDate()}})).findIndex((s=>{const{year:o,month:r,day:n}=s;return e===r&&i===o&&t===n}));s>-1&&this.changeDate.emit(s)}tellIsCurDay(t,e,i){return this.curDate.day===t&&this.curDate.month===e&&this.curDate.year===i}tellIsHighLight(t,e,i){return!(!this.highlightDates||!this.highlightDates.length)&&this.highlightDates.map((t=>{const e=new Date(t);return{year:e.getFullYear(),month:e.getMonth(),day:e.getDate()}})).some((s=>{const{year:o,month:r,day:n}=s;return e===r&&i===o&&t===n}))}renderInner(){const t=["calendar",this.showCalendar?"calendar-visible":"calendar-leave"];return i("div",{class:"lottery-tipping-calendar",ref:t=>this.calendarRef=t},i("div",{class:"calling-input",onClick:()=>{this.showCalendar=!0}},i("div",{class:"calling-input-text"},this.showFormatedDate(this.curDate)),i("div",{class:"calling-input-icon",innerHTML:Sl})),i("div",{class:t.join(" ")},i("div",{class:"calendar-header"},i("div",{class:"date-controller year-minus",onClick:this.onYearMinus},"<"),i("div",{class:"date-controller month-minus",onClick:this.onMonthMinus},"<"),i("div",{class:"date-picker"},i("div",{class:"date-picker-year"},i("vaadin-select",{items:this.yearOptions,value:this.alterDate.year,style:{"--vaadin-field-default-width":"90px"},"on-value-changed":this.onYearChange.bind(this)})),i("div",{class:"date-picker-delimiter"},"-"),i("div",{class:"date-picker-month"},i("vaadin-select",{items:this.monthOptions,value:this.alterDate.month+1,style:{"--vaadin-field-default-width":"64px"},"on-value-changed":this.onMonthChange.bind(this)})),i("div",{class:"date-picker-delimiter"},"-"),i("div",{class:"date-picker-day"},this.alterDate.day)),i("div",{class:"date-controller month-plus",onClick:this.onMonthPlus},">"),i("div",{class:"date-controller year-plus",onClick:this.onYearPlus},">")),i("div",{class:"calendar-content"},i("div",{class:"calendar-content-week"},this.weeks.map((t=>i("div",{class:"week-item"},t)))),i("div",{class:"calendar-content-day"},this.days.map((t=>i("div",{class:{"day-item":!0,isCurDay:this.tellIsCurDay(t.date,t.month,t.year),isHighLight:this.tellIsHighLight(t.date,t.month,t.year)},onClick:()=>this.handleSelectDate(t.date,t.month,t.year)},t.date)))))))}render(){return i("div",{key:"da34c4c86cac49411fb15ab8bceda89e379befc6",class:"date-selection"},i("div",{key:"29f06ef7a5df466018ae6561b54fcbdfbab9f23b",class:"date-selection-leftIcon",innerHTML:Cl,onClick:()=>this.handlePrev.emit()}),i("div",{key:"c6d75d873c2683752c37d4083c57761c4f7e523b",class:"date-selection-calendar"},this.renderInner()),i("div",{key:"8b16b3e0761dd4c877f169aea84d028aaf193b69",class:"date-selection-rightIcon",innerHTML:Al,onClick:()=>this.handleNext.emit()}))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"],defaultHighlightDates:["handleGameIdStringChange"],date:["handleDateChange"]}}};zl.style='.lottery-tipping-calendar{position:relative;display:inline-block}.calendar-visible{opacity:1;visibility:visible}.calendar-leave{opacity:0;visibility:hidden}.calendar{position:absolute;top:40px;left:-50%;background:var(--emw--color-background, #fff);color:var(--emw--color-typography-secondary, #6f6f6f);padding:16px;width:fit-content;border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));border-radius:var(--emw--border-radius-small, 4px);box-shadow:2px 3px 5px rgba(0, 0, 0, 0.1);cursor:pointer;transition:opacity 0.2s ease, visibility 0.2s ease;z-index:99}.calendar-header{display:flex;align-items:center}.calendar-header .date-picker{display:flex;margin:0 18px;align-items:center}.calendar-header .date-picker-delimiter{font-size:16px;margin:auto 4px}.calendar-header .month-plus,.calendar-header .month-minus,.calendar-header .year-plus,.calendar-header .year-minus{cursor:pointer;font-size:14px}.calendar-header .month-plus:hover,.calendar-header .month-minus:hover,.calendar-header .year-plus:hover,.calendar-header .year-minus:hover{color:var(--emw-pool-game-acition-active, #005fdb);transition:color 0.2s}.calendar-header .year-minus,.calendar-header .month-plus{margin-right:6px}.calendar-content{padding:3px;width:fit-content}.calendar-content .day-item{text-align:center;line-height:40px;cursor:not-allowed;position:relative;pointer-events:none}.calendar-content .day-item:hover{background-color:var(--emw--color-background-secondary, #f5f5f5)}.calendar-content .day-item.isCurDay{border-radius:4px;background:var(--emw--color-secondary, #fff3b9);background-size:50%;color:var(--emw--color-typography-secondary, #6f6f6f);font-weight:600;box-shadow:2px 2px 2px var(--emw-calender-curday-box-shadow, rgba(0, 0, 0, 0.09));cursor:pointer;pointer-events:all}.calendar-content .day-item.isHighLight{cursor:pointer;pointer-events:all}.calendar-content .day-item.isHighLight::after{content:"";position:absolute;left:calc(50% - 4px);bottom:0;width:6px;height:6px;border-radius:50%;background-color:var(--emw--color-error, red)}.calendar-content-week{display:grid;grid-template-columns:repeat(7, 40px);grid-template-rows:repeat(1, 36px);justify-items:center;align-items:center;border-bottom:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));color:var(--emw--color-typography-secondary, #6f6f6f)}.calendar-content-day{margin-top:4px;display:grid;grid-template-rows:repeat(6, 40px);grid-template-columns:repeat(7, 40px)}.calling-input{height:36px;width:160px;display:flex;align-items:center;justify-content:space-between;padding:0px 4px;background-color:var(--emw--color-background, #f5f5f5);border-radius:var(--emw--border-radius-small, 4px);border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));cursor:pointer}.calling-input .input{color:var(--emw--color-typography, #000)}.calling-input-text{color:var(--emw--color-typography, #000)}.date-selection{display:flex;align-items:center;justify-content:center;gap:24px}.date-selection-leftIcon,.date-selection-rightIcon{cursor:pointer;color:var(--emw--color-typography, #000)}';export{zl as H}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{H as helper_date_navigator}from"./helper-date-navigator-
|
|
1
|
+
export{H as helper_date_navigator}from"./helper-date-navigator-4f3c3c05.js";import"./index-aec7c9dd.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{H as HelperDateNavigator}from"./helper-date-navigator-
|
|
1
|
+
export{H as HelperDateNavigator}from"./helper-date-navigator-4f3c3c05.js";import"./index-aec7c9dd.js";
|