@hbis-uni/components 1.0.1 → 1.0.9

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"),s=e.defineComponent({__name:"C1",props:{title:{default:"C1 Component"},primary:{type:Boolean,default:!1}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["c1-container",{"c1-primary":t.primary}])},[e.renderSlot(o.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)],!0)],2))}}),a=(t,o)=>{const n=t.__vccOpts||t;for(const[l,c]of o)n[l]=c;return n},r=a(s,[["__scopeId","data-v-e2028f64"]]),i={class:"c2-container"},d={class:"c2-title"},u={class:"c2-content"},m=e.defineComponent({__name:"C2",props:{title:{default:"C2 Component"},showButton:{type:Boolean,default:!0},buttonText:{default:"Click Me"}},emits:["click"],setup(t,{emit:o}){const n=o,l=c=>{n("click",c)};return(c,_)=>(e.openBlock(),e.createElementBlock("div",i,[e.createElementVNode("h2",d,e.toDisplayString(t.title),1),e.createElementVNode("div",u,[e.renderSlot(c.$slots,"default",{},void 0,!0)]),t.showButton?(e.openBlock(),e.createElementBlock("button",{key:0,class:"c2-button",onClick:l},e.toDisplayString(t.buttonText),1)):e.createCommentVNode("",!0)]))}}),p=a(m,[["__scopeId","data-v-b1d573ae"]]);exports.C1=r;exports.C2=p;
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;
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"],"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"],"names":["_createElementBlock","_normalizeClass","__props","_renderSlot","_ctx","emit","__emit","handleClick","event","_openBlock","_hoisted_1","_createElementVNode","_hoisted_2","_toDisplayString","_hoisted_3"],"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"}
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,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,KAIhExC,kBAAAwC,EAAQ,KAAK,EAAA,CAAA,YAKpB1C,EAAAA,mBAmBM,MAnBNG,EAmBM,kBAlBJd,EAAAA,mBAiBM4D,EAAAA,SAAA,KAAAC,EAAAA,WAhBWlC,EAAA,MAARgB,kBADT3C,EAAAA,mBAiBM,MAAA,CAfH,IAAK2C,EAAK,WACX,wBAAM,wBAAuB,CAC4B,kCAAAE,EAAWF,CAAI,EAA+C,+BAAAK,EAAQL,CAAI,EAAmD,kCAAA,CAAAO,EAAUP,CAAI,EAAiD,iCAAAA,EAAK,SAAA,IAMzP,MAAKoB,EAAAA,eAAA,CAAuB,MAAAlB,EAAWF,CAAI,EAAIzC,EAAA,cAAgBA,EAAA,YAA0C,gBAAA2C,EAAWF,CAAI,EAAIzC,EAAA,gBAAkBA,EAAA,aAAA,GAI9I,QAAK8D,GAAER,EAAgBb,CAAI,CAAA,GAE5BhC,EAAAA,mBAA8D,MAA9DuD,EAA8DrD,EAAAA,gBAAjB8B,EAAK,GAAG,EAAA,CAAA,CAAA,qBAmDhBwB,EAAAA,OAAO,SAAlD1D,EAAAA,YAAAT,EAAAA,mBAEM,MAFNoE,EAEM,CADJjE,EAAAA,WAAaC,EAAA,OAAA,UAAA,CAAA,EAAA,OAAA,EAAA,CAAA"}
package/dist/index.es.js CHANGED
@@ -1,25 +1,25 @@
1
- import { defineComponent as i, createElementBlock as s, openBlock as a, normalizeClass as m, renderSlot as d, createTextVNode as _, toDisplayString as l, createElementVNode as r, createCommentVNode as p } from "vue";
2
- const f = /* @__PURE__ */ i({
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({
3
3
  __name: "C1",
4
4
  props: {
5
5
  title: { default: "C1 Component" },
6
6
  primary: { type: Boolean, default: !1 }
7
7
  },
8
- setup(t) {
9
- return (e, o) => (a(), s("div", {
10
- class: m(["c1-container", { "c1-primary": t.primary }])
8
+ setup(l) {
9
+ return (h, a) => (r(), o("div", {
10
+ class: y(["c1-container", { "c1-primary": l.primary }])
11
11
  }, [
12
- d(e.$slots, "default", {}, () => [
13
- _(l(t.title), 1)
12
+ S(h.$slots, "default", {}, () => [
13
+ I(g(l.title), 1)
14
14
  ], !0)
15
15
  ], 2));
16
16
  }
17
- }), u = (t, e) => {
18
- const o = t.__vccOpts || t;
19
- for (const [c, n] of e)
20
- o[c] = n;
21
- return o;
22
- }, b = /* @__PURE__ */ u(f, [["__scopeId", "data-v-e2028f64"]]), C = { class: "c2-container" }, h = { class: "c2-title" }, k = { class: "c2-content" }, v = /* @__PURE__ */ i({
17
+ }), T = (l, h) => {
18
+ const a = l.__vccOpts || l;
19
+ for (const [f, u] of h)
20
+ a[f] = u;
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({
23
23
  __name: "C2",
24
24
  props: {
25
25
  title: { default: "C2 Component" },
@@ -27,25 +27,222 @@ const f = /* @__PURE__ */ i({
27
27
  buttonText: { default: "Click Me" }
28
28
  },
29
29
  emits: ["click"],
30
- setup(t, { emit: e }) {
31
- const o = e, c = (n) => {
32
- o("click", n);
30
+ setup(l, { emit: h }) {
31
+ const a = h, f = (u) => {
32
+ a("click", u);
33
33
  };
34
- return (n, y) => (a(), s("div", C, [
35
- r("h2", h, l(t.title), 1),
36
- r("div", k, [
37
- d(n.$slots, "default", {}, void 0, !0)
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)
38
38
  ]),
39
- t.showButton ? (a(), s("button", {
39
+ l.showButton ? (r(), o("button", {
40
40
  key: 0,
41
41
  class: "c2-button",
42
- onClick: c
43
- }, l(t.buttonText), 1)) : p("", !0)
42
+ onClick: f
43
+ }, g(l.buttonText), 1)) : V("", !0)
44
44
  ]));
45
45
  }
46
- }), x = /* @__PURE__ */ u(v, [["__scopeId", "data-v-b1d573ae"]]);
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 = {
47
+ key: 1,
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({
53
+ __name: "hbis-dateStrip",
54
+ props: {
55
+ modelValue: { default: () => /* @__PURE__ */ new Date() },
56
+ startDate: { default: () => /* @__PURE__ */ new Date() },
57
+ endDate: { default: () => {
58
+ const l = /* @__PURE__ */ new Date();
59
+ return l.setDate(l.getDate() + 30), l;
60
+ } },
61
+ highlightType: { default: "bg" },
62
+ showToday: { type: Boolean, default: !0 },
63
+ disablePast: { type: Boolean, default: !1 },
64
+ disableFuture: { type: Boolean, default: !1 },
65
+ selectedColor: { default: "#ffffff" },
66
+ normalColor: { default: "#666666" },
67
+ selectedBgColor: { default: "#1890ff" },
68
+ normalBgColor: { default: "transparent" },
69
+ scrollable: { type: Boolean, default: !1 },
70
+ visibleDays: { default: 7 }
71
+ },
72
+ emits: ["update:modelValue", "dateClick"],
73
+ setup(l, { emit: h }) {
74
+ const a = l, f = h, u = k(() => {
75
+ if (console.log("props:", {
76
+ startDate: a.startDate,
77
+ endDate: a.endDate,
78
+ scrollable: a.scrollable
79
+ }), a.scrollable)
80
+ return console.log("显式设置了scrollable为true,允许滚动"), !0;
81
+ try {
82
+ const e = new Date(a.startDate);
83
+ e.setHours(0, 0, 0, 0);
84
+ const s = new Date(a.endDate);
85
+ if (s.setHours(0, 0, 0, 0), isNaN(e.getTime()) || isNaN(s.getTime()))
86
+ return console.log("无效的日期对象,使用默认滚动行为"), !1;
87
+ const t = s.getTime() - e.getTime(), n = Math.ceil(t / (1e3 * 60 * 60 * 24)), d = n + 1;
88
+ return console.log("日期范围天数计算:", {
89
+ start: e.toLocaleDateString(),
90
+ end: s.toLocaleDateString(),
91
+ diffTime: t,
92
+ diffDays: n,
93
+ totalDays: d,
94
+ shouldScroll: d > 7
95
+ }), d > 7;
96
+ } catch (e) {
97
+ return console.error("计算日期范围时出错:", e), !1;
98
+ }
99
+ }), b = [
100
+ { value: 0, label: "日", isWeekend: !0 },
101
+ { value: 1, label: "一", isWeekend: !1 },
102
+ { value: 2, label: "二", isWeekend: !1 },
103
+ { value: 3, label: "三", isWeekend: !1 },
104
+ { value: 4, label: "四", isWeekend: !1 },
105
+ { value: 5, label: "五", isWeekend: !1 },
106
+ { value: 6, label: "六", isWeekend: !0 }
107
+ ], M = k(() => {
108
+ const e = m.value[0];
109
+ if (!e)
110
+ return b;
111
+ const s = e.weekday, t = [];
112
+ for (let n = 0; n < 7; n++) {
113
+ const d = (s + n) % 7;
114
+ t.push(b[d]);
115
+ }
116
+ return t;
117
+ });
118
+ 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;
121
+ })()), L(() => {
122
+ console.log("props:", a), console.log("highlightType:", a.highlightType);
123
+ }), W(
124
+ () => a.highlightType,
125
+ (e) => {
126
+ console.log("highlightType changed:", e);
127
+ }
128
+ ), W(
129
+ () => a.modelValue,
130
+ (e) => {
131
+ console.log("modelValue changed:", e);
132
+ }
133
+ );
134
+ const x = k(() => {
135
+ const e = [];
136
+ try {
137
+ const s = a.startDate, t = a.endDate;
138
+ if (isNaN(s.getTime()) || isNaN(t.getTime()))
139
+ 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()
151
+ });
152
+ }
153
+ } catch (s) {
154
+ console.error("生成日期数组时出错:", s);
155
+ }
156
+ 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) => {
158
+ const s = e.dateString;
159
+ 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
+ }, N = (e) => {
161
+ const s = p(/* @__PURE__ */ new Date());
162
+ return e.dateString === s;
163
+ }, C = (e) => {
164
+ const s = e.date;
165
+ 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) => {
167
+ var s;
168
+ return ((s = b.find((t) => t.value === e)) == null ? void 0 : s.label) || "";
169
+ }, B = (e) => {
170
+ C(e) && (f("dateClick", e), f("update:modelValue", e.date));
171
+ };
172
+ return (e, s) => (r(), o("div", {
173
+ class: y(["hbis-date-strip", {
174
+ "hbis-date-strip--highlight-bg": l.highlightType === "bg",
175
+ "hbis-date-strip--highlight-dot": l.highlightType === "dot",
176
+ "hbis-date-strip--highlight-round": l.highlightType === "round",
177
+ "hbis-date-strip--scrollable": u.value
178
+ }])
179
+ }, [
180
+ u.value ? (r(), o("div", J, [
181
+ c("div", K, [
182
+ c("div", Q, [
183
+ (r(!0), o(D, null, v(m.value, (t) => (r(), o("div", {
184
+ key: t.dateString + "-weekday",
185
+ class: y(["hbis-date-strip__weekday", {
186
+ "hbis-date-strip__weekday--weekend": t.isWeekend
187
+ }])
188
+ }, g(F(t.weekday)), 3))), 128))
189
+ ]),
190
+ c("div", U, [
191
+ (r(!0), o(D, null, v(m.value, (t) => (r(), o("div", {
192
+ key: t.dateString,
193
+ class: y(["hbis-date-strip__date", {
194
+ "hbis-date-strip__date--selected": _(t),
195
+ "hbis-date-strip__date--today": N(t),
196
+ "hbis-date-strip__date--disabled": !C(t),
197
+ "hbis-date-strip__date--weekend": t.isWeekend
198
+ }]),
199
+ style: $({
200
+ color: _(t) ? l.selectedColor : l.normalColor,
201
+ backgroundColor: _(t) ? l.selectedBgColor : l.normalBgColor
202
+ }),
203
+ onClick: (n) => B(t)
204
+ }, [
205
+ c("div", Z, g(t.day), 1)
206
+ ], 14, X))), 128))
207
+ ])
208
+ ])
209
+ ])) : (r(), o("div", Y, [
210
+ c("div", j, [
211
+ (r(!0), o(D, null, v(M.value, (t) => (r(), o("div", {
212
+ key: t.value,
213
+ class: y(["hbis-date-strip__weekday", {
214
+ "hbis-date-strip__weekday--weekend": t.isWeekend
215
+ }])
216
+ }, g(t.label), 3))), 128))
217
+ ]),
218
+ c("div", R, [
219
+ (r(!0), o(D, null, v(m.value, (t) => (r(), o("div", {
220
+ key: t.dateString,
221
+ class: y(["hbis-date-strip__date", {
222
+ "hbis-date-strip__date--selected": _(t),
223
+ "hbis-date-strip__date--today": N(t),
224
+ "hbis-date-strip__date--disabled": !C(t),
225
+ "hbis-date-strip__date--weekend": t.isWeekend
226
+ }]),
227
+ style: $({
228
+ color: _(t) ? l.selectedColor : l.normalColor,
229
+ backgroundColor: _(t) ? l.selectedBgColor : l.normalBgColor
230
+ }),
231
+ onClick: (n) => B(t)
232
+ }, [
233
+ c("div", G, g(t.day), 1)
234
+ ], 14, q))), 128))
235
+ ])
236
+ ])),
237
+ e.$slots.default ? (r(), o("div", ee, [
238
+ S(e.$slots, "default", {}, void 0, !0)
239
+ ])) : V("", !0)
240
+ ], 2));
241
+ }
242
+ }), re = /* @__PURE__ */ T(te, [["__scopeId", "data-v-7591067b"]]);
47
243
  export {
48
- b as C1,
49
- x as C2
244
+ le as C1,
245
+ oe as C2,
246
+ re as hbisDateStrip
50
247
  };
51
248
  //# sourceMappingURL=index.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es.js","sources":["../c1/src/C1.vue","../c2/src/C2.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"],"names":["_createElementBlock","_normalizeClass","__props","_renderSlot","_ctx","emit","__emit","handleClick","event","_openBlock","_hoisted_1","_createElementVNode","_hoisted_2","_toDisplayString","_hoisted_3"],"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,CAAA,GAAA,QAAA,EAAA;AAAA,MAAA;MAEDF,EAAA,mBAAdF,EAES,UAAA;AAAA;QAFiB,OAAM;AAAA,QAAa,SAAOO;AAAA,MAAA,KAC/CL,EAAA,UAAU,GAAA,CAAA;;;;"}
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,KAA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AAA,OAAe,CAA1B2B,YADTpD,EASM,OAAA;AAAA,YAPH,KAAKoD,EAAQ;AAAA,YACd,UAAM,4BAA0B;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;;;;"}
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .c1-container[data-v-e2028f64]{padding:16px;border:1px solid #e0e0e0;border-radius:4px;background-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}
1
+ .c1-container[data-v-e2028f64]{padding:16px;border:1px solid #e0e0e0;border-radius:4px;background-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}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hbis-uni/components",
3
- "version": "1.0.1",
3
+ "version": "1.0.9",
4
4
  "description": "HBIS UNI components library",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",
@@ -20,6 +20,15 @@
20
20
  "import": "dist/index.es.js",
21
21
  "require": "dist/index.cjs.js",
22
22
  "types": "dist/types/index.d.ts"
23
+ },
24
+ "./hbis-dateStrip": {
25
+ "import": "dist/index.es.js",
26
+ "require": "dist/index.cjs.js",
27
+ "types": "dist/types/index.d.ts"
28
+ },
29
+ "./dist/style.css": {
30
+ "import": "dist/style.css",
31
+ "require": "dist/style.css"
23
32
  }
24
33
  },
25
34
  "peerDependencies": {