@ironsource/shared-ui 2.2.0-rc.18 → 2.2.0-rc.19

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.
@@ -1 +1,148 @@
1
- import "../../../CalendarMonth.vue_vue_type_style_index_0_scoped_a44769fd_lang.css";
1
+ import "../../../CalendarMonth.vue_vue_type_style_index_0_scoped_a44769fd_lang.css"; import { defineComponent as z, openBlock as d, createElementBlock as s, unref as t, createElementVNode as o, createBlock as m, withCtx as l, createVNode as r, createCommentVNode as y, createTextVNode as v, toDisplayString as c, Fragment as $, renderList as g, normalizeClass as B } from "vue";
2
+ import { navigatePrev as D, navigateNext as E } from "../common/consts.common.js";
3
+ import S from "../../typography/Heading.vue.js";
4
+ import h from "../../typography/Text.vue.js";
5
+ import { calendarMonthCommon as V } from "../common/CalendarMonth.common.js";
6
+ import "../../button/v3/Button.vue.js";
7
+ import C from "../../button/v3/IconButton.vue.js";
8
+ import "../../button/v3/ScrollButton.vue.js";
9
+ import F from "../../icon/v3/icons/AngleLeft.vue.js";
10
+ import O from "../../icon/v3/icons/AngleRight.vue.js";
11
+ import I from "../../icon/v3/Icon.vue.js";
12
+ import { CalendarMonthTestIdModifiers as n } from "../../../testids/index.js";
13
+ const Y = ["id", "data-testid"], L = ["data-testid"], W = ["data-testid"], X = ["data-testid"], nt = /* @__PURE__ */ z({
14
+ __name: "CalendarMonth",
15
+ props: {
16
+ year: null,
17
+ days: null,
18
+ weeks: null,
19
+ month: null,
20
+ navigation: null,
21
+ range: null,
22
+ type: null,
23
+ id: { default: Date.now() },
24
+ allowedDays: { default: null },
25
+ maxAllowedDate: { default: null },
26
+ minAllowedDate: { default: null },
27
+ testId: { default: "" }
28
+ },
29
+ emits: ["selectionChanged", "navigation"],
30
+ setup(e, { emit: A }) {
31
+ const w = e, {
32
+ isEndDay: N,
33
+ isStartDay: x,
34
+ navigate: k,
35
+ selectDay: R,
36
+ monthName: T,
37
+ dayNames: M,
38
+ selectedDaysMap: b,
39
+ inBetweenMap: H
40
+ } = V(w, A);
41
+ return (U, u) => (d(), s("div", {
42
+ id: "datepickerCalendar" + e.id,
43
+ class: "calendar-month",
44
+ "data-testid": `${e.testId}-${t(n).WRAPPER}`
45
+ }, [
46
+ o("span", {
47
+ onClick: u[0] || (u[0] = (i) => t(k)(t(D)))
48
+ }, [
49
+ e.navigation === t(D) || e.navigation === "all" ? (d(), m(t(C), {
50
+ key: 0,
51
+ variant: "borderless",
52
+ size: "md",
53
+ class: "previous",
54
+ "data-testid": `${e.testId}-${t(n).PREVIOUS}`
55
+ }, {
56
+ default: l(() => [
57
+ r(I, null, {
58
+ default: l(() => [
59
+ r(F)
60
+ ]),
61
+ _: 1
62
+ })
63
+ ]),
64
+ _: 1
65
+ }, 8, ["data-testid"])) : y("", !0)
66
+ ]),
67
+ o("span", {
68
+ onClick: u[1] || (u[1] = (i) => t(k)(t(E)))
69
+ }, [
70
+ e.navigation === t(E) || e.navigation === "all" ? (d(), m(t(C), {
71
+ key: 0,
72
+ class: "next",
73
+ variant: "borderless",
74
+ size: "md",
75
+ "data-testid": `${e.testId}-${t(n).NEXT}`
76
+ }, {
77
+ default: l(() => [
78
+ r(I, null, {
79
+ default: l(() => [
80
+ r(O)
81
+ ]),
82
+ _: 1
83
+ })
84
+ ]),
85
+ _: 1
86
+ }, 8, ["data-testid"])) : y("", !0)
87
+ ]),
88
+ o("div", {
89
+ class: "month-header",
90
+ "data-testid": `${e.testId}-${t(n).MONTH_HEADER}`
91
+ }, [
92
+ r(S, {
93
+ level: "6",
94
+ "test-id": `${e.testId}-${t(n).MONTH_HEADER_TEXT}`
95
+ }, {
96
+ default: l(() => [
97
+ v(c(t(T)) + " " + c(e.year), 1)
98
+ ]),
99
+ _: 1
100
+ }, 8, ["test-id"]),
101
+ o("div", {
102
+ class: "days-header",
103
+ "data-testid": `${e.testId}-${t(n).DAYS_HEADER}`
104
+ }, [
105
+ (d(!0), s($, null, g(t(M), (i, f) => (d(), m(t(h), {
106
+ key: f,
107
+ size: "xs"
108
+ }, {
109
+ default: l(() => [
110
+ v(c(i), 1)
111
+ ]),
112
+ _: 2
113
+ }, 1024))), 128))
114
+ ], 8, W)
115
+ ], 8, L),
116
+ o("div", {
117
+ class: "days-wrapper",
118
+ "data-testid": `${e.testId}-${t(n).DAYS_WRAPPER}`
119
+ }, [
120
+ (d(!0), s($, null, g(e.weeks, (i, f) => (d(), s("div", { key: f }, [
121
+ (d(!0), s($, null, g(i, (a, P) => (d(), m(t(h), {
122
+ key: P,
123
+ class: B(["day", {
124
+ "selected-day": t(b)[a.value],
125
+ "selected-day-between": t(H)[a.value],
126
+ today: a.isToday,
127
+ "disabled-day": a.isFuture || a.disabled,
128
+ "non-day": a.value === 0,
129
+ "start-day": t(x)(a),
130
+ "end-day": t(N)(a)
131
+ }]),
132
+ size: "sm",
133
+ "data-testid": `${e.testId}-${t(n).DAY}-${a.value}`,
134
+ onClick: (j) => a.disabled || a.isFuture || t(R)(a)
135
+ }, {
136
+ default: l(() => [
137
+ v(c(a.value), 1)
138
+ ]),
139
+ _: 2
140
+ }, 1032, ["class", "data-testid", "onClick"]))), 128))
141
+ ]))), 128))
142
+ ], 8, X)
143
+ ], 8, Y));
144
+ }
145
+ });
146
+ export {
147
+ nt as default
148
+ };
@@ -1 +1,273 @@
1
- import "../../../DateRangeV4.vue_vue_type_style_index_0_scoped_f8826716_lang.css";
1
+ import "../../../DateRangeV4.vue_vue_type_style_index_0_scoped_f8826716_lang.css"; import { defineComponent as Q, watch as X, openBlock as n, createElementBlock as i, unref as e, normalizeClass as r, createElementVNode as d, renderSlot as x, createVNode as s, withDirectives as v, Fragment as k, renderList as C, withCtx as o, createTextVNode as m, toDisplayString as g, createCommentVNode as A, vShow as $, normalizeStyle as Z, setBlockTracking as E } from "vue";
2
+ import _ from "./CalendarMonthV4.vue.js";
3
+ import { typeToName as ee, messagePerType as te } from "../common/consts.common.js";
4
+ import R from "../../button/v4/ButtonV4.vue.js";
5
+ import "../../button/v4/IconButtonV4.vue.js";
6
+ import "../../button/v4/ButtonGroup.vue.js";
7
+ import "../../button/v4/ToggleButtonGroupAB.vue.js";
8
+ import "../../dropdown/v4/DropdownV4.vue.js";
9
+ import "../../dropdown/v4/DefaultDropdownTrigger.vue.js";
10
+ import "../../dropdown/v4/IconButtonDropdownTrigger.vue.js";
11
+ import "../../dropdown/v4/ChipDropdownTrigger.vue.js";
12
+ import "../../dropdown/v4/AppDropdownTrigger.vue.js";
13
+ import "../../dropdown/v4/ButtonDropdownTrigger.vue.js";
14
+ import ae from "../../dropdown/v4/ButtonFilterDropdownTrigger.vue.js";
15
+ import "../../dropdown/v4/TreeDropdown.vue.js";
16
+ import "../../dropdown/v4/OptionV4.vue.js";
17
+ import "../../dropdown/v4/ConditionalDropdown.vue.js";
18
+ import { DateRangeTestIdModifiers as l, DatePickerTestIdModifiers as de } from "../../../testids/index.js";
19
+ import { dateRangeCommon as ne } from "../common/DateRange.common.js";
20
+ import p from "../../typography/v4/Typography.vue.js";
21
+ const ie = ["id", "data-testid"], se = ["data-testid"], le = ["id", "data-testid"], oe = {
22
+ key: 0,
23
+ class: "type-picker"
24
+ }, re = ["onClick"], ue = ["data-testid"], ce = ["id"], me = ["id"], pe = ["onClick"], ye = { class: "dropdown-rightTriangle" }, ge = ["data-testid"], fe = { class: "date-picker-calendar left-box" }, he = { class: "buttons-cover" }, ve = { class: "range" }, ke = { class: "text-container" }, ze = /* @__PURE__ */ Q({
25
+ __name: "DateRangeV4",
26
+ props: {
27
+ range: null,
28
+ types: { default: () => ["date"] },
29
+ includeToday: { type: Boolean, default: !0 },
30
+ allowedDays: { default: null },
31
+ maxDaysInRange: { default: null },
32
+ datePresetList: { default: "date" },
33
+ regex: { default: () => /^(1[0-2]|0?[1-9])\/[\d]{1,2}\/[\d]{4}$/ },
34
+ dateFormat: { default: "mm/dd/yyyy" },
35
+ uniqueId: { default: Date.now() },
36
+ disabled: { type: Boolean, default: !1 },
37
+ initialType: { default: null },
38
+ openOnTop: { type: Boolean, default: !1 },
39
+ showPresets: { type: Boolean, default: !0 },
40
+ maxDate: { default: null },
41
+ minDate: { default: null },
42
+ testId: { default: "" }
43
+ },
44
+ emits: [
45
+ "rangeTypeChanged",
46
+ "currentDateChanged",
47
+ "rangeChanged",
48
+ "dateRangePresetNameChanged",
49
+ "opened",
50
+ "dismissed"
51
+ ],
52
+ setup(t, { emit: M }) {
53
+ const w = t, {
54
+ datePicker: B,
55
+ datePickerId: S,
56
+ getMaxAllowedDate: q,
57
+ getMinAllowedDate: O,
58
+ selectedPreset: I,
59
+ displayError: L,
60
+ rangeType: f,
61
+ selectedRange: V,
62
+ placement: z,
63
+ currentDate: T,
64
+ error: U,
65
+ presets: F,
66
+ isOpen: h,
67
+ popup: G,
68
+ currentMonths: y,
69
+ displayedMonthsKeys: D,
70
+ changeType: b,
71
+ presetChanged: K,
72
+ apply: W,
73
+ getNavigation: Y,
74
+ navigationCallback: j,
75
+ selectionChanged: H,
76
+ toggle: P,
77
+ isCompact: J
78
+ } = ne(w, M);
79
+ return X(
80
+ () => w.datePresetList,
81
+ () => {
82
+ b("date", !1);
83
+ }
84
+ ), (N, u) => (n(), i("div", {
85
+ id: e(S),
86
+ ref_key: "datePicker",
87
+ ref: B,
88
+ class: r(["relative-wrap", { "date-range-disabled": t.disabled }]),
89
+ "data-testid": `${t.testId}-${e(l).WRAPPER}`
90
+ }, [
91
+ d("div", {
92
+ class: "date-range-field",
93
+ "data-testid": `${t.testId}-${e(l).TRIGGER}`,
94
+ onClick: u[0] || (u[0] = (a) => e(P)())
95
+ }, [
96
+ x(N.$slots, "field", {
97
+ currentDate: e(T),
98
+ isOpen: e(h)
99
+ }, () => [
100
+ s(e(ae), {
101
+ label: e(T),
102
+ "start-icon-name": "calendar-blank",
103
+ variant: "outlined",
104
+ "test-id": `${t.testId}-${e(de).INPUT}`,
105
+ open: e(h)
106
+ }, null, 8, ["label", "test-id", "open"])
107
+ ], !0)
108
+ ], 8, se),
109
+ v(d("div", {
110
+ id: "datepickerPopup" + t.uniqueId,
111
+ ref_key: "popup",
112
+ ref: G,
113
+ class: r(["pop-up", [
114
+ e(z),
115
+ t.openOnTop ? "open-on-top" : "",
116
+ t.showPresets ? "" : "hide-presets"
117
+ ]]),
118
+ "data-testid": `${t.testId}-${e(l).CONTAINER}`
119
+ }, [
120
+ t.types.length > 1 ? (n(), i("div", oe, [
121
+ (n(!0), i(k, null, C(t.types, (a) => (n(), i("span", {
122
+ key: a,
123
+ class: r(["range-type", { "selected-range-type": e(f) === a }]),
124
+ onClick: (c) => e(b)(a, !0)
125
+ }, [
126
+ s(e(p), { variant: "h1" }, {
127
+ default: o(() => [
128
+ m(g(e(ee)[a]), 1)
129
+ ]),
130
+ _: 2
131
+ }, 1024)
132
+ ], 10, re))), 128))
133
+ ])) : A("", !0),
134
+ d("div", {
135
+ class: r(["flex", { "pop-up-content": t.types.length > 1 }])
136
+ }, [
137
+ t.showPresets ? (n(), i("div", {
138
+ key: 0,
139
+ class: "date-picker-menu",
140
+ "data-testid": `${t.testId}-${e(l).MENU}`
141
+ }, [
142
+ d("div", {
143
+ id: "presets" + t.uniqueId,
144
+ class: "preset-dropdown"
145
+ }, [
146
+ d("ul", {
147
+ id: "customDropDownList" + t.uniqueId
148
+ }, [
149
+ (n(!0), i(k, null, C(e(F), (a) => (n(), i("li", {
150
+ key: a.id,
151
+ class: r({
152
+ "selected-preset-container": e(I) === a.id
153
+ })
154
+ }, [
155
+ d("div", {
156
+ class: r([{ "selected-preset": e(I) === a.id }, "preset-element"]),
157
+ onClick: (c) => e(K)(a)
158
+ }, [
159
+ s(e(p), {
160
+ variant: "body2",
161
+ "data-testid": `${t.testId}-${e(l).MENU}-${a.id}`
162
+ }, {
163
+ default: o(() => [
164
+ m(g(a.name), 1)
165
+ ]),
166
+ _: 2
167
+ }, 1032, ["data-testid"])
168
+ ], 10, pe),
169
+ v(d("div", ye, null, 512), [
170
+ [$, a.id === "custom"]
171
+ ])
172
+ ], 2))), 128))
173
+ ], 8, me)
174
+ ], 8, ce),
175
+ d("div", {
176
+ class: "type-message",
177
+ "data-testid": `${t.testId}-${e(l).MESSAGE}`
178
+ }, g(e(te)[e(f)]), 9, ge)
179
+ ], 8, ue)) : A("", !0),
180
+ d("div", {
181
+ class: "calendar-wrap",
182
+ style: Z({ height: e(J) ? "336px" : "372px" })
183
+ }, [
184
+ d("div", fe, [
185
+ (n(!0), i(k, null, C(e(D), (a, c) => (n(), i("div", { key: a }, [
186
+ s(_, {
187
+ id: t.uniqueId,
188
+ navigation: e(Y)(
189
+ c === 0,
190
+ c === e(D).length - 1
191
+ ),
192
+ year: e(y)[a].parsedMonth.year,
193
+ days: e(y)[a].parsedMonth.days,
194
+ weeks: e(y)[a].parsedMonth.weeks,
195
+ month: e(y)[a].parsedMonth.month,
196
+ range: e(V),
197
+ type: e(f),
198
+ "allowed-days": t.allowedDays,
199
+ "max-allowed-date": e(q),
200
+ "min-allowed-date": e(O),
201
+ "test-id": `${t.testId}-${c}`,
202
+ onSelectionChanged: e(H),
203
+ onNavigation: e(j)
204
+ }, null, 8, ["id", "navigation", "year", "days", "weeks", "month", "range", "type", "allowed-days", "max-allowed-date", "min-allowed-date", "test-id", "onSelectionChanged", "onNavigation"])
205
+ ]))), 128)),
206
+ d("div", he, [
207
+ d("div", ve, [
208
+ x(N.$slots, "footer", {}, void 0, !0)
209
+ ]),
210
+ d("div", ke, [
211
+ s(e(p), { variant: "body2" }, {
212
+ default: o(() => [
213
+ m("All dates are in UTC")
214
+ ]),
215
+ _: 1
216
+ })
217
+ ]),
218
+ v(d("div", { class: "error" }, g(e(U)), 513), [
219
+ [$, e(L)]
220
+ ]),
221
+ u[1] || (E(-1), u[1] = d("div", { class: "buttons" }, [
222
+ s(e(R), {
223
+ id: "button-ok" + t.uniqueId,
224
+ size: "small",
225
+ class: "button",
226
+ color: "primary",
227
+ "data-testid": `${t.testId}-${e(l).ACTION_APPLY}`,
228
+ onClick: (a) => e(W)()
229
+ }, {
230
+ default: o(() => [
231
+ s(e(p), { variant: "button" }, {
232
+ default: o(() => [
233
+ m("Apply")
234
+ ]),
235
+ _: 1
236
+ })
237
+ ]),
238
+ _: 1
239
+ }, 8, ["id", "data-testid", "onClick"]),
240
+ s(e(R), {
241
+ id: "button-cancel" + t.uniqueId,
242
+ size: "small",
243
+ theme: "third",
244
+ color: "default",
245
+ variant: "outlined",
246
+ class: "button",
247
+ "data-testid": `${t.testId}-${e(l).ACTION_CANCEL}`,
248
+ onClick: (a) => e(P)()
249
+ }, {
250
+ default: o(() => [
251
+ s(e(p), { variant: "button" }, {
252
+ default: o(() => [
253
+ m(" Cancel ")
254
+ ]),
255
+ _: 1
256
+ })
257
+ ]),
258
+ _: 1
259
+ }, 8, ["id", "data-testid", "onClick"])
260
+ ]), E(1), u[1])
261
+ ])
262
+ ])
263
+ ], 4)
264
+ ], 2)
265
+ ], 10, le), [
266
+ [$, e(h)]
267
+ ])
268
+ ], 10, ie));
269
+ }
270
+ });
271
+ export {
272
+ ze as default
273
+ };
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import './FilterDropdown.vue_vue_type_style_index_0_scoped_b42d8b45_lang.css';
1
+ import './AppTrigger.vue_vue_type_style_index_0_scoped_121aac8b_lang.css';
2
2
  import { AppTriggerTypes as eo } from "./components/appTrigger/index.js";
3
3
  import { AutocompleteDropdownTypes as mo } from "./components/autocompleteDropdown/index.js";
4
4
  import { MenuItemTypes as ao } from "./components/menuItem/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ironsource/shared-ui",
3
- "version": "2.2.0-rc.18",
3
+ "version": "2.2.0-rc.19",
4
4
  "engines": {
5
5
  "npm": ">=7.0.0",
6
6
  "node": ">=16.0.0"