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

Commit f1cf72f

Browse files
committed
Code formatting with Prettier
1 parent 10fae05 commit f1cf72f

15 files changed

+1271
-1027
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
end_of_line = lf
9+
insert_final_newline = true
10+
trim_trailing_whitespace=true
11+
indent_style=space
12+
indent_size=2

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto eol=lf

.prettierignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Dist
2+
dist/
3+
4+
# node modules
5+
node_modules
6+
package.json
7+
package-lock.json
8+
9+
# MacOS desktop services store
10+
.DS_Store
11+
12+
# Log files
13+
*.log
14+
15+
# Map files
16+
*.map
17+
18+
# Editors
19+
.vscode
20+
21+
# VuePress temp directory
22+
.temp
23+
24+
# Source Control
25+
.github
26+
27+
# Secure
28+
.env

.prettierrc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"arrowParens": "always",
3+
"bracketSpacing": true,
4+
"endOfLine": "lf",
5+
"htmlWhitespaceSensitivity": "css",
6+
"jsxBracketSameLine": true,
7+
"jsxSingleQuote": true,
8+
"printWidth": 120,
9+
"quoteProps": "consistent",
10+
"semi": false,
11+
"singleQuote": true,
12+
"tabWidth": 2,
13+
"trailingComma": "all",
14+
"useTabs": false,
15+
"vueIndentScriptAndStyle": true
16+
}

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## [Version 1.2.1](https://github.com/adamdehaven/vue-custom-tooltip/releases/tag/v1.2.1) (2020-10-30)
2+
3+
### Misc.
4+
5+
- Added Prettier; no changes to functionality or configuration.
6+
17
## [Version 1.2.0](https://github.com/adamdehaven/vue-custom-tooltip/releases/tag/v1.2.0) (2020-09-25)
28

39
### Fixes
@@ -31,4 +37,4 @@
3137

3238
## [Version 1.0.0](https://github.com/adamdehaven/vue-custom-tooltip/releases/tag/v1.0.0) (2020-08-20)
3339

34-
### Initial Release :tada:
40+
### Initial Release :tada:

README.md

Lines changed: 63 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ A customizable, reusable, and reactive tooltip component for Vue (and VuePress)
66

77
## Installation
88

9-
``` sh
9+
```sh
1010
# With npm
1111
npm install @adamdehaven/vue-custom-tooltip
1212

@@ -18,7 +18,7 @@ yarn add @adamdehaven/vue-custom-tooltip
1818

1919
It is recommended to install the plugin in your Vue project's entry file. For projects created with [`@vue/cli`](https://cli.vuejs.org/), this is likely your `main.js` file where you are already importing `Vue`.
2020

21-
``` js
21+
```js
2222
// main.js (or your Vue entry file)
2323

2424
// Import Vue... you're probably already doing this
@@ -37,11 +37,11 @@ Vue.use(VueCustomTooltip)
3737

3838
// 2. Install with custom options (defaults shown)
3939
Vue.use(VueCustomTooltip, {
40-
name: 'VueCustomTooltip',
41-
color: '#fff',
42-
background: '#000',
43-
borderRadius: 12,
44-
fontWeight: 400,
40+
name: 'VueCustomTooltip',
41+
color: '#fff',
42+
background: '#000',
43+
borderRadius: 12,
44+
fontWeight: 400,
4545
})
4646
```
4747

@@ -53,7 +53,7 @@ Vue.use(VueCustomTooltip, {
5353
5454
For [VuePress](https://vuepress.vuejs.org/) projects, the `theme/enhanceApp.js` is a good location to initialize plugins.
5555

56-
``` js
56+
```js
5757
// theme/enhanceApp.js
5858

5959
// Import Vue... you're probably already doing this
@@ -63,51 +63,51 @@ import Vue from 'vue'
6363
import VueCustomTooltip from '@adamdehaven/vue-custom-tooltip'
6464

6565
export default ({
66-
Vue, // the version of Vue being used in the VuePress app
67-
options, // the options for the root Vue instance
68-
router, // the router instance for the app
69-
siteData, // site metadata
70-
isServer, // is this enhancement applied in server-rendering or client
66+
Vue, // the version of Vue being used in the VuePress app
67+
options, // the options for the root Vue instance
68+
router, // the router instance for the app
69+
siteData, // site metadata
70+
isServer, // is this enhancement applied in server-rendering or client
7171
}) => {
72-
// ...apply enhancements to the app
72+
// ...apply enhancements to the app
7373

74-
// Install the plugin using ONE of the options below:
75-
// --------------------------------------------------
74+
// Install the plugin using ONE of the options below:
75+
// --------------------------------------------------
7676

77-
// 1. Install with default options
78-
Vue.use(VueCustomTooltip)
77+
// 1. Install with default options
78+
Vue.use(VueCustomTooltip)
7979

80-
// ===== OR =====
80+
// ===== OR =====
8181

82-
// 2. Install with custom options (defaults shown)
83-
Vue.use(VueCustomTooltip, {
84-
name: 'VueCustomTooltip',
85-
color: '#fff',
86-
background: '#000',
87-
borderRadius: 12,
88-
fontWeight: 400,
89-
})
82+
// 2. Install with custom options (defaults shown)
83+
Vue.use(VueCustomTooltip, {
84+
name: 'VueCustomTooltip',
85+
color: '#fff',
86+
background: '#000',
87+
borderRadius: 12,
88+
fontWeight: 400,
89+
})
9090
}
9191
```
9292

9393
### In-Component Install
9494

9595
Alternatively, you may install the component directly within a single file in your project; however, you will not be able to customize the `Vue.use()` options.
9696

97-
``` html
97+
```html
9898
<!-- Single file component -->
9999

100100
<script>
101-
// Import the tooltip component (no options available)
102-
import VueCustomTooltip from '@adamdehaven/vue-custom-tooltip'
101+
// Import the tooltip component (no options available)
102+
import VueCustomTooltip from '@adamdehaven/vue-custom-tooltip'
103103
104-
// .vue file default export
105-
export default {
104+
// .vue file default export
105+
export default {
106106
// Register the component
107107
components: {
108-
VueCustomTooltip,
108+
VueCustomTooltip,
109109
},
110-
}
110+
}
111111
</script>
112112
```
113113

@@ -119,7 +119,7 @@ Import the tooltip component after importing Vue in your file after importing Vu
119119

120120
Installing via the CDN requires using the kebob-case component name.
121121

122-
``` html
122+
```html
123123
<!-- Import Vue -->
124124
<script src="https://unpkg.com/vue/dist/vue.js"></script>
125125
<!-- Import tooltip component -->
@@ -135,7 +135,7 @@ Download `dist/vue-custom-tooltip.min.js` and include it in your file after impo
135135

136136
Installing manually requires using the kebob-case component name.
137137

138-
``` html
138+
```html
139139
<!-- Import Vue -->
140140
<script src="https://unpkg.com/vue/dist/vue.js"></script>
141141
<!-- Import tooltip component -->
@@ -147,25 +147,26 @@ Installing manually requires using the kebob-case component name.
147147

148148
## Usage
149149

150-
``` html
150+
```html
151151
<!-- Basic -->
152152
What is <VueCustomTooltip label="This is a tooltip">a tooltip</VueCustomTooltip>?
153153

154154
<!-- With Props -->
155-
What is <VueCustomTooltip label="This is a tooltip" position="is-bottom" abbreviation sticky>a tooltip</VueCustomTooltip>?
155+
What is
156+
<VueCustomTooltip label="This is a tooltip" position="is-bottom" abbreviation sticky>a tooltip</VueCustomTooltip>?
156157

157158
<!-- With element(s) -->
158159
<VueCustomTooltip label="View @adamdehaven on Twitter">
159-
<a class="button" href="https://twitter.com/adamdehaven">
160-
<span class="icon icon-twitter"></span>
161-
<span>Twitter</span>
162-
</a>
160+
<a class="button" href="https://twitter.com/adamdehaven">
161+
<span class="icon icon-twitter"></span>
162+
<span>Twitter</span>
163+
</a>
163164
</VueCustomTooltip>
164165
```
165166

166167
## Options
167168

168-
Pass any of the options listed below to `Vue.use(VueCustomTooltip, {...})` to customize the plugin for your project *(not available with [in-component installation](#in-component-install))*.
169+
Pass any of the options listed below to `Vue.use(VueCustomTooltip, {...})` to customize the plugin for your project _(not available with [in-component installation](#in-component-install))_.
169170

170171
> **A note on options tied to CSS properties**
171172
>
@@ -178,15 +179,15 @@ Pass any of the options listed below to `Vue.use(VueCustomTooltip, {...})` to cu
178179

179180
Customize the name of the component you will use in your project. **Camel-case names are preferred**, as this allows for camel-case or kebob-case usage within your project.
180181

181-
``` js
182+
```js
182183
Vue.use(VueCustomTooltip, {
183-
name: 'SuperCoolTooltip', // camel-case preferred
184+
name: 'SuperCoolTooltip', // camel-case preferred
184185
})
185186
```
186187

187-
If you registered the name using camel-case, you can reference the tooltip component via camel-case *or* kebob-case:
188+
If you registered the name using camel-case, you can reference the tooltip component via camel-case _or_ kebob-case:
188189

189-
``` html
190+
```html
190191
<!-- Default name (user did not pass the 'name' option) -->
191192

192193
<!-- camel-case -->
@@ -209,9 +210,9 @@ Nice <super-cool-tooltip label="Neat!">tooltip</super-cool-tooltip>!
209210

210211
Customize the color of the text displayed in the tooltip.
211212

212-
``` js
213+
```js
213214
Vue.use(VueCustomTooltip, {
214-
color: '#c1403d', // 3 or 6 digit HEX color, including a leading hash (#)
215+
color: '#c1403d', // 3 or 6 digit HEX color, including a leading hash (#)
215216
})
216217
```
217218

@@ -222,9 +223,9 @@ Vue.use(VueCustomTooltip, {
222223

223224
Customize the background color (and the `underlined` text color) of the tooltip.
224225

225-
``` js
226+
```js
226227
Vue.use(VueCustomTooltip, {
227-
background: '#1b2735', // 3 or 6 digit HEX color, including a leading hash (#)
228+
background: '#1b2735', // 3 or 6 digit HEX color, including a leading hash (#)
228229
})
229230
```
230231

@@ -235,9 +236,9 @@ Vue.use(VueCustomTooltip, {
235236

236237
Customize the border-radius of the tooltip. Must be an integer.
237238

238-
``` js
239+
```js
239240
Vue.use(VueCustomTooltip, {
240-
borderRadius: 4,
241+
borderRadius: 4,
241242
})
242243
```
243244

@@ -248,9 +249,9 @@ Vue.use(VueCustomTooltip, {
248249

249250
Customize the font-weight of the tooltip text. Must be an integer that is a multiple of 100, between 100 - 900.
250251

251-
``` js
252+
```js
252253
Vue.use(VueCustomTooltip, {
253-
fontWeight: 700,
254+
fontWeight: 700,
254255
})
255256
```
256257

@@ -260,13 +261,13 @@ In addition to the [Plugin Options](#options) above, you may also pass props to
260261

261262
Props that accept a Boolean value may be passed simply by adding the attribute to the component tag, if a `true` value is desired. See the `sticky` example here:
262263

263-
``` html
264+
```html
264265
<VueCustomTooltip label="Tooltip" sticky>text/element</VueCustomTooltip>
265266
```
266267

267268
All other props may be passed as normal attributes (if the corresponding value is a String, like the `label` prop, shown above) or with `v-bind` directives, as shown here:
268269

269-
``` html
270+
```html
270271
<VueCustomTooltip :label="element.helpText" :sticky="false">text/element</VueCustomTooltip>
271272
```
272273

@@ -303,7 +304,7 @@ The position of the tooltip in relation to the text/element it is surrounding.
303304

304305
Swaps out the component's standard `<span>` element with a semantically-correct `<abbr>` element, and sets the [`underlined`](#underlined) prop to `true`. This is useful when adding a tooltip to text within a page's content where you want to provide additional context to a word or phrase, or provide a definition of a word or acronym.
305306

306-
``` html
307+
```html
307308
VuePress pages are served as an <VueCustomTooltip label="Single Page Application" abbreviation>SPA</VueCustomTooltip>.
308309
```
309310

@@ -340,9 +341,11 @@ The width of the tooltip, if the [`multiline`](#multiline) prop is set to `true`
340341

341342
Just like any other Vue component, you can add classes or styles directly to the component tag that will be applied to the rendered `<span>` tag (or `<abbr>` tag, if `abbreviation` is set to `true`).
342343

343-
``` html
344+
```html
344345
<!-- Tooltip component with custom classes and styles -->
345-
<VueCustomTooltip class="your-class" :class="{ 'dynamic-class': isDynamic }" :style="{ display: 'inline' }" label="Neat">text</VueCustomTooltip>
346+
<VueCustomTooltip class="your-class" :class="{ 'dynamic-class': isDynamic }" :style="{ display: 'inline' }" label="Neat"
347+
>text</VueCustomTooltip
348+
>
346349
```
347350

348351
This is extremely helpful if you want to extend functionality or tooltip styles within your project, which allows you to tweak things like the display behavior of the tooltip element.

0 commit comments

Comments
 (0)