eco-vue-js 0.16.0 → 0.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. package/dist/components/Chip/WChip.vue.d.ts.map +1 -1
  2. package/dist/components/Chip/WChip.vue_vue_type_script_setup_true_lang.js +3 -10
  3. package/dist/components/DatePicker/WDatePicker.vue.d.ts.map +1 -1
  4. package/dist/components/DatePicker/WDatePicker.vue_vue_type_script_setup_true_lang.js +47 -33
  5. package/dist/components/DatePicker/WDatePickerSingle.vue.d.ts.map +1 -1
  6. package/dist/components/DatePicker/WDatePickerSingle.vue_vue_type_script_setup_true_lang.js +32 -26
  7. package/dist/components/DatePicker/components/CalendarDay.vue_vue_type_script_setup_true_lang.js +2 -2
  8. package/dist/components/DatePicker/components/CalendarMonth.vue_vue_type_script_setup_true_lang.js +2 -2
  9. package/dist/components/DatePicker/components/CalendarToggle.vue.d.ts +2 -0
  10. package/dist/components/DatePicker/components/CalendarToggle.vue.d.ts.map +1 -1
  11. package/dist/components/DatePicker/components/CalendarToggle.vue_vue_type_script_setup_true_lang.js +12 -8
  12. package/dist/components/DatePicker/components/CalendarWeek.vue_vue_type_script_setup_true_lang.js +2 -2
  13. package/dist/components/DatePicker/use/useCalendarNavigation.d.ts +17 -0
  14. package/dist/components/DatePicker/use/useCalendarNavigation.d.ts.map +1 -0
  15. package/dist/components/DatePicker/use/useCalendarNavigation.js +50 -0
  16. package/dist/components/Input/WInputDate.vue.d.ts.map +1 -1
  17. package/dist/components/Input/WInputDate.vue_vue_type_script_setup_true_lang.js +5 -2
  18. package/dist/components/Link/WLink.vue_vue_type_script_setup_true_lang.js +6 -3
  19. package/dist/components/List/WList.vue.d.ts.map +1 -1
  20. package/dist/components/List/WList.vue_vue_type_script_setup_true_lang.js +19 -7
  21. package/dist/utils/SemanticType.js +1 -1
  22. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"WChip.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Chip/WChip.vue"],"names":[],"mappings":"AAgBA;AAkDA,OAAO,EAAC,YAAY,EAAC,MAAM,sBAAsB,CAAA;AAGjD,KAAK,WAAW,GAAG;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAC;AA4EJ,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAM/C,QAAA,MAAM,UAAU;cArFD,OAAO;UAFX,MAAM;kBACE,YAAY;6EAyF7B,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"WChip.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Chip/WChip.vue"],"names":[],"mappings":"AAgBA;AA2CA,OAAO,EAAC,YAAY,EAAyB,MAAM,sBAAsB,CAAA;AAGzE,KAAK,WAAW,GAAG;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAC;AAoEJ,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAM/C,QAAA,MAAM,UAAU;cA7ED,OAAO;UAFX,MAAM;kBACE,YAAY;6EAiF7B,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import WSkeleton_default from "../Skeleton/WSkeleton.vue.js";
2
- import { SemanticType } from "../../utils/SemanticType.js";
2
+ import { SemanticType, useSemanticTypeChipMap } from "../../utils/SemanticType.js";
3
3
  import { useComponentStatesSkeleton } from "../../utils/useComponentStates.js";
4
4
  import { createBlock, createElementBlock, createTextVNode, defineComponent, normalizeClass, openBlock, renderSlot, toDisplayString, unref } from "vue";
5
5
  //#region src/components/Chip/WChip.vue?vue&type=script&setup=true&lang.ts
@@ -15,21 +15,14 @@ var WChip_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
15
15
  },
16
16
  setup(__props) {
17
17
  const { isSkeleton } = useComponentStatesSkeleton(__props);
18
- const classMap = {
19
- [SemanticType.PRIMARY]: "text-primary dark:text-primary-dark",
20
- [SemanticType.SECONDARY]: "text-description",
21
- [SemanticType.POSITIVE]: "text-positive dark:text-positive-dark",
22
- [SemanticType.NEGATIVE]: "text-negative dark:text-negative-dark",
23
- [SemanticType.WARNING]: "text-warning dark:text-warning-dark",
24
- [SemanticType.INFO]: "text-info dark:text-info-dark"
25
- };
18
+ const semanticTypeChipMap = useSemanticTypeChipMap();
26
19
  return (_ctx, _cache) => {
27
20
  return unref(isSkeleton) ? (openBlock(), createBlock(WSkeleton_default, {
28
21
  key: 0,
29
22
  class: "w-skeleton-h-5 max-w-28"
30
23
  })) : (openBlock(), createElementBlock("div", {
31
24
  key: 1,
32
- class: normalizeClass(["w-max rounded-md bg-gray-100 px-2 py-0.5 text-xs font-semibold dark:bg-gray-800", classMap[__props.semanticType]])
25
+ class: normalizeClass(["w-max rounded-md px-2 py-0.5 text-xs font-semibold text-default", unref(semanticTypeChipMap)[__props.semanticType]])
33
26
  }, [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(__props.text), 1)])], 2));
34
27
  };
35
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"WDatePicker.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/DatePicker/WDatePicker.vue"],"names":[],"mappings":"AA8DA;AA2KA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAA;AAW7C,KAAK,WAAW,GAAG;IACf,UAAU,EAAE,SAAS,GAAG,SAAS,CAAA;IACjC,OAAO,CAAC,EAAE,IAAI,CAAA;IACd,OAAO,CAAC,EAAE,IAAI,CAAA;IACd,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAC;AA6UJ,QAAA,MAAM,YAAY;;;;;cA9UH,OAAO;cAFP,OAAO;cACP,OAAO;aAHR,IAAI;aACJ,IAAI;6EAqVhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"WDatePicker.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/DatePicker/WDatePicker.vue"],"names":[],"mappings":"AAkEA;AA8KA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAA;AAY7C,KAAK,WAAW,GAAG;IACf,UAAU,EAAE,SAAS,GAAG,SAAS,CAAA;IACjC,OAAO,CAAC,EAAE,IAAI,CAAA;IACd,OAAO,CAAC,EAAE,IAAI,CAAA;IACd,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAC;AAuUJ,QAAA,MAAM,YAAY;;;;;cAxUH,OAAO;cAFP,OAAO;cACP,OAAO;aAHR,IAAI;aACJ,IAAI;6EA+UhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1,9 +1,10 @@
1
1
  import { useComponentStates } from "../../utils/useComponentStates.js";
2
- import { addDay, addMonth, addYear, getStartOfDay, getStartOfMonth, getStartOfWeek, isSameMonth, monthShortFormatter } from "../../utils/dateTime.js";
2
+ import { getStartOfDay, isSameMonth, monthShortFormatter } from "../../utils/dateTime.js";
3
3
  import CalendarMonth_default from "./components/CalendarMonth.vue.js";
4
4
  import CalendarToggle_default from "./components/CalendarToggle.vue.js";
5
5
  import CalendarValue_default from "./components/CalendarValue.vue.js";
6
- import { Transition, computed, createBlock, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeStyle, openBlock, ref, toRef, unref, watch, withCtx } from "vue";
6
+ import { useCalendarNavigation } from "./use/useCalendarNavigation.js";
7
+ import { Transition, createBlock, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeStyle, openBlock, ref, toRef, unref, watch, withCtx } from "vue";
7
8
  //#region src/components/DatePicker/WDatePicker.vue?vue&type=script&setup=true&lang.ts
8
9
  var _hoisted_1 = { class: "mb-4 grid grid-cols-2 gap-5" };
9
10
  var _hoisted_2 = { class: "grid grid-cols-2 gap-5 px-3 pb-4" };
@@ -32,16 +33,10 @@ var WDatePicker_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
32
33
  const props = __props;
33
34
  const { isReadonly, isDisabled, isSkeleton } = useComponentStates(props);
34
35
  const emit = __emit;
35
- const currentDate = ref(getStartOfMonth());
36
+ const { currentDate, isDirect, year, isPreviousDisabled, isNextDisabled, setCurrentDate, toPreviousMonth, toNextMonth, toPreviousYear, toNextYear, isSameCalendarPage } = useCalendarNavigation(props);
36
37
  const dateRange = ref(props.modelValue);
37
38
  const preselectedValue = ref(null);
38
- const isDirect = ref(false);
39
39
  const today = ref(getStartOfDay());
40
- const year = computed(() => currentDate.value.getFullYear());
41
- const setCurrentDate = (value) => {
42
- isDirect.value = value > currentDate.value;
43
- currentDate.value = value;
44
- };
45
40
  const onClickDay = (value) => {
46
41
  if (!preselectedValue.value) {
47
42
  preselectedValue.value = value;
@@ -70,53 +65,72 @@ var WDatePicker_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
70
65
  to: new Date(preselectedValue.value)
71
66
  };
72
67
  };
73
- const firstDay = computed(() => getStartOfWeek(currentDate.value));
74
- const lastDay = computed(() => addDay(firstDay.value, 41));
75
- const isSameCalendarPage = (value) => {
76
- return value >= firstDay.value && value <= lastDay.value;
77
- };
78
68
  watch(toRef(props, "modelValue"), (modelValue) => {
79
69
  dateRange.value = modelValue;
80
70
  if (!modelValue) return;
81
- if (!isSameCalendarPage(modelValue.from) && !isSameCalendarPage(modelValue.to)) setCurrentDate(getStartOfMonth(modelValue.from));
71
+ if (!isSameCalendarPage(modelValue.from) && !isSameCalendarPage(modelValue.to)) setCurrentDate(modelValue.from);
82
72
  });
83
73
  return (_ctx, _cache) => {
84
74
  return openBlock(), createElementBlock("div", null, [createElementVNode("div", _hoisted_1, [createVNode(CalendarValue_default, {
85
75
  title: "From:",
86
76
  value: dateRange.value?.from,
87
- "current-date": currentDate.value,
77
+ "current-date": unref(currentDate),
88
78
  "auto-focus": "",
89
- "onUpdate:currentDate": setCurrentDate
90
- }, null, 8, ["value", "current-date"]), createVNode(CalendarValue_default, {
79
+ "onUpdate:currentDate": unref(setCurrentDate)
80
+ }, null, 8, [
81
+ "value",
82
+ "current-date",
83
+ "onUpdate:currentDate"
84
+ ]), createVNode(CalendarValue_default, {
91
85
  title: "To:",
92
86
  value: dateRange.value?.to,
93
- "current-date": currentDate.value,
94
- "onUpdate:currentDate": setCurrentDate
95
- }, null, 8, ["value", "current-date"])]), createElementVNode("div", {
87
+ "current-date": unref(currentDate),
88
+ "onUpdate:currentDate": unref(setCurrentDate)
89
+ }, null, 8, [
90
+ "value",
91
+ "current-date",
92
+ "onUpdate:currentDate"
93
+ ])]), createElementVNode("div", {
96
94
  class: "bg-default dark:bg-default-dark overflow-hidden rounded-xl border border-solid border-gray-300 py-3 dark:border-gray-700",
97
- style: normalizeStyle({ "--direction-factor": isDirect.value ? "1" : "-1" })
95
+ style: normalizeStyle({ "--direction-factor": unref(isDirect) ? "1" : "-1" })
98
96
  }, [createElementVNode("div", _hoisted_2, [createVNode(CalendarToggle_default, {
99
- text: unref(monthShortFormatter).format(currentDate.value).toLocaleUpperCase(),
100
- "onClick:previous": _cache[0] || (_cache[0] = ($event) => setCurrentDate(unref(addMonth)(currentDate.value, -1))),
101
- "onClick:next": _cache[1] || (_cache[1] = ($event) => setCurrentDate(unref(addMonth)(currentDate.value, 1)))
102
- }, null, 8, ["text"]), createVNode(CalendarToggle_default, {
103
- text: year.value.toString(),
104
- "onClick:previous": _cache[2] || (_cache[2] = ($event) => setCurrentDate(unref(addYear)(currentDate.value, -1))),
105
- "onClick:next": _cache[3] || (_cache[3] = ($event) => setCurrentDate(unref(addYear)(currentDate.value, 1)))
106
- }, null, 8, ["text"])]), createElementVNode("div", _hoisted_3, [createVNode(Transition, {
97
+ text: unref(monthShortFormatter).format(unref(currentDate)).toLocaleUpperCase(),
98
+ "disabled-previous": unref(isPreviousDisabled),
99
+ "disabled-next": unref(isNextDisabled),
100
+ "onClick:previous": unref(toPreviousMonth),
101
+ "onClick:next": unref(toNextMonth)
102
+ }, null, 8, [
103
+ "text",
104
+ "disabled-previous",
105
+ "disabled-next",
106
+ "onClick:previous",
107
+ "onClick:next"
108
+ ]), createVNode(CalendarToggle_default, {
109
+ text: unref(year).toString(),
110
+ "disabled-previous": unref(isPreviousDisabled),
111
+ "disabled-next": unref(isNextDisabled),
112
+ "onClick:previous": unref(toPreviousYear),
113
+ "onClick:next": unref(toNextYear)
114
+ }, null, 8, [
115
+ "text",
116
+ "disabled-previous",
117
+ "disabled-next",
118
+ "onClick:previous",
119
+ "onClick:next"
120
+ ])]), createElementVNode("div", _hoisted_3, [createVNode(Transition, {
107
121
  "enter-active-class": "transition-transform duration-250 w-full",
108
122
  "leave-active-class": "transition-transform duration-250 w-full absolute top-0",
109
123
  "enter-from-class": "translate-x-[calc(100%*var(--direction-factor))]",
110
124
  "leave-to-class": "translate-x-[calc(100%*var(--direction-factor)*-1)]"
111
125
  }, {
112
126
  default: withCtx(() => [(openBlock(), createBlock(CalendarMonth_default, {
113
- key: currentDate.value.toISOString(),
114
- "start-of-month": currentDate.value,
127
+ key: unref(currentDate).toISOString(),
128
+ "start-of-month": unref(currentDate),
115
129
  "date-range": dateRange.value,
116
130
  "is-hover-enabled": preselectedValue.value !== null,
117
131
  "min-date": __props.minDate,
118
132
  "max-date": __props.maxDate,
119
- today: today.value && unref(isSameMonth)(today.value, currentDate.value) ? today.value : void 0,
133
+ today: today.value && unref(isSameMonth)(today.value, unref(currentDate)) ? today.value : void 0,
120
134
  readonly: unref(isReadonly) || unref(isDisabled) || unref(isSkeleton),
121
135
  class: "px-3",
122
136
  "onClick:day": onClickDay,
@@ -1 +1 @@
1
- {"version":3,"file":"WDatePickerSingle.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/DatePicker/WDatePickerSingle.vue"],"names":[],"mappings":"AA0CA;AA8HA,KAAK,WAAW,GAAG;IACf,UAAU,EAAE,IAAI,GAAG,SAAS,CAAA;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,IAAI,CAAA;IACd,OAAO,CAAC,EAAE,IAAI,CAAA;IACd,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAC;AA8OJ,QAAA,MAAM,YAAY;;;;;cA/OH,OAAO;cAFP,OAAO;WAHV,MAAM;cAIH,OAAO;aAHR,IAAI;aACJ,IAAI;6EAsPhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"WDatePickerSingle.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/DatePicker/WDatePickerSingle.vue"],"names":[],"mappings":"AA8CA;AAkIA,KAAK,WAAW,GAAG;IACf,UAAU,EAAE,IAAI,GAAG,SAAS,CAAA;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,IAAI,CAAA;IACd,OAAO,CAAC,EAAE,IAAI,CAAA;IACd,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAC;AAuOJ,QAAA,MAAM,YAAY;;;;;cAxOH,OAAO;cAFP,OAAO;WAHV,MAAM;cAIH,OAAO;aAHR,IAAI;aACJ,IAAI;6EA+OhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1,8 +1,9 @@
1
1
  import { useComponentStates } from "../../utils/useComponentStates.js";
2
- import { addDay, addMonth, addYear, getStartOfDay, getStartOfMonth, getStartOfWeek, monthShortFormatter } from "../../utils/dateTime.js";
2
+ import { getStartOfDay, monthShortFormatter } from "../../utils/dateTime.js";
3
3
  import CalendarMonth_default from "./components/CalendarMonth.vue.js";
4
4
  import CalendarToggle_default from "./components/CalendarToggle.vue.js";
5
- import { Transition, computed, createBlock, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeStyle, openBlock, ref, toRef, unref, watch, withCtx } from "vue";
5
+ import { useCalendarNavigation } from "./use/useCalendarNavigation.js";
6
+ import { Transition, createBlock, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeStyle, openBlock, ref, toRef, unref, watch, withCtx } from "vue";
6
7
  //#region src/components/DatePicker/WDatePickerSingle.vue?vue&type=script&setup=true&lang.ts
7
8
  var _hoisted_1 = { class: "grid grid-cols-2 gap-8 px-3 pb-4" };
8
9
  var _hoisted_2 = { class: "relative" };
@@ -31,53 +32,58 @@ var WDatePickerSingle_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
31
32
  const props = __props;
32
33
  const { isReadonly, isDisabled, isSkeleton } = useComponentStates(props);
33
34
  const emit = __emit;
34
- const currentDate = ref(getStartOfMonth());
35
+ const { currentDate, isDirect, year, isPreviousDisabled, isNextDisabled, setCurrentDate, toPreviousMonth, toNextMonth, toPreviousYear, toNextYear, isSameCalendarPage } = useCalendarNavigation(props);
35
36
  const dateRange = ref(void 0);
36
37
  const preselectedValue = ref(null);
37
- const isDirect = ref(false);
38
38
  const today = ref(getStartOfDay());
39
- const year = computed(() => currentDate.value.getFullYear());
40
- const setCurrentDate = (value) => {
41
- isDirect.value = value > currentDate.value;
42
- currentDate.value = value;
43
- };
44
39
  const onClickDay = (value) => {
45
40
  emit("update:model-value", value);
46
41
  };
47
- const firstDay = computed(() => getStartOfWeek(currentDate.value));
48
- const lastDay = computed(() => addDay(firstDay.value, 41));
49
- const isSameCalendarPage = (value) => {
50
- return value >= firstDay.value && value <= lastDay.value;
51
- };
52
42
  watch(toRef(props, "modelValue"), (modelValue) => {
53
43
  dateRange.value = modelValue ? {
54
44
  from: modelValue,
55
45
  to: modelValue
56
46
  } : void 0;
57
47
  if (!modelValue) return;
58
- if (!isSameCalendarPage(modelValue)) setCurrentDate(getStartOfMonth(modelValue));
48
+ if (!isSameCalendarPage(modelValue)) setCurrentDate(modelValue);
59
49
  }, { immediate: true });
60
50
  return (_ctx, _cache) => {
61
51
  return openBlock(), createElementBlock("div", {
62
52
  class: "bg-default dark:bg-default-dark overflow-hidden rounded-xl border border-solid border-gray-300 py-3 dark:border-gray-700",
63
- style: normalizeStyle({ "--direction-factor": isDirect.value ? "1" : "-1" })
53
+ style: normalizeStyle({ "--direction-factor": unref(isDirect) ? "1" : "-1" })
64
54
  }, [createElementVNode("div", _hoisted_1, [createVNode(CalendarToggle_default, {
65
- text: unref(monthShortFormatter).format(currentDate.value).toLocaleUpperCase(),
66
- "onClick:previous": _cache[0] || (_cache[0] = ($event) => setCurrentDate(unref(addMonth)(currentDate.value, -1))),
67
- "onClick:next": _cache[1] || (_cache[1] = ($event) => setCurrentDate(unref(addMonth)(currentDate.value, 1)))
68
- }, null, 8, ["text"]), createVNode(CalendarToggle_default, {
69
- text: year.value.toString(),
70
- "onClick:previous": _cache[2] || (_cache[2] = ($event) => setCurrentDate(unref(addYear)(currentDate.value, -1))),
71
- "onClick:next": _cache[3] || (_cache[3] = ($event) => setCurrentDate(unref(addYear)(currentDate.value, 1)))
72
- }, null, 8, ["text"])]), createElementVNode("div", _hoisted_2, [createVNode(Transition, {
55
+ text: unref(monthShortFormatter).format(unref(currentDate)).toLocaleUpperCase(),
56
+ "disabled-previous": unref(isPreviousDisabled),
57
+ "disabled-next": unref(isNextDisabled),
58
+ "onClick:previous": unref(toPreviousMonth),
59
+ "onClick:next": unref(toNextMonth)
60
+ }, null, 8, [
61
+ "text",
62
+ "disabled-previous",
63
+ "disabled-next",
64
+ "onClick:previous",
65
+ "onClick:next"
66
+ ]), createVNode(CalendarToggle_default, {
67
+ text: unref(year).toString(),
68
+ "disabled-previous": unref(isPreviousDisabled),
69
+ "disabled-next": unref(isNextDisabled),
70
+ "onClick:previous": unref(toPreviousYear),
71
+ "onClick:next": unref(toNextYear)
72
+ }, null, 8, [
73
+ "text",
74
+ "disabled-previous",
75
+ "disabled-next",
76
+ "onClick:previous",
77
+ "onClick:next"
78
+ ])]), createElementVNode("div", _hoisted_2, [createVNode(Transition, {
73
79
  "enter-active-class": "transition-transform duration-250 w-full",
74
80
  "leave-active-class": "transition-transform duration-250 w-full absolute top-0",
75
81
  "enter-from-class": "translate-x-[calc(100%*var(--direction-factor))]",
76
82
  "leave-to-class": "translate-x-[calc(100%*var(--direction-factor)*-1)]"
77
83
  }, {
78
84
  default: withCtx(() => [(openBlock(), createBlock(CalendarMonth_default, {
79
- key: currentDate.value.toISOString(),
80
- "start-of-month": currentDate.value,
85
+ key: unref(currentDate).toISOString(),
86
+ "start-of-month": unref(currentDate),
81
87
  "date-range": dateRange.value,
82
88
  "is-hover-enabled": preselectedValue.value !== null,
83
89
  "min-date": __props.minDate,
@@ -53,8 +53,8 @@ var CalendarDay_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
53
53
  });
54
54
  const isDisabled = computed(() => {
55
55
  if (props.disabled) return true;
56
- if (props.minDate) return props.minDate > props.startOfDay;
57
- if (props.maxDate) return props.maxDate < props.startOfDay;
56
+ if (props.minDate && props.minDate > props.startOfDay) return true;
57
+ if (props.maxDate && props.maxDate < props.startOfDay) return true;
58
58
  return false;
59
59
  });
60
60
  return (_ctx, _cache) => {
@@ -70,8 +70,8 @@ var CalendarMonth_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
70
70
  });
71
71
  const isDisabled = computed(() => {
72
72
  if (props.disabled) return true;
73
- if (props.minDate) return props.minDate > endOfLastWeek.value;
74
- if (props.maxDate) return props.maxDate < startOfFirstWeek.value;
73
+ if (props.minDate && props.minDate > endOfLastWeek.value) return true;
74
+ if (props.maxDate && props.maxDate < startOfFirstWeek.value) return true;
75
75
  return false;
76
76
  });
77
77
  return (_ctx, _cache) => {
@@ -1,5 +1,7 @@
1
1
  type __VLS_Props = {
2
2
  text: string;
3
+ disabledPrevious?: boolean;
4
+ disabledNext?: boolean;
3
5
  };
4
6
  declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
5
7
  "click:next": () => any;
@@ -1 +1 @@
1
- {"version":3,"file":"CalendarToggle.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/DatePicker/components/CalendarToggle.vue"],"names":[],"mappings":"AAyCA;AA0DA,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAA;CACb,CAAC;AAiNF,QAAA,MAAM,YAAY;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"CalendarToggle.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/DatePicker/components/CalendarToggle.vue"],"names":[],"mappings":"AAuCA;AA0DA,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,CAAC;AA2IF,QAAA,MAAM,YAAY;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1,19 +1,23 @@
1
1
  import IconArrow_default from "../../../assets/icons/IconArrow.js";
2
- import { Transition, createElementBlock, createElementVNode, createVNode, defineComponent, openBlock, toDisplayString, unref, withCtx } from "vue";
2
+ import { Transition, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, toDisplayString, unref, withCtx } from "vue";
3
3
  //#region src/components/DatePicker/components/CalendarToggle.vue?vue&type=script&setup=true&lang.ts
4
4
  var _hoisted_1 = { class: "my-2 flex h-8 w-full items-center" };
5
5
  var _hoisted_2 = { class: "relative overflow-hidden" };
6
6
  var CalendarToggle_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
7
7
  __name: "CalendarToggle",
8
- props: { text: {} },
8
+ props: {
9
+ text: {},
10
+ disabledPrevious: { type: Boolean },
11
+ disabledNext: { type: Boolean }
12
+ },
9
13
  emits: ["click:next", "click:previous"],
10
14
  setup(__props) {
11
15
  return (_ctx, _cache) => {
12
16
  return openBlock(), createElementBlock("div", _hoisted_1, [
13
17
  createElementVNode("div", {
14
- class: "square-8 w-ripple hover:bg-primary hover:dark:bg-primary-dark hover:text-default dark:hover:text-default text-description relative mr-auto flex cursor-pointer select-none items-center justify-center rounded-xl",
15
- onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click:previous"))
16
- }, [createVNode(unref(IconArrow_default), { class: "-ml-1 rotate-90" })]),
18
+ class: normalizeClass(["square-8 text-description relative mr-auto flex select-none items-center justify-center rounded-xl", __props.disabledPrevious ? "cursor-not-allowed opacity-50" : "w-ripple hover:bg-primary hover:dark:bg-primary-dark hover:text-default dark:hover:text-default cursor-pointer"]),
19
+ onClick: _cache[0] || (_cache[0] = ($event) => !__props.disabledPrevious && _ctx.$emit("click:previous"))
20
+ }, [createVNode(unref(IconArrow_default), { class: "-ml-1 rotate-90" })], 2),
17
21
  createElementVNode("div", _hoisted_2, [createVNode(Transition, {
18
22
  "enter-active-class": "transition-transform duration-250 w-full",
19
23
  "leave-active-class": "transition-transform duration-250 w-full absolute top-0",
@@ -27,9 +31,9 @@ var CalendarToggle_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
27
31
  _: 1
28
32
  })]),
29
33
  createElementVNode("div", {
30
- class: "square-8 w-ripple hover:bg-primary hover:dark:bg-primary-dark hover:text-default dark:hover:text-default text-description relative ml-auto flex cursor-pointer select-none items-center justify-center rounded-xl",
31
- onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("click:next"))
32
- }, [createVNode(unref(IconArrow_default), { class: "-mr-1 -rotate-90" })])
34
+ class: normalizeClass(["square-8 text-description relative ml-auto flex select-none items-center justify-center rounded-xl", __props.disabledNext ? "cursor-not-allowed opacity-50" : "w-ripple hover:bg-primary hover:dark:bg-primary-dark hover:text-default dark:hover:text-default cursor-pointer"]),
35
+ onClick: _cache[1] || (_cache[1] = ($event) => !__props.disabledNext && _ctx.$emit("click:next"))
36
+ }, [createVNode(unref(IconArrow_default), { class: "-mr-1 -rotate-90" })], 2)
33
37
  ]);
34
38
  };
35
39
  }
@@ -57,8 +57,8 @@ var CalendarWeek_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
57
57
  });
58
58
  const isDisabled = computed(() => {
59
59
  if (props.disabled) return true;
60
- if (props.minDate) return props.minDate > endOfWeek.value;
61
- if (props.maxDate) return props.maxDate < props.startOfWeek;
60
+ if (props.minDate && props.minDate > endOfWeek.value) return true;
61
+ if (props.maxDate && props.maxDate < props.startOfWeek) return true;
62
62
  return false;
63
63
  });
64
64
  return (_ctx, _cache) => {
@@ -0,0 +1,17 @@
1
+ export declare const useCalendarNavigation: (props: {
2
+ minDate?: Date;
3
+ maxDate?: Date;
4
+ }) => {
5
+ currentDate: import('vue').Ref<Date, Date>;
6
+ isDirect: import('vue').Ref<boolean, boolean>;
7
+ year: import('vue').ComputedRef<number>;
8
+ isPreviousDisabled: import('vue').ComputedRef<boolean>;
9
+ isNextDisabled: import('vue').ComputedRef<boolean>;
10
+ setCurrentDate: (value: Date) => void;
11
+ toPreviousMonth: () => void;
12
+ toNextMonth: () => void;
13
+ toPreviousYear: () => void;
14
+ toNextYear: () => void;
15
+ isSameCalendarPage: (value: Date) => boolean;
16
+ };
17
+ //# sourceMappingURL=useCalendarNavigation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCalendarNavigation.d.ts","sourceRoot":"","sources":["../../../../../src/components/DatePicker/use/useCalendarNavigation.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,qBAAqB,GAAI,OAAO;IAAC,OAAO,CAAC,EAAE,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,IAAI,CAAA;CAAC;;;;;;4BAgB5C,IAAI,KAAG,IAAI;2BAYd,IAAI;uBACR,IAAI;0BACD,IAAI;sBACR,IAAI;gCAKQ,IAAI,KAAG,OAAO;CAqBlD,CAAA"}
@@ -0,0 +1,50 @@
1
+ import { addDay, addMonth, addYear, getStartOfMonth, getStartOfWeek } from "../../../utils/dateTime.js";
2
+ import { computed, ref, watch } from "vue";
3
+ //#region src/components/DatePicker/use/useCalendarNavigation.ts
4
+ var useCalendarNavigation = (props) => {
5
+ const minMonth = computed(() => props.minDate ? getStartOfMonth(props.minDate) : void 0);
6
+ const maxMonth = computed(() => props.maxDate ? getStartOfMonth(props.maxDate) : void 0);
7
+ const clampMonth = (value) => {
8
+ if (minMonth.value && value < minMonth.value) return new Date(minMonth.value);
9
+ if (maxMonth.value && value > maxMonth.value) return new Date(maxMonth.value);
10
+ return value;
11
+ };
12
+ const currentDate = ref(clampMonth(getStartOfMonth()));
13
+ const isDirect = ref(false);
14
+ const year = computed(() => currentDate.value.getFullYear());
15
+ const setCurrentDate = (value) => {
16
+ const startOfMonth = clampMonth(getStartOfMonth(value));
17
+ if (startOfMonth.getTime() === currentDate.value.getTime()) return;
18
+ isDirect.value = startOfMonth > currentDate.value;
19
+ currentDate.value = startOfMonth;
20
+ };
21
+ const isPreviousDisabled = computed(() => !!minMonth.value && currentDate.value <= minMonth.value);
22
+ const isNextDisabled = computed(() => !!maxMonth.value && currentDate.value >= maxMonth.value);
23
+ const toPreviousMonth = () => setCurrentDate(addMonth(currentDate.value, -1));
24
+ const toNextMonth = () => setCurrentDate(addMonth(currentDate.value, 1));
25
+ const toPreviousYear = () => setCurrentDate(addYear(currentDate.value, -1));
26
+ const toNextYear = () => setCurrentDate(addYear(currentDate.value, 1));
27
+ const firstDay = computed(() => getStartOfWeek(currentDate.value));
28
+ const lastDay = computed(() => addDay(firstDay.value, 41));
29
+ const isSameCalendarPage = (value) => {
30
+ return value >= firstDay.value && value <= lastDay.value;
31
+ };
32
+ watch([minMonth, maxMonth], () => {
33
+ setCurrentDate(currentDate.value);
34
+ });
35
+ return {
36
+ currentDate,
37
+ isDirect,
38
+ year,
39
+ isPreviousDisabled,
40
+ isNextDisabled,
41
+ setCurrentDate,
42
+ toPreviousMonth,
43
+ toNextMonth,
44
+ toPreviousYear,
45
+ toNextYear,
46
+ isSameCalendarPage
47
+ };
48
+ };
49
+ //#endregion
50
+ export { useCalendarNavigation };
@@ -1 +1 @@
1
- {"version":3,"file":"WInputDate.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/WInputDate.vue"],"names":[],"mappings":"AAoDA;AAwHA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,SAAS,CAAA;AAO3C,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAA;AAoNvD,QAAA,IAAwB,QAAQ,IAAW,EAAE,QAAQ,IAAW,EAAE,QAAQ;;CAAY,CAAE;AACxF,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,KAAK,CAAC,EAAE,CAAC,KAAK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,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -95,8 +95,11 @@ var WInputDate_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
95
95
  const inputComponentRef = useTemplateRef("inputComponent");
96
96
  const inputValue = ref(props.modelValue ? dateFormat(props.modelValue) : "");
97
97
  const updateInputValue = (value) => {
98
- if (!value) return;
99
- inputValue.value = value;
98
+ inputValue.value = value ?? "";
99
+ if (!value) {
100
+ emit("update:model-value", void 0);
101
+ return;
102
+ }
100
103
  const date = parseDate(value);
101
104
  if (!date) return;
102
105
  if (props.minDate && props.minDate > date) {
@@ -18,9 +18,12 @@ var WLink_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
18
18
  const semanticTypeTextMap = useSemanticTypeTextMap();
19
19
  return (_ctx, _cache) => {
20
20
  return openBlock(), createBlock(resolveDynamicComponent(__props.to ? WRouterLink_default : "a"), mergeProps(!__props.to ? {
21
- target: __props.target,
22
- href: __props.href
23
- } : { to: __props.to }, { class: ["cursor-pointer overflow-hidden truncate whitespace-normal font-normal no-underline hover:underline", unref(semanticTypeTextMap)[__props.semanticType]] }), {
21
+ href: __props.href,
22
+ target: __props.target
23
+ } : {
24
+ to: __props.to,
25
+ target: __props.target
26
+ }, { class: ["cursor-pointer overflow-hidden truncate whitespace-normal font-normal no-underline hover:underline", unref(semanticTypeTextMap)[__props.semanticType]] }), {
24
27
  default: withCtx(() => [(openBlock(), createBlock(resolveDynamicComponent(__props.icon ?? unref(IconLink_default)), { class: normalizeClass(["square-[1.25em] mr-[0.25em] mt-[-0.25em] inline rounded-[0.5em] p-px", unref(semanticTypeChipMap)[__props.semanticType]]) }, null, 8, ["class"])), renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(__props.text), 1)])]),
25
28
  _: 3
26
29
  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;;gBAC/B,CAAC,KAAK,IAAiB,KAAK,GAAG;;;YAlqBrC,cAAc,SAAS,QAAQ,GAAG,IAAI;YACtC,cAAc,SAAS,gBAAgB,CAAC,IAAI,CAAC,GAAG,IAAI;YACpD,qBAAqB,SAAS,WAAW,GAAG,IAAI;YAChD,cAAc,SAAS,MAAM,GAAG,SAAS,GAAG,IAAI;YAChD,kBAAkB,SAAS,SAAS,CAAC,MAAM,CAAC,GAAG,IAAI;;EA0qBrD,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAA;CAAI,CAAC;wBACpE,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,mBAAmB,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,CAAC,GAAG,EAAE,CAAC"}
@@ -5,6 +5,7 @@ import { useSelected, useSelectionHash } from "../../utils/useSelected.js";
5
5
  import WInfiniteList_default from "../InfiniteList/WInfiniteList.vue.js";
6
6
  import { encodeOrdering, parseOrdering } from "../../utils/order.js";
7
7
  import "../../utils/useDefaultQuery.js";
8
+ import "./types.js";
8
9
  import { filterFields, forEachField, getFieldStylesFixed, getFieldStylesWidth, getFieldVariable, sortFields, sortFieldsDeep, useListConfig } from "./use/useListConfig.js";
9
10
  import ListItem_default from "./components/ListItem.vue.js";
10
11
  import ListToolbar_default from "./components/ListToolbar.vue.js";
@@ -99,13 +100,6 @@ var WList_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
99
100
  const { isMobile } = useIsMobile();
100
101
  const listCount = ref(void 0);
101
102
  const countValue = computed(() => props.count ?? listCount.value);
102
- const cardStyles = computed(() => {
103
- if (!props.cardColumns || !props.cardAreas) return;
104
- return {
105
- "--w-list-grid-cols": props.cardColumns.join(" "),
106
- "--w-list-grid-areas": props.cardAreas.map((inner) => `"${inner.join(" ")}"`).join("\n")
107
- };
108
- });
109
103
  const fieldsVisible = computed(() => filterFields(props.fields, (field) => field.visibleGetter?.(props.queryParams) ?? true));
110
104
  const { listConfig, fieldConfigMap, isGrid, hasSaved, reset, save, updateMode } = useListConfig(() => props.configKey, () => props.fields, () => props.defaultConfigMap, () => props.defaultMode, props.noHeaderSettings);
111
105
  const fieldsFiltered = computed(() => filterFields(fieldsVisible.value, (field) => fieldConfigMap.value[field.label]?.visible ?? false));
@@ -139,6 +133,24 @@ var WList_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
139
133
  const allowOpen = computed(() => props.expansion !== void 0);
140
134
  const hasMenu = computed(() => props.menu !== void 0 || props.toMarkdown !== void 0);
141
135
  const disableSelect = computed(() => !allowSelect.value);
136
+ const cardStyles = computed(() => {
137
+ const cardColumns = props.cardColumns;
138
+ const cardAreas = props.cardAreas;
139
+ if (!cardColumns || !cardAreas) return;
140
+ const isAreaShown = (area) => {
141
+ if (area === "area_select") return allowSelect.value;
142
+ if (area === "area_more") return hasMenu.value;
143
+ return area in columnDataMap.value;
144
+ };
145
+ const areas = cardAreas.map((row) => row.map((area) => isAreaShown(area) ? area : "."));
146
+ const colsShown = cardColumns.map((_, index) => areas.some((row) => row[index] !== "."));
147
+ const areasShown = areas.filter((row) => row.some((area) => area !== ".")).map((row) => row.filter((_, index) => colsShown[index]));
148
+ if (!areasShown.length) return;
149
+ return {
150
+ "--w-list-grid-cols": cardColumns.filter((_, index) => colsShown[index]).join(" "),
151
+ "--w-list-grid-areas": areasShown.map((row) => `"${row.join(" ")}"`).join("\n")
152
+ };
153
+ });
142
154
  const { selection: selectionUsed, updateSelection } = props.selection ? {
143
155
  selection: toRef(props, "selection"),
144
156
  updateSelection: (value) => emit("update:selection", value)
@@ -25,7 +25,7 @@ var setSemanticTypeBackgroundMap = (value) => {
25
25
  };
26
26
  var semanticTypeChipMap = reactive({
27
27
  ...semanticTypeConfig,
28
- ["secondary"]: "bg-gray-200 dark:bg-gray-800 text-description"
28
+ ["secondary"]: "bg-gray-200 dark:bg-gray-800 text-default"
29
29
  });
30
30
  var useSemanticTypeChipMap = () => {
31
31
  return semanticTypeChipMap;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "https://github.com/rsmple/eco-vue-js.git"
6
6
  },
7
- "version": "0.16.0",
7
+ "version": "0.16.2",
8
8
  "dependencies": {
9
9
  "@stylistic/eslint-plugin": "5.10.0",
10
10
  "@tanstack/eslint-plugin-query": "5.102.8",