@hbis-uni/components 1.0.9 → 2.0.0

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/index.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),B=e.defineComponent({__name:"C1",props:{title:{default:"C1 Component"},primary:{type:Boolean,default:!1}},setup(o){return(d,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["c1-container",{"c1-primary":o.primary}])},[e.renderSlot(d.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(o.title),1)],!0)],2))}}),k=(o,d)=>{const s=o.__vccOpts||o;for(const[u,c]of d)s[u]=c;return s},S=k(B,[["__scopeId","data-v-e2028f64"]]),w={class:"c2-container"},N={class:"c2-title"},T={class:"c2-content"},E=e.defineComponent({__name:"C2",props:{title:{default:"C2 Component"},showButton:{type:Boolean,default:!0},buttonText:{default:"Click Me"}},emits:["click"],setup(o,{emit:d}){const s=d,u=c=>{s("click",c)};return(c,m)=>(e.openBlock(),e.createElementBlock("div",w,[e.createElementVNode("h2",N,e.toDisplayString(o.title),1),e.createElementVNode("div",T,[e.renderSlot(c.$slots,"default",{},void 0,!0)]),o.showButton?(e.openBlock(),e.createElementBlock("button",{key:0,class:"c2-button",onClick:u},e.toDisplayString(o.buttonText),1)):e.createCommentVNode("",!0)]))}}),V=k(E,[["__scopeId","data-v-b1d573ae"]]),W={key:0},$={class:"hbis-date-strip__weekdays"},z={class:"hbis-date-strip__dates"},F=["onClick"],L={class:"hbis-date-strip__date-number"},M={key:1,class:"hbis-date-strip__scroll-wrapper"},I={class:"hbis-date-strip__scroll-container"},x={class:"hbis-date-strip__weekdays"},H={class:"hbis-date-strip__dates"},O=["onClick"],P={class:"hbis-date-strip__date-number"},j={key:2,class:"hbis-date-strip__custom"},A=e.defineComponent({__name:"hbis-dateStrip",props:{modelValue:{default:()=>new Date},startDate:{default:()=>new Date},endDate:{default:()=>{const o=new Date;return o.setDate(o.getDate()+30),o}},highlightType:{default:"bg"},showToday:{type:Boolean,default:!0},disablePast:{type:Boolean,default:!1},disableFuture:{type:Boolean,default:!1},selectedColor:{default:"#ffffff"},normalColor:{default:"#666666"},selectedBgColor:{default:"#1890ff"},normalBgColor:{default:"transparent"},scrollable:{type:Boolean,default:!1},visibleDays:{default:7}},emits:["update:modelValue","dateClick"],setup(o,{emit:d}){const s=o,u=d,c=e.computed(()=>{if(console.log("props:",{startDate:s.startDate,endDate:s.endDate,scrollable:s.scrollable}),s.scrollable)return console.log("显式设置了scrollable为true,允许滚动"),!0;try{const t=new Date(s.startDate);t.setHours(0,0,0,0);const l=new Date(s.endDate);if(l.setHours(0,0,0,0),isNaN(t.getTime())||isNaN(l.getTime()))return console.log("无效的日期对象,使用默认滚动行为"),!1;const a=l.getTime()-t.getTime(),n=Math.ceil(a/(1e3*60*60*24)),i=n+1;return console.log("日期范围天数计算:",{start:t.toLocaleDateString(),end:l.toLocaleDateString(),diffTime:a,diffDays:n,totalDays:i,shouldScroll:i>7}),i>7}catch(t){return console.error("计算日期范围时出错:",t),!1}}),m=[{value:0,label:"日",isWeekend:!0},{value:1,label:"一",isWeekend:!1},{value:2,label:"二",isWeekend:!1},{value:3,label:"三",isWeekend:!1},{value:4,label:"四",isWeekend:!1},{value:5,label:"五",isWeekend:!1},{value:6,label:"六",isWeekend:!0}],_=e.computed(()=>{const t=g.value[0];if(!t)return m;const l=t.weekday,a=[];for(let n=0;n<7;n++){const i=(l+n)%7;a.push(m[i])}return a}),D=()=>{const t=s.startDate||new Date,l=t.getDay(),a=t.getDate()-(l===0?6:l-1),n=new Date(t);return n.setDate(a),n};e.ref(D()),e.onMounted(()=>{console.log("props:",s),console.log("highlightType:",s.highlightType)}),e.watch(()=>s.highlightType,t=>{console.log("highlightType changed:",t)}),e.watch(()=>s.modelValue,t=>{console.log("modelValue changed:",t)});const v=e.computed(()=>{const t=[];try{const l=s.startDate,a=s.endDate;if(isNaN(l.getTime())||isNaN(a.getTime()))return console.log("无效的日期对象,返回空数组"),t;const n=Math.ceil((a.getTime()-l.getTime())/(1e3*60*60*24))+1;for(let i=0;i<n;i++){const r=new Date(l);r.setDate(l.getDate()+i),isNaN(r.getTime())||t.push({date:r,dateString:f(r),day:r.getDate(),month:r.getMonth()+1,year:r.getFullYear(),isWeekend:r.getDay()===0||r.getDay()===6,weekday:r.getDay()})}}catch(l){console.error("生成日期数组时出错:",l)}return t}),g=e.computed(()=>v.value.filter(t=>!!(t&&t.date&&t.dateString&&!isNaN(t.date.getTime())&&typeof t.dateString=="string"&&typeof t.day=="number"))),f=t=>`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`,h=t=>{const l=t.dateString;return s.modelValue?Array.isArray(s.modelValue)?s.modelValue.some(a=>!a||isNaN(a.getTime())?!1:f(a)===l):isNaN(s.modelValue.getTime())?!1:f(s.modelValue)===l:!1},y=t=>{const l=f(new Date);return t.dateString===l},p=t=>{const l=t.date;return s.disablePast&&l<new Date(new Date().setHours(0,0,0,0))||s.disableFuture&&l>new Date(new Date().setHours(23,59,59,999))?!1:l>=s.startDate&&l<=s.endDate},C=t=>{var l;return((l=m.find(a=>a.value===t))==null?void 0:l.label)||""},b=t=>{p(t)&&(u("dateClick",t),u("update:modelValue",t.date))};return(t,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["hbis-date-strip",{"hbis-date-strip--highlight-bg":o.highlightType==="bg","hbis-date-strip--highlight-dot":o.highlightType==="dot","hbis-date-strip--highlight-round":o.highlightType==="round","hbis-date-strip--scrollable":c.value}])},[c.value?(e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("div",I,[e.createElementVNode("div",x,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.dateString+"-weekday",class:e.normalizeClass(["hbis-date-strip__weekday",{"hbis-date-strip__weekday--weekend":a.isWeekend}])},e.toDisplayString(C(a.weekday)),3))),128))]),e.createElementVNode("div",H,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.dateString,class:e.normalizeClass(["hbis-date-strip__date",{"hbis-date-strip__date--selected":h(a),"hbis-date-strip__date--today":y(a),"hbis-date-strip__date--disabled":!p(a),"hbis-date-strip__date--weekend":a.isWeekend}]),style:e.normalizeStyle({color:h(a)?o.selectedColor:o.normalColor,backgroundColor:h(a)?o.selectedBgColor:o.normalBgColor}),onClick:n=>b(a)},[e.createElementVNode("div",P,e.toDisplayString(a.day),1)],14,O))),128))])])])):(e.openBlock(),e.createElementBlock("div",W,[e.createElementVNode("div",$,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.value,class:e.normalizeClass(["hbis-date-strip__weekday",{"hbis-date-strip__weekday--weekend":a.isWeekend}])},e.toDisplayString(a.label),3))),128))]),e.createElementVNode("div",z,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.dateString,class:e.normalizeClass(["hbis-date-strip__date",{"hbis-date-strip__date--selected":h(a),"hbis-date-strip__date--today":y(a),"hbis-date-strip__date--disabled":!p(a),"hbis-date-strip__date--weekend":a.isWeekend}]),style:e.normalizeStyle({color:h(a)?o.selectedColor:o.normalColor,backgroundColor:h(a)?o.selectedBgColor:o.normalBgColor}),onClick:n=>b(a)},[e.createElementVNode("div",L,e.toDisplayString(a.day),1)],14,F))),128))])])),t.$slots.default?(e.openBlock(),e.createElementBlock("div",j,[e.renderSlot(t.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0)],2))}}),Y=k(A,[["__scopeId","data-v-7591067b"]]);exports.C1=S;exports.C2=V;exports.hbisDateStrip=Y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),B=e.defineComponent({__name:"C1",props:{title:{default:"C1 Component"},primary:{type:Boolean,default:!1}},setup(o){return(c,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["c1-container",{"c1-primary":o.primary}])},[e.renderSlot(c.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(o.title),1)],!0)],2))}}),k=(o,c)=>{const s=o.__vccOpts||o;for(const[u,d]of c)s[u]=d;return s},S=k(B,[["__scopeId","data-v-e2250793"]]),w={class:"c2-container"},N={class:"c2-title"},T={class:"c2-content"},E=e.defineComponent({__name:"C2",props:{title:{default:"C2 Component"},showButton:{type:Boolean,default:!0},buttonText:{default:"Click Me"}},emits:["click"],setup(o,{emit:c}){const s=c,u=d=>{s("click",d)};return(d,m)=>(e.openBlock(),e.createElementBlock("div",w,[e.createElementVNode("h2",N,e.toDisplayString(o.title),1),e.createElementVNode("div",T,[e.renderSlot(d.$slots,"default",{},void 0,!0)]),o.showButton?(e.openBlock(),e.createElementBlock("button",{key:0,class:"c2-button",onClick:u},e.toDisplayString(o.buttonText),1)):e.createCommentVNode("",!0)]))}}),V=k(E,[["__scopeId","data-v-ed1086ed"]]),W={key:0},$={class:"hbis-date-strip__weekdays"},z={class:"hbis-date-strip__dates"},F=["onClick"],L={class:"hbis-date-strip__date-number"},M={class:"hbis-date-strip__date-slot"},I={key:1,class:"hbis-date-strip__scroll-wrapper"},x={class:"hbis-date-strip__scroll-container"},H={class:"hbis-date-strip__weekdays"},O={class:"hbis-date-strip__dates"},P=["onClick"],j={class:"hbis-date-strip__date-number"},A={class:"hbis-date-strip__date-slot"},Y=e.defineComponent({__name:"hbis-dateStrip",props:{modelValue:{default:()=>new Date},startDate:{default:()=>new Date},endDate:{default:()=>{const o=new Date;return o.setDate(o.getDate()+30),o}},highlightType:{default:"bg"},showToday:{type:Boolean,default:!0},disablePast:{type:Boolean,default:!1},disableFuture:{type:Boolean,default:!1},selectedColor:{default:"#ffffff"},normalColor:{default:"#666666"},selectedBgColor:{default:"#1890ff"},normalBgColor:{default:"transparent"},scrollable:{type:Boolean,default:!1},visibleDays:{default:7}},emits:["update:modelValue","dateClick"],setup(o,{emit:c}){const s=o,u=c,d=e.computed(()=>{if(console.log("props:",{startDate:s.startDate,endDate:s.endDate,scrollable:s.scrollable}),s.scrollable)return console.log("显式设置了scrollable为true,允许滚动"),!0;try{const t=new Date(s.startDate);t.setHours(0,0,0,0);const l=new Date(s.endDate);if(l.setHours(0,0,0,0),isNaN(t.getTime())||isNaN(l.getTime()))return console.log("无效的日期对象,使用默认滚动行为"),!1;const a=l.getTime()-t.getTime(),n=Math.ceil(a/(1e3*60*60*24)),i=n+1;return console.log("日期范围天数计算:",{start:t.toLocaleDateString(),end:l.toLocaleDateString(),diffTime:a,diffDays:n,totalDays:i,shouldScroll:i>7}),i>7}catch(t){return console.error("计算日期范围时出错:",t),!1}}),m=[{value:0,label:"日",isWeekend:!0},{value:1,label:"一",isWeekend:!1},{value:2,label:"二",isWeekend:!1},{value:3,label:"三",isWeekend:!1},{value:4,label:"四",isWeekend:!1},{value:5,label:"五",isWeekend:!1},{value:6,label:"六",isWeekend:!0}],b=e.computed(()=>{const t=g.value[0];if(!t)return m;const l=t.weekday,a=[];for(let n=0;n<7;n++){const i=(l+n)%7;a.push(m[i])}return a}),D=()=>{const t=s.startDate||new Date,l=t.getDay(),a=t.getDate()-(l===0?6:l-1),n=new Date(t);return n.setDate(a),n};e.ref(D()),e.onMounted(()=>{console.log("props:",s),console.log("highlightType:",s.highlightType)}),e.watch(()=>s.highlightType,t=>{console.log("highlightType changed:",t)}),e.watch(()=>s.modelValue,t=>{console.log("modelValue changed:",t)});const v=e.computed(()=>{const t=[];try{const l=s.startDate,a=s.endDate;if(isNaN(l.getTime())||isNaN(a.getTime()))return console.log("无效的日期对象,返回空数组"),t;const n=Math.ceil((a.getTime()-l.getTime())/(1e3*60*60*24))+1;for(let i=0;i<n;i++){const r=new Date(l);r.setDate(l.getDate()+i),isNaN(r.getTime())||t.push({date:r,dateString:f(r),day:r.getDate(),month:r.getMonth()+1,year:r.getFullYear(),isWeekend:r.getDay()===0||r.getDay()===6,weekday:r.getDay()})}}catch(l){console.error("生成日期数组时出错:",l)}return t}),g=e.computed(()=>v.value.filter(t=>!!(t&&t.date&&t.dateString&&!isNaN(t.date.getTime())&&typeof t.dateString=="string"&&typeof t.day=="number"))),f=t=>`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`,h=t=>{const l=t.dateString;return s.modelValue?Array.isArray(s.modelValue)?s.modelValue.some(a=>!a||isNaN(a.getTime())?!1:f(a)===l):isNaN(s.modelValue.getTime())?!1:f(s.modelValue)===l:!1},y=t=>{const l=f(new Date);return t.dateString===l},p=t=>{const l=t.date;return s.disablePast&&l<new Date(new Date().setHours(0,0,0,0))||s.disableFuture&&l>new Date(new Date().setHours(23,59,59,999))?!1:l>=s.startDate&&l<=s.endDate},C=t=>{var l;return((l=m.find(a=>a.value===t))==null?void 0:l.label)||""},_=t=>{p(t)&&(u("dateClick",t),u("update:modelValue",t.date))};return(t,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["hbis-date-strip",{"hbis-date-strip--highlight-bg":o.highlightType==="bg","hbis-date-strip--highlight-dot":o.highlightType==="dot","hbis-date-strip--highlight-round":o.highlightType==="round","hbis-date-strip--scrollable":d.value}])},[d.value?(e.openBlock(),e.createElementBlock("div",I,[e.createElementVNode("div",x,[e.createElementVNode("div",H,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.dateString+"-weekday",class:e.normalizeClass(["hbis-date-strip__weekday",{"hbis-date-strip__weekday--weekend":a.isWeekend}])},e.toDisplayString(C(a.weekday)),3))),128))]),e.createElementVNode("div",O,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.dateString,class:e.normalizeClass(["hbis-date-strip__date",{"hbis-date-strip__date--selected":h(a),"hbis-date-strip__date--today":y(a),"hbis-date-strip__date--disabled":!p(a),"hbis-date-strip__date--weekend":a.isWeekend}]),style:e.normalizeStyle({color:h(a)?o.selectedColor:o.normalColor,backgroundColor:h(a)?o.selectedBgColor:o.normalBgColor}),onClick:n=>_(a)},[e.createElementVNode("div",j,e.toDisplayString(a.day),1),e.createElementVNode("div",A,[e.renderSlot(t.$slots,"default",{date:a},void 0,!0)])],14,P))),128))])])])):(e.openBlock(),e.createElementBlock("div",W,[e.createElementVNode("div",$,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.value,class:e.normalizeClass(["hbis-date-strip__weekday",{"hbis-date-strip__weekday--weekend":a.isWeekend}])},e.toDisplayString(a.label),3))),128))]),e.createElementVNode("div",z,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.dateString,class:e.normalizeClass(["hbis-date-strip__date",{"hbis-date-strip__date--selected":h(a),"hbis-date-strip__date--today":y(a),"hbis-date-strip__date--disabled":!p(a),"hbis-date-strip__date--weekend":a.isWeekend}]),style:e.normalizeStyle({color:h(a)?o.selectedColor:o.normalColor,backgroundColor:h(a)?o.selectedBgColor:o.normalBgColor}),onClick:n=>_(a)},[e.createElementVNode("div",L,e.toDisplayString(a.day),1),e.createElementVNode("div",M,[e.renderSlot(t.$slots,"default",{date:a},void 0,!0)])],14,F))),128))])]))],2))}}),q=k(Y,[["__scopeId","data-v-f7fe6423"]]);exports.C1=S;exports.C2=V;exports.hbisDateStrip=q;
2
2
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../c1/src/C1.vue","../c2/src/C2.vue","../hbis-dateStrip/src/hbis-dateStrip.vue"],"sourcesContent":["<template>\n <div class=\"c1-container\" :class=\"{ 'c1-primary': primary }\">\n <slot>{{ title }}</slot>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n/**\n * C1组件 - 基础组件示例\n * 用于展示基本的Vue3组件结构和TypeScript支持\n */\n\n// 定义组件属性\ninterface Props {\n /** 标题文本 */\n title?: string;\n /** 是否使用主要样式 */\n primary?: boolean;\n}\n\n// 定义组件属性默认值\nconst props = withDefaults(defineProps<Props>(), {\n title: 'C1 Component',\n primary: false\n});\n</script>\n\n<style scoped>\n.c1-container {\n padding: 16px;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n background-color: #ffffff;\n}\n\n.c1-primary {\n background-color: #1890ff;\n color: #ffffff;\n border-color: #1890ff;\n}\n</style>\n","<template>\n <div class=\"c2-container\">\n <h2 class=\"c2-title\">{{ title }}</h2>\n <div class=\"c2-content\">\n <slot></slot>\n </div>\n <button v-if=\"showButton\" class=\"c2-button\" @click=\"handleClick\">\n {{ buttonText }}\n </button>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n/**\n * C2组件 - 带按钮的容器组件\n * 用于展示包含事件处理的Vue3组件\n */\n\n// 定义组件属性\ninterface Props {\n /** 标题文本 */\n title?: string;\n /** 是否显示按钮 */\n showButton?: boolean;\n /** 按钮文本 */\n buttonText?: string;\n}\n\n// 定义组件事件\nconst emit = defineEmits<{\n /** 按钮点击事件 */\n (e: 'click', event: MouseEvent): void;\n}>();\n\n// 定义组件属性默认值\nconst props = withDefaults(defineProps<Props>(), {\n title: 'C2 Component',\n showButton: true,\n buttonText: 'Click Me'\n});\n\n/**\n * 处理按钮点击事件\n * @param event 鼠标点击事件对象\n */\nconst handleClick = (event: MouseEvent) => {\n emit('click', event);\n};\n</script>\n\n<style scoped>\n.c2-container {\n padding: 20px;\n border: 1px solid #e0e0e0;\n border-radius: 8px;\n background-color: #fafafa;\n margin: 16px 0;\n}\n\n.c2-title {\n margin: 0 0 12px 0;\n font-size: 18px;\n font-weight: 600;\n color: #333333;\n}\n\n.c2-content {\n margin-bottom: 16px;\n color: #666666;\n}\n\n.c2-button {\n padding: 8px 16px;\n background-color: #52c41a;\n color: #ffffff;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n font-size: 14px;\n transition: background-color 0.3s;\n}\n\n.c2-button:hover {\n background-color: #73d13d;\n}\n</style>\n","<template>\n <div class=\"hbis-date-strip\" :class=\"{\n 'hbis-date-strip--highlight-bg': highlightType === 'bg',\n 'hbis-date-strip--highlight-dot': highlightType === 'dot',\n 'hbis-date-strip--highlight-round': highlightType === 'round',\n 'hbis-date-strip--scrollable': shouldScroll\n }\">\n <!-- 非滚动模式:星期行 + 固定日期行 -->\n <div v-if=\"!shouldScroll\">\n <!-- 星期行 - 固定显示7个星期,始终在顶部 -->\n <div class=\"hbis-date-strip__weekdays\">\n <div \n v-for=\"weekday in orderedWeekdays\" \n :key=\"weekday.value\"\n class=\"hbis-date-strip__weekday\"\n :class=\"{\n 'hbis-date-strip__weekday--weekend': weekday.isWeekend\n }\"\n >\n {{ weekday.label }}\n </div>\n </div>\n \n <!-- 日期行 - 固定显示7天 -->\n <div class=\"hbis-date-strip__dates\">\n <div \n v-for=\"date in filteredDisplayDates\" \n :key=\"date.dateString\"\n class=\"hbis-date-strip__date\"\n :class=\"{\n 'hbis-date-strip__date--selected': isSelected(date),\n 'hbis-date-strip__date--today': isToday(date),\n 'hbis-date-strip__date--disabled': !isInRange(date),\n 'hbis-date-strip__date--weekend': date.isWeekend\n }\"\n :style=\"{\n color: isSelected(date) ? selectedColor : normalColor,\n backgroundColor: isSelected(date) ? selectedBgColor : normalBgColor\n }\"\n @click=\"handleDateClick(date)\"\n >\n <div class=\"hbis-date-strip__date-number\">{{ date.day }}</div>\n </div>\n </div>\n </div>\n \n <!-- 滚动模式:星期行和日期行一起滚动 -->\n <div v-else class=\"hbis-date-strip__scroll-wrapper\">\n <!-- 滚动容器 - 包含星期行和日期行 -->\n <div \n class=\"hbis-date-strip__scroll-container\"\n >\n <!-- 星期行 - 与日期一起滚动 -->\n <div class=\"hbis-date-strip__weekdays\">\n <div \n v-for=\"date in filteredDisplayDates\" \n :key=\"date.dateString + '-weekday'\"\n class=\"hbis-date-strip__weekday\"\n :class=\"{\n 'hbis-date-strip__weekday--weekend': date.isWeekend\n }\"\n >\n <!-- 显示每个日期对应的星期 -->\n {{ getWeekdayLabel(date.weekday) }}\n </div>\n </div>\n \n <!-- 日期行 - 一页显示7天,支持横向滑动 -->\n <div class=\"hbis-date-strip__dates\">\n <div \n v-for=\"date in filteredDisplayDates\" \n :key=\"date.dateString\"\n class=\"hbis-date-strip__date\"\n :class=\"{\n 'hbis-date-strip__date--selected': isSelected(date),\n 'hbis-date-strip__date--today': isToday(date),\n 'hbis-date-strip__date--disabled': !isInRange(date),\n 'hbis-date-strip__date--weekend': date.isWeekend\n }\"\n :style=\"{\n color: isSelected(date) ? selectedColor : normalColor,\n backgroundColor: isSelected(date) ? selectedBgColor : normalBgColor\n }\"\n @click=\"handleDateClick(date)\"\n >\n <div class=\"hbis-date-strip__date-number\">{{ date.day }}</div>\n </div>\n </div>\n </div>\n </div>\n \n <!-- 自定义slot -->\n <div class=\"hbis-date-strip__custom\" v-if=\"$slots.default\">\n <slot></slot>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n/**\n * hbis-dateStrip组件 - 用于展示一周的日历信息\n * 支持多种切换方式和选中样式\n * 兼容平台:H5、App、微信小程序、支付宝小程序等Uniapp支持的所有平台\n */\n\nimport { ref, computed, onMounted, watch } from 'vue';\n\n// 星期数据类型\ninterface Weekday {\n value: number;\n label: string;\n isWeekend: boolean;\n}\n\n// 日期数据类型\ninterface DateItem {\n date: Date;\n dateString: string;\n day: number;\n month: number;\n year: number;\n isWeekend: boolean;\n weekday: number;\n}\n\n// 组件属性类型\ninterface Props {\n /** 选中日期,可以是单个日期或日期范围 */\n modelValue?: Date | Date[];\n /** 日期范围开始 */\n startDate?: Date;\n /** 日期范围结束 */\n endDate?: Date;\n /** 选中样式类型:bg(背景色高亮), dot(数字背景色高亮), round(数字背景色圆角高亮) */\n highlightType?: 'bg' | 'dot' | 'round';\n /** 是否显示今天 */\n showToday?: boolean;\n /** 是否禁用过去的日期 */\n disablePast?: boolean;\n /** 是否禁用未来的日期 */\n disableFuture?: boolean;\n /** 选中状态的文字颜色 */\n selectedColor?: string;\n /** 正常状态的文字颜色 */\n normalColor?: string;\n /** 选中状态的背景颜色 */\n selectedBgColor?: string;\n /** 正常状态的背景颜色 */\n normalBgColor?: string;\n /** 是否支持横向滑动日期 */\n scrollable?: boolean;\n /** 可见的天数(默认7天) */\n visibleDays?: number;\n}\n\n// 定义组件属性默认值\nconst props = withDefaults(defineProps<Props>(), {\n modelValue: () => new Date(),\n startDate: () => new Date(),\n endDate: () => {\n const end = new Date();\n end.setDate(end.getDate() + 30);\n return end;\n },\n highlightType: 'bg',\n showToday: true,\n disablePast: false,\n disableFuture: false,\n selectedColor: '#ffffff',\n normalColor: '#666666',\n selectedBgColor: '#1890ff',\n normalBgColor: 'transparent',\n scrollable: false,\n visibleDays: 7\n});\n\n// 直接使用props访问属性,确保响应性\n// 注意:在Vue 3 Composition API中,解构props会失去响应性\n\n// 定义组件事件\nconst emit = defineEmits<{\n /** 选中日期变化事件 */\n (e: 'update:modelValue', value: Date | Date[]): void;\n /** 日期点击事件 */\n (e: 'dateClick', date: DateItem): void;\n}>();\n\n// 计算是否需要滚动:如果日期范围超过7天,则可以滚动\nconst shouldScroll = computed<boolean>(() => {\n // 调试信息:打印props,查看startDate和endDate的值\n console.log('props:', {\n startDate: props.startDate,\n endDate: props.endDate,\n scrollable: props.scrollable\n });\n \n // 如果显式设置了scrollable为true,直接返回true\n if (props.scrollable) {\n console.log('显式设置了scrollable为true,允许滚动');\n return true;\n }\n \n try {\n // 计算日期范围的天数,忽略时间部分\n const start = new Date(props.startDate);\n start.setHours(0, 0, 0, 0);\n \n const end = new Date(props.endDate);\n end.setHours(0, 0, 0, 0);\n \n // 检查日期是否有效\n if (isNaN(start.getTime()) || isNaN(end.getTime())) {\n console.log('无效的日期对象,使用默认滚动行为');\n return false;\n }\n \n // 计算总天数,确保结果正确\n const diffTime = end.getTime() - start.getTime();\n const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));\n const totalDays = diffDays + 1;\n \n // 调试信息\n console.log('日期范围天数计算:', {\n start: start.toLocaleDateString(),\n end: end.toLocaleDateString(),\n diffTime,\n diffDays,\n totalDays,\n shouldScroll: totalDays > 7\n });\n \n // 如果超过7天,允许滚动\n return totalDays > 7;\n } catch (error) {\n console.error('计算日期范围时出错:', error);\n // 出错时,默认不允许滚动\n return false;\n }\n});\n\n// 星期数据\nconst weekdays: Weekday[] = [\n { value: 0, label: '日', isWeekend: true },\n { value: 1, label: '一', isWeekend: false },\n { value: 2, label: '二', isWeekend: false },\n { value: 3, label: '三', isWeekend: false },\n { value: 4, label: '四', isWeekend: false },\n { value: 5, label: '五', isWeekend: false },\n { value: 6, label: '六', isWeekend: true }\n];\n\n// 根据当前显示的第一个日期动态排序星期,确保星期和日期对应\nconst orderedWeekdays = computed<Weekday[]>(() => {\n // 获取当前显示的第一个有效的日期\n const firstDate = filteredDisplayDates.value[0];\n if (!firstDate) {\n // 如果没有日期,返回默认的星期顺序\n return weekdays;\n }\n \n const firstDateWeekday = firstDate.weekday;\n const result: Weekday[] = [];\n \n // 从第一个日期的星期开始,按顺序排列7天的星期\n for (let i = 0; i < 7; i++) {\n const weekdayIndex = (firstDateWeekday + i) % 7;\n result.push(weekdays[weekdayIndex]);\n }\n \n return result;\n});\n\n// 当前显示的周开始日期\n// 初始化时就计算出正确的周开始日期,确保组件第一次渲染时就有有效值\nconst initCurrentWeekStart = () => {\n // 如果设置了startDate,就从startDate开始,否则从今天开始\n const baseDate = props.startDate || new Date();\n const day = baseDate.getDay(); // 0是周日,1是周一,2是周二,3是周三,4是周四,5是周五,6是周六\n // 计算从baseDate开始的周开始日期:如果是周一,diff=0;如果是周二,diff=-1;...;如果是周日,diff=-6\n const diff = baseDate.getDate() - (day === 0 ? 6 : day - 1);\n const startDate = new Date(baseDate);\n startDate.setDate(diff);\n return startDate;\n};\n\nconst currentWeekStart = ref(initCurrentWeekStart());\n\n// 组件挂载后再次确认周开始日期\nonMounted(() => {\n // 调试信息:打印props的值,看看是否能被正确接收\n console.log('props:', props);\n console.log('highlightType:', props.highlightType);\n});\n\n// 监听highlightType变化\nwatch(\n () => props.highlightType,\n (newValue) => {\n console.log('highlightType changed:', newValue);\n }\n);\n\n// 监听modelValue变化\nwatch(\n () => props.modelValue,\n (newValue) => {\n console.log('modelValue changed:', newValue);\n }\n);\n\n/**\n * 生成显示的日期数组\n */\nconst displayDates = computed<DateItem[]>(() => {\n const dates: DateItem[] = [];\n \n try {\n // 计算日期范围:从startDate开始,到endDate结束\n const start = props.startDate;\n const end = props.endDate;\n \n // 检查日期是否有效\n if (isNaN(start.getTime()) || isNaN(end.getTime())) {\n console.log('无效的日期对象,返回空数组');\n return dates;\n }\n \n // 计算总天数\n const totalDays = Math.ceil((end.getTime() - start.getTime()) / (1000 * 60 * 60 * 24)) + 1;\n \n // 生成日期数组\n for (let i = 0; i < totalDays; i++) {\n const date = new Date(start);\n date.setDate(start.getDate() + i);\n \n // 确保生成的日期是有效的\n if (!isNaN(date.getTime())) {\n dates.push({\n date,\n dateString: formatDate(date),\n day: date.getDate(),\n month: date.getMonth() + 1,\n year: date.getFullYear(),\n isWeekend: date.getDay() === 0 || date.getDay() === 6,\n weekday: date.getDay()\n });\n }\n }\n } catch (error) {\n console.error('生成日期数组时出错:', error);\n }\n \n return dates;\n});\n\n/**\n * 过滤后的日期数组,只包含有效的DateItem对象\n */\nconst filteredDisplayDates = computed<DateItem[]>(() => {\n return displayDates.value.filter((date): date is DateItem => {\n // 确保date是有效的DateItem对象,并且包含所有必要的属性\n return Boolean(date && \n date.date && \n date.dateString && \n !isNaN(date.date.getTime()) && \n typeof date.dateString === 'string' && \n typeof date.day === 'number');\n });\n});\n\n/**\n * 格式化日期为YYYY-MM-DD格式\n * @param date 日期对象\n * @returns 格式化后的日期字符串\n */\nconst formatDate = (date: Date): string => {\n return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`;\n};\n\n/**\n * 检查日期是否被选中\n * @param date 日期项\n * @returns 是否被选中\n */\nconst isSelected = (date: DateItem): boolean => {\n const dateStr = date.dateString;\n \n // 确保modelValue存在\n if (!props.modelValue) {\n return false;\n }\n \n if (Array.isArray(props.modelValue)) {\n // 范围选择\n return props.modelValue.some(selectedDate => {\n // 确保selectedDate是有效的Date对象\n if (!selectedDate || isNaN(selectedDate.getTime())) {\n return false;\n }\n return formatDate(selectedDate) === dateStr;\n });\n } else {\n // 单个日期选择\n // 确保modelValue是有效的Date对象\n if (isNaN(props.modelValue.getTime())) {\n return false;\n }\n return formatDate(props.modelValue) === dateStr;\n }\n};\n\n/**\n * 检查日期是否是今天\n * @param date 日期项\n * @returns 是否是今天\n */\nconst isToday = (date: DateItem): boolean => {\n const todayStr = formatDate(new Date());\n return date.dateString === todayStr;\n};\n\n/**\n * 检查日期是否在可选范围内\n * @param date 日期项\n * @returns 是否在范围内\n */\nconst isInRange = (date: DateItem): boolean => {\n const dateObj = date.date;\n \n if (props.disablePast && dateObj < new Date(new Date().setHours(0, 0, 0, 0))) {\n return false;\n }\n \n if (props.disableFuture && dateObj > new Date(new Date().setHours(23, 59, 59, 999))) {\n return false;\n }\n \n return dateObj >= props.startDate && dateObj <= props.endDate;\n};\n\n/**\n * 根据星期值获取星期标签\n * @param weekday 星期值(0-6,0代表周日)\n * @returns 星期标签\n */\nconst getWeekdayLabel = (weekday: number): string => {\n return weekdays.find(w => w.value === weekday)?.label || '';\n};\n\n/**\n * 处理日期点击事件\n * @param date 日期项\n */\nconst handleDateClick = (date: DateItem) => {\n if (!isInRange(date)) return;\n \n emit('dateClick', date);\n emit('update:modelValue', date.date);\n};\n</script>\n\n<style scoped>\n/* 基础容器样式 */\n.hbis-date-strip {\n display: flex;\n flex-direction: column;\n width: 100%;\n padding: 8px;\n background-color: #ffffff;\n border-radius: 8px;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);\n box-sizing: border-box;\n}\n\n/* 横向滚动模式 */\n.hbis-date-strip--scrollable {\n overflow: hidden;\n}\n\n/* 滚动包装器 */\n.hbis-date-strip__scroll-wrapper {\n overflow: hidden;\n width: 100%;\n}\n\n/* 滚动容器 */\n.hbis-date-strip__scroll-container {\n width: 100%;\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: none; /* 隐藏Firefox滚动条 */\n -ms-overflow-style: none; /* 隐藏IE滚动条 */\n}\n\n.hbis-date-strip__scroll-container::-webkit-scrollbar {\n display: none; /* 隐藏Chrome、Safari滚动条 */\n}\n\n/* 星期行样式 */\n.hbis-date-strip__weekdays {\n display: flex;\n margin-bottom: 8px;\n box-sizing: border-box;\n flex-wrap: nowrap;\n}\n\n/* 星期项样式 - 所有模式下都占1/7宽度 */\n.hbis-date-strip__weekday {\n text-align: center;\n font-size: 12px;\n font-weight: 500;\n color: #666666;\n padding: 4px 0;\n flex: 0 0 calc(100% / 7); /* 每日宽度占父宽度的1/7 */\n width: calc(100% / 7); /* 每日宽度占父宽度的1/7 */\n min-width: calc(100% / 7); /* 确保宽度固定,不受内容影响 */\n box-sizing: border-box;\n}\n\n.hbis-date-strip__weekday--weekend {\n color: #ff4d4f;\n}\n\n/* 日期行样式 - 所有模式下的基础样式 */\n.hbis-date-strip__dates {\n display: flex;\n justify-content: flex-start;\n width: 100%;\n box-sizing: border-box;\n}\n\n/* 滚动模式下的星期行 */\n.hbis-date-strip--scrollable .hbis-date-strip__weekdays {\n width: auto;\n}\n\n/* 滚动模式下的日期行 */\n.hbis-date-strip--scrollable .hbis-date-strip__dates {\n width: auto;\n flex-wrap: nowrap;\n}\n\n/* 非滚动模式下的日期行 */\n.hbis-date-strip:not(.hbis-date-strip--scrollable) .hbis-date-strip__dates {\n justify-content: space-around;\n width: 100%;\n}\n\n/* 日期项样式 - 所有模式下都和星期项宽度完全一致 */\n.hbis-date-strip__date {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 8px 0;\n border-radius: 4px;\n transition: all 0.2s ease;\n position: relative;\n user-select: none;\n cursor: pointer;\n flex: 0 0 calc(100% / 7); /* 和星期项保持完全一致,每日宽度占父宽度的1/7 */\n width: calc(100% / 7); /* 和星期项保持完全一致,每日宽度占父宽度的1/7 */\n min-width: calc(100% / 7); /* 和星期项保持完全一致,确保宽度固定 */\n max-width: calc(100% / 7); /* 和星期项保持完全一致,确保宽度不超过 */\n box-sizing: border-box;\n white-space: normal;\n}\n\n.hbis-date-strip__date--disabled {\n cursor: not-allowed;\n opacity: 0.6;\n}\n\n.hbis-date-strip__date--weekend {\n /* 周末颜色通过自定义属性控制 */\n}\n\n.hbis-date-strip__date-number {\n font-size: 14px;\n font-weight: 500;\n padding: 4px;\n transition: all 0.2s ease;\n width: 100%;\n text-align: center;\n box-sizing: border-box;\n}\n\n/* 选中样式 - 背景色高亮 */\n.hbis-date-strip--highlight-bg .hbis-date-strip__date--selected {\n /* 背景色和文字颜色通过内联样式控制 */\n}\n\n/* 选中样式 - 数字背景色高亮 */\n.hbis-date-strip--highlight-dot .hbis-date-strip__date--selected .hbis-date-strip__date-number {\n /* 背景色和文字颜色通过内联样式控制 */\n border-radius: 2px;\n}\n\n/* 选中样式 - 数字背景色圆角高亮 */\n.hbis-date-strip--highlight-round .hbis-date-strip__date--selected .hbis-date-strip__date-number {\n /* 背景色和文字颜色通过内联样式控制 */\n border-radius: 50%;\n padding: 4px 8px;\n min-width: 20px;\n text-align: center;\n}\n\n/* 今天样式 */\n.hbis-date-strip__date--today .hbis-date-strip__date-number {\n font-weight: 600;\n /* 今天颜色保持默认,不受自定义颜色影响 */\n color: #1890ff !important;\n}\n\n/* 禁用日期样式 */\n.hbis-date-strip__date--disabled {\n color: #cccccc !important;\n background-color: transparent !important;\n}\n\n/* 自定义slot样式 */\n.hbis-date-strip__custom {\n margin-top: 8px;\n padding-top: 8px;\n border-top: 1px solid #f0f0f0;\n}\n</style>"],"names":["_createElementBlock","_normalizeClass","__props","_renderSlot","_ctx","emit","__emit","handleClick","event","_openBlock","_hoisted_1","_createElementVNode","_hoisted_2","_toDisplayString","_hoisted_3","props","shouldScroll","computed","start","end","diffTime","diffDays","totalDays","error","weekdays","orderedWeekdays","firstDate","filteredDisplayDates","firstDateWeekday","result","i","weekdayIndex","initCurrentWeekStart","baseDate","day","diff","startDate","ref","onMounted","watch","newValue","displayDates","dates","date","formatDate","isSelected","dateStr","selectedDate","isToday","todayStr","isInRange","dateObj","getWeekdayLabel","weekday","_a","w","handleDateClick","_hoisted_6","_hoisted_7","_hoisted_8","_Fragment","_renderList","_hoisted_9","_normalizeStyle","$event","_hoisted_11","_hoisted_5","$slots","_hoisted_12"],"mappings":"sPACEA,EAAAA,mBAEM,MAAA,CAFD,MAAKC,EAAAA,eAAA,CAAC,eAAc,CAAA,aAAyBC,EAAA,QAAO,CAAA,CAAA,GACvDC,EAAAA,WAAwBC,sBAAxB,IAAwB,qCAAfF,EAAA,KAAK,EAAA,CAAA,CAAA,gXC2BlB,MAAMG,EAAOC,EAgBPC,EAAeC,GAAsB,CACzCH,EAAK,QAASG,CAAK,CACrB,gBA9CEC,YAAA,EAAAT,qBAQM,MARNU,EAQM,CAPJC,EAAAA,mBAAqC,KAArCC,EAAqCC,EAAAA,gBAAbX,EAAA,KAAK,EAAA,CAAA,EAC7BS,EAAAA,mBAEM,MAFNG,EAEM,CADJX,EAAAA,WAAaC,EAAA,OAAA,UAAA,CAAA,EAAA,OAAA,EAAA,CAAA,GAEDF,EAAA,0BAAdF,EAAAA,mBAES,SAAA,OAFiB,MAAM,YAAa,QAAOO,CAAA,oBAC/CL,EAAA,UAAU,EAAA,CAAA,wjCCqJnB,MAAMa,EAAQb,EAwBRG,EAAOC,EAQPU,EAAeC,EAAAA,SAAkB,IAAM,CAS3C,GAPA,QAAQ,IAAI,SAAU,CACpB,UAAWF,EAAM,UACjB,QAASA,EAAM,QACf,WAAYA,EAAM,U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FNoE,EAEM,CADJjE,EAAAA,WAAaC,EAAA,OAAA,UAAA,CAAA,EAAA,OAAA,EAAA,CAAA"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../c1/src/C1.vue","../c2/src/C2.vue","../hbis-dateStrip/src/hbis-dateStrip.vue"],"sourcesContent":["<template>\r\n <div class=\"c1-container\" :class=\"{ 'c1-primary': primary }\">\r\n <slot>{{ title }}</slot>\r\n </div>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\n/**\r\n * C1组件 - 基础组件示例\r\n * 用于展示基本的Vue3组件结构和TypeScript支持\r\n */\r\n\r\n// 定义组件属性\r\ninterface Props {\r\n /** 标题文本 */\r\n title?: string;\r\n /** 是否使用主要样式 */\r\n primary?: boolean;\r\n}\r\n\r\n// 定义组件属性默认值\r\nconst props = withDefaults(defineProps<Props>(), {\r\n title: 'C1 Component',\r\n primary: false\r\n});\r\n</script>\r\n\r\n<style scoped>\r\n.c1-container {\r\n padding: 16px;\r\n border: 1px solid #e0e0e0;\r\n border-radius: 4px;\r\n background-color: #ffffff;\r\n}\r\n\r\n.c1-primary {\r\n background-color: #1890ff;\r\n color: #ffffff;\r\n border-color: #1890ff;\r\n}\r\n</style>\r\n","<template>\r\n <div class=\"c2-container\">\r\n <h2 class=\"c2-title\">{{ title }}</h2>\r\n <div class=\"c2-content\">\r\n <slot></slot>\r\n </div>\r\n <button v-if=\"showButton\" class=\"c2-button\" @click=\"handleClick\">\r\n {{ buttonText }}\r\n </button>\r\n </div>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\n/**\r\n * C2组件 - 带按钮的容器组件\r\n * 用于展示包含事件处理的Vue3组件\r\n */\r\n\r\n// 定义组件属性\r\ninterface Props {\r\n /** 标题文本 */\r\n title?: string;\r\n /** 是否显示按钮 */\r\n showButton?: boolean;\r\n /** 按钮文本 */\r\n buttonText?: string;\r\n}\r\n\r\n// 定义组件事件\r\nconst emit = defineEmits<{\r\n /** 按钮点击事件 */\r\n (e: 'click', event: MouseEvent): void;\r\n}>();\r\n\r\n// 定义组件属性默认值\r\nconst props = withDefaults(defineProps<Props>(), {\r\n title: 'C2 Component',\r\n showButton: true,\r\n buttonText: 'Click Me'\r\n});\r\n\r\n/**\r\n * 处理按钮点击事件\r\n * @param event 鼠标点击事件对象\r\n */\r\nconst handleClick = (event: MouseEvent) => {\r\n emit('click', event);\r\n};\r\n</script>\r\n\r\n<style scoped>\r\n.c2-container {\r\n padding: 20px;\r\n border: 1px solid #e0e0e0;\r\n border-radius: 8px;\r\n background-color: #fafafa;\r\n margin: 16px 0;\r\n}\r\n\r\n.c2-title {\r\n margin: 0 0 12px 0;\r\n font-size: 18px;\r\n font-weight: 600;\r\n color: #333333;\r\n}\r\n\r\n.c2-content {\r\n margin-bottom: 16px;\r\n color: #666666;\r\n}\r\n\r\n.c2-button {\r\n padding: 8px 16px;\r\n background-color: #52c41a;\r\n color: #ffffff;\r\n border: none;\r\n border-radius: 4px;\r\n cursor: pointer;\r\n font-size: 14px;\r\n transition: background-color 0.3s;\r\n}\r\n\r\n.c2-button:hover {\r\n background-color: #73d13d;\r\n}\r\n</style>\r\n","<template>\r\n <div class=\"hbis-date-strip\" :class=\"{\r\n 'hbis-date-strip--highlight-bg': highlightType === 'bg',\r\n 'hbis-date-strip--highlight-dot': highlightType === 'dot',\r\n 'hbis-date-strip--highlight-round': highlightType === 'round',\r\n 'hbis-date-strip--scrollable': shouldScroll\r\n }\">\r\n <!-- 非滚动模式:星期行 + 固定日期行 -->\r\n <div v-if=\"!shouldScroll\">\r\n <!-- 星期行 - 固定显示7个星期,始终在顶部 -->\r\n <div class=\"hbis-date-strip__weekdays\">\r\n <div \r\n v-for=\"weekday in orderedWeekdays\" \r\n :key=\"weekday.value\"\r\n class=\"hbis-date-strip__weekday\"\r\n :class=\"{\r\n 'hbis-date-strip__weekday--weekend': weekday.isWeekend\r\n }\"\r\n >\r\n {{ weekday.label }}\r\n </div>\r\n </div>\r\n \r\n <!-- 日期行 - 固定显示7天 -->\r\n <div class=\"hbis-date-strip__dates\">\r\n <div \r\n v-for=\"date in filteredDisplayDates\" \r\n :key=\"date.dateString\"\r\n class=\"hbis-date-strip__date\"\r\n :class=\"{\r\n 'hbis-date-strip__date--selected': isSelected(date),\r\n 'hbis-date-strip__date--today': isToday(date),\r\n 'hbis-date-strip__date--disabled': !isInRange(date),\r\n 'hbis-date-strip__date--weekend': date.isWeekend\r\n }\"\r\n :style=\"{\r\n color: isSelected(date) ? selectedColor : normalColor,\r\n backgroundColor: isSelected(date) ? selectedBgColor : normalBgColor\r\n }\"\r\n @click=\"handleDateClick(date)\"\r\n >\r\n <div class=\"hbis-date-strip__date-number\">{{ date.day }}</div>\r\n <!-- 每个日期项的自定义slot -->\r\n <div class=\"hbis-date-strip__date-slot\">\r\n <slot :date=\"date\"></slot>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n <!-- 滚动模式:星期行和日期行一起滚动 -->\r\n <div v-else class=\"hbis-date-strip__scroll-wrapper\">\r\n <!-- 滚动容器 - 包含星期行和日期行 -->\r\n <div \r\n class=\"hbis-date-strip__scroll-container\"\r\n >\r\n <!-- 星期行 - 与日期一起滚动 -->\r\n <div class=\"hbis-date-strip__weekdays\">\r\n <div \r\n v-for=\"date in filteredDisplayDates\" \r\n :key=\"date.dateString + '-weekday'\"\r\n class=\"hbis-date-strip__weekday\"\r\n :class=\"{\r\n 'hbis-date-strip__weekday--weekend': date.isWeekend\r\n }\"\r\n >\r\n <!-- 显示每个日期对应的星期 -->\r\n {{ getWeekdayLabel(date.weekday) }}\r\n </div>\r\n </div>\r\n \r\n <!-- 日期行 - 一页显示7天,支持横向滑动 -->\r\n <div class=\"hbis-date-strip__dates\">\r\n <div \r\n v-for=\"date in filteredDisplayDates\" \r\n :key=\"date.dateString\"\r\n class=\"hbis-date-strip__date\"\r\n :class=\"{\r\n 'hbis-date-strip__date--selected': isSelected(date),\r\n 'hbis-date-strip__date--today': isToday(date),\r\n 'hbis-date-strip__date--disabled': !isInRange(date),\r\n 'hbis-date-strip__date--weekend': date.isWeekend\r\n }\"\r\n :style=\"{\r\n color: isSelected(date) ? selectedColor : normalColor,\r\n backgroundColor: isSelected(date) ? selectedBgColor : normalBgColor\r\n }\"\r\n @click=\"handleDateClick(date)\"\r\n >\r\n <div class=\"hbis-date-strip__date-number\">{{ date.day }}</div>\r\n <!-- 每个日期项的自定义slot -->\r\n <div class=\"hbis-date-strip__date-slot\">\r\n <slot :date=\"date\"></slot>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n\r\n </div>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\n/**\r\n * hbis-dateStrip组件 - 用于展示一周的日历信息\r\n * 支持多种切换方式和选中样式\r\n * 兼容平台:H5、App、微信小程序、支付宝小程序等Uniapp支持的所有平台\r\n */\r\n\r\nimport { ref, computed, onMounted, watch } from 'vue';\r\n\r\n// 星期数据类型\r\ninterface Weekday {\r\n value: number;\r\n label: string;\r\n isWeekend: boolean;\r\n}\r\n\r\n// 日期数据类型\r\ninterface DateItem {\r\n date: Date;\r\n dateString: string;\r\n day: number;\r\n month: number;\r\n year: number;\r\n isWeekend: boolean;\r\n weekday: number;\r\n}\r\n\r\n// 组件属性类型\r\ninterface Props {\r\n /** 选中日期,可以是单个日期或日期范围 */\r\n modelValue?: Date | Date[];\r\n /** 日期范围开始 */\r\n startDate?: Date;\r\n /** 日期范围结束 */\r\n endDate?: Date;\r\n /** 选中样式类型:bg(背景色高亮), dot(数字背景色高亮), round(数字背景色圆角高亮) */\r\n highlightType?: 'bg' | 'dot' | 'round';\r\n /** 是否显示今天 */\r\n showToday?: boolean;\r\n /** 是否禁用过去的日期 */\r\n disablePast?: boolean;\r\n /** 是否禁用未来的日期 */\r\n disableFuture?: boolean;\r\n /** 选中状态的文字颜色 */\r\n selectedColor?: string;\r\n /** 正常状态的文字颜色 */\r\n normalColor?: string;\r\n /** 选中状态的背景颜色 */\r\n selectedBgColor?: string;\r\n /** 正常状态的背景颜色 */\r\n normalBgColor?: string;\r\n /** 是否支持横向滑动日期 */\r\n scrollable?: boolean;\r\n /** 可见的天数(默认7天) */\r\n visibleDays?: number;\r\n}\r\n\r\n// 定义组件属性默认值\r\nconst props = withDefaults(defineProps<Props>(), {\r\n modelValue: () => new Date(),\r\n startDate: () => new Date(),\r\n endDate: () => {\r\n const end = new Date();\r\n end.setDate(end.getDate() + 30);\r\n return end;\r\n },\r\n highlightType: 'bg',\r\n showToday: true,\r\n disablePast: false,\r\n disableFuture: false,\r\n selectedColor: '#ffffff',\r\n normalColor: '#666666',\r\n selectedBgColor: '#1890ff',\r\n normalBgColor: 'transparent',\r\n scrollable: false,\r\n visibleDays: 7\r\n});\r\n\r\n// 直接使用props访问属性,确保响应性\r\n// 注意:在Vue 3 Composition API中,解构props会失去响应性\r\n\r\n// 定义组件事件\r\nconst emit = defineEmits<{\r\n /** 选中日期变化事件 */\r\n (e: 'update:modelValue', value: Date | Date[]): void;\r\n /** 日期点击事件 */\r\n (e: 'dateClick', date: DateItem): void;\r\n}>();\r\n\r\n// 计算是否需要滚动:如果日期范围超过7天,则可以滚动\r\nconst shouldScroll = computed<boolean>(() => {\r\n // 调试信息:打印props,查看startDate和endDate的值\r\n console.log('props:', {\r\n startDate: props.startDate,\r\n endDate: props.endDate,\r\n scrollable: props.scrollable\r\n });\r\n \r\n // 如果显式设置了scrollable为true,直接返回true\r\n if (props.scrollable) {\r\n console.log('显式设置了scrollable为true,允许滚动');\r\n return true;\r\n }\r\n \r\n try {\r\n // 计算日期范围的天数,忽略时间部分\r\n const start = new Date(props.startDate);\r\n start.setHours(0, 0, 0, 0);\r\n \r\n const end = new Date(props.endDate);\r\n end.setHours(0, 0, 0, 0);\r\n \r\n // 检查日期是否有效\r\n if (isNaN(start.getTime()) || isNaN(end.getTime())) {\r\n console.log('无效的日期对象,使用默认滚动行为');\r\n return false;\r\n }\r\n \r\n // 计算总天数,确保结果正确\r\n const diffTime = end.getTime() - start.getTime();\r\n const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));\r\n const totalDays = diffDays + 1;\r\n \r\n // 调试信息\r\n console.log('日期范围天数计算:', {\r\n start: start.toLocaleDateString(),\r\n end: end.toLocaleDateString(),\r\n diffTime,\r\n diffDays,\r\n totalDays,\r\n shouldScroll: totalDays > 7\r\n });\r\n \r\n // 如果超过7天,允许滚动\r\n return totalDays > 7;\r\n } catch (error) {\r\n console.error('计算日期范围时出错:', error);\r\n // 出错时,默认不允许滚动\r\n return false;\r\n }\r\n});\r\n\r\n// 星期数据\r\nconst weekdays: Weekday[] = [\r\n { value: 0, label: '日', isWeekend: true },\r\n { value: 1, label: '一', isWeekend: false },\r\n { value: 2, label: '二', isWeekend: false },\r\n { value: 3, label: '三', isWeekend: false },\r\n { value: 4, label: '四', isWeekend: false },\r\n { value: 5, label: '五', isWeekend: false },\r\n { value: 6, label: '六', isWeekend: true }\r\n];\r\n\r\n// 根据当前显示的第一个日期动态排序星期,确保星期和日期对应\r\nconst orderedWeekdays = computed<Weekday[]>(() => {\r\n // 获取当前显示的第一个有效的日期\r\n const firstDate = filteredDisplayDates.value[0];\r\n if (!firstDate) {\r\n // 如果没有日期,返回默认的星期顺序\r\n return weekdays;\r\n }\r\n \r\n const firstDateWeekday = firstDate.weekday;\r\n const result: Weekday[] = [];\r\n \r\n // 从第一个日期的星期开始,按顺序排列7天的星期\r\n for (let i = 0; i < 7; i++) {\r\n const weekdayIndex = (firstDateWeekday + i) % 7;\r\n result.push(weekdays[weekdayIndex]);\r\n }\r\n \r\n return result;\r\n});\r\n\r\n// 当前显示的周开始日期\r\n// 初始化时就计算出正确的周开始日期,确保组件第一次渲染时就有有效值\r\nconst initCurrentWeekStart = () => {\r\n // 如果设置了startDate,就从startDate开始,否则从今天开始\r\n const baseDate = props.startDate || new Date();\r\n const day = baseDate.getDay(); // 0是周日,1是周一,2是周二,3是周三,4是周四,5是周五,6是周六\r\n // 计算从baseDate开始的周开始日期:如果是周一,diff=0;如果是周二,diff=-1;...;如果是周日,diff=-6\r\n const diff = baseDate.getDate() - (day === 0 ? 6 : day - 1);\r\n const startDate = new Date(baseDate);\r\n startDate.setDate(diff);\r\n return startDate;\r\n};\r\n\r\nconst currentWeekStart = ref(initCurrentWeekStart());\r\n\r\n// 组件挂载后再次确认周开始日期\r\nonMounted(() => {\r\n // 调试信息:打印props的值,看看是否能被正确接收\r\n console.log('props:', props);\r\n console.log('highlightType:', props.highlightType);\r\n});\r\n\r\n// 监听highlightType变化\r\nwatch(\r\n () => props.highlightType,\r\n (newValue) => {\r\n console.log('highlightType changed:', newValue);\r\n }\r\n);\r\n\r\n// 监听modelValue变化\r\nwatch(\r\n () => props.modelValue,\r\n (newValue) => {\r\n console.log('modelValue changed:', newValue);\r\n }\r\n);\r\n\r\n/**\r\n * 生成显示的日期数组\r\n */\r\nconst displayDates = computed<DateItem[]>(() => {\r\n const dates: DateItem[] = [];\r\n \r\n try {\r\n // 计算日期范围:从startDate开始,到endDate结束\r\n const start = props.startDate;\r\n const end = props.endDate;\r\n \r\n // 检查日期是否有效\r\n if (isNaN(start.getTime()) || isNaN(end.getTime())) {\r\n console.log('无效的日期对象,返回空数组');\r\n return dates;\r\n }\r\n \r\n // 计算总天数\r\n const totalDays = Math.ceil((end.getTime() - start.getTime()) / (1000 * 60 * 60 * 24)) + 1;\r\n \r\n // 生成日期数组\r\n for (let i = 0; i < totalDays; i++) {\r\n const date = new Date(start);\r\n date.setDate(start.getDate() + i);\r\n \r\n // 确保生成的日期是有效的\r\n if (!isNaN(date.getTime())) {\r\n dates.push({\r\n date,\r\n dateString: formatDate(date),\r\n day: date.getDate(),\r\n month: date.getMonth() + 1,\r\n year: date.getFullYear(),\r\n isWeekend: date.getDay() === 0 || date.getDay() === 6,\r\n weekday: date.getDay()\r\n });\r\n }\r\n }\r\n } catch (error) {\r\n console.error('生成日期数组时出错:', error);\r\n }\r\n \r\n return dates;\r\n});\r\n\r\n/**\r\n * 过滤后的日期数组,只包含有效的DateItem对象\r\n */\r\nconst filteredDisplayDates = computed<DateItem[]>(() => {\r\n return displayDates.value.filter((date): date is DateItem => {\r\n // 确保date是有效的DateItem对象,并且包含所有必要的属性\r\n return Boolean(date && \r\n date.date && \r\n date.dateString && \r\n !isNaN(date.date.getTime()) && \r\n typeof date.dateString === 'string' && \r\n typeof date.day === 'number');\r\n });\r\n});\r\n\r\n/**\r\n * 格式化日期为YYYY-MM-DD格式\r\n * @param date 日期对象\r\n * @returns 格式化后的日期字符串\r\n */\r\nconst formatDate = (date: Date): string => {\r\n return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`;\r\n};\r\n\r\n/**\r\n * 检查日期是否被选中\r\n * @param date 日期项\r\n * @returns 是否被选中\r\n */\r\nconst isSelected = (date: DateItem): boolean => {\r\n const dateStr = date.dateString;\r\n \r\n // 确保modelValue存在\r\n if (!props.modelValue) {\r\n return false;\r\n }\r\n \r\n if (Array.isArray(props.modelValue)) {\r\n // 范围选择\r\n return props.modelValue.some(selectedDate => {\r\n // 确保selectedDate是有效的Date对象\r\n if (!selectedDate || isNaN(selectedDate.getTime())) {\r\n return false;\r\n }\r\n return formatDate(selectedDate) === dateStr;\r\n });\r\n } else {\r\n // 单个日期选择\r\n // 确保modelValue是有效的Date对象\r\n if (isNaN(props.modelValue.getTime())) {\r\n return false;\r\n }\r\n return formatDate(props.modelValue) === dateStr;\r\n }\r\n};\r\n\r\n/**\r\n * 检查日期是否是今天\r\n * @param date 日期项\r\n * @returns 是否是今天\r\n */\r\nconst isToday = (date: DateItem): boolean => {\r\n const todayStr = formatDate(new Date());\r\n return date.dateString === todayStr;\r\n};\r\n\r\n/**\r\n * 检查日期是否在可选范围内\r\n * @param date 日期项\r\n * @returns 是否在范围内\r\n */\r\nconst isInRange = (date: DateItem): boolean => {\r\n const dateObj = date.date;\r\n \r\n if (props.disablePast && dateObj < new Date(new Date().setHours(0, 0, 0, 0))) {\r\n return false;\r\n }\r\n \r\n if (props.disableFuture && dateObj > new Date(new Date().setHours(23, 59, 59, 999))) {\r\n return false;\r\n }\r\n \r\n return dateObj >= props.startDate && dateObj <= props.endDate;\r\n};\r\n\r\n/**\r\n * 根据星期值获取星期标签\r\n * @param weekday 星期值(0-6,0代表周日)\r\n * @returns 星期标签\r\n */\r\nconst getWeekdayLabel = (weekday: number): string => {\r\n return weekdays.find(w => w.value === weekday)?.label || '';\r\n};\r\n\r\n/**\r\n * 处理日期点击事件\r\n * @param date 日期项\r\n */\r\nconst handleDateClick = (date: DateItem) => {\r\n if (!isInRange(date)) return;\r\n \r\n emit('dateClick', date);\r\n emit('update:modelValue', date.date);\r\n};\r\n</script>\r\n\r\n<style scoped>\r\n/* 基础容器样式 */\r\n.hbis-date-strip {\r\n display: flex;\r\n flex-direction: column;\r\n width: 100%;\r\n padding: 8px;\r\n background-color: #ffffff;\r\n border-radius: 8px;\r\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);\r\n box-sizing: border-box;\r\n}\r\n\r\n/* 横向滚动模式 */\r\n.hbis-date-strip--scrollable {\r\n overflow: hidden;\r\n}\r\n\r\n/* 滚动包装器 */\r\n.hbis-date-strip__scroll-wrapper {\r\n overflow: hidden;\r\n width: 100%;\r\n}\r\n\r\n/* 滚动容器 */\r\n.hbis-date-strip__scroll-container {\r\n width: 100%;\r\n overflow-x: auto;\r\n overflow-y: hidden;\r\n scrollbar-width: none; /* 隐藏Firefox滚动条 */\r\n -ms-overflow-style: none; /* 隐藏IE滚动条 */\r\n}\r\n\r\n.hbis-date-strip__scroll-container::-webkit-scrollbar {\r\n display: none; /* 隐藏Chrome、Safari滚动条 */\r\n}\r\n\r\n/* 星期行样式 */\r\n.hbis-date-strip__weekdays {\r\n display: flex;\r\n margin-bottom: 8px;\r\n box-sizing: border-box;\r\n flex-wrap: nowrap;\r\n}\r\n\r\n/* 星期项样式 - 所有模式下都占1/7宽度 */\r\n.hbis-date-strip__weekday {\r\n text-align: center;\r\n font-size: 12px;\r\n font-weight: 500;\r\n color: #666666;\r\n padding: 4px 0;\r\n flex: 0 0 calc(100% / 7); /* 每日宽度占父宽度的1/7 */\r\n width: calc(100% / 7); /* 每日宽度占父宽度的1/7 */\r\n min-width: calc(100% / 7); /* 确保宽度固定,不受内容影响 */\r\n box-sizing: border-box;\r\n}\r\n\r\n.hbis-date-strip__weekday--weekend {\r\n color: #ff4d4f;\r\n}\r\n\r\n/* 日期行样式 - 所有模式下的基础样式 */\r\n.hbis-date-strip__dates {\r\n display: flex;\r\n justify-content: flex-start;\r\n width: 100%;\r\n box-sizing: border-box;\r\n}\r\n\r\n/* 滚动模式下的星期行 */\r\n.hbis-date-strip--scrollable .hbis-date-strip__weekdays {\r\n width: auto;\r\n}\r\n\r\n/* 滚动模式下的日期行 */\r\n.hbis-date-strip--scrollable .hbis-date-strip__dates {\r\n width: auto;\r\n flex-wrap: nowrap;\r\n}\r\n\r\n/* 非滚动模式下的日期行 */\r\n.hbis-date-strip:not(.hbis-date-strip--scrollable) .hbis-date-strip__dates {\r\n justify-content: space-around;\r\n width: 100%;\r\n}\r\n\r\n/* 日期项样式 - 所有模式下都和星期项宽度完全一致 */\r\n.hbis-date-strip__date {\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n justify-content: center;\r\n padding: 8px 0;\r\n border-radius: 4px;\r\n transition: all 0.2s ease;\r\n position: relative;\r\n user-select: none;\r\n cursor: pointer;\r\n flex: 0 0 calc(100% / 7); /* 和星期项保持完全一致,每日宽度占父宽度的1/7 */\r\n width: calc(100% / 7); /* 和星期项保持完全一致,每日宽度占父宽度的1/7 */\r\n min-width: calc(100% / 7); /* 和星期项保持完全一致,确保宽度固定 */\r\n max-width: calc(100% / 7); /* 和星期项保持完全一致,确保宽度不超过 */\r\n box-sizing: border-box;\r\n white-space: normal;\r\n}\r\n\r\n.hbis-date-strip__date--disabled {\r\n cursor: not-allowed;\r\n opacity: 0.6;\r\n}\r\n\r\n.hbis-date-strip__date--weekend {\r\n /* 周末颜色通过自定义属性控制 */\r\n}\r\n\r\n.hbis-date-strip__date-number {\r\n font-size: 14px;\r\n font-weight: 500;\r\n padding: 4px;\r\n transition: all 0.2s ease;\r\n width: 100%;\r\n text-align: center;\r\n box-sizing: border-box;\r\n}\r\n\r\n/* 日期slot样式 */\r\n.hbis-date-strip__date-slot {\r\n margin-top: 4px;\r\n font-size: 10px;\r\n text-align: center;\r\n width: 100%;\r\n box-sizing: border-box;\r\n}\r\n\r\n/* 选中样式 - 背景色高亮 */\r\n.hbis-date-strip--highlight-bg .hbis-date-strip__date--selected {\r\n /* 背景色和文字颜色通过内联样式控制 */\r\n}\r\n\r\n/* 选中样式 - 数字背景色高亮 */\r\n.hbis-date-strip--highlight-dot .hbis-date-strip__date--selected .hbis-date-strip__date-number {\r\n /* 背景色和文字颜色通过内联样式控制 */\r\n border-radius: 2px;\r\n}\r\n\r\n/* 选中样式 - 数字背景色圆角高亮 */\r\n.hbis-date-strip--highlight-round .hbis-date-strip__date--selected .hbis-date-strip__date-number {\r\n /* 背景色和文字颜色通过内联样式控制 */\r\n border-radius: 50%;\r\n padding: 4px 8px;\r\n min-width: 20px;\r\n text-align: center;\r\n}\r\n\r\n/* 今天样式 */\r\n.hbis-date-strip__date--today .hbis-date-strip__date-number {\r\n font-weight: 600;\r\n /* 今天颜色保持默认,不受自定义颜色影响 */\r\n color: #1890ff !important;\r\n}\r\n\r\n/* 禁用日期样式 */\r\n.hbis-date-strip__date--disabled {\r\n color: #cccccc !important;\r\n background-color: transparent !important;\r\n}\r\n</style>"],"names":["_createElementBlock","_normalizeClass","__props","_renderSlot","_ctx","emit","__emit","handleClick","event","_openBlock","_hoisted_1","_createElementVNode","_hoisted_2","_toDisplayString","_hoisted_3","props","shouldScroll","computed","start","end","diffTime","diffDays","totalDays","error","weekdays","orderedWeekdays","firstDate","filteredDisplayDates","firstDateWeekday","result","i","weekdayIndex","initCurrentWeekStart","baseDate","day","diff","startDate","ref","onMounted","watch","newValue","displayDates","dates","date","formatDate","isSelected","dateStr","selectedDate","isToday","todayStr","isInRange","dateObj","getWeekdayLabel","weekday","_a","w","handleDateClick","_hoisted_7","_hoisted_8","_hoisted_9","_Fragment","_renderList","_hoisted_10","_normalizeStyle","$event","_hoisted_12","_hoisted_13","_hoisted_5","_hoisted_6"],"mappings":"sPACEA,EAAAA,mBAEM,MAAA,CAFD,MAAKC,EAAAA,eAAA,CAAC,eAAc,CAAA,aAAyBC,EAAA,QAAO,CAAA,CAAA,GACvDC,EAAAA,WAAwBC,sBAAxB,IAAwB,qCAAfF,EAAA,KAAK,EAAA,CAAA,CAAA,gXC2BlB,MAAMG,EAAOC,EAgBPC,EAAeC,GAAsB,CACzCH,EAAK,QAASG,CAAK,CACrB,gBA9CEC,YAAA,EAAAT,qBAQM,MARNU,EAQM,CAPJC,EAAAA,mBAAqC,KAArCC,EAAqCC,EAAAA,gBAAbX,EAAA,KAAK,EAAA,CAAA,EAC7BS,EAAAA,mBAEM,MAFNG,EAEM,CADJX,EAAAA,WAAaC,EAAA,OAAA,UAAA,CAAA,EAAA,OAAA,EAAA,CAAA,GAEDF,EAAA,0BAAdF,EAAAA,mBAES,SAAA,OAFiB,MAAM,YAAa,QAAOO,CAAA,oBAC/CL,EAAA,UAAU,EAAA,CAAA,4lCC0JnB,MAAMa,EAAQb,EAwBRG,EAAOC,EAQPU,EAAeC,EAAAA,SAAkB,IAAM,CAS3C,GAPA,QAAQ,IAAI,SAAU,CACpB,UAAWF,EAAM,UACjB,QAASA,EAAM,QACf,WAAYA,EAAM,UAAA,CACnB,EAGGA,EAAM,WACR,eAAQ,IAAI,2BAA2B,EAChC,GAGT,GAAI,CAEF,MAAMG,EAAQ,IAAI,KAAKH,EAAM,SAAS,EACtCG,EAAM,SAAS,EAAG,EAAG,EAAG,CAAC,EAEzB,MAAMC,EAAM,IAAI,KAAKJ,EAAM,OAAO,EAIlC,GAHAI,EAAI,SAAS,EAAG,EAAG,EAAG,CAAC,EAGnB,MAAMD,EAAM,QAAA,CAAS,GAAK,MAAMC,EA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CADJ/D,EAAAA,WAA0BC,EAAA,OAAA,UAAA,CAAnB,KAAAuC,CAAA,EAAU,OAAA,EAAA,CAAA,wCApFzB3C,EAAAA,mBAwCM,MAAAU,EAAA,CAtCJC,EAAAA,mBAWM,MAXNC,EAWM,kBAVJZ,EAAAA,mBASM4D,EAAAA,SAAA,KAAAC,EAAAA,WARcpC,EAAA,MAAX4B,kBADTrD,EAAAA,mBASM,MAAA,CAPH,IAAKqD,EAAQ,MACd,wBAAM,2BAA0B,CAC4B,oCAAAA,EAAQ,SAAA,KAIjExC,kBAAAwC,EAAQ,KAAK,EAAA,CAAA,YAKpB1C,EAAAA,mBAuBM,MAvBNG,EAuBM,kBAtBJd,EAAAA,mBAqBM4D,EAAAA,SAAA,KAAAC,EAAAA,WApBWlC,EAAA,MAARgB,kBADT3C,EAAAA,mBAqBM,MAAA,CAnBH,IAAK2C,EAAK,WACX,wBAAM,wBAAuB,CAC6B,kCAAAE,EAAWF,CAAI,EAAgD,+BAAAK,EAAQL,CAAI,EAAoD,kCAAA,CAAAO,EAAUP,CAAI,EAAkD,iCAAAA,EAAK,SAAA,IAM7P,MAAKoB,EAAAA,eAAA,CAAwB,MAAAlB,EAAWF,CAAI,EAAIzC,EAAA,cAAgBA,EAAA,YAA2C,gBAAA2C,EAAWF,CAAI,EAAIzC,EAAA,gBAAkBA,EAAA,aAAA,GAIhJ,QAAK8D,GAAER,EAAgBb,CAAI,CAAA,GAE5BhC,EAAAA,mBAA8D,MAA9DwD,EAA8DtD,EAAAA,gBAAjB8B,EAAK,GAAG,EAAA,CAAA,EAErDhC,EAAAA,mBAEM,MAFNyD,EAEM,CADJjE,EAAAA,WAA0BC,EAAA,OAAA,UAAA,CAAnB,KAAAuC,CAAA,EAAU,OAAA,EAAA,CAAA"}
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
- import { defineComponent as w, createElementBlock as o, openBlock as r, normalizeClass as y, renderSlot as S, createTextVNode as I, toDisplayString as g, createElementVNode as c, createCommentVNode as V, computed as k, ref as H, onMounted as L, watch as W, Fragment as D, renderList as v, normalizeStyle as $ } from "vue";
2
- const z = /* @__PURE__ */ w({
1
+ import { defineComponent as S, createElementBlock as o, openBlock as r, normalizeClass as y, renderSlot as C, createTextVNode as F, toDisplayString as g, createElementVNode as n, createCommentVNode as I, computed as k, ref as H, onMounted as L, watch as W, Fragment as D, renderList as v, normalizeStyle as $ } from "vue";
2
+ const z = /* @__PURE__ */ S({
3
3
  __name: "C1",
4
4
  props: {
5
5
  title: { default: "C1 Component" },
@@ -9,8 +9,8 @@ const z = /* @__PURE__ */ w({
9
9
  return (h, a) => (r(), o("div", {
10
10
  class: y(["c1-container", { "c1-primary": l.primary }])
11
11
  }, [
12
- S(h.$slots, "default", {}, () => [
13
- I(g(l.title), 1)
12
+ C(h.$slots, "default", {}, () => [
13
+ F(g(l.title), 1)
14
14
  ], !0)
15
15
  ], 2));
16
16
  }
@@ -19,7 +19,7 @@ const z = /* @__PURE__ */ w({
19
19
  for (const [f, u] of h)
20
20
  a[f] = u;
21
21
  return a;
22
- }, le = /* @__PURE__ */ T(z, [["__scopeId", "data-v-e2028f64"]]), A = { class: "c2-container" }, E = { class: "c2-title" }, O = { class: "c2-content" }, P = /* @__PURE__ */ w({
22
+ }, oe = /* @__PURE__ */ T(z, [["__scopeId", "data-v-e2250793"]]), A = { class: "c2-container" }, E = { class: "c2-title" }, O = { class: "c2-content" }, P = /* @__PURE__ */ S({
23
23
  __name: "C2",
24
24
  props: {
25
25
  title: { default: "C2 Component" },
@@ -32,24 +32,21 @@ const z = /* @__PURE__ */ w({
32
32
  a("click", u);
33
33
  };
34
34
  return (u, b) => (r(), o("div", A, [
35
- c("h2", E, g(l.title), 1),
36
- c("div", O, [
37
- S(u.$slots, "default", {}, void 0, !0)
35
+ n("h2", E, g(l.title), 1),
36
+ n("div", O, [
37
+ C(u.$slots, "default", {}, void 0, !0)
38
38
  ]),
39
39
  l.showButton ? (r(), o("button", {
40
40
  key: 0,
41
41
  class: "c2-button",
42
42
  onClick: f
43
- }, g(l.buttonText), 1)) : V("", !0)
43
+ }, g(l.buttonText), 1)) : I("", !0)
44
44
  ]));
45
45
  }
46
- }), oe = /* @__PURE__ */ T(P, [["__scopeId", "data-v-b1d573ae"]]), Y = { key: 0 }, j = { class: "hbis-date-strip__weekdays" }, R = { class: "hbis-date-strip__dates" }, q = ["onClick"], G = { class: "hbis-date-strip__date-number" }, J = {
46
+ }), re = /* @__PURE__ */ T(P, [["__scopeId", "data-v-ed1086ed"]]), Y = { key: 0 }, j = { class: "hbis-date-strip__weekdays" }, R = { class: "hbis-date-strip__dates" }, q = ["onClick"], G = { class: "hbis-date-strip__date-number" }, J = { class: "hbis-date-strip__date-slot" }, K = {
47
47
  key: 1,
48
48
  class: "hbis-date-strip__scroll-wrapper"
49
- }, K = { class: "hbis-date-strip__scroll-container" }, Q = { class: "hbis-date-strip__weekdays" }, U = { class: "hbis-date-strip__dates" }, X = ["onClick"], Z = { class: "hbis-date-strip__date-number" }, ee = {
50
- key: 2,
51
- class: "hbis-date-strip__custom"
52
- }, te = /* @__PURE__ */ w({
49
+ }, Q = { class: "hbis-date-strip__scroll-container" }, U = { class: "hbis-date-strip__weekdays" }, X = { class: "hbis-date-strip__dates" }, Z = ["onClick"], ee = { class: "hbis-date-strip__date-number" }, te = { class: "hbis-date-strip__date-slot" }, se = /* @__PURE__ */ S({
53
50
  __name: "hbis-dateStrip",
54
51
  props: {
55
52
  modelValue: { default: () => /* @__PURE__ */ new Date() },
@@ -84,15 +81,15 @@ const z = /* @__PURE__ */ w({
84
81
  const s = new Date(a.endDate);
85
82
  if (s.setHours(0, 0, 0, 0), isNaN(e.getTime()) || isNaN(s.getTime()))
86
83
  return console.log("无效的日期对象,使用默认滚动行为"), !1;
87
- const t = s.getTime() - e.getTime(), n = Math.ceil(t / (1e3 * 60 * 60 * 24)), d = n + 1;
84
+ const t = s.getTime() - e.getTime(), i = Math.ceil(t / (1e3 * 60 * 60 * 24)), c = i + 1;
88
85
  return console.log("日期范围天数计算:", {
89
86
  start: e.toLocaleDateString(),
90
87
  end: s.toLocaleDateString(),
91
88
  diffTime: t,
92
- diffDays: n,
93
- totalDays: d,
94
- shouldScroll: d > 7
95
- }), d > 7;
89
+ diffDays: i,
90
+ totalDays: c,
91
+ shouldScroll: c > 7
92
+ }), c > 7;
96
93
  } catch (e) {
97
94
  return console.error("计算日期范围时出错:", e), !1;
98
95
  }
@@ -104,20 +101,20 @@ const z = /* @__PURE__ */ w({
104
101
  { value: 4, label: "四", isWeekend: !1 },
105
102
  { value: 5, label: "五", isWeekend: !1 },
106
103
  { value: 6, label: "六", isWeekend: !0 }
107
- ], M = k(() => {
104
+ ], V = k(() => {
108
105
  const e = m.value[0];
109
106
  if (!e)
110
107
  return b;
111
108
  const s = e.weekday, t = [];
112
- for (let n = 0; n < 7; n++) {
113
- const d = (s + n) % 7;
114
- t.push(b[d]);
109
+ for (let i = 0; i < 7; i++) {
110
+ const c = (s + i) % 7;
111
+ t.push(b[c]);
115
112
  }
116
113
  return t;
117
114
  });
118
115
  H((() => {
119
- const e = a.startDate || /* @__PURE__ */ new Date(), s = e.getDay(), t = e.getDate() - (s === 0 ? 6 : s - 1), n = new Date(e);
120
- return n.setDate(t), n;
116
+ const e = a.startDate || /* @__PURE__ */ new Date(), s = e.getDay(), t = e.getDate() - (s === 0 ? 6 : s - 1), i = new Date(e);
117
+ return i.setDate(t), i;
121
118
  })()), L(() => {
122
119
  console.log("props:", a), console.log("highlightType:", a.highlightType);
123
120
  }), W(
@@ -131,43 +128,43 @@ const z = /* @__PURE__ */ w({
131
128
  console.log("modelValue changed:", e);
132
129
  }
133
130
  );
134
- const x = k(() => {
131
+ const M = k(() => {
135
132
  const e = [];
136
133
  try {
137
134
  const s = a.startDate, t = a.endDate;
138
135
  if (isNaN(s.getTime()) || isNaN(t.getTime()))
139
136
  return console.log("无效的日期对象,返回空数组"), e;
140
- const n = Math.ceil((t.getTime() - s.getTime()) / (1e3 * 60 * 60 * 24)) + 1;
141
- for (let d = 0; d < n; d++) {
142
- const i = new Date(s);
143
- i.setDate(s.getDate() + d), isNaN(i.getTime()) || e.push({
144
- date: i,
145
- dateString: p(i),
146
- day: i.getDate(),
147
- month: i.getMonth() + 1,
148
- year: i.getFullYear(),
149
- isWeekend: i.getDay() === 0 || i.getDay() === 6,
150
- weekday: i.getDay()
137
+ const i = Math.ceil((t.getTime() - s.getTime()) / (1e3 * 60 * 60 * 24)) + 1;
138
+ for (let c = 0; c < i; c++) {
139
+ const d = new Date(s);
140
+ d.setDate(s.getDate() + c), isNaN(d.getTime()) || e.push({
141
+ date: d,
142
+ dateString: p(d),
143
+ day: d.getDate(),
144
+ month: d.getMonth() + 1,
145
+ year: d.getFullYear(),
146
+ isWeekend: d.getDay() === 0 || d.getDay() === 6,
147
+ weekday: d.getDay()
151
148
  });
152
149
  }
153
150
  } catch (s) {
154
151
  console.error("生成日期数组时出错:", s);
155
152
  }
156
153
  return e;
157
- }), m = k(() => x.value.filter((e) => !!(e && e.date && e.dateString && !isNaN(e.date.getTime()) && typeof e.dateString == "string" && typeof e.day == "number"))), p = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, _ = (e) => {
154
+ }), m = k(() => M.value.filter((e) => !!(e && e.date && e.dateString && !isNaN(e.date.getTime()) && typeof e.dateString == "string" && typeof e.day == "number"))), p = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, _ = (e) => {
158
155
  const s = e.dateString;
159
156
  return a.modelValue ? Array.isArray(a.modelValue) ? a.modelValue.some((t) => !t || isNaN(t.getTime()) ? !1 : p(t) === s) : isNaN(a.modelValue.getTime()) ? !1 : p(a.modelValue) === s : !1;
160
157
  }, N = (e) => {
161
158
  const s = p(/* @__PURE__ */ new Date());
162
159
  return e.dateString === s;
163
- }, C = (e) => {
160
+ }, w = (e) => {
164
161
  const s = e.date;
165
162
  return a.disablePast && s < new Date((/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0)) || a.disableFuture && s > new Date((/* @__PURE__ */ new Date()).setHours(23, 59, 59, 999)) ? !1 : s >= a.startDate && s <= a.endDate;
166
- }, F = (e) => {
163
+ }, x = (e) => {
167
164
  var s;
168
165
  return ((s = b.find((t) => t.value === e)) == null ? void 0 : s.label) || "";
169
166
  }, B = (e) => {
170
- C(e) && (f("dateClick", e), f("update:modelValue", e.date));
167
+ w(e) && (f("dateClick", e), f("update:modelValue", e.date));
171
168
  };
172
169
  return (e, s) => (r(), o("div", {
173
170
  class: y(["hbis-date-strip", {
@@ -177,72 +174,75 @@ const z = /* @__PURE__ */ w({
177
174
  "hbis-date-strip--scrollable": u.value
178
175
  }])
179
176
  }, [
180
- u.value ? (r(), o("div", J, [
181
- c("div", K, [
182
- c("div", Q, [
177
+ u.value ? (r(), o("div", K, [
178
+ n("div", Q, [
179
+ n("div", U, [
183
180
  (r(!0), o(D, null, v(m.value, (t) => (r(), o("div", {
184
181
  key: t.dateString + "-weekday",
185
182
  class: y(["hbis-date-strip__weekday", {
186
183
  "hbis-date-strip__weekday--weekend": t.isWeekend
187
184
  }])
188
- }, g(F(t.weekday)), 3))), 128))
185
+ }, g(x(t.weekday)), 3))), 128))
189
186
  ]),
190
- c("div", U, [
187
+ n("div", X, [
191
188
  (r(!0), o(D, null, v(m.value, (t) => (r(), o("div", {
192
189
  key: t.dateString,
193
190
  class: y(["hbis-date-strip__date", {
194
191
  "hbis-date-strip__date--selected": _(t),
195
192
  "hbis-date-strip__date--today": N(t),
196
- "hbis-date-strip__date--disabled": !C(t),
193
+ "hbis-date-strip__date--disabled": !w(t),
197
194
  "hbis-date-strip__date--weekend": t.isWeekend
198
195
  }]),
199
196
  style: $({
200
197
  color: _(t) ? l.selectedColor : l.normalColor,
201
198
  backgroundColor: _(t) ? l.selectedBgColor : l.normalBgColor
202
199
  }),
203
- onClick: (n) => B(t)
200
+ onClick: (i) => B(t)
204
201
  }, [
205
- c("div", Z, g(t.day), 1)
206
- ], 14, X))), 128))
202
+ n("div", ee, g(t.day), 1),
203
+ n("div", te, [
204
+ C(e.$slots, "default", { date: t }, void 0, !0)
205
+ ])
206
+ ], 14, Z))), 128))
207
207
  ])
208
208
  ])
209
209
  ])) : (r(), o("div", Y, [
210
- c("div", j, [
211
- (r(!0), o(D, null, v(M.value, (t) => (r(), o("div", {
210
+ n("div", j, [
211
+ (r(!0), o(D, null, v(V.value, (t) => (r(), o("div", {
212
212
  key: t.value,
213
213
  class: y(["hbis-date-strip__weekday", {
214
214
  "hbis-date-strip__weekday--weekend": t.isWeekend
215
215
  }])
216
216
  }, g(t.label), 3))), 128))
217
217
  ]),
218
- c("div", R, [
218
+ n("div", R, [
219
219
  (r(!0), o(D, null, v(m.value, (t) => (r(), o("div", {
220
220
  key: t.dateString,
221
221
  class: y(["hbis-date-strip__date", {
222
222
  "hbis-date-strip__date--selected": _(t),
223
223
  "hbis-date-strip__date--today": N(t),
224
- "hbis-date-strip__date--disabled": !C(t),
224
+ "hbis-date-strip__date--disabled": !w(t),
225
225
  "hbis-date-strip__date--weekend": t.isWeekend
226
226
  }]),
227
227
  style: $({
228
228
  color: _(t) ? l.selectedColor : l.normalColor,
229
229
  backgroundColor: _(t) ? l.selectedBgColor : l.normalBgColor
230
230
  }),
231
- onClick: (n) => B(t)
231
+ onClick: (i) => B(t)
232
232
  }, [
233
- c("div", G, g(t.day), 1)
233
+ n("div", G, g(t.day), 1),
234
+ n("div", J, [
235
+ C(e.$slots, "default", { date: t }, void 0, !0)
236
+ ])
234
237
  ], 14, q))), 128))
235
238
  ])
236
- ])),
237
- e.$slots.default ? (r(), o("div", ee, [
238
- S(e.$slots, "default", {}, void 0, !0)
239
- ])) : V("", !0)
239
+ ]))
240
240
  ], 2));
241
241
  }
242
- }), re = /* @__PURE__ */ T(te, [["__scopeId", "data-v-7591067b"]]);
242
+ }), ie = /* @__PURE__ */ T(se, [["__scopeId", "data-v-f7fe6423"]]);
243
243
  export {
244
- le as C1,
245
- oe as C2,
246
- re as hbisDateStrip
244
+ oe as C1,
245
+ re as C2,
246
+ ie as hbisDateStrip
247
247
  };
248
248
  //# sourceMappingURL=index.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es.js","sources":["../c1/src/C1.vue","../c2/src/C2.vue","../hbis-dateStrip/src/hbis-dateStrip.vue"],"sourcesContent":["<template>\n <div class=\"c1-container\" :class=\"{ 'c1-primary': primary }\">\n <slot>{{ title }}</slot>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n/**\n * C1组件 - 基础组件示例\n * 用于展示基本的Vue3组件结构和TypeScript支持\n */\n\n// 定义组件属性\ninterface Props {\n /** 标题文本 */\n title?: string;\n /** 是否使用主要样式 */\n primary?: boolean;\n}\n\n// 定义组件属性默认值\nconst props = withDefaults(defineProps<Props>(), {\n title: 'C1 Component',\n primary: false\n});\n</script>\n\n<style scoped>\n.c1-container {\n padding: 16px;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n background-color: #ffffff;\n}\n\n.c1-primary {\n background-color: #1890ff;\n color: #ffffff;\n border-color: #1890ff;\n}\n</style>\n","<template>\n <div class=\"c2-container\">\n <h2 class=\"c2-title\">{{ title }}</h2>\n <div class=\"c2-content\">\n <slot></slot>\n </div>\n <button v-if=\"showButton\" class=\"c2-button\" @click=\"handleClick\">\n {{ buttonText }}\n </button>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n/**\n * C2组件 - 带按钮的容器组件\n * 用于展示包含事件处理的Vue3组件\n */\n\n// 定义组件属性\ninterface Props {\n /** 标题文本 */\n title?: string;\n /** 是否显示按钮 */\n showButton?: boolean;\n /** 按钮文本 */\n buttonText?: string;\n}\n\n// 定义组件事件\nconst emit = defineEmits<{\n /** 按钮点击事件 */\n (e: 'click', event: MouseEvent): void;\n}>();\n\n// 定义组件属性默认值\nconst props = withDefaults(defineProps<Props>(), {\n title: 'C2 Component',\n showButton: true,\n buttonText: 'Click Me'\n});\n\n/**\n * 处理按钮点击事件\n * @param event 鼠标点击事件对象\n */\nconst handleClick = (event: MouseEvent) => {\n emit('click', event);\n};\n</script>\n\n<style scoped>\n.c2-container {\n padding: 20px;\n border: 1px solid #e0e0e0;\n border-radius: 8px;\n background-color: #fafafa;\n margin: 16px 0;\n}\n\n.c2-title {\n margin: 0 0 12px 0;\n font-size: 18px;\n font-weight: 600;\n color: #333333;\n}\n\n.c2-content {\n margin-bottom: 16px;\n color: #666666;\n}\n\n.c2-button {\n padding: 8px 16px;\n background-color: #52c41a;\n color: #ffffff;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n font-size: 14px;\n transition: background-color 0.3s;\n}\n\n.c2-button:hover {\n background-color: #73d13d;\n}\n</style>\n","<template>\n <div class=\"hbis-date-strip\" :class=\"{\n 'hbis-date-strip--highlight-bg': highlightType === 'bg',\n 'hbis-date-strip--highlight-dot': highlightType === 'dot',\n 'hbis-date-strip--highlight-round': highlightType === 'round',\n 'hbis-date-strip--scrollable': shouldScroll\n }\">\n <!-- 非滚动模式:星期行 + 固定日期行 -->\n <div v-if=\"!shouldScroll\">\n <!-- 星期行 - 固定显示7个星期,始终在顶部 -->\n <div class=\"hbis-date-strip__weekdays\">\n <div \n v-for=\"weekday in orderedWeekdays\" \n :key=\"weekday.value\"\n class=\"hbis-date-strip__weekday\"\n :class=\"{\n 'hbis-date-strip__weekday--weekend': weekday.isWeekend\n }\"\n >\n {{ weekday.label }}\n </div>\n </div>\n \n <!-- 日期行 - 固定显示7天 -->\n <div class=\"hbis-date-strip__dates\">\n <div \n v-for=\"date in filteredDisplayDates\" \n :key=\"date.dateString\"\n class=\"hbis-date-strip__date\"\n :class=\"{\n 'hbis-date-strip__date--selected': isSelected(date),\n 'hbis-date-strip__date--today': isToday(date),\n 'hbis-date-strip__date--disabled': !isInRange(date),\n 'hbis-date-strip__date--weekend': date.isWeekend\n }\"\n :style=\"{\n color: isSelected(date) ? selectedColor : normalColor,\n backgroundColor: isSelected(date) ? selectedBgColor : normalBgColor\n }\"\n @click=\"handleDateClick(date)\"\n >\n <div class=\"hbis-date-strip__date-number\">{{ date.day }}</div>\n </div>\n </div>\n </div>\n \n <!-- 滚动模式:星期行和日期行一起滚动 -->\n <div v-else class=\"hbis-date-strip__scroll-wrapper\">\n <!-- 滚动容器 - 包含星期行和日期行 -->\n <div \n class=\"hbis-date-strip__scroll-container\"\n >\n <!-- 星期行 - 与日期一起滚动 -->\n <div class=\"hbis-date-strip__weekdays\">\n <div \n v-for=\"date in filteredDisplayDates\" \n :key=\"date.dateString + '-weekday'\"\n class=\"hbis-date-strip__weekday\"\n :class=\"{\n 'hbis-date-strip__weekday--weekend': date.isWeekend\n }\"\n >\n <!-- 显示每个日期对应的星期 -->\n {{ getWeekdayLabel(date.weekday) }}\n </div>\n </div>\n \n <!-- 日期行 - 一页显示7天,支持横向滑动 -->\n <div class=\"hbis-date-strip__dates\">\n <div \n v-for=\"date in filteredDisplayDates\" \n :key=\"date.dateString\"\n class=\"hbis-date-strip__date\"\n :class=\"{\n 'hbis-date-strip__date--selected': isSelected(date),\n 'hbis-date-strip__date--today': isToday(date),\n 'hbis-date-strip__date--disabled': !isInRange(date),\n 'hbis-date-strip__date--weekend': date.isWeekend\n }\"\n :style=\"{\n color: isSelected(date) ? selectedColor : normalColor,\n backgroundColor: isSelected(date) ? selectedBgColor : normalBgColor\n }\"\n @click=\"handleDateClick(date)\"\n >\n <div class=\"hbis-date-strip__date-number\">{{ date.day }}</div>\n </div>\n </div>\n </div>\n </div>\n \n <!-- 自定义slot -->\n <div class=\"hbis-date-strip__custom\" v-if=\"$slots.default\">\n <slot></slot>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n/**\n * hbis-dateStrip组件 - 用于展示一周的日历信息\n * 支持多种切换方式和选中样式\n * 兼容平台:H5、App、微信小程序、支付宝小程序等Uniapp支持的所有平台\n */\n\nimport { ref, computed, onMounted, watch } from 'vue';\n\n// 星期数据类型\ninterface Weekday {\n value: number;\n label: string;\n isWeekend: boolean;\n}\n\n// 日期数据类型\ninterface DateItem {\n date: Date;\n dateString: string;\n day: number;\n month: number;\n year: number;\n isWeekend: boolean;\n weekday: number;\n}\n\n// 组件属性类型\ninterface Props {\n /** 选中日期,可以是单个日期或日期范围 */\n modelValue?: Date | Date[];\n /** 日期范围开始 */\n startDate?: Date;\n /** 日期范围结束 */\n endDate?: Date;\n /** 选中样式类型:bg(背景色高亮), dot(数字背景色高亮), round(数字背景色圆角高亮) */\n highlightType?: 'bg' | 'dot' | 'round';\n /** 是否显示今天 */\n showToday?: boolean;\n /** 是否禁用过去的日期 */\n disablePast?: boolean;\n /** 是否禁用未来的日期 */\n disableFuture?: boolean;\n /** 选中状态的文字颜色 */\n selectedColor?: string;\n /** 正常状态的文字颜色 */\n normalColor?: string;\n /** 选中状态的背景颜色 */\n selectedBgColor?: string;\n /** 正常状态的背景颜色 */\n normalBgColor?: string;\n /** 是否支持横向滑动日期 */\n scrollable?: boolean;\n /** 可见的天数(默认7天) */\n visibleDays?: number;\n}\n\n// 定义组件属性默认值\nconst props = withDefaults(defineProps<Props>(), {\n modelValue: () => new Date(),\n startDate: () => new Date(),\n endDate: () => {\n const end = new Date();\n end.setDate(end.getDate() + 30);\n return end;\n },\n highlightType: 'bg',\n showToday: true,\n disablePast: false,\n disableFuture: false,\n selectedColor: '#ffffff',\n normalColor: '#666666',\n selectedBgColor: '#1890ff',\n normalBgColor: 'transparent',\n scrollable: false,\n visibleDays: 7\n});\n\n// 直接使用props访问属性,确保响应性\n// 注意:在Vue 3 Composition API中,解构props会失去响应性\n\n// 定义组件事件\nconst emit = defineEmits<{\n /** 选中日期变化事件 */\n (e: 'update:modelValue', value: Date | Date[]): void;\n /** 日期点击事件 */\n (e: 'dateClick', date: DateItem): void;\n}>();\n\n// 计算是否需要滚动:如果日期范围超过7天,则可以滚动\nconst shouldScroll = computed<boolean>(() => {\n // 调试信息:打印props,查看startDate和endDate的值\n console.log('props:', {\n startDate: props.startDate,\n endDate: props.endDate,\n scrollable: props.scrollable\n });\n \n // 如果显式设置了scrollable为true,直接返回true\n if (props.scrollable) {\n console.log('显式设置了scrollable为true,允许滚动');\n return true;\n }\n \n try {\n // 计算日期范围的天数,忽略时间部分\n const start = new Date(props.startDate);\n start.setHours(0, 0, 0, 0);\n \n const end = new Date(props.endDate);\n end.setHours(0, 0, 0, 0);\n \n // 检查日期是否有效\n if (isNaN(start.getTime()) || isNaN(end.getTime())) {\n console.log('无效的日期对象,使用默认滚动行为');\n return false;\n }\n \n // 计算总天数,确保结果正确\n const diffTime = end.getTime() - start.getTime();\n const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));\n const totalDays = diffDays + 1;\n \n // 调试信息\n console.log('日期范围天数计算:', {\n start: start.toLocaleDateString(),\n end: end.toLocaleDateString(),\n diffTime,\n diffDays,\n totalDays,\n shouldScroll: totalDays > 7\n });\n \n // 如果超过7天,允许滚动\n return totalDays > 7;\n } catch (error) {\n console.error('计算日期范围时出错:', error);\n // 出错时,默认不允许滚动\n return false;\n }\n});\n\n// 星期数据\nconst weekdays: Weekday[] = [\n { value: 0, label: '日', isWeekend: true },\n { value: 1, label: '一', isWeekend: false },\n { value: 2, label: '二', isWeekend: false },\n { value: 3, label: '三', isWeekend: false },\n { value: 4, label: '四', isWeekend: false },\n { value: 5, label: '五', isWeekend: false },\n { value: 6, label: '六', isWeekend: true }\n];\n\n// 根据当前显示的第一个日期动态排序星期,确保星期和日期对应\nconst orderedWeekdays = computed<Weekday[]>(() => {\n // 获取当前显示的第一个有效的日期\n const firstDate = filteredDisplayDates.value[0];\n if (!firstDate) {\n // 如果没有日期,返回默认的星期顺序\n return weekdays;\n }\n \n const firstDateWeekday = firstDate.weekday;\n const result: Weekday[] = [];\n \n // 从第一个日期的星期开始,按顺序排列7天的星期\n for (let i = 0; i < 7; i++) {\n const weekdayIndex = (firstDateWeekday + i) % 7;\n result.push(weekdays[weekdayIndex]);\n }\n \n return result;\n});\n\n// 当前显示的周开始日期\n// 初始化时就计算出正确的周开始日期,确保组件第一次渲染时就有有效值\nconst initCurrentWeekStart = () => {\n // 如果设置了startDate,就从startDate开始,否则从今天开始\n const baseDate = props.startDate || new Date();\n const day = baseDate.getDay(); // 0是周日,1是周一,2是周二,3是周三,4是周四,5是周五,6是周六\n // 计算从baseDate开始的周开始日期:如果是周一,diff=0;如果是周二,diff=-1;...;如果是周日,diff=-6\n const diff = baseDate.getDate() - (day === 0 ? 6 : day - 1);\n const startDate = new Date(baseDate);\n startDate.setDate(diff);\n return startDate;\n};\n\nconst currentWeekStart = ref(initCurrentWeekStart());\n\n// 组件挂载后再次确认周开始日期\nonMounted(() => {\n // 调试信息:打印props的值,看看是否能被正确接收\n console.log('props:', props);\n console.log('highlightType:', props.highlightType);\n});\n\n// 监听highlightType变化\nwatch(\n () => props.highlightType,\n (newValue) => {\n console.log('highlightType changed:', newValue);\n }\n);\n\n// 监听modelValue变化\nwatch(\n () => props.modelValue,\n (newValue) => {\n console.log('modelValue changed:', newValue);\n }\n);\n\n/**\n * 生成显示的日期数组\n */\nconst displayDates = computed<DateItem[]>(() => {\n const dates: DateItem[] = [];\n \n try {\n // 计算日期范围:从startDate开始,到endDate结束\n const start = props.startDate;\n const end = props.endDate;\n \n // 检查日期是否有效\n if (isNaN(start.getTime()) || isNaN(end.getTime())) {\n console.log('无效的日期对象,返回空数组');\n return dates;\n }\n \n // 计算总天数\n const totalDays = Math.ceil((end.getTime() - start.getTime()) / (1000 * 60 * 60 * 24)) + 1;\n \n // 生成日期数组\n for (let i = 0; i < totalDays; i++) {\n const date = new Date(start);\n date.setDate(start.getDate() + i);\n \n // 确保生成的日期是有效的\n if (!isNaN(date.getTime())) {\n dates.push({\n date,\n dateString: formatDate(date),\n day: date.getDate(),\n month: date.getMonth() + 1,\n year: date.getFullYear(),\n isWeekend: date.getDay() === 0 || date.getDay() === 6,\n weekday: date.getDay()\n });\n }\n }\n } catch (error) {\n console.error('生成日期数组时出错:', error);\n }\n \n return dates;\n});\n\n/**\n * 过滤后的日期数组,只包含有效的DateItem对象\n */\nconst filteredDisplayDates = computed<DateItem[]>(() => {\n return displayDates.value.filter((date): date is DateItem => {\n // 确保date是有效的DateItem对象,并且包含所有必要的属性\n return Boolean(date && \n date.date && \n date.dateString && \n !isNaN(date.date.getTime()) && \n typeof date.dateString === 'string' && \n typeof date.day === 'number');\n });\n});\n\n/**\n * 格式化日期为YYYY-MM-DD格式\n * @param date 日期对象\n * @returns 格式化后的日期字符串\n */\nconst formatDate = (date: Date): string => {\n return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`;\n};\n\n/**\n * 检查日期是否被选中\n * @param date 日期项\n * @returns 是否被选中\n */\nconst isSelected = (date: DateItem): boolean => {\n const dateStr = date.dateString;\n \n // 确保modelValue存在\n if (!props.modelValue) {\n return false;\n }\n \n if (Array.isArray(props.modelValue)) {\n // 范围选择\n return props.modelValue.some(selectedDate => {\n // 确保selectedDate是有效的Date对象\n if (!selectedDate || isNaN(selectedDate.getTime())) {\n return false;\n }\n return formatDate(selectedDate) === dateStr;\n });\n } else {\n // 单个日期选择\n // 确保modelValue是有效的Date对象\n if (isNaN(props.modelValue.getTime())) {\n return false;\n }\n return formatDate(props.modelValue) === dateStr;\n }\n};\n\n/**\n * 检查日期是否是今天\n * @param date 日期项\n * @returns 是否是今天\n */\nconst isToday = (date: DateItem): boolean => {\n const todayStr = formatDate(new Date());\n return date.dateString === todayStr;\n};\n\n/**\n * 检查日期是否在可选范围内\n * @param date 日期项\n * @returns 是否在范围内\n */\nconst isInRange = (date: DateItem): boolean => {\n const dateObj = date.date;\n \n if (props.disablePast && dateObj < new Date(new Date().setHours(0, 0, 0, 0))) {\n return false;\n }\n \n if (props.disableFuture && dateObj > new Date(new Date().setHours(23, 59, 59, 999))) {\n return false;\n }\n \n return dateObj >= props.startDate && dateObj <= props.endDate;\n};\n\n/**\n * 根据星期值获取星期标签\n * @param weekday 星期值(0-6,0代表周日)\n * @returns 星期标签\n */\nconst getWeekdayLabel = (weekday: number): string => {\n return weekdays.find(w => w.value === weekday)?.label || '';\n};\n\n/**\n * 处理日期点击事件\n * @param date 日期项\n */\nconst handleDateClick = (date: DateItem) => {\n if (!isInRange(date)) return;\n \n emit('dateClick', date);\n emit('update:modelValue', date.date);\n};\n</script>\n\n<style scoped>\n/* 基础容器样式 */\n.hbis-date-strip {\n display: flex;\n flex-direction: column;\n width: 100%;\n padding: 8px;\n background-color: #ffffff;\n border-radius: 8px;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);\n box-sizing: border-box;\n}\n\n/* 横向滚动模式 */\n.hbis-date-strip--scrollable {\n overflow: hidden;\n}\n\n/* 滚动包装器 */\n.hbis-date-strip__scroll-wrapper {\n overflow: hidden;\n width: 100%;\n}\n\n/* 滚动容器 */\n.hbis-date-strip__scroll-container {\n width: 100%;\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: none; /* 隐藏Firefox滚动条 */\n -ms-overflow-style: none; /* 隐藏IE滚动条 */\n}\n\n.hbis-date-strip__scroll-container::-webkit-scrollbar {\n display: none; /* 隐藏Chrome、Safari滚动条 */\n}\n\n/* 星期行样式 */\n.hbis-date-strip__weekdays {\n display: flex;\n margin-bottom: 8px;\n box-sizing: border-box;\n flex-wrap: nowrap;\n}\n\n/* 星期项样式 - 所有模式下都占1/7宽度 */\n.hbis-date-strip__weekday {\n text-align: center;\n font-size: 12px;\n font-weight: 500;\n color: #666666;\n padding: 4px 0;\n flex: 0 0 calc(100% / 7); /* 每日宽度占父宽度的1/7 */\n width: calc(100% / 7); /* 每日宽度占父宽度的1/7 */\n min-width: calc(100% / 7); /* 确保宽度固定,不受内容影响 */\n box-sizing: border-box;\n}\n\n.hbis-date-strip__weekday--weekend {\n color: #ff4d4f;\n}\n\n/* 日期行样式 - 所有模式下的基础样式 */\n.hbis-date-strip__dates {\n display: flex;\n justify-content: flex-start;\n width: 100%;\n box-sizing: border-box;\n}\n\n/* 滚动模式下的星期行 */\n.hbis-date-strip--scrollable .hbis-date-strip__weekdays {\n width: auto;\n}\n\n/* 滚动模式下的日期行 */\n.hbis-date-strip--scrollable .hbis-date-strip__dates {\n width: auto;\n flex-wrap: nowrap;\n}\n\n/* 非滚动模式下的日期行 */\n.hbis-date-strip:not(.hbis-date-strip--scrollable) .hbis-date-strip__dates {\n justify-content: space-around;\n width: 100%;\n}\n\n/* 日期项样式 - 所有模式下都和星期项宽度完全一致 */\n.hbis-date-strip__date {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 8px 0;\n border-radius: 4px;\n transition: all 0.2s ease;\n position: relative;\n user-select: none;\n cursor: pointer;\n flex: 0 0 calc(100% / 7); /* 和星期项保持完全一致,每日宽度占父宽度的1/7 */\n width: calc(100% / 7); /* 和星期项保持完全一致,每日宽度占父宽度的1/7 */\n min-width: calc(100% / 7); /* 和星期项保持完全一致,确保宽度固定 */\n max-width: calc(100% / 7); /* 和星期项保持完全一致,确保宽度不超过 */\n box-sizing: border-box;\n white-space: normal;\n}\n\n.hbis-date-strip__date--disabled {\n cursor: not-allowed;\n opacity: 0.6;\n}\n\n.hbis-date-strip__date--weekend {\n /* 周末颜色通过自定义属性控制 */\n}\n\n.hbis-date-strip__date-number {\n font-size: 14px;\n font-weight: 500;\n padding: 4px;\n transition: all 0.2s ease;\n width: 100%;\n text-align: center;\n box-sizing: border-box;\n}\n\n/* 选中样式 - 背景色高亮 */\n.hbis-date-strip--highlight-bg .hbis-date-strip__date--selected {\n /* 背景色和文字颜色通过内联样式控制 */\n}\n\n/* 选中样式 - 数字背景色高亮 */\n.hbis-date-strip--highlight-dot .hbis-date-strip__date--selected .hbis-date-strip__date-number {\n /* 背景色和文字颜色通过内联样式控制 */\n border-radius: 2px;\n}\n\n/* 选中样式 - 数字背景色圆角高亮 */\n.hbis-date-strip--highlight-round .hbis-date-strip__date--selected .hbis-date-strip__date-number {\n /* 背景色和文字颜色通过内联样式控制 */\n border-radius: 50%;\n padding: 4px 8px;\n min-width: 20px;\n text-align: center;\n}\n\n/* 今天样式 */\n.hbis-date-strip__date--today .hbis-date-strip__date-number {\n font-weight: 600;\n /* 今天颜色保持默认,不受自定义颜色影响 */\n color: #1890ff !important;\n}\n\n/* 禁用日期样式 */\n.hbis-date-strip__date--disabled {\n color: #cccccc !important;\n background-color: transparent !important;\n}\n\n/* 自定义slot样式 */\n.hbis-date-strip__custom {\n margin-top: 8px;\n padding-top: 8px;\n border-top: 1px solid #f0f0f0;\n}\n</style>"],"names":["_createElementBlock","_normalizeClass","__props","_renderSlot","_ctx","emit","__emit","handleClick","event","_openBlock","_hoisted_1","_createElementVNode","_hoisted_2","_toDisplayString","_hoisted_3","props","shouldScroll","computed","start","end","diffTime","diffDays","totalDays","error","weekdays","orderedWeekdays","firstDate","filteredDisplayDates","firstDateWeekday","result","i","weekdayIndex","ref","baseDate","day","diff","startDate","onMounted","watch","newValue","displayDates","dates","date","formatDate","isSelected","dateStr","selectedDate","isToday","todayStr","isInRange","dateObj","getWeekdayLabel","weekday","_a","w","handleDateClick","_hoisted_6","_hoisted_7","_hoisted_8","_Fragment","_renderList","_hoisted_9","_normalizeStyle","$event","_hoisted_11","_hoisted_5","$slots","_hoisted_12"],"mappings":";;;;;;;;2BACEA,EAEM,OAAA;AAAA,MAFD,OAAKC,EAAA,CAAC,gBAAc,EAAA,cAAyBC,EAAA,SAAO,CAAA;AAAA,IAAA;MACvDC,EAAwBC,yBAAxB,MAAwB;AAAA,YAAfF,EAAA,KAAK,GAAA,CAAA;AAAA,MAAA;;;;;;;;;;;;;;;;;AC2BlB,UAAMG,IAAOC,GAgBPC,IAAc,CAACC,MAAsB;AACzC,MAAAH,EAAK,SAASG,CAAK;AAAA,IACrB;sBA9CEC,EAAA,GAAAT,EAQM,OARNU,GAQM;AAAA,MAPJC,EAAqC,MAArCC,GAAqCC,EAAbX,EAAA,KAAK,GAAA,CAAA;AAAA,MAC7BS,EAEM,OAFNG,GAEM;AAAA,QADJX,EAAaC,EAAA,QAAA,WAAA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BAA0B;AAAA,cAC2B,qCAAAA,EAAQ;AAAA,YAAA;aAIhEvC,EAAAuC,EAAQ,KAAK,GAAA,CAAA;;QAKpBzC,EAmBM,OAnBNG,GAmBM;AAAA,kBAlBJd,EAiBM2D,GAAA,MAAAC,EAhBWjC,EAAA,OAAoB,CAA5Be,YADT1C,EAiBM,OAAA;AAAA,YAfH,KAAK0C,EAAK;AAAA,YACX,UAAM,yBAAuB;AAAA,cAC4B,mCAAAE,EAAWF,CAAI;AAAA,cAA+C,gCAAAK,EAAQL,CAAI;AAAA,cAAmD,mCAAA,CAAAO,EAAUP,CAAI;AAAA,cAAiD,kCAAAA,EAAK;AAAA,YAAA;YAMzP,OAAKoB,EAAA;AAAA,cAAuB,OAAAlB,EAAWF,CAAI,IAAIxC,EAAA,gBAAgBA,EAAA;AAAA,cAA0C,iBAAA0C,EAAWF,CAAI,IAAIxC,EAAA,kBAAkBA,EAAA;AAAA,YAAA;YAI9I,SAAK,CAAA6D,MAAER,EAAgBb,CAAI;AAAA,UAAA;YAE5B/B,EAA8D,OAA9DsD,GAA8DpD,EAAjB6B,EAAK,GAAG,GAAA,CAAA;AAAA,UAAA;;;MAmDhBwB,EAAAA,OAAO,WAAlDzD,KAAAT,EAEM,OAFNmE,IAEM;AAAA,QADJhE,EAAaC,EAAA,QAAA,WAAA,CAAA,GAAA,QAAA,EAAA;AAAA,MAAA;;;;"}
1
+ {"version":3,"file":"index.es.js","sources":["../c1/src/C1.vue","../c2/src/C2.vue","../hbis-dateStrip/src/hbis-dateStrip.vue"],"sourcesContent":["<template>\r\n <div class=\"c1-container\" :class=\"{ 'c1-primary': primary }\">\r\n <slot>{{ title }}</slot>\r\n </div>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\n/**\r\n * C1组件 - 基础组件示例\r\n * 用于展示基本的Vue3组件结构和TypeScript支持\r\n */\r\n\r\n// 定义组件属性\r\ninterface Props {\r\n /** 标题文本 */\r\n title?: string;\r\n /** 是否使用主要样式 */\r\n primary?: boolean;\r\n}\r\n\r\n// 定义组件属性默认值\r\nconst props = withDefaults(defineProps<Props>(), {\r\n title: 'C1 Component',\r\n primary: false\r\n});\r\n</script>\r\n\r\n<style scoped>\r\n.c1-container {\r\n padding: 16px;\r\n border: 1px solid #e0e0e0;\r\n border-radius: 4px;\r\n background-color: #ffffff;\r\n}\r\n\r\n.c1-primary {\r\n background-color: #1890ff;\r\n color: #ffffff;\r\n border-color: #1890ff;\r\n}\r\n</style>\r\n","<template>\r\n <div class=\"c2-container\">\r\n <h2 class=\"c2-title\">{{ title }}</h2>\r\n <div class=\"c2-content\">\r\n <slot></slot>\r\n </div>\r\n <button v-if=\"showButton\" class=\"c2-button\" @click=\"handleClick\">\r\n {{ buttonText }}\r\n </button>\r\n </div>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\n/**\r\n * C2组件 - 带按钮的容器组件\r\n * 用于展示包含事件处理的Vue3组件\r\n */\r\n\r\n// 定义组件属性\r\ninterface Props {\r\n /** 标题文本 */\r\n title?: string;\r\n /** 是否显示按钮 */\r\n showButton?: boolean;\r\n /** 按钮文本 */\r\n buttonText?: string;\r\n}\r\n\r\n// 定义组件事件\r\nconst emit = defineEmits<{\r\n /** 按钮点击事件 */\r\n (e: 'click', event: MouseEvent): void;\r\n}>();\r\n\r\n// 定义组件属性默认值\r\nconst props = withDefaults(defineProps<Props>(), {\r\n title: 'C2 Component',\r\n showButton: true,\r\n buttonText: 'Click Me'\r\n});\r\n\r\n/**\r\n * 处理按钮点击事件\r\n * @param event 鼠标点击事件对象\r\n */\r\nconst handleClick = (event: MouseEvent) => {\r\n emit('click', event);\r\n};\r\n</script>\r\n\r\n<style scoped>\r\n.c2-container {\r\n padding: 20px;\r\n border: 1px solid #e0e0e0;\r\n border-radius: 8px;\r\n background-color: #fafafa;\r\n margin: 16px 0;\r\n}\r\n\r\n.c2-title {\r\n margin: 0 0 12px 0;\r\n font-size: 18px;\r\n font-weight: 600;\r\n color: #333333;\r\n}\r\n\r\n.c2-content {\r\n margin-bottom: 16px;\r\n color: #666666;\r\n}\r\n\r\n.c2-button {\r\n padding: 8px 16px;\r\n background-color: #52c41a;\r\n color: #ffffff;\r\n border: none;\r\n border-radius: 4px;\r\n cursor: pointer;\r\n font-size: 14px;\r\n transition: background-color 0.3s;\r\n}\r\n\r\n.c2-button:hover {\r\n background-color: #73d13d;\r\n}\r\n</style>\r\n","<template>\r\n <div class=\"hbis-date-strip\" :class=\"{\r\n 'hbis-date-strip--highlight-bg': highlightType === 'bg',\r\n 'hbis-date-strip--highlight-dot': highlightType === 'dot',\r\n 'hbis-date-strip--highlight-round': highlightType === 'round',\r\n 'hbis-date-strip--scrollable': shouldScroll\r\n }\">\r\n <!-- 非滚动模式:星期行 + 固定日期行 -->\r\n <div v-if=\"!shouldScroll\">\r\n <!-- 星期行 - 固定显示7个星期,始终在顶部 -->\r\n <div class=\"hbis-date-strip__weekdays\">\r\n <div \r\n v-for=\"weekday in orderedWeekdays\" \r\n :key=\"weekday.value\"\r\n class=\"hbis-date-strip__weekday\"\r\n :class=\"{\r\n 'hbis-date-strip__weekday--weekend': weekday.isWeekend\r\n }\"\r\n >\r\n {{ weekday.label }}\r\n </div>\r\n </div>\r\n \r\n <!-- 日期行 - 固定显示7天 -->\r\n <div class=\"hbis-date-strip__dates\">\r\n <div \r\n v-for=\"date in filteredDisplayDates\" \r\n :key=\"date.dateString\"\r\n class=\"hbis-date-strip__date\"\r\n :class=\"{\r\n 'hbis-date-strip__date--selected': isSelected(date),\r\n 'hbis-date-strip__date--today': isToday(date),\r\n 'hbis-date-strip__date--disabled': !isInRange(date),\r\n 'hbis-date-strip__date--weekend': date.isWeekend\r\n }\"\r\n :style=\"{\r\n color: isSelected(date) ? selectedColor : normalColor,\r\n backgroundColor: isSelected(date) ? selectedBgColor : normalBgColor\r\n }\"\r\n @click=\"handleDateClick(date)\"\r\n >\r\n <div class=\"hbis-date-strip__date-number\">{{ date.day }}</div>\r\n <!-- 每个日期项的自定义slot -->\r\n <div class=\"hbis-date-strip__date-slot\">\r\n <slot :date=\"date\"></slot>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n <!-- 滚动模式:星期行和日期行一起滚动 -->\r\n <div v-else class=\"hbis-date-strip__scroll-wrapper\">\r\n <!-- 滚动容器 - 包含星期行和日期行 -->\r\n <div \r\n class=\"hbis-date-strip__scroll-container\"\r\n >\r\n <!-- 星期行 - 与日期一起滚动 -->\r\n <div class=\"hbis-date-strip__weekdays\">\r\n <div \r\n v-for=\"date in filteredDisplayDates\" \r\n :key=\"date.dateString + '-weekday'\"\r\n class=\"hbis-date-strip__weekday\"\r\n :class=\"{\r\n 'hbis-date-strip__weekday--weekend': date.isWeekend\r\n }\"\r\n >\r\n <!-- 显示每个日期对应的星期 -->\r\n {{ getWeekdayLabel(date.weekday) }}\r\n </div>\r\n </div>\r\n \r\n <!-- 日期行 - 一页显示7天,支持横向滑动 -->\r\n <div class=\"hbis-date-strip__dates\">\r\n <div \r\n v-for=\"date in filteredDisplayDates\" \r\n :key=\"date.dateString\"\r\n class=\"hbis-date-strip__date\"\r\n :class=\"{\r\n 'hbis-date-strip__date--selected': isSelected(date),\r\n 'hbis-date-strip__date--today': isToday(date),\r\n 'hbis-date-strip__date--disabled': !isInRange(date),\r\n 'hbis-date-strip__date--weekend': date.isWeekend\r\n }\"\r\n :style=\"{\r\n color: isSelected(date) ? selectedColor : normalColor,\r\n backgroundColor: isSelected(date) ? selectedBgColor : normalBgColor\r\n }\"\r\n @click=\"handleDateClick(date)\"\r\n >\r\n <div class=\"hbis-date-strip__date-number\">{{ date.day }}</div>\r\n <!-- 每个日期项的自定义slot -->\r\n <div class=\"hbis-date-strip__date-slot\">\r\n <slot :date=\"date\"></slot>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n\r\n </div>\r\n</template>\r\n\r\n<script setup lang=\"ts\">\r\n/**\r\n * hbis-dateStrip组件 - 用于展示一周的日历信息\r\n * 支持多种切换方式和选中样式\r\n * 兼容平台:H5、App、微信小程序、支付宝小程序等Uniapp支持的所有平台\r\n */\r\n\r\nimport { ref, computed, onMounted, watch } from 'vue';\r\n\r\n// 星期数据类型\r\ninterface Weekday {\r\n value: number;\r\n label: string;\r\n isWeekend: boolean;\r\n}\r\n\r\n// 日期数据类型\r\ninterface DateItem {\r\n date: Date;\r\n dateString: string;\r\n day: number;\r\n month: number;\r\n year: number;\r\n isWeekend: boolean;\r\n weekday: number;\r\n}\r\n\r\n// 组件属性类型\r\ninterface Props {\r\n /** 选中日期,可以是单个日期或日期范围 */\r\n modelValue?: Date | Date[];\r\n /** 日期范围开始 */\r\n startDate?: Date;\r\n /** 日期范围结束 */\r\n endDate?: Date;\r\n /** 选中样式类型:bg(背景色高亮), dot(数字背景色高亮), round(数字背景色圆角高亮) */\r\n highlightType?: 'bg' | 'dot' | 'round';\r\n /** 是否显示今天 */\r\n showToday?: boolean;\r\n /** 是否禁用过去的日期 */\r\n disablePast?: boolean;\r\n /** 是否禁用未来的日期 */\r\n disableFuture?: boolean;\r\n /** 选中状态的文字颜色 */\r\n selectedColor?: string;\r\n /** 正常状态的文字颜色 */\r\n normalColor?: string;\r\n /** 选中状态的背景颜色 */\r\n selectedBgColor?: string;\r\n /** 正常状态的背景颜色 */\r\n normalBgColor?: string;\r\n /** 是否支持横向滑动日期 */\r\n scrollable?: boolean;\r\n /** 可见的天数(默认7天) */\r\n visibleDays?: number;\r\n}\r\n\r\n// 定义组件属性默认值\r\nconst props = withDefaults(defineProps<Props>(), {\r\n modelValue: () => new Date(),\r\n startDate: () => new Date(),\r\n endDate: () => {\r\n const end = new Date();\r\n end.setDate(end.getDate() + 30);\r\n return end;\r\n },\r\n highlightType: 'bg',\r\n showToday: true,\r\n disablePast: false,\r\n disableFuture: false,\r\n selectedColor: '#ffffff',\r\n normalColor: '#666666',\r\n selectedBgColor: '#1890ff',\r\n normalBgColor: 'transparent',\r\n scrollable: false,\r\n visibleDays: 7\r\n});\r\n\r\n// 直接使用props访问属性,确保响应性\r\n// 注意:在Vue 3 Composition API中,解构props会失去响应性\r\n\r\n// 定义组件事件\r\nconst emit = defineEmits<{\r\n /** 选中日期变化事件 */\r\n (e: 'update:modelValue', value: Date | Date[]): void;\r\n /** 日期点击事件 */\r\n (e: 'dateClick', date: DateItem): void;\r\n}>();\r\n\r\n// 计算是否需要滚动:如果日期范围超过7天,则可以滚动\r\nconst shouldScroll = computed<boolean>(() => {\r\n // 调试信息:打印props,查看startDate和endDate的值\r\n console.log('props:', {\r\n startDate: props.startDate,\r\n endDate: props.endDate,\r\n scrollable: props.scrollable\r\n });\r\n \r\n // 如果显式设置了scrollable为true,直接返回true\r\n if (props.scrollable) {\r\n console.log('显式设置了scrollable为true,允许滚动');\r\n return true;\r\n }\r\n \r\n try {\r\n // 计算日期范围的天数,忽略时间部分\r\n const start = new Date(props.startDate);\r\n start.setHours(0, 0, 0, 0);\r\n \r\n const end = new Date(props.endDate);\r\n end.setHours(0, 0, 0, 0);\r\n \r\n // 检查日期是否有效\r\n if (isNaN(start.getTime()) || isNaN(end.getTime())) {\r\n console.log('无效的日期对象,使用默认滚动行为');\r\n return false;\r\n }\r\n \r\n // 计算总天数,确保结果正确\r\n const diffTime = end.getTime() - start.getTime();\r\n const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));\r\n const totalDays = diffDays + 1;\r\n \r\n // 调试信息\r\n console.log('日期范围天数计算:', {\r\n start: start.toLocaleDateString(),\r\n end: end.toLocaleDateString(),\r\n diffTime,\r\n diffDays,\r\n totalDays,\r\n shouldScroll: totalDays > 7\r\n });\r\n \r\n // 如果超过7天,允许滚动\r\n return totalDays > 7;\r\n } catch (error) {\r\n console.error('计算日期范围时出错:', error);\r\n // 出错时,默认不允许滚动\r\n return false;\r\n }\r\n});\r\n\r\n// 星期数据\r\nconst weekdays: Weekday[] = [\r\n { value: 0, label: '日', isWeekend: true },\r\n { value: 1, label: '一', isWeekend: false },\r\n { value: 2, label: '二', isWeekend: false },\r\n { value: 3, label: '三', isWeekend: false },\r\n { value: 4, label: '四', isWeekend: false },\r\n { value: 5, label: '五', isWeekend: false },\r\n { value: 6, label: '六', isWeekend: true }\r\n];\r\n\r\n// 根据当前显示的第一个日期动态排序星期,确保星期和日期对应\r\nconst orderedWeekdays = computed<Weekday[]>(() => {\r\n // 获取当前显示的第一个有效的日期\r\n const firstDate = filteredDisplayDates.value[0];\r\n if (!firstDate) {\r\n // 如果没有日期,返回默认的星期顺序\r\n return weekdays;\r\n }\r\n \r\n const firstDateWeekday = firstDate.weekday;\r\n const result: Weekday[] = [];\r\n \r\n // 从第一个日期的星期开始,按顺序排列7天的星期\r\n for (let i = 0; i < 7; i++) {\r\n const weekdayIndex = (firstDateWeekday + i) % 7;\r\n result.push(weekdays[weekdayIndex]);\r\n }\r\n \r\n return result;\r\n});\r\n\r\n// 当前显示的周开始日期\r\n// 初始化时就计算出正确的周开始日期,确保组件第一次渲染时就有有效值\r\nconst initCurrentWeekStart = () => {\r\n // 如果设置了startDate,就从startDate开始,否则从今天开始\r\n const baseDate = props.startDate || new Date();\r\n const day = baseDate.getDay(); // 0是周日,1是周一,2是周二,3是周三,4是周四,5是周五,6是周六\r\n // 计算从baseDate开始的周开始日期:如果是周一,diff=0;如果是周二,diff=-1;...;如果是周日,diff=-6\r\n const diff = baseDate.getDate() - (day === 0 ? 6 : day - 1);\r\n const startDate = new Date(baseDate);\r\n startDate.setDate(diff);\r\n return startDate;\r\n};\r\n\r\nconst currentWeekStart = ref(initCurrentWeekStart());\r\n\r\n// 组件挂载后再次确认周开始日期\r\nonMounted(() => {\r\n // 调试信息:打印props的值,看看是否能被正确接收\r\n console.log('props:', props);\r\n console.log('highlightType:', props.highlightType);\r\n});\r\n\r\n// 监听highlightType变化\r\nwatch(\r\n () => props.highlightType,\r\n (newValue) => {\r\n console.log('highlightType changed:', newValue);\r\n }\r\n);\r\n\r\n// 监听modelValue变化\r\nwatch(\r\n () => props.modelValue,\r\n (newValue) => {\r\n console.log('modelValue changed:', newValue);\r\n }\r\n);\r\n\r\n/**\r\n * 生成显示的日期数组\r\n */\r\nconst displayDates = computed<DateItem[]>(() => {\r\n const dates: DateItem[] = [];\r\n \r\n try {\r\n // 计算日期范围:从startDate开始,到endDate结束\r\n const start = props.startDate;\r\n const end = props.endDate;\r\n \r\n // 检查日期是否有效\r\n if (isNaN(start.getTime()) || isNaN(end.getTime())) {\r\n console.log('无效的日期对象,返回空数组');\r\n return dates;\r\n }\r\n \r\n // 计算总天数\r\n const totalDays = Math.ceil((end.getTime() - start.getTime()) / (1000 * 60 * 60 * 24)) + 1;\r\n \r\n // 生成日期数组\r\n for (let i = 0; i < totalDays; i++) {\r\n const date = new Date(start);\r\n date.setDate(start.getDate() + i);\r\n \r\n // 确保生成的日期是有效的\r\n if (!isNaN(date.getTime())) {\r\n dates.push({\r\n date,\r\n dateString: formatDate(date),\r\n day: date.getDate(),\r\n month: date.getMonth() + 1,\r\n year: date.getFullYear(),\r\n isWeekend: date.getDay() === 0 || date.getDay() === 6,\r\n weekday: date.getDay()\r\n });\r\n }\r\n }\r\n } catch (error) {\r\n console.error('生成日期数组时出错:', error);\r\n }\r\n \r\n return dates;\r\n});\r\n\r\n/**\r\n * 过滤后的日期数组,只包含有效的DateItem对象\r\n */\r\nconst filteredDisplayDates = computed<DateItem[]>(() => {\r\n return displayDates.value.filter((date): date is DateItem => {\r\n // 确保date是有效的DateItem对象,并且包含所有必要的属性\r\n return Boolean(date && \r\n date.date && \r\n date.dateString && \r\n !isNaN(date.date.getTime()) && \r\n typeof date.dateString === 'string' && \r\n typeof date.day === 'number');\r\n });\r\n});\r\n\r\n/**\r\n * 格式化日期为YYYY-MM-DD格式\r\n * @param date 日期对象\r\n * @returns 格式化后的日期字符串\r\n */\r\nconst formatDate = (date: Date): string => {\r\n return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`;\r\n};\r\n\r\n/**\r\n * 检查日期是否被选中\r\n * @param date 日期项\r\n * @returns 是否被选中\r\n */\r\nconst isSelected = (date: DateItem): boolean => {\r\n const dateStr = date.dateString;\r\n \r\n // 确保modelValue存在\r\n if (!props.modelValue) {\r\n return false;\r\n }\r\n \r\n if (Array.isArray(props.modelValue)) {\r\n // 范围选择\r\n return props.modelValue.some(selectedDate => {\r\n // 确保selectedDate是有效的Date对象\r\n if (!selectedDate || isNaN(selectedDate.getTime())) {\r\n return false;\r\n }\r\n return formatDate(selectedDate) === dateStr;\r\n });\r\n } else {\r\n // 单个日期选择\r\n // 确保modelValue是有效的Date对象\r\n if (isNaN(props.modelValue.getTime())) {\r\n return false;\r\n }\r\n return formatDate(props.modelValue) === dateStr;\r\n }\r\n};\r\n\r\n/**\r\n * 检查日期是否是今天\r\n * @param date 日期项\r\n * @returns 是否是今天\r\n */\r\nconst isToday = (date: DateItem): boolean => {\r\n const todayStr = formatDate(new Date());\r\n return date.dateString === todayStr;\r\n};\r\n\r\n/**\r\n * 检查日期是否在可选范围内\r\n * @param date 日期项\r\n * @returns 是否在范围内\r\n */\r\nconst isInRange = (date: DateItem): boolean => {\r\n const dateObj = date.date;\r\n \r\n if (props.disablePast && dateObj < new Date(new Date().setHours(0, 0, 0, 0))) {\r\n return false;\r\n }\r\n \r\n if (props.disableFuture && dateObj > new Date(new Date().setHours(23, 59, 59, 999))) {\r\n return false;\r\n }\r\n \r\n return dateObj >= props.startDate && dateObj <= props.endDate;\r\n};\r\n\r\n/**\r\n * 根据星期值获取星期标签\r\n * @param weekday 星期值(0-6,0代表周日)\r\n * @returns 星期标签\r\n */\r\nconst getWeekdayLabel = (weekday: number): string => {\r\n return weekdays.find(w => w.value === weekday)?.label || '';\r\n};\r\n\r\n/**\r\n * 处理日期点击事件\r\n * @param date 日期项\r\n */\r\nconst handleDateClick = (date: DateItem) => {\r\n if (!isInRange(date)) return;\r\n \r\n emit('dateClick', date);\r\n emit('update:modelValue', date.date);\r\n};\r\n</script>\r\n\r\n<style scoped>\r\n/* 基础容器样式 */\r\n.hbis-date-strip {\r\n display: flex;\r\n flex-direction: column;\r\n width: 100%;\r\n padding: 8px;\r\n background-color: #ffffff;\r\n border-radius: 8px;\r\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);\r\n box-sizing: border-box;\r\n}\r\n\r\n/* 横向滚动模式 */\r\n.hbis-date-strip--scrollable {\r\n overflow: hidden;\r\n}\r\n\r\n/* 滚动包装器 */\r\n.hbis-date-strip__scroll-wrapper {\r\n overflow: hidden;\r\n width: 100%;\r\n}\r\n\r\n/* 滚动容器 */\r\n.hbis-date-strip__scroll-container {\r\n width: 100%;\r\n overflow-x: auto;\r\n overflow-y: hidden;\r\n scrollbar-width: none; /* 隐藏Firefox滚动条 */\r\n -ms-overflow-style: none; /* 隐藏IE滚动条 */\r\n}\r\n\r\n.hbis-date-strip__scroll-container::-webkit-scrollbar {\r\n display: none; /* 隐藏Chrome、Safari滚动条 */\r\n}\r\n\r\n/* 星期行样式 */\r\n.hbis-date-strip__weekdays {\r\n display: flex;\r\n margin-bottom: 8px;\r\n box-sizing: border-box;\r\n flex-wrap: nowrap;\r\n}\r\n\r\n/* 星期项样式 - 所有模式下都占1/7宽度 */\r\n.hbis-date-strip__weekday {\r\n text-align: center;\r\n font-size: 12px;\r\n font-weight: 500;\r\n color: #666666;\r\n padding: 4px 0;\r\n flex: 0 0 calc(100% / 7); /* 每日宽度占父宽度的1/7 */\r\n width: calc(100% / 7); /* 每日宽度占父宽度的1/7 */\r\n min-width: calc(100% / 7); /* 确保宽度固定,不受内容影响 */\r\n box-sizing: border-box;\r\n}\r\n\r\n.hbis-date-strip__weekday--weekend {\r\n color: #ff4d4f;\r\n}\r\n\r\n/* 日期行样式 - 所有模式下的基础样式 */\r\n.hbis-date-strip__dates {\r\n display: flex;\r\n justify-content: flex-start;\r\n width: 100%;\r\n box-sizing: border-box;\r\n}\r\n\r\n/* 滚动模式下的星期行 */\r\n.hbis-date-strip--scrollable .hbis-date-strip__weekdays {\r\n width: auto;\r\n}\r\n\r\n/* 滚动模式下的日期行 */\r\n.hbis-date-strip--scrollable .hbis-date-strip__dates {\r\n width: auto;\r\n flex-wrap: nowrap;\r\n}\r\n\r\n/* 非滚动模式下的日期行 */\r\n.hbis-date-strip:not(.hbis-date-strip--scrollable) .hbis-date-strip__dates {\r\n justify-content: space-around;\r\n width: 100%;\r\n}\r\n\r\n/* 日期项样式 - 所有模式下都和星期项宽度完全一致 */\r\n.hbis-date-strip__date {\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n justify-content: center;\r\n padding: 8px 0;\r\n border-radius: 4px;\r\n transition: all 0.2s ease;\r\n position: relative;\r\n user-select: none;\r\n cursor: pointer;\r\n flex: 0 0 calc(100% / 7); /* 和星期项保持完全一致,每日宽度占父宽度的1/7 */\r\n width: calc(100% / 7); /* 和星期项保持完全一致,每日宽度占父宽度的1/7 */\r\n min-width: calc(100% / 7); /* 和星期项保持完全一致,确保宽度固定 */\r\n max-width: calc(100% / 7); /* 和星期项保持完全一致,确保宽度不超过 */\r\n box-sizing: border-box;\r\n white-space: normal;\r\n}\r\n\r\n.hbis-date-strip__date--disabled {\r\n cursor: not-allowed;\r\n opacity: 0.6;\r\n}\r\n\r\n.hbis-date-strip__date--weekend {\r\n /* 周末颜色通过自定义属性控制 */\r\n}\r\n\r\n.hbis-date-strip__date-number {\r\n font-size: 14px;\r\n font-weight: 500;\r\n padding: 4px;\r\n transition: all 0.2s ease;\r\n width: 100%;\r\n text-align: center;\r\n box-sizing: border-box;\r\n}\r\n\r\n/* 日期slot样式 */\r\n.hbis-date-strip__date-slot {\r\n margin-top: 4px;\r\n font-size: 10px;\r\n text-align: center;\r\n width: 100%;\r\n box-sizing: border-box;\r\n}\r\n\r\n/* 选中样式 - 背景色高亮 */\r\n.hbis-date-strip--highlight-bg .hbis-date-strip__date--selected {\r\n /* 背景色和文字颜色通过内联样式控制 */\r\n}\r\n\r\n/* 选中样式 - 数字背景色高亮 */\r\n.hbis-date-strip--highlight-dot .hbis-date-strip__date--selected .hbis-date-strip__date-number {\r\n /* 背景色和文字颜色通过内联样式控制 */\r\n border-radius: 2px;\r\n}\r\n\r\n/* 选中样式 - 数字背景色圆角高亮 */\r\n.hbis-date-strip--highlight-round .hbis-date-strip__date--selected .hbis-date-strip__date-number {\r\n /* 背景色和文字颜色通过内联样式控制 */\r\n border-radius: 50%;\r\n padding: 4px 8px;\r\n min-width: 20px;\r\n text-align: center;\r\n}\r\n\r\n/* 今天样式 */\r\n.hbis-date-strip__date--today .hbis-date-strip__date-number {\r\n font-weight: 600;\r\n /* 今天颜色保持默认,不受自定义颜色影响 */\r\n color: #1890ff !important;\r\n}\r\n\r\n/* 禁用日期样式 */\r\n.hbis-date-strip__date--disabled {\r\n color: #cccccc !important;\r\n background-color: transparent !important;\r\n}\r\n</style>"],"names":["_createElementBlock","_normalizeClass","__props","_renderSlot","_ctx","emit","__emit","handleClick","event","_openBlock","_hoisted_1","_createElementVNode","_hoisted_2","_toDisplayString","_hoisted_3","props","shouldScroll","computed","start","end","diffTime","diffDays","totalDays","error","weekdays","orderedWeekdays","firstDate","filteredDisplayDates","firstDateWeekday","result","weekdayIndex","ref","baseDate","day","diff","startDate","onMounted","watch","newValue","displayDates","dates","i","date","formatDate","isSelected","dateStr","selectedDate","isToday","todayStr","isInRange","dateObj","getWeekdayLabel","weekday","_a","w","handleDateClick","_hoisted_7","_hoisted_8","_hoisted_9","_Fragment","_renderList","_hoisted_10","_normalizeStyle","$event","_hoisted_12","_hoisted_13","_hoisted_5","_hoisted_6"],"mappings":";;;;;;;;2BACEA,EAEM,OAAA;AAAA,MAFD,OAAKC,EAAA,CAAC,gBAAc,EAAA,cAAyBC,EAAA,SAAO,CAAA;AAAA,IAAA;MACvDC,EAAwBC,yBAAxB,MAAwB;AAAA,YAAfF,EAAA,KAAK,GAAA,CAAA;AAAA,MAAA;;;;;;;;;;;;;;;;;AC2BlB,UAAMG,IAAOC,GAgBPC,IAAc,CAACC,MAAsB;AACzC,MAAAH,EAAK,SAASG,CAAK;AAA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color:#fff}.c1-primary[data-v-e2028f64]{background-color:#1890ff;color:#fff;border-color:#1890ff}.c2-container[data-v-b1d573ae]{padding:20px;border:1px solid #e0e0e0;border-radius:8px;background-color:#fafafa;margin:16px 0}.c2-title[data-v-b1d573ae]{margin:0 0 12px;font-size:18px;font-weight:600;color:#333}.c2-content[data-v-b1d573ae]{margin-bottom:16px;color:#666}.c2-button[data-v-b1d573ae]{padding:8px 16px;background-color:#52c41a;color:#fff;border:none;border-radius:4px;cursor:pointer;font-size:14px;transition:background-color .3s}.c2-button[data-v-b1d573ae]:hover{background-color:#73d13d}.hbis-date-strip[data-v-7591067b]{display:flex;flex-direction:column;width:100%;padding:8px;background-color:#fff;border-radius:8px;box-shadow:0 2px 8px #0000001a;box-sizing:border-box}.hbis-date-strip--scrollable[data-v-7591067b]{overflow:hidden}.hbis-date-strip__scroll-wrapper[data-v-7591067b]{overflow:hidden;width:100%}.hbis-date-strip__scroll-container[data-v-7591067b]{width:100%;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;-ms-overflow-style:none}.hbis-date-strip__scroll-container[data-v-7591067b]::-webkit-scrollbar{display:none}.hbis-date-strip__weekdays[data-v-7591067b]{display:flex;margin-bottom:8px;box-sizing:border-box;flex-wrap:nowrap}.hbis-date-strip__weekday[data-v-7591067b]{text-align:center;font-size:12px;font-weight:500;color:#666;padding:4px 0;flex:0 0 calc(100% / 7);width:calc(100% / 7);min-width:calc(100% / 7);box-sizing:border-box}.hbis-date-strip__weekday--weekend[data-v-7591067b]{color:#ff4d4f}.hbis-date-strip__dates[data-v-7591067b]{display:flex;justify-content:flex-start;width:100%;box-sizing:border-box}.hbis-date-strip--scrollable .hbis-date-strip__weekdays[data-v-7591067b]{width:auto}.hbis-date-strip--scrollable .hbis-date-strip__dates[data-v-7591067b]{width:auto;flex-wrap:nowrap}.hbis-date-strip:not(.hbis-date-strip--scrollable) .hbis-date-strip__dates[data-v-7591067b]{justify-content:space-around;width:100%}.hbis-date-strip__date[data-v-7591067b]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:8px 0;border-radius:4px;transition:all .2s ease;position:relative;-webkit-user-select:none;user-select:none;cursor:pointer;flex:0 0 calc(100% / 7);width:calc(100% / 7);min-width:calc(100% / 7);max-width:calc(100% / 7);box-sizing:border-box;white-space:normal}.hbis-date-strip__date--disabled[data-v-7591067b]{cursor:not-allowed;opacity:.6}.hbis-date-strip__date-number[data-v-7591067b]{font-size:14px;font-weight:500;padding:4px;transition:all .2s ease;width:100%;text-align:center;box-sizing:border-box}.hbis-date-strip--highlight-dot .hbis-date-strip__date--selected .hbis-date-strip__date-number[data-v-7591067b]{border-radius:2px}.hbis-date-strip--highlight-round .hbis-date-strip__date--selected .hbis-date-strip__date-number[data-v-7591067b]{border-radius:50%;padding:4px 8px;min-width:20px;text-align:center}.hbis-date-strip__date--today .hbis-date-strip__date-number[data-v-7591067b]{font-weight:600;color:#1890ff!important}.hbis-date-strip__date--disabled[data-v-7591067b]{color:#ccc!important;background-color:transparent!important}.hbis-date-strip__custom[data-v-7591067b]{margin-top:8px;padding-top:8px;border-top:1px solid #f0f0f0}
1
+ .c1-container[data-v-e2250793]{padding:16px;border:1px solid #e0e0e0;border-radius:4px;background-color:#fff}.c1-primary[data-v-e2250793]{background-color:#1890ff;color:#fff;border-color:#1890ff}.c2-container[data-v-ed1086ed]{padding:20px;border:1px solid #e0e0e0;border-radius:8px;background-color:#fafafa;margin:16px 0}.c2-title[data-v-ed1086ed]{margin:0 0 12px;font-size:18px;font-weight:600;color:#333}.c2-content[data-v-ed1086ed]{margin-bottom:16px;color:#666}.c2-button[data-v-ed1086ed]{padding:8px 16px;background-color:#52c41a;color:#fff;border:none;border-radius:4px;cursor:pointer;font-size:14px;transition:background-color .3s}.c2-button[data-v-ed1086ed]:hover{background-color:#73d13d}.hbis-date-strip[data-v-f7fe6423]{display:flex;flex-direction:column;width:100%;padding:8px;background-color:#fff;border-radius:8px;box-shadow:0 2px 8px #0000001a;box-sizing:border-box}.hbis-date-strip--scrollable[data-v-f7fe6423]{overflow:hidden}.hbis-date-strip__scroll-wrapper[data-v-f7fe6423]{overflow:hidden;width:100%}.hbis-date-strip__scroll-container[data-v-f7fe6423]{width:100%;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;-ms-overflow-style:none}.hbis-date-strip__scroll-container[data-v-f7fe6423]::-webkit-scrollbar{display:none}.hbis-date-strip__weekdays[data-v-f7fe6423]{display:flex;margin-bottom:8px;box-sizing:border-box;flex-wrap:nowrap}.hbis-date-strip__weekday[data-v-f7fe6423]{text-align:center;font-size:12px;font-weight:500;color:#666;padding:4px 0;flex:0 0 calc(100% / 7);width:calc(100% / 7);min-width:calc(100% / 7);box-sizing:border-box}.hbis-date-strip__weekday--weekend[data-v-f7fe6423]{color:#ff4d4f}.hbis-date-strip__dates[data-v-f7fe6423]{display:flex;justify-content:flex-start;width:100%;box-sizing:border-box}.hbis-date-strip--scrollable .hbis-date-strip__weekdays[data-v-f7fe6423]{width:auto}.hbis-date-strip--scrollable .hbis-date-strip__dates[data-v-f7fe6423]{width:auto;flex-wrap:nowrap}.hbis-date-strip:not(.hbis-date-strip--scrollable) .hbis-date-strip__dates[data-v-f7fe6423]{justify-content:space-around;width:100%}.hbis-date-strip__date[data-v-f7fe6423]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:8px 0;border-radius:4px;transition:all .2s ease;position:relative;-webkit-user-select:none;user-select:none;cursor:pointer;flex:0 0 calc(100% / 7);width:calc(100% / 7);min-width:calc(100% / 7);max-width:calc(100% / 7);box-sizing:border-box;white-space:normal}.hbis-date-strip__date--disabled[data-v-f7fe6423]{cursor:not-allowed;opacity:.6}.hbis-date-strip__date-number[data-v-f7fe6423]{font-size:14px;font-weight:500;padding:4px;transition:all .2s ease;width:100%;text-align:center;box-sizing:border-box}.hbis-date-strip__date-slot[data-v-f7fe6423]{margin-top:4px;font-size:10px;text-align:center;width:100%;box-sizing:border-box}.hbis-date-strip--highlight-dot .hbis-date-strip__date--selected .hbis-date-strip__date-number[data-v-f7fe6423]{border-radius:2px}.hbis-date-strip--highlight-round .hbis-date-strip__date--selected .hbis-date-strip__date-number[data-v-f7fe6423]{border-radius:50%;padding:4px 8px;min-width:20px;text-align:center}.hbis-date-strip__date--today .hbis-date-strip__date-number[data-v-f7fe6423]{font-weight:600;color:#1890ff!important}.hbis-date-strip__date--disabled[data-v-f7fe6423]{color:#ccc!important;background-color:transparent!important}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hbis-uni/components",
3
- "version": "1.0.9",
3
+ "version": "2.0.0",
4
4
  "description": "HBIS UNI components library",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",
@@ -26,6 +26,11 @@
26
26
  "require": "dist/index.cjs.js",
27
27
  "types": "dist/types/index.d.ts"
28
28
  },
29
+ "./hbis-previewImage": {
30
+ "import": "dist/index.es.js",
31
+ "require": "dist/index.cjs.js",
32
+ "types": "dist/types/index.d.ts"
33
+ },
29
34
  "./dist/style.css": {
30
35
  "import": "dist/style.css",
31
36
  "require": "dist/style.css"
@@ -39,5 +44,6 @@
39
44
  ],
40
45
  "publishConfig": {
41
46
  "access": "public"
42
- }
47
+ },
48
+ "git-checks": false
43
49
  }