Skip to content

Commit bb63559

Browse files
committed
updating readme
adding contribution guidelines
1 parent 42c98ea commit bb63559

File tree

6 files changed

+131
-54
lines changed

6 files changed

+131
-54
lines changed

CONTRIBUTING.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Contributor Code of Conduct
2+
3+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4+
5+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6+
7+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8+
9+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10+
11+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12+
13+
This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at https://www.contributor-covenant.org/version/1/0/0/code-of-conduct.html

README.md

Lines changed: 75 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,17 @@
1111
1212
![app-home](./readme-assets/app-home.png)
1313

14-
[Edit on Stackblitz](https://stackblitz.com/edit/vue-mkrnwq?file=src/App.vue)
14+
[![Edit vue-float-menu](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/vue-float-menu-e09z4?fontsize=14&hidenavigation=1&theme=dark)
1515

1616
## Features
1717

18-
**Draggable Menu Handle** - Drag and easily place the Menu anywhere on screen.
18+
**Draggable Menu Handle** - Drag and easily place the menu anywhere on screen.
1919

2020
**Smart Menu** - Detects the top & bottom edges of the screen and flips the menu automatically.
2121

2222
**Smart Placement** - The Menu head automatically adjusts itself and always stays inside the viewport.
2323

24-
**Nested Menus** - Support for Nested menus up to any levels.
25-
26-
**Composition API** - Built using the latest Composition API from Vue 3.
24+
**Nested Menus** - Support for Nested menus.
2725

2826
## ⚙ Installation
2927

@@ -38,14 +36,56 @@ float-menu has some great defaults. Please check the props list for details on a
3836
The following snippet sets the default position of the menu as `top left` and default menu direction as `bottom`.
3937

4038
```sh
39+
<template>
4140
<float-menu
42-
position="top left"
41+
:position="'top left'"
4342
:dimension="50"
44-
:menu-data="menuData"
45-
menu-direction="bottom"
43+
:menu-data="items"
44+
:on-selected="handleSelection"
45+
menu-orientation="bottom"
4646
>
47-
<BoxIcon />
47+
Drag
4848
</float-menu>
49+
</template>
50+
51+
<script>
52+
import { FloatMenu } from "vue-float-menu";
53+
import "vue-float-menu/dist/vue-float-menu.css";
54+
55+
export default {
56+
components: {
57+
FloatMenu,
58+
},
59+
setup() {
60+
const handleSelection = (selectedItem: string) => {
61+
console.log(selectedItem);
62+
};
63+
return {
64+
handleSelection,
65+
};
66+
},
67+
data() {
68+
return {
69+
items: [
70+
{ name: "New" },
71+
{
72+
name: "Edit",
73+
subMenu: {
74+
name: "edit-items",
75+
items: [{ name: "Copy" }, { name: "Paste" }],
76+
},
77+
},
78+
{
79+
name: "Open Recent"
80+
},
81+
{
82+
name: "Save",
83+
}
84+
],
85+
};
86+
},
87+
};
88+
</script>
4989
```
5090
5191
## 📺 Demo
@@ -128,7 +168,7 @@ prop to set the `height` and `width` of the menu.
128168
129169
Use the `menu-data` prop to create Simple or Nested menus of your liking. `menu-data` takes an array of `MenuItem` type
130170
131-
**List of MenuItem properties**
171+
MenuItem properties
132172
133173
| property | description |
134174
| ----------- | --------------------------------------------------------------------- |
@@ -189,7 +229,7 @@ hook for the menu item selection event.
189229
</float-menu>
190230
```
191231
192-
### Auto flip on edges
232+
### Flip on edges
193233
194234
setting this prop `flips` the menu content on the right edges of the screen. This is useful you have nested menus of many levels.
195235
@@ -232,6 +272,30 @@ and here we render a custom text inside the Menu handle
232272
233273
![example2](./readme-assets/example2.png)
234274
275+
## Build Setup
276+
277+
``` bash
278+
# install dependencies
279+
yarn install
280+
281+
# start dev
282+
yarn run dev
283+
284+
# run css linting
285+
yarn run lint:css
286+
287+
# package lib
288+
npm run rollup
289+
```
290+
291+
## Contributing
292+
293+
1. Fork it ( [https://github.com/prabhuignoto/vue-float-menu/fork](https://github.com/prabhuignoto/vue-float-menu/fork) )
294+
2. Create your feature branch (`git checkout -b new-feature`)
295+
3. Commit your changes (`git commit -am 'Add feature'`)
296+
4. Push to the branch (`git push origin new-feature`)
297+
5. Create a new Pull Request
298+
235299
## 🔨 Built with
236300
237301
- [Vue.JS](vue) - The Component is written in Vue + [Typescript](typescript).

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
"@rollup/plugin-sucrase": "^3.1.0",
3434
"@rollup/plugin-typescript": "^6.0.0",
3535
"@types/nanoid": "^2.1.0",
36-
"@typescript-eslint/eslint-plugin": "^4.2.0",
37-
"@typescript-eslint/parser": "^4.2.0",
36+
"@typescript-eslint/eslint-plugin": "^4.3.0",
37+
"@typescript-eslint/parser": "^4.3.0",
3838
"@vue/compiler-sfc": "^3.0.0",
3939
"eslint": "^7.10.0",
4040
"eslint-plugin-vue": "^7.0.0-beta.4",

readme-assets/demo.gif

-489 KB
Loading
47.8 KB
Loading

yarn.lock

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -490,74 +490,74 @@
490490
resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.3.tgz#9c088679876f374eb5983f150d4787aa6fb32d7e"
491491
integrity sha512-FvUupuM3rlRsRtCN+fDudtmytGO6iHJuuRKS1Ss0pG5z8oX0diNEw94UEL7hgDbpN94rgaK5R7sWm6RrSkZuAQ==
492492

493-
"@typescript-eslint/eslint-plugin@^4.2.0":
494-
version "4.2.0"
495-
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.2.0.tgz#a3d5c11b377b7e18f3cd9c4e87d465fe9432669b"
496-
integrity sha512-zBNRkzvLSwo6y5TG0DVcmshZIYBHKtmzD4N+LYnfTFpzc4bc79o8jNRSb728WV7A4Cegbs+MV5IRAj8BKBgOVQ==
493+
"@typescript-eslint/eslint-plugin@^4.3.0":
494+
version "4.3.0"
495+
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.3.0.tgz#1a23d904bf8ea248d09dc3761af530d90f39c8fa"
496+
integrity sha512-RqEcaHuEKnn3oPFislZ6TNzsBLqpZjN93G69SS+laav/I8w/iGMuMq97P0D2/2/kW4SCebHggqhbcCfbDaaX+g==
497497
dependencies:
498-
"@typescript-eslint/experimental-utils" "4.2.0"
499-
"@typescript-eslint/scope-manager" "4.2.0"
498+
"@typescript-eslint/experimental-utils" "4.3.0"
499+
"@typescript-eslint/scope-manager" "4.3.0"
500500
debug "^4.1.1"
501501
functional-red-black-tree "^1.0.1"
502502
regexpp "^3.0.0"
503503
semver "^7.3.2"
504504
tsutils "^3.17.1"
505505

506-
"@typescript-eslint/experimental-utils@4.2.0":
507-
version "4.2.0"
508-
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.2.0.tgz#3d0b5cd4aa61f5eb7aa1e873dea0db1410b062d2"
509-
integrity sha512-5BBj6BjgHEndBaQQpUVzRIPERz03LBc0MCQkHwUaH044FJFL08SwWv/sQftk7gf0ShZ2xZysz0LTwCwNt4Xu3w==
506+
"@typescript-eslint/experimental-utils@4.3.0":
507+
version "4.3.0"
508+
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-4.3.0.tgz#3f3c6c508e01b8050d51b016e7f7da0e3aefcb87"
509+
integrity sha512-cmmIK8shn3mxmhpKfzMMywqiEheyfXLV/+yPDnOTvQX/ztngx7Lg/OD26J8gTZfkLKUmaEBxO2jYP3keV7h2OQ==
510510
dependencies:
511511
"@types/json-schema" "^7.0.3"
512-
"@typescript-eslint/scope-manager" "4.2.0"
513-
"@typescript-eslint/types" "4.2.0"
514-
"@typescript-eslint/typescript-estree" "4.2.0"
512+
"@typescript-eslint/scope-manager" "4.3.0"
513+
"@typescript-eslint/types" "4.3.0"
514+
"@typescript-eslint/typescript-estree" "4.3.0"
515515
eslint-scope "^5.0.0"
516516
eslint-utils "^2.0.0"
517517

518-
"@typescript-eslint/parser@^4.2.0":
519-
version "4.2.0"
520-
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.2.0.tgz#1879ef400abd73d972e20f14c3522e5b343d1d1b"
521-
integrity sha512-54jJ6MwkOtowpE48C0QJF9iTz2/NZxfKVJzv1ha5imigzHbNSLN9yvbxFFH1KdlRPQrlR8qxqyOvLHHxd397VA==
518+
"@typescript-eslint/parser@^4.3.0":
519+
version "4.3.0"
520+
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.3.0.tgz#684fc0be6551a2bfcb253991eec3c786a8c063a3"
521+
integrity sha512-JyfRnd72qRuUwItDZ00JNowsSlpQGeKfl9jxwO0FHK1qQ7FbYdoy5S7P+5wh1ISkT2QyAvr2pc9dAemDxzt75g==
522522
dependencies:
523-
"@typescript-eslint/scope-manager" "4.2.0"
524-
"@typescript-eslint/types" "4.2.0"
525-
"@typescript-eslint/typescript-estree" "4.2.0"
523+
"@typescript-eslint/scope-manager" "4.3.0"
524+
"@typescript-eslint/types" "4.3.0"
525+
"@typescript-eslint/typescript-estree" "4.3.0"
526526
debug "^4.1.1"
527527

528-
"@typescript-eslint/scope-manager@4.2.0":
529-
version "4.2.0"
530-
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.2.0.tgz#d10e6854a65e175b22a28265d372a97c8cce4bfc"
531-
integrity sha512-Tb402cxxObSxWIVT+PnBp5ruT2V/36yj6gG4C9AjkgRlZpxrLAzWDk3neen6ToMBGeGdxtnfFLoJRUecGz9mYQ==
528+
"@typescript-eslint/scope-manager@4.3.0":
529+
version "4.3.0"
530+
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-4.3.0.tgz#c743227e087545968080d2362cfb1273842cb6a7"
531+
integrity sha512-cTeyP5SCNE8QBRfc+Lgh4Xpzje46kNUhXYfc3pQWmJif92sjrFuHT9hH4rtOkDTo/si9Klw53yIr+djqGZS1ig==
532532
dependencies:
533-
"@typescript-eslint/types" "4.2.0"
534-
"@typescript-eslint/visitor-keys" "4.2.0"
533+
"@typescript-eslint/types" "4.3.0"
534+
"@typescript-eslint/visitor-keys" "4.3.0"
535535

536-
"@typescript-eslint/types@4.2.0":
537-
version "4.2.0"
538-
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.2.0.tgz#6f6b094329e72040f173123832397c7c0b910fc8"
539-
integrity sha512-xkv5nIsxfI/Di9eVwN+G9reWl7Me9R5jpzmZUch58uQ7g0/hHVuGUbbn4NcxcM5y/R4wuJIIEPKPDb5l4Fdmwg==
536+
"@typescript-eslint/types@4.3.0":
537+
version "4.3.0"
538+
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.3.0.tgz#1f0b2d5e140543e2614f06d48fb3ae95193c6ddf"
539+
integrity sha512-Cx9TpRvlRjOppGsU6Y6KcJnUDOelja2NNCX6AZwtVHRzaJkdytJWMuYiqi8mS35MRNA3cJSwDzXePfmhU6TANw==
540540

541-
"@typescript-eslint/typescript-estree@4.2.0":
542-
version "4.2.0"
543-
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.2.0.tgz#9d746240991c305bf225ad5e96cbf57e7fea0551"
544-
integrity sha512-iWDLCB7z4MGkLipduF6EOotdHNtgxuNKnYD54nMS/oitFnsk4S3S/TE/UYXQTra550lHtlv9eGmp+dvN9pUDtA==
541+
"@typescript-eslint/typescript-estree@4.3.0":
542+
version "4.3.0"
543+
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.3.0.tgz#0edc1068e6b2e4c7fdc54d61e329fce76241cee8"
544+
integrity sha512-ZAI7xjkl+oFdLV/COEz2tAbQbR3XfgqHEGy0rlUXzfGQic6EBCR4s2+WS3cmTPG69aaZckEucBoTxW9PhzHxxw==
545545
dependencies:
546-
"@typescript-eslint/types" "4.2.0"
547-
"@typescript-eslint/visitor-keys" "4.2.0"
546+
"@typescript-eslint/types" "4.3.0"
547+
"@typescript-eslint/visitor-keys" "4.3.0"
548548
debug "^4.1.1"
549549
globby "^11.0.1"
550550
is-glob "^4.0.1"
551551
lodash "^4.17.15"
552552
semver "^7.3.2"
553553
tsutils "^3.17.1"
554554

555-
"@typescript-eslint/visitor-keys@4.2.0":
556-
version "4.2.0"
557-
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.2.0.tgz#ae13838e3a260b63ae51021ecaf1d0cdea8dbba5"
558-
integrity sha512-WIf4BNOlFOH2W+YqGWa6YKLcK/EB3gEj2apCrqLw6mme1RzBy0jtJ9ewJgnrZDB640zfnv8L+/gwGH5sYp/rGw==
555+
"@typescript-eslint/visitor-keys@4.3.0":
556+
version "4.3.0"
557+
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.3.0.tgz#0e5ab0a09552903edeae205982e8521e17635ae0"
558+
integrity sha512-xZxkuR7XLM6RhvLkgv9yYlTcBHnTULzfnw4i6+z2TGBLy9yljAypQaZl9c3zFvy7PNI7fYWyvKYtohyF8au3cw==
559559
dependencies:
560-
"@typescript-eslint/types" "4.2.0"
560+
"@typescript-eslint/types" "4.3.0"
561561
eslint-visitor-keys "^2.0.0"
562562

563563

0 commit comments

Comments
 (0)