@ironsource/shared-ui 2.1.7-test.1 → 2.1.7-test.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 (63) hide show
  1. package/Autocomplete.vue_vue_type_style_index_0_scoped_e361f9fd_lang.css +1 -0
  2. package/Chart.vue_vue_type_style_index_0_scoped_f06a4764_lang.css +1 -0
  3. package/ChartHeader.vue_vue_type_style_index_0_scoped_88d4532f_lang.css +1 -0
  4. package/ChartLegend.vue_vue_type_style_index_0_scoped_efc608f9_lang.css +1 -0
  5. package/ChartLoader.vue_vue_type_style_index_0_scoped_142c444a_lang.css +1 -0
  6. package/ChartTooltip.vue_vue_type_style_index_0_scoped_ec636f18_lang.css +1 -0
  7. package/FieldMaxLength.vue_vue_type_style_index_0_scoped_47877984_lang.css +1 -0
  8. package/SortableItem.vue_vue_type_style_index_0_scoped_9dd4d372_lang.css +1 -0
  9. package/SortableItemLabel.vue_vue_type_style_index_0_scoped_1386ae20_lang.css +1 -0
  10. package/SortableList.vue_vue_type_style_index_0_scoped_21842d59_lang.css +1 -0
  11. package/TextAreaV4.vue_vue_type_style_index_0_scoped_4114ef89_lang.css +1 -0
  12. package/TextField.vue_vue_type_style_index_0_scoped_eb472aa3_lang.css +1 -0
  13. package/components/autocomplete/Autocomplete.vue.d.ts +5 -0
  14. package/components/autocomplete/Autocomplete.vue.js +2 -2
  15. package/components/autocomplete/Autocomplete.vue2.js +57 -45
  16. package/components/autocomplete/index.d.ts +20 -1
  17. package/components/chart/Chart.vue.js +7 -0
  18. package/components/chart/Chart.vue2.js +281 -0
  19. package/components/chart/ChartHeader.vue.js +7 -0
  20. package/components/chart/ChartHeader.vue2.js +51 -0
  21. package/components/chart/ChartLegend.vue.js +7 -0
  22. package/components/chart/ChartLegend.vue2.js +65 -0
  23. package/components/chart/ChartLoader.vue.js +25 -0
  24. package/components/chart/ChartLoader.vue2.js +0 -0
  25. package/components/chart/ChartTooltip.vue.js +7 -0
  26. package/components/chart/ChartTooltip.vue2.js +81 -0
  27. package/components/chart/composables/useChartValues.js +32 -0
  28. package/components/chart/composables/useTooltipPosition.js +22 -0
  29. package/components/chart/consts.js +21 -0
  30. package/components/chart/index.js +6 -0
  31. package/components/chart/plugins/HoverVerticalLine.js +12 -0
  32. package/components/chart/types.js +4 -0
  33. package/components/chart/utils/formatNumber.js +11 -0
  34. package/components/chart/utils/utils.js +12 -0
  35. package/components/input/v4/TextField.vue.d.ts +6 -1
  36. package/components/input/v4/TextField.vue.js +3 -3
  37. package/components/input/v4/TextField.vue2.js +95 -90
  38. package/components/input/v4/index.d.ts +20 -1
  39. package/components/shared/FieldMaxLength.vue.js +3 -3
  40. package/components/shared/FieldMaxLength.vue2.js +2 -2
  41. package/components/shared/commonTypes.d.ts +2 -0
  42. package/components/sortableList/SortableItem.vue.js +7 -0
  43. package/components/sortableList/SortableItem.vue2.js +140 -0
  44. package/components/sortableList/SortableItemLabel.vue.js +7 -0
  45. package/components/sortableList/SortableItemLabel.vue2.js +60 -0
  46. package/components/sortableList/SortableList.vue.js +7 -0
  47. package/components/sortableList/SortableList.vue2.js +120 -0
  48. package/components/sortableList/composables/useHoverEffect.js +19 -0
  49. package/components/sortableList/consts.js +4 -0
  50. package/components/sortableList/index.js +6 -0
  51. package/components/textArea/v4/TextAreaV4.vue.d.ts +6 -1
  52. package/components/textArea/v4/TextAreaV4.vue.js +3 -3
  53. package/components/textArea/v4/TextAreaV4.vue2.js +18 -12
  54. package/components/textArea/v4/index.d.ts +9 -0
  55. package/index.d.ts +651 -2
  56. package/index.js +131 -126
  57. package/package.json +9 -1
  58. package/testids/index.js +5 -4
  59. package/utils/search.js +4 -0
  60. package/Autocomplete.vue_vue_type_style_index_0_scoped_a7bfd237_lang.css +0 -1
  61. package/FieldMaxLength.vue_vue_type_style_index_0_scoped_f3c4001a_lang.css +0 -1
  62. package/TextAreaV4.vue_vue_type_style_index_0_scoped_f3b2c01d_lang.css +0 -1
  63. package/TextField.vue_vue_type_style_index_0_scoped_a6457440_lang.css +0 -1
@@ -0,0 +1,120 @@
1
+ import "../../SortableList.vue_vue_type_style_index_0_scoped_21842d59_lang.css"; import { defineComponent as $, computed as p, ref as F, openBlock as c, createElementBlock as m, mergeProps as v, unref as t, createBlock as y, isRef as E, createCommentVNode as P, createVNode as w, withCtx as C, Fragment as x, renderList as B, renderSlot as D, createElementVNode as G } from "vue";
2
+ import { VueDraggable as U } from "vue-draggable-plus";
3
+ import R from "./SortableItem.vue.js";
4
+ import M from "../search/v4/SearchV4.vue.js";
5
+ import { useVModel as K } from "@vueuse/core";
6
+ import { matchString as q } from "../../utils/search.js";
7
+ import { useTestIdAttrs as Q } from "../../utils/testIds.js";
8
+ import { SortableListTestIdModifiers as f } from "../../testids/index.js";
9
+ import { DRAG_CURSOR_CSS_CLASS as H } from "./consts.js";
10
+ const le = /* @__PURE__ */ $({
11
+ __name: "SortableList",
12
+ props: {
13
+ items: { default: () => [] },
14
+ displayValue: { type: Function, default: (d) => d.displayText || d.toString() },
15
+ openId: { default: null },
16
+ selectedId: { default: null },
17
+ selectedChildId: { default: null },
18
+ search: { default: null },
19
+ showSearch: { type: Boolean, default: !1 },
20
+ searchPlaceholder: { default: "Search" },
21
+ searchHandler: { type: Function, default: null },
22
+ testId: { default: "" }
23
+ },
24
+ emits: ["update:items", "update:openId", "update:selectedId", "update:selectedChildId", "update:search", "clearSearch"],
25
+ setup(d, { emit: s }) {
26
+ const r = d, o = K(r, "search", s), S = p(() => !!o.value?.trim()), L = p(() => S.value ? r.items.filter((l) => {
27
+ const a = l.children || [], e = o.value;
28
+ return r.searchHandler ? r.searchHandler(l, e) : q(l.displayText, e) || // match parent item
29
+ a.some((n) => q(n.displayText, e));
30
+ }) : r.items), u = p({
31
+ get() {
32
+ return L.value.filter((l) => !l.isLocked);
33
+ },
34
+ set(l) {
35
+ s("update:items", [...l, ...V.value]);
36
+ }
37
+ }), V = p(
38
+ () => L.value.filter((l) => l.isLocked)
39
+ ), I = F(!1), N = (l) => {
40
+ I.value = !0, setTimeout(() => l.target.classList.add(H), 50);
41
+ }, O = (l) => {
42
+ I.value = !1, l.target.classList.remove(H);
43
+ }, T = (l) => (S.value || l.id === r.openId) && !I.value, b = (l, a) => {
44
+ a ? s("update:openId", l.id) : s("update:openId", null);
45
+ }, i = (l) => l.id === r.selectedId, k = (l) => {
46
+ s("update:selectedId", l.id), s("update:selectedChildId", null);
47
+ }, A = (l, a) => {
48
+ s("update:selectedChildId", l.id), s("update:selectedId", a.id), s("update:openId", a.id);
49
+ }, g = Q(r.testId, f);
50
+ return (l, a) => (c(), m("div", v({ class: "sortable-list-container" }, t(g)[t(f).CONTAINER]), [
51
+ d.showSearch ? (c(), y(t(M), {
52
+ key: 0,
53
+ modelValue: t(o),
54
+ "onUpdate:modelValue": a[0] || (a[0] = (e) => E(o) ? o.value = e : null),
55
+ class: "list-search",
56
+ placeholder: d.searchPlaceholder,
57
+ "test-id": d.testId,
58
+ onOnClear: a[1] || (a[1] = (e) => s("clearSearch"))
59
+ }, null, 8, ["modelValue", "placeholder", "test-id"])) : P("", !0),
60
+ w(t(U), v({
61
+ modelValue: t(u),
62
+ "onUpdate:modelValue": a[2] || (a[2] = (e) => E(u) ? u.value = e : null),
63
+ class: "sortable-list",
64
+ filter: ".expand-icon",
65
+ animation: 150,
66
+ handle: ".draggable-handle",
67
+ disabled: t(S)
68
+ }, t(g)[t(f).DRAGGABLE_LIST], {
69
+ onStart: N,
70
+ onEnd: O
71
+ }), {
72
+ default: C(() => [
73
+ (c(!0), m(x, null, B(t(u), (e, n) => (c(), y(R, {
74
+ key: e.id,
75
+ item: e,
76
+ index: n,
77
+ "is-open": T(e),
78
+ "is-selected": i(e),
79
+ "selected-child-id": i(e) ? d.selectedChildId : null,
80
+ "display-value": d.displayValue,
81
+ "search-query": t(o),
82
+ "search-handler": d.searchHandler,
83
+ onToggle: (h) => b(e, h),
84
+ onSelect: (h) => k(e),
85
+ onSelectChild: (h) => A(h, e)
86
+ }, {
87
+ menu: C(() => [
88
+ D(l.$slots, "menu", { item: e }, void 0, !0)
89
+ ]),
90
+ _: 2
91
+ }, 1032, ["item", "index", "is-open", "is-selected", "selected-child-id", "display-value", "search-query", "search-handler", "onToggle", "onSelect", "onSelectChild"]))), 128))
92
+ ]),
93
+ _: 3
94
+ }, 16, ["modelValue", "disabled"]),
95
+ G("div", v({ class: "locked-list" }, t(g)[t(f).LOCKED_LIST]), [
96
+ (c(!0), m(x, null, B(t(V), (e) => (c(), y(R, {
97
+ key: e.id,
98
+ item: e,
99
+ "is-open": T(e),
100
+ "is-selected": i(e),
101
+ "selected-child-id": i(e) ? d.selectedChildId : null,
102
+ "display-value": d.displayValue,
103
+ "search-query": t(o),
104
+ "on-search": d.searchHandler,
105
+ onToggle: (n) => b(e, n),
106
+ onSelect: (n) => k(e),
107
+ onSelectChild: (n) => A(n, e)
108
+ }, {
109
+ menu: C(() => [
110
+ D(l.$slots, "menu", { item: e }, void 0, !0)
111
+ ]),
112
+ _: 2
113
+ }, 1032, ["item", "is-open", "is-selected", "selected-child-id", "display-value", "search-query", "on-search", "onToggle", "onSelect", "onSelectChild"]))), 128))
114
+ ], 16)
115
+ ], 16));
116
+ }
117
+ });
118
+ export {
119
+ le as default
120
+ };
@@ -0,0 +1,19 @@
1
+ import { computed as t } from "vue";
2
+ const d = (e, r) => {
3
+ const s = t(() => e.value ? Array.from(e.value.parentElement?.children || []) : []);
4
+ return {
5
+ handleMouseover: (n) => {
6
+ s.value.forEach(
7
+ (o) => o.classList.remove(r)
8
+ ), s.value.some(
9
+ (o) => o.classList.contains("sortable-chosen")
10
+ ) || n.currentTarget.classList.add(r);
11
+ },
12
+ handleMouseout: () => {
13
+ e.value.classList.remove(r);
14
+ }
15
+ };
16
+ };
17
+ export {
18
+ d as useHoverEffect
19
+ };
@@ -0,0 +1,4 @@
1
+ const r = "force-grabbing-cursor";
2
+ export {
3
+ r as DRAG_CURSOR_CSS_CLASS
4
+ };
@@ -0,0 +1,6 @@
1
+ import t from "./SortableList.vue.js";
2
+ const r = () => [t];
3
+ export {
4
+ t as SortableList,
5
+ r as SortableListTypes
6
+ };
@@ -1,11 +1,12 @@
1
1
  import { TooltipPositions } from '@/components/tooltip/common/Tooltip.types';
2
- import { FeedbackVariant } from '@/components/shared/commonTypes';
2
+ import { FeedbackVariant, MaxLengthCounterPositions } from '@/components/shared/commonTypes';
3
3
  declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
4
4
  modelValue?: string;
5
5
  placeholder?: string;
6
6
  disabled?: boolean;
7
7
  label?: string;
8
8
  maxLength?: number;
9
+ maxLengthCounterPosition?: MaxLengthCounterPositions;
9
10
  mandatory?: boolean;
10
11
  hoverHelpText?: string;
11
12
  hoverHelpTextPlacement?: TooltipPositions;
@@ -21,6 +22,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
21
22
  disabled: boolean;
22
23
  label: string;
23
24
  maxLength: any;
25
+ maxLengthCounterPosition: string;
24
26
  mandatory: boolean;
25
27
  hoverHelpText: string;
26
28
  hoverHelpTextPlacement: string;
@@ -38,6 +40,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
38
40
  disabled?: boolean;
39
41
  label?: string;
40
42
  maxLength?: number;
43
+ maxLengthCounterPosition?: MaxLengthCounterPositions;
41
44
  mandatory?: boolean;
42
45
  hoverHelpText?: string;
43
46
  hoverHelpTextPlacement?: TooltipPositions;
@@ -53,6 +56,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
53
56
  disabled: boolean;
54
57
  label: string;
55
58
  maxLength: any;
59
+ maxLengthCounterPosition: string;
56
60
  mandatory: boolean;
57
61
  hoverHelpText: string;
58
62
  hoverHelpTextPlacement: string;
@@ -76,6 +80,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
76
80
  maxLength: number;
77
81
  modelValue: string;
78
82
  placeholder: string;
83
+ maxLengthCounterPosition: MaxLengthCounterPositions;
79
84
  feedbackText: string;
80
85
  feedbackVariant: FeedbackVariant;
81
86
  showFeedbackTextIcon: boolean;
@@ -1,7 +1,7 @@
1
1
  import e from "./TextAreaV4.vue2.js";
2
2
  /* empty css */import o from "../../../_virtual/_plugin-vue_export-helper.js";
3
- // import "../../../TextAreaV4.vue_vue_type_style_index_0_scoped_f3b2c01d_lang.css"; //*');
4
- const c = /* @__PURE__ */ o(e, [["__scopeId", "data-v-f3b2c01d"]]);
3
+ // import "../../../TextAreaV4.vue_vue_type_style_index_0_scoped_4114ef89_lang.css"; //*');
4
+ const p = /* @__PURE__ */ o(e, [["__scopeId", "data-v-4114ef89"]]);
5
5
  export {
6
- c as default
6
+ p as default
7
7
  };
@@ -1,13 +1,13 @@
1
- import "../../../TextAreaV4.vue_vue_type_style_index_0_scoped_f3b2c01d_lang.css"; import { defineComponent as s, computed as b, openBlock as t, createElementBlock as i, mergeProps as c, unref as a, createBlock as n, createCommentVNode as l, createElementVNode as g } from "vue";
1
+ import "../../../TextAreaV4.vue_vue_type_style_index_0_scoped_4114ef89_lang.css"; import { defineComponent as f, computed as b, openBlock as t, createElementBlock as r, mergeProps as c, unref as a, createBlock as d, createCommentVNode as l, createElementVNode as g } from "vue";
2
2
  import v from "../../shared/FieldLabel.vue.js";
3
3
  import k from "../../shared/FieldMaxLength.vue.js";
4
4
  import T from "../../shared/FieldHelpText.vue.js";
5
- import { TextAreaTestIdModifiers as u } from "../../../testids/index.js";
5
+ import { TextAreaTestIdModifiers as i } from "../../../testids/index.js";
6
6
  import { useTestIdAttrs as V } from "../../../utils/testIds.js";
7
7
  const y = ["value", "placeholder", "disabled", "maxlength"], I = {
8
8
  key: 1,
9
9
  class: "footer"
10
- }, w = /* @__PURE__ */ s({
10
+ }, w = /* @__PURE__ */ f({
11
11
  __name: "TextAreaV4",
12
12
  props: {
13
13
  modelValue: { default: "" },
@@ -15,6 +15,7 @@ const y = ["value", "placeholder", "disabled", "maxlength"], I = {
15
15
  disabled: { type: Boolean, default: !1 },
16
16
  label: { default: "" },
17
17
  maxLength: { default: null },
18
+ maxLengthCounterPosition: { default: "inside" },
18
19
  mandatory: { type: Boolean, default: !1 },
19
20
  hoverHelpText: { default: "" },
20
21
  hoverHelpTextPlacement: { default: "top" },
@@ -27,11 +28,15 @@ const y = ["value", "placeholder", "disabled", "maxlength"], I = {
27
28
  },
28
29
  emits: ["update:modelValue"],
29
30
  setup(e, { emit: h }) {
30
- const o = e, m = (d) => {
31
- h("update:modelValue", d.target.value);
32
- }, x = b(() => (o.modelValue || "").length), r = V(o.testId, u);
33
- return (d, f) => (t(), i("div", c({ class: "textarea-field" }, a(r)[a(u).WRAPPER]), [
34
- e.label ? (t(), n(v, {
31
+ const u = e, m = (n) => {
32
+ h("update:modelValue", n.target.value);
33
+ }, x = b(() => (u.modelValue || "").length), o = V(u.testId, i);
34
+ return (n, s) => (t(), r("div", c({
35
+ class: ["textarea-field", {
36
+ "textarea-field--counter-inside": e.maxLength && e.maxLengthCounterPosition === "inside"
37
+ }]
38
+ }, a(o)[a(i).WRAPPER]), [
39
+ e.label ? (t(), d(v, {
35
40
  key: 0,
36
41
  class: "textarea-label",
37
42
  label: e.label,
@@ -51,17 +56,18 @@ const y = ["value", "placeholder", "disabled", "maxlength"], I = {
51
56
  placeholder: e.placeholder,
52
57
  disabled: e.disabled,
53
58
  maxlength: e.maxLength
54
- }, a(r)[a(u).FIELD], { onInput: m }), null, 16, y),
55
- e.feedbackText || e.maxLength ? (t(), i("div", I, [
56
- e.feedbackText ? (t(), n(T, {
59
+ }, a(o)[a(i).FIELD], { onInput: m }), null, 16, y),
60
+ e.feedbackText || e.maxLength ? (t(), r("div", I, [
61
+ e.feedbackText ? (t(), d(T, {
57
62
  key: 0,
58
63
  text: e.feedbackText,
59
64
  variant: e.feedbackVariant,
60
65
  "show-icon": e.showFeedbackTextIcon,
61
66
  "test-id": e.testId
62
67
  }, null, 8, ["text", "variant", "show-icon", "test-id"])) : l("", !0),
63
- e.maxLength ? (t(), n(k, {
68
+ e.maxLength ? (t(), d(k, {
64
69
  key: 1,
70
+ class: "max-length-counter",
65
71
  "current-length": a(x),
66
72
  "max-length": e.maxLength
67
73
  }, null, 8, ["current-length", "max-length"])) : l("", !0)
@@ -43,6 +43,10 @@ declare const TextAreaTypes: () => import("vue").DefineComponent<{
43
43
  type: import("vue").PropType<string>;
44
44
  default: string;
45
45
  };
46
+ maxLengthCounterPosition: {
47
+ type: import("vue").PropType<"inside" | "outside">;
48
+ default: string;
49
+ };
46
50
  feedbackText: {
47
51
  type: import("vue").PropType<string>;
48
52
  default: string;
@@ -102,6 +106,10 @@ declare const TextAreaTypes: () => import("vue").DefineComponent<{
102
106
  type: import("vue").PropType<string>;
103
107
  default: string;
104
108
  };
109
+ maxLengthCounterPosition: {
110
+ type: import("vue").PropType<"inside" | "outside">;
111
+ default: string;
112
+ };
105
113
  feedbackText: {
106
114
  type: import("vue").PropType<string>;
107
115
  default: string;
@@ -128,6 +136,7 @@ declare const TextAreaTypes: () => import("vue").DefineComponent<{
128
136
  maxLength: number;
129
137
  modelValue: string;
130
138
  placeholder: string;
139
+ maxLengthCounterPosition: "inside" | "outside";
131
140
  feedbackText: string;
132
141
  feedbackVariant: "success" | "warning" | "error";
133
142
  showFeedbackTextIcon: boolean;