@dataloop-ai/components 0.17.88 → 0.17.90
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dataloop-ai/components",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.90",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": "./index.ts",
|
|
6
6
|
"./models": "./models.ts",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"dev": "vite",
|
|
11
|
-
"dev:2": "./misc/
|
|
11
|
+
"dev:2": "./misc/unpackAndRunV2.sh",
|
|
12
12
|
"build": "vue-tsc --noEmit --skipLibCheck && vite build",
|
|
13
13
|
"preview": "vite preview",
|
|
14
14
|
"storybook": "storybook dev -p 6006",
|
|
@@ -173,7 +173,12 @@ export default defineComponent({
|
|
|
173
173
|
|
|
174
174
|
const { showPortal, hidePortal, portalIsActive, portalEl } = usePortal(
|
|
175
175
|
vm,
|
|
176
|
-
innerRef
|
|
176
|
+
innerRef,
|
|
177
|
+
false,
|
|
178
|
+
{
|
|
179
|
+
parentId: attrs.id as string,
|
|
180
|
+
parentClass: attrs.class as string
|
|
181
|
+
}
|
|
177
182
|
)
|
|
178
183
|
|
|
179
184
|
const isMobile = computed(() => isMobileOrTablet())
|
|
@@ -386,7 +391,9 @@ export default defineComponent({
|
|
|
386
391
|
Object.assign(vm!.proxy, { updatePosition })
|
|
387
392
|
|
|
388
393
|
return {
|
|
389
|
-
uuid:
|
|
394
|
+
uuid: (attrs.id as string)?.length
|
|
395
|
+
? attrs.id
|
|
396
|
+
: `dl-tooltip-${v4()}`,
|
|
390
397
|
portalIsActive,
|
|
391
398
|
classes: ['dl-tooltip dl-position-engine', attrs.class],
|
|
392
399
|
showing,
|
|
@@ -425,7 +432,7 @@ export default defineComponent({
|
|
|
425
432
|
overflow-y: auto;
|
|
426
433
|
overflow-x: hidden;
|
|
427
434
|
min-height: 16px;
|
|
428
|
-
padding: 2px 5px;
|
|
435
|
+
padding: var(--dl-tooltip-padding, 2px 5px);
|
|
429
436
|
font-size: var(--dl-font-size-small);
|
|
430
437
|
line-height: 16px;
|
|
431
438
|
color: var(--dl-tooltip-color);
|
|
@@ -82,6 +82,30 @@
|
|
|
82
82
|
</div>
|
|
83
83
|
</dl-tooltip>
|
|
84
84
|
</div>
|
|
85
|
+
<div>
|
|
86
|
+
Styled Tooltip using styles
|
|
87
|
+
<dl-tooltip style="border: 1px solid red">
|
|
88
|
+
<div style="display: flex; flex-flow: row wrap; gap: 3px">
|
|
89
|
+
i am with a border!
|
|
90
|
+
</div>
|
|
91
|
+
</dl-tooltip>
|
|
92
|
+
</div>
|
|
93
|
+
<div>
|
|
94
|
+
Styled Tooltip using a class
|
|
95
|
+
<dl-tooltip class="TestID">
|
|
96
|
+
<div style="display: flex; flex-flow: row wrap; gap: 3px">
|
|
97
|
+
i am with a border!
|
|
98
|
+
</div>
|
|
99
|
+
</dl-tooltip>
|
|
100
|
+
</div>
|
|
101
|
+
<div>
|
|
102
|
+
Styled Tooltip using an id
|
|
103
|
+
<dl-tooltip id="TestID">
|
|
104
|
+
<div style="display: flex; flex-flow: row wrap; gap: 3px">
|
|
105
|
+
i am with a border!
|
|
106
|
+
</div>
|
|
107
|
+
</dl-tooltip>
|
|
108
|
+
</div>
|
|
85
109
|
</div>
|
|
86
110
|
</template>
|
|
87
111
|
|
|
@@ -128,3 +152,12 @@ export default defineComponent({
|
|
|
128
152
|
template: 'dl-tooltip-demo'
|
|
129
153
|
})
|
|
130
154
|
</script>
|
|
155
|
+
|
|
156
|
+
<style>
|
|
157
|
+
#TestID {
|
|
158
|
+
border: 1px solid red;
|
|
159
|
+
}
|
|
160
|
+
.TestID {
|
|
161
|
+
border: 1px solid red;
|
|
162
|
+
}
|
|
163
|
+
</style>
|
package/src/hooks/use-portal.ts
CHANGED
|
@@ -27,12 +27,18 @@ function isOnGlobalDialog(vm: any) {
|
|
|
27
27
|
export default function (
|
|
28
28
|
vm: ComponentInternalInstance | null,
|
|
29
29
|
innerRef: Ref<HTMLElement | null>,
|
|
30
|
-
checkGlobalDialog = false
|
|
30
|
+
checkGlobalDialog = false,
|
|
31
|
+
config: {
|
|
32
|
+
parentId?: string
|
|
33
|
+
parentClass?: string
|
|
34
|
+
parentStyle?: string
|
|
35
|
+
} = {}
|
|
31
36
|
) {
|
|
32
37
|
// showing, including while in show/hide transition
|
|
33
38
|
const portalIsActive = ref(false)
|
|
34
39
|
|
|
35
40
|
const { proxy } = vm!
|
|
41
|
+
const { parentId, parentClass, parentStyle } = config
|
|
36
42
|
|
|
37
43
|
// showing & not in any show/hide transition
|
|
38
44
|
const portalIsAccessible = ref(false)
|
|
@@ -53,7 +59,11 @@ export default function (
|
|
|
53
59
|
|
|
54
60
|
if (portalIsActive.value === false) {
|
|
55
61
|
if (onGlobalDialog === false && portalEl.value === null) {
|
|
56
|
-
portalEl.value = createGlobalNode()
|
|
62
|
+
portalEl.value = createGlobalNode(parentId)
|
|
63
|
+
portalEl.value.className =
|
|
64
|
+
portalEl.value.className + (parentClass || '')
|
|
65
|
+
portalEl.value.style.cssText =
|
|
66
|
+
portalEl.value.style.cssText + (parentStyle || '')
|
|
57
67
|
}
|
|
58
68
|
|
|
59
69
|
portalIsActive.value = true
|