eco-vue-js 0.16.1 → 0.16.3

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 (24) hide show
  1. package/dist/components/Button/WButton.vue.d.ts +1 -0
  2. package/dist/components/Button/WButton.vue.d.ts.map +1 -1
  3. package/dist/components/Button/WButton.vue_vue_type_script_setup_true_lang.js +5 -2
  4. package/dist/components/Button/types.d.ts +2 -1
  5. package/dist/components/Button/types.d.ts.map +1 -1
  6. package/dist/components/DatePicker/WDatePicker.vue.d.ts.map +1 -1
  7. package/dist/components/DatePicker/WDatePicker.vue_vue_type_script_setup_true_lang.js +47 -33
  8. package/dist/components/DatePicker/WDatePickerSingle.vue.d.ts.map +1 -1
  9. package/dist/components/DatePicker/WDatePickerSingle.vue_vue_type_script_setup_true_lang.js +32 -26
  10. package/dist/components/DatePicker/components/CalendarDay.vue_vue_type_script_setup_true_lang.js +2 -2
  11. package/dist/components/DatePicker/components/CalendarMonth.vue_vue_type_script_setup_true_lang.js +2 -2
  12. package/dist/components/DatePicker/components/CalendarToggle.vue.d.ts +2 -0
  13. package/dist/components/DatePicker/components/CalendarToggle.vue.d.ts.map +1 -1
  14. package/dist/components/DatePicker/components/CalendarToggle.vue_vue_type_script_setup_true_lang.js +12 -8
  15. package/dist/components/DatePicker/components/CalendarWeek.vue_vue_type_script_setup_true_lang.js +2 -2
  16. package/dist/components/DatePicker/use/useCalendarNavigation.d.ts +17 -0
  17. package/dist/components/DatePicker/use/useCalendarNavigation.d.ts.map +1 -0
  18. package/dist/components/DatePicker/use/useCalendarNavigation.js +50 -0
  19. package/dist/components/Input/WInputDate.vue.d.ts.map +1 -1
  20. package/dist/components/Input/WInputDate.vue_vue_type_script_setup_true_lang.js +5 -2
  21. package/dist/components/Link/WLink.vue.d.ts +2 -0
  22. package/dist/components/Link/WLink.vue.d.ts.map +1 -1
  23. package/dist/components/Link/WLink.vue_vue_type_script_setup_true_lang.js +5 -2
  24. package/package.json +1 -1
@@ -21,6 +21,7 @@ declare const __VLS_base: import('vue').DefineComponent<ButtonProps, {}, {}, {},
21
21
  semanticType: SemanticType;
22
22
  disabled: boolean;
23
23
  target: "_self" | "_blank" | "_parent" | "_top";
24
+ rel: string;
24
25
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
25
26
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
26
27
  declare const _default: typeof __VLS_export;
@@ -1 +1 @@
1
- {"version":3,"file":"WButton.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Button/WButton.vue"],"names":[],"mappings":"AAgFA;AAsLA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,SAAS,CAAA;AAUxC,OAAO,EAAC,YAAY,EAAgI,MAAM,sBAAsB,CAAA;AAoXhL,QAAA,IAAI,OAAO,IAAU,EAAuB,QAAQ,IAAY,CAAE;AAClE,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC5C;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAQhD,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;6EAId,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":"WButton.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Button/WButton.vue"],"names":[],"mappings":"AAgFA;AAuLA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,SAAS,CAAA;AAUxC,OAAO,EAAC,YAAY,EAAgI,MAAM,sBAAsB,CAAA;AAsXhL,QAAA,IAAI,OAAO,IAAU,EAAuB,QAAQ,IAAY,CAAE;AAClE,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC5C;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAQhD,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;6EAId,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"}
@@ -24,6 +24,7 @@ var WButton_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCo
24
24
  replace: { type: Boolean },
25
25
  href: { default: void 0 },
26
26
  target: { default: void 0 },
27
+ rel: { default: void 0 },
27
28
  join: { type: Boolean },
28
29
  tooltipText: {},
29
30
  download: {},
@@ -93,11 +94,13 @@ var WButton_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCo
93
94
  style: _ctx.$attrs.style,
94
95
  ...unref(isDisabled) ? {} : __props.tag === "a" ? {
95
96
  href: __props.href,
96
- target: __props.target
97
+ target: __props.target,
98
+ rel: __props.rel
97
99
  } : __props.to !== void 0 ? {
98
100
  to: __props.to,
99
101
  replace: __props.replace,
100
- target: __props.target
102
+ target: __props.target,
103
+ rel: __props.rel
101
104
  } : {}
102
105
  }, {
103
106
  ref: "container",
@@ -13,6 +13,7 @@ export interface ButtonProps extends Partial<LinkProps> {
13
13
  replace?: boolean;
14
14
  href?: string;
15
15
  target?: '_self' | '_blank' | '_parent' | '_top';
16
+ rel?: string;
16
17
  join?: boolean;
17
18
  tooltipText?: string;
18
19
  download?: string;
@@ -23,7 +24,7 @@ export interface ButtonProps extends Partial<LinkProps> {
23
24
  noBorderComponent?: boolean;
24
25
  }
25
26
  export type ButtonGroupOptionComponent<Option> = Component<SelectOptionProps<Option>>;
26
- interface ButtonGroupPropsBase<Model extends number | string | null | boolean> extends Omit<FieldWrapperProps, 'modelValue'>, Omit<ButtonProps, 'tag' | 'type' | 'replace' | 'href' | 'target' | 'join'> {
27
+ interface ButtonGroupPropsBase<Model extends number | string | null | boolean> extends Omit<FieldWrapperProps, 'modelValue'>, Omit<ButtonProps, 'tag' | 'type' | 'replace' | 'href' | 'target' | 'rel' | 'join'> {
27
28
  modelValue: Model;
28
29
  wrap?: boolean;
29
30
  col?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/Button/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,iBAAiB,CAAA;AACtD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,iCAAiC,CAAA;AACtE,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,iCAAiC,CAAA;AACtE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAC,SAAS,EAAE,KAAK,EAAC,MAAM,KAAK,CAAA;AAEzC,MAAM,WAAW,WAAY,SAAQ,OAAO,CAAC,SAAS,CAAC;IACrD,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,GAAG,CAAC,EAAE,MAAM,qBAAqB,CAAA;IACjC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAA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ACjC,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,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC3C;IAAE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC9C;IAAE,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAO9C,QAAA,MAAM,UAAU;;;;;;;;;;;;6EAId,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":"WInputDate.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/WInputDate.vue"],"names":[],"mappings":"AAoDA;AA2HA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,SAAS,CAAA;AAO3C,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAA;AAuNvD,QAAA,IAAwB,QAAQ,IAAW,EAAE,QAAQ,IAAW,EAAE,QAAQ;;CAAY,CAAE;AACxF,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC3C;IAAE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,GAC9C;IAAE,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAO9C,QAAA,MAAM,UAAU;;;;;;;;;;;;6EAId,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"}
@@ -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) {
@@ -3,6 +3,7 @@ import { SemanticType } from '../../utils/SemanticType';
3
3
  interface Props extends Partial<LinkProps> {
4
4
  href?: string;
5
5
  target?: '_self' | '_blank' | '_parent' | '_top';
6
+ rel?: string;
6
7
  text?: string;
7
8
  semanticType?: SemanticType;
8
9
  icon?: SVGComponent;
@@ -18,6 +19,7 @@ declare const __VLS_base: import('vue').DefineComponent<Props, {}, {}, {}, {}, i
18
19
  icon: SVGComponent;
19
20
  semanticType: SemanticType;
20
21
  target: "_self" | "_blank" | "_parent" | "_top";
22
+ rel: string;
21
23
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
22
24
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
23
25
  declare const _default: typeof __VLS_export;
@@ -1 +1 @@
1
- {"version":3,"file":"WLink.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Link/WLink.vue"],"names":[],"mappings":"AAcA;AAiDA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,eAAe,CAAA;AAM5C,OAAO,EAAC,YAAY,EAAiD,MAAM,sBAAsB,CAAA;AAEjG,UAAU,KAAM,SAAQ,OAAO,CAAC,SAAS,CAAC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAA;IAChD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,IAAI,CAAC,EAAE,YAAY,CAAA;CACpB;AAyFD,QAAA,IAAI,QAAQ,IAAY,CAAE;AAC1B,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAKhD,QAAA,MAAM,UAAU;UAnGP,MAAM;UAFN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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"}
@@ -8,6 +8,7 @@ var WLink_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
8
8
  props: {
9
9
  href: { default: void 0 },
10
10
  target: { default: void 0 },
11
+ rel: { default: void 0 },
11
12
  text: { default: void 0 },
12
13
  semanticType: { default: SemanticType.PRIMARY },
13
14
  icon: { default: void 0 },
@@ -19,10 +20,12 @@ var WLink_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
19
20
  return (_ctx, _cache) => {
20
21
  return openBlock(), createBlock(resolveDynamicComponent(__props.to ? WRouterLink_default : "a"), mergeProps(!__props.to ? {
21
22
  href: __props.href,
22
- target: __props.target
23
+ target: __props.target,
24
+ rel: __props.rel
23
25
  } : {
24
26
  to: __props.to,
25
- target: __props.target
27
+ target: __props.target,
28
+ rel: __props.rel
26
29
  }, { class: ["cursor-pointer overflow-hidden truncate whitespace-normal font-normal no-underline hover:underline", unref(semanticTypeTextMap)[__props.semanticType]] }), {
27
30
  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)])]),
28
31
  _: 3
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.1",
7
+ "version": "0.16.3",
8
8
  "dependencies": {
9
9
  "@stylistic/eslint-plugin": "5.10.0",
10
10
  "@tanstack/eslint-plugin-query": "5.102.8",