@ysgroup/ui 0.1.59 → 0.1.60

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ysgroup/ui",
3
- "version": "0.1.59",
3
+ "version": "0.1.60",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -2,12 +2,13 @@
2
2
  /**
3
3
  * 选中日详情卡:放在 YsCalendar 旁边,介绍选中那天的情况。
4
4
  *
5
- * - 头部:日期方块(颜色跟月历一致:工作日、法定补班浅绿,放假浅橙,休息灰)、完整日期、离今天几天、农历和干支生肖、
5
+ * - 头部:日期方块(颜色跟月历一致:工作日、法定补班浅绿,放假浅橙,休息灰)、完整日期、离今天几天;传 lunar 时再写农历、
6
6
  * 传统节日和节气。
7
7
  * - 状态:工作日 / 法定补班 / 休息 / 放假、交易日 / 休市,以及节前最后、节后首日、月初、月末这些关键交易日(全称)。
8
8
  * - 本月位置:几月第 N 个工作日、第 N 个交易日(带进度条),放假时写「国庆节假期第 3 天,共 8 天」。
9
9
  * - 当天的事项(events),以及默认插槽放页面自己的内容(如上一个、下一个交易日和 T+N 推算)。
10
- * - 数据都由 @ysgroup/core 的 ysDayDetail 从服务端下发的 days 推出,组件只显示;农历用 ysLunar 现算,只用于显示。
10
+ * - 农历、传统节日和节气默认不显示(lunar 打开);农历用 ysLunar 现算,只用于显示。
11
+ * - 数据都由 @ysgroup/core 的 ysDayDetail 从服务端下发的 days 推出,组件只显示。
11
12
  */
12
13
  import { computed } from "vue";
13
14
  import {
@@ -47,6 +48,8 @@ const props = withDefaults(
47
48
  labels?: Partial<YsCalendarLabels>;
48
49
  /** 显示交易日相关内容(交易日 / 休市、第几个交易日、关键交易日);不涉及交易的系统可以关掉。 */
49
50
  trading?: boolean;
51
+ /** 显示农历、干支生肖、传统节日和节气;默认不显示。 */
52
+ lunar?: boolean;
50
53
  }>(),
51
54
  {
52
55
  days: () => [],
@@ -54,6 +57,7 @@ const props = withDefaults(
54
57
  today: "",
55
58
  labels: () => ({}),
56
59
  trading: true,
60
+ lunar: false,
57
61
  },
58
62
  );
59
63
 
@@ -89,14 +93,14 @@ const relative = computed(() => {
89
93
  });
90
94
 
91
95
  const lunarText = computed(() => {
92
- const lunar = detail.value.lunar;
96
+ const lunar = props.lunar ? detail.value.lunar : null;
93
97
  if (!lunar) return "";
94
98
  return `农历${lunar.monthName}${lunar.dayName} · ${lunar.yearName}${lunar.zodiac}年`;
95
99
  });
96
100
  /** 传统节日、节气小标签(法定假日名已经在状态标签里,不重复)。 */
97
101
  const festivals = computed(() => {
98
102
  const list: { text: string; kind: "lunar" | "term" }[] = [];
99
- const lunar = detail.value.lunar;
103
+ const lunar = props.lunar ? detail.value.lunar : null;
100
104
  const legal = covered.value ? (info.value?.name ?? "") : "";
101
105
  if (lunar?.festival && lunar.festival !== legal)
102
106
  list.push({ text: lunar.festival, kind: "lunar" });