├── .Rbuildignore ├── .babelrc ├── .eslintignore ├── .eslintrc ├── .gitignore ├── .npmignore ├── .prettierrc ├── .pylintrc ├── CONTRIBUTING.md ├── DESCRIPTION ├── LICENSE ├── MANIFEST.in ├── NAMESPACE ├── Pipfile ├── Pipfile.lock ├── R ├── card.R ├── carousel.R ├── gridItem.R ├── gridLayoutComponent.R ├── internal.R ├── responsiveGrid.R ├── sideBar.R ├── sideBarItem.R ├── sideBarToggle.R └── themeToggle.R ├── README.md ├── _validate_init.py ├── assets ├── css │ └── all.min.css ├── styles.css └── webfonts │ ├── fa-brands-400.eot │ ├── fa-brands-400.svg │ ├── fa-brands-400.ttf │ ├── fa-brands-400.woff │ ├── fa-brands-400.woff2 │ ├── fa-regular-400.eot │ ├── fa-regular-400.svg │ ├── fa-regular-400.ttf │ ├── fa-regular-400.woff │ ├── fa-regular-400.woff2 │ ├── fa-solid-900.eot │ ├── fa-solid-900.svg │ ├── fa-solid-900.ttf │ ├── fa-solid-900.woff │ └── fa-solid-900.woff2 ├── dash_trich_components ├── 2c16ad7-main-wps-hmr.js ├── 2c16ad7-wps-hmr.json ├── 5070b51-main-wps-hmr.js ├── 5070b51-wps-hmr.json ├── 698155c-main-wps-hmr.js ├── 698155c-wps-hmr.json ├── Card.py ├── Carousel.py ├── GridItem.py ├── GridLayoutComponent.py ├── ResponsiveGrid.py ├── SideBar.py ├── SideBarItem.py ├── SideBarToggle.py ├── ThemeToggle.py ├── __init__.py ├── _imports_.py ├── dash_trich_components.min.js ├── dash_trich_components.min.js.map ├── f083a31-main-wps-hmr.js ├── f083a31-wps-hmr.json ├── fec5c6e-main-wps-hmr.js ├── fec5c6e-wps-hmr.json ├── fonts │ ├── ajax-loader.gif │ ├── fa-brands-400.eot │ ├── fa-brands-400.svg │ ├── fa-brands-400.ttf │ ├── fa-brands-400.woff │ ├── fa-brands-400.woff2 │ ├── fa-regular-400.eot │ ├── fa-regular-400.svg │ ├── fa-regular-400.ttf │ ├── fa-regular-400.woff │ ├── fa-regular-400.woff2 │ ├── fa-solid-900.eot │ ├── fa-solid-900.svg │ ├── fa-solid-900.ttf │ ├── fa-solid-900.woff │ ├── fa-solid-900.woff2 │ ├── slick.eot │ ├── slick.svg │ ├── slick.ttf │ └── slick.woff ├── metadata.json ├── output.js └── package-info.json ├── docs ├── images │ ├── card_dark.gif │ ├── card_light.gif │ ├── carousel.gif │ ├── sidebar.gif │ └── themetoggle.gif ├── index.html ├── scribbler-doc.css ├── scribbler-global.css ├── scribbler-landing.css └── scribbler.js ├── index.html ├── inst └── deps │ ├── 2c16ad7-main-wps-hmr.js │ ├── 5070b51-main-wps-hmr.js │ ├── 698155c-main-wps-hmr.js │ ├── dash_trich_components.min.js │ ├── dash_trich_components.min.js.map │ ├── f083a31-main-wps-hmr.js │ ├── fec5c6e-main-wps-hmr.js │ ├── fonts │ ├── ajax-loader.gif │ ├── fa-brands-400.eot │ ├── fa-brands-400.svg │ ├── fa-brands-400.ttf │ ├── fa-brands-400.woff │ ├── fa-brands-400.woff2 │ ├── fa-regular-400.eot │ ├── fa-regular-400.svg │ ├── fa-regular-400.ttf │ ├── fa-regular-400.woff │ ├── fa-regular-400.woff2 │ ├── fa-solid-900.eot │ ├── fa-solid-900.svg │ ├── fa-solid-900.ttf │ ├── fa-solid-900.woff │ ├── fa-solid-900.woff2 │ ├── slick.eot │ ├── slick.svg │ ├── slick.ttf │ └── slick.woff │ └── output.js ├── man ├── card.Rd ├── carousel.Rd ├── gridItem.Rd ├── gridLayoutComponent.Rd ├── responsiveGrid.Rd ├── sideBar.Rd ├── sideBarItem.Rd ├── sideBarToggle.Rd └── themeToggle.Rd ├── package-lock.json ├── package.json ├── pytest.ini ├── requirements.txt ├── review_checklist.md ├── setup.py ├── src ├── demo │ ├── App.js │ └── index.js └── lib │ ├── components │ ├── Card │ │ ├── Card.react.js │ │ └── Card.scss │ ├── Carousel │ │ ├── Carousel.react.js │ │ └── Carousel.scss │ ├── GridLayoutComponent │ │ ├── GridLayout.scss │ │ └── GridLayoutComponent.react.js │ ├── ResponsiveGrid │ │ ├── GridItem.react.js │ │ ├── GridLayoutResponsive.scss │ │ └── ResponsiveGrid.react.js │ ├── SideBar │ │ ├── SideBar.react.js │ │ └── SideBar.scss │ ├── SideBarItem │ │ └── SideBarItem.react.js │ └── ThemeToggle │ │ ├── ThemeToggle.react.js │ │ └── ThemeToggle.scss │ ├── index.js │ └── utils │ ├── GridItemWrapper.js │ └── index.js ├── tests ├── __init__.py ├── requirements.txt └── test_usage.py ├── usage.py ├── webpack.config.js ├── webpack.serve.config.js └── yarn.lock /.Rbuildignore: -------------------------------------------------------------------------------- 1 | # ignore JS config files/folders 2 | node_modules/ 3 | coverage/ 4 | src/ 5 | lib/ 6 | .babelrc 7 | .builderrc 8 | .eslintrc 9 | .npmignore 10 | .editorconfig 11 | .eslintignore 12 | .prettierrc 13 | .circleci 14 | .github 15 | 16 | # demo folder has special meaning in R 17 | # this should hopefully make it still 18 | # allow for the possibility to make R demos 19 | demo/.*\.js 20 | demo/.*\.html 21 | demo/.*\.css 22 | 23 | # ignore python files/folders 24 | setup.py 25 | usage.py 26 | setup.py 27 | requirements.txt 28 | MANIFEST.in 29 | CHANGELOG.md 30 | test/ 31 | # CRAN has weird LICENSE requirements 32 | LICENSE.txt 33 | ^.*\.Rproj$ 34 | ^\.Rproj\.user$ 35 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["@babel/preset-env", "@babel/preset-react"], 3 | "env": { 4 | "production": { 5 | "plugins": ["@babel/plugin-proposal-object-rest-spread", "styled-jsx/babel"] 6 | }, 7 | "development": { 8 | "plugins": ["@babel/plugin-proposal-object-rest-spread", "styled-jsx/babel"] 9 | }, 10 | "test": { 11 | "plugins": ["@babel/plugin-proposal-object-rest-spread", "styled-jsx/babel-test"] 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | *.css 2 | registerServiceWorker.js -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["eslint:recommended", "prettier"], 3 | "parser": "babel-eslint", 4 | "parserOptions": { 5 | "ecmaVersion": 6, 6 | "sourceType": "module", 7 | "ecmaFeatures": { 8 | "arrowFunctions": true, 9 | "blockBindings": true, 10 | "classes": true, 11 | "defaultParams": true, 12 | "destructuring": true, 13 | "forOf": true, 14 | "generators": true, 15 | "modules": true, 16 | "templateStrings": true, 17 | "jsx": true 18 | } 19 | }, 20 | "env": { 21 | "browser": true, 22 | "es6": true, 23 | "jasmine": true, 24 | "jest": true, 25 | "node": true 26 | }, 27 | "globals": { 28 | "jest": true 29 | }, 30 | "plugins": [ 31 | "react", 32 | "import" 33 | ], 34 | "rules": { 35 | "accessor-pairs": ["error"], 36 | "block-scoped-var": ["error"], 37 | "consistent-return": ["error"], 38 | "curly": ["error", "all"], 39 | "default-case": ["error"], 40 | "dot-location": ["off"], 41 | "dot-notation": ["error"], 42 | "eqeqeq": ["error"], 43 | "guard-for-in": ["off"], 44 | "import/named": ["off"], 45 | "import/no-duplicates": ["error"], 46 | "import/no-named-as-default": ["error"], 47 | "new-cap": ["error"], 48 | "no-alert": [1], 49 | "no-caller": ["error"], 50 | "no-case-declarations": ["error"], 51 | "no-console": ["off"], 52 | "no-div-regex": ["error"], 53 | "no-dupe-keys": ["error"], 54 | "no-else-return": ["error"], 55 | "no-empty-pattern": ["error"], 56 | "no-eq-null": ["error"], 57 | "no-eval": ["error"], 58 | "no-extend-native": ["error"], 59 | "no-extra-bind": ["error"], 60 | "no-extra-boolean-cast": ["error"], 61 | "no-inline-comments": ["error"], 62 | "no-implicit-coercion": ["error"], 63 | "no-implied-eval": ["error"], 64 | "no-inner-declarations": ["off"], 65 | "no-invalid-this": ["error"], 66 | "no-iterator": ["error"], 67 | "no-labels": ["error"], 68 | "no-lone-blocks": ["error"], 69 | "no-loop-func": ["error"], 70 | "no-multi-str": ["error"], 71 | "no-native-reassign": ["error"], 72 | "no-new": ["error"], 73 | "no-new-func": ["error"], 74 | "no-new-wrappers": ["error"], 75 | "no-param-reassign": ["error"], 76 | "no-process-env": ["warn"], 77 | "no-proto": ["error"], 78 | "no-redeclare": ["error"], 79 | "no-return-assign": ["error"], 80 | "no-script-url": ["error"], 81 | "no-self-compare": ["error"], 82 | "no-sequences": ["error"], 83 | "no-shadow": ["off"], 84 | "no-throw-literal": ["error"], 85 | "no-undefined": ["error"], 86 | "no-unused-expressions": ["error"], 87 | "no-use-before-define": ["error", "nofunc"], 88 | "no-useless-call": ["error"], 89 | "no-useless-concat": ["error"], 90 | "no-with": ["error"], 91 | "prefer-const": ["error"], 92 | "radix": ["error"], 93 | "react/jsx-no-duplicate-props": ["error"], 94 | "react/jsx-no-undef": ["error"], 95 | "react/jsx-uses-react": ["error"], 96 | "react/jsx-uses-vars": ["error"], 97 | "react/no-did-update-set-state": ["error"], 98 | "react/no-direct-mutation-state": ["error"], 99 | "react/no-is-mounted": ["error"], 100 | "react/no-unknown-property": ["error"], 101 | "react/prefer-es6-class": ["error", "always"], 102 | "react/prop-types": "error", 103 | "valid-jsdoc": ["off"], 104 | "yoda": ["error"], 105 | "spaced-comment": ["error", "always", { 106 | "block": { 107 | "exceptions": ["*"] 108 | } 109 | }], 110 | "no-unused-vars": ["error", { 111 | "args": "after-used", 112 | "argsIgnorePattern": "^_", 113 | "caughtErrorsIgnorePattern": "^e$" 114 | }], 115 | "no-magic-numbers": ["error", { 116 | "ignoreArrayIndexes": true, 117 | "ignore": [-1, 0, 1, 2, 3, 100, 10, 0.5] 118 | }], 119 | "no-underscore-dangle": ["off"] 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### VisualStudioCode template 3 | .vscode/* 4 | !.vscode/settings.json 5 | !.vscode/tasks.json 6 | !.vscode/launch.json 7 | !.vscode/extensions.json 8 | ### JetBrains template 9 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm 10 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 11 | 12 | # User-specific stuff 13 | .idea/**/workspace.xml 14 | .idea/**/tasks.xml 15 | .idea/**/usage.statistics.xml 16 | .idea/**/dictionaries 17 | .idea/**/shelf 18 | 19 | # Sensitive or high-churn files 20 | .idea/**/dataSources/ 21 | .idea/**/dataSources.ids 22 | .idea/**/dataSources.local.xml 23 | .idea/**/sqlDataSources.xml 24 | .idea/**/dynamic.xml 25 | .idea/**/uiDesigner.xml 26 | .idea/**/dbnavigator.xml 27 | 28 | # Gradle 29 | .idea/**/gradle.xml 30 | .idea/**/libraries 31 | 32 | # Gradle and Maven with auto-import 33 | # When using Gradle or Maven with auto-import, you should exclude module files, 34 | # since they will be recreated, and may cause churn. Uncomment if using 35 | # auto-import. 36 | # .idea/modules.xml 37 | # .idea/*.iml 38 | # .idea/modules 39 | 40 | # CMake 41 | cmake-build-*/ 42 | 43 | # Mongo Explorer plugin 44 | .idea/**/mongoSettings.xml 45 | 46 | # File-based project format 47 | *.iws 48 | 49 | # IntelliJ 50 | out/ 51 | 52 | # mpeltonen/sbt-idea plugin 53 | .idea_modules/ 54 | 55 | # JIRA plugin 56 | atlassian-ide-plugin.xml 57 | 58 | # Cursive Clojure plugin 59 | .idea/replstate.xml 60 | 61 | # Crashlytics plugin (for Android Studio and IntelliJ) 62 | com_crashlytics_export_strings.xml 63 | crashlytics.properties 64 | crashlytics-build.properties 65 | fabric.properties 66 | 67 | # Editor-based Rest Client 68 | .idea/httpRequests 69 | ### Node template 70 | # Logs 71 | logs 72 | *.log 73 | npm-debug.log* 74 | yarn-debug.log* 75 | yarn-error.log* 76 | 77 | # Runtime data 78 | pids 79 | *.pid 80 | *.seed 81 | *.pid.lock 82 | 83 | # Directory for instrumented libs generated by jscoverage/JSCover 84 | lib-cov 85 | 86 | # Coverage directory used by tools like istanbul 87 | coverage 88 | 89 | # nyc test coverage 90 | .nyc_output 91 | 92 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 93 | .grunt 94 | 95 | # Bower dependency directory (https://bower.io/) 96 | bower_components 97 | 98 | # node-waf configuration 99 | .lock-wscript 100 | 101 | # Compiled binary addons (https://nodejs.org/api/addons.html) 102 | build/Release 103 | 104 | # Dependency directories 105 | node_modules/ 106 | jspm_packages/ 107 | 108 | # TypeScript v1 declaration files 109 | typings/ 110 | 111 | # Optional npm cache directory 112 | .npm 113 | 114 | # Optional eslint cache 115 | .eslintcache 116 | 117 | # Optional REPL history 118 | .node_repl_history 119 | 120 | # Output of 'npm pack' 121 | *.tgz 122 | 123 | # Yarn Integrity file 124 | .yarn-integrity 125 | 126 | # dotenv environment variables file 127 | .env 128 | 129 | # parcel-bundler cache (https://parceljs.org/) 130 | .cache 131 | 132 | # next.js build output 133 | .next 134 | 135 | # nuxt.js build output 136 | .nuxt 137 | 138 | # vuepress build output 139 | .vuepress/dist 140 | 141 | # Serverless directories 142 | .serverless 143 | ### Python template 144 | # Byte-compiled / optimized / DLL files 145 | __pycache__/ 146 | *.py[cod] 147 | *$py.class 148 | 149 | # C extensions 150 | *.so 151 | 152 | # Distribution / packaging 153 | .Python 154 | build/ 155 | develop-eggs/ 156 | dist/ 157 | downloads/ 158 | eggs/ 159 | .eggs/ 160 | lib64/ 161 | parts/ 162 | sdist/ 163 | var/ 164 | wheels/ 165 | *.egg-info/ 166 | .installed.cfg 167 | *.egg 168 | MANIFEST 169 | 170 | # PyInstaller 171 | # Usually these files are written by a python script from a template 172 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 173 | *.manifest 174 | *.spec 175 | 176 | # Installer logs 177 | pip-log.txt 178 | pip-delete-this-directory.txt 179 | 180 | # Unit test / coverage reports 181 | htmlcov/ 182 | .tox/ 183 | .coverage 184 | .coverage.* 185 | nosetests.xml 186 | coverage.xml 187 | *.cover 188 | .hypothesis/ 189 | .pytest_cache/ 190 | 191 | # Translations 192 | *.mo 193 | *.pot 194 | 195 | # Django stuff: 196 | local_settings.py 197 | db.sqlite3 198 | 199 | # Flask stuff: 200 | instance/ 201 | .webassets-cache 202 | 203 | # Scrapy stuff: 204 | .scrapy 205 | 206 | # Sphinx documentation 207 | docs/_build/ 208 | 209 | # PyBuilder 210 | target/ 211 | 212 | # Jupyter Notebook 213 | .ipynb_checkpoints 214 | 215 | # pyenv 216 | .python-version 217 | 218 | # celery beat schedule file 219 | celerybeat-schedule 220 | 221 | # SageMath parsed files 222 | *.sage.py 223 | 224 | # Environments 225 | .venv 226 | env/ 227 | venv/ 228 | ENV/ 229 | env.bak/ 230 | venv.bak/ 231 | 232 | # Spyder project settings 233 | .spyderproject 234 | .spyproject 235 | 236 | # Rope project settings 237 | .ropeproject 238 | 239 | # mkdocs documentation 240 | /site 241 | 242 | # mypy 243 | .mypy_cache/ 244 | ### SublimeText template 245 | # Cache files for Sublime Text 246 | *.tmlanguage.cache 247 | *.tmPreferences.cache 248 | *.stTheme.cache 249 | 250 | # Workspace files are user-specific 251 | *.sublime-workspace 252 | 253 | # Project files should be checked into the repository, unless a significant 254 | # proportion of contributors will probably not be using Sublime Text 255 | # *.sublime-project 256 | 257 | # SFTP configuration file 258 | sftp-config.json 259 | 260 | # Package control specific files 261 | Package Control.last-run 262 | Package Control.ca-list 263 | Package Control.ca-bundle 264 | Package Control.system-ca-bundle 265 | Package Control.cache/ 266 | Package Control.ca-certs/ 267 | Package Control.merged-ca-bundle 268 | Package Control.user-ca-bundle 269 | oscrypto-ca-bundle.crt 270 | bh_unicode_properties.cache 271 | 272 | # Sublime-github package stores a github token in this file 273 | # https://packagecontrol.io/packages/sublime-github 274 | GitHub.sublime-settings 275 | 276 | 277 | 278 | dash_trich_components/*-hmr.js -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # dependencies 2 | /node_modules 3 | 4 | # testing 5 | /coverage 6 | 7 | # misc 8 | .DS_Store 9 | .env.local 10 | .env.development.local 11 | .env.test.local 12 | .env.production.local 13 | 14 | npm-debug.log* 15 | yarn-debug.log* 16 | yarn-error.log* 17 | 18 | # Development folders and files 19 | public 20 | src 21 | scripts 22 | config 23 | .travis.yml 24 | CHANGELOG.md 25 | README.md 26 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "tabWidth": 4, 3 | "singleQuote": true, 4 | "bracketSpacing": false, 5 | "trailingComma": "es5" 6 | } 7 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # CONTRIBUTING 2 | 3 | This project was generated by the [dash-component-boilerplate](https://github.com/plotly/dash-component-boilerplate) it contains the minimal set of code required to create your own custom Dash component. 4 | 5 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: dashTrichComponents 2 | Title: Trich.ai components library for Dash Plotly 3 | Version: 1.0.0 4 | Description: Trich.ai components library for Dash Plotly 5 | Depends: R (>= 3.0.2) 6 | Imports: 7 | Suggests: 8 | License: MIT + file LICENSE 9 | URL: https://github.com/romanonatacha/dash-trich-components 10 | BugReports: https://github.com/romanonatacha/dash-trich-components/issues 11 | Encoding: UTF-8 12 | LazyData: true 13 | KeepSource: true 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 natacha romano 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. 22 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include dash_trich_components/dash_trich_components.min.js 2 | include dash_trich_components/dash_trich_components.min.js.map 3 | include dash_trich_components/metadata.json 4 | include dash_trich_components/package-info.json 5 | include README.md 6 | include LICENSE 7 | include package.json 8 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | export(Card) 4 | export(Carousel) 5 | export(GridLayoutComponent) 6 | export(GridItem) 7 | export(ResponsiveGrid) 8 | export(SideBar) 9 | export(SideBarItem) 10 | export(ThemeToggle) 11 | export(themeToggle) 12 | export(carousel) 13 | export(gridItem) 14 | export(responsiveGrid) 15 | export(sideBarItem) 16 | export(card) 17 | export(gridLayoutComponent) 18 | export(sideBar) 19 | export(sideBarToggle) -------------------------------------------------------------------------------- /Pipfile: -------------------------------------------------------------------------------- 1 | [[source]] 2 | url = "https://pypi.python.org/simple" 3 | verify_ssl = true 4 | name = "pypi" 5 | 6 | [packages] 7 | appdirs = "==1.4.4" 8 | attrs = "==19.3.0" 9 | autopep8 = "==1.5.2" 10 | black = "==19.10b0" 11 | bleach = "==3.3.0" 12 | Brotli = "==1.0.7" 13 | certifi = "==2020.4.5.1" 14 | cffi = "==1.14.0" 15 | chardet = "==3.0.4" 16 | click = "==7.1.2" 17 | coloredlogs = "==14.0" 18 | cryptography = "==3.3.2" 19 | dash = "==1.12.0" 20 | dash-core-components = "==1.10.0" 21 | dash-dangerously-set-inner-html = "==0.0.2" 22 | dash-flow-example = "==0.0.5" 23 | dash-html-components = "==1.0.3" 24 | dash-renderer = "==1.4.1" 25 | dash-table = "==4.7.0" 26 | docutils = "==0.16" 27 | entrypoints = "==0.3" 28 | fire = "==0.2.1" 29 | flake8 = "==3.7.9" 30 | Flask = "==1.1.2" 31 | Flask-Compress = "==1.5.0" 32 | future = "==0.18.2" 33 | humanfriendly = "==8.2" 34 | idna = "==2.9" 35 | itsdangerous = "==1.1.0" 36 | jeepney = "==0.4.3" 37 | Jinja2 = "==2.11.2" 38 | keyring = "==21.2.1" 39 | MarkupSafe = "==1.1.1" 40 | mccabe = "==0.6.1" 41 | mock = "==4.0.1" 42 | numpy = "==1.18.4" 43 | pandas = "==1.0.3" 44 | pathspec = "==0.8.0" 45 | pkginfo = "==1.5.0.1" 46 | plotly = "==4.7.1" 47 | pycodestyle = "==2.5.0" 48 | pycparser = "==2.20" 49 | pyflakes = "==2.1.1" 50 | Pygments = "==2.6.1" 51 | pyparsing = "==2.4.7" 52 | python-dateutil = "==2.8.1" 53 | pytz = "==2020.1" 54 | PyYAML = "==5.3" 55 | readme-renderer = "==26.0" 56 | regex = "==2020.5.14" 57 | requests = "==2.23.0" 58 | requests-toolbelt = "==0.9.1" 59 | retrying = "==1.3.3" 60 | SecretStorage = "==3.1.2" 61 | six = "==1.14.0" 62 | termcolor = "==1.1.0" 63 | toml = "==0.10.1" 64 | tqdm = "==4.46.0" 65 | twine = "==3.1.1" 66 | typed-ast = "==1.4.1" 67 | urllib3 = "==1.25.9" 68 | webencodings = "==0.5.1" 69 | Werkzeug = "==1.0.1" 70 | 71 | [dev-packages] 72 | 73 | [requires] 74 | python_version = "3.8" 75 | -------------------------------------------------------------------------------- /R/card.R: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | card <- function(id=NULL, className=NULL, style=NULL, link=NULL, image=NULL, title=NULL, description=NULL, badges=NULL, git=NULL, dark=NULL, openNewTab=NULL) { 4 | 5 | props <- list(id=id, className=className, style=style, link=link, image=image, title=title, description=description, badges=badges, git=git, dark=dark, openNewTab=openNewTab) 6 | if (length(props) > 0) { 7 | props <- props[!vapply(props, is.null, logical(1))] 8 | } 9 | component <- list( 10 | props = props, 11 | type = 'Card', 12 | namespace = 'dash_trich_components', 13 | propNames = c('id', 'className', 'style', 'link', 'image', 'title', 'description', 'badges', 'git', 'dark', 'openNewTab'), 14 | package = 'dashTrichComponents' 15 | ) 16 | 17 | structure(component, class = c('dash_component', 'list')) 18 | } 19 | -------------------------------------------------------------------------------- /R/carousel.R: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | carousel <- function(children=NULL, dots=NULL, arrows=NULL, infinite=NULL, autoplay=NULL, speed=NULL, slides_to_show=NULL, slides_to_scroll=NULL, center_mode=NULL, center_padding=NULL, swipe_to_slide=NULL, variable_width=NULL, responsive=NULL, vertical=NULL, style=NULL, className=NULL, id=NULL) { 4 | 5 | props <- list(children=children, dots=dots, arrows=arrows, infinite=infinite, autoplay=autoplay, speed=speed, slides_to_show=slides_to_show, slides_to_scroll=slides_to_scroll, center_mode=center_mode, center_padding=center_padding, swipe_to_slide=swipe_to_slide, variable_width=variable_width, responsive=responsive, vertical=vertical, style=style, className=className, id=id) 6 | if (length(props) > 0) { 7 | props <- props[!vapply(props, is.null, logical(1))] 8 | } 9 | component <- list( 10 | props = props, 11 | type = 'Carousel', 12 | namespace = 'dash_trich_components', 13 | propNames = c('children', 'dots', 'arrows', 'infinite', 'autoplay', 'speed', 'slides_to_show', 'slides_to_scroll', 'center_mode', 'center_padding', 'swipe_to_slide', 'variable_width', 'responsive', 'vertical', 'style', 'className', 'id'), 14 | package = 'dashTrichComponents' 15 | ) 16 | 17 | structure(component, class = c('dash_component', 'list')) 18 | } 19 | -------------------------------------------------------------------------------- /R/gridItem.R: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | gridItem <- function(children=NULL, i=NULL, layout=NULL) { 4 | 5 | props <- list(children=children, i=i, layout=layout) 6 | if (length(props) > 0) { 7 | props <- props[!vapply(props, is.null, logical(1))] 8 | } 9 | component <- list( 10 | props = props, 11 | type = 'GridItem', 12 | namespace = 'dash_trich_components', 13 | propNames = c('children', 'i', 'layout'), 14 | package = 'dashTrichComponents' 15 | ) 16 | 17 | structure(component, class = c('dash_component', 'list')) 18 | } 19 | -------------------------------------------------------------------------------- /R/gridLayoutComponent.R: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | gridLayoutComponent <- function(children=NULL, style=NULL, className=NULL, id=NULL, layout=NULL) { 4 | 5 | props <- list(children=children, style=style, className=className, id=id, layout=layout) 6 | if (length(props) > 0) { 7 | props <- props[!vapply(props, is.null, logical(1))] 8 | } 9 | component <- list( 10 | props = props, 11 | type = 'GridLayoutComponent', 12 | namespace = 'dash_trich_components', 13 | propNames = c('children', 'style', 'className', 'id', 'layout'), 14 | package = 'dashTrichComponents' 15 | ) 16 | 17 | structure(component, class = c('dash_component', 'list')) 18 | } 19 | -------------------------------------------------------------------------------- /R/internal.R: -------------------------------------------------------------------------------- 1 | .dashTrichComponents_js_metadata <- function() { 2 | deps_metadata <- list(`dash_trich_components` = structure(list(name = "dash_trich_components", 3 | version = "1.0.0", src = list(href = NULL, 4 | file = "deps"), meta = NULL, 5 | script = 'dash_trich_components.min.js', 6 | stylesheet = NULL, head = NULL, attachment = NULL, package = "dashTrichComponents", 7 | all_files = FALSE), class = "html_dependency"), 8 | `dash_trich_components` = structure(list(name = "dash_trich_components", 9 | version = "1.0.0", src = list(href = NULL, 10 | file = "deps"), meta = NULL, 11 | script = 'dash_trich_components.min.js.map', 12 | stylesheet = NULL, head = NULL, attachment = NULL, package = "dashTrichComponents", 13 | all_files = FALSE, dynamic = TRUE), class = "html_dependency")) 14 | return(deps_metadata) 15 | } 16 | -------------------------------------------------------------------------------- /R/responsiveGrid.R: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | responsiveGrid <- function(children=NULL, id=NULL, breakpoint=NULL, breakpoints=NULL, cols=NULL, layouts=NULL, width=NULL, onBreakpointChange=NULL, onLayoutChange=NULL, onWidthChange=NULL, rowHeight=NULL, maxRows=NULL, autoSize=NULL, draggableCancel=NULL, draggableHandle=NULL, verticalCompact=NULL, compactType=NULL, margin=NULL, containerPadding=NULL, isDraggable=NULL, isResizable=NULL, useCSSTransforms=NULL, preventCollision=NULL, onDragStart=NULL, onDrag=NULL, onDragStop=NULL, onResizeStart=NULL, onResize=NULL, onResizeStop=NULL, className=NULL) { 4 | 5 | props <- list(children=children, id=id, breakpoint=breakpoint, breakpoints=breakpoints, cols=cols, layouts=layouts, width=width, onBreakpointChange=onBreakpointChange, onLayoutChange=onLayoutChange, onWidthChange=onWidthChange, rowHeight=rowHeight, maxRows=maxRows, autoSize=autoSize, draggableCancel=draggableCancel, draggableHandle=draggableHandle, verticalCompact=verticalCompact, compactType=compactType, margin=margin, containerPadding=containerPadding, isDraggable=isDraggable, isResizable=isResizable, useCSSTransforms=useCSSTransforms, preventCollision=preventCollision, onDragStart=onDragStart, onDrag=onDrag, onDragStop=onDragStop, onResizeStart=onResizeStart, onResize=onResize, onResizeStop=onResizeStop, className=className) 6 | if (length(props) > 0) { 7 | props <- props[!vapply(props, is.null, logical(1))] 8 | } 9 | component <- list( 10 | props = props, 11 | type = 'ResponsiveGrid', 12 | namespace = 'dash_trich_components', 13 | propNames = c('children', 'id', 'breakpoint', 'breakpoints', 'cols', 'layouts', 'width', 'onBreakpointChange', 'onLayoutChange', 'onWidthChange', 'rowHeight', 'maxRows', 'autoSize', 'draggableCancel', 'draggableHandle', 'verticalCompact', 'compactType', 'margin', 'containerPadding', 'isDraggable', 'isResizable', 'useCSSTransforms', 'preventCollision', 'onDragStart', 'onDrag', 'onDragStop', 'onResizeStart', 'onResize', 'onResizeStop', 'className'), 14 | package = 'dashTrichComponents' 15 | ) 16 | 17 | structure(component, class = c('dash_component', 'list')) 18 | } 19 | -------------------------------------------------------------------------------- /R/sideBar.R: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | sideBar <- function(children=NULL, id=NULL, className=NULL, bg_color=NULL, text_color=NULL) { 4 | 5 | props <- list(children=children, id=id, className=className, bg_color=bg_color, text_color=text_color) 6 | if (length(props) > 0) { 7 | props <- props[!vapply(props, is.null, logical(1))] 8 | } 9 | component <- list( 10 | props = props, 11 | type = 'SideBar', 12 | namespace = 'dash_trich_components', 13 | propNames = c('children', 'id', 'className', 'bg_color', 'text_color'), 14 | package = 'dashTrichComponents' 15 | ) 16 | 17 | structure(component, class = c('dash_component', 'list')) 18 | } 19 | -------------------------------------------------------------------------------- /R/sideBarItem.R: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | sideBarItem <- function(id=NULL, className=NULL, label=NULL, icon=NULL, disabled=NULL, n_clicks=NULL, n_clicks_timestamp=NULL) { 4 | 5 | props <- list(id=id, className=className, label=label, icon=icon, disabled=disabled, n_clicks=n_clicks, n_clicks_timestamp=n_clicks_timestamp) 6 | if (length(props) > 0) { 7 | props <- props[!vapply(props, is.null, logical(1))] 8 | } 9 | component <- list( 10 | props = props, 11 | type = 'SideBarItem', 12 | namespace = 'dash_trich_components', 13 | propNames = c('id', 'className', 'label', 'icon', 'disabled', 'n_clicks', 'n_clicks_timestamp'), 14 | package = 'dashTrichComponents' 15 | ) 16 | 17 | structure(component, class = c('dash_component', 'list')) 18 | } 19 | -------------------------------------------------------------------------------- /R/sideBarToggle.R: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | sideBarToggle <- function(n_clicks=NULL, id=NULL) { 4 | 5 | props <- list(n_clicks=n_clicks, id=id) 6 | if (length(props) > 0) { 7 | props <- props[!vapply(props, is.null, logical(1))] 8 | } 9 | component <- list( 10 | props = props, 11 | type = 'SideBarToggle', 12 | namespace = 'dash_trich_components', 13 | propNames = c('n_clicks', 'id'), 14 | package = 'dashTrichComponents' 15 | ) 16 | 17 | structure(component, class = c('dash_component', 'list')) 18 | } 19 | -------------------------------------------------------------------------------- /R/themeToggle.R: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | themeToggle <- function(bg_color_dark=NULL, icon_color_dark=NULL, bg_color_light=NULL, icon_color_light=NULL, tooltip_text=NULL, style=NULL, className=NULL, id=NULL) { 4 | 5 | props <- list(bg_color_dark=bg_color_dark, icon_color_dark=icon_color_dark, bg_color_light=bg_color_light, icon_color_light=icon_color_light, tooltip_text=tooltip_text, style=style, className=className, id=id) 6 | if (length(props) > 0) { 7 | props <- props[!vapply(props, is.null, logical(1))] 8 | } 9 | component <- list( 10 | props = props, 11 | type = 'ThemeToggle', 12 | namespace = 'dash_trich_components', 13 | propNames = c('bg_color_dark', 'icon_color_dark', 'bg_color_light', 'icon_color_light', 'tooltip_text', 'style', 'className', 'id'), 14 | package = 'dashTrichComponents' 15 | ) 16 | 17 | structure(component, class = c('dash_component', 'list')) 18 | } 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # dash-trich-components 2 | 3 | To use the Dash Trich Components library, read the [documentation](https://romanonatacha.github.io/dash_trich_components/) 4 | 5 | Documentation: https://romanonatacha.github.io/dash_trich_components/ 6 | 7 | dash-trich-components is a Dash component library. 8 | 9 | 10 | ## Get started 11 | 12 | 13 | To use dash_trich_components install the package on your project's terminal. 14 | 15 | ``` 16 | $ pip install dash-trich-components 17 | ``` 18 | 19 | ### How to use 20 | 21 | To use the Dash Trich Components library, read the [documentation](https://romanonatacha.github.io/dash_trich_components/) 22 | 23 | Documentation: https://romanonatacha.github.io/dash_trich_components/ 24 | 25 | ### Updating 26 | 27 | Stay tuned and update our package to get new components released, bug fixes and improvements. 28 | 29 | To uptade just run in your project's terminal the command bellow. 30 | 31 | ``` 32 | $ pip install --upgrade dash-trich-components 33 | ``` 34 | 35 | ### Authors 36 | This library is developed by [trich.ai](https://trich/ai) team. 37 | - [Leonardo Ferreira](https://www.linkedin.com/in/leonardoferreirads/) 38 | - [Natacha Romano](https://www.linkedin.com/in/natacha-romano/) -------------------------------------------------------------------------------- /_validate_init.py: -------------------------------------------------------------------------------- 1 | """ 2 | DO NOT MODIFY 3 | This file is used to validate your publish settings. 4 | """ 5 | from __future__ import print_function 6 | 7 | import os 8 | import sys 9 | import importlib 10 | 11 | 12 | components_package = 'dash_trich_components' 13 | 14 | components_lib = importlib.import_module(components_package) 15 | 16 | missing_dist_msg = 'Warning {} was not found in `{}.__init__.{}`!!!' 17 | missing_manifest_msg = ''' 18 | Warning {} was not found in `MANIFEST.in`! 19 | It will not be included in the build! 20 | ''' 21 | 22 | with open('MANIFEST.in', 'r') as f: 23 | manifest = f.read() 24 | 25 | 26 | def check_dist(dist, filename): 27 | # Support the dev bundle. 28 | if filename.endswith('dev.js'): 29 | return True 30 | 31 | return any( 32 | filename in x 33 | for d in dist 34 | for x in ( 35 | [d.get('relative_package_path')] 36 | if not isinstance(d.get('relative_package_path'), list) 37 | else d.get('relative_package_path') 38 | ) 39 | ) 40 | 41 | 42 | def check_manifest(filename): 43 | return filename in manifest 44 | 45 | 46 | def check_file(dist, filename): 47 | if not check_dist(dist, filename): 48 | print( 49 | missing_dist_msg.format(filename, components_package, '_js_dist'), 50 | file=sys.stderr 51 | ) 52 | if not check_manifest(filename): 53 | print(missing_manifest_msg.format(filename), 54 | file=sys.stderr) 55 | 56 | 57 | for cur, _, files in os.walk(components_package): 58 | for f in files: 59 | 60 | if f.endswith('js'): 61 | # noinspection PyProtectedMember 62 | check_file(components_lib._js_dist, f) 63 | elif f.endswith('css'): 64 | # noinspection PyProtectedMember 65 | check_file(components_lib._css_dist, f) 66 | elif not f.endswith('py'): 67 | check_manifest(f) 68 | -------------------------------------------------------------------------------- /assets/styles.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/assets/styles.css -------------------------------------------------------------------------------- /assets/webfonts/fa-brands-400.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/assets/webfonts/fa-brands-400.eot -------------------------------------------------------------------------------- /assets/webfonts/fa-brands-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/assets/webfonts/fa-brands-400.ttf -------------------------------------------------------------------------------- /assets/webfonts/fa-brands-400.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/assets/webfonts/fa-brands-400.woff -------------------------------------------------------------------------------- /assets/webfonts/fa-brands-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/assets/webfonts/fa-brands-400.woff2 -------------------------------------------------------------------------------- /assets/webfonts/fa-regular-400.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/assets/webfonts/fa-regular-400.eot -------------------------------------------------------------------------------- /assets/webfonts/fa-regular-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/assets/webfonts/fa-regular-400.ttf -------------------------------------------------------------------------------- /assets/webfonts/fa-regular-400.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/assets/webfonts/fa-regular-400.woff -------------------------------------------------------------------------------- /assets/webfonts/fa-regular-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/assets/webfonts/fa-regular-400.woff2 -------------------------------------------------------------------------------- /assets/webfonts/fa-solid-900.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/assets/webfonts/fa-solid-900.eot -------------------------------------------------------------------------------- /assets/webfonts/fa-solid-900.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/assets/webfonts/fa-solid-900.ttf -------------------------------------------------------------------------------- /assets/webfonts/fa-solid-900.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/assets/webfonts/fa-solid-900.woff -------------------------------------------------------------------------------- /assets/webfonts/fa-solid-900.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/assets/webfonts/fa-solid-900.woff2 -------------------------------------------------------------------------------- /dash_trich_components/2c16ad7-wps-hmr.json: -------------------------------------------------------------------------------- 1 | {"h":"8b97dc7d4d33c980bd64","c":{"main":true}} -------------------------------------------------------------------------------- /dash_trich_components/5070b51-main-wps-hmr.js: -------------------------------------------------------------------------------- 1 | webpackHotUpdatedash_trich_components("main",{ 2 | 3 | /***/ "./src/lib/components/GridLayoutComponent/GridLayoutComponent.react.js": 4 | /*!*****************************************************************************!*\ 5 | !*** ./src/lib/components/GridLayoutComponent/GridLayoutComponent.react.js ***! 6 | \*****************************************************************************/ 7 | /*! exports provided: default */ 8 | /***/ (function(module, __webpack_exports__, __webpack_require__) { 9 | 10 | "use strict"; 11 | __webpack_require__.r(__webpack_exports__); 12 | /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return GridLayoutComponent; }); 13 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); 14 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); 15 | /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); 16 | /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); 17 | /* harmony import */ var react_grid_layout_css_styles_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-grid-layout/css/styles.css */ "./node_modules/react-grid-layout/css/styles.css"); 18 | /* harmony import */ var react_grid_layout_css_styles_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_grid_layout_css_styles_css__WEBPACK_IMPORTED_MODULE_2__); 19 | /* harmony import */ var react_resizable_css_styles_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-resizable/css/styles.css */ "./node_modules/react-resizable/css/styles.css"); 20 | /* harmony import */ var react_resizable_css_styles_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_resizable_css_styles_css__WEBPACK_IMPORTED_MODULE_3__); 21 | /* harmony import */ var react_grid_layout__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-grid-layout */ "./node_modules/react-grid-layout/index.js"); 22 | /* harmony import */ var react_grid_layout__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_grid_layout__WEBPACK_IMPORTED_MODULE_4__); 23 | function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 24 | 25 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 26 | 27 | function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 28 | 29 | function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 30 | 31 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 32 | 33 | function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 34 | 35 | function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function () { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 36 | 37 | function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 38 | 39 | function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 40 | 41 | function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } 42 | 43 | function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 44 | 45 | 46 | 47 | 48 | 49 | 50 | /** 51 | * GridLayout is an GridLayout component. 52 | * It takes some setting properties 53 | * You put how many blocks of divs you want inside it, 54 | * and this div turn into slides 55 | */ 56 | 57 | var GridLayoutComponent = /*#__PURE__*/function (_Component) { 58 | _inherits(GridLayoutComponent, _Component); 59 | 60 | var _super = _createSuper(GridLayoutComponent); 61 | 62 | function GridLayoutComponent() { 63 | _classCallCheck(this, GridLayoutComponent); 64 | 65 | return _super.apply(this, arguments); 66 | } 67 | 68 | _createClass(GridLayoutComponent, [{ 69 | key: "render", 70 | value: function render() { 71 | var _this$props = this.props, 72 | style = _this$props.style, 73 | className = _this$props.className, 74 | children = _this$props.children, 75 | id = _this$props.id, 76 | layout = _this$props.layout; 77 | return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_grid_layout__WEBPACK_IMPORTED_MODULE_4___default.a, { 78 | id: id, 79 | className: "".concat(className, " layout"), 80 | style: style, 81 | layout: layout, 82 | cols: 12, 83 | rowHeight: 30, 84 | width: 1200 85 | }, children); 86 | } 87 | }]); 88 | 89 | return GridLayoutComponent; 90 | }(react__WEBPACK_IMPORTED_MODULE_0__["Component"]); 91 | 92 | 93 | GridLayoutComponent.defaultProps = {}; 94 | GridLayoutComponent.propTypes = { 95 | /** 96 | * Your GridLayout is vertical 97 | */ 98 | children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node, 99 | 100 | /** 101 | * Inline style of the component. 102 | */ 103 | style: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object, 104 | 105 | /** 106 | * Style class of the component. 107 | */ 108 | className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, 109 | 110 | /** 111 | * Id of the element 112 | */ 113 | id: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, 114 | 115 | /** 116 | * Initial layout 117 | */ 118 | layout: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.array 119 | }; 120 | 121 | /***/ }) 122 | 123 | }) 124 | //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX3RyaWNoX2NvbXBvbmVudHMvLi9zcmMvbGliL2NvbXBvbmVudHMvR3JpZExheW91dENvbXBvbmVudC9HcmlkTGF5b3V0Q29tcG9uZW50LnJlYWN0LmpzIl0sIm5hbWVzIjpbIkdyaWRMYXlvdXRDb21wb25lbnQiLCJwcm9wcyIsInN0eWxlIiwiY2xhc3NOYW1lIiwiY2hpbGRyZW4iLCJpZCIsImxheW91dCIsIkNvbXBvbmVudCIsImRlZmF1bHRQcm9wcyIsInByb3BUeXBlcyIsIlByb3BUeXBlcyIsIm5vZGUiLCJvYmplY3QiLCJzdHJpbmciLCJhcnJheSJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7Ozs7Ozs7SUFPcUJBLG1COzs7Ozs7Ozs7Ozs7OzZCQUNSO0FBQUEsd0JBRThDLEtBQUtDLEtBRm5EO0FBQUEsVUFFR0MsS0FGSCxlQUVHQSxLQUZIO0FBQUEsVUFFVUMsU0FGVixlQUVVQSxTQUZWO0FBQUEsVUFFcUJDLFFBRnJCLGVBRXFCQSxRQUZyQjtBQUFBLFVBRStCQyxFQUYvQixlQUUrQkEsRUFGL0I7QUFBQSxVQUVtQ0MsTUFGbkMsZUFFbUNBLE1BRm5DO0FBSUwsMEJBQ0ksMkRBQUMsd0RBQUQ7QUFBWSxVQUFFLEVBQUVELEVBQWhCO0FBQW9CLGlCQUFTLFlBQUtGLFNBQUwsWUFBN0I7QUFBc0QsYUFBSyxFQUFFRCxLQUE3RDtBQUFvRSxjQUFNLEVBQUVJLE1BQTVFO0FBQW9GLFlBQUksRUFBRSxFQUExRjtBQUE4RixpQkFBUyxFQUFFLEVBQXpHO0FBQTZHLGFBQUssRUFBRTtBQUFwSCxTQUNLRixRQURMLENBREo7QUFLSDs7OztFQVY0Q0csK0M7OztBQWFqRFAsbUJBQW1CLENBQUNRLFlBQXBCLEdBQW1DLEVBQW5DO0FBR0FSLG1CQUFtQixDQUFDUyxTQUFwQixHQUFnQztBQUM1Qjs7O0FBR0FMLFVBQVEsRUFBRU0saURBQVMsQ0FBQ0MsSUFKUTs7QUFNNUI7OztBQUdBVCxPQUFLLEVBQUVRLGlEQUFTLENBQUNFLE1BVFc7O0FBVzVCOzs7QUFHQVQsV0FBUyxFQUFFTyxpREFBUyxDQUFDRyxNQWRPOztBQWdCNUI7OztBQUdBUixJQUFFLEVBQUVLLGlEQUFTLENBQUNHLE1BbkJjOztBQXFCNUI7OztBQUdBUCxRQUFNLEVBQUVJLGlEQUFTLENBQUNJO0FBeEJVLENBQWhDLEMiLCJmaWxlIjoiNTA3MGI1MS1tYWluLXdwcy1obXIuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QsIHsgQ29tcG9uZW50IH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IFByb3BUeXBlcyBmcm9tICdwcm9wLXR5cGVzJztcbmltcG9ydCAncmVhY3QtZ3JpZC1sYXlvdXQvY3NzL3N0eWxlcy5jc3MnXG5pbXBvcnQgJ3JlYWN0LXJlc2l6YWJsZS9jc3Mvc3R5bGVzLmNzcydcbmltcG9ydCBHcmlkTGF5b3V0IGZyb20gJ3JlYWN0LWdyaWQtbGF5b3V0JztcblxuLyoqXG4gKiBHcmlkTGF5b3V0IGlzIGFuIEdyaWRMYXlvdXQgY29tcG9uZW50LlxuICogSXQgdGFrZXMgc29tZSBzZXR0aW5nIHByb3BlcnRpZXNcbiAqIFlvdSBwdXQgaG93IG1hbnkgYmxvY2tzIG9mIGRpdnMgeW91IHdhbnQgaW5zaWRlIGl0LFxuICogYW5kIHRoaXMgZGl2IHR1cm4gaW50byBzbGlkZXNcbiAqL1xuXG5leHBvcnQgZGVmYXVsdCBjbGFzcyBHcmlkTGF5b3V0Q29tcG9uZW50IGV4dGVuZHMgQ29tcG9uZW50IHtcbiAgICByZW5kZXIoKSB7XG5cbiAgICAgICAgY29uc3QgeyBzdHlsZSwgY2xhc3NOYW1lLCBjaGlsZHJlbiwgaWQsIGxheW91dCB9ID0gdGhpcy5wcm9wcztcblxuICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgPEdyaWRMYXlvdXQgaWQ9e2lkfSBjbGFzc05hbWU9e2Ake2NsYXNzTmFtZX0gbGF5b3V0YH0gc3R5bGU9e3N0eWxlfSBsYXlvdXQ9e2xheW91dH0gY29scz17MTJ9IHJvd0hlaWdodD17MzB9IHdpZHRoPXsxMjAwfT5cbiAgICAgICAgICAgICAgICB7Y2hpbGRyZW59XG4gICAgICAgICAgICA8L0dyaWRMYXlvdXQ+XG4gICAgICAgIClcbiAgICB9XG59XG5cbkdyaWRMYXlvdXRDb21wb25lbnQuZGVmYXVsdFByb3BzID0ge1xufTtcblxuR3JpZExheW91dENvbXBvbmVudC5wcm9wVHlwZXMgPSB7XG4gICAgLyoqXG4gICAgICogWW91ciBHcmlkTGF5b3V0IGlzIHZlcnRpY2FsXG4gICAgICovXG4gICAgY2hpbGRyZW46IFByb3BUeXBlcy5ub2RlLFxuXG4gICAgLyoqXG4gICAgICogSW5saW5lIHN0eWxlIG9mIHRoZSBjb21wb25lbnQuXG4gICAgICovXG4gICAgc3R5bGU6IFByb3BUeXBlcy5vYmplY3QsXG5cbiAgICAvKipcbiAgICAgKiBTdHlsZSBjbGFzcyBvZiB0aGUgY29tcG9uZW50LlxuICAgICAqL1xuICAgIGNsYXNzTmFtZTogUHJvcFR5cGVzLnN0cmluZyxcblxuICAgIC8qKlxuICAgICAqIElkIG9mIHRoZSBlbGVtZW50XG4gICAgICovXG4gICAgaWQ6IFByb3BUeXBlcy5zdHJpbmcsXG5cbiAgICAvKipcbiAgICAgKiBJbml0aWFsIGxheW91dFxuICAgICAqL1xuICAgIGxheW91dDogUHJvcFR5cGVzLmFycmF5LFxufTtcbiJdLCJzb3VyY2VSb290IjoiIn0= -------------------------------------------------------------------------------- /dash_trich_components/5070b51-wps-hmr.json: -------------------------------------------------------------------------------- 1 | {"h":"d67aa219dd68b7357bd4","c":{"main":true}} -------------------------------------------------------------------------------- /dash_trich_components/698155c-wps-hmr.json: -------------------------------------------------------------------------------- 1 | {"h":"890d5e7e68924aba1f9b","c":{"main":true}} -------------------------------------------------------------------------------- /dash_trich_components/Card.py: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | from dash.development.base_component import Component, _explicitize_args 4 | 5 | 6 | class Card(Component): 7 | """A Card component. 8 | A simple card with an image, title, description, 9 | badges and link for github with icon, all this arguments are optional. 10 | 11 | Keyword arguments: 12 | - id (string; optional): Id of the element 13 | - className (string; default ''): Style class of the component. 14 | - style (dict; optional): Inline style of the component. 15 | - link (string; optional): link to redirect when the user clicks on the image 16 | - image (string; optional): image that will display on card 17 | - title (string; optional): title of the card 18 | - description (string; optional): description of the card 19 | - badges (list; optional): list of strings to display in badges, to work porperly put up to 4 or 5 20 | - git (string; optional): github URL, is not required, only if you want to 21 | - dark (boolean; default False): theme color of the card, that for default is light 22 | - openNewTab (boolean; default True): Open card link in a new tab""" 23 | @_explicitize_args 24 | def __init__(self, id=Component.UNDEFINED, className=Component.UNDEFINED, style=Component.UNDEFINED, link=Component.UNDEFINED, image=Component.UNDEFINED, title=Component.UNDEFINED, description=Component.UNDEFINED, badges=Component.UNDEFINED, git=Component.UNDEFINED, dark=Component.UNDEFINED, openNewTab=Component.UNDEFINED, **kwargs): 25 | self._prop_names = ['id', 'className', 'style', 'link', 'image', 'title', 'description', 'badges', 'git', 'dark', 'openNewTab'] 26 | self._type = 'Card' 27 | self._namespace = 'dash_trich_components' 28 | self._valid_wildcard_attributes = [] 29 | self.available_properties = ['id', 'className', 'style', 'link', 'image', 'title', 'description', 'badges', 'git', 'dark', 'openNewTab'] 30 | self.available_wildcard_properties = [] 31 | 32 | _explicit_args = kwargs.pop('_explicit_args') 33 | _locals = locals() 34 | _locals.update(kwargs) # For wildcard attrs 35 | args = {k: _locals[k] for k in _explicit_args if k != 'children'} 36 | 37 | for k in []: 38 | if k not in args: 39 | raise TypeError( 40 | 'Required argument `' + k + '` was not specified.') 41 | super(Card, self).__init__(**args) 42 | -------------------------------------------------------------------------------- /dash_trich_components/Carousel.py: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | from dash.development.base_component import Component, _explicitize_args 4 | 5 | 6 | class Carousel(Component): 7 | """A Carousel component. 8 | Carousel is an carousel component. 9 | It takes some setting properties 10 | You put how many blocks of divs you want inside it, 11 | and this div turn into slides 12 | 13 | Keyword arguments: 14 | - children (a list of or a singular dash component, string or number; optional): Your carousel is vertical 15 | - dots (boolean; optional): Dots under carousel 16 | - arrows (boolean; optional): Arrows to control carousel 17 | - infinite (boolean; optional): If the carousel content will repeat in a loop 18 | - autoplay (boolean; optional): If the carousel will start to play automatically 19 | - speed (number; optional): Speed of autoplay 20 | - slides_to_show (number; optional): How many slides you want to show 21 | - slides_to_scroll (number; optional): How many slides will scroll when you swipe the carousel 22 | - center_mode (boolean; optional): To centralize the carousel 23 | - center_padding (string; optional): Padding on the sides 24 | - swipe_to_slide (boolean; optional): If you can slide to scroll the slides 25 | - variable_width (boolean; optional): The slides width varies according to the screen size 26 | - responsive (list; optional): Settings of breakpoints 27 | - vertical (boolean; optional): If your carousel is vertical 28 | - style (dict; optional): Inline style of the component. 29 | - className (string; optional): Style class of the component. 30 | - id (string; optional): Id of the element""" 31 | @_explicitize_args 32 | def __init__(self, children=None, dots=Component.UNDEFINED, arrows=Component.UNDEFINED, infinite=Component.UNDEFINED, autoplay=Component.UNDEFINED, speed=Component.UNDEFINED, slides_to_show=Component.UNDEFINED, slides_to_scroll=Component.UNDEFINED, center_mode=Component.UNDEFINED, center_padding=Component.UNDEFINED, swipe_to_slide=Component.UNDEFINED, variable_width=Component.UNDEFINED, responsive=Component.UNDEFINED, vertical=Component.UNDEFINED, style=Component.UNDEFINED, className=Component.UNDEFINED, id=Component.UNDEFINED, **kwargs): 33 | self._prop_names = ['children', 'dots', 'arrows', 'infinite', 'autoplay', 'speed', 'slides_to_show', 'slides_to_scroll', 'center_mode', 'center_padding', 'swipe_to_slide', 'variable_width', 'responsive', 'vertical', 'style', 'className', 'id'] 34 | self._type = 'Carousel' 35 | self._namespace = 'dash_trich_components' 36 | self._valid_wildcard_attributes = [] 37 | self.available_properties = ['children', 'dots', 'arrows', 'infinite', 'autoplay', 'speed', 'slides_to_show', 'slides_to_scroll', 'center_mode', 'center_padding', 'swipe_to_slide', 'variable_width', 'responsive', 'vertical', 'style', 'className', 'id'] 38 | self.available_wildcard_properties = [] 39 | 40 | _explicit_args = kwargs.pop('_explicit_args') 41 | _locals = locals() 42 | _locals.update(kwargs) # For wildcard attrs 43 | args = {k: _locals[k] for k in _explicit_args if k != 'children'} 44 | 45 | for k in []: 46 | if k not in args: 47 | raise TypeError( 48 | 'Required argument `' + k + '` was not specified.') 49 | super(Carousel, self).__init__(children=children, **args) 50 | -------------------------------------------------------------------------------- /dash_trich_components/GridItem.py: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | from dash.development.base_component import Component, _explicitize_args 4 | 5 | 6 | class GridItem(Component): 7 | """A GridItem component. 8 | A class for displaying an item in a grid 9 | Designed to be wrapped in a function, similar to a higher-order component. Otherwise 10 | the layout will render incorrectly 11 | 12 | Keyword arguments: 13 | - children (a list of or a singular dash component, string or number; optional): A list of child elements to place inside the grid ite, 14 | - i (string; required): An identifier for the component. 15 | Synonymous with `key`, but `key` cannot be specified as 16 | a PropType without causing errors. A caveat to this is that when using 17 | the component in pure React (as opposed to via Dash), both `i` and `key` 18 | must be specified 19 | - layout (dict; optional): An object describing the layout of the element. layout has the following type: dict containing keys 'x', 'y', 'w', 'h', 'minW', 'maxW', 'minH', 'maxH', 'static', 'isDraggable', 'isResizable'. 20 | Those keys have the following types: 21 | - x (number; required): The x-value of the element location, in grid units 22 | - y (number; required): The y-value of the element location, in grid units 23 | - w (number; required): The width of the element, in grid units 24 | - h (number; required): The height of the element, in grid units 25 | - minW (number; optional): The minimum width of the element, in grid units 26 | - maxW (number; optional): The maximum width of the element, in grid units 27 | - minH (number; optional): The minimum height of the element, in grid units 28 | - maxH (number; optional): The maximum height of the element, in grid units 29 | - static (boolean; optional): Is static: if true, the element is not resizable or draggable 30 | - isDraggable (boolean; optional): If false, element can not be dragged 31 | - isResizable (boolean; optional): If false, the element can not be resized""" 32 | @_explicitize_args 33 | def __init__(self, children=None, i=Component.REQUIRED, layout=Component.UNDEFINED, **kwargs): 34 | self._prop_names = ['children', 'i', 'layout'] 35 | self._type = 'GridItem' 36 | self._namespace = 'dash_trich_components' 37 | self._valid_wildcard_attributes = [] 38 | self.available_properties = ['children', 'i', 'layout'] 39 | self.available_wildcard_properties = [] 40 | 41 | _explicit_args = kwargs.pop('_explicit_args') 42 | _locals = locals() 43 | _locals.update(kwargs) # For wildcard attrs 44 | args = {k: _locals[k] for k in _explicit_args if k != 'children'} 45 | 46 | for k in ['i']: 47 | if k not in args: 48 | raise TypeError( 49 | 'Required argument `' + k + '` was not specified.') 50 | super(GridItem, self).__init__(children=children, **args) 51 | -------------------------------------------------------------------------------- /dash_trich_components/GridLayoutComponent.py: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | from dash.development.base_component import Component, _explicitize_args 4 | 5 | 6 | class GridLayoutComponent(Component): 7 | """A GridLayoutComponent component. 8 | GridLayout is an GridLayout component. 9 | It takes some setting properties 10 | You put how many blocks of divs you want inside it, 11 | and this div turn into slides 12 | 13 | Keyword arguments: 14 | - children (a list of or a singular dash component, string or number; optional): Your GridLayout is vertical 15 | - style (dict; optional): Inline style of the component. 16 | - className (string; optional): Style class of the component. 17 | - id (string; optional): Id of the element 18 | - layout (list; optional): Initial layout""" 19 | @_explicitize_args 20 | def __init__(self, children=None, style=Component.UNDEFINED, className=Component.UNDEFINED, id=Component.UNDEFINED, layout=Component.UNDEFINED, **kwargs): 21 | self._prop_names = ['children', 'style', 'className', 'id', 'layout'] 22 | self._type = 'GridLayoutComponent' 23 | self._namespace = 'dash_trich_components' 24 | self._valid_wildcard_attributes = [] 25 | self.available_properties = ['children', 'style', 'className', 'id', 'layout'] 26 | self.available_wildcard_properties = [] 27 | 28 | _explicit_args = kwargs.pop('_explicit_args') 29 | _locals = locals() 30 | _locals.update(kwargs) # For wildcard attrs 31 | args = {k: _locals[k] for k in _explicit_args if k != 'children'} 32 | 33 | for k in []: 34 | if k not in args: 35 | raise TypeError( 36 | 'Required argument `' + k + '` was not specified.') 37 | super(GridLayoutComponent, self).__init__(children=children, **args) 38 | -------------------------------------------------------------------------------- /dash_trich_components/ResponsiveGrid.py: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | from dash.development.base_component import Component, _explicitize_args 4 | 5 | 6 | class ResponsiveGrid(Component): 7 | """A ResponsiveGrid component. 8 | This component is an update of an another component build by Alexander Cabello 9 | 10 | The Link to the original component is: https://github.com/AlgorithmHub/dash-responsive-grid-layout 11 | 12 | It allows the user to drag, resize and modify the components inside of it. 13 | To be able to run it, you need to add a layout(one definition to each breakpoint) and a div with the ID (key) that will be mapped as the box inside of the Draggable Component. 14 | 15 | Keyword arguments: 16 | - children (a list of or a singular dash component, string or number; optional): A list of renderable child elements, that will be placed inside the grid 17 | - id (string; optional): The ID used to identify the component in Dash callbacks 18 | - breakpoint (string; optional) 19 | - breakpoints (dict; optional) 20 | - cols (dict; optional) 21 | - layouts (dict; optional) 22 | - width (number; optional) 23 | - rowHeight (number; optional): The height, in pixels of a row in the grid 24 | - maxRows (number; optional): Total Rows that can the board have based on the cumulated sum of all rows 25 | - autoSize (boolean; optional): If true, containers will automatically resize to fit the content 26 | - draggableCancel (string; optional): CSS selector for tags that will not be draggable. Requires a leading '.' 27 | - draggableHandle (string; optional): CSS selector for tags that will act as the draggable handle. Requires a leading '.' 28 | - verticalCompact (boolean; optional): If true, the layout will compact vertically 29 | - compactType (a value equal to: 'vertical', 'horizontal'; optional): Compaction type. 30 | One of 'vertical' and 'horizontal' 31 | - margin (list of numbers; optional): Margin between items [x, y] in px 32 | - containerPadding (list of numbers; optional): Padding inside the container [x, y] in px 33 | - isDraggable (boolean; optional): Elements can be dragged 34 | - isResizable (boolean; optional): Elements can be resized 35 | - useCSSTransforms (boolean; optional): Use CSS transforms instead of Position. Improves performance if switched on 36 | - preventCollision (boolean; optional): If true, grid items won't change position when being 37 | dragged over 38 | - className (string; optional): Set the ClassName to the component""" 39 | @_explicitize_args 40 | def __init__(self, children=None, id=Component.UNDEFINED, breakpoint=Component.UNDEFINED, breakpoints=Component.UNDEFINED, cols=Component.UNDEFINED, layouts=Component.UNDEFINED, width=Component.UNDEFINED, onBreakpointChange=Component.UNDEFINED, onLayoutChange=Component.UNDEFINED, onWidthChange=Component.UNDEFINED, rowHeight=Component.UNDEFINED, maxRows=Component.UNDEFINED, autoSize=Component.UNDEFINED, draggableCancel=Component.UNDEFINED, draggableHandle=Component.UNDEFINED, verticalCompact=Component.UNDEFINED, compactType=Component.UNDEFINED, margin=Component.UNDEFINED, containerPadding=Component.UNDEFINED, isDraggable=Component.UNDEFINED, isResizable=Component.UNDEFINED, useCSSTransforms=Component.UNDEFINED, preventCollision=Component.UNDEFINED, onDragStart=Component.UNDEFINED, onDrag=Component.UNDEFINED, onDragStop=Component.UNDEFINED, onResizeStart=Component.UNDEFINED, onResize=Component.UNDEFINED, onResizeStop=Component.UNDEFINED, className=Component.UNDEFINED, **kwargs): 41 | self._prop_names = ['children', 'id', 'breakpoint', 'breakpoints', 'cols', 'layouts', 'width', 'rowHeight', 'maxRows', 'autoSize', 'draggableCancel', 'draggableHandle', 'verticalCompact', 'compactType', 'margin', 'containerPadding', 'isDraggable', 'isResizable', 'useCSSTransforms', 'preventCollision', 'className'] 42 | self._type = 'ResponsiveGrid' 43 | self._namespace = 'dash_trich_components' 44 | self._valid_wildcard_attributes = [] 45 | self.available_properties = ['children', 'id', 'breakpoint', 'breakpoints', 'cols', 'layouts', 'width', 'rowHeight', 'maxRows', 'autoSize', 'draggableCancel', 'draggableHandle', 'verticalCompact', 'compactType', 'margin', 'containerPadding', 'isDraggable', 'isResizable', 'useCSSTransforms', 'preventCollision', 'className'] 46 | self.available_wildcard_properties = [] 47 | 48 | _explicit_args = kwargs.pop('_explicit_args') 49 | _locals = locals() 50 | _locals.update(kwargs) # For wildcard attrs 51 | args = {k: _locals[k] for k in _explicit_args if k != 'children'} 52 | 53 | for k in []: 54 | if k not in args: 55 | raise TypeError( 56 | 'Required argument `' + k + '` was not specified.') 57 | super(ResponsiveGrid, self).__init__(children=children, **args) 58 | -------------------------------------------------------------------------------- /dash_trich_components/SideBar.py: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | from dash.development.base_component import Component, _explicitize_args 4 | 5 | 6 | class SideBar(Component): 7 | """A SideBar component. 8 | A collapsible side bar for your dashboard, 9 | with icons from Font Awesome 10 | 11 | Keyword arguments: 12 | - children (a list of or a singular dash component, string or number; optional): Your carousel is vertical 13 | - id (string; optional): Id of the element 14 | - className (string; default ''): Style class of the component. 15 | - bg_color (string; default '#2b7279'): Color of sidebar background 16 | - text_color (string; default '#ffffff'): Color of sidebar text""" 17 | @_explicitize_args 18 | def __init__(self, children=None, id=Component.UNDEFINED, className=Component.UNDEFINED, bg_color=Component.UNDEFINED, text_color=Component.UNDEFINED, **kwargs): 19 | self._prop_names = ['children', 'id', 'className', 'bg_color', 'text_color'] 20 | self._type = 'SideBar' 21 | self._namespace = 'dash_trich_components' 22 | self._valid_wildcard_attributes = [] 23 | self.available_properties = ['children', 'id', 'className', 'bg_color', 'text_color'] 24 | self.available_wildcard_properties = [] 25 | 26 | _explicit_args = kwargs.pop('_explicit_args') 27 | _locals = locals() 28 | _locals.update(kwargs) # For wildcard attrs 29 | args = {k: _locals[k] for k in _explicit_args if k != 'children'} 30 | 31 | for k in []: 32 | if k not in args: 33 | raise TypeError( 34 | 'Required argument `' + k + '` was not specified.') 35 | super(SideBar, self).__init__(children=children, **args) 36 | -------------------------------------------------------------------------------- /dash_trich_components/SideBarItem.py: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | from dash.development.base_component import Component, _explicitize_args 4 | 5 | 6 | class SideBarItem(Component): 7 | """A SideBarItem component. 8 | Side bar items, to be used inside of sidebar component 9 | 10 | Keyword arguments: 11 | - id (string; optional): Id of the element 12 | - className (string; default ''): Style class of the component. 13 | - label (string; default 'Label'): Text of menu item on sidebar 14 | - icon (string; default 'fas fa-circle'): Icon of menu item on sidebar, pass the icon class from font awesome 15 | - disabled (boolean; default False): Disable the link. Default: False. 16 | - n_clicks (number; default 0): An integer that represents the number of times 17 | that this element has been clicked on. 18 | - n_clicks_timestamp (number; default -1): An integer that represents the time (in ms since 1970) 19 | at which n_clicks changed. This can be used to tell 20 | which button was changed most recently.""" 21 | @_explicitize_args 22 | def __init__(self, id=Component.UNDEFINED, className=Component.UNDEFINED, label=Component.UNDEFINED, icon=Component.UNDEFINED, disabled=Component.UNDEFINED, n_clicks=Component.UNDEFINED, n_clicks_timestamp=Component.UNDEFINED, **kwargs): 23 | self._prop_names = ['id', 'className', 'label', 'icon', 'disabled', 'n_clicks', 'n_clicks_timestamp'] 24 | self._type = 'SideBarItem' 25 | self._namespace = 'dash_trich_components' 26 | self._valid_wildcard_attributes = [] 27 | self.available_properties = ['id', 'className', 'label', 'icon', 'disabled', 'n_clicks', 'n_clicks_timestamp'] 28 | self.available_wildcard_properties = [] 29 | 30 | _explicit_args = kwargs.pop('_explicit_args') 31 | _locals = locals() 32 | _locals.update(kwargs) # For wildcard attrs 33 | args = {k: _locals[k] for k in _explicit_args if k != 'children'} 34 | 35 | for k in []: 36 | if k not in args: 37 | raise TypeError( 38 | 'Required argument `' + k + '` was not specified.') 39 | super(SideBarItem, self).__init__(**args) 40 | -------------------------------------------------------------------------------- /dash_trich_components/SideBarToggle.py: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | from dash.development.base_component import Component, _explicitize_args 4 | 5 | 6 | class SideBarToggle(Component): 7 | """A SideBarToggle component. 8 | 9 | 10 | Keyword arguments: 11 | - n_clicks (number; optional): How many slides you want to show 12 | - id (string; optional): Padding on the sides""" 13 | @_explicitize_args 14 | def __init__(self, n_clicks=Component.UNDEFINED, id=Component.UNDEFINED, **kwargs): 15 | self._prop_names = ['n_clicks', 'id'] 16 | self._type = 'SideBarToggle' 17 | self._namespace = 'dash_trich_components' 18 | self._valid_wildcard_attributes = [] 19 | self.available_properties = ['n_clicks', 'id'] 20 | self.available_wildcard_properties = [] 21 | 22 | _explicit_args = kwargs.pop('_explicit_args') 23 | _locals = locals() 24 | _locals.update(kwargs) # For wildcard attrs 25 | args = {k: _locals[k] for k in _explicit_args if k != 'children'} 26 | 27 | for k in []: 28 | if k not in args: 29 | raise TypeError( 30 | 'Required argument `' + k + '` was not specified.') 31 | super(SideBarToggle, self).__init__(**args) 32 | -------------------------------------------------------------------------------- /dash_trich_components/ThemeToggle.py: -------------------------------------------------------------------------------- 1 | # AUTO GENERATED FILE - DO NOT EDIT 2 | 3 | from dash.development.base_component import Component, _explicitize_args 4 | 5 | 6 | class ThemeToggle(Component): 7 | """A ThemeToggle component. 8 | Dark/Light theme toggle switch for your Dash project. 9 | 10 | Keyword arguments: 11 | - bg_color_dark (string; default '#232323'): Background color of toggle switch when dark theme 12 | - icon_color_dark (string; default '#EDC575'): Sun icon color of toggle switch when dark theme 13 | - bg_color_light (string; default '#07484E'): Background color of toggle switch when light theme 14 | - icon_color_light (string; default '#c8dbdc'): Moon icon color of toggle switch when dark theme 15 | - tooltip_text (string; default 'Toggle light/dark theme'): Text that will appear in tooltip (only desktop) 16 | - style (dict; optional): Inline style of the component. 17 | - className (string; default ''): Style class of the component. 18 | - id (string; optional): Id of the element""" 19 | @_explicitize_args 20 | def __init__(self, bg_color_dark=Component.UNDEFINED, icon_color_dark=Component.UNDEFINED, bg_color_light=Component.UNDEFINED, icon_color_light=Component.UNDEFINED, tooltip_text=Component.UNDEFINED, style=Component.UNDEFINED, className=Component.UNDEFINED, id=Component.UNDEFINED, **kwargs): 21 | self._prop_names = ['bg_color_dark', 'icon_color_dark', 'bg_color_light', 'icon_color_light', 'tooltip_text', 'style', 'className', 'id'] 22 | self._type = 'ThemeToggle' 23 | self._namespace = 'dash_trich_components' 24 | self._valid_wildcard_attributes = [] 25 | self.available_properties = ['bg_color_dark', 'icon_color_dark', 'bg_color_light', 'icon_color_light', 'tooltip_text', 'style', 'className', 'id'] 26 | self.available_wildcard_properties = [] 27 | 28 | _explicit_args = kwargs.pop('_explicit_args') 29 | _locals = locals() 30 | _locals.update(kwargs) # For wildcard attrs 31 | args = {k: _locals[k] for k in _explicit_args if k != 'children'} 32 | 33 | for k in []: 34 | if k not in args: 35 | raise TypeError( 36 | 'Required argument `' + k + '` was not specified.') 37 | super(ThemeToggle, self).__init__(**args) 38 | -------------------------------------------------------------------------------- /dash_trich_components/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function as _ 2 | 3 | import os as _os 4 | import sys as _sys 5 | import json 6 | 7 | import dash as _dash 8 | 9 | # noinspection PyUnresolvedReferences 10 | from ._imports_ import * 11 | from ._imports_ import __all__ 12 | 13 | if not hasattr(_dash, 'development'): 14 | print('Dash was not successfully imported. ' 15 | 'Make sure you don\'t have a file ' 16 | 'named \n"dash.py" in your current directory.', file=_sys.stderr) 17 | _sys.exit(1) 18 | 19 | _basepath = _os.path.dirname(__file__) 20 | _filepath = _os.path.abspath(_os.path.join(_basepath, 'package-info.json')) 21 | with open(_filepath) as f: 22 | package = json.load(f) 23 | 24 | package_name = package['name'].replace(' ', '_').replace('-', '_') 25 | __version__ = package['version'] 26 | 27 | _current_path = _os.path.dirname(_os.path.abspath(__file__)) 28 | 29 | _this_module = _sys.modules[__name__] 30 | 31 | 32 | _js_dist = [ 33 | { 34 | 'relative_package_path': 'dash_trich_components.min.js', 35 | 'external_url': 'https://unpkg.com/{0}@{2}/{1}/{1}.min.js'.format( 36 | package_name, __name__, __version__), 37 | 'namespace': package_name 38 | }, 39 | { 40 | 'relative_package_path': 'dash_trich_components.min.js.map', 41 | 'external_url': 'https://unpkg.com/{0}@{2}/{1}/{1}.min.js.map'.format( 42 | package_name, __name__, __version__), 43 | 'namespace': package_name, 44 | 'dynamic': True 45 | } 46 | ] 47 | 48 | _css_dist = [] 49 | 50 | 51 | for _component in __all__: 52 | setattr(locals()[_component], '_js_dist', _js_dist) 53 | setattr(locals()[_component], '_css_dist', _css_dist) 54 | -------------------------------------------------------------------------------- /dash_trich_components/_imports_.py: -------------------------------------------------------------------------------- 1 | from .Card import Card 2 | from .Carousel import Carousel 3 | from .GridLayoutComponent import GridLayoutComponent 4 | from .GridItem import GridItem 5 | from .ResponsiveGrid import ResponsiveGrid 6 | from .SideBar import SideBar 7 | from .SideBarItem import SideBarItem 8 | from .ThemeToggle import ThemeToggle 9 | 10 | __all__ = [ 11 | "Card", 12 | "Carousel", 13 | "GridLayoutComponent", 14 | "GridItem", 15 | "ResponsiveGrid", 16 | "SideBar", 17 | "SideBarItem", 18 | "ThemeToggle" 19 | ] -------------------------------------------------------------------------------- /dash_trich_components/f083a31-wps-hmr.json: -------------------------------------------------------------------------------- 1 | {"h":"6c67640c00b17d598cb9","c":{"main":true}} -------------------------------------------------------------------------------- /dash_trich_components/fec5c6e-main-wps-hmr.js: -------------------------------------------------------------------------------- 1 | webpackHotUpdatedash_trich_components("main",{ 2 | 3 | /***/ "./src/demo/App.js": 4 | /*!*************************!*\ 5 | !*** ./src/demo/App.js ***! 6 | \*************************/ 7 | /*! exports provided: default */ 8 | /***/ (function(module, __webpack_exports__, __webpack_require__) { 9 | 10 | "use strict"; 11 | __webpack_require__.r(__webpack_exports__); 12 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); 13 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); 14 | /* harmony import */ var _lib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib */ "./src/lib/index.js"); 15 | /* harmony import */ var _lib_components_GridLayoutComponent_GridLayoutComponent_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lib/components/GridLayoutComponent/GridLayoutComponent.react */ "./src/lib/components/GridLayoutComponent/GridLayoutComponent.react.js"); 16 | function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 17 | 18 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 19 | 20 | function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 21 | 22 | function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 23 | 24 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 25 | 26 | function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 27 | 28 | function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function () { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 29 | 30 | function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 31 | 32 | function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 33 | 34 | function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } 35 | 36 | function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 37 | 38 | /* eslint no-magic-numbers: 0 */ 39 | 40 | 41 | 42 | 43 | var App = /*#__PURE__*/function (_Component) { 44 | _inherits(App, _Component); 45 | 46 | var _super = _createSuper(App); 47 | 48 | function App() { 49 | var _this; 50 | 51 | _classCallCheck(this, App); 52 | 53 | _this = _super.call(this); 54 | _this.state = { 55 | value: '' 56 | }; 57 | _this.setProps = _this.setProps.bind(_assertThisInitialized(_this)); 58 | return _this; 59 | } 60 | 61 | _createClass(App, [{ 62 | key: "setProps", 63 | value: function setProps(newProps) { 64 | this.setState(newProps); 65 | } 66 | }, { 67 | key: "render", 68 | value: function render() { 69 | return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_lib_components_GridLayoutComponent_GridLayoutComponent_react__WEBPACK_IMPORTED_MODULE_2__["default"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, "teste"))); 70 | } 71 | }]); 72 | 73 | return App; 74 | }(react__WEBPACK_IMPORTED_MODULE_0__["Component"]); 75 | 76 | /* harmony default export */ __webpack_exports__["default"] = (App); 77 | 78 | /***/ }) 79 | 80 | }) 81 | //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX3RyaWNoX2NvbXBvbmVudHMvLi9zcmMvZGVtby9BcHAuanMiXSwibmFtZXMiOlsiQXBwIiwic3RhdGUiLCJ2YWx1ZSIsInNldFByb3BzIiwiYmluZCIsIm5ld1Byb3BzIiwic2V0U3RhdGUiLCJDb21wb25lbnQiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQTtBQUNBO0FBRUE7QUFDQTs7SUFFTUEsRzs7Ozs7QUFFRixpQkFBYztBQUFBOztBQUFBOztBQUNWO0FBQ0EsVUFBS0MsS0FBTCxHQUFhO0FBQ1RDLFdBQUssRUFBRTtBQURFLEtBQWI7QUFHQSxVQUFLQyxRQUFMLEdBQWdCLE1BQUtBLFFBQUwsQ0FBY0MsSUFBZCwrQkFBaEI7QUFMVTtBQU1iOzs7OzZCQUVRQyxRLEVBQVU7QUFDZixXQUFLQyxRQUFMLENBQWNELFFBQWQ7QUFDSDs7OzZCQUVRO0FBQ0wsMEJBQ0kscUZBQ0ksMkRBQUMscUdBQUQscUJBQ0EsZ0ZBREEsQ0FESixDQURKO0FBT0g7Ozs7RUF0QmFFLCtDOztBQXlCSFAsa0VBQWYsRSIsImZpbGUiOiJmZWM1YzZlLW1haW4td3BzLWhtci5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludCBuby1tYWdpYy1udW1iZXJzOiAwICovXG5pbXBvcnQgUmVhY3QsIHtDb21wb25lbnR9IGZyb20gJ3JlYWN0JztcblxuaW1wb3J0IHsgQ2Fyb3VzZWwgfSBmcm9tICcuLi9saWInO1xuaW1wb3J0IEdyaWRMYXlvdXRDb21wb25lbnQgZnJvbSAnLi4vbGliL2NvbXBvbmVudHMvR3JpZExheW91dENvbXBvbmVudC9HcmlkTGF5b3V0Q29tcG9uZW50LnJlYWN0JztcblxuY2xhc3MgQXBwIGV4dGVuZHMgQ29tcG9uZW50IHtcblxuICAgIGNvbnN0cnVjdG9yKCkge1xuICAgICAgICBzdXBlcigpO1xuICAgICAgICB0aGlzLnN0YXRlID0ge1xuICAgICAgICAgICAgdmFsdWU6ICcnXG4gICAgICAgIH07XG4gICAgICAgIHRoaXMuc2V0UHJvcHMgPSB0aGlzLnNldFByb3BzLmJpbmQodGhpcyk7XG4gICAgfVxuXG4gICAgc2V0UHJvcHMobmV3UHJvcHMpIHtcbiAgICAgICAgdGhpcy5zZXRTdGF0ZShuZXdQcm9wcyk7XG4gICAgfVxuXG4gICAgcmVuZGVyKCkge1xuICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgPGRpdj5cbiAgICAgICAgICAgICAgICA8R3JpZExheW91dENvbXBvbmVudD5cbiAgICAgICAgICAgICAgICA8ZGl2PnRlc3RlPC9kaXY+XG4gICAgICAgICAgICAgICAgPC9HcmlkTGF5b3V0Q29tcG9uZW50PlxuICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgIClcbiAgICB9XG59XG5cbmV4cG9ydCBkZWZhdWx0IEFwcDtcbiJdLCJzb3VyY2VSb290IjoiIn0= -------------------------------------------------------------------------------- /dash_trich_components/fec5c6e-wps-hmr.json: -------------------------------------------------------------------------------- 1 | {"h":"8d1025b0758f83ddeb84","c":{"main":true}} -------------------------------------------------------------------------------- /dash_trich_components/fonts/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/dash_trich_components/fonts/ajax-loader.gif -------------------------------------------------------------------------------- /dash_trich_components/fonts/fa-brands-400.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/dash_trich_components/fonts/fa-brands-400.eot -------------------------------------------------------------------------------- /dash_trich_components/fonts/fa-brands-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/dash_trich_components/fonts/fa-brands-400.ttf -------------------------------------------------------------------------------- /dash_trich_components/fonts/fa-brands-400.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/dash_trich_components/fonts/fa-brands-400.woff -------------------------------------------------------------------------------- /dash_trich_components/fonts/fa-brands-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/dash_trich_components/fonts/fa-brands-400.woff2 -------------------------------------------------------------------------------- /dash_trich_components/fonts/fa-regular-400.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/dash_trich_components/fonts/fa-regular-400.eot -------------------------------------------------------------------------------- /dash_trich_components/fonts/fa-regular-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/dash_trich_components/fonts/fa-regular-400.ttf -------------------------------------------------------------------------------- /dash_trich_components/fonts/fa-regular-400.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/dash_trich_components/fonts/fa-regular-400.woff -------------------------------------------------------------------------------- /dash_trich_components/fonts/fa-regular-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/dash_trich_components/fonts/fa-regular-400.woff2 -------------------------------------------------------------------------------- /dash_trich_components/fonts/fa-solid-900.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/dash_trich_components/fonts/fa-solid-900.eot -------------------------------------------------------------------------------- /dash_trich_components/fonts/fa-solid-900.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/dash_trich_components/fonts/fa-solid-900.ttf -------------------------------------------------------------------------------- /dash_trich_components/fonts/fa-solid-900.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/dash_trich_components/fonts/fa-solid-900.woff -------------------------------------------------------------------------------- /dash_trich_components/fonts/fa-solid-900.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/dash_trich_components/fonts/fa-solid-900.woff2 -------------------------------------------------------------------------------- /dash_trich_components/fonts/slick.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/dash_trich_components/fonts/slick.eot -------------------------------------------------------------------------------- /dash_trich_components/fonts/slick.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Generated by Fontastic.me 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /dash_trich_components/fonts/slick.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/dash_trich_components/fonts/slick.ttf -------------------------------------------------------------------------------- /dash_trich_components/fonts/slick.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/dash_trich_components/fonts/slick.woff -------------------------------------------------------------------------------- /dash_trich_components/package-info.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dash_trich_components", 3 | "version": "1.0.0", 4 | "description": "Trich.ai components library for Dash Plotly", 5 | "repository": { 6 | "type": "git", 7 | "url": "git://github.com/romanonatacha/dash-trich-components.git" 8 | }, 9 | "bugs": { 10 | "url": "https://github.com/romanonatacha/dash-trich-components/issues" 11 | }, 12 | "homepage": "https://github.com/romanonatacha/dash-trich-components", 13 | "main": "build/index.js", 14 | "scripts": { 15 | "start": "webpack-serve --config ./webpack.serve.config.js --open", 16 | "validate-init": "python _validate_init.py", 17 | "prepublishOnly": "npm run validate-init", 18 | "build:js": "webpack --mode production", 19 | "build:py_and_r": "dash-generate-components ./src/lib/components dash_trich_components -p package-info.json --r-prefix ''", 20 | "build:py_and_r-activated": "(. venv/bin/activate || venv\\scripts\\activate && npm run build:py_and_r)", 21 | "build": "npm run build:js && npm run build:py_and_r", 22 | "build:activated": "npm run build:js && npm run build:py_and_r-activated" 23 | }, 24 | "author": "Natacha Romano ", 25 | "license": "MIT", 26 | "dependencies": { 27 | "@fortawesome/fontawesome-svg-core": "^1.2.28", 28 | "@fortawesome/free-solid-svg-icons": "^5.13.0", 29 | "@fortawesome/react-fontawesome": "^0.1.9", 30 | "@material-ui/core": "^4.11.3", 31 | "@material-ui/icons": "^4.11.2", 32 | "@trendmicro/react-sidenav": "^0.5.0", 33 | "bootstrap": "^4.5.0", 34 | "file-loader": "^6.0.0", 35 | "node-sass": "^4.14.1", 36 | "ramda": "^0.26.1", 37 | "react-bootstrap": "^1.0.1", 38 | "react-grid-layout": "^1.2.0", 39 | "react-jss": "^10.1.1", 40 | "react-slick": "^0.26.1", 41 | "sass-loader": "^8.0.2", 42 | "slick-carousel": "^1.8.1", 43 | "styled-components": "^5.1.0" 44 | }, 45 | "devDependencies": { 46 | "@babel/core": "^7.5.4", 47 | "@babel/plugin-proposal-object-rest-spread": "^7.5.4", 48 | "@babel/preset-env": "^7.5.4", 49 | "@babel/preset-react": "^7.0.0", 50 | "babel-eslint": "^10.0.2", 51 | "babel-loader": "^8.0.6", 52 | "copyfiles": "^2.1.1", 53 | "css-loader": "^3.5.3", 54 | "eslint": "^6.0.1", 55 | "eslint-config-prettier": "^6.0.0", 56 | "eslint-plugin-import": "^2.18.0", 57 | "eslint-plugin-react": "^7.14.2", 58 | "npm": "^6.14.6", 59 | "prop-types": "^15.7.2", 60 | "react": "^16.13.1", 61 | "react-docgen": "^4.1.1", 62 | "react-dom": "^16.8.6", 63 | "style-loader": "^0.23.1", 64 | "styled-jsx": "^3.2.1", 65 | "webpack": "4.36.1", 66 | "webpack-cli": "3.3.6", 67 | "webpack-serve": "3.1.0" 68 | }, 69 | "engines": { 70 | "node": ">=8.11.0", 71 | "npm": ">=6.1.0" 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /docs/images/card_dark.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/docs/images/card_dark.gif -------------------------------------------------------------------------------- /docs/images/card_light.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/docs/images/card_light.gif -------------------------------------------------------------------------------- /docs/images/carousel.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/docs/images/carousel.gif -------------------------------------------------------------------------------- /docs/images/sidebar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/docs/images/sidebar.gif -------------------------------------------------------------------------------- /docs/images/themetoggle.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/docs/images/themetoggle.gif -------------------------------------------------------------------------------- /docs/scribbler-doc.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | display: flex; 3 | flex-direction: column; 4 | min-height: 100vh; 5 | } 6 | 7 | /* layout */ 8 | .header { 9 | border-bottom: 1px solid var(--code-bg-color); 10 | grid-template-columns: 1fr 150px 60% 1fr; 11 | } 12 | 13 | .wrapper { 14 | display: flex; 15 | flex-grow: 1; 16 | } 17 | 18 | /* logo */ 19 | .logo { 20 | font-weight: 900; 21 | color: var(--primary-color); 22 | font-size: 1.4em; 23 | grid-column: 2; 24 | } 25 | 26 | .logo__thin { 27 | font-weight: 300; 28 | } 29 | 30 | /* menu */ 31 | .menu { 32 | grid-template-columns: 1fr 180px 60% 1fr; 33 | } 34 | 35 | .menu__item { 36 | padding: 1.5rem 1rem; 37 | } 38 | 39 | /* doc */ 40 | .doc__bg { 41 | position: fixed; 42 | top: 0; 43 | left: 0; 44 | bottom: 0; 45 | width: 28%; 46 | background-color: var(--bg-color); 47 | z-index: -1; 48 | } 49 | 50 | .doc__nav { 51 | flex-basis: 20%; 52 | font-weight: 200; 53 | } 54 | 55 | .doc__nav ul { 56 | list-style: none; 57 | padding-left: 0; 58 | line-height: 1.8; 59 | } 60 | 61 | .doc__nav li:hover { 62 | color: var(--primary-color-light); 63 | cursor: pointer; 64 | transition: color .3s ease-in-out; 65 | } 66 | 67 | .doc__nav .selected { 68 | color: var(--accent-color); 69 | position: relative; 70 | } 71 | 72 | .doc__nav .selected:after { 73 | position: absolute; 74 | content: ""; 75 | width: 1rem; 76 | height: 1rem; 77 | background-color: var(--accent-color); 78 | left: -1.5rem; 79 | top: 0.3rem; 80 | } 81 | 82 | .doc__content { 83 | flex-basis: 80%; 84 | padding: 0 0 5rem 1rem; 85 | } 86 | 87 | @media (max-width: 750px) { 88 | .wrapper { 89 | flex-direction: column; 90 | } 91 | .doc__content { 92 | padding-left: 0; 93 | } 94 | .doc__nav ul { 95 | border-bottom: 1px solid var(--code-bg-color); 96 | padding-bottom: 0.5rem; 97 | } 98 | .doc__nav ul.fixed { 99 | /* nutralized the fixed menu for mobile*/ 100 | position: relative; 101 | top: 0; 102 | } 103 | .doc__nav li { 104 | display: inline-block; 105 | padding-right: 1rem; 106 | } 107 | .doc__nav .selected:after { 108 | display: none; 109 | } 110 | } 111 | 112 | .subtitle { 113 | font-size: 0.9rem; 114 | padding-left: 16px; 115 | } 116 | 117 | .gif-example { 118 | width: 800px; 119 | margin: 0 auto 32px; 120 | } 121 | 122 | .text-center { 123 | text-align: center; 124 | } -------------------------------------------------------------------------------- /docs/scribbler-global.css: -------------------------------------------------------------------------------- 1 | /* css variables*/ 2 | :root { 3 | --primary-color: #432E30; 4 | --primary-color-light: #8E7474; 5 | --accent-color: #FE6A6B; 6 | --accent-color-light: #FFE4E4; 7 | --accent-color-dark: #B94B4C; 8 | --white-color: #FAFBFC; 9 | --light-gray-color: #C6CBD1; 10 | --medium-gray-color: #959DA5; 11 | --dark-gray-color: #444D56; 12 | --bg-color: #F8F8FA; 13 | --code-bg-color: #F0E8E8; 14 | } 15 | 16 | /* normalized */ 17 | html, body { 18 | padding: 0; 19 | margin: 0; 20 | font-family: 'Nunito Sans', sans-serif; 21 | background-color: white; 22 | } 23 | 24 | p { 25 | font-weight: 300; 26 | color: #4A4A4A; 27 | } 28 | 29 | a { 30 | text-decoration: none; 31 | color: var(--accent-color-dark); 32 | font-weight: bold; 33 | } 34 | 35 | a:hover { 36 | text-decoration: underline; 37 | } 38 | 39 | hr { 40 | padding: 1rem 0; 41 | border: 0; 42 | border-bottom: 1px solid var(--bg-color); 43 | } 44 | 45 | * { 46 | box-sizing: border-box; 47 | } 48 | 49 | img { 50 | width: 100%; 51 | } 52 | 53 | /* global components */ 54 | 55 | /* typography */ 56 | .section__title { 57 | color: var(--primary-color); 58 | } 59 | 60 | /* tabs */ 61 | .tab__container { 62 | position: relative; 63 | } 64 | 65 | .tab__container > ul { 66 | position: absolute; 67 | list-style: none; 68 | margin: 0; 69 | right: 1rem; 70 | top: -2rem; 71 | padding-left: 0; 72 | } 73 | 74 | .tab__container .code { 75 | white-space: normal; 76 | padding: 1rem 1.5rem; 77 | } 78 | 79 | .tab { 80 | display: inline-block; 81 | padding: 0.3rem 0.5rem; 82 | font-weight: 200; 83 | cursor: pointer; 84 | } 85 | 86 | .tab.active { 87 | border-bottom: 1px solid var(--primary-color); 88 | font-weight: 700; 89 | display: inline-block; 90 | } 91 | 92 | .tab__pane { 93 | display: none; 94 | } 95 | 96 | .tab__pane.active { 97 | display: block; 98 | } 99 | 100 | /* code */ 101 | .code { 102 | border-radius: 3px; 103 | font-family: Space Mono, SFMono-Regular, Menlo,Monaco, Consolas, Liberation Mono, Courier New, monospace; 104 | background: var(--bg-color); 105 | border: 1px solid var(--code-bg-color); 106 | color: var(--dark-gray-color); 107 | } 108 | 109 | .code--block { 110 | white-space: pre-line; 111 | padding: 0 1.5rem; 112 | } 113 | 114 | .code--inline { 115 | padding: 3px 6px; 116 | font-size: 80%; 117 | } 118 | 119 | /* buttons */ 120 | .button--primary { 121 | padding: 10px 22px; 122 | background-color: var(--accent-color); 123 | color: white; 124 | position: relative; 125 | text-decoration: none; 126 | border: 0; 127 | transition: all .3s ease-out; 128 | } 129 | 130 | .button--primary:after { 131 | position: absolute; 132 | content: ""; 133 | width: 1rem; 134 | height: 1rem; 135 | background-color: var(--accent-color-light); 136 | right: -0.4rem; 137 | top: -0.4rem; 138 | transition: all 0.3s ease-out; 139 | } 140 | 141 | .button--primary:hover { 142 | text-shadow: 0px 1px 1px var(--accent-color-dark); 143 | color: white; 144 | transform: translate3D(0, -3px, 0); 145 | } 146 | 147 | .button--primary:hover::after { 148 | transform: rotate(90deg); 149 | } 150 | 151 | .button--secondary { 152 | padding: 10px 22px; 153 | border: 2px solid var(--primary-color); 154 | transition: all 0.5s ease-out; 155 | } 156 | 157 | .button--secondary:hover { 158 | border-color: var(--accent-color); 159 | color: var(--accent-color); 160 | } 161 | 162 | /* links */ 163 | .link { 164 | text-decoration: none; 165 | transition: all 0.3s ease-out; 166 | } 167 | 168 | .link:hover { 169 | color: var(--accent-color); 170 | } 171 | 172 | .link--dark { 173 | color: var(--primary-color); 174 | } 175 | 176 | .link--light { 177 | color: var(--accent-color); 178 | } 179 | 180 | /* menu */ 181 | nav { 182 | display: grid; 183 | grid-template-columns: 70px auto; 184 | } 185 | 186 | .menu { 187 | margin: 0; 188 | text-align: right; 189 | overflow: hidden; 190 | list-style: none; 191 | } 192 | 193 | .toggle { 194 | display: none; 195 | position: relative; 196 | } 197 | 198 | .toggle span, 199 | .toggle span:before, 200 | .toggle span:after { 201 | content: ''; 202 | position: absolute; 203 | height: 2px; 204 | width: 18px; 205 | border-radius: 2px; 206 | background: var(--primary-color); 207 | display: block; 208 | cursor: pointer; 209 | transition: all 0.3s ease-in-out; 210 | right: 0; 211 | } 212 | 213 | .toggle span:before { 214 | top: -6px; 215 | } 216 | 217 | .toggle span:after { 218 | bottom: -6px; 219 | } 220 | 221 | .toggle.open span{ 222 | background-color: transparent; 223 | } 224 | 225 | .toggle.open span:before, 226 | .toggle.open span:after { 227 | top: 0; 228 | } 229 | 230 | .toggle.open span:before { 231 | transform: rotate(45deg); 232 | } 233 | 234 | .toggle.open span:after { 235 | transform: rotate(-45deg); 236 | } 237 | 238 | .menu__item { 239 | padding: 1rem; 240 | display: inline-block; 241 | } 242 | 243 | .menu__item.toggle { 244 | display: none; 245 | } 246 | 247 | /* table */ 248 | table { 249 | border-collapse: collapse; 250 | width: 100%; 251 | transition: color .3s ease-out; 252 | margin-bottom: 2rem; 253 | } 254 | 255 | table td, table th { 256 | border: 1px solid var(--code-bg-color); 257 | padding: 0.8rem; 258 | font-weight: 300; 259 | } 260 | 261 | table th { 262 | text-align: left; 263 | background-color: white; 264 | border-color: white; 265 | border-bottom-color: var(--code-bg-color); 266 | } 267 | 268 | table td:first-child { 269 | background-color: var(--bg-color); 270 | font-weight: 600; 271 | } 272 | 273 | @media screen and (max-width: 600px) { 274 | nav { 275 | grid-template-columns: 70px auto; 276 | } 277 | 278 | .menu__item{ 279 | display: none; 280 | } 281 | 282 | .menu__item.toggle { 283 | display: inline-block; 284 | } 285 | 286 | .menu { 287 | text-align: right; 288 | padding: 0.5rem 1rem; 289 | } 290 | 291 | .toggle { 292 | display: block; 293 | } 294 | 295 | .menu.responsive .menu__item:not(:first-child) { 296 | display: block; 297 | padding: 0 0 0.5rem 0; 298 | } 299 | } 300 | 301 | /* layout */ 302 | .wrapper { 303 | margin: 0 auto; 304 | width: 70%; 305 | } 306 | 307 | .footer { 308 | text-align: center; 309 | background-color: var(--primary-color); 310 | padding: 2rem; 311 | color: white; 312 | } 313 | 314 | @keyframes fadeUp { 315 | 0% { 316 | opacity: 0; 317 | transform: translate3d(0,30px,0); 318 | } 319 | 100% { 320 | transform: translate3d(0,0,0); 321 | } 322 | } -------------------------------------------------------------------------------- /docs/scribbler-landing.css: -------------------------------------------------------------------------------- 1 | /* nav specialized to landing page */ 2 | .logo { 3 | background: url('logo.svg') no-repeat; 4 | background-size: contain; 5 | margin: 1rem 0 0 1rem; 6 | } 7 | 8 | nav { 9 | background-color: var(--bg-color); 10 | } 11 | 12 | /* hero section */ 13 | .hero { 14 | text-align: center; 15 | background-color: var(--bg-color); 16 | padding: 2rem 0 10rem 0; 17 | } 18 | 19 | .hero__title { 20 | font-weight: 900; 21 | color: var(--primary-color); 22 | } 23 | 24 | .hero__description { 25 | margin: -1rem auto 2rem auto; 26 | } 27 | 28 | .hero__terminal { 29 | width: 60%; 30 | margin: -11rem auto 3rem auto; 31 | text-align: left; 32 | color: white; 33 | padding: 0 1rem; 34 | border-radius: 4px; 35 | background-color: #232323; 36 | min-height: 285px; 37 | animation: fadeUp 2s; 38 | box-shadow: 0px 12px 36.8px 9.2px rgba(0, 0, 0, 0.1); 39 | } 40 | 41 | .hero__terminal pre { 42 | white-space: pre-line; 43 | padding-top: 1rem; 44 | } 45 | 46 | /* feature section */ 47 | .feature { 48 | display: flex; 49 | flex-wrap: wrap; 50 | } 51 | 52 | .feature__item { 53 | max-width: calc(33% - 20px); 54 | margin: 0 20px 0 0; 55 | } 56 | 57 | .feature__item .section__title { 58 | margin-bottom: 0; 59 | } 60 | 61 | .feature__item p { 62 | margin-top: 0.5rem; 63 | } 64 | 65 | /* keybinding section */ 66 | .keybinding { 67 | margin-top: 3rem; 68 | display: flex; 69 | } 70 | 71 | .keybinding__detail { 72 | position: relative; 73 | border: 1px solid var(--code-bg-color); 74 | flex-basis: 50%; 75 | padding: 2rem 1rem 1rem 1rem; 76 | list-style: none; 77 | line-height: 2rem; 78 | } 79 | 80 | .keybinding__detail:first-child { 81 | text-align: right; 82 | padding-right: 1rem; 83 | } 84 | 85 | .keybinding__detail:last-child { 86 | padding-left: 1rem; 87 | margin-left: -1px; 88 | } 89 | 90 | .keybinding__detail:first-child .keybinding__title { 91 | position: absolute; 92 | right: 0.5rem; 93 | top: -2rem; 94 | background-color: white; 95 | padding: 0 0.5rem; 96 | } 97 | 98 | .keybinding__detail:last-child .keybinding__title { 99 | position: absolute; 100 | left: 0.5rem; 101 | top: -2rem; 102 | background-color: white; 103 | padding: 0 0.5rem; 104 | } 105 | 106 | .keybinding__label { 107 | background: var(--white-color); 108 | border: 1px solid var(--light-gray-color); 109 | box-shadow: 0 1px 0 0 var(--medium-gray-color); 110 | border-radius: 3px; 111 | font-family: Courier; 112 | font-size: 0.7rem; 113 | color: var(--dark-gray-color); 114 | padding: 3px 3px 1px 3px; 115 | vertical-align: middle; 116 | } 117 | 118 | /* callout section */ 119 | .callout { 120 | text-align: center; 121 | padding: 1rem 0 3rem 0; 122 | } 123 | 124 | .callout .button--primary { 125 | display: inline-block; 126 | margin-top: 0.5rem; 127 | } 128 | 129 | /* changelog section */ 130 | .changelog { 131 | background-color: var(--bg-color); 132 | padding: 2rem 0; 133 | } 134 | 135 | .changelog__item { 136 | display: flex; 137 | } 138 | 139 | .changelog__meta { 140 | flex-basis: 25%; 141 | } 142 | 143 | .changelog__meta small { 144 | color: var(--primary-color-light); 145 | font-weight: 200; 146 | letter-spacing: 1px; 147 | } 148 | 149 | .changelog__title { 150 | margin-bottom: 0; 151 | } 152 | 153 | .changelog__callout { 154 | margin: 3rem auto 2rem auto; 155 | text-align: center; 156 | } 157 | 158 | @media (max-width: 750px) { 159 | .hero__terminal { 160 | width: 70%; 161 | } 162 | .tab__container > ul { 163 | right: auto; 164 | left: 0; 165 | padding-left: 0; 166 | } 167 | .tab__container .code { 168 | margin-top: 2rem; 169 | } 170 | .feature, .keybinding, .changelog__item { 171 | flex-direction: column; 172 | } 173 | .feature__item { 174 | max-width: 100%; 175 | margin: 0; 176 | } 177 | .keybinding { 178 | font-size: 0.8rem; 179 | } 180 | } -------------------------------------------------------------------------------- /docs/scribbler.js: -------------------------------------------------------------------------------- 1 | // utilities 2 | var get = function (selector, scope) { 3 | scope = scope ? scope : document; 4 | return scope.querySelector(selector); 5 | }; 6 | 7 | var getAll = function (selector, scope) { 8 | scope = scope ? scope : document; 9 | return scope.querySelectorAll(selector); 10 | }; 11 | 12 | // setup typewriter effect in the terminal demo 13 | if (document.getElementsByClassName('demo').length > 0) { 14 | var i = 0; 15 | var txt = `scribbler 16 | [Entry mode; press Ctrl+D to save and quit; press Ctrl+C to quit without saving] 17 | 18 | ###todo for new year dinner party 19 | 20 | - milk 21 | - butter 22 | - green onion 23 | - lots and lots of kiwis 🥝`; 24 | var speed = 60; 25 | 26 | function typeItOut() { 27 | if (i < txt.length) { 28 | document.getElementsByClassName('demo')[0].innerHTML += txt.charAt(i); 29 | i++; 30 | setTimeout(typeItOut, speed); 31 | } 32 | } 33 | 34 | setTimeout(typeItOut, 1800); 35 | } 36 | 37 | // toggle tabs on codeblock 38 | window.addEventListener("load", function () { 39 | // get all tab_containers in the document 40 | var tabContainers = getAll(".tab__container"); 41 | 42 | // bind click event to each tab container 43 | for (var i = 0; i < tabContainers.length; i++) { 44 | get('.tab__menu', tabContainers[i]).addEventListener("click", tabClick); 45 | } 46 | 47 | // each click event is scoped to the tab_container 48 | function tabClick(event) { 49 | var scope = event.currentTarget.parentNode; 50 | var clickedTab = event.target; 51 | var tabs = getAll('.tab', scope); 52 | var panes = getAll('.tab__pane', scope); 53 | var activePane = get(`.${clickedTab.getAttribute('data-tab')}`, scope); 54 | 55 | // remove all active tab classes 56 | for (var i = 0; i < tabs.length; i++) { 57 | tabs[i].classList.remove('active'); 58 | } 59 | 60 | // remove all active pane classes 61 | for (var i = 0; i < panes.length; i++) { 62 | panes[i].classList.remove('active'); 63 | } 64 | 65 | // apply active classes on desired tab and pane 66 | clickedTab.classList.add('active'); 67 | activePane.classList.add('active'); 68 | } 69 | }); 70 | 71 | //in page scrolling for documentaiton page 72 | var btns = getAll('.js-btn'); 73 | var sections = getAll('.js-section'); 74 | 75 | function setActiveLink(event) { 76 | // remove all active tab classes 77 | for (var i = 0; i < btns.length; i++) { 78 | btns[i].classList.remove('selected'); 79 | } 80 | 81 | event.target.classList.add('selected'); 82 | } 83 | 84 | function smoothScrollTo(i, event) { 85 | var element = sections[i]; 86 | setActiveLink(event); 87 | 88 | window.scrollTo({ 89 | 'behavior': 'smooth', 90 | 'top': element.offsetTop - 20, 91 | 'left': 0 92 | }); 93 | } 94 | 95 | if (btns.length && sections.length > 0) { 96 | for (var i = 0; i < btns.length; i++) { 97 | btns[i].addEventListener('click', smoothScrollTo.bind(this, i)); 98 | } 99 | } 100 | 101 | // fix menu to page-top once user starts scrolling 102 | window.addEventListener('scroll', function () { 103 | var docNav = get('.doc__nav > ul'); 104 | 105 | if (docNav) { 106 | if (window.pageYOffset > 63) { 107 | docNav.classList.add('fixed'); 108 | } else { 109 | docNav.classList.remove('fixed'); 110 | } 111 | } 112 | }); 113 | 114 | // responsive navigation 115 | var topNav = get('.menu'); 116 | var icon = get('.toggle'); 117 | 118 | window.addEventListener('load', function () { 119 | function showNav() { 120 | if (topNav.className === 'menu') { 121 | topNav.className += ' responsive'; 122 | icon.className += ' open'; 123 | } else { 124 | topNav.className = 'menu'; 125 | icon.classList.remove('open'); 126 | } 127 | } 128 | icon.addEventListener('click', showNav); 129 | }); 130 | 131 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | my-dash-component 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /inst/deps/2c16ad7-main-wps-hmr.js: -------------------------------------------------------------------------------- 1 | webpackHotUpdatedash_trich_components("main",{ 2 | 3 | /***/ "./src/lib/components/GridLayoutComponent/GridLayoutComponent.react.js": 4 | /*!*****************************************************************************!*\ 5 | !*** ./src/lib/components/GridLayoutComponent/GridLayoutComponent.react.js ***! 6 | \*****************************************************************************/ 7 | /*! exports provided: default */ 8 | /***/ (function(module, __webpack_exports__, __webpack_require__) { 9 | 10 | "use strict"; 11 | __webpack_require__.r(__webpack_exports__); 12 | /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return GridLayoutComponent; }); 13 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); 14 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); 15 | /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); 16 | /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); 17 | !(function webpackMissingModule() { var e = new Error("Cannot find module '@/node_modules/react-grid-layout/css/styles.css'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); 18 | !(function webpackMissingModule() { var e = new Error("Cannot find module '@/node_modules/react-resizable/css/styles.css'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); 19 | /* harmony import */ var react_grid_layout__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-grid-layout */ "./node_modules/react-grid-layout/index.js"); 20 | /* harmony import */ var react_grid_layout__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_grid_layout__WEBPACK_IMPORTED_MODULE_3__); 21 | function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 22 | 23 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 24 | 25 | function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 26 | 27 | function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 28 | 29 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 30 | 31 | function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 32 | 33 | function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function () { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 34 | 35 | function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 36 | 37 | function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 38 | 39 | function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } 40 | 41 | function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 42 | 43 | 44 | 45 | 46 | 47 | 48 | /** 49 | * GridLayout is an GridLayout component. 50 | * It takes some setting properties 51 | * You put how many blocks of divs you want inside it, 52 | * and this div turn into slides 53 | */ 54 | 55 | var GridLayoutComponent = /*#__PURE__*/function (_Component) { 56 | _inherits(GridLayoutComponent, _Component); 57 | 58 | var _super = _createSuper(GridLayoutComponent); 59 | 60 | function GridLayoutComponent() { 61 | _classCallCheck(this, GridLayoutComponent); 62 | 63 | return _super.apply(this, arguments); 64 | } 65 | 66 | _createClass(GridLayoutComponent, [{ 67 | key: "render", 68 | value: function render() { 69 | var _this$props = this.props, 70 | style = _this$props.style, 71 | className = _this$props.className, 72 | children = _this$props.children; // layout is an array of objects, see the demo for more complete usage 73 | 74 | var layout = [{ 75 | i: 'a', 76 | x: 0, 77 | y: 0, 78 | w: 1, 79 | h: 2, 80 | "static": true 81 | }, { 82 | i: 'b', 83 | x: 1, 84 | y: 0, 85 | w: 3, 86 | h: 2, 87 | minW: 2, 88 | maxW: 4 89 | }, { 90 | i: 'c', 91 | x: 4, 92 | y: 0, 93 | w: 1, 94 | h: 2 95 | }]; 96 | return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_grid_layout__WEBPACK_IMPORTED_MODULE_3___default.a, { 97 | id: id, 98 | className: "".concat(className, " layout"), 99 | style: style, 100 | layout: layout, 101 | cols: 12, 102 | rowHeight: 30, 103 | width: 1200 104 | }, children); 105 | } 106 | }]); 107 | 108 | return GridLayoutComponent; 109 | }(react__WEBPACK_IMPORTED_MODULE_0__["Component"]); 110 | 111 | 112 | GridLayoutComponent.defaultProps = {}; 113 | GridLayoutComponent.propTypes = { 114 | /** 115 | * Your GridLayout is vertical 116 | */ 117 | children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node, 118 | 119 | /** 120 | * Inline style of the component. 121 | */ 122 | style: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object, 123 | 124 | /** 125 | * Style class of the component. 126 | */ 127 | className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, 128 | 129 | /** 130 | * Id of the element 131 | */ 132 | id: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string 133 | }; 134 | 135 | /***/ }) 136 | 137 | }) 138 | //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX3RyaWNoX2NvbXBvbmVudHMvLi9zcmMvbGliL2NvbXBvbmVudHMvR3JpZExheW91dENvbXBvbmVudC9HcmlkTGF5b3V0Q29tcG9uZW50LnJlYWN0LmpzIl0sIm5hbWVzIjpbIkdyaWRMYXlvdXRDb21wb25lbnQiLCJwcm9wcyIsInN0eWxlIiwiY2xhc3NOYW1lIiwiY2hpbGRyZW4iLCJsYXlvdXQiLCJpIiwieCIsInkiLCJ3IiwiaCIsIm1pblciLCJtYXhXIiwiaWQiLCJDb21wb25lbnQiLCJkZWZhdWx0UHJvcHMiLCJwcm9wVHlwZXMiLCJQcm9wVHlwZXMiLCJub2RlIiwib2JqZWN0Iiwic3RyaW5nIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7Ozs7Ozs7SUFPcUJBLG1COzs7Ozs7Ozs7Ozs7OzZCQUNSO0FBQUEsd0JBRWtDLEtBQUtDLEtBRnZDO0FBQUEsVUFFR0MsS0FGSCxlQUVHQSxLQUZIO0FBQUEsVUFFVUMsU0FGVixlQUVVQSxTQUZWO0FBQUEsVUFFcUJDLFFBRnJCLGVBRXFCQSxRQUZyQixFQUlMOztBQUNBLFVBQU1DLE1BQU0sR0FBRyxDQUNYO0FBQUVDLFNBQUMsRUFBRSxHQUFMO0FBQVVDLFNBQUMsRUFBRSxDQUFiO0FBQWdCQyxTQUFDLEVBQUUsQ0FBbkI7QUFBc0JDLFNBQUMsRUFBRSxDQUF6QjtBQUE0QkMsU0FBQyxFQUFFLENBQS9CO0FBQWtDLGtCQUFRO0FBQTFDLE9BRFcsRUFFWDtBQUFFSixTQUFDLEVBQUUsR0FBTDtBQUFVQyxTQUFDLEVBQUUsQ0FBYjtBQUFnQkMsU0FBQyxFQUFFLENBQW5CO0FBQXNCQyxTQUFDLEVBQUUsQ0FBekI7QUFBNEJDLFNBQUMsRUFBRSxDQUEvQjtBQUFrQ0MsWUFBSSxFQUFFLENBQXhDO0FBQTJDQyxZQUFJLEVBQUU7QUFBakQsT0FGVyxFQUdYO0FBQUVOLFNBQUMsRUFBRSxHQUFMO0FBQVVDLFNBQUMsRUFBRSxDQUFiO0FBQWdCQyxTQUFDLEVBQUUsQ0FBbkI7QUFBc0JDLFNBQUMsRUFBRSxDQUF6QjtBQUE0QkMsU0FBQyxFQUFFO0FBQS9CLE9BSFcsQ0FBZjtBQUtBLDBCQUNJLDJEQUFDLHdEQUFEO0FBQVksVUFBRSxFQUFFRyxFQUFoQjtBQUFvQixpQkFBUyxZQUFLVixTQUFMLFlBQTdCO0FBQXNELGFBQUssRUFBRUQsS0FBN0Q7QUFBb0UsY0FBTSxFQUFFRyxNQUE1RTtBQUFvRixZQUFJLEVBQUUsRUFBMUY7QUFBOEYsaUJBQVMsRUFBRSxFQUF6RztBQUE2RyxhQUFLLEVBQUU7QUFBcEgsU0FDS0QsUUFETCxDQURKO0FBS0g7Ozs7RUFoQjRDVSwrQzs7O0FBbUJqRGQsbUJBQW1CLENBQUNlLFlBQXBCLEdBQW1DLEVBQW5DO0FBR0FmLG1CQUFtQixDQUFDZ0IsU0FBcEIsR0FBZ0M7QUFDNUI7OztBQUdBWixVQUFRLEVBQUVhLGlEQUFTLENBQUNDLElBSlE7O0FBTTVCOzs7QUFHQWhCLE9BQUssRUFBRWUsaURBQVMsQ0FBQ0UsTUFUVzs7QUFXNUI7OztBQUdBaEIsV0FBUyxFQUFFYyxpREFBUyxDQUFDRyxNQWRPOztBQWdCNUI7OztBQUdBUCxJQUFFLEVBQUVJLGlEQUFTLENBQUNHO0FBbkJjLENBQWhDLEMiLCJmaWxlIjoiMmMxNmFkNy1tYWluLXdwcy1obXIuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QsIHsgQ29tcG9uZW50IH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IFByb3BUeXBlcyBmcm9tICdwcm9wLXR5cGVzJztcbmltcG9ydCAnQC9ub2RlX21vZHVsZXMvcmVhY3QtZ3JpZC1sYXlvdXQvY3NzL3N0eWxlcy5jc3MnXG5pbXBvcnQgJ0Avbm9kZV9tb2R1bGVzL3JlYWN0LXJlc2l6YWJsZS9jc3Mvc3R5bGVzLmNzcydcbmltcG9ydCBHcmlkTGF5b3V0IGZyb20gJ3JlYWN0LWdyaWQtbGF5b3V0JztcblxuLyoqXG4gKiBHcmlkTGF5b3V0IGlzIGFuIEdyaWRMYXlvdXQgY29tcG9uZW50LlxuICogSXQgdGFrZXMgc29tZSBzZXR0aW5nIHByb3BlcnRpZXNcbiAqIFlvdSBwdXQgaG93IG1hbnkgYmxvY2tzIG9mIGRpdnMgeW91IHdhbnQgaW5zaWRlIGl0LFxuICogYW5kIHRoaXMgZGl2IHR1cm4gaW50byBzbGlkZXNcbiAqL1xuXG5leHBvcnQgZGVmYXVsdCBjbGFzcyBHcmlkTGF5b3V0Q29tcG9uZW50IGV4dGVuZHMgQ29tcG9uZW50IHtcbiAgICByZW5kZXIoKSB7XG5cbiAgICAgICAgY29uc3QgeyBzdHlsZSwgY2xhc3NOYW1lLCBjaGlsZHJlbiB9ID0gdGhpcy5wcm9wcztcblxuICAgICAgICAvLyBsYXlvdXQgaXMgYW4gYXJyYXkgb2Ygb2JqZWN0cywgc2VlIHRoZSBkZW1vIGZvciBtb3JlIGNvbXBsZXRlIHVzYWdlXG4gICAgICAgIGNvbnN0IGxheW91dCA9IFtcbiAgICAgICAgICAgIHsgaTogJ2EnLCB4OiAwLCB5OiAwLCB3OiAxLCBoOiAyLCBzdGF0aWM6IHRydWUgfSxcbiAgICAgICAgICAgIHsgaTogJ2InLCB4OiAxLCB5OiAwLCB3OiAzLCBoOiAyLCBtaW5XOiAyLCBtYXhXOiA0IH0sXG4gICAgICAgICAgICB7IGk6ICdjJywgeDogNCwgeTogMCwgdzogMSwgaDogMiB9XG4gICAgICAgIF07XG4gICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICA8R3JpZExheW91dCBpZD17aWR9IGNsYXNzTmFtZT17YCR7Y2xhc3NOYW1lfSBsYXlvdXRgfSBzdHlsZT17c3R5bGV9IGxheW91dD17bGF5b3V0fSBjb2xzPXsxMn0gcm93SGVpZ2h0PXszMH0gd2lkdGg9ezEyMDB9PlxuICAgICAgICAgICAgICAgIHtjaGlsZHJlbn1cbiAgICAgICAgICAgIDwvR3JpZExheW91dD5cbiAgICAgICAgKVxuICAgIH1cbn1cblxuR3JpZExheW91dENvbXBvbmVudC5kZWZhdWx0UHJvcHMgPSB7XG59O1xuXG5HcmlkTGF5b3V0Q29tcG9uZW50LnByb3BUeXBlcyA9IHtcbiAgICAvKipcbiAgICAgKiBZb3VyIEdyaWRMYXlvdXQgaXMgdmVydGljYWxcbiAgICAgKi9cbiAgICBjaGlsZHJlbjogUHJvcFR5cGVzLm5vZGUsXG5cbiAgICAvKipcbiAgICAgKiBJbmxpbmUgc3R5bGUgb2YgdGhlIGNvbXBvbmVudC5cbiAgICAgKi9cbiAgICBzdHlsZTogUHJvcFR5cGVzLm9iamVjdCxcblxuICAgIC8qKlxuICAgICAqIFN0eWxlIGNsYXNzIG9mIHRoZSBjb21wb25lbnQuXG4gICAgICovXG4gICAgY2xhc3NOYW1lOiBQcm9wVHlwZXMuc3RyaW5nLFxuXG4gICAgLyoqXG4gICAgICogSWQgb2YgdGhlIGVsZW1lbnRcbiAgICAgKi9cbiAgICBpZDogUHJvcFR5cGVzLnN0cmluZyxcbn07XG4iXSwic291cmNlUm9vdCI6IiJ9 -------------------------------------------------------------------------------- /inst/deps/5070b51-main-wps-hmr.js: -------------------------------------------------------------------------------- 1 | webpackHotUpdatedash_trich_components("main",{ 2 | 3 | /***/ "./src/lib/components/GridLayoutComponent/GridLayoutComponent.react.js": 4 | /*!*****************************************************************************!*\ 5 | !*** ./src/lib/components/GridLayoutComponent/GridLayoutComponent.react.js ***! 6 | \*****************************************************************************/ 7 | /*! exports provided: default */ 8 | /***/ (function(module, __webpack_exports__, __webpack_require__) { 9 | 10 | "use strict"; 11 | __webpack_require__.r(__webpack_exports__); 12 | /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return GridLayoutComponent; }); 13 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); 14 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); 15 | /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "./node_modules/prop-types/index.js"); 16 | /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__); 17 | /* harmony import */ var react_grid_layout_css_styles_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-grid-layout/css/styles.css */ "./node_modules/react-grid-layout/css/styles.css"); 18 | /* harmony import */ var react_grid_layout_css_styles_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_grid_layout_css_styles_css__WEBPACK_IMPORTED_MODULE_2__); 19 | /* harmony import */ var react_resizable_css_styles_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-resizable/css/styles.css */ "./node_modules/react-resizable/css/styles.css"); 20 | /* harmony import */ var react_resizable_css_styles_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_resizable_css_styles_css__WEBPACK_IMPORTED_MODULE_3__); 21 | /* harmony import */ var react_grid_layout__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-grid-layout */ "./node_modules/react-grid-layout/index.js"); 22 | /* harmony import */ var react_grid_layout__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_grid_layout__WEBPACK_IMPORTED_MODULE_4__); 23 | function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 24 | 25 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 26 | 27 | function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 28 | 29 | function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 30 | 31 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 32 | 33 | function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 34 | 35 | function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function () { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 36 | 37 | function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 38 | 39 | function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 40 | 41 | function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } 42 | 43 | function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 44 | 45 | 46 | 47 | 48 | 49 | 50 | /** 51 | * GridLayout is an GridLayout component. 52 | * It takes some setting properties 53 | * You put how many blocks of divs you want inside it, 54 | * and this div turn into slides 55 | */ 56 | 57 | var GridLayoutComponent = /*#__PURE__*/function (_Component) { 58 | _inherits(GridLayoutComponent, _Component); 59 | 60 | var _super = _createSuper(GridLayoutComponent); 61 | 62 | function GridLayoutComponent() { 63 | _classCallCheck(this, GridLayoutComponent); 64 | 65 | return _super.apply(this, arguments); 66 | } 67 | 68 | _createClass(GridLayoutComponent, [{ 69 | key: "render", 70 | value: function render() { 71 | var _this$props = this.props, 72 | style = _this$props.style, 73 | className = _this$props.className, 74 | children = _this$props.children, 75 | id = _this$props.id, 76 | layout = _this$props.layout; 77 | return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_grid_layout__WEBPACK_IMPORTED_MODULE_4___default.a, { 78 | id: id, 79 | className: "".concat(className, " layout"), 80 | style: style, 81 | layout: layout, 82 | cols: 12, 83 | rowHeight: 30, 84 | width: 1200 85 | }, children); 86 | } 87 | }]); 88 | 89 | return GridLayoutComponent; 90 | }(react__WEBPACK_IMPORTED_MODULE_0__["Component"]); 91 | 92 | 93 | GridLayoutComponent.defaultProps = {}; 94 | GridLayoutComponent.propTypes = { 95 | /** 96 | * Your GridLayout is vertical 97 | */ 98 | children: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.node, 99 | 100 | /** 101 | * Inline style of the component. 102 | */ 103 | style: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.object, 104 | 105 | /** 106 | * Style class of the component. 107 | */ 108 | className: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, 109 | 110 | /** 111 | * Id of the element 112 | */ 113 | id: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.string, 114 | 115 | /** 116 | * Initial layout 117 | */ 118 | layout: prop_types__WEBPACK_IMPORTED_MODULE_1___default.a.array 119 | }; 120 | 121 | /***/ }) 122 | 123 | }) 124 | //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX3RyaWNoX2NvbXBvbmVudHMvLi9zcmMvbGliL2NvbXBvbmVudHMvR3JpZExheW91dENvbXBvbmVudC9HcmlkTGF5b3V0Q29tcG9uZW50LnJlYWN0LmpzIl0sIm5hbWVzIjpbIkdyaWRMYXlvdXRDb21wb25lbnQiLCJwcm9wcyIsInN0eWxlIiwiY2xhc3NOYW1lIiwiY2hpbGRyZW4iLCJpZCIsImxheW91dCIsIkNvbXBvbmVudCIsImRlZmF1bHRQcm9wcyIsInByb3BUeXBlcyIsIlByb3BUeXBlcyIsIm5vZGUiLCJvYmplY3QiLCJzdHJpbmciLCJhcnJheSJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7Ozs7Ozs7SUFPcUJBLG1COzs7Ozs7Ozs7Ozs7OzZCQUNSO0FBQUEsd0JBRThDLEtBQUtDLEtBRm5EO0FBQUEsVUFFR0MsS0FGSCxlQUVHQSxLQUZIO0FBQUEsVUFFVUMsU0FGVixlQUVVQSxTQUZWO0FBQUEsVUFFcUJDLFFBRnJCLGVBRXFCQSxRQUZyQjtBQUFBLFVBRStCQyxFQUYvQixlQUUrQkEsRUFGL0I7QUFBQSxVQUVtQ0MsTUFGbkMsZUFFbUNBLE1BRm5DO0FBSUwsMEJBQ0ksMkRBQUMsd0RBQUQ7QUFBWSxVQUFFLEVBQUVELEVBQWhCO0FBQW9CLGlCQUFTLFlBQUtGLFNBQUwsWUFBN0I7QUFBc0QsYUFBSyxFQUFFRCxLQUE3RDtBQUFvRSxjQUFNLEVBQUVJLE1BQTVFO0FBQW9GLFlBQUksRUFBRSxFQUExRjtBQUE4RixpQkFBUyxFQUFFLEVBQXpHO0FBQTZHLGFBQUssRUFBRTtBQUFwSCxTQUNLRixRQURMLENBREo7QUFLSDs7OztFQVY0Q0csK0M7OztBQWFqRFAsbUJBQW1CLENBQUNRLFlBQXBCLEdBQW1DLEVBQW5DO0FBR0FSLG1CQUFtQixDQUFDUyxTQUFwQixHQUFnQztBQUM1Qjs7O0FBR0FMLFVBQVEsRUFBRU0saURBQVMsQ0FBQ0MsSUFKUTs7QUFNNUI7OztBQUdBVCxPQUFLLEVBQUVRLGlEQUFTLENBQUNFLE1BVFc7O0FBVzVCOzs7QUFHQVQsV0FBUyxFQUFFTyxpREFBUyxDQUFDRyxNQWRPOztBQWdCNUI7OztBQUdBUixJQUFFLEVBQUVLLGlEQUFTLENBQUNHLE1BbkJjOztBQXFCNUI7OztBQUdBUCxRQUFNLEVBQUVJLGlEQUFTLENBQUNJO0FBeEJVLENBQWhDLEMiLCJmaWxlIjoiNTA3MGI1MS1tYWluLXdwcy1obXIuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QsIHsgQ29tcG9uZW50IH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IFByb3BUeXBlcyBmcm9tICdwcm9wLXR5cGVzJztcbmltcG9ydCAncmVhY3QtZ3JpZC1sYXlvdXQvY3NzL3N0eWxlcy5jc3MnXG5pbXBvcnQgJ3JlYWN0LXJlc2l6YWJsZS9jc3Mvc3R5bGVzLmNzcydcbmltcG9ydCBHcmlkTGF5b3V0IGZyb20gJ3JlYWN0LWdyaWQtbGF5b3V0JztcblxuLyoqXG4gKiBHcmlkTGF5b3V0IGlzIGFuIEdyaWRMYXlvdXQgY29tcG9uZW50LlxuICogSXQgdGFrZXMgc29tZSBzZXR0aW5nIHByb3BlcnRpZXNcbiAqIFlvdSBwdXQgaG93IG1hbnkgYmxvY2tzIG9mIGRpdnMgeW91IHdhbnQgaW5zaWRlIGl0LFxuICogYW5kIHRoaXMgZGl2IHR1cm4gaW50byBzbGlkZXNcbiAqL1xuXG5leHBvcnQgZGVmYXVsdCBjbGFzcyBHcmlkTGF5b3V0Q29tcG9uZW50IGV4dGVuZHMgQ29tcG9uZW50IHtcbiAgICByZW5kZXIoKSB7XG5cbiAgICAgICAgY29uc3QgeyBzdHlsZSwgY2xhc3NOYW1lLCBjaGlsZHJlbiwgaWQsIGxheW91dCB9ID0gdGhpcy5wcm9wcztcblxuICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgPEdyaWRMYXlvdXQgaWQ9e2lkfSBjbGFzc05hbWU9e2Ake2NsYXNzTmFtZX0gbGF5b3V0YH0gc3R5bGU9e3N0eWxlfSBsYXlvdXQ9e2xheW91dH0gY29scz17MTJ9IHJvd0hlaWdodD17MzB9IHdpZHRoPXsxMjAwfT5cbiAgICAgICAgICAgICAgICB7Y2hpbGRyZW59XG4gICAgICAgICAgICA8L0dyaWRMYXlvdXQ+XG4gICAgICAgIClcbiAgICB9XG59XG5cbkdyaWRMYXlvdXRDb21wb25lbnQuZGVmYXVsdFByb3BzID0ge1xufTtcblxuR3JpZExheW91dENvbXBvbmVudC5wcm9wVHlwZXMgPSB7XG4gICAgLyoqXG4gICAgICogWW91ciBHcmlkTGF5b3V0IGlzIHZlcnRpY2FsXG4gICAgICovXG4gICAgY2hpbGRyZW46IFByb3BUeXBlcy5ub2RlLFxuXG4gICAgLyoqXG4gICAgICogSW5saW5lIHN0eWxlIG9mIHRoZSBjb21wb25lbnQuXG4gICAgICovXG4gICAgc3R5bGU6IFByb3BUeXBlcy5vYmplY3QsXG5cbiAgICAvKipcbiAgICAgKiBTdHlsZSBjbGFzcyBvZiB0aGUgY29tcG9uZW50LlxuICAgICAqL1xuICAgIGNsYXNzTmFtZTogUHJvcFR5cGVzLnN0cmluZyxcblxuICAgIC8qKlxuICAgICAqIElkIG9mIHRoZSBlbGVtZW50XG4gICAgICovXG4gICAgaWQ6IFByb3BUeXBlcy5zdHJpbmcsXG5cbiAgICAvKipcbiAgICAgKiBJbml0aWFsIGxheW91dFxuICAgICAqL1xuICAgIGxheW91dDogUHJvcFR5cGVzLmFycmF5LFxufTtcbiJdLCJzb3VyY2VSb290IjoiIn0= -------------------------------------------------------------------------------- /inst/deps/fec5c6e-main-wps-hmr.js: -------------------------------------------------------------------------------- 1 | webpackHotUpdatedash_trich_components("main",{ 2 | 3 | /***/ "./src/demo/App.js": 4 | /*!*************************!*\ 5 | !*** ./src/demo/App.js ***! 6 | \*************************/ 7 | /*! exports provided: default */ 8 | /***/ (function(module, __webpack_exports__, __webpack_require__) { 9 | 10 | "use strict"; 11 | __webpack_require__.r(__webpack_exports__); 12 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js"); 13 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); 14 | /* harmony import */ var _lib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../lib */ "./src/lib/index.js"); 15 | /* harmony import */ var _lib_components_GridLayoutComponent_GridLayoutComponent_react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../lib/components/GridLayoutComponent/GridLayoutComponent.react */ "./src/lib/components/GridLayoutComponent/GridLayoutComponent.react.js"); 16 | function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 17 | 18 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 19 | 20 | function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 21 | 22 | function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 23 | 24 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 25 | 26 | function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 27 | 28 | function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function () { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } 29 | 30 | function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 31 | 32 | function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 33 | 34 | function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } 35 | 36 | function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 37 | 38 | /* eslint no-magic-numbers: 0 */ 39 | 40 | 41 | 42 | 43 | var App = /*#__PURE__*/function (_Component) { 44 | _inherits(App, _Component); 45 | 46 | var _super = _createSuper(App); 47 | 48 | function App() { 49 | var _this; 50 | 51 | _classCallCheck(this, App); 52 | 53 | _this = _super.call(this); 54 | _this.state = { 55 | value: '' 56 | }; 57 | _this.setProps = _this.setProps.bind(_assertThisInitialized(_this)); 58 | return _this; 59 | } 60 | 61 | _createClass(App, [{ 62 | key: "setProps", 63 | value: function setProps(newProps) { 64 | this.setState(newProps); 65 | } 66 | }, { 67 | key: "render", 68 | value: function render() { 69 | return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_lib_components_GridLayoutComponent_GridLayoutComponent_react__WEBPACK_IMPORTED_MODULE_2__["default"], null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", null, "teste"))); 70 | } 71 | }]); 72 | 73 | return App; 74 | }(react__WEBPACK_IMPORTED_MODULE_0__["Component"]); 75 | 76 | /* harmony default export */ __webpack_exports__["default"] = (App); 77 | 78 | /***/ }) 79 | 80 | }) 81 | //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX3RyaWNoX2NvbXBvbmVudHMvLi9zcmMvZGVtby9BcHAuanMiXSwibmFtZXMiOlsiQXBwIiwic3RhdGUiLCJ2YWx1ZSIsInNldFByb3BzIiwiYmluZCIsIm5ld1Byb3BzIiwic2V0U3RhdGUiLCJDb21wb25lbnQiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQTtBQUNBO0FBRUE7QUFDQTs7SUFFTUEsRzs7Ozs7QUFFRixpQkFBYztBQUFBOztBQUFBOztBQUNWO0FBQ0EsVUFBS0MsS0FBTCxHQUFhO0FBQ1RDLFdBQUssRUFBRTtBQURFLEtBQWI7QUFHQSxVQUFLQyxRQUFMLEdBQWdCLE1BQUtBLFFBQUwsQ0FBY0MsSUFBZCwrQkFBaEI7QUFMVTtBQU1iOzs7OzZCQUVRQyxRLEVBQVU7QUFDZixXQUFLQyxRQUFMLENBQWNELFFBQWQ7QUFDSDs7OzZCQUVRO0FBQ0wsMEJBQ0kscUZBQ0ksMkRBQUMscUdBQUQscUJBQ0EsZ0ZBREEsQ0FESixDQURKO0FBT0g7Ozs7RUF0QmFFLCtDOztBQXlCSFAsa0VBQWYsRSIsImZpbGUiOiJmZWM1YzZlLW1haW4td3BzLWhtci5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludCBuby1tYWdpYy1udW1iZXJzOiAwICovXG5pbXBvcnQgUmVhY3QsIHtDb21wb25lbnR9IGZyb20gJ3JlYWN0JztcblxuaW1wb3J0IHsgQ2Fyb3VzZWwgfSBmcm9tICcuLi9saWInO1xuaW1wb3J0IEdyaWRMYXlvdXRDb21wb25lbnQgZnJvbSAnLi4vbGliL2NvbXBvbmVudHMvR3JpZExheW91dENvbXBvbmVudC9HcmlkTGF5b3V0Q29tcG9uZW50LnJlYWN0JztcblxuY2xhc3MgQXBwIGV4dGVuZHMgQ29tcG9uZW50IHtcblxuICAgIGNvbnN0cnVjdG9yKCkge1xuICAgICAgICBzdXBlcigpO1xuICAgICAgICB0aGlzLnN0YXRlID0ge1xuICAgICAgICAgICAgdmFsdWU6ICcnXG4gICAgICAgIH07XG4gICAgICAgIHRoaXMuc2V0UHJvcHMgPSB0aGlzLnNldFByb3BzLmJpbmQodGhpcyk7XG4gICAgfVxuXG4gICAgc2V0UHJvcHMobmV3UHJvcHMpIHtcbiAgICAgICAgdGhpcy5zZXRTdGF0ZShuZXdQcm9wcyk7XG4gICAgfVxuXG4gICAgcmVuZGVyKCkge1xuICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgPGRpdj5cbiAgICAgICAgICAgICAgICA8R3JpZExheW91dENvbXBvbmVudD5cbiAgICAgICAgICAgICAgICA8ZGl2PnRlc3RlPC9kaXY+XG4gICAgICAgICAgICAgICAgPC9HcmlkTGF5b3V0Q29tcG9uZW50PlxuICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgIClcbiAgICB9XG59XG5cbmV4cG9ydCBkZWZhdWx0IEFwcDtcbiJdLCJzb3VyY2VSb290IjoiIn0= -------------------------------------------------------------------------------- /inst/deps/fonts/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/inst/deps/fonts/ajax-loader.gif -------------------------------------------------------------------------------- /inst/deps/fonts/fa-brands-400.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/inst/deps/fonts/fa-brands-400.eot -------------------------------------------------------------------------------- /inst/deps/fonts/fa-brands-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/inst/deps/fonts/fa-brands-400.ttf -------------------------------------------------------------------------------- /inst/deps/fonts/fa-brands-400.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/inst/deps/fonts/fa-brands-400.woff -------------------------------------------------------------------------------- /inst/deps/fonts/fa-brands-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/inst/deps/fonts/fa-brands-400.woff2 -------------------------------------------------------------------------------- /inst/deps/fonts/fa-regular-400.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/inst/deps/fonts/fa-regular-400.eot -------------------------------------------------------------------------------- /inst/deps/fonts/fa-regular-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/inst/deps/fonts/fa-regular-400.ttf -------------------------------------------------------------------------------- /inst/deps/fonts/fa-regular-400.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/inst/deps/fonts/fa-regular-400.woff -------------------------------------------------------------------------------- /inst/deps/fonts/fa-regular-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/inst/deps/fonts/fa-regular-400.woff2 -------------------------------------------------------------------------------- /inst/deps/fonts/fa-solid-900.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/inst/deps/fonts/fa-solid-900.eot -------------------------------------------------------------------------------- /inst/deps/fonts/fa-solid-900.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/inst/deps/fonts/fa-solid-900.ttf -------------------------------------------------------------------------------- /inst/deps/fonts/fa-solid-900.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/inst/deps/fonts/fa-solid-900.woff -------------------------------------------------------------------------------- /inst/deps/fonts/fa-solid-900.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/inst/deps/fonts/fa-solid-900.woff2 -------------------------------------------------------------------------------- /inst/deps/fonts/slick.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/inst/deps/fonts/slick.eot -------------------------------------------------------------------------------- /inst/deps/fonts/slick.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Generated by Fontastic.me 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /inst/deps/fonts/slick.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/inst/deps/fonts/slick.ttf -------------------------------------------------------------------------------- /inst/deps/fonts/slick.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/inst/deps/fonts/slick.woff -------------------------------------------------------------------------------- /man/card.Rd: -------------------------------------------------------------------------------- 1 | % Auto-generated: do not edit by hand 2 | \name{card} 3 | 4 | \alias{card} 5 | 6 | \title{Card component} 7 | 8 | \description{ 9 | A simple card with an image, title, description, badges and link for github with icon, all this arguments are optional. 10 | } 11 | 12 | \usage{ 13 | card(id=NULL, className=NULL, style=NULL, link=NULL, image=NULL, 14 | title=NULL, description=NULL, badges=NULL, git=NULL, 15 | dark=NULL, openNewTab=NULL) 16 | } 17 | 18 | \arguments{ 19 | \item{id}{Character. Id of the element} 20 | 21 | \item{className}{Character. Style class of the component.} 22 | 23 | \item{style}{Named list. Inline style of the component.} 24 | 25 | \item{link}{Character. link to redirect when the user clicks on the image} 26 | 27 | \item{image}{Character. image that will display on card} 28 | 29 | \item{title}{Character. title of the card} 30 | 31 | \item{description}{Character. description of the card} 32 | 33 | \item{badges}{Unnamed list. list of strings to display in badges, to work porperly put up to 4 or 5} 34 | 35 | \item{git}{Character. github URL, is not required, only if you want to} 36 | 37 | \item{dark}{Logical. theme color of the card, that for default is light} 38 | 39 | \item{openNewTab}{Logical. Open card link in a new tab} 40 | } 41 | 42 | \value{named list of JSON elements corresponding to React.js properties and their values} 43 | 44 | -------------------------------------------------------------------------------- /man/carousel.Rd: -------------------------------------------------------------------------------- 1 | % Auto-generated: do not edit by hand 2 | \name{carousel} 3 | 4 | \alias{carousel} 5 | 6 | \title{Carousel component} 7 | 8 | \description{ 9 | Carousel is an carousel component. It takes some setting properties You put how many blocks of divs you want inside it, and this div turn into slides 10 | } 11 | 12 | \usage{ 13 | carousel(children=NULL, dots=NULL, arrows=NULL, infinite=NULL, 14 | autoplay=NULL, speed=NULL, slides_to_show=NULL, 15 | slides_to_scroll=NULL, center_mode=NULL, 16 | center_padding=NULL, swipe_to_slide=NULL, 17 | variable_width=NULL, responsive=NULL, vertical=NULL, 18 | style=NULL, className=NULL, id=NULL) 19 | } 20 | 21 | \arguments{ 22 | \item{children}{A list of or a singular dash component, string or number. Your carousel is vertical} 23 | 24 | \item{dots}{Logical. Dots under carousel} 25 | 26 | \item{arrows}{Logical. Arrows to control carousel} 27 | 28 | \item{infinite}{Logical. If the carousel content will repeat in a loop} 29 | 30 | \item{autoplay}{Logical. If the carousel will start to play automatically} 31 | 32 | \item{speed}{Numeric. Speed of autoplay} 33 | 34 | \item{slides_to_show}{Numeric. How many slides you want to show} 35 | 36 | \item{slides_to_scroll}{Numeric. How many slides will scroll when you swipe the carousel} 37 | 38 | \item{center_mode}{Logical. To centralize the carousel} 39 | 40 | \item{center_padding}{Character. Padding on the sides} 41 | 42 | \item{swipe_to_slide}{Logical. If you can slide to scroll the slides} 43 | 44 | \item{variable_width}{Logical. The slides width varies according to the screen size} 45 | 46 | \item{responsive}{Unnamed list. Settings of breakpoints} 47 | 48 | \item{vertical}{Logical. If your carousel is vertical} 49 | 50 | \item{style}{Named list. Inline style of the component.} 51 | 52 | \item{className}{Character. Style class of the component.} 53 | 54 | \item{id}{Character. Id of the element} 55 | } 56 | 57 | \value{named list of JSON elements corresponding to React.js properties and their values} 58 | 59 | -------------------------------------------------------------------------------- /man/gridItem.Rd: -------------------------------------------------------------------------------- 1 | % Auto-generated: do not edit by hand 2 | \name{gridItem} 3 | 4 | \alias{gridItem} 5 | 6 | \title{GridItem component} 7 | 8 | \description{ 9 | A class for displaying an item in a grid Designed to be wrapped in a function, similar to a higher-order component. Otherwise the layout will render incorrectly 10 | } 11 | 12 | \usage{ 13 | gridItem(children=NULL, i=NULL, layout=NULL) 14 | } 15 | 16 | \arguments{ 17 | \item{children}{A list of or a singular dash component, string or number. A list of child elements to place inside the grid ite,} 18 | 19 | \item{i}{Character. An identifier for the component. 20 | Synonymous with `key`, but `key` cannot be specified as 21 | a PropType without causing errors. A caveat to this is that when using 22 | the component in pure React (as opposed to via Dash), both `i` and `key` 23 | must be specified} 24 | 25 | \item{layout}{Lists containing elements 'x', 'y', 'w', 'h', 'minw', 'maxw', 'minh', 'maxh', 'static', 'isdraggable', 'isresizable'. 26 | those elements have the following types: 27 | - x (numeric; required): the x-value of the element location, in grid units 28 | - y (numeric; required): the y-value of the element location, in grid units 29 | - w (numeric; required): the width of the element, in grid units 30 | - h (numeric; required): the height of the element, in grid units 31 | - minw (numeric; optional): the minimum width of the element, in grid units 32 | - maxw (numeric; optional): the maximum width of the element, in grid units 33 | - minh (numeric; optional): the minimum height of the element, in grid units 34 | - maxh (numeric; optional): the maximum height of the element, in grid units 35 | - static (logical; optional): is static: if true, the element is not resizable or draggable 36 | - isdraggable (logical; optional): if false, element can not be dragged 37 | - isresizable (logical; optional): if false, the element can not be resized. An object describing the layout of the element} 38 | } 39 | 40 | \value{named list of JSON elements corresponding to React.js properties and their values} 41 | 42 | -------------------------------------------------------------------------------- /man/gridLayoutComponent.Rd: -------------------------------------------------------------------------------- 1 | % Auto-generated: do not edit by hand 2 | \name{gridLayoutComponent} 3 | 4 | \alias{gridLayoutComponent} 5 | 6 | \title{GridLayoutComponent component} 7 | 8 | \description{ 9 | GridLayout is an GridLayout component. It takes some setting properties You put how many blocks of divs you want inside it, and this div turn into slides 10 | } 11 | 12 | \usage{ 13 | gridLayoutComponent(children=NULL, style=NULL, className=NULL, id=NULL, 14 | layout=NULL) 15 | } 16 | 17 | \arguments{ 18 | \item{children}{A list of or a singular dash component, string or number. Your GridLayout is vertical} 19 | 20 | \item{style}{Named list. Inline style of the component.} 21 | 22 | \item{className}{Character. Style class of the component.} 23 | 24 | \item{id}{Character. Id of the element} 25 | 26 | \item{layout}{Unnamed list. Initial layout} 27 | } 28 | 29 | \value{named list of JSON elements corresponding to React.js properties and their values} 30 | 31 | -------------------------------------------------------------------------------- /man/responsiveGrid.Rd: -------------------------------------------------------------------------------- 1 | % Auto-generated: do not edit by hand 2 | \name{responsiveGrid} 3 | 4 | \alias{responsiveGrid} 5 | 6 | \title{ResponsiveGrid component} 7 | 8 | \description{ 9 | This component is an update of an another component build by Alexander Cabello The Link to the original component is: https://github.com/AlgorithmHub/dash-responsive-grid-layout It allows the user to drag, resize and modify the components inside of it. To be able to run it, you need to add a layout(one definition to each breakpoint) and a div with the ID (key) that will be mapped as the box inside of the Draggable Component. 10 | } 11 | 12 | \usage{ 13 | responsiveGrid(children=NULL, id=NULL, breakpoint=NULL, breakpoints=NULL, 14 | cols=NULL, layouts=NULL, width=NULL, 15 | onBreakpointChange=NULL, onLayoutChange=NULL, 16 | onWidthChange=NULL, rowHeight=NULL, maxRows=NULL, 17 | autoSize=NULL, draggableCancel=NULL, draggableHandle=NULL, 18 | verticalCompact=NULL, compactType=NULL, margin=NULL, 19 | containerPadding=NULL, isDraggable=NULL, isResizable=NULL, 20 | useCSSTransforms=NULL, preventCollision=NULL, 21 | onDragStart=NULL, onDrag=NULL, onDragStop=NULL, 22 | onResizeStart=NULL, onResize=NULL, onResizeStop=NULL, 23 | className=NULL) 24 | } 25 | 26 | \arguments{ 27 | \item{children}{A list of or a singular dash component, string or number. A list of renderable child elements, that will be placed inside the grid} 28 | 29 | \item{id}{Character. The ID used to identify the component in Dash callbacks} 30 | 31 | \item{breakpoint}{Character. } 32 | 33 | \item{breakpoints}{Named list. } 34 | 35 | \item{cols}{Named list. } 36 | 37 | \item{layouts}{Named list. } 38 | 39 | \item{width}{Numeric. } 40 | 41 | \item{onBreakpointChange}{} 42 | 43 | \item{onLayoutChange}{} 44 | 45 | \item{onWidthChange}{} 46 | 47 | \item{rowHeight}{Numeric. The height, in pixels of a row in the grid} 48 | 49 | \item{maxRows}{Numeric. Total Rows that can the board have based on the cumulated sum of all rows} 50 | 51 | \item{autoSize}{Logical. If true, containers will automatically resize to fit the content} 52 | 53 | \item{draggableCancel}{Character. CSS selector for tags that will not be draggable. Requires a leading '.'} 54 | 55 | \item{draggableHandle}{Character. CSS selector for tags that will act as the draggable handle. Requires a leading '.'} 56 | 57 | \item{verticalCompact}{Logical. If true, the layout will compact vertically} 58 | 59 | \item{compactType}{A value equal to: 'vertical', 'horizontal'. Compaction type. 60 | One of 'vertical' and 'horizontal'} 61 | 62 | \item{margin}{List of numerics. Margin between items [x, y] in px} 63 | 64 | \item{containerPadding}{List of numerics. Padding inside the container [x, y] in px} 65 | 66 | \item{isDraggable}{Logical. Elements can be dragged} 67 | 68 | \item{isResizable}{Logical. Elements can be resized} 69 | 70 | \item{useCSSTransforms}{Logical. Use CSS transforms instead of Position. Improves performance if switched on} 71 | 72 | \item{preventCollision}{Logical. If true, grid items won't change position when being 73 | dragged over} 74 | 75 | \item{onDragStart}{Callback when dragging is started} 76 | 77 | \item{onDrag}{Callback upon each drag movement} 78 | 79 | \item{onDragStop}{Callback upon drag completion} 80 | 81 | \item{onResizeStart}{Calls when resize starts} 82 | 83 | \item{onResize}{Calls when resize movement happens} 84 | 85 | \item{onResizeStop}{Calls when resize is complete} 86 | 87 | \item{className}{Character. Set the ClassName to the component} 88 | } 89 | 90 | \value{named list of JSON elements corresponding to React.js properties and their values} 91 | 92 | -------------------------------------------------------------------------------- /man/sideBar.Rd: -------------------------------------------------------------------------------- 1 | % Auto-generated: do not edit by hand 2 | \name{sideBar} 3 | 4 | \alias{sideBar} 5 | 6 | \title{SideBar component} 7 | 8 | \description{ 9 | A collapsible side bar for your dashboard, with icons from Font Awesome 10 | } 11 | 12 | \usage{ 13 | sideBar(children=NULL, id=NULL, className=NULL, bg_color=NULL, 14 | text_color=NULL) 15 | } 16 | 17 | \arguments{ 18 | \item{children}{A list of or a singular dash component, string or number. Your carousel is vertical} 19 | 20 | \item{id}{Character. Id of the element} 21 | 22 | \item{className}{Character. Style class of the component.} 23 | 24 | \item{bg_color}{Character. Color of sidebar background} 25 | 26 | \item{text_color}{Character. Color of sidebar text} 27 | } 28 | 29 | \value{named list of JSON elements corresponding to React.js properties and their values} 30 | 31 | -------------------------------------------------------------------------------- /man/sideBarItem.Rd: -------------------------------------------------------------------------------- 1 | % Auto-generated: do not edit by hand 2 | \name{sideBarItem} 3 | 4 | \alias{sideBarItem} 5 | 6 | \title{SideBarItem component} 7 | 8 | \description{ 9 | Side bar items, to be used inside of sidebar component 10 | } 11 | 12 | \usage{ 13 | sideBarItem(id=NULL, className=NULL, label=NULL, icon=NULL, 14 | disabled=NULL, n_clicks=NULL, n_clicks_timestamp=NULL) 15 | } 16 | 17 | \arguments{ 18 | \item{id}{Character. Id of the element} 19 | 20 | \item{className}{Character. Style class of the component.} 21 | 22 | \item{label}{Character. Text of menu item on sidebar} 23 | 24 | \item{icon}{Character. Icon of menu item on sidebar, pass the icon class from font awesome} 25 | 26 | \item{disabled}{Logical. Disable the link. Default: False.} 27 | 28 | \item{n_clicks}{Numeric. An integer that represents the number of times 29 | that this element has been clicked on.} 30 | 31 | \item{n_clicks_timestamp}{Numeric. An integer that represents the time (in ms since 1970) 32 | at which n_clicks changed. This can be used to tell 33 | which button was changed most recently.} 34 | } 35 | 36 | \value{named list of JSON elements corresponding to React.js properties and their values} 37 | 38 | -------------------------------------------------------------------------------- /man/sideBarToggle.Rd: -------------------------------------------------------------------------------- 1 | % Auto-generated: do not edit by hand 2 | \name{sideBarToggle} 3 | 4 | \alias{sideBarToggle} 5 | 6 | \title{SideBarToggle component} 7 | 8 | \description{ 9 | 10 | } 11 | 12 | \usage{ 13 | sideBarToggle(n_clicks=NULL, id=NULL) 14 | } 15 | 16 | \arguments{ 17 | \item{n_clicks}{Numeric. How many slides you want to show} 18 | 19 | \item{id}{Character. Padding on the sides} 20 | } 21 | 22 | \value{named list of JSON elements corresponding to React.js properties and their values} 23 | 24 | -------------------------------------------------------------------------------- /man/themeToggle.Rd: -------------------------------------------------------------------------------- 1 | % Auto-generated: do not edit by hand 2 | \name{themeToggle} 3 | 4 | \alias{themeToggle} 5 | 6 | \title{ThemeToggle component} 7 | 8 | \description{ 9 | Dark/Light theme toggle switch for your Dash project. 10 | } 11 | 12 | \usage{ 13 | themeToggle(bg_color_dark=NULL, icon_color_dark=NULL, 14 | bg_color_light=NULL, icon_color_light=NULL, 15 | tooltip_text=NULL, style=NULL, className=NULL, id=NULL) 16 | } 17 | 18 | \arguments{ 19 | \item{bg_color_dark}{Character. Background color of toggle switch when dark theme} 20 | 21 | \item{icon_color_dark}{Character. Sun icon color of toggle switch when dark theme} 22 | 23 | \item{bg_color_light}{Character. Background color of toggle switch when light theme} 24 | 25 | \item{icon_color_light}{Character. Moon icon color of toggle switch when dark theme} 26 | 27 | \item{tooltip_text}{Character. Text that will appear in tooltip (only desktop)} 28 | 29 | \item{style}{Named list. Inline style of the component.} 30 | 31 | \item{className}{Character. Style class of the component.} 32 | 33 | \item{id}{Character. Id of the element} 34 | } 35 | 36 | \value{named list of JSON elements corresponding to React.js properties and their values} 37 | 38 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dash_trich_components", 3 | "version": "1.0.0", 4 | "description": "Trich.ai components library for Dash Plotly", 5 | "repository": { 6 | "type": "git", 7 | "url": "git://github.com/romanonatacha/dash-trich-components.git" 8 | }, 9 | "bugs": { 10 | "url": "https://github.com/romanonatacha/dash-trich-components/issues" 11 | }, 12 | "homepage": "https://github.com/romanonatacha/dash-trich-components", 13 | "main": "build/index.js", 14 | "scripts": { 15 | "start": "webpack-serve --config ./webpack.serve.config.js --open", 16 | "validate-init": "python _validate_init.py", 17 | "prepublishOnly": "npm run validate-init", 18 | "build:js": "webpack --mode production", 19 | "build:py_and_r": "dash-generate-components ./src/lib/components dash_trich_components -p package-info.json --r-prefix ''", 20 | "build:py_and_r-activated": "(. venv/bin/activate || venv\\scripts\\activate && npm run build:py_and_r)", 21 | "build": "npm run build:js && npm run build:py_and_r", 22 | "build:activated": "npm run build:js && npm run build:py_and_r-activated" 23 | }, 24 | "author": "Natacha Romano ", 25 | "license": "MIT", 26 | "dependencies": { 27 | "@fortawesome/fontawesome-svg-core": "^1.2.28", 28 | "@fortawesome/free-solid-svg-icons": "^5.13.0", 29 | "@fortawesome/react-fontawesome": "^0.1.9", 30 | "@material-ui/core": "^4.11.3", 31 | "@material-ui/icons": "^4.11.2", 32 | "@trendmicro/react-sidenav": "^0.5.0", 33 | "bootstrap": "^4.5.0", 34 | "file-loader": "^6.0.0", 35 | "node-sass": "^4.14.1", 36 | "ramda": "^0.26.1", 37 | "react-bootstrap": "^1.0.1", 38 | "react-grid-layout": "^1.2.0", 39 | "react-jss": "^10.1.1", 40 | "react-slick": "^0.26.1", 41 | "sass-loader": "^8.0.2", 42 | "slick-carousel": "^1.8.1", 43 | "styled-components": "^5.1.0" 44 | }, 45 | "devDependencies": { 46 | "@babel/core": "^7.5.4", 47 | "@babel/plugin-proposal-object-rest-spread": "^7.5.4", 48 | "@babel/preset-env": "^7.5.4", 49 | "@babel/preset-react": "^7.0.0", 50 | "babel-eslint": "^10.0.2", 51 | "babel-loader": "^8.0.6", 52 | "copyfiles": "^2.1.1", 53 | "css-loader": "^3.5.3", 54 | "eslint": "^6.0.1", 55 | "eslint-config-prettier": "^6.0.0", 56 | "eslint-plugin-import": "^2.18.0", 57 | "eslint-plugin-react": "^7.14.2", 58 | "npm": "^6.14.6", 59 | "prop-types": "^15.7.2", 60 | "react": "^16.13.1", 61 | "react-docgen": "^4.1.1", 62 | "react-dom": "^16.8.6", 63 | "style-loader": "^0.23.1", 64 | "styled-jsx": "^3.2.1", 65 | "webpack": "4.36.1", 66 | "webpack-cli": "3.3.6", 67 | "webpack-serve": "3.1.0" 68 | }, 69 | "engines": { 70 | "node": ">=8.11.0", 71 | "npm": ">=6.1.0" 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | testpaths = tests/ 3 | addopts = -rsxX -vv 4 | log_format = %(asctime)s | %(levelname)s | %(name)s:%(lineno)d | %(message)s 5 | log_cli_level = ERROR 6 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | appdirs==1.4.4 2 | attrs==19.3.0 3 | autopep8==1.5.2 4 | black==19.10b0 5 | bleach==3.3.0 6 | Brotli==1.0.7 7 | certifi==2020.4.5.1 8 | cffi==1.14.0 9 | chardet==3.0.4 10 | click==7.1.2 11 | coloredlogs==14.0 12 | cryptography==3.3.2 13 | dash==1.12.0 14 | dash-core-components==1.10.0 15 | dash-dangerously-set-inner-html==0.0.2 16 | dash-flow-example==0.0.5 17 | dash-html-components==1.0.3 18 | dash-renderer==1.4.1 19 | dash-table==4.7.0 20 | docutils==0.16 21 | entrypoints==0.3 22 | fire==0.2.1 23 | flake8==3.7.9 24 | Flask==1.1.2 25 | Flask-Compress==1.5.0 26 | future==0.18.2 27 | humanfriendly==8.2 28 | idna==2.9 29 | itsdangerous==1.1.0 30 | jeepney==0.4.3 31 | Jinja2==2.11.2 32 | keyring==21.2.1 33 | MarkupSafe==1.1.1 34 | mccabe==0.6.1 35 | mock==4.0.1 36 | numpy==1.18.4 37 | packaging==20.3 38 | pandas==1.0.3 39 | pathspec==0.8.0 40 | pkginfo==1.5.0.1 41 | plotly==4.7.1 42 | pycodestyle==2.5.0 43 | pycparser==2.20 44 | pyflakes==2.1.1 45 | Pygments==2.6.1 46 | pyparsing==2.4.7 47 | python-dateutil==2.8.1 48 | pytz==2020.1 49 | PyYAML==5.3 50 | readme-renderer==26.0 51 | regex==2020.5.14 52 | requests==2.23.0 53 | requests-toolbelt==0.9.1 54 | retrying==1.3.3 55 | SecretStorage==3.1.2 56 | six==1.14.0 57 | termcolor==1.1.0 58 | toml==0.10.1 59 | tqdm==4.46.0 60 | twine==3.1.1 61 | typed-ast==1.4.1 62 | urllib3==1.25.9 63 | webencodings==0.5.1 64 | Werkzeug==1.0.1 65 | -------------------------------------------------------------------------------- /review_checklist.md: -------------------------------------------------------------------------------- 1 | # Code Review Checklist 2 | 3 | ## Code quality & design 4 | 5 | - Is your code clear? If you had to go back to it in a month, would you be happy to? If someone else had to contribute to it, would they be able to? 6 | 7 | A few suggestions: 8 | 9 | - Make your variable names descriptive and use the same naming conventions throughout the code. 10 | 11 | - For more complex pieces of logic, consider putting a comment, and maybe an example. 12 | 13 | - In the comments, focus on describing _why_ the code does what it does, rather than describing _what_ it does. The reader can most likely read the code, but not necessarily understand why it was necessary. 14 | 15 | - Don't overdo it in the comments. The code should be clear enough to speak for itself. Stale comments that no longer reflect the intent of the code can hurt code comprehension. 16 | 17 | * Don't repeat yourself. Any time you see that the same piece of logic can be applied in multiple places, factor it out into a function, or variable, and reuse that code. 18 | * Scan your code for expensive operations (large computations, DOM queries, React re-renders). Have you done your possible to limit their impact? If not, it is going to slow your app down. 19 | * Can you think of cases where your current code will break? How are you handling errors? Should the user see them as notifications? Should your app try to auto-correct them for them? 20 | 21 | ## Component API 22 | 23 | - Have you tested your component on the Python side by creating an app in `usage.py` ? 24 | 25 | Do all of your component's props work when set from the back-end? 26 | 27 | Should all of them be settable from the back-end or are some only relevant to user interactions in the front-end? 28 | 29 | - Have you provided some basic documentation about your component? The Dash community uses [react docstrings](https://github.com/plotly/dash-docs/blob/master/tutorial/plugins.py#L45) to provide basic information about dash components. Take a look at this [Checklist component example](https://github.com/plotly/dash-core-components/blob/master/src/components/Checklist.react.js) and others from the dash-core-components repository. 30 | 31 | At a minimum, you should describe what your component does, and describe its props and the features they enable. 32 | 33 | Be careful to use the correct formatting for your docstrings for them to be properly recognized. 34 | 35 | ## Tests 36 | 37 | - The Dash team uses integration tests extensively, and we highly encourage you to write tests for the main functionality of your component. In the `tests` folder of the boilerplate, you can see a sample integration test. By launching it, you will run a sample Dash app in a browser. You can run the test with: 38 | ``` 39 | python -m tests.test_render 40 | ``` 41 | [Browse the Dash component code on GitHub for more examples of testing.](https://github.com/plotly/dash-core-components) 42 | 43 | ## Ready to publish? Final scan 44 | 45 | - Take a last look at the external resources that your component is using. Are all the external resources used [referenced in `MANIFEST.in`](https://github.com/plotly/dash-docs/blob/0b2fd8f892db720a7f3dc1c404b4cff464b5f8d4/tutorial/plugins.py#L55)? 46 | 47 | - [You're ready to publish!](https://github.com/plotly/dash-component-boilerplate/blob/master/%7B%7Bcookiecutter.project_shortname%7D%7D/README.md#create-a-production-build-and-publish) 48 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import json 2 | import os 3 | from setuptools import setup 4 | 5 | # read the contents of your README file 6 | from os import path 7 | this_directory = path.abspath(path.dirname(__file__)) 8 | with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f: 9 | long_description = f.read() 10 | 11 | with open('package.json') as f: 12 | package = json.load(f) 13 | 14 | package_name = package["name"].replace(" ", "_").replace("-", "_") 15 | 16 | setup( 17 | name=package_name, 18 | version=package["version"], 19 | author=package['author'], 20 | packages=[package_name], 21 | include_package_data=True, 22 | license=package['license'], 23 | description=package.get('description', package_name), 24 | long_description=long_description, 25 | long_description_content_type='text/markdown', 26 | install_requires=[], 27 | classifiers = [ 28 | 'Framework :: Dash', 29 | ], 30 | ) 31 | -------------------------------------------------------------------------------- /src/demo/App.js: -------------------------------------------------------------------------------- 1 | /* eslint no-magic-numbers: 0 */ 2 | import React, { Component } from 'react'; 3 | 4 | // import { Carousel } from '../lib'; 5 | // import GridLayoutComponent from '../lib/components/GridLayoutComponent/GridLayoutComponent.react'; 6 | // import TrichResponsiveGridLayout from '../lib/components/GridLayoutComponent/ResponsiveGridLayout.react'; 7 | // import RatingComp from '../lib/components/Rating/Rating.react'; 8 | import ResponsiveGrid from '../lib/components/ResponsiveGrid/ResponsiveGrid.react'; 9 | 10 | class App extends Component { 11 | 12 | 13 | render() { 14 | const layouts = {xl:[{ i: 'a', x: 2, y: 5, w: 3, h: 10, minH: 3, maxH: 15 }, 15 | { i: 'b', x: 3, y: 0, w: 3, h: 4, minH: 3, maxH: 10, minW: 2, maxW: 4 }, 16 | { i: 'c', x: 7, y: 0, w: 6, h: 2, minH: 3, maxH: 20}, 17 | { i: 'd', x: 2, y: 4, w: 6, h: 2, minH: 3, maxH: 20}], 18 | lg: [{ i: 'a', x: 0, y: 0, w: 3, h: 7, minH: 3, maxH: 15 }, 19 | { i: 'b', x: 3, y: 0, w: 3, h: 4, minH: 3, maxH: 10, minW: 2, maxW: 4 }, 20 | { i: 'c', x: 7, y: 0, w: 6, h: 10, minH: 3, maxH: 20}, 21 | { i: 'd', x: 2, y: 4, w: 6, h: 10, minH: 3, maxH: 20}], 22 | md: [{ i: 'a', x: 0, y: 0, w: 5, h: 4 }, 23 | { i: 'b', x: 1, y: 2, w: 5, h: 2, minW: 2, maxW: 4 }, 24 | { i: 'c', x: 2, y: 0, w: 3, h: 7 }, 25 | { i: 'd', x: 3, y: 4, w: 6, h: 4, minH: 3, maxH: 15}], 26 | 27 | sm: [{ i: 'a', x: 0, y: 0, w: 4, h: 4 }, 28 | { i: 'b', x: 1, y: 0, w: 3, h: 3, minW: 2, maxW: 5 }, 29 | { i: 'c', x: 2, y: 0, w: 5, h: 5 }, 30 | { i: 'd', x: 4, y: 3, w: 3, h: 7, minH: 3, maxH: 8}]} 31 | 32 | 33 | return ( 34 |
35 | 39 |
41 |
42 |
Draggable Area
44 |
ni hao
45 |
46 |
47 |
Bon jour
49 |
olá
51 |
HI
53 |
54 |
55 | ) 56 | } 57 | } 58 | 59 | export default App; 60 | -------------------------------------------------------------------------------- /src/demo/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | ReactDOM.render(, document.getElementById('root')); 6 | -------------------------------------------------------------------------------- /src/lib/components/Card/Card.react.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import Badge from 'react-bootstrap/Badge' 4 | import 'bootstrap/dist/css/bootstrap.min.css'; 5 | import './Card.scss' 6 | 7 | /** 8 | * A simple card with an image, title, description, 9 | * badges and link for github with icon, all this arguments are optional. 10 | */ 11 | 12 | export default class Card extends Component { 13 | 14 | render() { 15 | 16 | const { 17 | id, 18 | style, 19 | className, 20 | link, 21 | openNewTab, 22 | image, 23 | title, 24 | description, 25 | badges, 26 | git, 27 | dark 28 | } = this.props 29 | 30 | return ( 31 |
32 |
33 | {image && 34 | 35 |
36 | {title} 37 |
38 |
39 | } 40 |
41 | {title && 42 |

{title}

43 | } 44 | {description && 45 |

{description}

46 | } 47 |
48 |
49 |
50 | {badges && badges.map((item, i) => ( 51 |
52 | {item} 53 |
54 | 55 | ))} 56 |
57 | {git && 58 |
59 | 60 | 61 | 62 |
63 | } 64 |
65 |
66 |
67 | ); 68 | } 69 | 70 | } 71 | 72 | Card.defaultProps = { 73 | id: null, 74 | style: null, 75 | className: '', 76 | link: null, 77 | image: null, 78 | title: null, 79 | description: null, 80 | badges: null, 81 | git: null, 82 | dark: false, 83 | openNewTab: true 84 | }; 85 | 86 | Card.propTypes = { 87 | /** 88 | * Id of the element 89 | */ 90 | id: PropTypes.string, 91 | 92 | /** 93 | * Style class of the component. 94 | */ 95 | className: PropTypes.string, 96 | 97 | /** 98 | * Inline style of the component. 99 | */ 100 | style: PropTypes.object, 101 | 102 | /** 103 | * link to redirect when the user clicks on the image 104 | */ 105 | link: PropTypes.string, 106 | 107 | /** 108 | * image that will display on card 109 | */ 110 | image: PropTypes.string, 111 | 112 | /** 113 | * title of the card 114 | */ 115 | title: PropTypes.string, 116 | 117 | /** 118 | * description of the card 119 | */ 120 | description: PropTypes.string, 121 | 122 | /** 123 | * list of strings to display in badges, to work porperly put up to 4 or 5 124 | */ 125 | badges: PropTypes.array, 126 | 127 | /** 128 | * github URL, is not required, only if you want to 129 | */ 130 | git: PropTypes.string, 131 | 132 | /** 133 | * theme color of the card, that for default is light 134 | */ 135 | dark: PropTypes.bool, 136 | 137 | /** 138 | * Open card link in a new tab 139 | */ 140 | openNewTab: PropTypes.bool, 141 | }; 142 | -------------------------------------------------------------------------------- /src/lib/components/Card/Card.scss: -------------------------------------------------------------------------------- 1 | .trich_card { 2 | 3 | .card { 4 | height: 100%; 5 | border: none; 6 | 7 | &:focus { 8 | outline: none; 9 | } 10 | 11 | .badge { 12 | text-transform: capitalize; 13 | } 14 | } 15 | 16 | .padding16 { 17 | padding: 16px; 18 | } 19 | 20 | .radius8 { 21 | border-radius: 8px; 22 | } 23 | 24 | .bottom16 { 25 | margin-bottom: 16px; 26 | } 27 | 28 | .font-sm { 29 | font-size: 16px; 30 | } 31 | .font-xs { 32 | font-size: 14px; 33 | } 34 | 35 | .bold { 36 | font-weight: 700; 37 | } 38 | 39 | .uppercase { 40 | text-transform: uppercase; 41 | } 42 | 43 | .flex_row_btw { 44 | display: flex; 45 | flex-direction: row; 46 | justify-content: space-between; 47 | } 48 | 49 | .inline-block { 50 | display: inline-block; 51 | } 52 | 53 | .self_center { 54 | align-self: center; 55 | } 56 | 57 | &.light { 58 | .card { 59 | background-color: #f5f5f5; 60 | color: #333333; 61 | 62 | .badge { 63 | background-color: #2b7178; 64 | color: #fff; 65 | } 66 | 67 | .git { 68 | color: #c75146; 69 | } 70 | } 71 | } 72 | 73 | &.dark { 74 | .card { 75 | background-color: #333333; 76 | color: #fff; 77 | 78 | .badge { 79 | background-color: #77aeb2; 80 | color: #333333; 81 | } 82 | 83 | .git { 84 | color: #dc7d75; 85 | } 86 | } 87 | } 88 | } 89 | 90 | /* media queries */ 91 | 92 | @media only screen and (min-width: 576px) { 93 | 94 | .trich_card_text { 95 | height: calc(100% - 190px); 96 | } 97 | } 98 | 99 | @media only screen and (min-width: 768px) { 100 | 101 | .trich_card { 102 | .card { 103 | min-width: 332px; 104 | max-width: 332px; 105 | height: 100%; 106 | 107 | .trich_card_img { 108 | height: 200px; 109 | 110 | img { 111 | width: 100%; 112 | 113 | &:hover { 114 | cursor: pointer; 115 | } 116 | } 117 | } 118 | 119 | .trich_card_text { 120 | height: calc(100% - 252px); 121 | } 122 | 123 | .trich_card_footer { 124 | height: 24px; 125 | } 126 | 127 | } 128 | 129 | &.light { 130 | .card:hover { 131 | filter: drop-shadow(2px 4px 6px rgb(143, 143, 143)); 132 | } 133 | } 134 | 135 | &.dark { 136 | .card:hover { 137 | filter: drop-shadow(2px 4px 6px black); 138 | } 139 | } 140 | } 141 | 142 | 143 | } 144 | 145 | @media screen and (max-width: 767px) { 146 | 147 | .trich_card { 148 | 149 | .trich_card_footer { 150 | height: 24px; 151 | } 152 | 153 | .trich_card_img img { 154 | width: 100%; 155 | } 156 | } 157 | 158 | 159 | } -------------------------------------------------------------------------------- /src/lib/components/Carousel/Carousel.react.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import Slider from "react-slick"; 4 | import './Carousel.scss' 5 | 6 | /** 7 | * Carousel is an carousel component. 8 | * It takes some setting properties 9 | * You put how many blocks of divs you want inside it, 10 | * and this div turn into slides 11 | */ 12 | 13 | export default class Carousel extends Component { 14 | render() { 15 | 16 | const { 17 | dots, 18 | arrows, 19 | infinite, 20 | autoplay, 21 | speed, 22 | slides_to_show, 23 | slides_to_scroll, 24 | center_mode, 25 | center_padding, 26 | swipe_to_slide, 27 | variable_width, 28 | responsive, 29 | vertical, 30 | className, 31 | style, 32 | id, 33 | children } = this.props 34 | 35 | const settings = { 36 | dots: dots || false, 37 | arrows: arrows || true, 38 | infinite: infinite || true, 39 | autoplay: autoplay || false, 40 | speed: speed || 1000, 41 | slidesToShow: slides_to_show || 3, 42 | slidesToScroll: slides_to_scroll || 1, 43 | centerMode: center_mode || false, 44 | centerPadding: center_padding || '50px', 45 | swipeToSlide: swipe_to_slide || true, 46 | variableWidth: variable_width || false, 47 | responsive: responsive || null, 48 | vertical: vertical || false, 49 | 50 | }; 51 | 52 | return ( 53 |
54 | 55 | {children} 56 | 57 |
58 | ); 59 | } 60 | } 61 | 62 | Carousel.defaultProps = { 63 | 64 | }; 65 | 66 | Carousel.propTypes = { 67 | /** 68 | * Dots under carousel 69 | */ 70 | dots: PropTypes.bool, 71 | 72 | /** 73 | * Arrows to control carousel 74 | */ 75 | arrows: PropTypes.bool, 76 | 77 | /** 78 | * If the carousel content will repeat in a loop 79 | */ 80 | infinite: PropTypes.bool, 81 | 82 | /** 83 | * If the carousel will start to play automatically 84 | */ 85 | autoplay: PropTypes.bool, 86 | 87 | /** 88 | * Speed of autoplay 89 | */ 90 | speed: PropTypes.number, 91 | 92 | /** 93 | * How many slides you want to show 94 | */ 95 | slides_to_show: PropTypes.number, 96 | 97 | /** 98 | * How many slides will scroll when you swipe the carousel 99 | */ 100 | slides_to_scroll: PropTypes.number, 101 | 102 | /** 103 | * To centralize the carousel 104 | */ 105 | center_mode: PropTypes.bool, 106 | 107 | /** 108 | * Padding on the sides 109 | */ 110 | center_padding: PropTypes.string, 111 | 112 | /** 113 | * If you can slide to scroll the slides 114 | */ 115 | swipe_to_slide: PropTypes.bool, 116 | 117 | /** 118 | * The slides width varies according to the screen size 119 | */ 120 | variable_width: PropTypes.bool, 121 | 122 | /** 123 | * Settings of breakpoints 124 | */ 125 | responsive: PropTypes.array, 126 | 127 | /** 128 | * If your carousel is vertical 129 | */ 130 | vertical: PropTypes.bool, 131 | 132 | /** 133 | * Your carousel is vertical 134 | */ 135 | children: PropTypes.node, 136 | 137 | /** 138 | * Inline style of the component. 139 | */ 140 | style: PropTypes.object, 141 | 142 | /** 143 | * Style class of the component. 144 | */ 145 | className: PropTypes.string, 146 | 147 | /** 148 | * Id of the element 149 | */ 150 | id: PropTypes.string 151 | 152 | }; 153 | -------------------------------------------------------------------------------- /src/lib/components/Carousel/Carousel.scss: -------------------------------------------------------------------------------- 1 | $slick-font-path: "~slick-carousel/slick/fonts/"; 2 | $slick-loader-path: "~slick-carousel/slick/"; 3 | 4 | @import '~slick-carousel/slick/slick', '~slick-carousel/slick/slick-theme'; 5 | 6 | .trich_carousel { 7 | .slick-prev { 8 | &:before { 9 | font-family: "Font Awesome 5 Free"; 10 | font-weight: 900; 11 | content: '\f053'; 12 | color: #232323; 13 | } 14 | } 15 | .slick-next { 16 | &:before { 17 | font-family: "Font Awesome 5 Free"; 18 | font-weight: 900; 19 | content: '\f054'; 20 | color: #232323; 21 | } 22 | } 23 | 24 | .slick-dots { 25 | button { 26 | color: unset; 27 | &:before { 28 | font-size: 28px; 29 | color: #232323; 30 | } 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /src/lib/components/GridLayoutComponent/GridLayout.scss: -------------------------------------------------------------------------------- 1 | .gridlayout 2 | { 3 | background:lightgrey; 4 | } -------------------------------------------------------------------------------- /src/lib/components/GridLayoutComponent/GridLayoutComponent.react.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import 'react-grid-layout/css/styles.css' 4 | import 'react-resizable/css/styles.css' 5 | import GridLayout from 'react-grid-layout'; 6 | import './GridLayout.scss' 7 | 8 | /** 9 | * GridLayout is an GridLayout component. 10 | * It takes some setting properties 11 | * You put how many blocks of divs you want inside it, 12 | * and this div turn into slides 13 | */ 14 | 15 | export default class GridLayoutComponent extends Component { 16 | 17 | render() { 18 | 19 | const { style, className, children, id, layout, total_cols, row_height, width, background_color } = this.props; 20 | 21 | const styles = { 22 | maxWidth: width || '100px', 23 | backgroundColor: background_color || 'lightgray', 24 | margin: '0 auto' 25 | } 26 | 27 | return ( 28 | 29 | 30 | {children.map((child, i) => ( 31 |
32 | {child} 33 |
34 | )) 35 | } 36 | 37 |
38 | ) 39 | } 40 | } 41 | 42 | GridLayoutComponent.defaultProps = { 43 | 44 | }; 45 | 46 | GridLayoutComponent.propTypes = { 47 | /** 48 | * Your GridLayout is vertical 49 | */ 50 | children: PropTypes.node, 51 | 52 | /** 53 | * Inline style of the component. 54 | */ 55 | style: PropTypes.object, 56 | 57 | /** 58 | * Style class of the component. 59 | */ 60 | className: PropTypes.string, 61 | 62 | /** 63 | * Id of the element 64 | */ 65 | id: PropTypes.string, 66 | 67 | /** 68 | * Initial layout 69 | */ 70 | layout: PropTypes.array, 71 | 72 | }; 73 | -------------------------------------------------------------------------------- /src/lib/components/ResponsiveGrid/GridItem.react.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import ReactDOM from "react-dom" 3 | import PropTypes from 'prop-types'; 4 | 5 | /** 6 | * A class for displaying an item in a grid 7 | * Designed to be wrapped in a function, similar to a higher-order component. Otherwise 8 | * the layout will render incorrectly 9 | */ 10 | class GridItem extends Component { 11 | constructor(props) { 12 | super(props); 13 | this.relayout = this.relayout.bind(this); 14 | this.relayoutChildren = this.relayoutChildren.bind(this); 15 | } 16 | 17 | componentDidUpdate(prevProps) { 18 | let updated = false; 19 | // Ensure that the layout has in fact changed before calling relayout 20 | const keys = ['w','h','x','y']; 21 | 22 | for (let key of keys) { 23 | if(this.props.layout[key] !== prevProps.layout[key]) { 24 | updated = true; 25 | } 26 | } 27 | 28 | if (updated) { 29 | this.relayoutChildren(); 30 | } 31 | } 32 | 33 | componentDidMount() { 34 | this.relayoutChildren(); 35 | window.addEventListener("resize", this.relayoutChildren); 36 | } 37 | 38 | componentWillUnmount() { 39 | window.removeEventListener("resize", this.relayoutChildren); 40 | } 41 | 42 | /** 43 | * Iterate over children and trigger a relayout event 44 | */ 45 | relayoutChildren() { 46 | 47 | function flattenReactChildrenToArray(nodeChildren, accumulated = []) { 48 | React.Children.forEach(nodeChildren, (childNode) => { 49 | accumulated.push(childNode); 50 | if (childNode && childNode.props && childNode.props.children) { 51 | flattenReactChildrenToArray(childNode.props.children, accumulated); 52 | } 53 | }); 54 | return accumulated; 55 | } 56 | 57 | // Relayout after a time period so that the rest of the layout can render properly 58 | window.setTimeout(() => { 59 | let flat = flattenReactChildrenToArray(this.props.children); 60 | flat.forEach(this.relayout); 61 | }, 50); 62 | } 63 | 64 | /** 65 | * Relayout the Plotly objects; modify their sizes to fit inside the columns 66 | */ 67 | relayout(child) { 68 | 69 | const rootNode = ReactDOM.findDOMNode(this).parentElement; //gets the grid item node so we can calculate the correct plot height 70 | 71 | function outerHeight(el) { 72 | var height = el.offsetHeight; 73 | var style = getComputedStyle(el); 74 | 75 | height += parseInt(style.marginTop) + parseInt(style.marginBottom); 76 | return height; 77 | } 78 | 79 | function innerHeight(el) { 80 | var height = el.clientHeight; 81 | var style = getComputedStyle(el); 82 | 83 | height -= (parseInt(style.paddingTop) + parseInt(style.paddingBottom) + parseInt(style.borderTopWidth) + parseInt(style.borderBottomWidth)); 84 | return height; 85 | } 86 | 87 | function innerWidth(el) { 88 | var width = el.clientWidth; 89 | var style = getComputedStyle(el); 90 | 91 | width -= (parseInt(style.paddingLeft) + parseInt(style.paddingRight) + parseInt(style.borderLeftWidth) + parseInt(style.borderRightWidth)); 92 | return width; 93 | } 94 | 95 | if( (child.props && child.props.id) || (child.props._dashprivate_layout && child.props._dashprivate_layout.props.id)) { 96 | const id = child.props.id || child.props._dashprivate_layout.props.id; 97 | const elem = document.getElementById(id); 98 | 99 | // filter only plotly charts 100 | // TODO height calculation only works if plot is at the immediate level 101 | 102 | function updateElem(elem) { 103 | if(elem && elem.className && typeof elem.className === 'string' && elem.className.includes('js-plotly-plot')) { 104 | const parent = elem.parentElement; //div 105 | let height = innerHeight(rootNode); 106 | let width = innerWidth(rootNode); 107 | 108 | // If there are other elements in the GridItem, don't allow the 109 | // Plotly chart to completely fill the space 110 | for (let c of parent.children) { 111 | if(c !== elem) { 112 | height = height - outerHeight(c); 113 | } 114 | } 115 | 116 | const update = { 117 | width: width - 15, 118 | height: height - 15, //TODO does not entirely fit. 119 | }; 120 | 121 | try { 122 | window.Plotly.relayout(elem, update); 123 | } catch(e) { 124 | // Log the error 125 | window.console.log(e); 126 | } 127 | } else if(child.props.onResize && typeof v === 'function') { 128 | child.props.onResize(); //TODO not really useful unless size is passed 129 | } 130 | } 131 | 132 | function df(node) { 133 | updateElem(node); 134 | if(node.children) { 135 | for(var i = 0; i < node.children.length; i++) 136 | df(node.children[i]); 137 | } 138 | } 139 | 140 | df(elem); 141 | } 142 | } 143 | 144 | render() { 145 | return this.props.children; 146 | } 147 | } 148 | 149 | GridItem.propTypes = { 150 | /** 151 | * An identifier for the component. 152 | * Synonymous with `key`, but `key` cannot be specified as 153 | * a PropType without causing errors. A caveat to this is that when using 154 | * the component in pure React (as opposed to via Dash), both `i` and `key` 155 | * must be specified 156 | */ 157 | i: PropTypes.string.isRequired, 158 | 159 | /** 160 | * A list of child elements to place inside the grid ite, 161 | */ 162 | children: PropTypes.node, 163 | 164 | /** 165 | * An object describing the layout of the element 166 | */ 167 | layout: PropTypes.shape({ 168 | /** 169 | * The x-value of the element location, in grid units 170 | */ 171 | x: PropTypes.number.isRequired, 172 | 173 | /** 174 | * The y-value of the element location, in grid units 175 | */ 176 | y: PropTypes.number.isRequired, 177 | 178 | /** 179 | * The width of the element, in grid units 180 | */ 181 | w: PropTypes.number.isRequired, 182 | 183 | /** 184 | * The height of the element, in grid units 185 | */ 186 | h: PropTypes.number.isRequired, 187 | 188 | /** 189 | * The minimum width of the element, in grid units 190 | */ 191 | minW: PropTypes.number, 192 | 193 | /** 194 | * The maximum width of the element, in grid units 195 | */ 196 | maxW: PropTypes.number, 197 | 198 | /** 199 | * The minimum height of the element, in grid units 200 | */ 201 | minH: PropTypes.number, 202 | 203 | /** 204 | * The maximum height of the element, in grid units 205 | */ 206 | maxH: PropTypes.number, 207 | 208 | /** 209 | * Is static: if true, the element is not resizable or draggable 210 | */ 211 | static: PropTypes.bool, 212 | 213 | /** 214 | * If false, element can not be dragged 215 | */ 216 | isDraggable: PropTypes.bool, 217 | 218 | /** 219 | * If false, the element can not be resized 220 | */ 221 | isResizable: PropTypes.bool 222 | }), 223 | 224 | /** 225 | * Dash-assigned callback that should be called whenever any of the properties change 226 | */ 227 | setProps: PropTypes.func 228 | }; 229 | 230 | export default GridItem; 231 | -------------------------------------------------------------------------------- /src/lib/components/ResponsiveGrid/GridLayoutResponsive.scss: -------------------------------------------------------------------------------- 1 | img { 2 | max-width: 100%; 3 | max-height: 100%; 4 | } 5 | 6 | .react-grid-layout { 7 | position: relative; 8 | transition: height 200ms ease; 9 | } 10 | .react-grid-item { 11 | transition: all 200ms ease; 12 | transition-property: left, top; 13 | } 14 | .react-grid-item.cssTransforms { 15 | transition-property: transform; 16 | } 17 | .react-grid-item.resizing { 18 | z-index: 1; 19 | will-change: width, height; 20 | } 21 | 22 | .react-grid-item.react-draggable-dragging { 23 | transition: none; 24 | z-index: 3; 25 | will-change: transform; 26 | } 27 | 28 | .react-grid-item.react-grid-placeholder { 29 | background: red; 30 | opacity: 0.2; 31 | transition-duration: 100ms; 32 | z-index: 2; 33 | -webkit-user-select: none; 34 | -moz-user-select: none; 35 | -ms-user-select: none; 36 | -o-user-select: none; 37 | user-select: none; 38 | } 39 | 40 | .react-grid-item > .react-resizable-handle { 41 | position: absolute; 42 | width: 20px; 43 | height: 20px; 44 | bottom: 0; 45 | right: 0; 46 | background: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pg08IS0tIEdlbmVyYXRvcjogQWRvYmUgRmlyZXdvcmtzIENTNiwgRXhwb3J0IFNWRyBFeHRlbnNpb24gYnkgQWFyb24gQmVhbGwgKGh0dHA6Ly9maXJld29ya3MuYWJlYWxsLmNvbSkgLiBWZXJzaW9uOiAwLjYuMSAgLS0+DTwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DTxzdmcgaWQ9IlVudGl0bGVkLVBhZ2UlMjAxIiB2aWV3Qm94PSIwIDAgNiA2IiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjojZmZmZmZmMDAiIHZlcnNpb249IjEuMSINCXhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbDpzcGFjZT0icHJlc2VydmUiDQl4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjZweCIgaGVpZ2h0PSI2cHgiDT4NCTxnIG9wYWNpdHk9IjAuMzAyIj4NCQk8cGF0aCBkPSJNIDYgNiBMIDAgNiBMIDAgNC4yIEwgNCA0LjIgTCA0LjIgNC4yIEwgNC4yIDAgTCA2IDAgTCA2IDYgTCA2IDYgWiIgZmlsbD0iIzAwMDAwMCIvPg0JPC9nPg08L3N2Zz4='); 47 | background-position: bottom right; 48 | padding: 0 3px 3px 0; 49 | background-repeat: no-repeat; 50 | background-origin: content-box; 51 | box-sizing: border-box; 52 | cursor: se-resize; 53 | } 54 | 55 | .react-resizable { 56 | position: relative; 57 | } 58 | 59 | .react-resizable-handle { 60 | position: absolute; 61 | width: 20px; 62 | height: 20px; 63 | bottom: 0; 64 | right: 0; 65 | background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2IDYiIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmYwMCIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI2cHgiIGhlaWdodD0iNnB4Ij48ZyBvcGFjaXR5PSIwLjMwMiI+PHBhdGggZD0iTSA2IDYgTCAwIDYgTCAwIDQuMiBMIDQgNC4yIEwgNC4yIDQuMiBMIDQuMiAwIEwgNiAwIEwgNiA2IEwgNiA2IFoiIGZpbGw9IiMwMDAwMDAiLz48L2c+PC9zdmc+'); 66 | background-position: bottom right; 67 | padding: 0 3px 3px 0; 68 | background-repeat: no-repeat; 69 | background-origin: content-box; 70 | box-sizing: border-box; 71 | cursor: se-resize; 72 | } 73 | 74 | testing { 75 | background:black; 76 | } -------------------------------------------------------------------------------- /src/lib/components/ResponsiveGrid/ResponsiveGrid.react.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import { Responsive, WidthProvider, utils } from "react-grid-layout"; 4 | import { unpackChildren, wrapChildren} from '../../utils'; 5 | 6 | import './GridLayoutResponsive.scss'; 7 | 8 | const type = obj => Object.prototype.toString.call(obj); 9 | const ResponsiveReactGridLayout = WidthProvider(Responsive); 10 | 11 | 12 | /** 13 | * This component is an update of an another component build by Alexander Cabello 14 | * 15 | * The Link to the original component is: https://github.com/AlgorithmHub/dash-responsive-grid-layout 16 | * 17 | * It allows the user to drag, resize and modify the components inside of it. 18 | * To be able to run it, you need to add a layout(one definition to each breakpoint) and a div with the ID (key) that will be mapped as the box inside of the Draggable Component. 19 | * 20 | */ 21 | 22 | 23 | export default class ResponsiveGrid extends Component { 24 | constructor(props) { 25 | super(props); 26 | 27 | // Bind `this` to functions so that they can be 28 | // passed as callbacks without scoping issues 29 | this.onLayoutChange = this.onLayoutChange.bind(this); 30 | this.onBreakpointChange = this.onBreakpointChange.bind(this); 31 | 32 | this.state = { 33 | layout: props.layout, 34 | layouts: props.layouts, 35 | breakpoint: props.breakpoint 36 | }; 37 | 38 | if(this.props.setProps) { 39 | this.props.setProps({ 40 | layout: props.layout, 41 | layouts: props.layouts, 42 | breakpoint: props.breakpoint 43 | }); 44 | } 45 | } 46 | 47 | /** 48 | * Callback for the onLayoutChange 49 | */ 50 | onLayoutChange(layout, layouts) { 51 | if(this.props.setProps) { 52 | this.props.setProps({ 53 | layout: layout, 54 | layouts: layouts 55 | }); 56 | } else { 57 | this.setState({ 58 | layout: layout, 59 | layouts: layouts 60 | }); 61 | } 62 | } 63 | 64 | onBreakpointChange(breakpoint, cols) { 65 | if(this.props.setProps) { 66 | this.props.setProps({breakpoint: breakpoint}); 67 | } else { 68 | this.setState({ 69 | breakpoint: this.props.breakpoint 70 | }); 71 | } 72 | } 73 | 74 | render() { 75 | 76 | let layout, layouts, breakpoint; 77 | if(this.props.setProps) { //note setProps is not set if there are no dash input or state callbacks 78 | layout = this.props.layout; 79 | layouts = this.props.layouts; 80 | breakpoint = this.props.breakpoint; 81 | } else { 82 | layout = this.state.layout; 83 | layouts = this.state.layouts; 84 | breakpoint = this.state.breakpoint; 85 | } 86 | 87 | 88 | const unpackedChildren = unpackChildren(this.props.children); 89 | const wrappedChildren = wrapChildren(unpackedChildren, layouts[breakpoint]); 90 | 91 | 92 | return ( 93 | 123 | { wrappedChildren } 124 | 125 | ); 126 | } 127 | } 128 | 129 | ResponsiveGrid.propTypes = { 130 | 131 | /** 132 | * The ID used to identify the component in Dash callbacks 133 | */ 134 | id: PropTypes.string, 135 | 136 | /** 137 | * A list of renderable child elements, that will be placed inside the grid 138 | */ 139 | children: PropTypes.node, 140 | 141 | /** 142 | * Dash-assigned callback that should be called whenever any of the properties change 143 | */ 144 | setProps: PropTypes.func, 145 | 146 | // 147 | // Basic props 148 | // 149 | 150 | // Optional, but if you are managing width yourself you may want to set the breakpoint 151 | // yourself as well. 152 | breakpoint: PropTypes.string, 153 | 154 | // {name: pxVal}, e.g. {lg: 1200, md: 996, sm: 768, xs: 480} 155 | breakpoints: PropTypes.object, 156 | 157 | // # of cols. This is a breakpoint -> cols map 158 | cols: PropTypes.object, 159 | 160 | // layouts is an object mapping breakpoints to layouts. 161 | // e.g. {lg: Layout, md: Layout, ...} 162 | layouts: PropTypes.object, 163 | 164 | // The width of this component. 165 | // Required in this propTypes stanza because generateInitialState() will fail without it. 166 | width: PropTypes.number, 167 | 168 | // 169 | // Callbacks 170 | // 171 | 172 | // Calls back with breakpoint and new # cols 173 | onBreakpointChange: PropTypes.func, 174 | 175 | // Callback so you can save the layout. 176 | // Calls back with (currentLayout, allLayouts). allLayouts are keyed by breakpoint. 177 | onLayoutChange: PropTypes.func, 178 | 179 | // Calls back with (containerWidth, margin, cols, containerPadding) 180 | onWidthChange: PropTypes.func, 181 | 182 | 183 | // From GridLayout 184 | /** 185 | * The height, in pixels of a row in the grid 186 | */ 187 | rowHeight: PropTypes.number, 188 | 189 | /** 190 | * Total Rows that can the board have based on the cumulated sum of all rows 191 | */ 192 | maxRows: PropTypes.number, 193 | 194 | /** 195 | * If true, containers will automatically resize to fit the content 196 | */ 197 | autoSize: PropTypes.bool, 198 | 199 | /** 200 | * CSS selector for tags that will not be draggable. Requires a leading '.' 201 | */ 202 | draggableCancel: PropTypes.string, 203 | 204 | /** 205 | * CSS selector for tags that will act as the draggable handle. Requires a leading '.' 206 | */ 207 | draggableHandle: PropTypes.string, 208 | 209 | /** 210 | * If true, the layout will compact vertically 211 | */ 212 | verticalCompact: PropTypes.bool, 213 | 214 | /** 215 | * Compaction type. 216 | * One of 'vertical' and 'horizontal' 217 | */ 218 | compactType: PropTypes.oneOf(['vertical', 'horizontal']), 219 | 220 | /** 221 | * Margin between items [x, y] in px 222 | */ 223 | margin: PropTypes.arrayOf(PropTypes.number), 224 | 225 | /** 226 | * Padding inside the container [x, y] in px 227 | */ 228 | containerPadding: PropTypes.arrayOf(PropTypes.number), 229 | 230 | /** 231 | * Elements can be dragged 232 | */ 233 | isDraggable: PropTypes.bool, 234 | 235 | /** 236 | * Elements can be resized 237 | */ 238 | isResizable: PropTypes.bool, 239 | 240 | /** 241 | * Use CSS transforms instead of Position. Improves performance if switched on 242 | */ 243 | useCSSTransforms: PropTypes.bool, 244 | 245 | /** 246 | * If true, grid items won't change position when being 247 | * dragged over 248 | */ 249 | preventCollision: PropTypes.bool, 250 | 251 | 252 | /** 253 | * Callback when dragging is started 254 | */ 255 | onDragStart: PropTypes.func, 256 | 257 | /** 258 | * Callback upon each drag movement 259 | */ 260 | onDrag: PropTypes.func, 261 | 262 | /** 263 | * Callback upon drag completion 264 | */ 265 | onDragStop: PropTypes.func, 266 | 267 | /** 268 | * Calls when resize starts 269 | */ 270 | onResizeStart: PropTypes.func, 271 | 272 | /** 273 | * Calls when resize movement happens 274 | */ 275 | onResize: PropTypes.func, 276 | 277 | /** 278 | * Calls when resize is complete 279 | */ 280 | onResizeStop: PropTypes.func, 281 | 282 | /** 283 | * Set the ClassName to the component 284 | */ 285 | className: PropTypes.string, 286 | 287 | /** 288 | * Set the ClassName to the component 289 | * available options are: 290 | * ?Array<'s' | 'w' | 'e' | 'n' | 'sw' | 'nw' | 'se' | 'ne'> 291 | * default: ["se"] 292 | */ 293 | // resizeHandles: PropTypes.arrayOf(PropTypes.string), 294 | 295 | }; 296 | 297 | ResponsiveGrid.defaultProps = ResponsiveReactGridLayout.defaultProps; 298 | 299 | ResponsiveGrid.defaultProps = { 300 | breakpoint: 'lg', 301 | breakpoints: {lg: 1200, md: 996, sm: 768, xs: 480, xxs: 0}, 302 | cols: {lg: 12, md: 10, sm: 6, xs: 4, xxs: 2}, 303 | layouts: {lg: [], md: [], sm: [], xs: [], xxs: []}, 304 | onBreakpointChange: () => {}, 305 | onLayoutChange: () => {}, 306 | onWidthChange: () => {} 307 | }; 308 | -------------------------------------------------------------------------------- /src/lib/components/SideBar/SideBar.react.js: -------------------------------------------------------------------------------- 1 | import React, { Component, Children } from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import SideNav from '@trendmicro/react-sidenav'; 4 | import './SideBar.scss' 5 | import '@trendmicro/react-sidenav/dist/react-sidenav.css'; 6 | 7 | /** 8 | * A collapsible side bar for your dashboard, 9 | * with icons from Font Awesome 10 | */ 11 | 12 | export default class SideBar extends Component { 13 | 14 | render() { 15 | 16 | const { 17 | id, 18 | className, 19 | bg_color, 20 | text_color, 21 | children 22 | } = this.props 23 | 24 | return ( 25 | 32 | 33 | 34 | {children} 35 | 36 | 37 | ); 38 | } 39 | 40 | } 41 | 42 | SideBar.defaultProps = { 43 | id: null, 44 | className: '', 45 | bg_color: '#2b7279', 46 | text_color: '#ffffff' 47 | }; 48 | 49 | SideBar.propTypes = { 50 | /** 51 | * Id of the element 52 | */ 53 | id: PropTypes.string, 54 | 55 | /** 56 | * Style class of the component. 57 | */ 58 | className: PropTypes.string, 59 | 60 | /** 61 | * Color of sidebar background 62 | */ 63 | bg_color: PropTypes.string, 64 | 65 | /** 66 | * Color of sidebar text 67 | */ 68 | text_color: PropTypes.string, 69 | 70 | /** 71 | * Your carousel is vertical 72 | */ 73 | children: PropTypes.node 74 | }; 75 | -------------------------------------------------------------------------------- /src/lib/components/SideBar/SideBar.scss: -------------------------------------------------------------------------------- 1 | .trich_sidebar { 2 | i { 3 | vertical-align: middle; 4 | } 5 | } 6 | 7 | @media screen and (min-width: 600px) { 8 | .sidenav---expanded---1KdUL ~ #page_content { 9 | margin-left: 240px; 10 | transition: 0.5s; 11 | } 12 | 13 | .sidenav---collapsed---LQDEv ~ #page_content { 14 | margin-left: 64px; 15 | transition: 0.5s; 16 | } 17 | } 18 | 19 | @media screen and (max-width: 599px) { 20 | .sidenav---collapsed---LQDEv { 21 | background-color: transparent !important; 22 | } 23 | 24 | .sidenav---collapsed---LQDEv .sidenav---sidenav-nav---3tvij { 25 | display: none; 26 | } 27 | } -------------------------------------------------------------------------------- /src/lib/components/SideBarItem/SideBarItem.react.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import { NavItem, NavIcon, NavText } from '@trendmicro/react-sidenav'; 4 | import '@trendmicro/react-sidenav/dist/react-sidenav.css'; 5 | 6 | /** 7 | * Side bar items, to be used inside of sidebar component 8 | */ 9 | 10 | export default class SideBarItem extends Component { 11 | 12 | constructor(props) { 13 | super(props); 14 | 15 | this.incrementClicks = this.incrementClicks.bind(this); 16 | } 17 | 18 | incrementClicks() { 19 | if (!this.props.disabled && this.props.setProps) { 20 | this.props.setProps({ 21 | n_clicks: this.props.n_clicks + 1, 22 | n_clicks_timestamp: Date.now() 23 | }); 24 | } 25 | } 26 | 27 | render() { 28 | 29 | const { 30 | id, 31 | className, 32 | label, 33 | icon, 34 | setProps, 35 | ...otherProps 36 | } = this.props 37 | 38 | return ( 39 | 45 | 46 | 47 | 48 | 49 | {label} 50 | 51 | 52 | ); 53 | } 54 | 55 | } 56 | 57 | SideBarItem.defaultProps = { 58 | id: null, 59 | className: '', 60 | label: 'Label', 61 | icon: 'fas fa-circle', 62 | disabled: false, 63 | n_clicks: 0, 64 | n_clicks_timestamp: -1 65 | }; 66 | 67 | SideBarItem.propTypes = { 68 | /** 69 | * Id of the element 70 | */ 71 | id: PropTypes.string, 72 | 73 | /** 74 | * Style class of the component. 75 | */ 76 | className: PropTypes.string, 77 | 78 | /** 79 | * Text of menu item on sidebar 80 | */ 81 | label: PropTypes.string, 82 | 83 | /** 84 | * Icon of menu item on sidebar, pass the icon class from font awesome 85 | */ 86 | icon: PropTypes.string, 87 | 88 | /** 89 | * Disable the link. Default: False. 90 | */ 91 | disabled: PropTypes.bool, 92 | 93 | /** 94 | * An integer that represents the number of times 95 | * that this element has been clicked on. 96 | */ 97 | n_clicks: PropTypes.number, 98 | 99 | /** 100 | * An integer that represents the time (in ms since 1970) 101 | * at which n_clicks changed. This can be used to tell 102 | * which button was changed most recently. 103 | */ 104 | n_clicks_timestamp: PropTypes.number, 105 | 106 | /** 107 | * Dash-assigned callback that should be called whenever any of the 108 | * properties change 109 | */ 110 | setProps: PropTypes.func 111 | }; 112 | -------------------------------------------------------------------------------- /src/lib/components/ThemeToggle/ThemeToggle.react.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import './ThemeToggle.scss' 4 | import styled from 'styled-components' 5 | import 'bootstrap/dist/css/bootstrap.min.css'; 6 | import { OverlayTrigger, Tooltip } from 'react-bootstrap'; 7 | 8 | /** 9 | * Dark/Light theme toggle switch for your Dash project. 10 | */ 11 | 12 | export default class ThemeToggle extends Component { 13 | 14 | constructor(props) { 15 | super(props); 16 | this.state = { checked: false }; 17 | 18 | this.onChange = this.onChange.bind(this); 19 | } 20 | 21 | onChange(e) { 22 | if (e.target.checked) { 23 | document.documentElement.setAttribute('data-theme', 'dark'); 24 | } else { 25 | document.documentElement.setAttribute('data-theme', 'light'); 26 | } 27 | this.setState({ checked: e.target.checked }); 28 | }; 29 | render() { 30 | const { 31 | bg_color_dark, 32 | icon_color_dark, 33 | bg_color_light, 34 | icon_color_light, 35 | tooltip_text, 36 | className, 37 | id, 38 | style 39 | } = this.props 40 | 41 | const { checked } = this.state 42 | 43 | let background = checked ? bg_color_dark : bg_color_light 44 | let color = checked ? icon_color_dark : icon_color_light 45 | 46 | const Label = styled.label` 47 | background: ${background}; 48 | color: ${color}; 49 | ` 50 | 51 | return ( 52 |
53 | 55 | {tooltip_text} 56 | 57 | }> 58 |
59 | 60 | 61 |
62 |
63 |
64 | 65 | ); 66 | } 67 | } 68 | 69 | ThemeToggle.defaultProps = { 70 | bg_color_dark: '#232323', 71 | icon_color_dark: '#EDC575', 72 | bg_color_light: '#07484E', 73 | icon_color_light: '#c8dbdc', 74 | tooltip_text: 'Toggle light/dark theme', 75 | className: '', 76 | style: null, 77 | id: null 78 | }; 79 | 80 | ThemeToggle.propTypes = { 81 | /** 82 | * Background color of toggle switch when dark theme 83 | */ 84 | bg_color_dark: PropTypes.string, 85 | 86 | /** 87 | * Sun icon color of toggle switch when dark theme 88 | */ 89 | icon_color_dark: PropTypes.string, 90 | 91 | /** 92 | * Background color of toggle switch when light theme 93 | */ 94 | bg_color_light: PropTypes.string, 95 | 96 | /** 97 | * Moon icon color of toggle switch when dark theme 98 | */ 99 | icon_color_light: PropTypes.string, 100 | 101 | /** 102 | * Text that will appear in tooltip (only desktop) 103 | */ 104 | tooltip_text: PropTypes.string, 105 | 106 | /** 107 | * Inline style of the component. 108 | */ 109 | style: PropTypes.object, 110 | /** 111 | * Style class of the component. 112 | */ 113 | className: PropTypes.string, 114 | 115 | /** 116 | * Id of the element 117 | */ 118 | id: PropTypes.string 119 | }; 120 | -------------------------------------------------------------------------------- /src/lib/components/ThemeToggle/ThemeToggle.scss: -------------------------------------------------------------------------------- 1 | .themeToggle { 2 | input[type=checkbox] { 3 | height: 0; 4 | width: 0; 5 | visibility: hidden; 6 | } 7 | 8 | label { 9 | cursor: pointer; 10 | width: 55px; 11 | height: 30px; 12 | margin: 0 auto; 13 | display: flex; 14 | justify-content: center; 15 | align-items: center; 16 | -webkit-border-radius: 100px; 17 | -moz-border-radius: 100px; 18 | border-radius: 100px; 19 | position: relative; 20 | margin-top: -8px; 21 | 22 | &:after { 23 | font-family: "Font Awesome 5 Free"; 24 | font-weight: 900; 25 | content: "\f186"; 26 | font-size: 21px; 27 | position: absolute; 28 | top: 0; 29 | left: 4px; 30 | -webkit-transition: ease-in-out 200ms; 31 | -moz-transition: ease-in-out 200ms; 32 | -ms-transition: ease-in-out 200ms; 33 | -o-transition: ease-in-out 200ms; 34 | transition: ease-in-out 200ms; 35 | } 36 | 37 | &:hover:after { 38 | font-size: 23px; 39 | top: -2px; 40 | } 41 | } 42 | 43 | @media sreen and (max-width: 991px) { 44 | #tooltip-bottom { 45 | display: none; 46 | } 47 | } 48 | 49 | } 50 | html[data-theme='dark'] { 51 | 52 | .themeToggle { 53 | label { 54 | &:after { 55 | font-family: "Font Awesome 5 Free"; 56 | font-weight: 900; 57 | content: "\f185"; 58 | left: calc(100% - 5px); 59 | -webkit-transform: translateX(-100%); 60 | -moz-transform: translateX(-100%); 61 | -ms-transform: translateX(-100%); 62 | -o-transform: translateX(-100%); 63 | transform: translateX(-100%); 64 | } 65 | &:hover:after { 66 | font-size: 23px; 67 | top: -2px 68 | } 69 | } 70 | } 71 | } -------------------------------------------------------------------------------- /src/lib/index.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/prefer-default-export */ 2 | import Carousel from './components/Carousel/Carousel.react'; 3 | import ThemeToggle from './components/ThemeToggle/ThemeToggle.react'; 4 | import SideBar from './components/SideBar/SideBar.react'; 5 | import SideBarItem from './components/SideBarItem/SideBarItem.react'; 6 | import Card from './components/Card/Card.react'; 7 | import GridLayoutComponent from './components/GridLayoutComponent/GridLayoutComponent.react'; 8 | import ResponsiveGrid from './components/ResponsiveGrid/ResponsiveGrid.react'; 9 | import GridItem from './components/ResponsiveGrid/ResponsiveGrid.react'; 10 | 11 | export { 12 | Carousel, 13 | ThemeToggle, 14 | SideBar, 15 | SideBarItem, 16 | Card, 17 | GridLayoutComponent, 18 | ResponsiveGrid, 19 | GridItem 20 | }; 21 | -------------------------------------------------------------------------------- /src/lib/utils/GridItemWrapper.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import GridItem from '../components/ResponsiveGrid/GridItem.react'; 3 | 4 | /** 5 | * A wrapper function for GridItem 6 | * Because React Grid Layout works on the props of the 7 | * children passed to the root element, we can't just rely on 8 | * injecting the correct props at render time. Instead, we intercept 9 | * the GridItem pre-render, and replace it with a different component with the correct layout. 10 | * 11 | * In the future, this plain div will be replaced with a GridItemProxy component, that will 12 | * contain the necessary event handlers 13 | */ 14 | export const gridItemWrapper = (gridItem, newLayout) => { 15 | 16 | 17 | newLayout = newLayout || new Array(); 18 | 19 | let i, layout, gridItemNew; 20 | if(gridItem.type !== GridItem) { 21 | i = gridItem.key || gridItem.props.id; 22 | layout = gridItem.props.dataGrid || {x: 0, y: 0, w: 4, h: 4, maxWidth:12, maxHeight:8, minWidth:2, minHeight:3}; 23 | gridItemNew = {gridItem} 24 | } else { 25 | i = gridItem.props.i; 26 | layout = gridItem.props.layout; 27 | gridItemNew = gridItem; 28 | } 29 | 30 | let updatedLayout = Object.assign({}, (newLayout.find(x => x.i === i) || layout)); 31 | updatedLayout.i = i; 32 | 33 | return ( 34 |
35 | { React.cloneElement(gridItemNew, { layout: updatedLayout }) } 36 |
37 | ); 38 | } 39 | 40 | 41 | /** 42 | * By default, Dash wraps children in an element, obfuscating the key. 43 | * If a child has no key, this function npacks the children so that `key` 44 | * is exposed and the layout can be used 45 | */ 46 | export const unpackChildren = (children) => { 47 | if(children) { 48 | if(Array.isArray(children)) { 49 | return children.map(child => child.key === null ? (child.props.children || child) : child); 50 | } else if(!children.key && children.props) { 51 | return (children.props.children || children); 52 | } 53 | } 54 | 55 | return children; 56 | } 57 | 58 | /** 59 | * Wrap children inside a wrapper that conforms to react-grid-layout 60 | */ 61 | export const wrapChildren = (children, layout) => { 62 | if(children) { 63 | if(Array.isArray(children)) { 64 | return children.map(child => gridItemWrapper(child, layout)); 65 | } else { 66 | return gridItemWrapper(children, layout); 67 | } 68 | } 69 | 70 | return children; 71 | } -------------------------------------------------------------------------------- /src/lib/utils/index.js: -------------------------------------------------------------------------------- 1 | import {gridItemWrapper, unpackChildren, wrapChildren} from './GridItemWrapper'; 2 | 3 | export { 4 | gridItemWrapper, 5 | unpackChildren, 6 | wrapChildren, 7 | } 8 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/romanonatacha/dash_trich_components/cad90d50377b1e8f4f3694a3575f1548447c51dd/tests/__init__.py -------------------------------------------------------------------------------- /tests/requirements.txt: -------------------------------------------------------------------------------- 1 | # Packages needed to run the tests. 2 | # Switch into a virtual environment 3 | # pip install -r requirements.txt 4 | 5 | dash[dev,testing]>=1.3.1 6 | -------------------------------------------------------------------------------- /tests/test_usage.py: -------------------------------------------------------------------------------- 1 | from dash.testing.application_runners import import_app 2 | 3 | 4 | # Basic test for the component rendering. 5 | # The dash_duo pytest fixture is installed with dash (v1.0+) 6 | def test_render_component(dash_duo): 7 | # Start a dash app contained as the variable `app` in `usage.py` 8 | app = import_app('usage') 9 | dash_duo.start_server(app) 10 | 11 | # Get the generated component input with selenium 12 | # The html input will be a children of the #input dash component 13 | my_component = dash_duo.find_element('#input > input') 14 | 15 | assert 'my-value' == my_component.get_attribute('value') 16 | 17 | # Clear the input 18 | dash_duo.clear_input(my_component) 19 | 20 | # Send keys to the custom input. 21 | my_component.send_keys('Hello dash') 22 | 23 | # Wait for the text to equal, if after the timeout (default 10 seconds) 24 | # the text is not equal it will fail the test. 25 | dash_duo.wait_for_text_to_equal('#output', 'You have entered Hello dash') 26 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const packagejson = require('./package.json'); 3 | 4 | const dashLibraryName = packagejson.name.replace(/-/g, '_'); 5 | 6 | module.exports = (env, argv) => { 7 | 8 | let mode; 9 | 10 | const overrides = module.exports || {}; 11 | 12 | // if user specified mode flag take that value 13 | if (argv && argv.mode) { 14 | mode = argv.mode; 15 | } 16 | 17 | // else if configuration object is already set (module.exports) use that value 18 | else if (overrides.mode) { 19 | mode = overrides.mode; 20 | } 21 | 22 | // else take webpack default (production) 23 | else { 24 | mode = 'production'; 25 | } 26 | 27 | let filename = (overrides.output || {}).filename; 28 | if (!filename) { 29 | const modeSuffix = mode === 'development' ? 'dev' : 'min'; 30 | filename = `${dashLibraryName}.${modeSuffix}.js`; 31 | } 32 | 33 | const entry = overrides.entry || { main: './src/lib/index.js' }; 34 | 35 | const devtool = overrides.devtool || 'source-map'; 36 | 37 | const externals = ('externals' in overrides) ? overrides.externals : ({ 38 | react: 'React', 39 | 'react-dom': 'ReactDOM', 40 | 'plotly.js': 'Plotly', 41 | 'prop-types': 'PropTypes', 42 | }); 43 | 44 | return { 45 | mode, 46 | entry, 47 | output: { 48 | path: path.resolve(__dirname, dashLibraryName), 49 | filename, 50 | library: dashLibraryName, 51 | libraryTarget: 'window', 52 | }, 53 | devtool, 54 | externals, 55 | module: { 56 | rules: [ 57 | { 58 | test: /\.jsx?$/, 59 | exclude: /node_modules/, 60 | use: { 61 | loader: 'babel-loader', 62 | }, 63 | }, 64 | { 65 | test: /\.css$/, 66 | use: [ 67 | { 68 | loader: 'style-loader', 69 | options: { 70 | insertAt: 'top' 71 | } 72 | }, 73 | { 74 | loader: 'css-loader', 75 | }, 76 | ], 77 | }, 78 | { 79 | test: /\.s[ac]ss$/i, 80 | use: [ 81 | // Creates `style` nodes from JS strings 82 | 'style-loader', 83 | // Translates CSS into CommonJS 84 | 'css-loader', 85 | // Compiles Sass to CSS 86 | 'sass-loader', 87 | ], 88 | }, 89 | { 90 | test: /\.(woff(2)?|ttf|otf|eot|svg|gif)(\?v=\d+\.\d+\.\d+)?$/, 91 | use: [{ 92 | loader: 'file-loader', 93 | options: { 94 | name: '[name].[ext]', 95 | outputPath: 'fonts/' 96 | } 97 | }] 98 | } 99 | ], 100 | }, 101 | } 102 | }; 103 | -------------------------------------------------------------------------------- /webpack.serve.config.js: -------------------------------------------------------------------------------- 1 | const config = require('./webpack.config.js'); 2 | const path = require('path'); 3 | 4 | config.entry = {main: './src/demo/index.js'}; 5 | config.output = { 6 | filename: './output.js', 7 | path: path.resolve(__dirname), 8 | }; 9 | config.mode = 'development'; 10 | config.externals = undefined; // eslint-disable-line 11 | config.devtool = 'inline-source-map'; 12 | module.exports = config; 13 | --------------------------------------------------------------------------------