@dataloop-ai/components 0.17.89 → 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.89",
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/packAndRunV2.sh",
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",
@@ -131,11 +131,6 @@ export default defineComponent({
131
131
  default: 'left',
132
132
  validator: (v: string) =>
133
133
  ['left', 'right', 'justify', 'center'].includes(v)
134
- },
135
- border: {
136
- type: String,
137
- required: false,
138
- default: null
139
134
  }
140
135
  },
141
136
  setup(props, { emit, attrs }) {
@@ -178,7 +173,12 @@ export default defineComponent({
178
173
 
179
174
  const { showPortal, hidePortal, portalIsActive, portalEl } = usePortal(
180
175
  vm,
181
- innerRef
176
+ innerRef,
177
+ false,
178
+ {
179
+ parentId: attrs.id as string,
180
+ parentClass: attrs.class as string
181
+ }
182
182
  )
183
183
 
184
184
  const isMobile = computed(() => isMobileOrTablet())
@@ -391,7 +391,9 @@ export default defineComponent({
391
391
  Object.assign(vm!.proxy, { updatePosition })
392
392
 
393
393
  return {
394
- uuid: `dl-tooltip-${v4()}`,
394
+ uuid: (attrs.id as string)?.length
395
+ ? attrs.id
396
+ : `dl-tooltip-${v4()}`,
395
397
  portalIsActive,
396
398
  classes: ['dl-tooltip dl-position-engine', attrs.class],
397
399
  showing,
@@ -414,8 +416,7 @@ export default defineComponent({
414
416
  '--dl-tooltip-text-align': props.textAlignment,
415
417
  '--dl-tooltip-text-transform': props.capitalized
416
418
  ? 'capitalize'
417
- : 'none',
418
- '--dl-tooltip-border': props.border
419
+ : 'none'
419
420
  }
420
421
  ] as any
421
422
  }
@@ -431,13 +432,12 @@ export default defineComponent({
431
432
  overflow-y: auto;
432
433
  overflow-x: hidden;
433
434
  min-height: 16px;
434
- padding: 2px 5px;
435
+ padding: var(--dl-tooltip-padding, 2px 5px);
435
436
  font-size: var(--dl-font-size-small);
436
437
  line-height: 16px;
437
438
  color: var(--dl-tooltip-color);
438
439
  background: var(--dl-tooltip-background);
439
440
  border-radius: 2px;
440
- border: var(--dl-tooltip-border) solid var(--dl-color-separator);
441
441
  text-transform: none;
442
442
  font-family: 'Roboto', sans-serif;
443
443
  font-weight: 400;
@@ -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>
@@ -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