Skip to content
This repository was archived by the owner on Sep 28, 2024. It is now read-only.

Commit d9b019e

Browse files
committed
Fixing named imports
1 parent a8563c2 commit d9b019e

11 files changed

+33
-21
lines changed

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,14 @@ Alternatively, you may initialize the component directly within a single file in
6969

7070
**Notes on in-component initialization**:
7171

72-
- Initializing within a component does not allow for customizing the [Plugin Options](#options); however, you may still utilize all [`props`](#props) on the `<VueCustomTooltip>` element.
72+
- Initializing within a component does not allow for customizing the [Plugin Options](#options); however, you may still utilize all [`props`](#props) on the `<VueCustomTooltip>` element, or customize styles with [CSS Variables](#css-variables).
7373

7474
```html
7575
<!-- Single file component -->
7676

7777
<script>
78-
// Import the tooltip component (no options available)
79-
// Vue 2.x
78+
// Import the tooltip component
8079
import VueCustomTooltip from '@adamdehaven/vue-custom-tooltip'
81-
// Vue 3.x (notice we're importing the actual .vue file)
82-
import VueCustomTooltip from '@adamdehaven/vue-custom-tooltip/src/VueCustomTooltip.vue'
8380
8481
// .vue file default export
8582
export default {
11.1 KB
Binary file not shown.

dist/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ declare type InstallableComponent = typeof VueCustomTooltip & {
55
};
66
declare const _default: InstallableComponent;
77
export default _default;
8+
export { VueCustomTooltip };

dist/vue-custom-tooltip.cjs.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
'use strict';
22

3+
Object.defineProperty(exports, '__esModule', { value: true });
4+
35
var vue = require('vue');
46

57
var defaultTooltipOptions = {
@@ -48,10 +50,12 @@ var script = vue.defineComponent({
4850
var htmlRoot = document && document.documentElement ? document.documentElement : null;
4951
if (htmlRoot) {
5052
/* eslint-disable @typescript-eslint/no-non-null-assertion */
51-
htmlRoot.style.setProperty('--vue-custom-tooltip-color', tooltipOptions.color);
52-
htmlRoot.style.setProperty('--vue-custom-tooltip-background', tooltipOptions.background);
53-
htmlRoot.style.setProperty('--vue-custom-tooltip-border-radius', ((tooltipOptions.borderRadius) + "px"));
54-
htmlRoot.style.setProperty('--vue-custom-tooltip-font-weight', tooltipOptions.fontWeight.toString());
53+
htmlRoot.style.setProperty('--vue-custom-tooltip-color', tooltipOptions.color !== defaultTooltipOptions.color ? tooltipOptions.color : null);
54+
htmlRoot.style.setProperty('--vue-custom-tooltip-background', tooltipOptions.background !== defaultTooltipOptions.background ? tooltipOptions.background : null);
55+
htmlRoot.style.setProperty('--vue-custom-tooltip-border-radius', tooltipOptions.borderRadius !== defaultTooltipOptions.borderRadius
56+
? ((tooltipOptions.borderRadius) + "px")
57+
: null);
58+
htmlRoot.style.setProperty('--vue-custom-tooltip-font-weight', tooltipOptions.fontWeight !== defaultTooltipOptions.fontWeight ? tooltipOptions.fontWeight.toString() : null);
5559
/* eslint-enable @typescript-eslint/no-non-null-assertion */
5660
}
5761
};
@@ -153,4 +157,5 @@ var index = (function () {
153157
return installable;
154158
})();
155159

156-
module.exports = index;
160+
exports.VueCustomTooltip = script;
161+
exports.default = index;

dist/vue-custom-tooltip.esm.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,12 @@ var script = defineComponent({
4646
var htmlRoot = document && document.documentElement ? document.documentElement : null;
4747
if (htmlRoot) {
4848
/* eslint-disable @typescript-eslint/no-non-null-assertion */
49-
htmlRoot.style.setProperty('--vue-custom-tooltip-color', tooltipOptions.color);
50-
htmlRoot.style.setProperty('--vue-custom-tooltip-background', tooltipOptions.background);
51-
htmlRoot.style.setProperty('--vue-custom-tooltip-border-radius', ((tooltipOptions.borderRadius) + "px"));
52-
htmlRoot.style.setProperty('--vue-custom-tooltip-font-weight', tooltipOptions.fontWeight.toString());
49+
htmlRoot.style.setProperty('--vue-custom-tooltip-color', tooltipOptions.color !== defaultTooltipOptions.color ? tooltipOptions.color : null);
50+
htmlRoot.style.setProperty('--vue-custom-tooltip-background', tooltipOptions.background !== defaultTooltipOptions.background ? tooltipOptions.background : null);
51+
htmlRoot.style.setProperty('--vue-custom-tooltip-border-radius', tooltipOptions.borderRadius !== defaultTooltipOptions.borderRadius
52+
? ((tooltipOptions.borderRadius) + "px")
53+
: null);
54+
htmlRoot.style.setProperty('--vue-custom-tooltip-font-weight', tooltipOptions.fontWeight !== defaultTooltipOptions.fontWeight ? tooltipOptions.fontWeight.toString() : null);
5355
/* eslint-enable @typescript-eslint/no-non-null-assertion */
5456
}
5557
};
@@ -152,3 +154,4 @@ var index = (function () {
152154
})();
153155

154156
export default index;
157+
export { script as VueCustomTooltip };

dist/vue-custom-tooltip.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@adamdehaven/vue-custom-tooltip",
3-
"version": "2.3.0",
3+
"version": "2.4.0",
44
"description": "A customizable, reusable, and reactive tooltip component for Vue 3 (including TypeScript) projects.",
55
"keywords": [
66
"Vue",

rollup.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ function createEntry({ file, format, minify }) {
1414
name: 'VueCustomTooltip',
1515
file: file,
1616
format: format,
17-
exports: 'default',
17+
// exports: 'default',
18+
exports: 'named',
1819
globals: {
1920
vue: 'Vue',
2021
},

src/App.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@
88

99
<script lang="ts">
1010
import { defineComponent } from 'vue'
11+
// import { VueCustomTooltip } from './index'
1112
1213
export default defineComponent({
1314
name: 'App',
15+
// components: {
16+
// VueCustomTooltip,
17+
// },
1418
})
1519
</script>

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,5 @@ export default ((): InstallableComponent => {
5858

5959
return installable
6060
})()
61+
62+
export { VueCustomTooltip }

src/main.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
import { createApp } from 'vue'
22
import App from './App.vue'
3-
import VueCustomTooltipPlugin from './index'
4-
import { TooltipOptions } from './types'
3+
import VueCustomTooltip from './index'
54

65
const app = createApp(App)
76

8-
const tooltipOptions: TooltipOptions = {
7+
const tooltipOptions = {
98
// name: 'VueCustomTooltip',
109
// color: '#fff',
1110
background: '#ff0000',
1211
// borderRadius: 12,
1312
// fontWeight: 400,
1413
}
1514

16-
app.use(VueCustomTooltipPlugin, tooltipOptions)
15+
app.use(VueCustomTooltip, tooltipOptions)
1716

1817
app.mount('#app')

0 commit comments

Comments
 (0)