@ironsource/shared-ui 2.2.0-rc.27 → 2.2.0-rc.29
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.
- package/Tag.vue_vue_type_style_index_0_scoped_4b92d495_lang.css +1 -0
- package/components/tag/Tag.vue.d.ts +10 -0
- package/components/tag/Tag.vue.js +2 -2
- package/components/tag/Tag.vue2.js +144 -114
- package/components/tag/index.d.ts +18 -0
- package/index.js +1 -1
- package/package.json +6 -2
- package/Tag.vue_vue_type_style_index_0_scoped_18d036b6_lang.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap";.font-tab-label2[data-v-4b92d495],.font-chart-2[data-v-4b92d495],.font-chart-1[data-v-4b92d495]{font-family:Inter,sans-serif;font-weight:700}.tag-input-sizer[data-v-4b92d495],.tag-input[data-v-4b92d495],.font-chip-label[data-v-4b92d495],.font-table-label[data-v-4b92d495],.font-button[data-v-4b92d495],.font-heading-6[data-v-4b92d495],.font-heading-5[data-v-4b92d495],.font-heading-4[data-v-4b92d495],.font-heading-3[data-v-4b92d495],.font-heading-2[data-v-4b92d495],.font-heading-1[data-v-4b92d495],.font-title[data-v-4b92d495]{font-family:Inter,sans-serif;font-weight:600}.font-tab-label1[data-v-4b92d495],.font-input-label[data-v-4b92d495],.font-overline[data-v-4b92d495],.font-subtitle-2[data-v-4b92d495],.font-subtitle-1[data-v-4b92d495]{font-family:Inter,sans-serif;font-weight:500}.font-caption[data-v-4b92d495],.font-body-2[data-v-4b92d495],.font-body-1[data-v-4b92d495]{font-family:Inter,sans-serif;font-weight:400}.font-title[data-v-4b92d495]{font-size:2.5rem;line-height:3rem;letter-spacing:-.055rem}.font-heading-1[data-v-4b92d495]{font-size:1.5rem;line-height:1.75rem;letter-spacing:-.0285rem}.font-heading-2[data-v-4b92d495]{font-size:1.125rem;line-height:1.75rem;letter-spacing:-.01575rem}.font-heading-3[data-v-4b92d495]{font-size:1rem;line-height:1.5rem;letter-spacing:-.011rem}.font-heading-4[data-v-4b92d495]{font-size:.875rem;line-height:1rem;letter-spacing:unset}.font-heading-5[data-v-4b92d495]{font-size:.8125rem;line-height:16px;letter-spacing:unset}.font-heading-6[data-v-4b92d495]{font-size:.75rem;line-height:.75rem;letter-spacing:0}.font-body-1[data-v-4b92d495]{font-size:.875rem;line-height:1.25rem;letter-spacing:-.00525rem}.font-body-2[data-v-4b92d495]{font-size:.8125rem;line-height:1.25rem;letter-spacing:-.00244rem}.font-subtitle-1[data-v-4b92d495]{font-size:.875rem;line-height:1.25rem;letter-spacing:-.00525rem}.font-subtitle-2[data-v-4b92d495]{font-size:.8125rem;line-height:1.25rem;letter-spacing:-.00244rem}.font-chart-1[data-v-4b92d495]{font-size:1.5rem;line-height:1.5rem;letter-spacing:-.015rem}.font-chart-2[data-v-4b92d495]{font-size:1.25rem;line-height:1.25rem;letter-spacing:-.0125rem}.font-button[data-v-4b92d495]{font-size:.875rem;line-height:1.25rem;letter-spacing:.00875rem}.font-overline[data-v-4b92d495]{font-size:.75rem;line-height:1rem;letter-spacing:.045rem;text-transform:uppercase}.font-caption[data-v-4b92d495]{font-size:.75rem;line-height:1rem}.font-table-label[data-v-4b92d495]{font-size:.8125rem;line-height:1.25rem;letter-spacing:.00813rem}.font-input-label[data-v-4b92d495]{font-size:.8125rem;line-height:1rem;letter-spacing:.00813rem}.font-tab-label1[data-v-4b92d495],.font-tab-label2[data-v-4b92d495]{font-size:.875rem;line-height:1rem}.tag-input-sizer[data-v-4b92d495],.tag-input[data-v-4b92d495],.font-chip-label[data-v-4b92d495]{font-size:.75rem;line-height:1rem}h1[data-v-4b92d495],h2[data-v-4b92d495],h3[data-v-4b92d495],h4[data-v-4b92d495],h5[data-v-4b92d495],h6[data-v-4b92d495]{margin:0}.rounded-tag[data-v-4b92d495]{border-radius:100px}.tag-editing[data-v-4b92d495]{outline:1px solid var(--outline-color)}.unselected-tag-hover-outline[data-v-4b92d495]{background-color:var(--action-hover)}.tag-hover-outline[data-v-4b92d495]{outline:1px solid var(--outline-color);cursor:pointer}.unselected-tag[data-v-4b92d495]{outline:1px solid var(--action-outlined-border)}.tag-disabled[data-v-4b92d495]{background-color:transparent;outline:1px solid var(--action-disabled)}.tag-content[data-v-4b92d495]{display:flex;align-items:center;position:relative;min-width:.625rem;max-width:31.25rem}.tag-icon[data-v-4b92d495]{margin-right:.25rem}.tag-label[data-v-4b92d495]{user-select:none;min-width:.5rem}.tag-label--disabled[data-v-4b92d495]{color:var(--action-disabled)}.tag-label--hidden[data-v-4b92d495]{visibility:hidden}.tag-input[data-v-4b92d495]{position:static;width:auto;background:transparent;min-width:.6rem;padding:0;border:none;max-width:100%;overflow-x:auto;white-space:nowrap}.tag-input[data-v-4b92d495]:focus{outline:none}.tag-input-outline[data-v-4b92d495]::placeholder{color:var(--action-disabled)}.clear-button[data-v-4b92d495]{margin-left:.25rem;color:var(--action-active);cursor:pointer}.clear-button[data-v-4b92d495]:hover{color:var(--text-primary)}.clear-button--invalid[data-v-4b92d495]{color:var(--error-dark)}.clear-button--invalid[data-v-4b92d495]:hover{color:var(--error-darker)}.tag-input-sizer[data-v-4b92d495]{position:absolute;visibility:hidden;height:0;white-space:pre;pointer-events:none;padding:0}.editable-tag[data-v-4b92d495]{cursor:text}.empty-tag[data-v-4b92d495]{background-color:transparent;outline:1px dashed var(--action-outlined-border);color:var(--text-secondary)}.empty-tag[data-v-4b92d495]:hover:not(.tag-disabled){outline:1px dashed var(--action-active)}.tag-max-length-tooltip[data-v-4b92d495]{display:flex;width:15.625rem;padding:.25rem}
|
|
@@ -11,9 +11,11 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
11
11
|
variant?: ChipVariant;
|
|
12
12
|
placeholder?: string;
|
|
13
13
|
iconName?: string;
|
|
14
|
+
iconType?: 'regular' | 'fill';
|
|
14
15
|
editable?: boolean;
|
|
15
16
|
selectable?: boolean;
|
|
16
17
|
maxLength?: number;
|
|
18
|
+
maxLengthTooltip?: string;
|
|
17
19
|
}>, {
|
|
18
20
|
isInvalid: boolean;
|
|
19
21
|
label: string;
|
|
@@ -28,6 +30,8 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
28
30
|
editable: boolean;
|
|
29
31
|
selectable: boolean;
|
|
30
32
|
maxLength: any;
|
|
33
|
+
iconType: string;
|
|
34
|
+
maxLengthTooltip: string;
|
|
31
35
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
32
36
|
"update:label": (value: string) => void;
|
|
33
37
|
remove: () => void;
|
|
@@ -44,9 +48,11 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
44
48
|
variant?: ChipVariant;
|
|
45
49
|
placeholder?: string;
|
|
46
50
|
iconName?: string;
|
|
51
|
+
iconType?: 'regular' | 'fill';
|
|
47
52
|
editable?: boolean;
|
|
48
53
|
selectable?: boolean;
|
|
49
54
|
maxLength?: number;
|
|
55
|
+
maxLengthTooltip?: string;
|
|
50
56
|
}>, {
|
|
51
57
|
isInvalid: boolean;
|
|
52
58
|
label: string;
|
|
@@ -61,6 +67,8 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
61
67
|
editable: boolean;
|
|
62
68
|
selectable: boolean;
|
|
63
69
|
maxLength: any;
|
|
70
|
+
iconType: string;
|
|
71
|
+
maxLengthTooltip: string;
|
|
64
72
|
}>>> & {
|
|
65
73
|
onRemove?: () => any;
|
|
66
74
|
"onUpdate:label"?: (value: string) => any;
|
|
@@ -76,9 +84,11 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
76
84
|
rounded: boolean;
|
|
77
85
|
maxLength: number;
|
|
78
86
|
placeholder: string;
|
|
87
|
+
iconType: 'regular' | 'fill';
|
|
79
88
|
editable: boolean;
|
|
80
89
|
isInvalid: boolean;
|
|
81
90
|
selectable: boolean;
|
|
91
|
+
maxLengthTooltip: string;
|
|
82
92
|
}>;
|
|
83
93
|
export default _default;
|
|
84
94
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Tag.vue2.js";
|
|
2
2
|
/* empty css */import _ from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
-
// import "../../Tag.
|
|
4
|
-
const p = /* @__PURE__ */ _(o, [["__scopeId", "data-v-
|
|
3
|
+
// import "../../Tag.vue_vue_type_style_index_0_scoped_4b92d495_lang.css"; //*');
|
|
4
|
+
const p = /* @__PURE__ */ _(o, [["__scopeId", "data-v-4b92d495"]]);
|
|
5
5
|
export {
|
|
6
6
|
p as default
|
|
7
7
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import "../../Tag.
|
|
2
|
-
import
|
|
1
|
+
import "../../Tag.vue_vue_type_style_index_0_scoped_4b92d495_lang.css"; import { defineComponent as J, ref as s, computed as d, watch as N, nextTick as S, openBlock as v, createBlock as C, unref as l, withCtx as f, createElementVNode as E, createVNode as w, createTextVNode as V, toDisplayString as T, normalizeClass as p, normalizeStyle as R, withModifiers as m, createCommentVNode as $, withDirectives as O, createElementBlock as H, isRef as Q, withKeys as K, vModelText as X, vShow as Z } from "vue";
|
|
2
|
+
import D from "../typography/v4/Typography.vue.js";
|
|
3
3
|
import W from "../icon/v4/IconV4.vue.js";
|
|
4
4
|
import "../icon/v4/IconFlag.vue.js";
|
|
5
5
|
import _ from "../chip/v4/ChipV4.vue.js";
|
|
6
|
-
|
|
6
|
+
import ee from "../popover/v4/PopoverV4.vue.js";
|
|
7
|
+
const ae = { class: "tag-max-length-tooltip" }, le = { class: "tag-content" }, te = ["placeholder", "maxlength", "onKeyup"], se = /* @__PURE__ */ J({
|
|
7
8
|
__name: "Tag",
|
|
8
9
|
props: {
|
|
9
10
|
label: { default: "" },
|
|
@@ -17,37 +18,42 @@ const ee = { class: "tag-content" }, ae = ["placeholder", "maxlength", "onKeyup"
|
|
|
17
18
|
variant: { default: "filled" },
|
|
18
19
|
placeholder: { default: "" },
|
|
19
20
|
iconName: { default: "" },
|
|
21
|
+
iconType: { default: "regular" },
|
|
20
22
|
editable: { type: Boolean, default: !1 },
|
|
21
23
|
selectable: { type: Boolean, default: !0 },
|
|
22
|
-
maxLength: { default: void 0 }
|
|
24
|
+
maxLength: { default: void 0 },
|
|
25
|
+
maxLengthTooltip: { default: "You have reached the maximum number of characters" }
|
|
23
26
|
},
|
|
24
27
|
emits: ["update:label", "remove", "stopEditing"],
|
|
25
|
-
setup(a, { emit:
|
|
26
|
-
const e = a,
|
|
28
|
+
setup(a, { emit: b }) {
|
|
29
|
+
const e = a, r = s(!1), y = s(null), h = s(void 0), k = s(!1), u = s(!1), o = s(e.isSelected || e.editable), z = d(() => !e.label && !r.value && e.placeholder), I = d(() => (console.log(
|
|
30
|
+
"isTooltipOpen",
|
|
31
|
+
e.maxLength && i.value.length >= e.maxLength && r.value
|
|
32
|
+
), e.maxLength && i.value.length >= e.maxLength && r.value)), g = d(() => e.disabled || !e.selectable || r.value ? "outlined" : u.value ? "filled" : !o.value && !e.editable ? "outlined" : e.variant), F = d(() => e.disabled ? "default" : e.isInvalid ? "error" : o.value || !o.value && e.editable || !e.selectable ? e.color : "default"), i = d({
|
|
27
33
|
get: () => e.label,
|
|
28
34
|
set: (n) => {
|
|
29
|
-
|
|
35
|
+
b("update:label", n);
|
|
30
36
|
}
|
|
31
|
-
}),
|
|
32
|
-
e.disabled || !e.selectable || (e.editable ? (r.value = !0, await
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
r.value = !1, !i.value && !e.placeholder &&
|
|
37
|
+
}), M = s(null), P = () => M.value?.focus(), U = async () => {
|
|
38
|
+
e.disabled || !e.selectable || (e.editable ? (r.value = !0, await S(), P()) : o.value = !o.value);
|
|
39
|
+
}, Y = () => {
|
|
40
|
+
b("stopEditing"), x();
|
|
41
|
+
}, x = () => {
|
|
42
|
+
r.value = !1, !i.value && !e.placeholder && b("remove");
|
|
37
43
|
};
|
|
38
|
-
|
|
44
|
+
N(
|
|
39
45
|
() => [i.value, e.placeholder, r.value],
|
|
40
46
|
async () => {
|
|
41
|
-
await
|
|
47
|
+
await S(), r.value && y.value ? h.value = y.value.offsetWidth + "px" : h.value = void 0;
|
|
42
48
|
},
|
|
43
49
|
{ immediate: !0 }
|
|
44
|
-
),
|
|
50
|
+
), N(
|
|
45
51
|
() => e.editable,
|
|
46
52
|
() => {
|
|
47
53
|
e.editable && (o.value = !0);
|
|
48
54
|
}
|
|
49
55
|
);
|
|
50
|
-
const
|
|
56
|
+
const B = {
|
|
51
57
|
default: "var(--default-outlined-border)",
|
|
52
58
|
primary: "var(--primary-main)",
|
|
53
59
|
info: "var(--info-dark)",
|
|
@@ -55,7 +61,7 @@ const ee = { class: "tag-content" }, ae = ["placeholder", "maxlength", "onKeyup"
|
|
|
55
61
|
warning: "var(--warning-main)",
|
|
56
62
|
success: "var(--success-main)",
|
|
57
63
|
dark: "var(--common-divider)"
|
|
58
|
-
},
|
|
64
|
+
}, L = {
|
|
59
65
|
default: "var(--action-active)",
|
|
60
66
|
primary: "var(--primary-dark)",
|
|
61
67
|
info: "var(--info-dark)",
|
|
@@ -63,7 +69,7 @@ const ee = { class: "tag-content" }, ae = ["placeholder", "maxlength", "onKeyup"
|
|
|
63
69
|
warning: "var(--warning-dark)",
|
|
64
70
|
success: "var(--success-dark)",
|
|
65
71
|
dark: "var(--common-divider)"
|
|
66
|
-
},
|
|
72
|
+
}, j = {
|
|
67
73
|
default: "var(--action-active)",
|
|
68
74
|
primary: "var(--primary-darker)",
|
|
69
75
|
info: "var(--info-darker)",
|
|
@@ -71,121 +77,145 @@ const ee = { class: "tag-content" }, ae = ["placeholder", "maxlength", "onKeyup"
|
|
|
71
77
|
warning: "var(--warning-darker)",
|
|
72
78
|
success: "var(--success-darker)",
|
|
73
79
|
dark: "var(--common-divider)"
|
|
74
|
-
},
|
|
80
|
+
}, q = d(() => {
|
|
75
81
|
if (e.disabled)
|
|
76
82
|
return "var(--action-disabled)";
|
|
77
83
|
const n = e.isInvalid ? "error" : e.color;
|
|
78
|
-
return k.value ?
|
|
79
|
-
}),
|
|
84
|
+
return k.value ? j[n] : L[n];
|
|
85
|
+
}), A = d(() => {
|
|
80
86
|
if (e.disabled)
|
|
81
87
|
return "var(--action-disabled)";
|
|
82
88
|
const n = e.isInvalid ? "error" : e.color;
|
|
83
|
-
return o.value || !e.selectable ?
|
|
84
|
-
}),
|
|
89
|
+
return o.value || !e.selectable ? L[n] : "var(--action-active)";
|
|
90
|
+
}), G = d(() => {
|
|
85
91
|
if (e.editable && e.variant !== "outlined" || !e.selectable) {
|
|
86
|
-
const n = r.value ?
|
|
92
|
+
const n = r.value ? B[e.color] : "var(--primary-main-50-p)";
|
|
87
93
|
return {
|
|
88
|
-
"--outline-color": e.isInvalid ?
|
|
94
|
+
"--outline-color": e.isInvalid ? B.error : n
|
|
89
95
|
};
|
|
90
96
|
}
|
|
91
|
-
return
|
|
97
|
+
return u.value && e.variant !== "outlined" && e.color === "primary" && !e.editable ? {
|
|
92
98
|
"--outline-color": o.value ? "var(--primary-main-50-p)" : "var(--action-active)"
|
|
93
99
|
} : {};
|
|
94
100
|
});
|
|
95
|
-
return (n, t) => (v(), C(l(
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
"unselected-tag-hover-outline": a.label && s.value && l(p) !== "outlined" && !o.value && !a.editable,
|
|
103
|
-
// for unselected tags that are not editable, we want to show a hover outline
|
|
104
|
-
"tag-disabled": a.disabled,
|
|
105
|
-
"empty-tag": l(x),
|
|
106
|
-
"unselected-tag": !o.value && a.selectable && a.label
|
|
107
|
-
}),
|
|
108
|
-
label: l(i),
|
|
109
|
-
"test-id": a.testId,
|
|
110
|
-
color: l(D),
|
|
111
|
-
size: a.size,
|
|
112
|
-
variant: l(p),
|
|
113
|
-
disabled: a.disabled,
|
|
114
|
-
style: N(l(P)),
|
|
115
|
-
onMouseover: t[5] || (t[5] = (c) => s.value = !0),
|
|
116
|
-
onMouseleave: t[6] || (t[6] = (c) => s.value = !1),
|
|
117
|
-
onClick: f(L, ["stop"])
|
|
101
|
+
return (n, t) => (v(), C(l(ee), {
|
|
102
|
+
placement: "top",
|
|
103
|
+
text: a.maxLengthTooltip,
|
|
104
|
+
"is-open": l(I),
|
|
105
|
+
disabled: !l(I),
|
|
106
|
+
distance: 10,
|
|
107
|
+
skidding: 10
|
|
118
108
|
}, {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
size: "16px",
|
|
125
|
-
color: l(F),
|
|
126
|
-
class: "tag-icon"
|
|
127
|
-
}, null, 8, ["name", "color"])) : E("", !0),
|
|
128
|
-
r.value ? $((v(), R("input", {
|
|
129
|
-
key: 2,
|
|
130
|
-
ref_key: "inputRef",
|
|
131
|
-
ref: I,
|
|
132
|
-
"onUpdate:modelValue": t[0] || (t[0] = (c) => G(i) ? i.value = c : null),
|
|
133
|
-
placeholder: a.placeholder,
|
|
134
|
-
class: g(["tag-input", { "tag-input-outline": a.variant === "outlined" }]),
|
|
135
|
-
spellcheck: "false",
|
|
136
|
-
style: N({ width: y.value }),
|
|
137
|
-
maxlength: a.maxLength,
|
|
138
|
-
onBlur: O,
|
|
139
|
-
onKeyup: [
|
|
140
|
-
H(f(h, ["prevent"]), ["enter"]),
|
|
141
|
-
H(f(h, ["prevent"]), ["esc"])
|
|
142
|
-
]
|
|
143
|
-
}, null, 46, ae)), [
|
|
144
|
-
[
|
|
145
|
-
J,
|
|
146
|
-
l(i),
|
|
147
|
-
void 0,
|
|
148
|
-
{ trim: !0 }
|
|
149
|
-
]
|
|
150
|
-
]) : (v(), C(l(Z), {
|
|
151
|
-
key: 1,
|
|
152
|
-
variant: "chipLabel",
|
|
153
|
-
class: g(["tag-label", {
|
|
154
|
-
"tag-label--placeholder": !l(i) && a.placeholder,
|
|
155
|
-
"tag-label--disabled": a.disabled
|
|
156
|
-
}])
|
|
157
|
-
}, {
|
|
158
|
-
default: S(() => [
|
|
159
|
-
q(V(l(i) || a.placeholder), 1)
|
|
109
|
+
content: f(() => [
|
|
110
|
+
E("div", ae, [
|
|
111
|
+
w(l(D), { variant: "body2" }, {
|
|
112
|
+
default: f(() => [
|
|
113
|
+
V(T(a.maxLengthTooltip), 1)
|
|
160
114
|
]),
|
|
161
115
|
_: 1
|
|
162
|
-
}
|
|
163
|
-
r.value ? (v(), R("span", {
|
|
164
|
-
key: 3,
|
|
165
|
-
ref_key: "sizerRef",
|
|
166
|
-
ref: b,
|
|
167
|
-
class: "tag-input-sizer"
|
|
168
|
-
}, V(l(i) || a.placeholder || ""), 513)) : E("", !0)
|
|
169
|
-
]),
|
|
170
|
-
$(Q(l(W), {
|
|
171
|
-
class: g(["clear-button", { "clear-button--invalid": a.isInvalid }]),
|
|
172
|
-
name: "x-circle",
|
|
173
|
-
size: "16px",
|
|
174
|
-
type: "fill",
|
|
175
|
-
color: l(A),
|
|
176
|
-
onMousedown: t[1] || (t[1] = f(() => {
|
|
177
|
-
}, ["prevent"])),
|
|
178
|
-
onMouseover: t[2] || (t[2] = (c) => k.value = !0),
|
|
179
|
-
onMouseleave: t[3] || (t[3] = (c) => k.value = !1),
|
|
180
|
-
onClick: t[4] || (t[4] = f((c) => m("remove"), ["stop"]))
|
|
181
|
-
}, null, 8, ["class", "color"]), [
|
|
182
|
-
[Y, a.editable && !l(x) && a.selectable]
|
|
116
|
+
})
|
|
183
117
|
])
|
|
184
118
|
]),
|
|
119
|
+
trigger: f(() => [
|
|
120
|
+
w(l(_), {
|
|
121
|
+
class: p({
|
|
122
|
+
"rounded-tag": a.rounded,
|
|
123
|
+
"tag-editing": r.value && l(g) !== "outlined",
|
|
124
|
+
// outlined chips have an outline
|
|
125
|
+
"tag-hover-outline": a.label && u.value && l(g) !== "outlined",
|
|
126
|
+
// outlined chips have an outline
|
|
127
|
+
"unselected-tag-hover-outline": a.label && u.value && l(g) !== "outlined" && !o.value && !a.editable,
|
|
128
|
+
// for unselected tags that are not editable, we want to show a hover outline
|
|
129
|
+
"tag-disabled": a.disabled,
|
|
130
|
+
"empty-tag": l(z),
|
|
131
|
+
"unselected-tag": !o.value && a.selectable && a.label && !u.value,
|
|
132
|
+
"editable-tag": a.editable && !a.disabled
|
|
133
|
+
}),
|
|
134
|
+
label: l(i),
|
|
135
|
+
"test-id": a.testId,
|
|
136
|
+
color: l(F),
|
|
137
|
+
size: a.size,
|
|
138
|
+
variant: l(g),
|
|
139
|
+
disabled: a.disabled,
|
|
140
|
+
style: R(l(G)),
|
|
141
|
+
onMouseover: t[5] || (t[5] = (c) => u.value = !0),
|
|
142
|
+
onMouseleave: t[6] || (t[6] = (c) => u.value = !1),
|
|
143
|
+
onClick: m(U, ["stop"])
|
|
144
|
+
}, {
|
|
145
|
+
default: f(() => [
|
|
146
|
+
E("div", le, [
|
|
147
|
+
a.iconName ? (v(), C(l(W), {
|
|
148
|
+
key: 0,
|
|
149
|
+
name: a.iconName,
|
|
150
|
+
size: "16px",
|
|
151
|
+
color: l(A),
|
|
152
|
+
class: "tag-icon",
|
|
153
|
+
type: a.iconType
|
|
154
|
+
}, null, 8, ["name", "color", "type"])) : $("", !0),
|
|
155
|
+
r.value ? O((v(), H("input", {
|
|
156
|
+
key: 2,
|
|
157
|
+
ref_key: "inputRef",
|
|
158
|
+
ref: M,
|
|
159
|
+
"onUpdate:modelValue": t[0] || (t[0] = (c) => Q(i) ? i.value = c : null),
|
|
160
|
+
placeholder: a.placeholder,
|
|
161
|
+
class: p(["tag-input", { "tag-input-outline": a.variant === "outlined" }]),
|
|
162
|
+
spellcheck: "false",
|
|
163
|
+
style: R({ width: h.value }),
|
|
164
|
+
maxlength: a.maxLength,
|
|
165
|
+
onBlur: Y,
|
|
166
|
+
onKeyup: [
|
|
167
|
+
K(m(x, ["prevent"]), ["enter"]),
|
|
168
|
+
K(m(x, ["prevent"]), ["esc"])
|
|
169
|
+
]
|
|
170
|
+
}, null, 46, te)), [
|
|
171
|
+
[
|
|
172
|
+
X,
|
|
173
|
+
l(i),
|
|
174
|
+
void 0,
|
|
175
|
+
{ trim: !0 }
|
|
176
|
+
]
|
|
177
|
+
]) : (v(), C(l(D), {
|
|
178
|
+
key: 1,
|
|
179
|
+
variant: "chipLabel",
|
|
180
|
+
class: p(["tag-label", {
|
|
181
|
+
"tag-label--placeholder": !l(i) && a.placeholder,
|
|
182
|
+
"tag-label--disabled": a.disabled
|
|
183
|
+
}])
|
|
184
|
+
}, {
|
|
185
|
+
default: f(() => [
|
|
186
|
+
V(T(l(i) || a.placeholder), 1)
|
|
187
|
+
]),
|
|
188
|
+
_: 1
|
|
189
|
+
}, 8, ["class"])),
|
|
190
|
+
r.value ? (v(), H("span", {
|
|
191
|
+
key: 3,
|
|
192
|
+
ref_key: "sizerRef",
|
|
193
|
+
ref: y,
|
|
194
|
+
class: "tag-input-sizer"
|
|
195
|
+
}, T(l(i) || a.placeholder || ""), 513)) : $("", !0)
|
|
196
|
+
]),
|
|
197
|
+
O(w(l(W), {
|
|
198
|
+
class: p(["clear-button", { "clear-button--invalid": a.isInvalid }]),
|
|
199
|
+
name: "x-circle",
|
|
200
|
+
size: "16px",
|
|
201
|
+
type: "fill",
|
|
202
|
+
color: l(q),
|
|
203
|
+
onMousedown: t[1] || (t[1] = m(() => {
|
|
204
|
+
}, ["prevent"])),
|
|
205
|
+
onMouseover: t[2] || (t[2] = (c) => k.value = !0),
|
|
206
|
+
onMouseleave: t[3] || (t[3] = (c) => k.value = !1),
|
|
207
|
+
onClick: t[4] || (t[4] = m((c) => b("remove"), ["stop"]))
|
|
208
|
+
}, null, 8, ["class", "color"]), [
|
|
209
|
+
[Z, a.editable && !l(z) && a.selectable]
|
|
210
|
+
])
|
|
211
|
+
]),
|
|
212
|
+
_: 1
|
|
213
|
+
}, 8, ["class", "label", "test-id", "color", "size", "variant", "disabled", "style", "onClick"])
|
|
214
|
+
]),
|
|
185
215
|
_: 1
|
|
186
|
-
}, 8, ["
|
|
216
|
+
}, 8, ["text", "is-open", "disabled"]));
|
|
187
217
|
}
|
|
188
218
|
});
|
|
189
219
|
export {
|
|
190
|
-
|
|
220
|
+
se as default
|
|
191
221
|
};
|
|
@@ -45,6 +45,10 @@ declare const TagTypes: () => import("vue").DefineComponent<{
|
|
|
45
45
|
type: import("vue").PropType<boolean>;
|
|
46
46
|
required: true;
|
|
47
47
|
};
|
|
48
|
+
iconType: {
|
|
49
|
+
type: import("vue").PropType<"fill" | "regular">;
|
|
50
|
+
default: string;
|
|
51
|
+
};
|
|
48
52
|
editable: {
|
|
49
53
|
type: import("vue").PropType<boolean>;
|
|
50
54
|
default: boolean;
|
|
@@ -57,6 +61,10 @@ declare const TagTypes: () => import("vue").DefineComponent<{
|
|
|
57
61
|
type: import("vue").PropType<boolean>;
|
|
58
62
|
default: boolean;
|
|
59
63
|
};
|
|
64
|
+
maxLengthTooltip: {
|
|
65
|
+
type: import("vue").PropType<string>;
|
|
66
|
+
default: string;
|
|
67
|
+
};
|
|
60
68
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
61
69
|
"update:label": (value: string) => void;
|
|
62
70
|
remove: () => void;
|
|
@@ -107,6 +115,10 @@ declare const TagTypes: () => import("vue").DefineComponent<{
|
|
|
107
115
|
type: import("vue").PropType<boolean>;
|
|
108
116
|
required: true;
|
|
109
117
|
};
|
|
118
|
+
iconType: {
|
|
119
|
+
type: import("vue").PropType<"fill" | "regular">;
|
|
120
|
+
default: string;
|
|
121
|
+
};
|
|
110
122
|
editable: {
|
|
111
123
|
type: import("vue").PropType<boolean>;
|
|
112
124
|
default: boolean;
|
|
@@ -119,6 +131,10 @@ declare const TagTypes: () => import("vue").DefineComponent<{
|
|
|
119
131
|
type: import("vue").PropType<boolean>;
|
|
120
132
|
default: boolean;
|
|
121
133
|
};
|
|
134
|
+
maxLengthTooltip: {
|
|
135
|
+
type: import("vue").PropType<string>;
|
|
136
|
+
default: string;
|
|
137
|
+
};
|
|
122
138
|
}>> & {
|
|
123
139
|
onRemove?: () => any;
|
|
124
140
|
"onUpdate:label"?: (value: string) => any;
|
|
@@ -134,8 +150,10 @@ declare const TagTypes: () => import("vue").DefineComponent<{
|
|
|
134
150
|
rounded: boolean;
|
|
135
151
|
maxLength: number;
|
|
136
152
|
placeholder: string;
|
|
153
|
+
iconType: "fill" | "regular";
|
|
137
154
|
editable: boolean;
|
|
138
155
|
isInvalid: boolean;
|
|
139
156
|
selectable: boolean;
|
|
157
|
+
maxLengthTooltip: string;
|
|
140
158
|
}>[];
|
|
141
159
|
export { Tag, TagTypes };
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './
|
|
1
|
+
import './IncludeExclude.vue_vue_type_style_index_0_scoped_cc2adbf5_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.
|
|
3
|
+
"version": "2.2.0-rc.29",
|
|
4
4
|
"engines": {
|
|
5
5
|
"npm": ">=7.0.0",
|
|
6
6
|
"node": ">=16.0.0"
|
|
@@ -239,7 +239,8 @@
|
|
|
239
239
|
"./sortableList": "./components/sortableList/index.js",
|
|
240
240
|
"./composables/useFormValidation": "./composables/useFormValidation.js",
|
|
241
241
|
"./composables/useDateService": "./composables/useDateService.js",
|
|
242
|
-
"./utils/": "./utils/index.ts"
|
|
242
|
+
"./utils/": "./utils/index.ts",
|
|
243
|
+
"./tag": "./components/tag/index.js"
|
|
243
244
|
},
|
|
244
245
|
"typesVersions": {
|
|
245
246
|
"*": {
|
|
@@ -494,6 +495,9 @@
|
|
|
494
495
|
],
|
|
495
496
|
"composables/useDateService": [
|
|
496
497
|
"./composables/useDateService.d.ts"
|
|
498
|
+
],
|
|
499
|
+
"tag": [
|
|
500
|
+
"./components/tag/index.d.ts"
|
|
497
501
|
]
|
|
498
502
|
}
|
|
499
503
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap";.font-tab-label2[data-v-18d036b6],.font-chart-2[data-v-18d036b6],.font-chart-1[data-v-18d036b6]{font-family:Inter,sans-serif;font-weight:700}.tag-input-sizer[data-v-18d036b6],.tag-input[data-v-18d036b6],.font-chip-label[data-v-18d036b6],.font-table-label[data-v-18d036b6],.font-button[data-v-18d036b6],.font-heading-6[data-v-18d036b6],.font-heading-5[data-v-18d036b6],.font-heading-4[data-v-18d036b6],.font-heading-3[data-v-18d036b6],.font-heading-2[data-v-18d036b6],.font-heading-1[data-v-18d036b6],.font-title[data-v-18d036b6]{font-family:Inter,sans-serif;font-weight:600}.font-tab-label1[data-v-18d036b6],.font-input-label[data-v-18d036b6],.font-overline[data-v-18d036b6],.font-subtitle-2[data-v-18d036b6],.font-subtitle-1[data-v-18d036b6]{font-family:Inter,sans-serif;font-weight:500}.font-caption[data-v-18d036b6],.font-body-2[data-v-18d036b6],.font-body-1[data-v-18d036b6]{font-family:Inter,sans-serif;font-weight:400}.font-title[data-v-18d036b6]{font-size:2.5rem;line-height:3rem;letter-spacing:-.055rem}.font-heading-1[data-v-18d036b6]{font-size:1.5rem;line-height:1.75rem;letter-spacing:-.0285rem}.font-heading-2[data-v-18d036b6]{font-size:1.125rem;line-height:1.75rem;letter-spacing:-.01575rem}.font-heading-3[data-v-18d036b6]{font-size:1rem;line-height:1.5rem;letter-spacing:-.011rem}.font-heading-4[data-v-18d036b6]{font-size:.875rem;line-height:1rem;letter-spacing:unset}.font-heading-5[data-v-18d036b6]{font-size:.8125rem;line-height:16px;letter-spacing:unset}.font-heading-6[data-v-18d036b6]{font-size:.75rem;line-height:.75rem;letter-spacing:0}.font-body-1[data-v-18d036b6]{font-size:.875rem;line-height:1.25rem;letter-spacing:-.00525rem}.font-body-2[data-v-18d036b6]{font-size:.8125rem;line-height:1.25rem;letter-spacing:-.00244rem}.font-subtitle-1[data-v-18d036b6]{font-size:.875rem;line-height:1.25rem;letter-spacing:-.00525rem}.font-subtitle-2[data-v-18d036b6]{font-size:.8125rem;line-height:1.25rem;letter-spacing:-.00244rem}.font-chart-1[data-v-18d036b6]{font-size:1.5rem;line-height:1.5rem;letter-spacing:-.015rem}.font-chart-2[data-v-18d036b6]{font-size:1.25rem;line-height:1.25rem;letter-spacing:-.0125rem}.font-button[data-v-18d036b6]{font-size:.875rem;line-height:1.25rem;letter-spacing:.00875rem}.font-overline[data-v-18d036b6]{font-size:.75rem;line-height:1rem;letter-spacing:.045rem;text-transform:uppercase}.font-caption[data-v-18d036b6]{font-size:.75rem;line-height:1rem}.font-table-label[data-v-18d036b6]{font-size:.8125rem;line-height:1.25rem;letter-spacing:.00813rem}.font-input-label[data-v-18d036b6]{font-size:.8125rem;line-height:1rem;letter-spacing:.00813rem}.font-tab-label1[data-v-18d036b6],.font-tab-label2[data-v-18d036b6]{font-size:.875rem;line-height:1rem}.tag-input-sizer[data-v-18d036b6],.tag-input[data-v-18d036b6],.font-chip-label[data-v-18d036b6]{font-size:.75rem;line-height:1rem}h1[data-v-18d036b6],h2[data-v-18d036b6],h3[data-v-18d036b6],h4[data-v-18d036b6],h5[data-v-18d036b6],h6[data-v-18d036b6]{margin:0}.rounded-tag[data-v-18d036b6]{border-radius:100px}.tag-editing[data-v-18d036b6]{outline:1px solid var(--outline-color)}.unselected-tag-hover-outline[data-v-18d036b6]{background-color:var(--action-hover)}.tag-hover-outline[data-v-18d036b6]{outline:1px solid var(--outline-color);cursor:pointer}.empty-tag[data-v-18d036b6]{background-color:transparent;outline:1px dashed var(--action-outlined-border);color:var(--text-secondary)}.empty-tag[data-v-18d036b6]:hover{outline:1px dashed var(--action-active)}.unselected-tag[data-v-18d036b6]{outline:1px solid var(--action-outlined-border)}.tag-disabled[data-v-18d036b6]{background-color:transparent;outline:1px solid var(--action-disabled)}.tag-content[data-v-18d036b6]{display:flex;align-items:center;position:relative;min-width:.625rem;max-width:31.25rem}.tag-icon[data-v-18d036b6]{margin-right:.25rem}.tag-label[data-v-18d036b6]{user-select:none;min-width:.5rem}.tag-label--disabled[data-v-18d036b6]{color:var(--action-disabled)}.tag-label--hidden[data-v-18d036b6]{visibility:hidden}.tag-input[data-v-18d036b6]{position:static;width:auto;background:transparent;min-width:.6rem;padding:0;border:none;max-width:100%;overflow-x:auto;white-space:nowrap}.tag-input[data-v-18d036b6]:focus{outline:none}.tag-input-outline[data-v-18d036b6]::placeholder{color:var(--action-disabled)}.clear-button[data-v-18d036b6]{margin-left:.25rem;color:var(--action-active);cursor:pointer}.clear-button[data-v-18d036b6]:hover{color:var(--text-primary)}.clear-button--invalid[data-v-18d036b6]{color:var(--error-dark)}.clear-button--invalid[data-v-18d036b6]:hover{color:var(--error-darker)}.tag-input-sizer[data-v-18d036b6]{position:absolute;visibility:hidden;height:0;white-space:pre;pointer-events:none;padding:0}
|