├── .gitignore ├── src └── modal-dialog.js ├── test └── index.test.js ├── tea.yaml ├── LICENSE ├── package.json └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Directories 2 | node_modules/ 3 | dist/ 4 | coverage/ 5 | .cache/ 6 | 7 | # Files 8 | .env 9 | .DS_Store -------------------------------------------------------------------------------- /src/modal-dialog.js: -------------------------------------------------------------------------------- 1 | // modal-dialog.js 2 | 3 | class ModalDialog { 4 | constructor(title, content) { 5 | this.title = title; 6 | this.content = content; 7 | } 8 | 9 | open() { 10 | // Logika untuk membuka modal dialog 11 | console.log('Modal opened:', this.title); 12 | } 13 | 14 | close() { 15 | // Logika untuk menutup modal dialog 16 | console.log('Modal closed:', this.title); 17 | } 18 | } 19 | 20 | // Export kelas ModalDialog agar dapat digunakan di luar modul 21 | module.exports = ModalDialog; 22 | -------------------------------------------------------------------------------- /test/index.test.js: -------------------------------------------------------------------------------- 1 | const assert = require('assert'); 2 | const ModalDialog = require('../src/modal-dialog'); 3 | 4 | describe('ModalDialog', function() { 5 | describe('#open()', function() { 6 | it('should open the modal dialog', function() { 7 | const modal = new ModalDialog('Test Modal', 'This is a test modal'); 8 | modal.open(); 9 | }); 10 | }); 11 | 12 | describe('#close()', function() { 13 | it('should close the modal dialog', function() { 14 | const modal = new ModalDialog('Test Modal', 'This is a test modal'); 15 | modal.close(); 16 | }); 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /tea.yaml: -------------------------------------------------------------------------------- 1 | # https://tea.xyz/what-is-this-file 2 | --- 3 | version: 1.0.0 4 | codeOwners: 5 | - '0x9BAac40A197bbb110ae5B2f31342D8d15D734832' 6 | - '0xF7725452f90FaA6a9A71E472361EFf84c5692590' 7 | - '0x0B1A079db288F7A85Fb3C1A2377e1Ff269ee294C' 8 | - '0xe03582db8230714c9bD4333430292EB4b19D3D1B' 9 | - '0x62EAb235Abf5a22e3f20F5B7B951a57ccAA189fB' 10 | - '0xAa56e64aab202e55605fe7d8A792c0e8655d1381' 11 | - '0x754583D770e3B41C64A1114e5d291cCcD7c45C90' 12 | - '0xaB92968a3226A0e93b06631407241986F3E9609D' 13 | - '0xBd6F14a7A2Eb896c6F40808bf355d136409E210E' 14 | - '0x2043dEcdab0cBBda2D7413664459b56272400891' 15 | - '0xE40310fFC4A7FAc222Eb689C8dB095cf635c7A8f' 16 | - '0xe960002d32C4Cef1E9D1eB3b3a52725b33B84462' 17 | quorum: 1 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 ONE DIONYS 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "onedionys-modal-dialog-component", 3 | "version": "5.0.0", 4 | "description": "One Dionys (Modal Dialog Component) - A component to display a modal dialog with additional messages or content.", 5 | "main": "src/modal-dialog.js", 6 | "directories": { 7 | "test": "test" 8 | }, 9 | "scripts": { 10 | "test": "mocha" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "https://github.com/onedionys/onedionys-modal-dialog-component.git" 15 | }, 16 | "keywords": [ 17 | "onedionys", 18 | "tea", 19 | "package-manager", 20 | "modal-dialog-component" 21 | ], 22 | "author": "One Dionys", 23 | "license": "ISC", 24 | "bugs": { 25 | "url": "https://github.com/onedionys/onedionys-modal-dialog-component/issues" 26 | }, 27 | "homepage": "https://github.com/onedionys/onedionys-modal-dialog-component#readme", 28 | "dependencies": { 29 | "@types/chai": "^4.3.12", 30 | "@types/mocha": "^10.0.6", 31 | "chai": "^5.1.0", 32 | "mocha": "^10.3.0" 33 | }, 34 | "devDependencies": { 35 | "chai": "^5.1.0", 36 | "mocha": "^10.3.0" 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

Welcome to One Dionys - Modal Dialog Component! 👋

2 | 3 |

A component to display a modal dialog with additional messages or content. 💖

4 | 5 |

6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

14 | 15 | ## 💾 Requirements 16 | 17 | * `Web Browser` - Can be used as an emulator to build applications. Example [Chrome, Firefox, Safari & Opera]. 18 | * `Internet` - Because many use CDN and to make it easier to find solutions to all problems. 19 | 20 | ## 🎯 How To Use 21 | 22 | #### Example Syntax 23 | 24 | ```javascript 25 | // Import ModalDialog class 26 | const ModalDialog = require('./src/modal-dialog'); 27 | 28 | // Create a new modal dialog instance 29 | const modal = new ModalDialog('Example Modal', 'This is an example modal'); 30 | 31 | // Open the modal dialog 32 | modal.open(); 33 | 34 | // Close the modal dialog 35 | modal.close(); 36 | ``` 37 | 38 | #### Explanation 39 | 40 | * This package provides a simple Modal Dialog Component that can be used to display modal dialogs in web applications. It includes methods to open and close the modal dialog. 41 | 42 | #### Return Value 43 | 44 | * The `open()` method opens the modal dialog, while the `close()` method closes it. 45 | 46 | ## 📆 Release Date 47 | 48 | * v1.0.0 : 08 March 2024 49 | * v1.0.1 : 11 March 2024 50 | * v4.0.0 : 11 March 2024 51 | * v4.0.1 : 13 March 2024 52 | * v4.0.2 : 18 March 2024 53 | * v5.0.0 : 31 March 2024 54 | 55 | ## 🧑 Author 56 | 57 | * Facebook : Oned Ionys 58 | * Instagram : @onedionys 59 | * Twitter : @onedionys 60 | * LinkedIn : @onedionys 61 | 62 | ## 📝 License 63 | 64 | * Copyright © 2024 One Dionys 65 | * **One Dionys - Modal Dialog Component is an open source project licensed under the MIT license** 66 | 67 | ## ☕️ Suppport & Donation 68 | 69 | Love One Dionys - Modal Dialog Component? Support this project by donating or sharing with others in need. 70 | 71 | 72 | 73 | **Made with ❤️ One Dionys** 74 | --------------------------------------------------------------------------------