@ironsource/shared-ui 2.1.6-test.2 → 2.1.6-test.4

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 (144) hide show
  1. package/AppDropdownTrigger.vue_vue_type_style_index_0_scoped_39c47ad1_lang.css +1 -0
  2. package/AppHeader.vue_vue_type_style_index_0_scoped_538ccdc6_lang.css +1 -0
  3. package/Autocomplete.vue_vue_type_style_index_0_scoped_a7bfd237_lang.css +1 -0
  4. package/CalendarMonth.vue_vue_type_style_index_0_scoped_acd3440c_lang.css +1 -0
  5. package/ChipDropdownTrigger.vue_vue_type_style_index_0_scoped_a8fdae89_lang.css +1 -0
  6. package/DataGrid.vue_vue_type_style_index_0_scoped_6df3b70f_lang.css +1 -0
  7. package/DatePicker.vue_vue_type_style_index_0_scoped_67b44cbe_lang.css +1 -0
  8. package/DatePickerMonth.vue_vue_type_style_index_0_scoped_929d3028_lang.css +1 -0
  9. package/DateRange.vue_vue_type_style_index_0_scoped_70e316e9_lang.css +1 -0
  10. package/DefaultDropdownTrigger.vue_vue_type_style_index_0_scoped_ad524750_lang.css +1 -0
  11. package/DialogV4.vue_vue_type_style_index_0_scoped_09c488cf_lang.css +1 -0
  12. package/Dropdown.vue_vue_type_style_index_0_scoped_aaa8c4bb_lang.css +1 -0
  13. package/DropdownV4.vue_vue_type_style_index_0_scoped_0363db63_lang.css +1 -0
  14. package/DropdownV4.vue_vue_type_style_index_1_lang.css +1 -1
  15. package/FieldLabel.vue_vue_type_style_index_0_scoped_96ee1c98_lang.css +1 -0
  16. package/{FormCard.vue_vue_type_style_index_0_scoped_ef8b4e81_lang.css → FormCard.vue_vue_type_style_index_0_scoped_52ade67c_lang.css} +1 -1
  17. package/InlineCopy.vue_vue_type_style_index_0_scoped_6a7b3795_lang.css +1 -0
  18. package/MultiBar.vue_vue_type_style_index_0_scoped_71617643_lang.css +1 -0
  19. package/OptionV4.vue_vue_type_style_index_0_scoped_e0c24b6a_lang.css +1 -0
  20. package/TextAreaV4.vue_vue_type_style_index_0_scoped_8199b662_lang.css +1 -0
  21. package/TextField.vue_vue_type_style_index_0_scoped_a6457440_lang.css +1 -0
  22. package/TooltipV4.vue_vue_type_style_index_0_scoped_fcdb9d02_lang.css +1 -0
  23. package/components/appHeader/AppHeader.vue.d.ts +6 -2
  24. package/components/appHeader/AppHeader.vue.js +2 -2
  25. package/components/appHeader/AppHeader.vue2.js +30 -28
  26. package/components/appHeader/index.d.ts +6 -2
  27. package/components/autocomplete/Autocomplete.vue.d.ts +5 -0
  28. package/components/autocomplete/Autocomplete.vue.js +3 -3
  29. package/components/autocomplete/Autocomplete.vue2.js +82 -61
  30. package/components/autocomplete/index.d.ts +20 -1
  31. package/components/datePicker/common/DatePicker.common.d.ts +11 -0
  32. package/components/datePicker/common/DatePicker.common.js +52 -0
  33. package/components/datePicker/common/DatePickerMonth.common.d.ts +85 -0
  34. package/components/datePicker/common/DatePickerMonth.common.js +66 -0
  35. package/components/datePicker/{DatePicker.vue.d.ts → v3/DatePicker.vue.d.ts} +1 -1
  36. package/components/datePicker/v3/DatePicker.vue.js +7 -0
  37. package/components/datePicker/v3/DatePicker.vue2.js +69 -0
  38. package/components/datePicker/v3/DatePickerMonth.vue.js +7 -0
  39. package/components/datePicker/v3/DatePickerMonth.vue2.js +40 -0
  40. package/components/datePicker/{index.d.ts → v3/index.d.ts} +1 -1
  41. package/components/datePicker/v4/DatePickerMonthV4.vue.d.ts +53 -0
  42. package/components/datePicker/v4/DatePickerV4.vue.d.ts +67 -0
  43. package/components/datePicker/v4/index.d.ts +184 -0
  44. package/components/dateRange/common/CalendarMonth.common.d.ts +17 -0
  45. package/components/dateRange/common/CalendarMonth.common.js +131 -0
  46. package/components/dateRange/common/DateRange.common.d.ts +47 -0
  47. package/components/dateRange/common/DateRange.common.js +265 -0
  48. package/components/dateRange/common/DateRangePicker.common.d.ts +3 -0
  49. package/components/dateRange/{CalendarMonth.vue.d.ts → v3/CalendarMonth.vue.d.ts} +1 -1
  50. package/components/dateRange/v3/CalendarMonth.vue.js +7 -0
  51. package/components/dateRange/v3/CalendarMonth.vue2.js +147 -0
  52. package/components/dateRange/{DateRange.vue.d.ts → v3/DateRange.vue.d.ts} +9 -9
  53. package/components/dateRange/v3/DateRange.vue.js +7 -0
  54. package/components/dateRange/v3/DateRange.vue2.js +226 -0
  55. package/components/dateRange/{DateRangePicker.vue.d.ts → v3/DateRangePicker.vue.d.ts} +9 -9
  56. package/components/dateRange/{index.d.ts → v3/index.d.ts} +21 -21
  57. package/components/dateRange/v4/CalendarMonthV4.vue.d.ts +75 -0
  58. package/components/dateRange/v4/DateRangePickerV4.vue.d.ts +115 -0
  59. package/components/dateRange/v4/DateRangeV4.vue.d.ts +127 -0
  60. package/components/dateRange/v4/index.d.ts +408 -0
  61. package/components/dialog/v4/DialogV4.vue.js +3 -3
  62. package/components/dialog/v4/DialogV4.vue2.js +67 -62
  63. package/components/dropdown/common/Dropdown.common.js +21 -21
  64. package/components/dropdown/v3/Dropdown.vue.d.ts +4 -0
  65. package/components/dropdown/v3/Dropdown.vue.js +4 -4
  66. package/components/dropdown/v3/Dropdown.vue2.js +32 -32
  67. package/components/dropdown/v3/index.d.ts +13 -1
  68. package/components/dropdown/v4/AppDropdownTrigger.vue.d.ts +2 -0
  69. package/components/dropdown/v4/AppDropdownTrigger.vue.js +2 -2
  70. package/components/dropdown/v4/AppDropdownTrigger.vue2.js +16 -16
  71. package/components/dropdown/v4/ChipDropdownTrigger.vue.js +2 -2
  72. package/components/dropdown/v4/ChipDropdownTrigger.vue2.js +1 -1
  73. package/components/dropdown/v4/DefaultDropdownTrigger.vue.js +2 -2
  74. package/components/dropdown/v4/DefaultDropdownTrigger.vue2.js +40 -49
  75. package/components/dropdown/v4/DropdownV4.vue.d.ts +16 -0
  76. package/components/dropdown/v4/DropdownV4.vue.js +3 -3
  77. package/components/dropdown/v4/DropdownV4.vue2.js +140 -128
  78. package/components/dropdown/v4/OptionV4.vue.d.ts +11 -0
  79. package/components/dropdown/v4/OptionV4.vue.js +3 -3
  80. package/components/dropdown/v4/OptionV4.vue2.js +61 -44
  81. package/components/dropdown/v4/index.d.ts +105 -4
  82. package/components/filtersPanel/v3/Filter.d.ts +1 -1
  83. package/components/forms/FormCard.vue.js +2 -2
  84. package/components/forms/FormCard.vue2.js +9 -9
  85. package/components/inlineCopy/InlineCopy.vue.d.ts +6 -2
  86. package/components/inlineCopy/InlineCopy.vue.js +3 -3
  87. package/components/inlineCopy/InlineCopy.vue2.js +23 -22
  88. package/components/inlineCopy/index.d.ts +6 -2
  89. package/components/input/v4/TextField.vue.d.ts +5 -0
  90. package/components/input/v4/TextField.vue.js +2 -2
  91. package/components/input/v4/TextField.vue2.js +43 -43
  92. package/components/input/v4/index.d.ts +20 -1
  93. package/components/multibar/MultiBar.vue.js +3 -3
  94. package/components/multibar/MultiBar.vue2.js +21 -21
  95. package/components/shared/FieldLabel.vue.js +3 -3
  96. package/components/shared/FieldLabel.vue2.js +9 -9
  97. package/components/table/v4/DataGrid.vue.d.ts +4 -0
  98. package/components/table/v4/DataGrid.vue.js +3 -3
  99. package/components/table/v4/DataGrid.vue2.js +147 -147
  100. package/components/table/v4/index.d.ts +14 -2
  101. package/components/textArea/v4/TextAreaV4.vue.js +3 -3
  102. package/components/textArea/v4/TextAreaV4.vue2.js +1 -1
  103. package/components/tooltip/v4/TooltipV4.vue.d.ts +6 -2
  104. package/components/tooltip/v4/TooltipV4.vue.js +2 -2
  105. package/components/tooltip/v4/TooltipV4.vue2.js +21 -19
  106. package/components/tooltip/v4/index.d.ts +17 -5
  107. package/index.d.ts +338 -34
  108. package/index.js +4 -4
  109. package/package.json +3 -3
  110. package/AppDropdownTrigger.vue_vue_type_style_index_0_scoped_0267d003_lang.css +0 -1
  111. package/AppHeader.vue_vue_type_style_index_0_scoped_c148fc7a_lang.css +0 -1
  112. package/Autocomplete.vue_vue_type_style_index_0_scoped_d2d1dc1d_lang.css +0 -1
  113. package/CalendarMonth.vue_vue_type_style_index_0_scoped_b2206adb_lang.css +0 -1
  114. package/ChipDropdownTrigger.vue_vue_type_style_index_0_scoped_889042cf_lang.css +0 -1
  115. package/DataGrid.vue_vue_type_style_index_0_scoped_c96fba2c_lang.css +0 -1
  116. package/DatePicker.vue_vue_type_style_index_0_scoped_e108ef3b_lang.css +0 -1
  117. package/DatePickerMonth.vue_vue_type_style_index_0_scoped_b171cdab_lang.css +0 -1
  118. package/DateRange.vue_vue_type_style_index_0_scoped_eb5d155e_lang.css +0 -1
  119. package/DefaultDropdownTrigger.vue_vue_type_style_index_0_scoped_c3033d90_lang.css +0 -1
  120. package/DialogV4.vue_vue_type_style_index_0_scoped_c3004ba3_lang.css +0 -1
  121. package/Dropdown.vue_vue_type_style_index_0_scoped_d4f8e790_lang.css +0 -1
  122. package/DropdownV4.vue_vue_type_style_index_0_scoped_bf8e7ff5_lang.css +0 -1
  123. package/FieldLabel.vue_vue_type_style_index_0_scoped_72ab1f25_lang.css +0 -1
  124. package/InlineCopy.vue_vue_type_style_index_0_scoped_ff9f4a0f_lang.css +0 -1
  125. package/MultiBar.vue_vue_type_style_index_0_scoped_b473b35e_lang.css +0 -1
  126. package/OptionV4.vue_vue_type_style_index_0_scoped_b8375219_lang.css +0 -1
  127. package/TextAreaV4.vue_vue_type_style_index_0_scoped_0336a92f_lang.css +0 -1
  128. package/TextField.vue_vue_type_style_index_0_scoped_01778240_lang.css +0 -1
  129. package/TooltipV4.vue_vue_type_style_index_0_scoped_25809092_lang.css +0 -1
  130. package/components/datePicker/DatePicker.vue.js +0 -7
  131. package/components/datePicker/DatePicker.vue2.js +0 -97
  132. package/components/datePicker/DatePickerMonth.vue.js +0 -7
  133. package/components/datePicker/DatePickerMonth.vue2.js +0 -85
  134. package/components/dateRange/CalendarMonth.vue.js +0 -7
  135. package/components/dateRange/CalendarMonth.vue2.js +0 -244
  136. package/components/dateRange/DateRange.vue.js +0 -7
  137. package/components/dateRange/DateRange.vue2.js +0 -417
  138. /package/components/datePicker/{DatePickerMonth.vue.d.ts → v3/DatePickerMonth.vue.d.ts} +0 -0
  139. /package/components/datePicker/{index.js → v3/index.js} +0 -0
  140. /package/components/dateRange/{DateServices.d.ts → common/DateServices.common.d.ts} +0 -0
  141. /package/components/dateRange/{DateServices.js → common/DateServices.common.js} +0 -0
  142. /package/components/dateRange/{consts.d.ts → common/consts.common.d.ts} +0 -0
  143. /package/components/dateRange/{consts.js → common/consts.common.js} +0 -0
  144. /package/components/dateRange/{index.js → v3/index.js} +0 -0
@@ -1,7 +0,0 @@
1
- import e from "./DateRange.vue2.js";
2
- /* empty css */import o from "../../_virtual/_plugin-vue_export-helper.js";
3
- // import "../../DateRange.vue_vue_type_style_index_0_scoped_eb5d155e_lang.css"; //*');
4
- const a = /* @__PURE__ */ o(e, [["__scopeId", "data-v-eb5d155e"]]);
5
- export {
6
- a as default
7
- };
@@ -1,417 +0,0 @@
1
- import "../../DateRange.vue_vue_type_style_index_0_scoped_eb5d155e_lang.css"; import { defineComponent as Pe, ref as r, computed as Y, onMounted as be, onBeforeMount as xe, onUnmounted as Oe, watch as de, openBlock as D, createElementBlock as C, unref as d, normalizeClass as P, createElementVNode as i, renderSlot as ue, toDisplayString as O, setBlockTracking as q, withDirectives as K, Fragment as J, renderList as Q, createVNode as N, withCtx as A, createTextVNode as B, createCommentVNode as ie, vShow as V, normalizeStyle as Ne } from "vue";
2
- import { onClickOutside as Fe } from "@vueuse/core";
3
- import { useToggle as Le } from "../../composables/useToggle.js";
4
- import Ue from "./CalendarMonth.vue.js";
5
- import p from "./DateServices.js";
6
- import { typeToName as Re, messagePerType as We, presetsList as Ye, formatError as qe, mandatoryValuesError as Ae, navigatePrev as ce, navigateNext as fe } from "./consts.js";
7
- import ve from "../button/v3/Button.vue.js";
8
- import "../button/v3/IconButton.vue.js";
9
- import "../button/v3/ScrollButton.vue.js";
10
- import "../typography/Heading.vue.js";
11
- import me from "../typography/Text.vue.js";
12
- import { min as Be, addDays as ze, format as ge } from "date-fns";
13
- import { DateRangeTestIdModifiers as E } from "../../testids/index.js";
14
- const He = ["id", "data-testid"], je = ["data-testid"], Ge = ["id", "data-testid"], Ke = {
15
- key: 0,
16
- class: "type-picker"
17
- }, Je = ["onClick"], Qe = ["data-testid"], Ve = ["id"], Xe = ["id"], Ze = ["onClick"], _e = { class: "dropdown-rightTriangle" }, et = ["data-testid"], tt = { class: "date-picker-calendar left-box" }, at = { class: "buttons-cover" }, nt = { class: "range" }, pt = /* @__PURE__ */ Pe({
18
- __name: "DateRange",
19
- props: {
20
- range: null,
21
- types: { default: () => ["date"] },
22
- includeToday: { type: Boolean, default: !0 },
23
- allowedDays: { default: null },
24
- maxDaysInRange: { default: null },
25
- datePresetList: { default: "date" },
26
- regex: { default: () => /^(1[0-2]|0?[1-9])\/[\d]{1,2}\/[\d]{4}$/ },
27
- dateFormat: { default: "mm/dd/yyyy" },
28
- uniqueId: { default: Date.now() },
29
- disabled: { type: Boolean, default: !1 },
30
- initialType: { default: null },
31
- openOnTop: { type: Boolean, default: !1 },
32
- showPresets: { type: Boolean, default: !0 },
33
- maxDate: { default: null },
34
- testId: { default: "" }
35
- },
36
- emits: [
37
- "rangeTypeChanged",
38
- "currentDateChanged",
39
- "rangeChanged",
40
- "dateRangePresetNameChanged",
41
- "opened",
42
- "dismissed"
43
- ],
44
- setup(s, { emit: M }) {
45
- const o = s, X = r(null), y = r({ started: !1, date: null }), Z = r(!1), _ = 2, F = r({ from: null, to: null }), u = r({}), m = r([]), $ = r(null), f = r({}), L = r({}), b = r(!1), S = r(null), c = r(null), ee = r("left"), x = r(null), U = r(null), I = r([]), te = r(null), [k] = Le({ initialValue: !1 }), ae = r(null);
46
- Fe(ae, () => {
47
- k.value = !1;
48
- });
49
- const z = (e, t) => {
50
- const a = {
51
- weeks: [],
52
- days: {},
53
- month: e,
54
- year: t
55
- };
56
- let n, l;
57
- const g = new Date(t, e, 1).getDay();
58
- let h = 1;
59
- const v = /* @__PURE__ */ new Date();
60
- v.setHours(0, 0, 0, 0);
61
- const Ie = p.daysInMonth(e, t);
62
- for (let j = 0; j < 6; j++) {
63
- l = [];
64
- for (let G = 0; G < 7; G++)
65
- n = {}, j === 0 && g > 0 && G < g && (n.value = 0), h > Ie && (n.value = 0), !n.value && n.value !== 0 && (n.value = h, h += 1, a.days[n.value] = n, n.date = new Date(t, e, n.value), v < n.date ? n.isFuture = !0 : n.date.getTime() === v.getTime() && (n.isToday = !0, o.includeToday || (n.disabled = !0))), l.push(n);
66
- a.weeks.push(l);
67
- }
68
- return a;
69
- }, R = () => {
70
- let e = p.getCurrentTimeUTC();
71
- if (c.value && c.value.toEnd ? e = c.value.toEnd : o.range && o.range.to && (e = o.range.to), !u.value[`${e.getFullYear().toString()}_${e.getMonth().toString()}`]) {
72
- u.value = {}, m.value = [];
73
- for (let t = 0; t < _; t++) {
74
- const a = new Date(e);
75
- a.setDate(1), a.setMonth(e.getMonth() - t);
76
- const n = `${a.getFullYear().toString()}_${a.getMonth().toString()}`;
77
- u.value[n] = {
78
- parsedMonth: z(a.getMonth(), a.getFullYear()),
79
- order: t
80
- }, m.value.unshift(n);
81
- }
82
- }
83
- }, ne = (e, t) => {
84
- S.value = e;
85
- let a = e;
86
- e === "date" && (a = o.datePresetList), I.value = Ye[a], t && (c.value = {
87
- fromStart: null,
88
- fromEnd: null,
89
- toStart: null,
90
- toEnd: null
91
- }, F.value.from = "", F.value.to = "", y.value = { started: !1, date: null }, f.value = "custom"), M("rangeTypeChanged", S.value);
92
- }, he = (e) => {
93
- f.value = e.id, T($.value[e.id].dates()), R();
94
- }, T = (e, t = !1) => {
95
- let a = e;
96
- return (!e || !e.from && !e.to) && (a = $.value[I.value[0]]), o.maxDaysInRange && (te.value = t ? ze(a.from, o.maxDaysInRange) : null), b.value = !1, !a.from || !a.to || !(a.from instanceof Date) || !(a.to instanceof Date) ? (U.value = qe, b.value = !0, !1) : a.from > a.to ? (U.value = `"From" date can't be bigger than "To" date`, b.value = !0, !1) : (c.value = De(a), F.value.from = ge(
97
- c.value.fromStart,
98
- o.dateFormat
99
- ), F.value.to = ge(c.value.toEnd, o.dateFormat), !0);
100
- }, H = () => {
101
- f.value === "custom" ? x.value = p.getDateRangeString(c.value) : x.value = Ee.value, M("currentDateChanged", x.value);
102
- }, pe = () => {
103
- if (c.value.fromStart == null || c.value.toEnd == null) {
104
- b.value = !0, U.value = Ae;
105
- return;
106
- }
107
- const e = p.getCurrentTimeUTC();
108
- c.value.toEnd > e && (c.value.toEnd = e), H(), L.value = f.value, M("rangeChanged", {
109
- from: c.value.fromStart,
110
- to: c.value.toEnd,
111
- preset: L.value
112
- }), W(!1);
113
- }, ye = (e, t) => e ? ce : t ? fe : null, ke = (e) => {
114
- let t = null, a = null;
115
- const n = _ - 1;
116
- let l = "", w = null, g = null;
117
- switch (e) {
118
- case fe:
119
- Object.keys(u.value).forEach((h) => {
120
- const v = u.value[h];
121
- v.order === 0 && (w = v), v.order === n ? (m.value.splice(
122
- m.value.indexOf(h),
123
- 1
124
- ), delete u.value[h]) : v.order += 1;
125
- }), t = w.parsedMonth.month + 1, a = w.parsedMonth.year, t > 11 && (t = 0, a += 1), l = `${a.toString()}_${t.toString()}`, u.value[l] = {
126
- parsedMonth: z(t, a),
127
- order: 0
128
- }, m.value.push(l);
129
- break;
130
- case ce:
131
- Object.keys(u.value).forEach((h) => {
132
- const v = u.value[h];
133
- v.order === n && (g = v), v.order === 0 ? (m.value.splice(
134
- m.value.indexOf(h),
135
- 1
136
- ), delete u.value[h]) : v.order -= 1;
137
- }), t = g.parsedMonth.month - 1, a = g.parsedMonth.year, t < 0 && (t = 11, a -= 1), l = `${a.toString()}_${t.toString()}`, u.value[l] = {
138
- parsedMonth: z(t, a),
139
- order: n
140
- }, m.value.unshift(l);
141
- break;
142
- }
143
- }, De = (e) => {
144
- let t;
145
- switch (S.value) {
146
- case "week":
147
- t = {
148
- fromStart: p.getFirstDayOfWeek(e.from),
149
- fromEnd: p.getLastDayOfWeek(e.from),
150
- toStart: p.getFirstDayOfWeek(e.to),
151
- toEnd: p.getLastDayOfWeek(e.to)
152
- };
153
- break;
154
- case "month":
155
- t = {
156
- fromStart: new Date(
157
- e.from.getFullYear(),
158
- e.from.getMonth(),
159
- 1
160
- ),
161
- fromEnd: p.getLastDayOfMonth(e.from),
162
- toStart: new Date(
163
- e.to.getFullYear(),
164
- e.to.getMonth(),
165
- 1
166
- ),
167
- toEnd: p.getLastDayOfMonth(e.to)
168
- };
169
- break;
170
- case "date":
171
- default:
172
- t = {
173
- fromStart: e.from,
174
- fromEnd: e.from,
175
- toStart: e.to,
176
- toEnd: e.to
177
- };
178
- break;
179
- }
180
- return t;
181
- }, le = (e, t) => e.getUTCFullYear() === t.getUTCFullYear() && e.getUTCMonth() === t.getUTCMonth() && e.getUTCDate() === t.getUTCDate(), se = (e) => {
182
- let t = !1;
183
- const a = {
184
- from: new Date(e.from),
185
- to: new Date(e.to)
186
- };
187
- a.from.setHours(0, 0, 0, 0), a.to.setHours(0, 0, 0, 0);
188
- const n = I.value.map((l) => l.id);
189
- if (Object.keys($.value).forEach((l) => {
190
- const w = $.value[l];
191
- if (l !== "custom" && !t && n.indexOf(l) !== -1) {
192
- const g = w.dates();
193
- g.from.setHours(0, 0, 0, 0), g.to.setHours(0, 0, 0, 0), le(g.from, a.from) && le(g.to, a.to) && (f.value = l, t = !0);
194
- }
195
- }), t) {
196
- const l = I.value.find(
197
- (w) => w.id === f.value
198
- );
199
- M("dateRangePresetNameChanged", l.name);
200
- } else
201
- M("dateRangePresetNameChanged", null), f.value = "custom";
202
- L.value = f.value;
203
- }, oe = (e, t, a) => {
204
- if (!y.value.started)
205
- f.value = "custom", y.value.started = !0, y.value.date = new Date(a, t, e.value), T(
206
- { from: y.value.date, to: y.value.date },
207
- !0
208
- );
209
- else {
210
- const n = new Date(a, t, e.value), l = y.value.date;
211
- y.value.started = !1, y.value.date = null, n < l ? oe(e, t, a) : T({ from: l, to: n });
212
- }
213
- }, Ce = () => {
214
- const e = X.value.offsetLeft;
215
- return window.innerWidth - e > 930 ? "left" : "right";
216
- }, W = (e = !0) => {
217
- k.value = !k.value, k.value ? (ee.value = Ce(), T(o.range), R(), M("opened")) : (T(o.range), R(), f.value = L.value, e && M("dismissed"));
218
- }, we = () => {
219
- k.value && W();
220
- }, Me = () => {
221
- $.value = p.getPresetsFunctions(o.includeToday), $.value.custom = {
222
- dates: () => o.range
223
- };
224
- }, Te = Y(() => (m.value || []).reduce((e, t) => {
225
- const n = u.value[t].parsedMonth.weeks[u.value[t].parsedMonth.weeks.length - 1].filter(
226
- (l) => l.value !== 0
227
- ).length;
228
- return e && !n;
229
- }, !0)), re = () => {
230
- o.range && (Z.value = !0, ne(o.initialType || o.types[0]), Me(), se(o.range), T(o.range), R(), H());
231
- };
232
- be(() => {
233
- re();
234
- }), xe(() => {
235
- const e = (t) => {
236
- t.key === "Escape" && k.value && we();
237
- };
238
- document.addEventListener("keyup", e), Oe(() => {
239
- document.removeEventListener("keyup", e);
240
- });
241
- }), de(
242
- () => o.range,
243
- (e, t) => {
244
- e && e !== t && (Z.value ? (se(e), T(e), H()) : re());
245
- }
246
- ), de(k, (e) => {
247
- e || (y.value.started = !1);
248
- });
249
- const Ee = Y(() => {
250
- const e = I.value.find(
251
- (t) => t.id === f.value
252
- );
253
- return e ? e.name : "";
254
- }), $e = Y(() => `datepicker${o.uniqueId}`), Se = Y(() => {
255
- const e = [o.maxDate, te.value].filter((t) => t);
256
- return e.length ? Be(e) : null;
257
- });
258
- return (e, t) => (D(), C("div", {
259
- id: d($e),
260
- ref_key: "datePicker",
261
- ref: X,
262
- class: P(["relative-wrap", { "date-range-disabled": s.disabled }]),
263
- "data-testid": `${s.testId}-${d(E).WRAPPER}`
264
- }, [
265
- i("div", {
266
- class: "date-range-field",
267
- "data-testid": `${s.testId}-${d(E).TRIGGER}`,
268
- onClick: t[1] || (t[1] = (a) => W())
269
- }, [
270
- ue(e.$slots, "field", {
271
- currentDate: x.value,
272
- isOpen: d(k)
273
- }, () => [
274
- i("span", null, O(x.value), 1),
275
- t[0] || (q(-1), t[0] = i("div", { class: "small-triangle" }), q(1), t[0])
276
- ], !0)
277
- ], 8, je),
278
- K(i("div", {
279
- id: "datepickerPopup" + s.uniqueId,
280
- ref_key: "popup",
281
- ref: ae,
282
- class: P(["pop-up", [
283
- ee.value,
284
- s.openOnTop ? "open-on-top" : "",
285
- s.showPresets ? "" : "hide-presets"
286
- ]]),
287
- "data-testid": `${s.testId}-${d(E).CONTAINER}`
288
- }, [
289
- s.types.length > 1 ? (D(), C("div", Ke, [
290
- (D(!0), C(J, null, Q(s.types, (a) => (D(), C("span", {
291
- key: a,
292
- class: P(["range-type", { "selected-range-type": S.value === a }]),
293
- onClick: (n) => ne(a, !0)
294
- }, [
295
- N(d(me), { size: "sm" }, {
296
- default: A(() => [
297
- B(O(d(Re)[a]), 1)
298
- ]),
299
- _: 2
300
- }, 1024)
301
- ], 10, Je))), 128))
302
- ])) : ie("", !0),
303
- i("div", {
304
- class: P(["flex", { "pop-up-content": s.types.length > 1 }])
305
- }, [
306
- s.showPresets ? (D(), C("div", {
307
- key: 0,
308
- class: "date-picker-menu",
309
- "data-testid": `${s.testId}-${d(E).MENU}`
310
- }, [
311
- i("div", {
312
- id: "presets" + s.uniqueId,
313
- class: "preset-dropdown"
314
- }, [
315
- i("ul", {
316
- id: "customDropDownList" + s.uniqueId
317
- }, [
318
- (D(!0), C(J, null, Q(I.value, (a) => (D(), C("li", {
319
- key: a.id,
320
- class: P({
321
- "selected-preset-container": f.value === a.id
322
- })
323
- }, [
324
- i("div", {
325
- class: P([{ "selected-preset": f.value === a.id }, "preset-element"]),
326
- onClick: (n) => he(a)
327
- }, [
328
- N(d(me), { size: "sm" }, {
329
- default: A(() => [
330
- B(O(a.name), 1)
331
- ]),
332
- _: 2
333
- }, 1024)
334
- ], 10, Ze),
335
- K(i("div", _e, null, 512), [
336
- [V, a.id === "custom"]
337
- ])
338
- ], 2))), 128))
339
- ], 8, Xe)
340
- ], 8, Ve),
341
- i("div", {
342
- class: "type-message",
343
- "data-testid": `${s.testId}-${d(E).MESSAGE}`
344
- }, O(d(We)[S.value]), 9, et)
345
- ], 8, Qe)) : ie("", !0),
346
- i("div", {
347
- class: "calendar-wrap",
348
- style: Ne({ height: d(Te) ? "336px" : "372px" })
349
- }, [
350
- i("div", tt, [
351
- (D(!0), C(J, null, Q(m.value, (a, n) => (D(), C("div", { key: a }, [
352
- N(Ue, {
353
- id: s.uniqueId,
354
- navigation: ye(
355
- n === 0,
356
- n === m.value.length - 1
357
- ),
358
- year: u.value[a].parsedMonth.year,
359
- days: u.value[a].parsedMonth.days,
360
- weeks: u.value[a].parsedMonth.weeks,
361
- month: u.value[a].parsedMonth.month,
362
- range: c.value,
363
- type: S.value,
364
- "allowed-days": s.allowedDays,
365
- "max-allowed-date": d(Se),
366
- "test-id": `${s.testId}-${n}`,
367
- onSelectionChanged: oe,
368
- onNavigation: ke
369
- }, null, 8, ["id", "navigation", "year", "days", "weeks", "month", "range", "type", "allowed-days", "max-allowed-date", "test-id"])
370
- ]))), 128)),
371
- i("div", at, [
372
- i("div", nt, [
373
- ue(e.$slots, "footer", {}, void 0, !0)
374
- ]),
375
- K(i("div", { class: "error" }, O(U.value), 513), [
376
- [V, b.value]
377
- ]),
378
- t[2] || (q(-1), t[2] = i("div", { class: "buttons" }, [
379
- N(d(ve), {
380
- id: "button-ok" + s.uniqueId,
381
- size: "sm",
382
- class: "primary button small",
383
- "data-testid": `${s.testId}-${d(E).ACTION_APPLY}`,
384
- onClick: (a) => pe()
385
- }, {
386
- default: A(() => [
387
- B(" Apply ")
388
- ]),
389
- _: 1
390
- }, 8, ["id", "data-testid", "onClick"]),
391
- N(d(ve), {
392
- id: "button-cancel" + s.uniqueId,
393
- size: "sm",
394
- theme: "third",
395
- class: "button small border third transparent",
396
- "data-testid": `${s.testId}-${d(E).ACTION_CANCEL}`,
397
- onClick: (a) => W()
398
- }, {
399
- default: A(() => [
400
- B(" Cancel ")
401
- ]),
402
- _: 1
403
- }, 8, ["id", "data-testid", "onClick"])
404
- ]), q(1), t[2])
405
- ])
406
- ])
407
- ], 4)
408
- ], 2)
409
- ], 10, Ge), [
410
- [V, d(k)]
411
- ])
412
- ], 10, He));
413
- }
414
- });
415
- export {
416
- pt as default
417
- };
File without changes
File without changes