{"id":26763570,"url":"https://github.com/jbee37142/simple-navigation-component","last_synced_at":"2025-03-28T19:21:15.229Z","repository":{"id":57309012,"uuid":"92792999","full_name":"jbee37142/simple-navigation-component","owner":"jbee37142","description":"Jbee's simple-navigation-component","archived":false,"fork":false,"pushed_at":"2017-07-13T12:24:25.000Z","size":203,"stargazers_count":2,"open_issues_count":9,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-27T03:31:17.008Z","etag":null,"topics":["ajax","component","es6-javascript","javascript","navigation"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/simple-navigation-component","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jbee37142.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-30T02:55:28.000Z","updated_at":"2019-02-21T09:33:16.000Z","dependencies_parsed_at":"2022-09-06T22:30:51.939Z","dependency_job_id":null,"html_url":"https://github.com/jbee37142/simple-navigation-component","commit_stats":null,"previous_names":["jaeyeophan/component_development_practice","jbee37142/simple-navigation-component"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbee37142%2Fsimple-navigation-component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbee37142%2Fsimple-navigation-component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbee37142%2Fsimple-navigation-component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbee37142%2Fsimple-navigation-component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jbee37142","download_url":"https://codeload.github.com/jbee37142/simple-navigation-component/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246085655,"owners_count":20721213,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ajax","component","es6-javascript","javascript","navigation"],"created_at":"2025-03-28T19:21:14.749Z","updated_at":"2025-03-28T19:21:15.217Z","avatar_url":"https://github.com/jbee37142.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# simple-navigation-component\n[![Build Status](https://travis-ci.org/JaeYeopHan/simple-navigation-component.svg?branch=master)](https://travis-ci.org/JaeYeopHan/simple-navigation-component)  [![npm version](https://badge.fury.io/js/simple-navigation-component.svg)](https://badge.fury.io/js/simple-navigation-component) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n                                                                                                                                                                                                                                                                                    \n\n\n**This is a navigation component created with vanilla js (ES6).**  \nSimply pass api and the id value of the html you want to specify as root, and the `renderOption` to complete the navigation.\n\n## Install\n```bash\n$ npm install --save-dev simple-navigation-component\n# or\n$ yarn add -D simple-navigation-component\n```\n\n## Feature\nYou can see the demo with list component in [demo-branch](https://github.com/JaeYeopHan/Navigation_Component/tree/demo-branch)  \n\n### 1. Caching fetched data\nAssuming that the data fetched from the api does not change, once fetched from the api, the data that count of item is cached.\n\n### 2. Prev button and Next button\nThese two buttons change the index to the first index of the next or previous page. For example, if `countOfIndex` is 5, if index is between 1 and 5, clicking on the next button will move to the first index of 6 on the next page. (Similarly, if the index is between 6 and 10, click the prev button to move to index of 1.)\n\n### 3. Activate buttons according to the case\n`X`: Not clickable  |  `O`:  Clickable\n\n#### Case 1\n| 이전 | \u003c\u003c | \u003e\u003e | 다음 |\n|:-:|:-:|:-:|:-:|\n| X | X | O | O |\n\n![](/docs/DEMO_IMAGE/demo_1.png)\n\n#### Case 2\n| 이전 | \u003c\u003c | \u003e\u003e | 다음 |\n|:-:|:-:|:-:|:-:|\n| X | O | O | O |\n\n![](/docs/DEMO_IMAGE/demo_2.png)\n\n#### Case 3\n| 이전 | \u003c\u003c | \u003e\u003e | 다음 |\n|:-:|:-:|:-:|:-:|\n| O | O | O | X |\n\n![](/docs/DEMO_IMAGE/demo_3.png)\n\n#### Case 4\n| 이전 | \u003c\u003c | \u003e\u003e | 다음 |\n|:-:|:-:|:-:|:-:|\n| O | O | X | X |\n\n![](/docs/DEMO_IMAGE/demo_4.png)\n\n\u003c/br\u003e\n\n### Style\nCurrently, bootstrap framework is applied to the style. \n\n\u003c/br\u003e\n\n## Usage\n#### bootstrap CDN\n```html\n\u003clink href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css\" rel=\"stylesheet\" integrity=\"sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u\" crossorigin=\"anonymous\"\u003e\n```\n\n#### Import\n```js\nimport NavComoponent from 'simple-navigation-component';\n// or\nvar NavComponent = require('simple-navigation-component');\n```\n\n#### Create\n```js\n/**\n * \n * @type { NavComponent }\n * @param api [required] (fetch data url)\n * @param root [required] (selector)\n * \n**/\nconst nav = new NavComponent(api, '#nav');\n```\n\n#### Attatch event\n```js\n/**\n * \n * @method on\n * @event buildNav\n *        This event occurs when the navigation index changes by click.\n * \n**/\nnav.on('buildNav', data =\u003e {\n    //TODO Insert your code!\n});\n```\n\n**Also,** depending on the situation, you can customize the rendered appearance through `renderOption`.\n\n```js\nimport NavComoponent from 'simple-navigation-component';\n\nconst nav = new NavComponent(api, '#nav', {\n    countOfItem: 5,\n    countOfIndex: 3\n});\n\nnav.on('buildNav', data =\u003e {\n    //TODO Insert your code!\n});\n```\n\n#### Default renderOption\n```js\n{\n  countOfItem: 3, // Number of items to render on one page\n  countOfIndex: 5 // Number of pagination about items\n}\n```\n\u003e **Notice!**  \nIf the `renderOption` passed to the two each components is different, an **error** occurs. You can check it in tool for developer of browser.\n\n\n### API Design in component\n* To fetch value to count of data\n```\n[Domain Address]/count\n```\n\n\u003c/br\u003e\n\n## Development\n```bash\n# Clone repository and move folder\n$ git clone https://github.com/JaeYeopHan/simple-navigation-component\n$ cd simple-navigation-component\n\n# Install dependencies\n$ yarn\n# or\n$ npm install\n\n# Build\n$ npm run dev\n\n# Test\n$ npm test\n```\n\n\u003c/br\u003e\n\n## Supported Browsers\nThe following table shows browsers supported in this component.\n\n|IE|Chrome|Firefox|Safari|\n|:-:|:-:|:-:|:-:|\n|11+|Latest|Latest|Latest|\n\n\u003c/br\u003e\n\n## Dependency\n* axios\n* handlebars\n* event-emitter\n* bootstrap\n\n\u003c/br\u003e\n\n## Bug Report\nIf you find a bug, please report it to me using the [Issues](https://github.com/JaeYeopHan/simple-navigation-component/issues) page on Github.\n\n\u003c/br\u003e\n\n## LICENSE\nsimple-navigation-component is released under the [MIT License](https://github.com/JaeYeopHan/simple-navigation-component/blob/master/LICENSE).\n```\nCopyright (c) 2017 Jbee\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbee37142%2Fsimple-navigation-component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjbee37142%2Fsimple-navigation-component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbee37142%2Fsimple-navigation-component/lists"}