@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
@@ -0,0 +1,184 @@
1
+ declare const DatePickerTypes: () => ({
2
+ new (...args: any[]): {
3
+ $: import("vue").ComponentInternalInstance;
4
+ $data: {};
5
+ $props: Partial<{
6
+ testId: string;
7
+ modelValue: string | Date;
8
+ placeholder: string;
9
+ uniqueId: string | number;
10
+ allowFutureDates: boolean;
11
+ dateFormat: string;
12
+ }> & Omit<Readonly<import("vue").ExtractPropTypes<{
13
+ testId: {
14
+ type: import("vue").PropType<string>;
15
+ default: string;
16
+ };
17
+ modelValue: {
18
+ type: import("vue").PropType<string | Date>;
19
+ default: any;
20
+ };
21
+ placeholder: {
22
+ type: import("vue").PropType<string>;
23
+ default: string;
24
+ };
25
+ uniqueId: {
26
+ type: import("vue").PropType<string | number>;
27
+ default: number;
28
+ };
29
+ allowFutureDates: {
30
+ type: import("vue").PropType<boolean>;
31
+ default: boolean;
32
+ };
33
+ dateFormat: {
34
+ type: import("vue").PropType<string>;
35
+ default: string;
36
+ };
37
+ }>> & {
38
+ "onUpdate:modelValue"?: (val: string | Date) => any;
39
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "testId" | "modelValue" | "placeholder" | "uniqueId" | "allowFutureDates" | "dateFormat">;
40
+ $attrs: {
41
+ [x: string]: unknown;
42
+ };
43
+ $refs: {
44
+ [x: string]: unknown;
45
+ };
46
+ $slots: Readonly<{
47
+ [name: string]: import("vue").Slot;
48
+ }>;
49
+ $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>;
50
+ $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>;
51
+ $emit: (event: "update:modelValue", val: string | Date) => void;
52
+ $el: any;
53
+ $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
54
+ testId: {
55
+ type: import("vue").PropType<string>;
56
+ default: string;
57
+ };
58
+ modelValue: {
59
+ type: import("vue").PropType<string | Date>;
60
+ default: any;
61
+ };
62
+ placeholder: {
63
+ type: import("vue").PropType<string>;
64
+ default: string;
65
+ };
66
+ uniqueId: {
67
+ type: import("vue").PropType<string | number>;
68
+ default: number;
69
+ };
70
+ allowFutureDates: {
71
+ type: import("vue").PropType<boolean>;
72
+ default: boolean;
73
+ };
74
+ dateFormat: {
75
+ type: import("vue").PropType<string>;
76
+ default: string;
77
+ };
78
+ }>> & {
79
+ "onUpdate:modelValue"?: (val: string | Date) => any;
80
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
81
+ "update:modelValue": (val: string | Date) => void;
82
+ }, string, {
83
+ testId: string;
84
+ modelValue: string | Date;
85
+ placeholder: string;
86
+ uniqueId: string | number;
87
+ allowFutureDates: boolean;
88
+ dateFormat: string;
89
+ }, {}, string> & {
90
+ beforeCreate?: (() => void) | (() => void)[];
91
+ created?: (() => void) | (() => void)[];
92
+ beforeMount?: (() => void) | (() => void)[];
93
+ mounted?: (() => void) | (() => void)[];
94
+ beforeUpdate?: (() => void) | (() => void)[];
95
+ updated?: (() => void) | (() => void)[];
96
+ activated?: (() => void) | (() => void)[];
97
+ deactivated?: (() => void) | (() => void)[];
98
+ beforeDestroy?: (() => void) | (() => void)[];
99
+ beforeUnmount?: (() => void) | (() => void)[];
100
+ destroyed?: (() => void) | (() => void)[];
101
+ unmounted?: (() => void) | (() => void)[];
102
+ renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
103
+ renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
104
+ errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}>, info: string) => boolean | void)[];
105
+ };
106
+ $forceUpdate: () => void;
107
+ $nextTick: typeof import("vue").nextTick;
108
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: import("vue").WatchOptions<boolean>): import("vue").WatchStopHandle;
109
+ } & Readonly<import("vue").ExtractPropTypes<{
110
+ testId: {
111
+ type: import("vue").PropType<string>;
112
+ default: string;
113
+ };
114
+ modelValue: {
115
+ type: import("vue").PropType<string | Date>;
116
+ default: any;
117
+ };
118
+ placeholder: {
119
+ type: import("vue").PropType<string>;
120
+ default: string;
121
+ };
122
+ uniqueId: {
123
+ type: import("vue").PropType<string | number>;
124
+ default: number;
125
+ };
126
+ allowFutureDates: {
127
+ type: import("vue").PropType<boolean>;
128
+ default: boolean;
129
+ };
130
+ dateFormat: {
131
+ type: import("vue").PropType<string>;
132
+ default: string;
133
+ };
134
+ }>> & {
135
+ "onUpdate:modelValue"?: (val: string | Date) => any;
136
+ } & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {};
137
+ __isFragment?: never;
138
+ __isTeleport?: never;
139
+ __isSuspense?: never;
140
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
141
+ testId: {
142
+ type: import("vue").PropType<string>;
143
+ default: string;
144
+ };
145
+ modelValue: {
146
+ type: import("vue").PropType<string | Date>;
147
+ default: any;
148
+ };
149
+ placeholder: {
150
+ type: import("vue").PropType<string>;
151
+ default: string;
152
+ };
153
+ uniqueId: {
154
+ type: import("vue").PropType<string | number>;
155
+ default: number;
156
+ };
157
+ allowFutureDates: {
158
+ type: import("vue").PropType<boolean>;
159
+ default: boolean;
160
+ };
161
+ dateFormat: {
162
+ type: import("vue").PropType<string>;
163
+ default: string;
164
+ };
165
+ }>> & {
166
+ "onUpdate:modelValue"?: (val: string | Date) => any;
167
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
168
+ "update:modelValue": (val: string | Date) => void;
169
+ }, string, {
170
+ testId: string;
171
+ modelValue: string | Date;
172
+ placeholder: string;
173
+ uniqueId: string | number;
174
+ allowFutureDates: boolean;
175
+ dateFormat: string;
176
+ }, {}, string> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
177
+ $slots: {
178
+ default?(_: {
179
+ formattedDate: any;
180
+ }): any;
181
+ };
182
+ }))[];
183
+ export { default as DatePicker } from './DatePickerV4.vue';
184
+ export { DatePickerTypes };
@@ -0,0 +1,17 @@
1
+ export declare const calendarMonthCommon: (props: any, emit: any) => {
2
+ isEndDay: (day: any) => boolean;
3
+ isStartDay: (day: any) => boolean;
4
+ updateSelection: () => void;
5
+ refreshDisabledDays: () => void;
6
+ getMinDateInMonth: () => Date;
7
+ getLastDayInRangeForMonth: (date: any, month: any) => any;
8
+ getFirstDayInRangeForMonth: (date: any, month: any) => any;
9
+ isMonthInRange: () => boolean;
10
+ navigate: (navigation: any) => void;
11
+ selectDay: (day: any) => void;
12
+ monthName: import("vue").ComputedRef<string>;
13
+ dayNames: string[];
14
+ selectedDays: import("vue").Ref<any[]>;
15
+ selectedDaysMap: import("vue").Ref<{}>;
16
+ inBetweenMap: import("vue").Ref<{}>;
17
+ };
@@ -0,0 +1,131 @@
1
+ import g from "./DateServices.common.js";
2
+ import { ref as d, computed as A, watch as D, onMounted as x } from "vue";
3
+ import { isBefore as C, isAfter as J, isSameDay as F } from "date-fns";
4
+ const j = (t, M) => {
5
+ const E = [
6
+ "January",
7
+ "February",
8
+ "March",
9
+ "April",
10
+ "May",
11
+ "June",
12
+ "July",
13
+ "August",
14
+ "September",
15
+ "October",
16
+ "November",
17
+ "December"
18
+ ], b = ["S", "M", "T", "W", "T", "F", "S"], l = d([]), i = d({}), s = d({}), Y = A(() => E[t.month]), w = (e) => {
19
+ e.value !== 0 && M("selectionChanged", e, t.month, t.year);
20
+ }, I = (e) => {
21
+ M("navigation", e);
22
+ }, S = () => {
23
+ if (!t.range.fromStart || !t.range.toEnd)
24
+ return !1;
25
+ const e = t.range.fromStart.getMonth(), n = t.range.fromStart.getFullYear(), r = t.range.toEnd.getMonth(), a = t.range.toEnd.getFullYear();
26
+ return t.year < n || t.year > a ? !1 : !(t.year === n && t.month < e || t.year === a && t.month > r);
27
+ }, f = (e, n) => e.getMonth() < n.month && e.getFullYear() === n.year || e.getFullYear() < n.year ? 1 : e.getMonth() === n.month && e.getFullYear() === n.year ? e.getDate() : g.daysInMonth(n.month, n.year), y = (e, n) => e.getMonth() > n.month && e.getFullYear() === n.year || e.getFullYear() > n.year ? g.daysInMonth(n.month, n.year) : e.getMonth() === n.month && e.getFullYear() === n.year ? e.getDate() : 1, v = () => {
28
+ if (t.allowedDays) {
29
+ const e = g.getCurrentTimeUTC();
30
+ e.setDate(e.getDate() - t.allowedDays + 1);
31
+ let n = e;
32
+ switch (t.type) {
33
+ case "week":
34
+ n = g.getFirstDayOfWeek(e);
35
+ break;
36
+ case "month":
37
+ n.setDate(1);
38
+ break;
39
+ }
40
+ return n.setHours(0, 0, 0, 0), n;
41
+ }
42
+ return null;
43
+ }, m = () => {
44
+ const e = v(), n = t.maxAllowedDate;
45
+ Object.keys(t.days).forEach((r) => {
46
+ const a = t.days[r];
47
+ e && C(a.date, e) || n && J(a.date, n) ? a.disabled = !0 : delete a.disabled;
48
+ });
49
+ }, u = (e, n, r, a) => {
50
+ t.year === e.getFullYear() && t.month === e.getMonth() && n >= r && n <= a && (i.value[n] = !0);
51
+ }, c = () => {
52
+ for (let e = 0; e < l.value.length; e++) {
53
+ const n = l.value[e];
54
+ delete i.value[n.value], delete s.value[n.value];
55
+ }
56
+ if (l.value = [], S()) {
57
+ const e = { month: t.month, year: t.year }, n = f(
58
+ t.range.fromStart,
59
+ e
60
+ ), r = y(
61
+ t.range.fromEnd,
62
+ e
63
+ ), a = f(
64
+ t.range.toStart,
65
+ e
66
+ ), h = y(
67
+ t.range.toEnd,
68
+ e
69
+ );
70
+ for (let o = n; o <= h; o++)
71
+ s.value[o] = !0, u(
72
+ t.range.fromStart,
73
+ o,
74
+ n,
75
+ r
76
+ ), u(
77
+ t.range.fromEnd,
78
+ o,
79
+ n,
80
+ r
81
+ ), u(
82
+ t.range.toStart,
83
+ o,
84
+ a,
85
+ h
86
+ ), u(
87
+ t.range.toEnd,
88
+ o,
89
+ a,
90
+ h
91
+ ), l.value.push(t.days[o]);
92
+ }
93
+ }, T = (e) => e.value === 0 ? !1 : F(e.date, t.range.fromStart), k = (e) => e.value === 0 ? !1 : F(e.date, t.range.toEnd);
94
+ return D(
95
+ () => t.month,
96
+ () => {
97
+ c();
98
+ }
99
+ ), D(
100
+ () => t.range,
101
+ (e, n) => {
102
+ e && e !== n && c();
103
+ }
104
+ ), D(
105
+ () => t.maxAllowedDate,
106
+ () => {
107
+ m();
108
+ }
109
+ ), x(() => {
110
+ m(), c();
111
+ }), {
112
+ isEndDay: k,
113
+ isStartDay: T,
114
+ updateSelection: c,
115
+ refreshDisabledDays: m,
116
+ getMinDateInMonth: v,
117
+ getLastDayInRangeForMonth: y,
118
+ getFirstDayInRangeForMonth: f,
119
+ isMonthInRange: S,
120
+ navigate: I,
121
+ selectDay: w,
122
+ monthName: Y,
123
+ dayNames: b,
124
+ selectedDays: l,
125
+ selectedDaysMap: i,
126
+ inBetweenMap: s
127
+ };
128
+ };
129
+ export {
130
+ j as calendarMonthCommon
131
+ };
@@ -0,0 +1,47 @@
1
+ export declare const dateRangeCommon: (props: any, emit: any) => {
2
+ datePicker: import("vue").Ref<HTMLDivElement>;
3
+ datePickerId: import("vue").ComputedRef<string>;
4
+ getMaxAllowedDate: import("vue").ComputedRef<Date>;
5
+ selectedPresetName: import("vue").ComputedRef<any>;
6
+ selectedPreset: import("vue").Ref<{}>;
7
+ displayError: import("vue").Ref<boolean>;
8
+ rangeType: any;
9
+ selectedRange: any;
10
+ placement: import("vue").Ref<string>;
11
+ currentDate: any;
12
+ error: any;
13
+ presets: import("vue").Ref<any[]>;
14
+ isOpen: import("vue").Ref<boolean>;
15
+ popup: any;
16
+ selectionStart: import("vue").Ref<{
17
+ started: boolean;
18
+ date: any;
19
+ }>;
20
+ initialized: import("vue").Ref<boolean>;
21
+ textDates: import("vue").Ref<{
22
+ from: any;
23
+ to: any;
24
+ }>;
25
+ currentMonths: import("vue").Ref<{}>;
26
+ displayedMonthsKeys: import("vue").Ref<any[]>;
27
+ initMonths: () => void;
28
+ changeType: (type: any, resetDate?: any) => void;
29
+ presetChanged: (selectedObj: any) => void;
30
+ initRange: (newValue: any, selectionNotCompleted?: boolean) => boolean;
31
+ setCurrentDate: () => void;
32
+ apply: () => void;
33
+ getNavigation: (isFirst: any, isLast: any) => "previous" | "next";
34
+ navigationCallback: (direction: any) => void;
35
+ getSelectedRangeByType: (dateRange: {
36
+ from: Date;
37
+ to: Date;
38
+ }) => any;
39
+ compareDates: (dateA: Date, dateB: Date) => boolean;
40
+ determinePreset: (range: any) => void;
41
+ selectionChanged: (day: any, month: any, year: any) => void;
42
+ checkPlacement: () => "left" | "right";
43
+ toggle: (dismiss?: boolean) => void;
44
+ closeDatePicker: () => void;
45
+ isCompact: import("vue").ComputedRef<any>;
46
+ init: () => void;
47
+ };
@@ -0,0 +1,265 @@
1
+ import { onClickOutside as ie } from "@vueuse/core";
2
+ import { useToggle as fe } from "../../../composables/useToggle.js";
3
+ import { ref as r, computed as b, onMounted as ce, onBeforeMount as de, onUnmounted as ve, watch as Q } from "vue";
4
+ import { min as me, addDays as ge, format as X } from "date-fns";
5
+ import { presetsList as he, formatError as De, mandatoryValuesError as Me, navigatePrev as Z, navigateNext as V } from "./consts.common.js";
6
+ import m from "./DateServices.common.js";
7
+ const Te = (o, y) => {
8
+ const N = r(null), c = r({ started: !1, date: null }), x = r(!1), _ = 2, S = r({ from: null, to: null }), s = r({}), g = r([]), k = r(null), f = r({}), T = r({}), w = r(!1), P = r(null), u = r(null), j = r("left"), p = r(null), O = r(null), E = r([]), K = r(null), [h] = fe({ initialValue: !1 }), q = r(null);
9
+ ie(q, () => {
10
+ h.value = !1;
11
+ });
12
+ const L = (e, t) => {
13
+ const a = {
14
+ weeks: [],
15
+ days: {},
16
+ month: e,
17
+ year: t
18
+ };
19
+ let n, l;
20
+ const d = new Date(t, e, 1).getDay();
21
+ let v = 1;
22
+ const i = /* @__PURE__ */ new Date();
23
+ i.setHours(0, 0, 0, 0);
24
+ const se = m.daysInMonth(e, t);
25
+ for (let I = 0; I < 6; I++) {
26
+ l = [];
27
+ for (let H = 0; H < 7; H++)
28
+ n = {}, I === 0 && d > 0 && H < d && (n.value = 0), v > se && (n.value = 0), !n.value && n.value !== 0 && (n.value = v, v += 1, a.days[n.value] = n, n.date = new Date(t, e, n.value), i < n.date ? n.isFuture = !0 : n.date.getTime() === i.getTime() && (n.isToday = !0, o.includeToday || (n.disabled = !0))), l.push(n);
29
+ a.weeks.push(l);
30
+ }
31
+ return a;
32
+ }, C = () => {
33
+ let e = m.getCurrentTimeUTC();
34
+ if (u.value && u.value.toEnd ? e = u.value.toEnd : o.range && o.range.to && (e = o.range.to), !s.value[`${e.getFullYear().toString()}_${e.getMonth().toString()}`]) {
35
+ s.value = {}, g.value = [];
36
+ for (let t = 0; t < _; t++) {
37
+ const a = new Date(e);
38
+ a.setDate(1), a.setMonth(e.getMonth() - t);
39
+ const n = `${a.getFullYear().toString()}_${a.getMonth().toString()}`;
40
+ s.value[n] = {
41
+ parsedMonth: L(
42
+ a.getMonth(),
43
+ a.getFullYear()
44
+ ),
45
+ order: t
46
+ }, g.value.unshift(n);
47
+ }
48
+ }
49
+ }, z = (e, t) => {
50
+ P.value = e;
51
+ let a = e;
52
+ e === "date" && (a = o.datePresetList), E.value = he[a], t && (u.value = {
53
+ fromStart: null,
54
+ fromEnd: null,
55
+ toStart: null,
56
+ toEnd: null
57
+ }, S.value.from = "", S.value.to = "", c.value = { started: !1, date: null }, f.value = "custom"), y("rangeTypeChanged", P.value);
58
+ }, ee = (e) => {
59
+ f.value = e.id, D(k.value[e.id].dates()), C();
60
+ }, D = (e, t = !1) => {
61
+ let a = e;
62
+ return (!e || !e.from && !e.to) && (a = k.value[E.value[0]]), o.maxDaysInRange && (K.value = t ? ge(a.from, o.maxDaysInRange) : null), w.value = !1, !a.from || !a.to || !(a.from instanceof Date) || !(a.to instanceof Date) ? (O.value = De, w.value = !0, !1) : a.from > a.to ? (O.value = `"From" date can't be bigger than "To" date`, w.value = !0, !1) : (u.value = R(a), S.value.from = X(
63
+ u.value.fromStart,
64
+ o.dateFormat
65
+ ), S.value.to = X(u.value.toEnd, o.dateFormat), !0);
66
+ }, F = () => {
67
+ f.value === "custom" ? p.value = m.getDateRangeString(u.value) : p.value = J.value, y("currentDateChanged", p.value);
68
+ }, te = () => {
69
+ if (u.value.fromStart == null || u.value.toEnd == null) {
70
+ w.value = !0, O.value = Me;
71
+ return;
72
+ }
73
+ const e = m.getCurrentTimeUTC();
74
+ u.value.toEnd > e && (u.value.toEnd = e), F(), T.value = f.value, y("rangeChanged", {
75
+ from: u.value.fromStart,
76
+ to: u.value.toEnd,
77
+ preset: T.value
78
+ }), W(!1);
79
+ }, ae = (e, t) => e ? Z : t ? V : null, ne = (e) => {
80
+ let t = null, a = null;
81
+ const n = _ - 1;
82
+ let l = "", M = null, d = null;
83
+ switch (e) {
84
+ case V:
85
+ Object.keys(s.value).forEach((v) => {
86
+ const i = s.value[v];
87
+ i.order === 0 && (M = i), i.order === n ? (g.value.splice(
88
+ g.value.indexOf(v),
89
+ 1
90
+ ), delete s.value[v]) : i.order += 1;
91
+ }), t = M.parsedMonth.month + 1, a = M.parsedMonth.year, t > 11 && (t = 0, a += 1), l = `${a.toString()}_${t.toString()}`, s.value[l] = {
92
+ parsedMonth: L(t, a),
93
+ order: 0
94
+ }, g.value.push(l);
95
+ break;
96
+ case Z:
97
+ Object.keys(s.value).forEach((v) => {
98
+ const i = s.value[v];
99
+ i.order === n && (d = i), i.order === 0 ? (g.value.splice(
100
+ g.value.indexOf(v),
101
+ 1
102
+ ), delete s.value[v]) : i.order -= 1;
103
+ }), t = d.parsedMonth.month - 1, a = d.parsedMonth.year, t < 0 && (t = 11, a -= 1), l = `${a.toString()}_${t.toString()}`, s.value[l] = {
104
+ parsedMonth: L(t, a),
105
+ order: n
106
+ }, g.value.unshift(l);
107
+ break;
108
+ }
109
+ }, R = (e) => {
110
+ let t;
111
+ switch (P.value) {
112
+ case "week":
113
+ t = {
114
+ fromStart: m.getFirstDayOfWeek(e.from),
115
+ fromEnd: m.getLastDayOfWeek(e.from),
116
+ toStart: m.getFirstDayOfWeek(e.to),
117
+ toEnd: m.getLastDayOfWeek(e.to)
118
+ };
119
+ break;
120
+ case "month":
121
+ t = {
122
+ fromStart: new Date(
123
+ e.from.getFullYear(),
124
+ e.from.getMonth(),
125
+ 1
126
+ ),
127
+ fromEnd: m.getLastDayOfMonth(e.from),
128
+ toStart: new Date(
129
+ e.to.getFullYear(),
130
+ e.to.getMonth(),
131
+ 1
132
+ ),
133
+ toEnd: m.getLastDayOfMonth(e.to)
134
+ };
135
+ break;
136
+ case "date":
137
+ default:
138
+ t = {
139
+ fromStart: e.from,
140
+ fromEnd: e.from,
141
+ toStart: e.to,
142
+ toEnd: e.to
143
+ };
144
+ break;
145
+ }
146
+ return t;
147
+ }, U = (e, t) => e.getUTCFullYear() === t.getUTCFullYear() && e.getUTCMonth() === t.getUTCMonth() && e.getUTCDate() === t.getUTCDate(), $ = (e) => {
148
+ let t = !1;
149
+ const a = {
150
+ from: new Date(e.from),
151
+ to: new Date(e.to)
152
+ };
153
+ a.from.setHours(0, 0, 0, 0), a.to.setHours(0, 0, 0, 0);
154
+ const n = E.value.map((l) => l.id);
155
+ if (Object.keys(k.value).forEach((l) => {
156
+ const M = k.value[l];
157
+ if (l !== "custom" && !t && n.indexOf(l) !== -1) {
158
+ const d = M.dates();
159
+ d.from.setHours(0, 0, 0, 0), d.to.setHours(0, 0, 0, 0), U(d.from, a.from) && U(d.to, a.to) && (f.value = l, t = !0);
160
+ }
161
+ }), t) {
162
+ const l = E.value.find(
163
+ (M) => M.id === f.value
164
+ );
165
+ y("dateRangePresetNameChanged", l.name);
166
+ } else
167
+ y("dateRangePresetNameChanged", null), f.value = "custom";
168
+ T.value = f.value;
169
+ }, A = (e, t, a) => {
170
+ if (!c.value.started)
171
+ f.value = "custom", c.value.started = !0, c.value.date = new Date(a, t, e.value), D(
172
+ { from: c.value.date, to: c.value.date },
173
+ !0
174
+ );
175
+ else {
176
+ const n = new Date(a, t, e.value), l = c.value.date;
177
+ c.value.started = !1, c.value.date = null, n < l ? A(e, t, a) : D({ from: l, to: n });
178
+ }
179
+ }, B = () => {
180
+ const e = N.value.offsetLeft;
181
+ return window.innerWidth - e > 930 ? "left" : "right";
182
+ }, W = (e = !0) => {
183
+ h.value = !h.value, h.value ? (j.value = B(), D(o.range), C(), y("opened")) : (D(o.range), C(), f.value = T.value, e && y("dismissed"));
184
+ }, G = () => {
185
+ h.value && W();
186
+ }, le = () => {
187
+ k.value = m.getPresetsFunctions(o.includeToday), k.value.custom = {
188
+ dates: () => o.range
189
+ };
190
+ }, oe = b(() => (g.value || []).reduce((e, t) => {
191
+ const n = s.value[t].parsedMonth.weeks[s.value[t].parsedMonth.weeks.length - 1].filter(
192
+ (l) => l.value !== 0
193
+ ).length;
194
+ return e && !n;
195
+ }, !0)), Y = () => {
196
+ o.range && (x.value = !0, z(o.initialType || o.types[0]), le(), $(o.range), D(o.range), C(), F());
197
+ };
198
+ ce(() => {
199
+ Y();
200
+ }), de(() => {
201
+ const e = (t) => {
202
+ t.key === "Escape" && h.value && G();
203
+ };
204
+ document.addEventListener("keyup", e), ve(() => {
205
+ document.removeEventListener("keyup", e);
206
+ });
207
+ }), Q(
208
+ () => o.range,
209
+ (e, t) => {
210
+ e && e !== t && (x.value ? ($(e), D(e), F()) : Y());
211
+ }
212
+ ), Q(h, (e) => {
213
+ e || (c.value.started = !1);
214
+ });
215
+ const J = b(() => {
216
+ const e = E.value.find(
217
+ (t) => t.id === f.value
218
+ );
219
+ return e ? e.name : "";
220
+ }), re = b(() => `datepicker${o.uniqueId}`), ue = b(() => {
221
+ const e = [o.maxDate, K.value].filter((t) => t);
222
+ return e.length ? me(e) : null;
223
+ });
224
+ return {
225
+ datePicker: N,
226
+ datePickerId: re,
227
+ getMaxAllowedDate: ue,
228
+ selectedPresetName: J,
229
+ selectedPreset: f,
230
+ displayError: w,
231
+ rangeType: P,
232
+ selectedRange: u,
233
+ placement: j,
234
+ currentDate: p,
235
+ error: O,
236
+ presets: E,
237
+ isOpen: h,
238
+ popup: q,
239
+ selectionStart: c,
240
+ initialized: x,
241
+ textDates: S,
242
+ currentMonths: s,
243
+ displayedMonthsKeys: g,
244
+ initMonths: C,
245
+ changeType: z,
246
+ presetChanged: ee,
247
+ initRange: D,
248
+ setCurrentDate: F,
249
+ apply: te,
250
+ getNavigation: ae,
251
+ navigationCallback: ne,
252
+ getSelectedRangeByType: R,
253
+ compareDates: U,
254
+ determinePreset: $,
255
+ selectionChanged: A,
256
+ checkPlacement: B,
257
+ toggle: W,
258
+ closeDatePicker: G,
259
+ isCompact: oe,
260
+ init: Y
261
+ };
262
+ };
263
+ export {
264
+ Te as dateRangeCommon
265
+ };
@@ -0,0 +1,3 @@
1
+ export declare const DateRangePickerCommon: (props: any) => {
2
+ componentId: import("vue").ComputedRef<string>;
3
+ };
@@ -1,4 +1,4 @@
1
- import { Day } from './DateServices';
1
+ import { Day } from '../common/DateServices.common';
2
2
  declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
3
3
  year: number;
4
4
  days: Record<string, Day>;
@@ -0,0 +1,7 @@
1
+ import o from "./CalendarMonth.vue2.js";
2
+ /* empty css */import e from "../../../_virtual/_plugin-vue_export-helper.js";
3
+ // import "../../../CalendarMonth.vue_vue_type_style_index_0_scoped_acd3440c_lang.css"; //*');
4
+ const c = /* @__PURE__ */ e(o, [["__scopeId", "data-v-acd3440c"]]);
5
+ export {
6
+ c as default
7
+ };