├── .editorconfig ├── .eslintrc.js ├── .github ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md └── stale.yml ├── .gitignore ├── .npmignore ├── .travis.yml ├── CONTRIBUTING.md ├── README.md ├── config ├── commit.template └── validate-commit-msg.js ├── demo ├── _config.yml ├── _data │ └── egjs.yml ├── _includes │ ├── facebook.html │ ├── footer.html │ ├── head.html │ ├── header.html │ └── promo.html ├── _layouts │ ├── gallery.html │ └── page.html ├── assets │ ├── css │ │ └── demo.css │ ├── html │ │ └── demo.html │ └── js │ │ └── demo.js ├── common │ ├── css │ │ ├── bootstrap.min.css │ │ ├── font-awesome.min.css │ │ ├── gallery.css │ │ ├── monokai.css │ │ └── page.css │ ├── image │ │ ├── cp-arrow-right.svg │ │ ├── logo.svg │ │ ├── logo_mono.svg │ │ ├── logo_mono_black.svg │ │ ├── type_black.svg │ │ └── type_white.svg │ └── js │ │ ├── app.js │ │ ├── bootstrap.min.js │ │ └── jquery-2.2.4.js ├── demo.md ├── gallery.md ├── index.md └── started.md ├── jsdoc.json ├── karma.conf.js ├── mocha.opts ├── package.json ├── rollup.config.js ├── src ├── ActualComponentEvent.ts ├── Component.ts ├── ComponentEvent.ts ├── index.cjs.ts ├── index.ts ├── index.umd.ts ├── types.ts └── utils.ts ├── test ├── .eslintrc.js ├── types │ ├── Component.test-d.ts │ ├── ComponentEvent.test-d.ts │ └── type-utils.ts └── unit │ ├── Component.spec.ts │ └── ComponentEvent.spec.ts ├── tsconfig.declaration.json ├── tsconfig.eslint.json ├── tsconfig.json ├── tsconfig.test.json └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | end_of_line = lf 7 | indent_style = space 8 | indent_size = 2 9 | insert_final_newline = true 10 | max_line_length = 80 11 | trim_trailing_whitespace = true 12 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable @typescript-eslint/naming-convention */ 2 | 3 | module.exports = { 4 | "env": { 5 | "browser": true 6 | }, 7 | "extends": [ 8 | "plugin:@typescript-eslint/recommended", 9 | "plugin:@typescript-eslint/recommended-requiring-type-checking", 10 | "plugin:import/typescript" 11 | ], 12 | "parser": "@typescript-eslint/parser", 13 | "parserOptions": { 14 | "project": "tsconfig.eslint.json", 15 | "sourceType": "module" 16 | }, 17 | "plugins": [ 18 | "eslint-plugin-import", 19 | "eslint-plugin-jsdoc", 20 | "eslint-plugin-prefer-arrow", 21 | "@typescript-eslint", 22 | "@typescript-eslint/tslint" 23 | ], 24 | "rules": { 25 | "@typescript-eslint/adjacent-overload-signatures": "off", 26 | "@typescript-eslint/array-type": [ 27 | "error", 28 | { 29 | "default": "array-simple" 30 | } 31 | ], 32 | "@typescript-eslint/ban-types": [ 33 | "error", 34 | { 35 | "types": { 36 | "Object": { 37 | "message": "Avoid using the `Object` type. Did you mean `object`?" 38 | }, 39 | "Function": { 40 | "message": "Avoid using the `Function` type. Prefer a specific function type, like `() => void`." 41 | }, 42 | "Boolean": { 43 | "message": "Avoid using the `Boolean` type. Did you mean `boolean`?" 44 | }, 45 | "Number": { 46 | "message": "Avoid using the `Number` type. Did you mean `number`?" 47 | }, 48 | "String": { 49 | "message": "Avoid using the `String` type. Did you mean `string`?" 50 | }, 51 | "Symbol": { 52 | "message": "Avoid using the `Symbol` type. Did you mean `symbol`?" 53 | } 54 | } 55 | } 56 | ], 57 | "@typescript-eslint/consistent-type-assertions": "error", 58 | "@typescript-eslint/consistent-type-definitions": "error", 59 | "@typescript-eslint/dot-notation": "error", 60 | "@typescript-eslint/explicit-member-accessibility": [ 61 | "error", 62 | { 63 | "accessibility": "explicit" 64 | } 65 | ], 66 | "@typescript-eslint/indent": [ 67 | "error", 68 | 2, 69 | { 70 | "FunctionDeclaration": { 71 | "parameters": "first" 72 | }, 73 | "FunctionExpression": { 74 | "parameters": "first" 75 | }, 76 | "SwitchCase": 1 77 | } 78 | ], 79 | "@typescript-eslint/member-delimiter-style": [ 80 | "error", 81 | { 82 | "multiline": { 83 | "delimiter": "semi", 84 | "requireLast": true 85 | }, 86 | "singleline": { 87 | "delimiter": "semi", 88 | "requireLast": false 89 | } 90 | } 91 | ], 92 | "@typescript-eslint/no-non-null-assertion": "off", 93 | "@typescript-eslint/member-ordering": ["error", { 94 | "default": [ 95 | // Index signature 96 | "signature", 97 | 98 | // Static 99 | "public-static-method", 100 | "protected-static-method", 101 | "private-static-method", 102 | 103 | "public-static-field", 104 | "protected-static-field", 105 | "private-static-field", 106 | 107 | "public-abstract-field", 108 | "protected-abstract-field", 109 | "private-abstract-field", 110 | 111 | "public-instance-field", 112 | "protected-instance-field", 113 | "private-instance-field", 114 | 115 | "constructor", 116 | 117 | // Methods 118 | "public-abstract-method", 119 | "protected-abstract-method", 120 | "private-abstract-method", 121 | 122 | "public-instance-method", 123 | "protected-instance-method", 124 | "private-instance-method" 125 | ] 126 | }], 127 | "@typescript-eslint/no-empty-function": "error", 128 | "@typescript-eslint/no-empty-interface": "warn", 129 | "@typescript-eslint/no-explicit-any": "off", 130 | "@typescript-eslint/no-misused-new": "off", 131 | "@typescript-eslint/no-namespace": "error", 132 | "@typescript-eslint/no-parameter-properties": "off", 133 | "@typescript-eslint/no-unused-expressions": "error", 134 | "@typescript-eslint/no-use-before-define": "off", 135 | "@typescript-eslint/no-var-requires": "error", 136 | "@typescript-eslint/no-inferrable-types": "off", 137 | "@typescript-eslint/prefer-for-of": "error", 138 | "@typescript-eslint/prefer-function-type": "error", 139 | "@typescript-eslint/prefer-namespace-keyword": "error", 140 | "@typescript-eslint/explicit-module-boundary-types": "off", 141 | "@typescript-eslint/quotes": [ 142 | "error", 143 | "double" 144 | ], 145 | "@typescript-eslint/semi": [ 146 | "error", 147 | "always" 148 | ], 149 | "@typescript-eslint/triple-slash-reference": [ 150 | "error", 151 | { 152 | "path": "always", 153 | "types": "prefer-import", 154 | "lib": "always" 155 | } 156 | ], 157 | "@typescript-eslint/type-annotation-spacing": "error", 158 | "@typescript-eslint/unified-signatures": "error", 159 | "arrow-body-style": "error", 160 | "arrow-parens": [ 161 | "off", 162 | "always" 163 | ], 164 | "brace-style": [ 165 | "error", 166 | "1tbs", 167 | { "allowSingleLine": true } 168 | ], 169 | "comma-dangle": [ 170 | "error", 171 | "never" 172 | ], 173 | "complexity": "off", 174 | "constructor-super": "error", 175 | "curly": "off", 176 | "eol-last": "error", 177 | "eqeqeq": [ 178 | "error", 179 | "smart" 180 | ], 181 | "guard-for-in": "off", 182 | "id-blacklist": "off", 183 | "id-match": "off", 184 | "import/order": "off", 185 | "jsdoc/check-alignment": "error", 186 | "jsdoc/check-indentation": "error", 187 | "max-classes-per-file": [ 188 | "error", 189 | 1 190 | ], 191 | "max-len": "off", 192 | "new-parens": "error", 193 | "no-bitwise": "off", 194 | "no-caller": "error", 195 | "no-cond-assign": "error", 196 | "no-console": "warn", 197 | "no-debugger": "error", 198 | "no-empty": "error", 199 | "no-eval": "error", 200 | "no-fallthrough": "off", 201 | "no-invalid-this": "off", 202 | "no-multiple-empty-lines": "error", 203 | "no-new-wrappers": "error", 204 | "no-shadow": "off", 205 | "@typescript-eslint/no-shadow": ["error"], 206 | "no-throw-literal": "error", 207 | "no-trailing-spaces": "error", 208 | "no-undef-init": "error", 209 | "no-underscore-dangle": "off", 210 | "no-unsafe-finally": "error", 211 | "no-unsafe-call": "off", 212 | "no-unsafe-member-access": "off", 213 | "no-unused-labels": "error", 214 | "no-var": "error", 215 | "object-shorthand": "off", 216 | "one-var": [ 217 | "error", 218 | "never" 219 | ], 220 | "prefer-arrow/prefer-arrow-functions": "error", 221 | "prefer-const": "error", 222 | "quote-props": "off", 223 | "radix": "error", 224 | "space-before-function-paren": [ 225 | "error", 226 | { 227 | "anonymous": "never", 228 | "asyncArrow": "always", 229 | "named": "never" 230 | } 231 | ], 232 | "spaced-comment": [ 233 | "error", 234 | "always", 235 | { 236 | "markers": [ 237 | "/" 238 | ] 239 | } 240 | ], 241 | "use-isnan": "error", 242 | "valid-typeof": "off", 243 | "lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }], 244 | "import/order": ["error", {"newlines-between": "always"}], 245 | "@typescript-eslint/naming-convention": [ 246 | "error", 247 | { 248 | "selector": "variableLike", 249 | "format": ["camelCase"], 250 | "leadingUnderscore": "forbid", 251 | "trailingUnderscore": "forbid" 252 | }, 253 | { 254 | "selector": "variable", 255 | "format": ["camelCase", "UPPER_CASE"], 256 | "modifiers": ["exported", "const"] 257 | }, 258 | { 259 | "selector": "memberLike", 260 | "modifiers": ["public"], 261 | "format": ["camelCase"], 262 | "leadingUnderscore": "forbid", 263 | "trailingUnderscore": "forbid" 264 | }, 265 | { 266 | "selector": "memberLike", 267 | "modifiers": ["protected"], 268 | "format": ["camelCase"], 269 | "leadingUnderscore": "require", 270 | "trailingUnderscore": "forbid" 271 | }, 272 | { 273 | "selector": "memberLike", 274 | "modifiers": ["private"], 275 | "format": ["camelCase"], 276 | "leadingUnderscore": "require", 277 | "trailingUnderscore": "forbid" 278 | }, 279 | { 280 | "selector": "classProperty", 281 | "modifiers": ["static"], 282 | "format": ["camelCase", "UPPER_CASE"] 283 | }, 284 | { 285 | "selector": "classMethod", 286 | "modifiers": ["static"], 287 | "format": ["camelCase", "UPPER_CASE"] 288 | }, 289 | { 290 | "selector": "property", 291 | "modifiers": ["static"], 292 | "format": ["UPPER_CASE"] 293 | }, 294 | { 295 | "selector": "objectLiteralProperty", 296 | "format": ["camelCase", "UPPER_CASE"] 297 | }, 298 | { 299 | "selector": "objectLiteralMethod", 300 | "format": ["camelCase", "UPPER_CASE"] 301 | }, 302 | { 303 | "selector": "parameter", 304 | "modifiers": ["unused"], 305 | "format": ["camelCase"], 306 | "leadingUnderscore": "allow" 307 | }, 308 | { 309 | "selector": "typeLike", 310 | "format": ["PascalCase", "UPPER_CASE"], 311 | "leadingUnderscore": "allow" 312 | }, 313 | { 314 | "selector": "typeProperty", 315 | "format": ["camelCase", "UPPER_CASE"], 316 | "leadingUnderscore": "allow" 317 | } 318 | ], 319 | "@typescript-eslint/tslint/config": [ 320 | "error", 321 | { 322 | "rules": { 323 | "import-spacing": true, 324 | "whitespace": [ 325 | true, 326 | "check-decl", 327 | "check-operator", 328 | "check-module", 329 | "check-separator", 330 | "check-rest-spread", 331 | "check-branch", 332 | "check-type-operator", 333 | "check-type", 334 | "check-typecast", 335 | "check-preblock" 336 | ] 337 | } 338 | } 339 | ] 340 | } 341 | }; 342 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Description 2 | 3 | 4 | ## Steps to check or reproduce 5 | 6 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Issue 2 | 3 | 4 | ## Details 5 | 6 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 30 3 | # Number of days of inactivity before a stale issue is closed 4 | daysUntilClose: 7 5 | # Issues with these labels will never be considered stale 6 | exemptLabels: 7 | - wontstale 8 | # Label to use when marking an issue as stale 9 | staleLabel: stale 10 | # Comment to post when marking an issue as stale. Set to `false` to disable 11 | markComment: > 12 | This issue/PR has been automatically marked as stale because it has not had any update (including 13 | commits, comments, labels, milestones, etc) for 30 days. It will be closed automatically if no 14 | further update occurs in 7 day. Thank you for your contributions! 15 | 한글 16 | 이 이슈/PR은 commits, comments, labels, milestones 등 30일간 활동이 없어 자동으로 stale 상태로 전환되었습니다. 이후 7일간 활동이 없다면 자동으로 닫힐 예정입니다. 프로젝트 개선에 기여해주셔서 감사합니다. 17 | 18 | # Comment to post when closing a stale issue. Set to `false` to disable 19 | closeComment: false 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io/api/node,bower,osx,windows,webstorm,jekyll,sublimetext,visualstudiocode 2 | 3 | ### Node ### 4 | # Logs 5 | logs 6 | *.log 7 | npm-debug.log* 8 | 9 | # Runtime data 10 | pids 11 | *.pid 12 | *.seed 13 | *.pid.lock 14 | 15 | # Directory for instrumented libs generated by jscoverage/JSCover 16 | lib-cov 17 | 18 | # Coverage directory used by tools like istanbul 19 | coverage 20 | 21 | # nyc test coverage 22 | .nyc_output 23 | 24 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 25 | .grunt 26 | 27 | # node-waf configuration 28 | .lock-wscript 29 | 30 | # Compiled binary addons (http://nodejs.org/api/addons.html) 31 | build/Release 32 | 33 | # Dependency directories 34 | node_modules 35 | jspm_packages 36 | 37 | # Optional npm cache directory 38 | .npm 39 | 40 | # Optional eslint cache 41 | .eslintcache 42 | 43 | # Optional REPL history 44 | .node_repl_history 45 | 46 | # Output of 'npm pack' 47 | *.tgz 48 | 49 | # Yarn Integrity file 50 | .yarn-integrity 51 | 52 | 53 | 54 | ### Bower ### 55 | bower_components 56 | .bower-cache 57 | .bower-registry 58 | .bower-tmp 59 | 60 | 61 | ### OSX ### 62 | *.DS_Store 63 | .AppleDouble 64 | .LSOverride 65 | 66 | # Icon must end with two \r 67 | Icon 68 | # Thumbnails 69 | ._* 70 | # Files that might appear in the root of a volume 71 | .DocumentRevisions-V100 72 | .fseventsd 73 | .Spotlight-V100 74 | .TemporaryItems 75 | .Trashes 76 | .VolumeIcon.icns 77 | .com.apple.timemachine.donotpresent 78 | # Directories potentially created on remote AFP share 79 | .AppleDB 80 | .AppleDesktop 81 | Network Trash Folder 82 | Temporary Items 83 | .apdisk 84 | 85 | 86 | ### Windows ### 87 | # Windows image file caches 88 | Thumbs.db 89 | ehthumbs.db 90 | 91 | # Folder config file 92 | Desktop.ini 93 | 94 | # Recycle Bin used on file shares 95 | $RECYCLE.BIN/ 96 | 97 | # Windows Installer files 98 | *.cab 99 | *.msi 100 | *.msm 101 | *.msp 102 | 103 | # Windows shortcuts 104 | *.lnk 105 | 106 | 107 | ### WebStorm ### 108 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm 109 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 110 | 111 | # User-specific stuff: 112 | .idea/ 113 | .idea/workspace.xml 114 | .idea/tasks.xml 115 | 116 | # Sensitive or high-churn files: 117 | .idea/dataSources/ 118 | .idea/dataSources.ids 119 | .idea/dataSources.xml 120 | .idea/dataSources.local.xml 121 | .idea/sqlDataSources.xml 122 | .idea/dynamic.xml 123 | .idea/uiDesigner.xml 124 | 125 | # Gradle: 126 | .idea/gradle.xml 127 | .idea/libraries 128 | 129 | # Mongo Explorer plugin: 130 | .idea/mongoSettings.xml 131 | 132 | ## File-based project format: 133 | *.iws 134 | 135 | ## Plugin-specific files: 136 | 137 | # IntelliJ 138 | /out/ 139 | 140 | # mpeltonen/sbt-idea plugin 141 | .idea_modules/ 142 | 143 | # JIRA plugin 144 | atlassian-ide-plugin.xml 145 | 146 | # Crashlytics plugin (for Android Studio and IntelliJ) 147 | com_crashlytics_export_strings.xml 148 | crashlytics.properties 149 | crashlytics-build.properties 150 | fabric.properties 151 | 152 | ### WebStorm Patch ### 153 | # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 154 | 155 | # *.iml 156 | # modules.xml 157 | # .idea/misc.xml 158 | # *.ipr 159 | 160 | 161 | ### Jekyll ### 162 | _site/ 163 | .sass-cache/ 164 | .jekyll-metadata 165 | .jekyll-cache 166 | 167 | 168 | ### SublimeText ### 169 | # cache files for sublime text 170 | *.tmlanguage.cache 171 | *.tmPreferences.cache 172 | *.stTheme.cache 173 | 174 | # workspace files are user-specific 175 | *.sublime-workspace 176 | 177 | # project files should be checked into the repository, unless a significant 178 | # proportion of contributors will probably not be using SublimeText 179 | # *.sublime-project 180 | 181 | # sftp configuration file 182 | sftp-config.json 183 | 184 | # Package control specific files 185 | Package Control.last-run 186 | Package Control.ca-list 187 | Package Control.ca-bundle 188 | Package Control.system-ca-bundle 189 | Package Control.cache/ 190 | Package Control.ca-certs/ 191 | bh_unicode_properties.cache 192 | 193 | # Sublime-github package stores a github token in this file 194 | # https://packagecontrol.io/packages/sublime-github 195 | GitHub.sublime-settings 196 | 197 | 198 | ### VisualStudioCode ### 199 | .vscode/* 200 | !.vscode/settings.json 201 | !.vscode/tasks.json 202 | !.vscode/launch.json 203 | !.vscode/extensions.json 204 | 205 | ### Custom ### 206 | doc/ 207 | report/ 208 | temp/ 209 | demo/_data/version.yml 210 | demo/release/ 211 | CHANGELOG.md 212 | declaration/ 213 | test/types/*.d.ts 214 | dist/ 215 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | #configs 2 | config 3 | bower.json 4 | 5 | #tests 6 | test 7 | karma.conf.js 8 | 9 | #build tools 10 | webpack.*.js 11 | .travis.yml 12 | .codeclimate.yml 13 | 14 | #linters 15 | .eslintrc* 16 | 17 | #docs 18 | doc 19 | demo 20 | jsdoc.json 21 | README.md 22 | CHANGELOG.md 23 | 24 | #editor settings 25 | .idea 26 | .editorconfig 27 | 28 | coverage/ 29 | node_modules/ 30 | .github 31 | .babelrc 32 | mocha.opts 33 | demo 34 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "12" 4 | dist: trusty 5 | sudo: false 6 | before_install: 7 | - npm install -g npm@latest 8 | - npm cache verify 9 | - npm cache clean --force 10 | - rm -rf package-lock.json 11 | install: 12 | - npm i 13 | addons: 14 | chrome: stable 15 | before_script: 16 | - npm run lint 17 | script: 18 | - npm run coverage 19 | - npm run test:types 20 | after_success: 21 | - npm run coveralls 22 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to contribute to egjs-component 2 | egjs-component is opened to everyone and we're welcoming for any kind of contribution. 3 | We believe that our project can grow with your interests helping others' necessities. 4 | 5 | ## Style Guide 6 | 7 | egjs-component has several style guidelines to follow. 8 | Before your start, please read attentively below instructions. 9 | 10 | ### Linting and Code Conventions 11 | We adopted [ESLint](http://eslint.org/) to maintain our code quality. The [rules](https://github.com/naver/eslint-config-naver/tree/master/rules) are modified version based on [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript). 12 | All rules are described at [.eslintrc](.eslintrc) file. 13 | 14 | ### Commit Log Guidelines 15 | egjs-component use commit logs in many different purposes (like creating CHANGELOG, ease history searching, etc.). 16 | To not break, you'll be forced to follow our commit log guidelines. 17 | Before your commit/push, make sure following our commit log guidelines. 18 | 19 | The outline is as below: 20 | ``` 21 | (): 22 | 23 | 24 | 25 |