├── .eslintrc.js ├── .gitignore ├── .prettierrc.js ├── .storybook ├── dist │ ├── data │ │ ├── cities │ │ │ ├── ak.json │ │ │ ├── al.json │ │ │ ├── ar.json │ │ │ ├── az.json │ │ │ ├── ca.json │ │ │ ├── co.json │ │ │ ├── ct.json │ │ │ ├── de.json │ │ │ ├── fl.json │ │ │ ├── ga.json │ │ │ ├── ia.json │ │ │ ├── id.json │ │ │ ├── il.json │ │ │ ├── in.json │ │ │ ├── ks.json │ │ │ ├── ky.json │ │ │ ├── la.json │ │ │ ├── ma.json │ │ │ ├── md.json │ │ │ ├── me.json │ │ │ ├── mi.json │ │ │ ├── mn.json │ │ │ ├── mo.json │ │ │ ├── ms.json │ │ │ ├── mt.json │ │ │ ├── nc.json │ │ │ ├── nd.json │ │ │ ├── ne.json │ │ │ ├── nh.json │ │ │ ├── nj.json │ │ │ ├── nm.json │ │ │ ├── nv.json │ │ │ ├── ny.json │ │ │ ├── oh.json │ │ │ ├── ok.json │ │ │ ├── or.json │ │ │ ├── pa.json │ │ │ ├── readme.md │ │ │ ├── ri.json │ │ │ ├── sc.json │ │ │ ├── sd.json │ │ │ ├── tn.json │ │ │ ├── tx.json │ │ │ ├── ut.json │ │ │ ├── va.json │ │ │ ├── vt.json │ │ │ ├── wa.json │ │ │ ├── wi.json │ │ │ ├── wv.json │ │ │ └── wy.json │ │ ├── countries-by-continents.json │ │ ├── countries.json │ │ ├── genres.json │ │ ├── states-and-cities.json │ │ ├── states.json │ │ └── states2.json │ ├── favicon.ico │ ├── iframe.html │ ├── index.html │ ├── main.622f986c16fc951daaa2.bundle.js │ ├── main.fb86199444dcc768501f.bundle.js │ ├── main.fb86199444dcc768501f.bundle.js.map │ ├── runtime~main.286b69a873d49f2f199c.bundle.js │ ├── runtime~main.fb86199444dcc768501f.bundle.js │ ├── runtime~main.fb86199444dcc768501f.bundle.js.map │ ├── sb_dll │ │ ├── storybook_ui-manifest.json │ │ ├── storybook_ui_dll.LICENCE │ │ └── storybook_ui_dll.js │ ├── static │ │ └── media │ │ │ ├── dog.bee52b1c.png │ │ │ ├── folder-green.bde66c33.png │ │ │ └── menu-background.f999cff5.jpg │ ├── vendors~main.6ea528c75272c55d0ee9.bundle.js │ ├── vendors~main.fb86199444dcc768501f.bundle.js │ ├── vendors~main.fb86199444dcc768501f.bundle.js.LICENSE.txt │ └── vendors~main.fb86199444dcc768501f.bundle.js.map ├── main.js ├── preview.js └── yourTheme.js ├── LICENSE ├── README.md ├── dist ├── LICENSE ├── README.md ├── deni-react-treeview-1.1.11.tgz ├── libs │ ├── components │ │ ├── deni-react-treeview-item │ │ │ ├── DeniReactTreeViewItem.d.ts │ │ │ ├── DeniReactTreeViewItemProps.d.ts │ │ │ ├── DeniReactTreeviewItemConsts.d.ts │ │ │ ├── DeniReactTreeviewItemHelper.d.ts │ │ │ └── action-buttons │ │ │ │ ├── ActionButtons.d.ts │ │ │ │ ├── ActionButtonsProps.d.ts │ │ │ │ └── index.d.ts │ │ ├── deni-react-treeview │ │ │ ├── DeniReactTreeView.d.ts │ │ │ ├── DeniReactTreeviewApi.d.ts │ │ │ ├── DeniReactTreeviewApiImpl.d.ts │ │ │ ├── DeniReactTreeviewConsts.d.ts │ │ │ ├── DeniReactTreeviewHelper.d.ts │ │ │ └── DeniReactTreeviewProps.d.ts │ │ └── index.d.ts │ ├── examples │ │ ├── ExampleUnderConstruction.d.ts │ │ ├── api │ │ │ ├── AddItemAndSubitemApi │ │ │ │ └── index.d.ts │ │ │ └── RemoveItemApi │ │ │ │ └── index.d.ts │ │ ├── binding │ │ │ ├── ToAJavaScriptObject │ │ │ │ └── index.d.ts │ │ │ ├── ToALocalJson │ │ │ │ └── index.d.ts │ │ │ ├── ToARemoteJson │ │ │ │ └── index.d.ts │ │ │ └── ToARemoteJsonInLazyLoad │ │ │ │ └── index.d.ts │ │ ├── events │ │ │ ├── OnAfterLoadEvent │ │ │ │ └── index.d.ts │ │ │ ├── OnBeforeLoadEvent │ │ │ │ └── index.d.ts │ │ │ ├── OnRenderItemEvent │ │ │ │ └── index.d.ts │ │ │ └── OnSelectItemEvent │ │ │ │ └── index.d.ts │ │ ├── options │ │ │ ├── ActionButtonsOption │ │ │ │ └── index.d.ts │ │ │ ├── AutoLoadFalseOption │ │ │ │ └── index.d.ts │ │ │ ├── LazyLoadTrueOption │ │ │ │ └── index.d.ts │ │ │ ├── MarginItemsOption │ │ │ │ └── index.d.ts │ │ │ ├── SelectRowOption │ │ │ │ └── index.d.ts │ │ │ ├── ShowCheckboxOption │ │ │ │ └── index.d.ts │ │ │ ├── ShowIconOption │ │ │ │ └── index.d.ts │ │ │ ├── ShowRootOption │ │ │ │ └── index.d.ts │ │ │ └── ThemeOption │ │ │ │ └── index.d.ts │ │ └── theming │ │ │ ├── CustomizedTheme │ │ │ └── index.d.ts │ │ │ └── PredefinedThemes │ │ │ └── index.d.ts │ ├── index.d.ts │ ├── lib.cjs.js │ ├── lib.cjs.js.map │ ├── lib.esm.js │ ├── lib.esm.js.map │ ├── lib.umd.js │ └── lib.umd.js.map ├── package.json └── styles │ ├── style-base.scss │ └── themes │ ├── base-theme.scss │ ├── classic-theme.scss │ ├── green-theme.scss │ ├── icons-theme.scss │ ├── metro-theme.scss │ ├── moonlight-theme.scss │ ├── orange-theme.scss │ ├── purple-theme.scss │ ├── red-theme.scss │ └── silver-theme.scss ├── jest.config.js ├── mocks └── styleMock.js ├── package.json ├── rollup.config.js ├── scripts ├── postBuild.js └── publishNPM.sh ├── src ├── assets │ └── data │ │ ├── cities │ │ ├── ak.json │ │ ├── al.json │ │ ├── ar.json │ │ ├── az.json │ │ ├── ca.json │ │ ├── co.json │ │ ├── ct.json │ │ ├── de.json │ │ ├── fl.json │ │ ├── ga.json │ │ ├── ia.json │ │ ├── id.json │ │ ├── il.json │ │ ├── in.json │ │ ├── ks.json │ │ ├── ky.json │ │ ├── la.json │ │ ├── ma.json │ │ ├── md.json │ │ ├── me.json │ │ ├── mi.json │ │ ├── mn.json │ │ ├── mo.json │ │ ├── ms.json │ │ ├── mt.json │ │ ├── nc.json │ │ ├── nd.json │ │ ├── ne.json │ │ ├── nh.json │ │ ├── nj.json │ │ ├── nm.json │ │ ├── nv.json │ │ ├── ny.json │ │ ├── oh.json │ │ ├── ok.json │ │ ├── or.json │ │ ├── pa.json │ │ ├── readme.md │ │ ├── ri.json │ │ ├── sc.json │ │ ├── sd.json │ │ ├── tn.json │ │ ├── tx.json │ │ ├── ut.json │ │ ├── va.json │ │ ├── vt.json │ │ ├── wa.json │ │ ├── wi.json │ │ ├── wv.json │ │ └── wy.json │ │ ├── countries-by-continents.json │ │ ├── countries.json │ │ ├── dogs.json │ │ ├── genres.json │ │ ├── states-and-cities.json │ │ ├── states.json │ │ └── states2.json ├── components │ ├── deni-react-treeview-item │ │ ├── DeniReactTreeViewItem.scss │ │ ├── DeniReactTreeViewItem.tsx │ │ ├── DeniReactTreeViewItemProps.ts │ │ ├── DeniReactTreeviewItemConsts.ts │ │ ├── DeniReactTreeviewItemHelper.tsx │ │ └── action-buttons │ │ │ ├── ActionButtons.scss │ │ │ ├── ActionButtons.tsx │ │ │ ├── ActionButtonsProps.ts │ │ │ └── index.ts │ ├── deni-react-treeview │ │ ├── DeniReactTreeView.scss │ │ ├── DeniReactTreeView.tsx │ │ ├── DeniReactTreeviewApi.ts │ │ ├── DeniReactTreeviewApiImpl.ts │ │ ├── DeniReactTreeviewConsts.ts │ │ ├── DeniReactTreeviewHelper.ts │ │ └── DeniReactTreeviewProps.ts │ ├── index.ts │ └── styles │ │ ├── style-base.scss │ │ └── themes │ │ ├── base-theme.scss │ │ ├── classic-theme.scss │ │ ├── green-theme.scss │ │ ├── icons-theme.scss │ │ ├── metro-theme.scss │ │ ├── moonlight-theme.scss │ │ ├── orange-theme.scss │ │ ├── purple-theme.scss │ │ ├── red-theme.scss │ │ └── silver-theme.scss ├── examples │ ├── ExampleUnderConstruction.tsx │ ├── api │ │ ├── AddItemAndSubitemApi │ │ │ ├── index.tsx │ │ │ └── source.md │ │ ├── RemoveItemApi │ │ │ ├── index.tsx │ │ │ └── source.md │ │ └── api.stories.tsx │ ├── binding │ │ ├── ToAJavaScriptObject │ │ │ ├── index.tsx │ │ │ └── source.md │ │ ├── ToALocalJson │ │ │ ├── index.tsx │ │ │ └── source.md │ │ ├── ToARemoteJson │ │ │ ├── index.tsx │ │ │ └── source.md │ │ ├── ToARemoteJsonInLazyLoad │ │ │ ├── index.tsx │ │ │ └── source.md │ │ └── binding.stories.tsx │ ├── events │ │ ├── OnAfterLoadEvent │ │ │ ├── index.tsx │ │ │ └── source.md │ │ ├── OnBeforeLoadEvent │ │ │ ├── index.tsx │ │ │ └── source.md │ │ ├── OnRenderItemEvent │ │ │ ├── OnRenderItemEvent.scss │ │ │ ├── index.tsx │ │ │ └── source.md │ │ ├── OnSelectItemEvent │ │ │ ├── index.tsx │ │ │ └── source.md │ │ └── events.stories.tsx │ ├── options │ │ ├── ActionButtonsOption │ │ │ ├── index.tsx │ │ │ └── source.md │ │ ├── AutoLoadFalseOption │ │ │ ├── index.tsx │ │ │ └── source.md │ │ ├── LazyLoadTrueOption │ │ │ ├── index.tsx │ │ │ └── source.md │ │ ├── MarginItemsOption │ │ │ ├── index.tsx │ │ │ └── source.md │ │ ├── SelectRowOption │ │ │ ├── index.tsx │ │ │ └── source.md │ │ ├── ShowCheckboxOption │ │ │ ├── index.tsx │ │ │ └── source.md │ │ ├── ShowIconOption │ │ │ ├── index.tsx │ │ │ └── source.md │ │ ├── ShowRootOption │ │ │ ├── index.tsx │ │ │ └── source.md │ │ ├── ThemeOption │ │ │ ├── index.tsx │ │ │ └── source.md │ │ └── options.stories.tsx │ └── theming │ │ ├── CustomizedTheme │ │ ├── images │ │ │ ├── dog.png │ │ │ ├── folder-green.png │ │ │ └── menu-background.jpg │ │ ├── index.tsx │ │ ├── source.md │ │ └── theming-customizations.scss │ │ ├── PredefinedThemes │ │ ├── index.tsx │ │ └── source.md │ │ └── theming.stories.tsx └── index.ts ├── stylelint.config.js ├── tsconfig.json └── yarn.lock /.eslintrc.js: -------------------------------------------------------------------------------- 1 | const rules = { 2 | ON: 2, 3 | OFF: 0, 4 | WARN: 1, 5 | }; 6 | 7 | module.exports = { 8 | parser: '@typescript-eslint/parser', 9 | plugins: ['react-hooks'], 10 | parserOptions: { 11 | ecmaVersion: 2018, 12 | ecmaFeatures: { 13 | jsx: true, 14 | }, 15 | sourceType: 'module', 16 | }, 17 | extends: [ 18 | 'plugin:@typescript-eslint/recommended', 19 | 'plugin:react/recommended', 20 | 'prettier/@typescript-eslint', 21 | ], 22 | rules: { 23 | '@typescript-eslint/camelcase': rules.OFF, 24 | '@typescript-eslint/explicit-function-return-type': rules.OFF, 25 | '@typescript-eslint/explicit-member-accessibility': rules.OFF, 26 | '@typescript-eslint/no-non-null-assertion': rules.OFF, 27 | '@typescript-eslint/no-unused-vars': rules.OFF, 28 | '@typescript-eslint/array-type': rules.OFF, 29 | '@typescript-eslint/no-explicit-any': rules.OFF, 30 | '@typescript-eslint/no-empty-interface': rules.OFF, 31 | '@typescript-eslint/no-empty-function': rules.OFF, 32 | '@typescript-eslint/no-use-before-define': rules.OFF, 33 | '@typescript-eslint/no-object-literal-type-assertion': rules.OFF, 34 | 'react/no-deprecated': rules.OFF, 35 | 'react/prop-types': rules.OFF, 36 | 'react-hooks/rules-of-hooks': rules.ON, 37 | 'react-hooks/exhaustive-deps': rules.WARN, 38 | 'prefer-spread': rules.WARN 39 | }, 40 | settings: { 41 | react: { 42 | version: 'detect', 43 | }, 44 | }, 45 | }; 46 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_STORE 2 | 3 | node_modules 4 | .rpt2_cache 5 | .cache 6 | .env* 7 | 8 | /coverage 9 | 10 | # Ignore npm/yarn debug log 11 | npm-debug.log 12 | yarn-error.log 13 | 14 | # storybook 15 | .out 16 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | singleQuote: true, 3 | tabWidth: 2, 4 | ignoreTranspilerName: false 5 | }; 6 | -------------------------------------------------------------------------------- /.storybook/dist/data/cities/mt.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "http://www.anacondamt.org/", 4 | "long": "-112.94", 5 | "name": "Anaconda", 6 | "state": { 7 | "name": "Montana", 8 | "abbreviation": "MT" 9 | }, 10 | "lat": "46.12" 11 | }, 12 | { 13 | "url": "http://www.ci.belgrade.mt.us/", 14 | "long": "-111.17", 15 | "name": "Belgrade", 16 | "state": { 17 | "name": "Montana", 18 | "abbreviation": "MT" 19 | }, 20 | "lat": "45.77" 21 | }, 22 | { 23 | "url": "http://ci.billings.mt.us/", 24 | "long": "-108.5", 25 | "name": "Billings", 26 | "state": { 27 | "name": "Montana", 28 | "abbreviation": "MT" 29 | }, 30 | "lat": "45.78" 31 | }, 32 | { 33 | "url": "http://www.bozeman.net/", 34 | "long": "-111.03", 35 | "name": "Bozeman", 36 | "state": { 37 | "name": "Montana", 38 | "abbreviation": "MT" 39 | }, 40 | "lat": "45.67" 41 | }, 42 | { 43 | "url": "http://co.silverbow.mt.us/", 44 | "long": "-112.53", 45 | "name": "Butte", 46 | "state": { 47 | "name": "Montana", 48 | "abbreviation": "MT" 49 | }, 50 | "lat": "46" 51 | }, 52 | { 53 | "url": "http://www.greatfallsmt.net/", 54 | "long": "-111.3", 55 | "name": "Great Falls", 56 | "state": { 57 | "name": "Montana", 58 | "abbreviation": "MT" 59 | }, 60 | "lat": "47.5" 61 | }, 62 | { 63 | "url": "http://www.cityofhamilton.net/", 64 | "long": "-114.16", 65 | "name": "Hamilton", 66 | "state": { 67 | "name": "Montana", 68 | "abbreviation": "MT" 69 | }, 70 | "lat": "46.24" 71 | }, 72 | { 73 | "url": "http://www.ci.havre.mt.us/", 74 | "long": "-109.68", 75 | "name": "Havre", 76 | "state": { 77 | "name": "Montana", 78 | "abbreviation": "MT" 79 | }, 80 | "lat": "48.54" 81 | }, 82 | { 83 | "url": "http://www.ci.helena.mt.us/", 84 | "long": "-112.03", 85 | "name": "Helena", 86 | "state": { 87 | "name": "Montana", 88 | "abbreviation": "MT" 89 | }, 90 | "lat": "46.59" 91 | }, 92 | { 93 | "url": "http://www.kalispell.com/", 94 | "long": "-114.31", 95 | "name": "Kalispell", 96 | "state": { 97 | "name": "Montana", 98 | "abbreviation": "MT" 99 | }, 100 | "lat": "48.19" 101 | }, 102 | { 103 | "url": "http://www.mylaurel.com/", 104 | "long": "-108.77", 105 | "name": "Laurel", 106 | "state": { 107 | "name": "Montana", 108 | "abbreviation": "MT" 109 | }, 110 | "lat": "45.66" 111 | }, 112 | { 113 | "url": "http://www.cityoflibby.com/", 114 | "long": "-115.55", 115 | "name": "Libby", 116 | "state": { 117 | "name": "Montana", 118 | "abbreviation": "MT" 119 | }, 120 | "lat": "48.38" 121 | }, 122 | { 123 | "url": "http://www.ci.missoula.mt.us/", 124 | "long": "-113.99", 125 | "name": "Missoula", 126 | "state": { 127 | "name": "Montana", 128 | "abbreviation": "MT" 129 | }, 130 | "lat": "46.87" 131 | }, 132 | { 133 | "url": "http://www.shelbymt.com/", 134 | "long": "-111.85", 135 | "name": "Shelby", 136 | "state": { 137 | "name": "Montana", 138 | "abbreviation": "MT" 139 | }, 140 | "lat": "48.5" 141 | } 142 | ] -------------------------------------------------------------------------------- /.storybook/dist/data/cities/nh.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "http://www.ci.nashua.nh.us/", 4 | "long": "-71.46", 5 | "name": "Nashua", 6 | "state": { 7 | "name": "New Hampshire", 8 | "abbreviation": "NH" 9 | }, 10 | "lat": "42.76" 11 | }, 12 | { 13 | "url": "http://www.cityofportsmouth.com/", 14 | "long": "-70.76", 15 | "name": "Portsmouth", 16 | "state": { 17 | "name": "New Hampshire", 18 | "abbreviation": "NH" 19 | }, 20 | "lat": "43.07" 21 | }, 22 | { 23 | "url": "http://www.rochesternh.net/", 24 | "long": "-70.97", 25 | "name": "Rochester", 26 | "state": { 27 | "name": "New Hampshire", 28 | "abbreviation": "NH" 29 | }, 30 | "lat": "43.3" 31 | }, 32 | { 33 | "url": "http://www.somersworth.com/", 34 | "long": "-70.86", 35 | "name": "Somersworth", 36 | "state": { 37 | "name": "New Hampshire", 38 | "abbreviation": "NH" 39 | }, 40 | "lat": "43.26" 41 | }, 42 | { 43 | "url": "http://www.berlinnh.gov/", 44 | "long": "-71.18", 45 | "name": "Berlin", 46 | "state": { 47 | "name": "New Hampshire", 48 | "abbreviation": "NH" 49 | }, 50 | "lat": "44.46" 51 | }, 52 | { 53 | "url": "http://www.claremontnh.com/", 54 | "long": "-72.34", 55 | "name": "Claremont", 56 | "state": { 57 | "name": "New Hampshire", 58 | "abbreviation": "NH" 59 | }, 60 | "lat": "43.37" 61 | }, 62 | { 63 | "url": "http://www.ci.concord.nh.us/", 64 | "long": "-71.53", 65 | "name": "Concord", 66 | "state": { 67 | "name": "New Hampshire", 68 | "abbreviation": "NH" 69 | }, 70 | "lat": "43.2" 71 | }, 72 | { 73 | "url": "http://www.ci.dover.nh.us/", 74 | "long": "-70.87", 75 | "name": "Dover", 76 | "state": { 77 | "name": "New Hampshire", 78 | "abbreviation": "NH" 79 | }, 80 | "lat": "43.19" 81 | }, 82 | { 83 | "url": "http://www.ci.keene.nh.us/", 84 | "long": "-72.27", 85 | "name": "Keene", 86 | "state": { 87 | "name": "New Hampshire", 88 | "abbreviation": "NH" 89 | }, 90 | "lat": "42.93" 91 | }, 92 | { 93 | "url": "http://www.cityoflaconianh.org/", 94 | "long": "-71.47", 95 | "name": "Laconia", 96 | "state": { 97 | "name": "New Hampshire", 98 | "abbreviation": "NH" 99 | }, 100 | "lat": "43.52" 101 | }, 102 | { 103 | "url": "http://www.lebnh.net/", 104 | "long": "-72.25", 105 | "name": "Lebanon", 106 | "state": { 107 | "name": "New Hampshire", 108 | "abbreviation": "NH" 109 | }, 110 | "lat": "43.64" 111 | }, 112 | { 113 | "url": "http://www.manchesternh.gov/", 114 | "long": "-71.45", 115 | "name": "Manchester", 116 | "state": { 117 | "name": "New Hampshire", 118 | "abbreviation": "NH" 119 | }, 120 | "lat": "42.99" 121 | } 122 | ] -------------------------------------------------------------------------------- /.storybook/dist/data/cities/nv.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "http://www.bcnv.org/", 4 | "long": "-114.83", 5 | "name": "Boulder City", 6 | "state": { 7 | "name": "Nevada", 8 | "abbreviation": "NV" 9 | }, 10 | "lat": "35.97" 11 | }, 12 | { 13 | "url": "http://explorecarlinnv.com/", 14 | "long": "-116.1", 15 | "name": "Carlin", 16 | "state": { 17 | "name": "Nevada", 18 | "abbreviation": "NV" 19 | }, 20 | "lat": "40.71" 21 | }, 22 | { 23 | "url": "http://www.carson-city.nv.us/", 24 | "long": "-119.76", 25 | "name": "Carson City", 26 | "state": { 27 | "name": "Nevada", 28 | "abbreviation": "NV" 29 | }, 30 | "lat": "39.16" 31 | }, 32 | { 33 | "url": "http://www.ci.elko.nv.us/", 34 | "long": "-115.76", 35 | "name": "Elko", 36 | "state": { 37 | "name": "Nevada", 38 | "abbreviation": "NV" 39 | }, 40 | "lat": "40.83" 41 | }, 42 | { 43 | "url": "http://www.cityoffallon.org/", 44 | "long": "-118.77", 45 | "name": "Fallon", 46 | "state": { 47 | "name": "Nevada", 48 | "abbreviation": "NV" 49 | }, 50 | "lat": "39.47" 51 | }, 52 | { 53 | "url": "http://www.cityofhenderson.com/", 54 | "long": "-114.98", 55 | "name": "Henderson", 56 | "state": { 57 | "name": "Nevada", 58 | "abbreviation": "NV" 59 | }, 60 | "lat": "36.03" 61 | }, 62 | { 63 | "url": "http://www.lasvegasnevada.gov/", 64 | "long": "-115.13", 65 | "name": "Las Vegas", 66 | "state": { 67 | "name": "Nevada", 68 | "abbreviation": "NV" 69 | }, 70 | "lat": "36.17" 71 | }, 72 | { 73 | "url": "http://www.mesquitenv.com/", 74 | "long": "-114.06", 75 | "name": "Mesquite", 76 | "state": { 77 | "name": "Nevada", 78 | "abbreviation": "NV" 79 | }, 80 | "lat": "36.8" 81 | }, 82 | { 83 | "url": "http://www.cityofnorthlasvegas.com/", 84 | "long": "-115.11", 85 | "name": "North Las Vegas", 86 | "state": { 87 | "name": "Nevada", 88 | "abbreviation": "NV" 89 | }, 90 | "lat": "36.19" 91 | }, 92 | { 93 | "url": "http://www.reno.gov/", 94 | "long": "-119.81", 95 | "name": "Reno", 96 | "state": { 97 | "name": "Nevada", 98 | "abbreviation": "NV" 99 | }, 100 | "lat": "39.52" 101 | }, 102 | { 103 | "url": "http://www.ci.sparks.nv.us/", 104 | "long": "-119.75", 105 | "name": "Sparks", 106 | "state": { 107 | "name": "Nevada", 108 | "abbreviation": "NV" 109 | }, 110 | "lat": "39.53" 111 | }, 112 | { 113 | "url": "http://www.westwendovercity.com/", 114 | "long": "-114.07", 115 | "name": "West Wendover", 116 | "state": { 117 | "name": "Nevada", 118 | "abbreviation": "NV" 119 | }, 120 | "lat": "40.73" 121 | }, 122 | { 123 | "url": "http://www.yerington.net/", 124 | "long": "-119.16", 125 | "name": "Yerington", 126 | "state": { 127 | "name": "Nevada", 128 | "abbreviation": "NV" 129 | }, 130 | "lat": "38.98" 131 | } 132 | ] -------------------------------------------------------------------------------- /.storybook/dist/data/cities/readme.md: -------------------------------------------------------------------------------- 1 | by http://api.sba.gov/doc/ 2 | -------------------------------------------------------------------------------- /.storybook/dist/data/cities/ri.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "http://www.centralfallsri.us/", 4 | "long": "-71.39", 5 | "name": "Central Falls", 6 | "state": { 7 | "name": "Rhode Island", 8 | "abbreviation": "RI" 9 | }, 10 | "lat": "41.89" 11 | }, 12 | { 13 | "url": "http://www.cranstonri.com/", 14 | "long": "-71.43", 15 | "name": "Cranston", 16 | "state": { 17 | "name": "Rhode Island", 18 | "abbreviation": "RI" 19 | }, 20 | "lat": "41.77" 21 | }, 22 | { 23 | "url": "http://www.eastprovidenceri.net/", 24 | "long": "-71.37", 25 | "name": "East Providence", 26 | "state": { 27 | "name": "Rhode Island", 28 | "abbreviation": "RI" 29 | }, 30 | "lat": "41.81" 31 | }, 32 | { 33 | "url": "http://www.cityofnewport.com/", 34 | "long": "-71.31", 35 | "name": "Newport", 36 | "state": { 37 | "name": "Rhode Island", 38 | "abbreviation": "RI" 39 | }, 40 | "lat": "41.49" 41 | }, 42 | { 43 | "url": "http://www.pawtucketri.com/", 44 | "long": "-71.38", 45 | "name": "Pawtucket", 46 | "state": { 47 | "name": "Rhode Island", 48 | "abbreviation": "RI" 49 | }, 50 | "lat": "41.87" 51 | }, 52 | { 53 | "url": "http://www.providenceri.com/", 54 | "long": "-71.41", 55 | "name": "Providence", 56 | "state": { 57 | "name": "Rhode Island", 58 | "abbreviation": "RI" 59 | }, 60 | "lat": "41.82" 61 | }, 62 | { 63 | "url": "http://www.warwickri.gov/", 64 | "long": "-71.41", 65 | "name": "Warwick", 66 | "state": { 67 | "name": "Rhode Island", 68 | "abbreviation": "RI" 69 | }, 70 | "lat": "41.7" 71 | }, 72 | { 73 | "url": "http://www.ci.woonsocket.ri.us/", 74 | "long": "-71.51", 75 | "name": "Woonsocket", 76 | "state": { 77 | "name": "Rhode Island", 78 | "abbreviation": "RI" 79 | }, 80 | "lat": "42" 81 | } 82 | ] -------------------------------------------------------------------------------- /.storybook/dist/data/cities/vt.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "http://www.ci.burlington.vt.us/", 4 | "long": "-73.21", 5 | "name": "Burlington", 6 | "state": { 7 | "name": "Vermont", 8 | "abbreviation": "VT" 9 | }, 10 | "lat": "44.47" 11 | }, 12 | { 13 | "url": "http://www.essexjunction.org/", 14 | "long": "-73.11", 15 | "name": "Essex Junction", 16 | "state": { 17 | "name": "Vermont", 18 | "abbreviation": "VT" 19 | }, 20 | "lat": "44.49" 21 | }, 22 | { 23 | "url": "http://townofjohnson.com/", 24 | "long": "-72.68", 25 | "name": "Johnson", 26 | "state": { 27 | "name": "Vermont", 28 | "abbreviation": "VT" 29 | }, 30 | "lat": "44.63" 31 | }, 32 | { 33 | "url": "http://www.ludlow.vt.us/", 34 | "long": "-72.7", 35 | "name": "Ludlow", 36 | "state": { 37 | "name": "Vermont", 38 | "abbreviation": "VT" 39 | }, 40 | "lat": "43.39" 41 | }, 42 | { 43 | "url": "http://www.manchester-vt.gov/", 44 | "long": "-73.07", 45 | "name": "Manchester", 46 | "state": { 47 | "name": "Vermont", 48 | "abbreviation": "VT" 49 | }, 50 | "lat": "43.16" 51 | }, 52 | { 53 | "url": "http://www.montpelier-vt.org/", 54 | "long": "-72.57", 55 | "name": "Montpelier", 56 | "state": { 57 | "name": "Vermont", 58 | "abbreviation": "VT" 59 | }, 60 | "lat": "44.26" 61 | }, 62 | { 63 | "url": "http://www.newfanevt.com/", 64 | "long": "-72.65", 65 | "name": "Newfane", 66 | "state": { 67 | "name": "Vermont", 68 | "abbreviation": "VT" 69 | }, 70 | "lat": "42.98" 71 | }, 72 | { 73 | "url": "http://www.newportvermont.org/", 74 | "long": "-72.2", 75 | "name": "Newport", 76 | "state": { 77 | "name": "Vermont", 78 | "abbreviation": "VT" 79 | }, 80 | "lat": "44.93" 81 | }, 82 | { 83 | "url": "http://rutland.govoffice.com/", 84 | "long": "-72.97", 85 | "name": "Rutland", 86 | "state": { 87 | "name": "Vermont", 88 | "abbreviation": "VT" 89 | }, 90 | "lat": "43.61" 91 | }, 92 | { 93 | "url": "http://www.sburl.com/", 94 | "long": "-73.17", 95 | "name": "South Burlington", 96 | "state": { 97 | "name": "Vermont", 98 | "abbreviation": "VT" 99 | }, 100 | "lat": "44.46" 101 | }, 102 | { 103 | "url": "http://www.swanton.net/", 104 | "long": "-73.12", 105 | "name": "Swanton Village", 106 | "state": { 107 | "name": "Vermont", 108 | "abbreviation": "VT" 109 | }, 110 | "lat": "44.91" 111 | }, 112 | { 113 | "url": "http://www.vergennes.org/", 114 | "long": "-73.25", 115 | "name": "Vergennes", 116 | "state": { 117 | "name": "Vermont", 118 | "abbreviation": "VT" 119 | }, 120 | "lat": "44.16" 121 | }, 122 | { 123 | "url": "http://www.waterburyvt.com/", 124 | "long": "-72.75", 125 | "name": "Waterbury", 126 | "state": { 127 | "name": "Vermont", 128 | "abbreviation": "VT" 129 | }, 130 | "lat": "44.33" 131 | }, 132 | { 133 | "url": "http://www.barrecity.org/", 134 | "long": "-72.5", 135 | "name": "Barre", 136 | "state": { 137 | "name": "Vermont", 138 | "abbreviation": "VT" 139 | }, 140 | "lat": "44.19" 141 | }, 142 | { 143 | "url": "http://www.rockbf.org/", 144 | "long": "-72.44", 145 | "name": "Bellows Falls", 146 | "state": { 147 | "name": "Vermont", 148 | "abbreviation": "VT" 149 | }, 150 | "lat": "43.13" 151 | }, 152 | { 153 | "url": "http://www.onioncity.com/", 154 | "long": "-73.18", 155 | "name": "Winooski", 156 | "state": { 157 | "name": "Vermont", 158 | "abbreviation": "VT" 159 | }, 160 | "lat": "44.49" 161 | } 162 | ] -------------------------------------------------------------------------------- /.storybook/dist/data/cities/wv.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "http://www.parkersburg-wv.com/", 4 | "long": "-81.56", 5 | "name": "Parkersburg", 6 | "state": { 7 | "name": "West Virginia", 8 | "abbreviation": "WV" 9 | }, 10 | "lat": "39.26" 11 | }, 12 | { 13 | "url": "http://www.philippi.org/", 14 | "long": "-80.04", 15 | "name": "Philippi", 16 | "state": { 17 | "name": "West Virginia", 18 | "abbreviation": "WV" 19 | }, 20 | "lat": "39.15" 21 | }, 22 | { 23 | "url": "http://www.stalbanswv.com/", 24 | "long": "-81.83", 25 | "name": "Saint Albans", 26 | "state": { 27 | "name": "West Virginia", 28 | "abbreviation": "WV" 29 | }, 30 | "lat": "38.38" 31 | }, 32 | { 33 | "url": "http://www.shepherdstown.us/", 34 | "long": "-77.8", 35 | "name": "Shepherdstown", 36 | "state": { 37 | "name": "West Virginia", 38 | "abbreviation": "WV" 39 | }, 40 | "lat": "39.43" 41 | }, 42 | { 43 | "url": "http://www.shinnstonwv.com/", 44 | "long": "-80.3", 45 | "name": "Shinnston", 46 | "state": { 47 | "name": "West Virginia", 48 | "abbreviation": "WV" 49 | }, 50 | "lat": "39.39" 51 | }, 52 | { 53 | "url": "http://www.cityofspencer.com/", 54 | "long": "-81.35", 55 | "name": "Spencer", 56 | "state": { 57 | "name": "West Virginia", 58 | "abbreviation": "WV" 59 | }, 60 | "lat": "38.8" 61 | }, 62 | { 63 | "url": "http://www.cityofweirton.com/", 64 | "long": "-80.58", 65 | "name": "Weirton", 66 | "state": { 67 | "name": "West Virginia", 68 | "abbreviation": "WV" 69 | }, 70 | "lat": "40.41" 71 | }, 72 | { 73 | "url": "http://www.cityofwheelingwv.org/", 74 | "long": "-80.72", 75 | "name": "Wheeling", 76 | "state": { 77 | "name": "West Virginia", 78 | "abbreviation": "WV" 79 | }, 80 | "lat": "40.06" 81 | }, 82 | { 83 | "url": "http://www.beckley.org/", 84 | "long": "-81.18", 85 | "name": "Beckley", 86 | "state": { 87 | "name": "West Virginia", 88 | "abbreviation": "WV" 89 | }, 90 | "lat": "37.77" 91 | }, 92 | { 93 | "url": "http://www.cityofbluefield.com/", 94 | "long": "-81.22", 95 | "name": "Bluefield", 96 | "state": { 97 | "name": "West Virginia", 98 | "abbreviation": "WV" 99 | }, 100 | "lat": "37.26" 101 | }, 102 | { 103 | "url": "http://www.bridgeportwv.com/", 104 | "long": "-80.25", 105 | "name": "Bridgeport", 106 | "state": { 107 | "name": "West Virginia", 108 | "abbreviation": "WV" 109 | }, 110 | "lat": "39.28" 111 | }, 112 | { 113 | "url": "http://www.buckhannonwv.org", 114 | "long": "-80.23", 115 | "name": "Buckhannon", 116 | "state": { 117 | "name": "West Virginia", 118 | "abbreviation": "WV" 119 | }, 120 | "lat": "38.99" 121 | }, 122 | { 123 | "url": "http://www.cityofcharleston.org/", 124 | "long": "-81.63", 125 | "name": "Charleston", 126 | "state": { 127 | "name": "West Virginia", 128 | "abbreviation": "WV" 129 | }, 130 | "lat": "38.34" 131 | }, 132 | { 133 | "url": "http://www.clarksburg.com/", 134 | "long": "-80.34", 135 | "name": "Clarksburg", 136 | "state": { 137 | "name": "West Virginia", 138 | "abbreviation": "WV" 139 | }, 140 | "lat": "39.28" 141 | }, 142 | { 143 | "url": "http://www.cityofhuntington.com/", 144 | "long": "-82.44", 145 | "name": "Huntington", 146 | "state": { 147 | "name": "West Virginia", 148 | "abbreviation": "WV" 149 | }, 150 | "lat": "38.41" 151 | }, 152 | { 153 | "url": "http://www.lewisburg-wv.com/", 154 | "long": "-80.44", 155 | "name": "Lewisburg", 156 | "state": { 157 | "name": "West Virginia", 158 | "abbreviation": "WV" 159 | }, 160 | "lat": "37.8" 161 | }, 162 | { 163 | "url": "http://www.morgantown.com/", 164 | "long": "-79.95", 165 | "name": "Morgantown", 166 | "state": { 167 | "name": "West Virginia", 168 | "abbreviation": "WV" 169 | }, 170 | "lat": "39.62" 171 | }, 172 | { 173 | "url": "http://www.cityofweirton.com/", 174 | "long": "-80.58", 175 | "name": "Weirton", 176 | "state": { 177 | "name": "West Virginia", 178 | "abbreviation": "WV" 179 | }, 180 | "lat": "40.41" 181 | }, 182 | { 183 | "url": "http://www.cityofhuntington.com/", 184 | "long": "-82.44", 185 | "name": "Huntington", 186 | "state": { 187 | "name": "West Virginia", 188 | "abbreviation": "WV" 189 | }, 190 | "lat": "38.41" 191 | } 192 | ] -------------------------------------------------------------------------------- /.storybook/dist/data/cities/wy.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "http://www.casperwy.gov/", 4 | "long": "-106.31", 5 | "name": "Casper", 6 | "state": { 7 | "name": "Wyoming", 8 | "abbreviation": "WY" 9 | }, 10 | "lat": "42.86" 11 | }, 12 | { 13 | "url": "http://www.cheyennecity.org/", 14 | "long": "-104.82", 15 | "name": "Cheyenne", 16 | "state": { 17 | "name": "Wyoming", 18 | "abbreviation": "WY" 19 | }, 20 | "lat": "41.13" 21 | }, 22 | { 23 | "url": "http://www.cityofdouglaswy.com/", 24 | "long": "-105.38", 25 | "name": "Douglas", 26 | "state": { 27 | "name": "Wyoming", 28 | "abbreviation": "WY" 29 | }, 30 | "lat": "42.75" 31 | }, 32 | { 33 | "url": "http://www.evanstonwy.org/", 34 | "long": "-110.96", 35 | "name": "Evanston", 36 | "state": { 37 | "name": "Wyoming", 38 | "abbreviation": "WY" 39 | }, 40 | "lat": "41.26" 41 | }, 42 | { 43 | "url": "http://www.ci.gillette.wy.us/", 44 | "long": "-105.5", 45 | "name": "Gillette", 46 | "state": { 47 | "name": "Wyoming", 48 | "abbreviation": "WY" 49 | }, 50 | "lat": "44.29" 51 | }, 52 | { 53 | "url": "http://www.cityofgreenriver.org/", 54 | "long": "-109.46", 55 | "name": "Green River", 56 | "state": { 57 | "name": "Wyoming", 58 | "abbreviation": "WY" 59 | }, 60 | "lat": "41.52" 61 | }, 62 | { 63 | "url": "http://www.ci.jackson.wy.us/", 64 | "long": "-110.76", 65 | "name": "Jackson", 66 | "state": { 67 | "name": "Wyoming", 68 | "abbreviation": "WY" 69 | }, 70 | "lat": "43.47" 71 | }, 72 | { 73 | "url": "http://www.kemmerer.org/", 74 | "long": "-110.53", 75 | "name": "Kemmerer", 76 | "state": { 77 | "name": "Wyoming", 78 | "abbreviation": "WY" 79 | }, 80 | "lat": "41.79" 81 | }, 82 | { 83 | "url": "http://www.ci.laramie.wy.us/", 84 | "long": "-105.59", 85 | "name": "Laramie", 86 | "state": { 87 | "name": "Wyoming", 88 | "abbreviation": "WY" 89 | }, 90 | "lat": "41.31" 91 | }, 92 | { 93 | "url": "http://lyman.govoffice.com/", 94 | "long": "-110.29", 95 | "name": "Lyman", 96 | "state": { 97 | "name": "Wyoming", 98 | "abbreviation": "WY" 99 | }, 100 | "lat": "41.32" 101 | }, 102 | { 103 | "url": "http://www.rawlins-wyoming.com/", 104 | "long": "-107.23", 105 | "name": "Rawlins", 106 | "state": { 107 | "name": "Wyoming", 108 | "abbreviation": "WY" 109 | }, 110 | "lat": "41.79" 111 | }, 112 | { 113 | "url": "http://www.riverton.wyoming.com/", 114 | "long": "-108.38", 115 | "name": "Riverton", 116 | "state": { 117 | "name": "Wyoming", 118 | "abbreviation": "WY" 119 | }, 120 | "lat": "43.02" 121 | }, 122 | { 123 | "url": "http://www.rswy.net/", 124 | "long": "-109.2", 125 | "name": "Rock Springs", 126 | "state": { 127 | "name": "Wyoming", 128 | "abbreviation": "WY" 129 | }, 130 | "lat": "41.58" 131 | }, 132 | { 133 | "url": "http://www.saratoga.govoffice2.com/", 134 | "long": "-106.8", 135 | "name": "Saratoga", 136 | "state": { 137 | "name": "Wyoming", 138 | "abbreviation": "WY" 139 | }, 140 | "lat": "41.45" 141 | }, 142 | { 143 | "url": "http://www.city-sheridan-wy.com/", 144 | "long": "-106.95", 145 | "name": "Sheridan", 146 | "state": { 147 | "name": "Wyoming", 148 | "abbreviation": "WY" 149 | }, 150 | "lat": "44.79" 151 | }, 152 | { 153 | "url": "http://www.thayne-wy.com/", 154 | "long": "-111", 155 | "name": "Thayne", 156 | "state": { 157 | "name": "Wyoming", 158 | "abbreviation": "WY" 159 | }, 160 | "lat": "42.92" 161 | }, 162 | { 163 | "url": "http://www.city-of-torrington.org/", 164 | "long": "-104.18", 165 | "name": "Torrington", 166 | "state": { 167 | "name": "Wyoming", 168 | "abbreviation": "WY" 169 | }, 170 | "lat": "42.06" 171 | }, 172 | { 173 | "url": "http://www.cityofworland.org/", 174 | "long": "-107.95", 175 | "name": "Worland", 176 | "state": { 177 | "name": "Wyoming", 178 | "abbreviation": "WY" 179 | }, 180 | "lat": "44.01" 181 | }, 182 | { 183 | "url": "http://www.wrightwyoming.com/", 184 | "long": "-105.47", 185 | "name": "Wright", 186 | "state": { 187 | "name": "Wyoming", 188 | "abbreviation": "WY" 189 | }, 190 | "lat": "43.74" 191 | } 192 | ] -------------------------------------------------------------------------------- /.storybook/dist/data/genres.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 28, 4 | "text": "Action" 5 | }, 6 | { 7 | "id": 12, 8 | "text": "Adventure" 9 | }, 10 | { 11 | "id": 16, 12 | "text": "Animation" 13 | }, 14 | { 15 | "id": 35, 16 | "text": "Comedy" 17 | }, 18 | { 19 | "id": 80, 20 | "text": "Crime" 21 | }, 22 | { 23 | "id": 99, 24 | "text": "Documentary" 25 | }, 26 | { 27 | "id": 18, 28 | "text": "Drama" 29 | }, 30 | { 31 | "id": 10751, 32 | "text": "Family" 33 | }, 34 | { 35 | "id": 14, 36 | "text": "Fantasy" 37 | }, 38 | { 39 | "id": 36, 40 | "text": "History" 41 | }, 42 | { 43 | "id": 27, 44 | "text": "Horror" 45 | }, 46 | { 47 | "id": 10402, 48 | "text": "Music" 49 | }, 50 | { 51 | "id": 9648, 52 | "text": "Mystery" 53 | }, 54 | { 55 | "id": 10749, 56 | "text": "Romance" 57 | }, 58 | { 59 | "id": 878, 60 | "text": "Science Fiction" 61 | }, 62 | { 63 | "id": 10770, 64 | "text": "TV Movie" 65 | }, 66 | { 67 | "id": 53, 68 | "text": "Thriller" 69 | }, 70 | { 71 | "id": 10752, 72 | "text": "War" 73 | }, 74 | { 75 | "id": 37, 76 | "text": "Western" 77 | } 78 | ] 79 | -------------------------------------------------------------------------------- /.storybook/dist/data/states.json: -------------------------------------------------------------------------------- 1 | /* 2 | by http://api.sba.gov/doc/ 3 | */ 4 | 5 | [ 6 | { 7 | "name": "Alabama", 8 | "abbreviation": "AL" 9 | }, 10 | { 11 | "name": "Alaska", 12 | "abbreviation": "AK" 13 | }, 14 | { 15 | "name": "Arizona", 16 | "abbreviation": "AZ" 17 | }, 18 | { 19 | "name": "Arkansas", 20 | "abbreviation": "AR" 21 | }, 22 | { 23 | "name": "California", 24 | "abbreviation": "CA" 25 | }, 26 | { 27 | "name": "Colorado", 28 | "abbreviation": "CO" 29 | }, 30 | { 31 | "name": "Connecticut", 32 | "abbreviation": "CT" 33 | }, 34 | { 35 | "name": "Delaware", 36 | "abbreviation": "DE" 37 | }, 38 | { 39 | "name": "Florida", 40 | "abbreviation": "FL" 41 | }, 42 | { 43 | "name": "Georgia", 44 | "abbreviation": "GA" 45 | }, 46 | { 47 | "name": "Idaho", 48 | "abbreviation": "ID" 49 | }, 50 | { 51 | "name": "Illinois", 52 | "abbreviation": "IL" 53 | }, 54 | { 55 | "name": "Indiana", 56 | "abbreviation": "IN" 57 | }, 58 | { 59 | "name": "Iowa", 60 | "abbreviation": "IA" 61 | }, 62 | { 63 | "name": "Kansas", 64 | "abbreviation": "KS" 65 | }, 66 | { 67 | "name": "Kentucky", 68 | "abbreviation": "KY" 69 | }, 70 | { 71 | "name": "Louisiana", 72 | "abbreviation": "LA" 73 | }, 74 | { 75 | "name": "Maine", 76 | "abbreviation": "ME" 77 | }, 78 | { 79 | "name": "Maryland", 80 | "abbreviation": "MD" 81 | }, 82 | { 83 | "name": "Massachusetts", 84 | "abbreviation": "MA" 85 | }, 86 | { 87 | "name": "Michigan", 88 | "abbreviation": "MI" 89 | }, 90 | { 91 | "name": "Minnesota", 92 | "abbreviation": "MN" 93 | }, 94 | { 95 | "name": "Mississippi", 96 | "abbreviation": "MS" 97 | }, 98 | { 99 | "name": "Missouri", 100 | "abbreviation": "MO" 101 | }, 102 | { 103 | "name": "Montana", 104 | "abbreviation": "MT" 105 | }, 106 | { 107 | "name": "Nebraska", 108 | "abbreviation": "NE" 109 | }, 110 | { 111 | "name": "Nevada", 112 | "abbreviation": "NV" 113 | }, 114 | { 115 | "name": "New Hampshire", 116 | "abbreviation": "NH" 117 | }, 118 | { 119 | "name": "New Jersey", 120 | "abbreviation": "NJ" 121 | }, 122 | { 123 | "name": "New Mexico", 124 | "abbreviation": "NM" 125 | }, 126 | { 127 | "name": "New York", 128 | "abbreviation": "NY" 129 | }, 130 | { 131 | "name": "North Carolina", 132 | "abbreviation": "NC" 133 | }, 134 | { 135 | "name": "North Dakota", 136 | "abbreviation": "ND" 137 | }, 138 | { 139 | "name": "Ohio", 140 | "abbreviation": "OH" 141 | }, 142 | { 143 | "name": "Oklahoma", 144 | "abbreviation": "OK" 145 | }, 146 | { 147 | "name": "Oregon", 148 | "abbreviation": "OR" 149 | }, 150 | { 151 | "name": "Pennsylvania", 152 | "abbreviation": "PA" 153 | }, 154 | { 155 | "name": "Rhode Island", 156 | "abbreviation": "RI" 157 | }, 158 | { 159 | "name": "South Carolina", 160 | "abbreviation": "SC" 161 | }, 162 | { 163 | "name": "South Dakota", 164 | "abbreviation": "SD" 165 | }, 166 | { 167 | "name": "Tennessee", 168 | "abbreviation": "TN" 169 | }, 170 | { 171 | "name": "Texas", 172 | "abbreviation": "TX" 173 | }, 174 | { 175 | "name": "Utah", 176 | "abbreviation": "UT" 177 | }, 178 | { 179 | "name": "Vermont", 180 | "abbreviation": "VT" 181 | }, 182 | { 183 | "name": "Virginia", 184 | "abbreviation": "VA" 185 | }, 186 | { 187 | "name": "Washington", 188 | "abbreviation": "WA" 189 | }, 190 | { 191 | "name": "West Virginia", 192 | "abbreviation": "WV" 193 | }, 194 | { 195 | "name": "Wisconsin", 196 | "abbreviation": "WI" 197 | }, 198 | { 199 | "name": "Wyoming", 200 | "abbreviation": "WY" 201 | } 202 | ] 203 | -------------------------------------------------------------------------------- /.storybook/dist/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denimar/deni-react-treeview/a157c9a39f13065465df9512f51e39083658954a/.storybook/dist/favicon.ico -------------------------------------------------------------------------------- /.storybook/dist/iframe.html: -------------------------------------------------------------------------------- 1 | Storybook

No Preview

Sorry, but you either have no stories or none are selected somehow.

If the problem persists, check the browser console, or the terminal you've run Storybook from.

-------------------------------------------------------------------------------- /.storybook/dist/index.html: -------------------------------------------------------------------------------- 1 | Storybook
-------------------------------------------------------------------------------- /.storybook/dist/main.622f986c16fc951daaa2.bundle.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[0],{415:function(n,o,p){p(416),p(563),n.exports=p(1259)},480:function(n,o){}},[[415,1,2]]]); -------------------------------------------------------------------------------- /.storybook/dist/main.fb86199444dcc768501f.bundle.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"main.fb86199444dcc768501f.bundle.js","sources":["webpack:///main.fb86199444dcc768501f.bundle.js"],"mappings":"AAAA","sourceRoot":""} -------------------------------------------------------------------------------- /.storybook/dist/runtime~main.286b69a873d49f2f199c.bundle.js: -------------------------------------------------------------------------------- 1 | !function(e){function r(r){for(var n,l,f=r[0],i=r[1],a=r[2],c=0,s=[];c 40 | * 41 | * Copyright (c) 2014-2017, Jon Schlinkert. 42 | * Released under the MIT License. 43 | */ 44 | 45 | /** 46 | * @license 47 | * Lodash 48 | * Copyright OpenJS Foundation and other contributors 49 | * Released under MIT license 50 | * Based on Underscore.js 1.8.3 51 | * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 52 | */ 53 | 54 | /** @license React v0.18.0 55 | * scheduler.production.min.js 56 | * 57 | * Copyright (c) Facebook, Inc. and its affiliates. 58 | * 59 | * This source code is licensed under the MIT license found in the 60 | * LICENSE file in the root directory of this source tree. 61 | */ 62 | 63 | /** @license React v16.12.0 64 | * react-dom.production.min.js 65 | * 66 | * Copyright (c) Facebook, Inc. and its affiliates. 67 | * 68 | * This source code is licensed under the MIT license found in the 69 | * LICENSE file in the root directory of this source tree. 70 | */ 71 | 72 | /** @license React v16.12.0 73 | * react-is.production.min.js 74 | * 75 | * Copyright (c) Facebook, Inc. and its affiliates. 76 | * 77 | * This source code is licensed under the MIT license found in the 78 | * LICENSE file in the root directory of this source tree. 79 | */ 80 | 81 | /** @license React v16.12.0 82 | * react.production.min.js 83 | * 84 | * Copyright (c) Facebook, Inc. and its affiliates. 85 | * 86 | * This source code is licensed under the MIT license found in the 87 | * LICENSE file in the root directory of this source tree. 88 | */ 89 | 90 | /**! 91 | * @fileOverview Kickass library to create and place poppers near their reference elements. 92 | * @version 1.16.1 93 | * @license 94 | * Copyright (c) 2016 Federico Zivolo and contributors 95 | * 96 | * Permission is hereby granted, free of charge, to any person obtaining a copy 97 | * of this software and associated documentation files (the "Software"), to deal 98 | * in the Software without restriction, including without limitation the rights 99 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 100 | * copies of the Software, and to permit persons to whom the Software is 101 | * furnished to do so, subject to the following conditions: 102 | * 103 | * The above copyright notice and this permission notice shall be included in all 104 | * copies or substantial portions of the Software. 105 | * 106 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 107 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 108 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 109 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 110 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 111 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 112 | * SOFTWARE. 113 | */ 114 | -------------------------------------------------------------------------------- /.storybook/dist/static/media/dog.bee52b1c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denimar/deni-react-treeview/a157c9a39f13065465df9512f51e39083658954a/.storybook/dist/static/media/dog.bee52b1c.png -------------------------------------------------------------------------------- /.storybook/dist/static/media/folder-green.bde66c33.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denimar/deni-react-treeview/a157c9a39f13065465df9512f51e39083658954a/.storybook/dist/static/media/folder-green.bde66c33.png -------------------------------------------------------------------------------- /.storybook/dist/static/media/menu-background.f999cff5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denimar/deni-react-treeview/a157c9a39f13065465df9512f51e39083658954a/.storybook/dist/static/media/menu-background.f999cff5.jpg -------------------------------------------------------------------------------- /.storybook/dist/vendors~main.fb86199444dcc768501f.bundle.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /* 2 | object-assign 3 | (c) Sindre Sorhus 4 | @license MIT 5 | */ 6 | 7 | /*! 8 | * https://github.com/es-shims/es5-shim 9 | * @license es5-shim Copyright 2009-2020 by contributors, MIT License 10 | * see https://github.com/es-shims/es5-shim/blob/master/LICENSE 11 | */ 12 | 13 | /*! 14 | * https://github.com/paulmillr/es6-shim 15 | * @license es6-shim Copyright 2013-2016 by Paul Miller (http://paulmillr.com) 16 | * and contributors, MIT License 17 | * es6-shim: v0.35.4 18 | * see https://github.com/paulmillr/es6-shim/blob/0.35.3/LICENSE 19 | * Details and documentation: 20 | * https://github.com/paulmillr/es6-shim/ 21 | */ 22 | 23 | /*! 24 | * is-plain-object 25 | * 26 | * Copyright (c) 2014-2017, Jon Schlinkert. 27 | * Released under the MIT License. 28 | */ 29 | 30 | /*! 31 | * isobject 32 | * 33 | * Copyright (c) 2014-2017, Jon Schlinkert. 34 | * Released under the MIT License. 35 | */ 36 | 37 | /** @license React v0.19.1 38 | * scheduler.production.min.js 39 | * 40 | * Copyright (c) Facebook, Inc. and its affiliates. 41 | * 42 | * This source code is licensed under the MIT license found in the 43 | * LICENSE file in the root directory of this source tree. 44 | */ 45 | 46 | /** @license React v16.13.1 47 | * react-dom.production.min.js 48 | * 49 | * Copyright (c) Facebook, Inc. and its affiliates. 50 | * 51 | * This source code is licensed under the MIT license found in the 52 | * LICENSE file in the root directory of this source tree. 53 | */ 54 | 55 | /** @license React v16.13.1 56 | * react.production.min.js 57 | * 58 | * Copyright (c) Facebook, Inc. and its affiliates. 59 | * 60 | * This source code is licensed under the MIT license found in the 61 | * LICENSE file in the root directory of this source tree. 62 | */ 63 | 64 | //! stable.js 0.1.8, https://github.com/Two-Screen/stable 65 | 66 | //! © 2018 Angry Bytes and contributors. MIT licensed. 67 | -------------------------------------------------------------------------------- /.storybook/dist/vendors~main.fb86199444dcc768501f.bundle.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"vendors~main.fb86199444dcc768501f.bundle.js","sources":["webpack:///vendors~main.fb86199444dcc768501f.bundle.js"],"mappings":";AAAA","sourceRoot":""} -------------------------------------------------------------------------------- /.storybook/main.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | module.exports = { 4 | addons: [ 5 | '@storybook/addon-notes/register' 6 | ], 7 | stories: ['../src/examples/**/*.stories.tsx'], 8 | webpackFinal: async (config, par1, par2, par3) => { 9 | // add typescript support 10 | config.module.rules.push({ 11 | test: /\.(ts|tsx)$/, 12 | use: [ 13 | { 14 | loader: require.resolve('ts-loader') 15 | }, 16 | { 17 | loader: require.resolve('@storybook/source-loader'), 18 | options: { parser: 'typescript' }, 19 | }, 20 | ], 21 | }); 22 | 23 | config.resolve.extensions.push('.ts', '.tsx'); 24 | 25 | // add scss support 26 | config.module.rules.push({ 27 | test: /\.scss$/, 28 | use: ['style-loader', 'css-loader', 'sass-loader'], 29 | include: path.resolve(__dirname, '../'), 30 | }); 31 | 32 | return config; 33 | }, 34 | }; -------------------------------------------------------------------------------- /.storybook/preview.js: -------------------------------------------------------------------------------- 1 | import { addParameters } from '@storybook/react'; 2 | 3 | addParameters({ 4 | options: { 5 | storySort: (a, b) => 6 | a[1].kind === b[1].kind ? 0 : a[1].id.localeCompare(b[1].id, undefined, { numeric: true }), 7 | }, 8 | }); 9 | 10 | -------------------------------------------------------------------------------- /.storybook/yourTheme.js: -------------------------------------------------------------------------------- 1 | import { create } from '@storybook/theming/create'; 2 | 3 | export default create({ 4 | base: 'light', 5 | 6 | // colorPrimary: 'hotpink', 7 | // colorSecondary: 'deepskyblue', 8 | 9 | // // UI 10 | // appBg: 'white', 11 | // appContentBg: 'silver', 12 | // appBorderColor: 'grey', 13 | // appBorderRadius: 4, 14 | 15 | // // Typography 16 | // fontBase: '"Open Sans", sans-serif', 17 | // fontCode: 'monospace', 18 | 19 | // // Text colors 20 | // textColor: 'black', 21 | // textInverseColor: 'rgba(255,255,255,0.9)', 22 | 23 | // // Toolbar default and active colors 24 | // barTextColor: 'silver', 25 | // barSelectedColor: 'black', 26 | // barBg: 'hotpink', 27 | 28 | // // Form colors 29 | // inputBg: 'white', 30 | // inputBorder: 'silver', 31 | // inputTextColor: 'black', 32 | // inputBorderRadius: 4, 33 | 34 | brandTitle: 'by Denimar de Moraes', 35 | brandUrl: 'https://www.linkedin.com/in/denimar-moraes/?locale=en_US', 36 | brandImage: 'https://placehold.it/350x150', 37 | }); -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # deni-react-treeview 2 | A modern, themable and configurable treeview for React 3 | 4 | 5 | [live examples](https://deni-react-treeview.vercel.app/) 6 | 7 | 8 | ![alt text](https://denimar.github.io/deni-react-treeview/images/deni-react-treeview.png) 9 | 10 | 11 | TODO: Implement unit tests, E2E tests, CI. 12 | 13 | ## Installing with NPM 14 | 15 | npm install deni-react-treeview --save 16 | 17 | ## Usage 18 | 19 | Added to your react component 20 | ```html 21 | 22 | ``` 23 | For more details: [examples](https://deni-react-treeview.vercel.app/) 24 | 25 | ## API 26 | [documentation](https://denimar.github.io/deni-react-treeview/api.html) 27 | 28 | ## Features 29 | * Cross-Browser. 30 | * Binding to a JSON (locally, remotely and lazy-load) 31 | * Predefined Themes 32 | * Theme Customization 33 | * Events 34 | * Checkboxes 35 | * And so on... 36 | 37 | ## Properties 38 | * autoLoad ```(boolean)``` 39 | * lazyLoad ```(boolean)``` 40 | * marginItems ```(integer)``` 41 | * selectRow ```(boolean)``` 42 | * showCheckbox ```(boolean)``` 43 | * showIcon ```(boolean)``` 44 | * showRoot ```(boolean)``` 45 | * theme ```(string)``` 46 | 47 | ## Events 48 | * OnRenderItem 49 | * onBeforeLoad 50 | * onAfterLoad 51 | * onSelectItem 52 | * onExpanded 53 | * onColapsed 54 | * onLazyLoad 55 | * onCheckItem 56 | 57 | #### json example 58 | 59 | ```javascript 60 | [ 61 | { 62 | id: 100, 63 | text: 'Fruits', 64 | children: [ 65 | { 66 | id: 101, 67 | text: 'Orange', 68 | isLeaf: true 69 | }, 70 | { 71 | id: 102, 72 | text: 'Banana', 73 | isLeaf: true 74 | } 75 | ] 76 | }, 77 | { 78 | id: 200, 79 | text: 'Vegetables', 80 | children: [ 81 | { 82 | id: 201, 83 | text: 'Carrot', 84 | isLeaf: true 85 | }, 86 | { 87 | id: 202, 88 | text: 'Tomato', 89 | isLeaf: true 90 | } 91 | ] 92 | } 93 | ] 94 | ``` 95 | 96 | ## License 97 | 98 | [MIT.](https://raw.githubusercontent.com/denimar/deni-react-treeview/develop/LICENSE-MIT) 99 | 100 | ## Author 101 | 102 | [Denimar de Moraes](http://github.com/denimar) (denimar@gmail.com) is a full-stack developper at Feracode, Florianópolis, Santa Catarina, Brazil. 103 | 104 | [](https://www.linkedin.com/in/denimar-moraes/?locale=en_US) 105 | -------------------------------------------------------------------------------- /dist/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /dist/README.md: -------------------------------------------------------------------------------- 1 | # deni-react-treeview 2 | A modern, themable and configurable treeview for React 3 | 4 | 5 | [live examples](https://deni-react-treeview.vercel.app/) 6 | 7 | 8 | ![alt text](https://denimar.github.io/deni-react-treeview/images/deni-react-treeview.png) 9 | 10 | 11 | TODO: Implement unit tests, E2E tests, CI. 12 | 13 | ## Installing with NPM 14 | 15 | npm install deni-react-treeview --save 16 | 17 | ## Usage 18 | 19 | Added to your react component 20 | ```html 21 | 22 | ``` 23 | For more details: [examples](https://deni-react-treeview.vercel.app/) 24 | 25 | ## API 26 | [documentation](https://denimar.github.io/deni-react-treeview/api.html) 27 | 28 | ## Features 29 | * Cross-Browser. 30 | * Binding to a JSON (locally, remotely and lazy-load) 31 | * Predefined Themes 32 | * Theme Customization 33 | * Events 34 | * Checkboxes 35 | * And so on... 36 | 37 | ## Properties 38 | * autoLoad ```(boolean)``` 39 | * lazyLoad ```(boolean)``` 40 | * marginItems ```(integer)``` 41 | * selectRow ```(boolean)``` 42 | * showCheckbox ```(boolean)``` 43 | * showIcon ```(boolean)``` 44 | * showRoot ```(boolean)``` 45 | * theme ```(string)``` 46 | 47 | ## Events 48 | * OnRenderItem 49 | * onBeforeLoad 50 | * onAfterLoad 51 | * onSelectItem 52 | * onExpanded 53 | * onColapsed 54 | * onLazyLoad 55 | * onCheckItem 56 | 57 | #### json example 58 | 59 | ```javascript 60 | [ 61 | { 62 | id: 100, 63 | text: 'Fruits', 64 | children: [ 65 | { 66 | id: 101, 67 | text: 'Orange', 68 | isLeaf: true 69 | }, 70 | { 71 | id: 102, 72 | text: 'Banana', 73 | isLeaf: true 74 | } 75 | ] 76 | }, 77 | { 78 | id: 200, 79 | text: 'Vegetables', 80 | children: [ 81 | { 82 | id: 201, 83 | text: 'Carrot', 84 | isLeaf: true 85 | }, 86 | { 87 | id: 202, 88 | text: 'Tomato', 89 | isLeaf: true 90 | } 91 | ] 92 | } 93 | ] 94 | ``` 95 | 96 | ## License 97 | 98 | [MIT.](https://raw.githubusercontent.com/denimar/deni-react-treeview/develop/LICENSE-MIT) 99 | 100 | ## Author 101 | 102 | [Denimar de Moraes](http://github.com/denimar) (denimar@gmail.com) is a full-stack developper at Feracode, Florianópolis, Santa Catarina, Brazil. 103 | 104 | [](https://www.linkedin.com/in/denimar-moraes/?locale=en_US) 105 | -------------------------------------------------------------------------------- /dist/deni-react-treeview-1.1.11.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denimar/deni-react-treeview/a157c9a39f13065465df9512f51e39083658954a/dist/deni-react-treeview-1.1.11.tgz -------------------------------------------------------------------------------- /dist/libs/components/deni-react-treeview-item/DeniReactTreeViewItem.d.ts: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import './DeniReactTreeViewItem.scss'; 3 | import { DeniReactTreeviewItemProps } from './DeniReactTreeViewItemProps'; 4 | declare class DeniReactTreeViewItem extends React.Component { 5 | constructor(props: any); 6 | render(): JSX.Element; 7 | } 8 | export default DeniReactTreeViewItem; 9 | -------------------------------------------------------------------------------- /dist/libs/components/deni-react-treeview-item/DeniReactTreeViewItemProps.d.ts: -------------------------------------------------------------------------------- 1 | import DeniReactTreeView from '../deni-react-treeview/DeniReactTreeView'; 2 | export interface DeniReactTreeviewItemProps { 3 | treeview: DeniReactTreeView; 4 | item: number; 5 | parent?: any; 6 | level: number; 7 | root?: any; 8 | selectRow?: boolean; 9 | expandAll?: boolean; 10 | } 11 | -------------------------------------------------------------------------------- /dist/libs/components/deni-react-treeview-item/DeniReactTreeviewItemConsts.d.ts: -------------------------------------------------------------------------------- 1 | export declare const CHECKBOX_STATE: { 2 | CHECKED: number; 3 | UNCHECKED: number; 4 | UNDETERMINED: number; 5 | }; 6 | -------------------------------------------------------------------------------- /dist/libs/components/deni-react-treeview-item/DeniReactTreeviewItemHelper.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import DeniReactTreeView from '../deni-react-treeview/DeniReactTreeView'; 3 | declare const getClassItem: (treeview: any, item: any, level: any, selectRow: any) => string; 4 | declare const getClassIcon: (treeview: any, item: any) => string; 5 | declare const getClassExpandButton: (treeview: any, treeviewItem: any, item: any) => string; 6 | declare const getClassCheckbox: (treeview: any, item: any) => string; 7 | declare const getClassIconAndText: (treeview: any, item: any, selectRow: any) => string; 8 | declare const getInnerText: (treeview: DeniReactTreeView, item: any) => JSX.Element; 9 | declare const treeviewItemContainerDoubleClick: (treeviewItemExpandButtonMouseDown: any, treeview: any, selectRow: any, event: any) => void; 10 | declare const treeviewItemContainerMouseDown: (treeview: any, item: any, selectRow: any, event: any) => void; 11 | declare const treeviewItemExpandButtonMouseDown: (treeview: any, treeviewItem: any, item: any) => void; 12 | declare const treeviewItemCheckboxMouseDown: (treeviewItem: any, item: any) => void; 13 | export { getClassItem, getClassIcon, getClassExpandButton, getClassCheckbox, getClassIconAndText, getInnerText, treeviewItemContainerDoubleClick, treeviewItemContainerMouseDown, treeviewItemExpandButtonMouseDown, treeviewItemCheckboxMouseDown }; 14 | -------------------------------------------------------------------------------- /dist/libs/components/deni-react-treeview-item/action-buttons/ActionButtons.d.ts: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import './ActionButtons.scss'; 3 | import { ActionButtonsProps } from './ActionButtonsProps'; 4 | declare class ActionButtons extends React.Component { 5 | constructor(props: any); 6 | onClick(item: any, actionButton: any): void; 7 | render(): JSX.Element; 8 | } 9 | export default ActionButtons; 10 | -------------------------------------------------------------------------------- /dist/libs/components/deni-react-treeview-item/action-buttons/ActionButtonsProps.d.ts: -------------------------------------------------------------------------------- 1 | export interface ActionButtonsProps { 2 | buttons: any[]; 3 | item: any; 4 | onActionButtonClick?: (item: any, actionButton: any) => void; 5 | } 6 | -------------------------------------------------------------------------------- /dist/libs/components/deni-react-treeview-item/action-buttons/index.d.ts: -------------------------------------------------------------------------------- 1 | import ActionButtons from './ActionButtons'; 2 | export default ActionButtons; 3 | -------------------------------------------------------------------------------- /dist/libs/components/deni-react-treeview/DeniReactTreeView.d.ts: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import './DeniReactTreeView.scss'; 3 | import { DeniReactTreeviewProps } from './DeniReactTreeviewProps'; 4 | interface DeniReactTreeviewState { 5 | loading: boolean; 6 | theme: string; 7 | expandAll?: boolean; 8 | } 9 | declare class DeniReactTreeView extends React.Component { 10 | api: any; 11 | container: any; 12 | constructor(props: DeniReactTreeviewProps); 13 | componentDidUpdate(prevProps: any, prevState: any): void; 14 | componentDidMount(): void; 15 | expandAllFinished(): void; 16 | render(): JSX.Element; 17 | } 18 | export default DeniReactTreeView; 19 | -------------------------------------------------------------------------------- /dist/libs/components/deni-react-treeview/DeniReactTreeviewApi.d.ts: -------------------------------------------------------------------------------- 1 | declare const deniReactTreeviewApi: (scope: any) => { 2 | addItem: (text: any, isLeaf: any, parentNode: any) => { 3 | text: any; 4 | children: never[]; 5 | isLeaf: any; 6 | }; 7 | findFolder: (folderToFind: any) => any; 8 | expandAll: () => void; 9 | findNode: (nodeToFind: any) => any; 10 | findItem: (itemToFind: any) => any; 11 | getItems: () => any; 12 | getParentNode: (item: any) => any; 13 | getRootItem: () => any; 14 | getSelectedItem: () => any; 15 | load: (item: any) => Promise; 16 | loadData: (treeview: any, data: any, item: any) => void; 17 | removeItem: (id: any) => void; 18 | selectItem: (itemToFind: any) => void; 19 | setTheme: (newTheme: any) => void; 20 | }; 21 | export { deniReactTreeviewApi }; 22 | -------------------------------------------------------------------------------- /dist/libs/components/deni-react-treeview/DeniReactTreeviewApiImpl.d.ts: -------------------------------------------------------------------------------- 1 | declare class DeniReactTreeviewApiImpl { 2 | static addItem: (scope: any, text: any, isLeaf: any, parentNode: any) => { 3 | text: any; 4 | children: never[]; 5 | isLeaf: any; 6 | }; 7 | static findFolder: (scope: any, folderToFind: any) => any; 8 | static findItem: (scope: any, itemToFind: any) => any; 9 | static findNode: (scope: any, nodeToFind: any) => any; 10 | static expandAll: (scope: any) => void; 11 | static getItems: (scope: any) => any; 12 | static getParentNode: (scope: any, item: any) => any; 13 | static getRootItem: (scope: any) => any; 14 | static getSelectedItem: (scope: any) => any; 15 | static removeItem: (scope: any, id: any) => void; 16 | static selectItem: (scope: any, itemToFind: any) => void; 17 | } 18 | export default DeniReactTreeviewApiImpl; 19 | -------------------------------------------------------------------------------- /dist/libs/components/deni-react-treeview/DeniReactTreeviewConsts.d.ts: -------------------------------------------------------------------------------- 1 | export declare const ROOT_ITEM: { 2 | id: number; 3 | text: string; 4 | expanded: boolean; 5 | root: boolean; 6 | }; 7 | -------------------------------------------------------------------------------- /dist/libs/components/deni-react-treeview/DeniReactTreeviewHelper.d.ts: -------------------------------------------------------------------------------- 1 | declare const loadingSetup: (treeview: any) => void; 2 | declare const setTheme: (treeview: any, newTheme: any) => void; 3 | declare const load: (treeview: any, item: any) => Promise; 4 | declare const loadData: (treeview: any, data: any, item: any) => void; 5 | export { loadingSetup, setTheme, load, loadData }; 6 | -------------------------------------------------------------------------------- /dist/libs/components/deni-react-treeview/DeniReactTreeviewProps.d.ts: -------------------------------------------------------------------------------- 1 | import { CSSProperties } from "react"; 2 | import DeniReactTreeView from "./DeniReactTreeView"; 3 | export interface DeniReactTreeviewProps { 4 | className?: string; 5 | style?: CSSProperties; 6 | actionButtons?: JSX.Element[]; 7 | autoLoad?: boolean; 8 | json?: string; 9 | items?: any[]; 10 | lazyLoad?: boolean; 11 | expandAll?: boolean; 12 | marginItems?: string | number; 13 | onAfterLoad?: (data: any, item: any) => void; 14 | onBeforeLoad?: (data: any, item: any) => void; 15 | onRenderItem?: (item: any, treeview: DeniReactTreeView) => JSX.Element; 16 | onSelectItem?: (item: any) => void; 17 | onCheckItem?: void; 18 | selectRow?: boolean; 19 | showCheckbox?: boolean; 20 | showIcon?: boolean; 21 | showRoot?: boolean; 22 | theme?: string; 23 | url?: string; 24 | onActionButtonClick?: (item: any, actionButton: any) => void; 25 | } 26 | -------------------------------------------------------------------------------- /dist/libs/components/index.d.ts: -------------------------------------------------------------------------------- 1 | import DeniReactTreeView from './deni-react-treeview/DeniReactTreeView'; 2 | export default DeniReactTreeView; 3 | -------------------------------------------------------------------------------- /dist/libs/examples/ExampleUnderConstruction.d.ts: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | declare const ExampleUnderConstruction: React.FC; 3 | export default ExampleUnderConstruction; 4 | -------------------------------------------------------------------------------- /dist/libs/examples/api/AddItemAndSubitemApi/index.d.ts: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | declare const AddItemAndSubitemApi: React.FC; 3 | export default AddItemAndSubitemApi; 4 | -------------------------------------------------------------------------------- /dist/libs/examples/api/RemoveItemApi/index.d.ts: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | declare const RemoveItemApi: React.FC; 3 | export default RemoveItemApi; 4 | -------------------------------------------------------------------------------- /dist/libs/examples/binding/ToAJavaScriptObject/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | declare const ToAJavaScriptObject: () => JSX.Element; 3 | export default ToAJavaScriptObject; 4 | -------------------------------------------------------------------------------- /dist/libs/examples/binding/ToALocalJson/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | declare const ToALocalJson: () => JSX.Element; 3 | export default ToALocalJson; 4 | -------------------------------------------------------------------------------- /dist/libs/examples/binding/ToARemoteJson/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | declare const ToARemoteJson: () => JSX.Element; 3 | export default ToARemoteJson; 4 | -------------------------------------------------------------------------------- /dist/libs/examples/binding/ToARemoteJsonInLazyLoad/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | declare const ToARemoteJsonInLazyLoad: () => JSX.Element; 3 | export default ToARemoteJsonInLazyLoad; 4 | -------------------------------------------------------------------------------- /dist/libs/examples/events/OnAfterLoadEvent/index.d.ts: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | declare const OnAfterLoadEvent: React.FC; 3 | export default OnAfterLoadEvent; 4 | -------------------------------------------------------------------------------- /dist/libs/examples/events/OnBeforeLoadEvent/index.d.ts: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | declare const OnBeforeLoadEvent: React.FC; 3 | export default OnBeforeLoadEvent; 4 | -------------------------------------------------------------------------------- /dist/libs/examples/events/OnRenderItemEvent/index.d.ts: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import './OnRenderItemEvent.scss'; 3 | declare const OnRenderItemEvent: React.FC; 4 | export default OnRenderItemEvent; 5 | -------------------------------------------------------------------------------- /dist/libs/examples/events/OnSelectItemEvent/index.d.ts: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | declare const OnSelectItemEvent: React.FC; 3 | export default OnSelectItemEvent; 4 | -------------------------------------------------------------------------------- /dist/libs/examples/options/ActionButtonsOption/index.d.ts: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | declare const ActionButtonsOption: React.FC; 3 | export default ActionButtonsOption; 4 | -------------------------------------------------------------------------------- /dist/libs/examples/options/AutoLoadFalseOption/index.d.ts: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | declare const AutoLoadFalseOption: React.FC; 3 | export default AutoLoadFalseOption; 4 | -------------------------------------------------------------------------------- /dist/libs/examples/options/LazyLoadTrueOption/index.d.ts: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | declare const LazyLoadTrueOption: React.FC; 3 | export default LazyLoadTrueOption; 4 | -------------------------------------------------------------------------------- /dist/libs/examples/options/MarginItemsOption/index.d.ts: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | declare const MarginItemsOption: React.FC; 3 | export default MarginItemsOption; 4 | -------------------------------------------------------------------------------- /dist/libs/examples/options/SelectRowOption/index.d.ts: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | declare const SelectRowOption: React.FC; 3 | export default SelectRowOption; 4 | -------------------------------------------------------------------------------- /dist/libs/examples/options/ShowCheckboxOption/index.d.ts: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | declare const ShowCheckboxOption: React.FC; 3 | export default ShowCheckboxOption; 4 | -------------------------------------------------------------------------------- /dist/libs/examples/options/ShowIconOption/index.d.ts: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | declare const ShowIconOption: React.FC; 3 | export default ShowIconOption; 4 | -------------------------------------------------------------------------------- /dist/libs/examples/options/ShowRootOption/index.d.ts: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | declare const ShowRootOption: React.FC; 3 | export default ShowRootOption; 4 | -------------------------------------------------------------------------------- /dist/libs/examples/options/ThemeOption/index.d.ts: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | declare const ThemeOption: React.FC; 3 | export default ThemeOption; 4 | -------------------------------------------------------------------------------- /dist/libs/examples/theming/CustomizedTheme/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import './theming-customizations.scss'; 3 | declare const CustomeziedTheme: () => JSX.Element; 4 | export default CustomeziedTheme; 5 | -------------------------------------------------------------------------------- /dist/libs/examples/theming/PredefinedThemes/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | declare const PredefinedThemes: () => JSX.Element; 3 | export default PredefinedThemes; 4 | -------------------------------------------------------------------------------- /dist/libs/index.d.ts: -------------------------------------------------------------------------------- 1 | import DeniReactTreeView from './components/deni-react-treeview/DeniReactTreeView'; 2 | export default DeniReactTreeView; 3 | -------------------------------------------------------------------------------- /dist/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "deni-react-treeview", 3 | "license": "MIT", 4 | "version": "1.1.11", 5 | "private": false, 6 | "author": "Denimar de Moraes ", 7 | "description": "A modern, themable and configurable treeview for React.", 8 | "homepage": "https://github.com/denimar/deni-react-treeview", 9 | "bugs": { 10 | "url": "https://github.com/denimar/deni-react-treeview/issues" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git@github.com:denimar/deni-react-treeview.git" 15 | }, 16 | "scripts": { 17 | "build": "yarn clean; rollup -c; yarn postBuild", 18 | "postBuild": "node ./scripts/postBuild", 19 | "clean": "rimraf dist", 20 | "dev": "yarn storybook", 21 | "format": "prettier --write \"src/**/*.{ts,tsx,json,js,jsx}\"", 22 | "format:check": "prettier --list-different \"src/**/*.{ts,tsx,json,js,jsx}\"", 23 | "lint": "yarn lint:script && yarn lint:style", 24 | "lint:script": "eslint --ext js --ext jsx --ext ts --ext tsx src", 25 | "lint:style": "stylelint src", 26 | "npm:publish": "./scripts/publishNPM.sh", 27 | "storybook": "start-storybook -p 9001 -s ./src/assets -c .storybook", 28 | "storybook:build": "build-storybook -c .storybook -o .storybook/dist -s src/assets", 29 | "test": "jest --maxWorkers=2", 30 | "test:watch": "yarn test --watch", 31 | "test:coverage": "jest --coverage --colors --maxWorkers=2" 32 | }, 33 | "main": "libs/lib.cjs.js", 34 | "module": "libs/lib.esm.js", 35 | "browser": "libs/lib.umd.js", 36 | "types": "index.d.ts", 37 | "dependencies": { 38 | "@storybook/addon-notes": "^5.3.19", 39 | "axios": "^0.19.2", 40 | "classnames": "^2.2.6", 41 | "react": "^16.13.1", 42 | "react-dom": "^16.13.1", 43 | "react-icons": "^3.10.0" 44 | }, 45 | "peerDependencies": { 46 | "classnames": "^2.2.6", 47 | "react": "^16.13.1" 48 | }, 49 | "devDependencies": { 50 | "@babel/core": "^7.9.0", 51 | "@rollup/plugin-commonjs": "^11.1.0", 52 | "@storybook/addon-storysource": "^5.3.19", 53 | "@storybook/preset-typescript": "^3.0.0", 54 | "@storybook/react": "^5.3.18", 55 | "@testing-library/react": "^10.0.2", 56 | "@types/classnames": "^2.2.10", 57 | "@types/jest": "^25.2.1", 58 | "@types/node": "^10.12.18", 59 | "@types/react": "^16.9.34", 60 | "@types/react-dom": "^16.9.6", 61 | "@typescript-eslint/eslint-plugin": "^2.27.0", 62 | "@typescript-eslint/parser": "^2.27.0", 63 | "babel-loader": "^8.1.0", 64 | "css-loader": "^3.5.2", 65 | "eslint": "^6.8.0", 66 | "eslint-config-prettier": "^6.10.1", 67 | "eslint-plugin-prettier": "^3.1.2", 68 | "eslint-plugin-react": "^7.19.0", 69 | "eslint-plugin-react-hooks": "^3.0.0", 70 | "jest": "^25.3.0", 71 | "node-sass": "^4.13.1", 72 | "prettier": "^2.0.4", 73 | "rimraf": "^3.0.2", 74 | "rollup": "^2.6.0", 75 | "rollup-plugin-external-globals": "^0.5.0", 76 | "rollup-plugin-postcss": "^2.5.0", 77 | "rollup-plugin-terser": "^5.3.0", 78 | "rollup-plugin-typescript2": "^0.27.0", 79 | "sass-loader": "^8.0.2", 80 | "style-loader": "^1.1.3", 81 | "stylelint": "^13.3.2", 82 | "stylelint-config-standard": "^20.0.0", 83 | "stylelint-scss": "^3.16.1", 84 | "ts-jest": "^25.3.1", 85 | "ts-loader": "^6.2.2", 86 | "typescript": "^3.8.3", 87 | "webpack": "^4.42.1" 88 | }, 89 | "keywords": [ 90 | "react", 91 | "treeview", 92 | "tree-view", 93 | "tree", 94 | "view", 95 | "treenode", 96 | "tree-node", 97 | "deni-react-treeview" 98 | ] 99 | } -------------------------------------------------------------------------------- /dist/styles/style-base.scss: -------------------------------------------------------------------------------- 1 | $blue: #9DC2E1; 2 | $red: #ff8080; 3 | $green: #9ce2da; //#80ff80; 4 | $silver: #bfbfbf; 5 | $moonlight: #bfbfbf; 6 | $orange: #ffd280; 7 | $purple: #ff80ff; 8 | $metro: #b1b8cd; 9 | $base-color: $blue; 10 | 11 | @mixin unselectable { 12 | -webkit-touch-callout: none; /* iOS Safari */ 13 | -webkit-user-select: none; /* Chrome/Safari/Opera */ 14 | -khtml-user-select: none; /* Konqueror */ 15 | -moz-user-select: none; /* Firefox */ 16 | -ms-user-select: none; /* Internet Explorer/Edge */ 17 | user-select: none; /* Non-prefixed version, currently 18 | not supported by any browser */ 19 | } 20 | 21 | @mixin gradient-background ($end-color) { 22 | $selection-background-start-color: lighten($end-color, 20%); 23 | background: $selection-background-start-color; /* Old browsers */ 24 | background: -moz-linear-gradient(top, $selection-background-start-color 0%, $end-color 100%); /* FF3.6-15 */ 25 | background: -webkit-linear-gradient(top, $selection-background-start-color 0%,$end-color 100%); /* Chrome10-25,Safari5.1-6 */ 26 | background: linear-gradient(to bottom, $selection-background-start-color 0%, $end-color 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */ 27 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=$selection-background-start-color, endColorstr=$end-color,GradientType=0 ); /* IE6-9 */ 28 | } 29 | 30 | @mixin base-color($color: $blue) { 31 | $base-color: $color; 32 | } 33 | -------------------------------------------------------------------------------- /dist/styles/themes/base-theme.scss: -------------------------------------------------------------------------------- 1 | @import '../style-base.scss'; 2 | @import './icons-theme.scss'; 3 | 4 | @mixin set-theme($theme-base-color: $base-color) { 5 | $base-color: $theme-base-color; 6 | color: darken($base-color, 45%) !important; 7 | 8 | border-color: darken($base-color, 10%) !important; 9 | 10 | &:hover { 11 | &.select-row { 12 | background-color: lighten($base-color, 20%); 13 | } 14 | &:not(.select-row) { 15 | background-color: transparent; 16 | } 17 | } 18 | 19 | &.selected { 20 | @include gradient-background($base-color); 21 | outline-color: lighten($base-color, 10%) !important; 22 | } 23 | .checkbox { 24 | border-color: lighten($base-color, 4%) !important; 25 | &.selected { 26 | border-color: darken($base-color, 8%) !important; 27 | } 28 | } 29 | .expand-button { 30 | color: darken($base-color, 45%) !important; 31 | } 32 | 33 | .icon-and-text { 34 | &:hover { 35 | &.select-row { 36 | background-color: transparent; 37 | } 38 | &:not(.select-row) { 39 | background-color: lighten($base-color, 20%); 40 | } 41 | } 42 | &.select-row { 43 | border: 0; 44 | padding: 1px; 45 | } 46 | &.selected { 47 | @include gradient-background($base-color); 48 | } 49 | 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /dist/styles/themes/classic-theme.scss: -------------------------------------------------------------------------------- 1 | @import '../style-base.scss'; 2 | @import './base-theme.scss'; 3 | 4 | .deni-react-treeview-container.classic { 5 | border-color: lighten($blue, 2%); 6 | 7 | .deni-react-treeview-item-container.classic { 8 | @include set-theme($blue); 9 | 10 | .icon-and-text { 11 | .icon { 12 | background-image: $closed-folder-icon-blue-16; 13 | 14 | &.isleaf { 15 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACjElEQVR42o2SW0hUURSG/32OhnhAqJDCzF6kN0lLGtJCtLQyKIMotRjBy1sqVEZS9mKZBdKFHBJpJEKD0urBvAchhqY5kp6MHkRlMhpHR2fOHuZybu3KxhEr+/fL3g/rWx9rL4Kl1La+ta0XwiNUTVf9sgJF0yB5FVCfAqt9Lnx8yt7Ph4Qc6btVtIigkN+XJ28s9MTeHQLPETipF3aXB7NOJ2wLXnyamYVlwgq/jN5Fj+9QX3WhZxXg8ethmpMSzwA666rDxSBOKsHhViBa7XC5ndgWuRH1PSP9XlnJZJDFFYBHXe/p6bQEIanoGTZECJDhh98jg6gc5ue+oqwkBXlp8TB3WfBiYLx3yuYwiqbS6QDA3DVEjWk7BZ7n8Kc09IzAEBsFm+RG6+BndFsmhsdMxYkBwIO2d7QwI1HIrmgH0XmEMo7MA5qiQ9PZQF0SrDNOpBq2YPPWcLT0i+KYqTQuALjzvJeePZr8V4Nf0fHF4cD49DzKHnaKo7Uly4Cqpg568WS6kH21GxpREIZQEKKxEo4ZaXDJfrgWJBwwxGBPfDTONbxigOJlQLm5jVYaD65hAHgUP77ZKY5fbxI/BAPOm9vpTWOGkH2lExzHIKwrYYcnPNQwnhnpkKjGukciddcm5N9tFkdNJasBaxnouo5J2wKOVTaKYjDggrmDVhvThVOX2S9wPOu8tGnk5+zAMRPqk7HfEI2kuEjk32tmvxAEKK1rpTUFh9c00JjBFDPIYgYrAAW3W2hdcZaQU9GGdWwJOMIFCnRNxY+X5FaxLyEK6ckxOFPzdCUg90YjbbyUK+A/Mk89yCyvFwfvBy1SbF6VLWF7TIRPUdV/FRNNh6qowsDHyaG5l9d2fwfyXD4gAGnljAAAAABJRU5ErkJggg=='); 16 | } 17 | 18 | &.expanded { 19 | background-image: $opened-folder-icon-blue-16; 20 | } 21 | } 22 | } 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /dist/styles/themes/green-theme.scss: -------------------------------------------------------------------------------- 1 | @import '../style-base.scss'; 2 | @import './base-theme.scss'; 3 | 4 | .deni-react-treeview-container.green { 5 | border-color: lighten($green, 2%); 6 | 7 | .deni-react-treeview-item-container.green { 8 | @include set-theme($green); 9 | 10 | .icon-and-text { 11 | .icon { 12 | background-image: $closed-folder-icon-green-16; 13 | 14 | &.isleaf { 15 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACjElEQVR42o2SW0hUURSG/32OhnhAqJDCzF6kN0lLGtJCtLQyKIMotRjBy1sqVEZS9mKZBdKFHBJpJEKD0urBvAchhqY5kp6MHkRlMhpHR2fOHuZybu3KxhEr+/fL3g/rWx9rL4Kl1La+ta0XwiNUTVf9sgJF0yB5FVCfAqt9Lnx8yt7Ph4Qc6btVtIigkN+XJ28s9MTeHQLPETipF3aXB7NOJ2wLXnyamYVlwgq/jN5Fj+9QX3WhZxXg8ethmpMSzwA666rDxSBOKsHhViBa7XC5ndgWuRH1PSP9XlnJZJDFFYBHXe/p6bQEIanoGTZECJDhh98jg6gc5ue+oqwkBXlp8TB3WfBiYLx3yuYwiqbS6QDA3DVEjWk7BZ7n8Kc09IzAEBsFm+RG6+BndFsmhsdMxYkBwIO2d7QwI1HIrmgH0XmEMo7MA5qiQ9PZQF0SrDNOpBq2YPPWcLT0i+KYqTQuALjzvJeePZr8V4Nf0fHF4cD49DzKHnaKo7Uly4Cqpg568WS6kH21GxpREIZQEKKxEo4ZaXDJfrgWJBwwxGBPfDTONbxigOJlQLm5jVYaD65hAHgUP77ZKY5fbxI/BAPOm9vpTWOGkH2lExzHIKwrYYcnPNQwnhnpkKjGukciddcm5N9tFkdNJasBaxnouo5J2wKOVTaKYjDggrmDVhvThVOX2S9wPOu8tGnk5+zAMRPqk7HfEI2kuEjk32tmvxAEKK1rpTUFh9c00JjBFDPIYgYrAAW3W2hdcZaQU9GGdWwJOMIFCnRNxY+X5FaxLyEK6ckxOFPzdCUg90YjbbyUK+A/Mk89yCyvFwfvBy1SbF6VLWF7TIRPUdV/FRNNh6qowsDHyaG5l9d2fwfyXD4gAGnljAAAAABJRU5ErkJggg=='); 16 | } 17 | 18 | &.expanded { 19 | background-image: $opened-folder-icon-green-16; 20 | } 21 | } 22 | } 23 | 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /dist/styles/themes/metro-theme.scss: -------------------------------------------------------------------------------- 1 | @import '../style-base.scss'; 2 | @import './base-theme.scss'; 3 | 4 | .deni-react-treeview-container.metro { 5 | background-color: darken($metro, 50%) !important; 6 | border-color: lighten($metro, 2%); 7 | 8 | .deni-react-treeview-item-container.metro { 9 | color: lighten($base-color, 15%) !important; 10 | 11 | &:hover { 12 | background-color: transparent !important; 13 | } 14 | 15 | &.selected { 16 | @include gradient-background(darken($base-color, 52%)); 17 | outline-color: darken($base-color, 5%) !important; 18 | } 19 | .checkbox { 20 | border-color: lighten($base-color, 4%) !important; 21 | &.selected { 22 | border-color: darken($base-color, 15%) !important; 23 | background-color: transparent; 24 | } 25 | } 26 | .expand-button { 27 | color: lighten($base-color, 15%) !important; 28 | } 29 | .icon-and-text { 30 | &:hover { 31 | background-color: transparent !important; 32 | } 33 | &.selected { 34 | @include gradient-background(darken($base-color, 42%)); 35 | border-color: darken($base-color, 2%); 36 | } 37 | .icon { 38 | background-image: $closed-folder-icon-metro-16; 39 | 40 | &.isleaf { 41 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACjElEQVR42o2SW0hUURSG/32OhnhAqJDCzF6kN0lLGtJCtLQyKIMotRjBy1sqVEZS9mKZBdKFHBJpJEKD0urBvAchhqY5kp6MHkRlMhpHR2fOHuZybu3KxhEr+/fL3g/rWx9rL4Kl1La+ta0XwiNUTVf9sgJF0yB5FVCfAqt9Lnx8yt7Ph4Qc6btVtIigkN+XJ28s9MTeHQLPETipF3aXB7NOJ2wLXnyamYVlwgq/jN5Fj+9QX3WhZxXg8ethmpMSzwA666rDxSBOKsHhViBa7XC5ndgWuRH1PSP9XlnJZJDFFYBHXe/p6bQEIanoGTZECJDhh98jg6gc5ue+oqwkBXlp8TB3WfBiYLx3yuYwiqbS6QDA3DVEjWk7BZ7n8Kc09IzAEBsFm+RG6+BndFsmhsdMxYkBwIO2d7QwI1HIrmgH0XmEMo7MA5qiQ9PZQF0SrDNOpBq2YPPWcLT0i+KYqTQuALjzvJeePZr8V4Nf0fHF4cD49DzKHnaKo7Uly4Cqpg568WS6kH21GxpREIZQEKKxEo4ZaXDJfrgWJBwwxGBPfDTONbxigOJlQLm5jVYaD65hAHgUP77ZKY5fbxI/BAPOm9vpTWOGkH2lExzHIKwrYYcnPNQwnhnpkKjGukciddcm5N9tFkdNJasBaxnouo5J2wKOVTaKYjDggrmDVhvThVOX2S9wPOu8tGnk5+zAMRPqk7HfEI2kuEjk32tmvxAEKK1rpTUFh9c00JjBFDPIYgYrAAW3W2hdcZaQU9GGdWwJOMIFCnRNxY+X5FaxLyEK6ckxOFPzdCUg90YjbbyUK+A/Mk89yCyvFwfvBy1SbF6VLWF7TIRPUdV/FRNNh6qowsDHyaG5l9d2fwfyXD4gAGnljAAAAABJRU5ErkJggg=='); 42 | } 43 | 44 | &.expanded { 45 | background-image: $opened-folder-icon-metro-16; 46 | } 47 | } 48 | } 49 | 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /dist/styles/themes/moonlight-theme.scss: -------------------------------------------------------------------------------- 1 | @import '../style-base.scss'; 2 | @import './base-theme.scss'; 3 | 4 | .deni-react-treeview-container.moonlight { 5 | background-color: darken($moonlight, 50%) !important; 6 | border-color: lighten($moonlight, 2%); 7 | 8 | .deni-react-treeview-item-container.moonlight { 9 | color: lighten($base-color, 15%) !important; 10 | 11 | &:hover { 12 | background-color: transparent !important; 13 | } 14 | 15 | &.selected { 16 | @include gradient-background(#E59E06); 17 | outline-color: darken($base-color, 5%) !important; 18 | color: darken($base-color, 80%) !important; 19 | } 20 | .checkbox { 21 | border-color: lighten($base-color, 30%) !important; 22 | &.selected { 23 | //border-color: darken($base-color, 20%) !important; 24 | background-color: transparent; 25 | } 26 | } 27 | .expand-button { 28 | color: lighten($base-color, 15%) !important; 29 | } 30 | .icon-and-text { 31 | &:hover { 32 | background-color: transparent !important; 33 | } 34 | &.selected { 35 | @include gradient-background(#E59E06); 36 | border-color: darken($base-color, 2%); 37 | color: darken($base-color, 65%); 38 | } 39 | .icon { 40 | background-image: $closed-folder-icon-metro-16; 41 | 42 | &.isleaf { 43 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACjElEQVR42o2SW0hUURSG/32OhnhAqJDCzF6kN0lLGtJCtLQyKIMotRjBy1sqVEZS9mKZBdKFHBJpJEKD0urBvAchhqY5kp6MHkRlMhpHR2fOHuZybu3KxhEr+/fL3g/rWx9rL4Kl1La+ta0XwiNUTVf9sgJF0yB5FVCfAqt9Lnx8yt7Ph4Qc6btVtIigkN+XJ28s9MTeHQLPETipF3aXB7NOJ2wLXnyamYVlwgq/jN5Fj+9QX3WhZxXg8ethmpMSzwA666rDxSBOKsHhViBa7XC5ndgWuRH1PSP9XlnJZJDFFYBHXe/p6bQEIanoGTZECJDhh98jg6gc5ue+oqwkBXlp8TB3WfBiYLx3yuYwiqbS6QDA3DVEjWk7BZ7n8Kc09IzAEBsFm+RG6+BndFsmhsdMxYkBwIO2d7QwI1HIrmgH0XmEMo7MA5qiQ9PZQF0SrDNOpBq2YPPWcLT0i+KYqTQuALjzvJeePZr8V4Nf0fHF4cD49DzKHnaKo7Uly4Cqpg568WS6kH21GxpREIZQEKKxEo4ZaXDJfrgWJBwwxGBPfDTONbxigOJlQLm5jVYaD65hAHgUP77ZKY5fbxI/BAPOm9vpTWOGkH2lExzHIKwrYYcnPNQwnhnpkKjGukciddcm5N9tFkdNJasBaxnouo5J2wKOVTaKYjDggrmDVhvThVOX2S9wPOu8tGnk5+zAMRPqk7HfEI2kuEjk32tmvxAEKK1rpTUFh9c00JjBFDPIYgYrAAW3W2hdcZaQU9GGdWwJOMIFCnRNxY+X5FaxLyEK6ckxOFPzdCUg90YjbbyUK+A/Mk89yCyvFwfvBy1SbF6VLWF7TIRPUdV/FRNNh6qowsDHyaG5l9d2fwfyXD4gAGnljAAAAABJRU5ErkJggg=='); 44 | } 45 | 46 | &.expanded { 47 | background-image: $opened-folder-icon-metro-16; 48 | } 49 | } 50 | } 51 | 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /dist/styles/themes/orange-theme.scss: -------------------------------------------------------------------------------- 1 | @import '../style-base.scss'; 2 | @import './base-theme.scss'; 3 | 4 | .deni-react-treeview-container.orange { 5 | border-color: lighten($orange, 2%); 6 | 7 | .deni-react-treeview-item-container.orange { 8 | @include set-theme($orange); 9 | 10 | .icon-and-text { 11 | .icon { 12 | background-image: $closed-folder-icon-orange-16; 13 | 14 | &.isleaf { 15 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACjElEQVR42o2SW0hUURSG/32OhnhAqJDCzF6kN0lLGtJCtLQyKIMotRjBy1sqVEZS9mKZBdKFHBJpJEKD0urBvAchhqY5kp6MHkRlMhpHR2fOHuZybu3KxhEr+/fL3g/rWx9rL4Kl1La+ta0XwiNUTVf9sgJF0yB5FVCfAqt9Lnx8yt7Ph4Qc6btVtIigkN+XJ28s9MTeHQLPETipF3aXB7NOJ2wLXnyamYVlwgq/jN5Fj+9QX3WhZxXg8ethmpMSzwA666rDxSBOKsHhViBa7XC5ndgWuRH1PSP9XlnJZJDFFYBHXe/p6bQEIanoGTZECJDhh98jg6gc5ue+oqwkBXlp8TB3WfBiYLx3yuYwiqbS6QDA3DVEjWk7BZ7n8Kc09IzAEBsFm+RG6+BndFsmhsdMxYkBwIO2d7QwI1HIrmgH0XmEMo7MA5qiQ9PZQF0SrDNOpBq2YPPWcLT0i+KYqTQuALjzvJeePZr8V4Nf0fHF4cD49DzKHnaKo7Uly4Cqpg568WS6kH21GxpREIZQEKKxEo4ZaXDJfrgWJBwwxGBPfDTONbxigOJlQLm5jVYaD65hAHgUP77ZKY5fbxI/BAPOm9vpTWOGkH2lExzHIKwrYYcnPNQwnhnpkKjGukciddcm5N9tFkdNJasBaxnouo5J2wKOVTaKYjDggrmDVhvThVOX2S9wPOu8tGnk5+zAMRPqk7HfEI2kuEjk32tmvxAEKK1rpTUFh9c00JjBFDPIYgYrAAW3W2hdcZaQU9GGdWwJOMIFCnRNxY+X5FaxLyEK6ckxOFPzdCUg90YjbbyUK+A/Mk89yCyvFwfvBy1SbF6VLWF7TIRPUdV/FRNNh6qowsDHyaG5l9d2fwfyXD4gAGnljAAAAABJRU5ErkJggg=='); 16 | } 17 | 18 | &.expanded { 19 | background-image: $opened-folder-icon-orange-16; 20 | } 21 | } 22 | } 23 | 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /dist/styles/themes/purple-theme.scss: -------------------------------------------------------------------------------- 1 | @import '../style-base.scss'; 2 | @import './base-theme.scss'; 3 | 4 | .deni-react-treeview-container.purple { 5 | border-color: lighten($purple, 2%); 6 | 7 | .deni-react-treeview-item-container.purple { 8 | @include set-theme($purple); 9 | 10 | .icon-and-text { 11 | .icon { 12 | background-image: $closed-folder-icon-purple-16; 13 | 14 | &.isleaf { 15 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACjElEQVR42o2SW0hUURSG/32OhnhAqJDCzF6kN0lLGtJCtLQyKIMotRjBy1sqVEZS9mKZBdKFHBJpJEKD0urBvAchhqY5kp6MHkRlMhpHR2fOHuZybu3KxhEr+/fL3g/rWx9rL4Kl1La+ta0XwiNUTVf9sgJF0yB5FVCfAqt9Lnx8yt7Ph4Qc6btVtIigkN+XJ28s9MTeHQLPETipF3aXB7NOJ2wLXnyamYVlwgq/jN5Fj+9QX3WhZxXg8ethmpMSzwA666rDxSBOKsHhViBa7XC5ndgWuRH1PSP9XlnJZJDFFYBHXe/p6bQEIanoGTZECJDhh98jg6gc5ue+oqwkBXlp8TB3WfBiYLx3yuYwiqbS6QDA3DVEjWk7BZ7n8Kc09IzAEBsFm+RG6+BndFsmhsdMxYkBwIO2d7QwI1HIrmgH0XmEMo7MA5qiQ9PZQF0SrDNOpBq2YPPWcLT0i+KYqTQuALjzvJeePZr8V4Nf0fHF4cD49DzKHnaKo7Uly4Cqpg568WS6kH21GxpREIZQEKKxEo4ZaXDJfrgWJBwwxGBPfDTONbxigOJlQLm5jVYaD65hAHgUP77ZKY5fbxI/BAPOm9vpTWOGkH2lExzHIKwrYYcnPNQwnhnpkKjGukciddcm5N9tFkdNJasBaxnouo5J2wKOVTaKYjDggrmDVhvThVOX2S9wPOu8tGnk5+zAMRPqk7HfEI2kuEjk32tmvxAEKK1rpTUFh9c00JjBFDPIYgYrAAW3W2hdcZaQU9GGdWwJOMIFCnRNxY+X5FaxLyEK6ckxOFPzdCUg90YjbbyUK+A/Mk89yCyvFwfvBy1SbF6VLWF7TIRPUdV/FRNNh6qowsDHyaG5l9d2fwfyXD4gAGnljAAAAABJRU5ErkJggg=='); 16 | } 17 | 18 | &.expanded { 19 | background-image: $opened-folder-icon-purple-16; 20 | } 21 | } 22 | } 23 | 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /dist/styles/themes/red-theme.scss: -------------------------------------------------------------------------------- 1 | @import '../style-base.scss'; 2 | @import './base-theme.scss'; 3 | 4 | .deni-react-treeview-container.red { 5 | border-color: lighten($red, 2%); 6 | 7 | .deni-react-treeview-item-container.red { 8 | @include set-theme($red); 9 | 10 | .icon-and-text { 11 | .icon { 12 | background-image: $closed-folder-icon-red-16; 13 | 14 | &.isleaf { 15 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACjElEQVR42o2SW0hUURSG/32OhnhAqJDCzF6kN0lLGtJCtLQyKIMotRjBy1sqVEZS9mKZBdKFHBJpJEKD0urBvAchhqY5kp6MHkRlMhpHR2fOHuZybu3KxhEr+/fL3g/rWx9rL4Kl1La+ta0XwiNUTVf9sgJF0yB5FVCfAqt9Lnx8yt7Ph4Qc6btVtIigkN+XJ28s9MTeHQLPETipF3aXB7NOJ2wLXnyamYVlwgq/jN5Fj+9QX3WhZxXg8ethmpMSzwA666rDxSBOKsHhViBa7XC5ndgWuRH1PSP9XlnJZJDFFYBHXe/p6bQEIanoGTZECJDhh98jg6gc5ue+oqwkBXlp8TB3WfBiYLx3yuYwiqbS6QDA3DVEjWk7BZ7n8Kc09IzAEBsFm+RG6+BndFsmhsdMxYkBwIO2d7QwI1HIrmgH0XmEMo7MA5qiQ9PZQF0SrDNOpBq2YPPWcLT0i+KYqTQuALjzvJeePZr8V4Nf0fHF4cD49DzKHnaKo7Uly4Cqpg568WS6kH21GxpREIZQEKKxEo4ZaXDJfrgWJBwwxGBPfDTONbxigOJlQLm5jVYaD65hAHgUP77ZKY5fbxI/BAPOm9vpTWOGkH2lExzHIKwrYYcnPNQwnhnpkKjGukciddcm5N9tFkdNJasBaxnouo5J2wKOVTaKYjDggrmDVhvThVOX2S9wPOu8tGnk5+zAMRPqk7HfEI2kuEjk32tmvxAEKK1rpTUFh9c00JjBFDPIYgYrAAW3W2hdcZaQU9GGdWwJOMIFCnRNxY+X5FaxLyEK6ckxOFPzdCUg90YjbbyUK+A/Mk89yCyvFwfvBy1SbF6VLWF7TIRPUdV/FRNNh6qowsDHyaG5l9d2fwfyXD4gAGnljAAAAABJRU5ErkJggg=='); 16 | } 17 | 18 | &.expanded { 19 | background-image: $opened-folder-icon-red-16; 20 | } 21 | } 22 | } 23 | 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /dist/styles/themes/silver-theme.scss: -------------------------------------------------------------------------------- 1 | @import '../style-base.scss'; 2 | @import './base-theme.scss'; 3 | 4 | .deni-react-treeview-container.silver { 5 | border-color: lighten($silver, 2%); 6 | 7 | .deni-react-treeview-item-container.silver { 8 | @include set-theme($silver); 9 | 10 | .icon-and-text { 11 | .icon { 12 | background-image: $closed-folder-icon-silver-16; 13 | 14 | &.isleaf { 15 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACjElEQVR42o2SW0hUURSG/32OhnhAqJDCzF6kN0lLGtJCtLQyKIMotRjBy1sqVEZS9mKZBdKFHBJpJEKD0urBvAchhqY5kp6MHkRlMhpHR2fOHuZybu3KxhEr+/fL3g/rWx9rL4Kl1La+ta0XwiNUTVf9sgJF0yB5FVCfAqt9Lnx8yt7Ph4Qc6btVtIigkN+XJ28s9MTeHQLPETipF3aXB7NOJ2wLXnyamYVlwgq/jN5Fj+9QX3WhZxXg8ethmpMSzwA666rDxSBOKsHhViBa7XC5ndgWuRH1PSP9XlnJZJDFFYBHXe/p6bQEIanoGTZECJDhh98jg6gc5ue+oqwkBXlp8TB3WfBiYLx3yuYwiqbS6QDA3DVEjWk7BZ7n8Kc09IzAEBsFm+RG6+BndFsmhsdMxYkBwIO2d7QwI1HIrmgH0XmEMo7MA5qiQ9PZQF0SrDNOpBq2YPPWcLT0i+KYqTQuALjzvJeePZr8V4Nf0fHF4cD49DzKHnaKo7Uly4Cqpg568WS6kH21GxpREIZQEKKxEo4ZaXDJfrgWJBwwxGBPfDTONbxigOJlQLm5jVYaD65hAHgUP77ZKY5fbxI/BAPOm9vpTWOGkH2lExzHIKwrYYcnPNQwnhnpkKjGukciddcm5N9tFkdNJasBaxnouo5J2wKOVTaKYjDggrmDVhvThVOX2S9wPOu8tGnk5+zAMRPqk7HfEI2kuEjk32tmvxAEKK1rpTUFh9c00JjBFDPIYgYrAAW3W2hdcZaQU9GGdWwJOMIFCnRNxY+X5FaxLyEK6ckxOFPzdCUg90YjbbyUK+A/Mk89yCyvFwfvBy1SbF6VLWF7TIRPUdV/FRNNh6qowsDHyaG5l9d2fwfyXD4gAGnljAAAAABJRU5ErkJggg=='); 16 | } 17 | 18 | &.expanded { 19 | background-image: $opened-folder-icon-silver-16; 20 | } 21 | } 22 | } 23 | 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: 'ts-jest/presets/js-with-ts', 3 | transform: { 4 | '^.+\\.(css|scss|sass)$': '/mocks/styleMock.js', 5 | }, 6 | testMatch: [ 7 | '/src/**/__tests__/**/*.{js,jsx,ts,tsx}', 8 | '/src/**/?(*.)(spec|test).{js,jsx,ts,tsx}', 9 | ], 10 | coveragePathIgnorePatterns: [ 11 | '/node_modules/', 12 | 'dist/', 13 | '/src/index.ts', 14 | '/src/components/index.ts', 15 | ], 16 | collectCoverageFrom: [ 17 | '/src/**/*.{js,ts,tsx,jsx}', 18 | '!/src/**/*.stories.*', 19 | ], 20 | coverageThreshold: { 21 | global: { 22 | branches: 90, 23 | functions: 90, 24 | lines: 90, 25 | statements: 90, 26 | }, 27 | }, 28 | }; 29 | -------------------------------------------------------------------------------- /mocks/styleMock.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | process() { 3 | return ''; 4 | }, 5 | }; 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "deni-react-treeview", 3 | "license": "MIT", 4 | "version": "1.1.11", 5 | "private": false, 6 | "author": "Denimar de Moraes ", 7 | "description": "A modern, themable and configurable treeview for React.", 8 | "homepage": "https://github.com/denimar/deni-react-treeview", 9 | "bugs": { 10 | "url": "https://github.com/denimar/deni-react-treeview/issues" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git@github.com:denimar/deni-react-treeview.git" 15 | }, 16 | "scripts": { 17 | "build": "yarn clean; rollup -c; yarn postBuild", 18 | "postBuild": "node ./scripts/postBuild", 19 | "clean": "rimraf dist", 20 | "dev": "yarn storybook", 21 | "format": "prettier --write \"src/**/*.{ts,tsx,json,js,jsx}\"", 22 | "format:check": "prettier --list-different \"src/**/*.{ts,tsx,json,js,jsx}\"", 23 | "lint": "yarn lint:script && yarn lint:style", 24 | "lint:script": "eslint --ext js --ext jsx --ext ts --ext tsx src", 25 | "lint:style": "stylelint src", 26 | "npm:publish": "./scripts/publishNPM.sh", 27 | "storybook": "start-storybook -p 9001 -s ./src/assets -c .storybook", 28 | "storybook:build": "build-storybook -c .storybook -o .storybook/dist -s src/assets", 29 | "test": "jest --maxWorkers=2", 30 | "test:watch": "yarn test --watch", 31 | "test:coverage": "jest --coverage --colors --maxWorkers=2" 32 | }, 33 | "main": "libs/lib.cjs.js", 34 | "module": "libs/lib.esm.js", 35 | "browser": "libs/lib.umd.js", 36 | "types": "index.d.ts", 37 | "dependencies": { 38 | "@storybook/addon-notes": "^5.3.19", 39 | "axios": "^0.19.2", 40 | "classnames": "^2.2.6", 41 | "react": "^16.13.1", 42 | "react-dom": "^16.13.1", 43 | "react-icons": "^3.10.0" 44 | }, 45 | "peerDependencies": { 46 | "classnames": "^2.2.6", 47 | "react": "^16.13.1" 48 | }, 49 | "devDependencies": { 50 | "@babel/core": "^7.9.0", 51 | "@rollup/plugin-commonjs": "^11.1.0", 52 | "@storybook/addon-storysource": "^5.3.19", 53 | "@storybook/preset-typescript": "^3.0.0", 54 | "@storybook/react": "^5.3.18", 55 | "@testing-library/react": "^10.0.2", 56 | "@types/classnames": "^2.2.10", 57 | "@types/jest": "^25.2.1", 58 | "@types/node": "^10.12.18", 59 | "@types/react": "^16.9.34", 60 | "@types/react-dom": "^16.9.6", 61 | "@typescript-eslint/eslint-plugin": "^2.27.0", 62 | "@typescript-eslint/parser": "^2.27.0", 63 | "babel-loader": "^8.1.0", 64 | "css-loader": "^3.5.2", 65 | "eslint": "^6.8.0", 66 | "eslint-config-prettier": "^6.10.1", 67 | "eslint-plugin-prettier": "^3.1.2", 68 | "eslint-plugin-react": "^7.19.0", 69 | "eslint-plugin-react-hooks": "^3.0.0", 70 | "jest": "^25.3.0", 71 | "node-sass": "^4.13.1", 72 | "prettier": "^2.0.4", 73 | "rimraf": "^3.0.2", 74 | "rollup": "^2.6.0", 75 | "rollup-plugin-external-globals": "^0.5.0", 76 | "rollup-plugin-postcss": "^2.5.0", 77 | "rollup-plugin-terser": "^5.3.0", 78 | "rollup-plugin-typescript2": "^0.27.0", 79 | "sass-loader": "^8.0.2", 80 | "style-loader": "^1.1.3", 81 | "stylelint": "^13.3.2", 82 | "stylelint-config-standard": "^20.0.0", 83 | "stylelint-scss": "^3.16.1", 84 | "ts-jest": "^25.3.1", 85 | "ts-loader": "^6.2.2", 86 | "typescript": "^3.8.3", 87 | "webpack": "^4.42.1" 88 | }, 89 | "keywords": [ 90 | "react", 91 | "treeview", 92 | "tree-view", 93 | "tree", 94 | "view", 95 | "treenode", 96 | "tree-node", 97 | "deni-react-treeview" 98 | ] 99 | } 100 | -------------------------------------------------------------------------------- /rollup.config.js: -------------------------------------------------------------------------------- 1 | import typescript from 'rollup-plugin-typescript2'; 2 | import { terser } from 'rollup-plugin-terser'; 3 | import postcss from 'rollup-plugin-postcss'; 4 | import commonjs from '@rollup/plugin-commonjs'; 5 | import pkg from './package.json'; 6 | 7 | const globals = { 8 | classnames: 'classnames', 9 | react: 'React', 10 | axios: 'axios' 11 | }; 12 | 13 | export default { 14 | input: './src/index.ts', 15 | external: [ 16 | ...Object.keys(pkg.dependencies), 17 | ...Object.keys(pkg.devDependencies), 18 | ], 19 | output: [ 20 | { 21 | file: `./dist/${pkg.main}`, 22 | format: 'cjs', 23 | globals, 24 | sourcemap: true, 25 | }, 26 | { 27 | file: `./dist/${pkg.module}`, 28 | format: 'es', 29 | globals, 30 | sourcemap: true, 31 | }, 32 | { 33 | file: `./dist/${pkg.browser}`, 34 | format: 'umd', 35 | name: 'lib', 36 | globals, 37 | sourcemap: true, 38 | }, 39 | ], 40 | plugins: [commonjs(), postcss(), typescript(), terser()], 41 | }; -------------------------------------------------------------------------------- /scripts/postBuild.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | var fse = require("fs-extra"); 3 | const pkg = require('../package.json'); 4 | 5 | (async () => { 6 | fs.copyFileSync('LICENSE', './dist/LICENSE'); 7 | fs.copyFileSync('README.md', './dist/README.md'); 8 | fs.writeFileSync('./dist/package.json', JSON.stringify({ ...pkg }, null, 2)); 9 | 10 | fse.copy('./src/components/styles', './dist/styles') 11 | })(); -------------------------------------------------------------------------------- /scripts/publishNPM.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | npm version patch 4 | 5 | echo "building..." 6 | yarn build 7 | 8 | cd dist 9 | 10 | echo "packing..." 11 | npm pack 12 | 13 | #npm login 14 | 15 | echo "publishing..." 16 | npm publish -------------------------------------------------------------------------------- /src/assets/data/cities/me.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "http://www.brewerme.org/", 4 | "long": "-68.76", 5 | "name": "Brewer", 6 | "state": { 7 | "name": "Maine", 8 | "abbreviation": "ME" 9 | }, 10 | "lat": "44.79" 11 | }, 12 | { 13 | "url": "http://www.old-town.org/", 14 | "long": "-68.64", 15 | "name": "Old Town", 16 | "state": { 17 | "name": "Maine", 18 | "abbreviation": "ME" 19 | }, 20 | "lat": "44.93" 21 | }, 22 | { 23 | "url": "http://www.cariboumaine.org/", 24 | "long": "-68.01", 25 | "name": "Caribou", 26 | "state": { 27 | "name": "Maine", 28 | "abbreviation": "ME" 29 | }, 30 | "lat": "46.86" 31 | }, 32 | { 33 | "url": "http://www.ci.portland.me.us/", 34 | "long": "-70.25", 35 | "name": "Portland", 36 | "state": { 37 | "name": "Maine", 38 | "abbreviation": "ME" 39 | }, 40 | "lat": "43.66" 41 | }, 42 | { 43 | "url": "http://www.presqueisle.govoffice2.com/", 44 | "long": "-68.01", 45 | "name": "Presque Isle", 46 | "state": { 47 | "name": "Maine", 48 | "abbreviation": "ME" 49 | }, 50 | "lat": "46.68" 51 | }, 52 | { 53 | "url": "http://www.ci.rockland.me.us/", 54 | "long": "-69.1", 55 | "name": "Rockland", 56 | "state": { 57 | "name": "Maine", 58 | "abbreviation": "ME" 59 | }, 60 | "lat": "44.1" 61 | }, 62 | { 63 | "url": "http://www.eastport-me.gov/", 64 | "long": "-66.98", 65 | "name": "Eastport", 66 | "state": { 67 | "name": "Maine", 68 | "abbreviation": "ME" 69 | }, 70 | "lat": "44.9" 71 | }, 72 | { 73 | "url": "http://www.cityofellsworthme.org/", 74 | "long": "-68.41", 75 | "name": "Ellsworth", 76 | "state": { 77 | "name": "Maine", 78 | "abbreviation": "ME" 79 | }, 80 | "lat": "44.54" 81 | }, 82 | { 83 | "url": "http://www.southportland.org/", 84 | "long": "-70.24", 85 | "name": "South Portland", 86 | "state": { 87 | "name": "Maine", 88 | "abbreviation": "ME" 89 | }, 90 | "lat": "43.64" 91 | }, 92 | { 93 | "url": "http://www.gardinermaine.com/", 94 | "long": "-69.77", 95 | "name": "Gardiner", 96 | "state": { 97 | "name": "Maine", 98 | "abbreviation": "ME" 99 | }, 100 | "lat": "44.23" 101 | }, 102 | { 103 | "url": "http://hallowell.govoffice.com/", 104 | "long": "-69.79", 105 | "name": "Hallowell", 106 | "state": { 107 | "name": "Maine", 108 | "abbreviation": "ME" 109 | }, 110 | "lat": "44.28" 111 | }, 112 | { 113 | "url": "http://www.waterville-me.gov/", 114 | "long": "-69.63", 115 | "name": "Waterville", 116 | "state": { 117 | "name": "Maine", 118 | "abbreviation": "ME" 119 | }, 120 | "lat": "44.55" 121 | }, 122 | { 123 | "url": "http://www.westbrookmaine.com/", 124 | "long": "-70.37", 125 | "name": "Westbrook", 126 | "state": { 127 | "name": "Maine", 128 | "abbreviation": "ME" 129 | }, 130 | "lat": "43.67" 131 | }, 132 | { 133 | "url": "http://www.ci.lewiston.me.us/", 134 | "long": "-70.21", 135 | "name": "Lewiston", 136 | "state": { 137 | "name": "Maine", 138 | "abbreviation": "ME" 139 | }, 140 | "lat": "44.1" 141 | }, 142 | { 143 | "url": "http://www.auburnmaine.org/", 144 | "long": "-70.23", 145 | "name": "Auburn", 146 | "state": { 147 | "name": "Maine", 148 | "abbreviation": "ME" 149 | }, 150 | "lat": "44.09" 151 | }, 152 | { 153 | "url": "http://www.augustamaine.gov/", 154 | "long": "-69.77", 155 | "name": "Augusta", 156 | "state": { 157 | "name": "Maine", 158 | "abbreviation": "ME" 159 | }, 160 | "lat": "44.31" 161 | }, 162 | { 163 | "url": "http://www.bangormaine.gov/", 164 | "long": "-68.77", 165 | "name": "Bangor", 166 | "state": { 167 | "name": "Maine", 168 | "abbreviation": "ME" 169 | }, 170 | "lat": "44.8" 171 | }, 172 | { 173 | "url": "http://www.cityofbath.com/", 174 | "long": "-69.82", 175 | "name": "Bath", 176 | "state": { 177 | "name": "Maine", 178 | "abbreviation": "ME" 179 | }, 180 | "lat": "43.91" 181 | }, 182 | { 183 | "url": "http://www.cityofbelfast.org/", 184 | "long": "-69", 185 | "name": "Belfast", 186 | "state": { 187 | "name": "Maine", 188 | "abbreviation": "ME" 189 | }, 190 | "lat": "44.42" 191 | }, 192 | { 193 | "url": "http://www.biddefordmaine.org/", 194 | "long": "-70.45", 195 | "name": "Biddeford", 196 | "state": { 197 | "name": "Maine", 198 | "abbreviation": "ME" 199 | }, 200 | "lat": "43.49" 201 | } 202 | ] -------------------------------------------------------------------------------- /src/assets/data/cities/mt.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "http://www.anacondamt.org/", 4 | "long": "-112.94", 5 | "name": "Anaconda", 6 | "state": { 7 | "name": "Montana", 8 | "abbreviation": "MT" 9 | }, 10 | "lat": "46.12" 11 | }, 12 | { 13 | "url": "http://www.ci.belgrade.mt.us/", 14 | "long": "-111.17", 15 | "name": "Belgrade", 16 | "state": { 17 | "name": "Montana", 18 | "abbreviation": "MT" 19 | }, 20 | "lat": "45.77" 21 | }, 22 | { 23 | "url": "http://ci.billings.mt.us/", 24 | "long": "-108.5", 25 | "name": "Billings", 26 | "state": { 27 | "name": "Montana", 28 | "abbreviation": "MT" 29 | }, 30 | "lat": "45.78" 31 | }, 32 | { 33 | "url": "http://www.bozeman.net/", 34 | "long": "-111.03", 35 | "name": "Bozeman", 36 | "state": { 37 | "name": "Montana", 38 | "abbreviation": "MT" 39 | }, 40 | "lat": "45.67" 41 | }, 42 | { 43 | "url": "http://co.silverbow.mt.us/", 44 | "long": "-112.53", 45 | "name": "Butte", 46 | "state": { 47 | "name": "Montana", 48 | "abbreviation": "MT" 49 | }, 50 | "lat": "46" 51 | }, 52 | { 53 | "url": "http://www.greatfallsmt.net/", 54 | "long": "-111.3", 55 | "name": "Great Falls", 56 | "state": { 57 | "name": "Montana", 58 | "abbreviation": "MT" 59 | }, 60 | "lat": "47.5" 61 | }, 62 | { 63 | "url": "http://www.cityofhamilton.net/", 64 | "long": "-114.16", 65 | "name": "Hamilton", 66 | "state": { 67 | "name": "Montana", 68 | "abbreviation": "MT" 69 | }, 70 | "lat": "46.24" 71 | }, 72 | { 73 | "url": "http://www.ci.havre.mt.us/", 74 | "long": "-109.68", 75 | "name": "Havre", 76 | "state": { 77 | "name": "Montana", 78 | "abbreviation": "MT" 79 | }, 80 | "lat": "48.54" 81 | }, 82 | { 83 | "url": "http://www.ci.helena.mt.us/", 84 | "long": "-112.03", 85 | "name": "Helena", 86 | "state": { 87 | "name": "Montana", 88 | "abbreviation": "MT" 89 | }, 90 | "lat": "46.59" 91 | }, 92 | { 93 | "url": "http://www.kalispell.com/", 94 | "long": "-114.31", 95 | "name": "Kalispell", 96 | "state": { 97 | "name": "Montana", 98 | "abbreviation": "MT" 99 | }, 100 | "lat": "48.19" 101 | }, 102 | { 103 | "url": "http://www.mylaurel.com/", 104 | "long": "-108.77", 105 | "name": "Laurel", 106 | "state": { 107 | "name": "Montana", 108 | "abbreviation": "MT" 109 | }, 110 | "lat": "45.66" 111 | }, 112 | { 113 | "url": "http://www.cityoflibby.com/", 114 | "long": "-115.55", 115 | "name": "Libby", 116 | "state": { 117 | "name": "Montana", 118 | "abbreviation": "MT" 119 | }, 120 | "lat": "48.38" 121 | }, 122 | { 123 | "url": "http://www.ci.missoula.mt.us/", 124 | "long": "-113.99", 125 | "name": "Missoula", 126 | "state": { 127 | "name": "Montana", 128 | "abbreviation": "MT" 129 | }, 130 | "lat": "46.87" 131 | }, 132 | { 133 | "url": "http://www.shelbymt.com/", 134 | "long": "-111.85", 135 | "name": "Shelby", 136 | "state": { 137 | "name": "Montana", 138 | "abbreviation": "MT" 139 | }, 140 | "lat": "48.5" 141 | } 142 | ] -------------------------------------------------------------------------------- /src/assets/data/cities/nh.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "http://www.ci.nashua.nh.us/", 4 | "long": "-71.46", 5 | "name": "Nashua", 6 | "state": { 7 | "name": "New Hampshire", 8 | "abbreviation": "NH" 9 | }, 10 | "lat": "42.76" 11 | }, 12 | { 13 | "url": "http://www.cityofportsmouth.com/", 14 | "long": "-70.76", 15 | "name": "Portsmouth", 16 | "state": { 17 | "name": "New Hampshire", 18 | "abbreviation": "NH" 19 | }, 20 | "lat": "43.07" 21 | }, 22 | { 23 | "url": "http://www.rochesternh.net/", 24 | "long": "-70.97", 25 | "name": "Rochester", 26 | "state": { 27 | "name": "New Hampshire", 28 | "abbreviation": "NH" 29 | }, 30 | "lat": "43.3" 31 | }, 32 | { 33 | "url": "http://www.somersworth.com/", 34 | "long": "-70.86", 35 | "name": "Somersworth", 36 | "state": { 37 | "name": "New Hampshire", 38 | "abbreviation": "NH" 39 | }, 40 | "lat": "43.26" 41 | }, 42 | { 43 | "url": "http://www.berlinnh.gov/", 44 | "long": "-71.18", 45 | "name": "Berlin", 46 | "state": { 47 | "name": "New Hampshire", 48 | "abbreviation": "NH" 49 | }, 50 | "lat": "44.46" 51 | }, 52 | { 53 | "url": "http://www.claremontnh.com/", 54 | "long": "-72.34", 55 | "name": "Claremont", 56 | "state": { 57 | "name": "New Hampshire", 58 | "abbreviation": "NH" 59 | }, 60 | "lat": "43.37" 61 | }, 62 | { 63 | "url": "http://www.ci.concord.nh.us/", 64 | "long": "-71.53", 65 | "name": "Concord", 66 | "state": { 67 | "name": "New Hampshire", 68 | "abbreviation": "NH" 69 | }, 70 | "lat": "43.2" 71 | }, 72 | { 73 | "url": "http://www.ci.dover.nh.us/", 74 | "long": "-70.87", 75 | "name": "Dover", 76 | "state": { 77 | "name": "New Hampshire", 78 | "abbreviation": "NH" 79 | }, 80 | "lat": "43.19" 81 | }, 82 | { 83 | "url": "http://www.ci.keene.nh.us/", 84 | "long": "-72.27", 85 | "name": "Keene", 86 | "state": { 87 | "name": "New Hampshire", 88 | "abbreviation": "NH" 89 | }, 90 | "lat": "42.93" 91 | }, 92 | { 93 | "url": "http://www.cityoflaconianh.org/", 94 | "long": "-71.47", 95 | "name": "Laconia", 96 | "state": { 97 | "name": "New Hampshire", 98 | "abbreviation": "NH" 99 | }, 100 | "lat": "43.52" 101 | }, 102 | { 103 | "url": "http://www.lebnh.net/", 104 | "long": "-72.25", 105 | "name": "Lebanon", 106 | "state": { 107 | "name": "New Hampshire", 108 | "abbreviation": "NH" 109 | }, 110 | "lat": "43.64" 111 | }, 112 | { 113 | "url": "http://www.manchesternh.gov/", 114 | "long": "-71.45", 115 | "name": "Manchester", 116 | "state": { 117 | "name": "New Hampshire", 118 | "abbreviation": "NH" 119 | }, 120 | "lat": "42.99" 121 | } 122 | ] -------------------------------------------------------------------------------- /src/assets/data/cities/nv.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "http://www.bcnv.org/", 4 | "long": "-114.83", 5 | "name": "Boulder City", 6 | "state": { 7 | "name": "Nevada", 8 | "abbreviation": "NV" 9 | }, 10 | "lat": "35.97" 11 | }, 12 | { 13 | "url": "http://explorecarlinnv.com/", 14 | "long": "-116.1", 15 | "name": "Carlin", 16 | "state": { 17 | "name": "Nevada", 18 | "abbreviation": "NV" 19 | }, 20 | "lat": "40.71" 21 | }, 22 | { 23 | "url": "http://www.carson-city.nv.us/", 24 | "long": "-119.76", 25 | "name": "Carson City", 26 | "state": { 27 | "name": "Nevada", 28 | "abbreviation": "NV" 29 | }, 30 | "lat": "39.16" 31 | }, 32 | { 33 | "url": "http://www.ci.elko.nv.us/", 34 | "long": "-115.76", 35 | "name": "Elko", 36 | "state": { 37 | "name": "Nevada", 38 | "abbreviation": "NV" 39 | }, 40 | "lat": "40.83" 41 | }, 42 | { 43 | "url": "http://www.cityoffallon.org/", 44 | "long": "-118.77", 45 | "name": "Fallon", 46 | "state": { 47 | "name": "Nevada", 48 | "abbreviation": "NV" 49 | }, 50 | "lat": "39.47" 51 | }, 52 | { 53 | "url": "http://www.cityofhenderson.com/", 54 | "long": "-114.98", 55 | "name": "Henderson", 56 | "state": { 57 | "name": "Nevada", 58 | "abbreviation": "NV" 59 | }, 60 | "lat": "36.03" 61 | }, 62 | { 63 | "url": "http://www.lasvegasnevada.gov/", 64 | "long": "-115.13", 65 | "name": "Las Vegas", 66 | "state": { 67 | "name": "Nevada", 68 | "abbreviation": "NV" 69 | }, 70 | "lat": "36.17" 71 | }, 72 | { 73 | "url": "http://www.mesquitenv.com/", 74 | "long": "-114.06", 75 | "name": "Mesquite", 76 | "state": { 77 | "name": "Nevada", 78 | "abbreviation": "NV" 79 | }, 80 | "lat": "36.8" 81 | }, 82 | { 83 | "url": "http://www.cityofnorthlasvegas.com/", 84 | "long": "-115.11", 85 | "name": "North Las Vegas", 86 | "state": { 87 | "name": "Nevada", 88 | "abbreviation": "NV" 89 | }, 90 | "lat": "36.19" 91 | }, 92 | { 93 | "url": "http://www.reno.gov/", 94 | "long": "-119.81", 95 | "name": "Reno", 96 | "state": { 97 | "name": "Nevada", 98 | "abbreviation": "NV" 99 | }, 100 | "lat": "39.52" 101 | }, 102 | { 103 | "url": "http://www.ci.sparks.nv.us/", 104 | "long": "-119.75", 105 | "name": "Sparks", 106 | "state": { 107 | "name": "Nevada", 108 | "abbreviation": "NV" 109 | }, 110 | "lat": "39.53" 111 | }, 112 | { 113 | "url": "http://www.westwendovercity.com/", 114 | "long": "-114.07", 115 | "name": "West Wendover", 116 | "state": { 117 | "name": "Nevada", 118 | "abbreviation": "NV" 119 | }, 120 | "lat": "40.73" 121 | }, 122 | { 123 | "url": "http://www.yerington.net/", 124 | "long": "-119.16", 125 | "name": "Yerington", 126 | "state": { 127 | "name": "Nevada", 128 | "abbreviation": "NV" 129 | }, 130 | "lat": "38.98" 131 | } 132 | ] -------------------------------------------------------------------------------- /src/assets/data/cities/readme.md: -------------------------------------------------------------------------------- 1 | by http://api.sba.gov/doc/ 2 | -------------------------------------------------------------------------------- /src/assets/data/cities/ri.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "http://www.centralfallsri.us/", 4 | "long": "-71.39", 5 | "name": "Central Falls", 6 | "state": { 7 | "name": "Rhode Island", 8 | "abbreviation": "RI" 9 | }, 10 | "lat": "41.89" 11 | }, 12 | { 13 | "url": "http://www.cranstonri.com/", 14 | "long": "-71.43", 15 | "name": "Cranston", 16 | "state": { 17 | "name": "Rhode Island", 18 | "abbreviation": "RI" 19 | }, 20 | "lat": "41.77" 21 | }, 22 | { 23 | "url": "http://www.eastprovidenceri.net/", 24 | "long": "-71.37", 25 | "name": "East Providence", 26 | "state": { 27 | "name": "Rhode Island", 28 | "abbreviation": "RI" 29 | }, 30 | "lat": "41.81" 31 | }, 32 | { 33 | "url": "http://www.cityofnewport.com/", 34 | "long": "-71.31", 35 | "name": "Newport", 36 | "state": { 37 | "name": "Rhode Island", 38 | "abbreviation": "RI" 39 | }, 40 | "lat": "41.49" 41 | }, 42 | { 43 | "url": "http://www.pawtucketri.com/", 44 | "long": "-71.38", 45 | "name": "Pawtucket", 46 | "state": { 47 | "name": "Rhode Island", 48 | "abbreviation": "RI" 49 | }, 50 | "lat": "41.87" 51 | }, 52 | { 53 | "url": "http://www.providenceri.com/", 54 | "long": "-71.41", 55 | "name": "Providence", 56 | "state": { 57 | "name": "Rhode Island", 58 | "abbreviation": "RI" 59 | }, 60 | "lat": "41.82" 61 | }, 62 | { 63 | "url": "http://www.warwickri.gov/", 64 | "long": "-71.41", 65 | "name": "Warwick", 66 | "state": { 67 | "name": "Rhode Island", 68 | "abbreviation": "RI" 69 | }, 70 | "lat": "41.7" 71 | }, 72 | { 73 | "url": "http://www.ci.woonsocket.ri.us/", 74 | "long": "-71.51", 75 | "name": "Woonsocket", 76 | "state": { 77 | "name": "Rhode Island", 78 | "abbreviation": "RI" 79 | }, 80 | "lat": "42" 81 | } 82 | ] -------------------------------------------------------------------------------- /src/assets/data/cities/vt.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "http://www.ci.burlington.vt.us/", 4 | "long": "-73.21", 5 | "name": "Burlington", 6 | "state": { 7 | "name": "Vermont", 8 | "abbreviation": "VT" 9 | }, 10 | "lat": "44.47" 11 | }, 12 | { 13 | "url": "http://www.essexjunction.org/", 14 | "long": "-73.11", 15 | "name": "Essex Junction", 16 | "state": { 17 | "name": "Vermont", 18 | "abbreviation": "VT" 19 | }, 20 | "lat": "44.49" 21 | }, 22 | { 23 | "url": "http://townofjohnson.com/", 24 | "long": "-72.68", 25 | "name": "Johnson", 26 | "state": { 27 | "name": "Vermont", 28 | "abbreviation": "VT" 29 | }, 30 | "lat": "44.63" 31 | }, 32 | { 33 | "url": "http://www.ludlow.vt.us/", 34 | "long": "-72.7", 35 | "name": "Ludlow", 36 | "state": { 37 | "name": "Vermont", 38 | "abbreviation": "VT" 39 | }, 40 | "lat": "43.39" 41 | }, 42 | { 43 | "url": "http://www.manchester-vt.gov/", 44 | "long": "-73.07", 45 | "name": "Manchester", 46 | "state": { 47 | "name": "Vermont", 48 | "abbreviation": "VT" 49 | }, 50 | "lat": "43.16" 51 | }, 52 | { 53 | "url": "http://www.montpelier-vt.org/", 54 | "long": "-72.57", 55 | "name": "Montpelier", 56 | "state": { 57 | "name": "Vermont", 58 | "abbreviation": "VT" 59 | }, 60 | "lat": "44.26" 61 | }, 62 | { 63 | "url": "http://www.newfanevt.com/", 64 | "long": "-72.65", 65 | "name": "Newfane", 66 | "state": { 67 | "name": "Vermont", 68 | "abbreviation": "VT" 69 | }, 70 | "lat": "42.98" 71 | }, 72 | { 73 | "url": "http://www.newportvermont.org/", 74 | "long": "-72.2", 75 | "name": "Newport", 76 | "state": { 77 | "name": "Vermont", 78 | "abbreviation": "VT" 79 | }, 80 | "lat": "44.93" 81 | }, 82 | { 83 | "url": "http://rutland.govoffice.com/", 84 | "long": "-72.97", 85 | "name": "Rutland", 86 | "state": { 87 | "name": "Vermont", 88 | "abbreviation": "VT" 89 | }, 90 | "lat": "43.61" 91 | }, 92 | { 93 | "url": "http://www.sburl.com/", 94 | "long": "-73.17", 95 | "name": "South Burlington", 96 | "state": { 97 | "name": "Vermont", 98 | "abbreviation": "VT" 99 | }, 100 | "lat": "44.46" 101 | }, 102 | { 103 | "url": "http://www.swanton.net/", 104 | "long": "-73.12", 105 | "name": "Swanton Village", 106 | "state": { 107 | "name": "Vermont", 108 | "abbreviation": "VT" 109 | }, 110 | "lat": "44.91" 111 | }, 112 | { 113 | "url": "http://www.vergennes.org/", 114 | "long": "-73.25", 115 | "name": "Vergennes", 116 | "state": { 117 | "name": "Vermont", 118 | "abbreviation": "VT" 119 | }, 120 | "lat": "44.16" 121 | }, 122 | { 123 | "url": "http://www.waterburyvt.com/", 124 | "long": "-72.75", 125 | "name": "Waterbury", 126 | "state": { 127 | "name": "Vermont", 128 | "abbreviation": "VT" 129 | }, 130 | "lat": "44.33" 131 | }, 132 | { 133 | "url": "http://www.barrecity.org/", 134 | "long": "-72.5", 135 | "name": "Barre", 136 | "state": { 137 | "name": "Vermont", 138 | "abbreviation": "VT" 139 | }, 140 | "lat": "44.19" 141 | }, 142 | { 143 | "url": "http://www.rockbf.org/", 144 | "long": "-72.44", 145 | "name": "Bellows Falls", 146 | "state": { 147 | "name": "Vermont", 148 | "abbreviation": "VT" 149 | }, 150 | "lat": "43.13" 151 | }, 152 | { 153 | "url": "http://www.onioncity.com/", 154 | "long": "-73.18", 155 | "name": "Winooski", 156 | "state": { 157 | "name": "Vermont", 158 | "abbreviation": "VT" 159 | }, 160 | "lat": "44.49" 161 | } 162 | ] -------------------------------------------------------------------------------- /src/assets/data/cities/wv.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "http://www.parkersburg-wv.com/", 4 | "long": "-81.56", 5 | "name": "Parkersburg", 6 | "state": { 7 | "name": "West Virginia", 8 | "abbreviation": "WV" 9 | }, 10 | "lat": "39.26" 11 | }, 12 | { 13 | "url": "http://www.philippi.org/", 14 | "long": "-80.04", 15 | "name": "Philippi", 16 | "state": { 17 | "name": "West Virginia", 18 | "abbreviation": "WV" 19 | }, 20 | "lat": "39.15" 21 | }, 22 | { 23 | "url": "http://www.stalbanswv.com/", 24 | "long": "-81.83", 25 | "name": "Saint Albans", 26 | "state": { 27 | "name": "West Virginia", 28 | "abbreviation": "WV" 29 | }, 30 | "lat": "38.38" 31 | }, 32 | { 33 | "url": "http://www.shepherdstown.us/", 34 | "long": "-77.8", 35 | "name": "Shepherdstown", 36 | "state": { 37 | "name": "West Virginia", 38 | "abbreviation": "WV" 39 | }, 40 | "lat": "39.43" 41 | }, 42 | { 43 | "url": "http://www.shinnstonwv.com/", 44 | "long": "-80.3", 45 | "name": "Shinnston", 46 | "state": { 47 | "name": "West Virginia", 48 | "abbreviation": "WV" 49 | }, 50 | "lat": "39.39" 51 | }, 52 | { 53 | "url": "http://www.cityofspencer.com/", 54 | "long": "-81.35", 55 | "name": "Spencer", 56 | "state": { 57 | "name": "West Virginia", 58 | "abbreviation": "WV" 59 | }, 60 | "lat": "38.8" 61 | }, 62 | { 63 | "url": "http://www.cityofweirton.com/", 64 | "long": "-80.58", 65 | "name": "Weirton", 66 | "state": { 67 | "name": "West Virginia", 68 | "abbreviation": "WV" 69 | }, 70 | "lat": "40.41" 71 | }, 72 | { 73 | "url": "http://www.cityofwheelingwv.org/", 74 | "long": "-80.72", 75 | "name": "Wheeling", 76 | "state": { 77 | "name": "West Virginia", 78 | "abbreviation": "WV" 79 | }, 80 | "lat": "40.06" 81 | }, 82 | { 83 | "url": "http://www.beckley.org/", 84 | "long": "-81.18", 85 | "name": "Beckley", 86 | "state": { 87 | "name": "West Virginia", 88 | "abbreviation": "WV" 89 | }, 90 | "lat": "37.77" 91 | }, 92 | { 93 | "url": "http://www.cityofbluefield.com/", 94 | "long": "-81.22", 95 | "name": "Bluefield", 96 | "state": { 97 | "name": "West Virginia", 98 | "abbreviation": "WV" 99 | }, 100 | "lat": "37.26" 101 | }, 102 | { 103 | "url": "http://www.bridgeportwv.com/", 104 | "long": "-80.25", 105 | "name": "Bridgeport", 106 | "state": { 107 | "name": "West Virginia", 108 | "abbreviation": "WV" 109 | }, 110 | "lat": "39.28" 111 | }, 112 | { 113 | "url": "http://www.buckhannonwv.org", 114 | "long": "-80.23", 115 | "name": "Buckhannon", 116 | "state": { 117 | "name": "West Virginia", 118 | "abbreviation": "WV" 119 | }, 120 | "lat": "38.99" 121 | }, 122 | { 123 | "url": "http://www.cityofcharleston.org/", 124 | "long": "-81.63", 125 | "name": "Charleston", 126 | "state": { 127 | "name": "West Virginia", 128 | "abbreviation": "WV" 129 | }, 130 | "lat": "38.34" 131 | }, 132 | { 133 | "url": "http://www.clarksburg.com/", 134 | "long": "-80.34", 135 | "name": "Clarksburg", 136 | "state": { 137 | "name": "West Virginia", 138 | "abbreviation": "WV" 139 | }, 140 | "lat": "39.28" 141 | }, 142 | { 143 | "url": "http://www.cityofhuntington.com/", 144 | "long": "-82.44", 145 | "name": "Huntington", 146 | "state": { 147 | "name": "West Virginia", 148 | "abbreviation": "WV" 149 | }, 150 | "lat": "38.41" 151 | }, 152 | { 153 | "url": "http://www.lewisburg-wv.com/", 154 | "long": "-80.44", 155 | "name": "Lewisburg", 156 | "state": { 157 | "name": "West Virginia", 158 | "abbreviation": "WV" 159 | }, 160 | "lat": "37.8" 161 | }, 162 | { 163 | "url": "http://www.morgantown.com/", 164 | "long": "-79.95", 165 | "name": "Morgantown", 166 | "state": { 167 | "name": "West Virginia", 168 | "abbreviation": "WV" 169 | }, 170 | "lat": "39.62" 171 | }, 172 | { 173 | "url": "http://www.cityofweirton.com/", 174 | "long": "-80.58", 175 | "name": "Weirton", 176 | "state": { 177 | "name": "West Virginia", 178 | "abbreviation": "WV" 179 | }, 180 | "lat": "40.41" 181 | }, 182 | { 183 | "url": "http://www.cityofhuntington.com/", 184 | "long": "-82.44", 185 | "name": "Huntington", 186 | "state": { 187 | "name": "West Virginia", 188 | "abbreviation": "WV" 189 | }, 190 | "lat": "38.41" 191 | } 192 | ] -------------------------------------------------------------------------------- /src/assets/data/cities/wy.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "url": "http://www.casperwy.gov/", 4 | "long": "-106.31", 5 | "name": "Casper", 6 | "state": { 7 | "name": "Wyoming", 8 | "abbreviation": "WY" 9 | }, 10 | "lat": "42.86" 11 | }, 12 | { 13 | "url": "http://www.cheyennecity.org/", 14 | "long": "-104.82", 15 | "name": "Cheyenne", 16 | "state": { 17 | "name": "Wyoming", 18 | "abbreviation": "WY" 19 | }, 20 | "lat": "41.13" 21 | }, 22 | { 23 | "url": "http://www.cityofdouglaswy.com/", 24 | "long": "-105.38", 25 | "name": "Douglas", 26 | "state": { 27 | "name": "Wyoming", 28 | "abbreviation": "WY" 29 | }, 30 | "lat": "42.75" 31 | }, 32 | { 33 | "url": "http://www.evanstonwy.org/", 34 | "long": "-110.96", 35 | "name": "Evanston", 36 | "state": { 37 | "name": "Wyoming", 38 | "abbreviation": "WY" 39 | }, 40 | "lat": "41.26" 41 | }, 42 | { 43 | "url": "http://www.ci.gillette.wy.us/", 44 | "long": "-105.5", 45 | "name": "Gillette", 46 | "state": { 47 | "name": "Wyoming", 48 | "abbreviation": "WY" 49 | }, 50 | "lat": "44.29" 51 | }, 52 | { 53 | "url": "http://www.cityofgreenriver.org/", 54 | "long": "-109.46", 55 | "name": "Green River", 56 | "state": { 57 | "name": "Wyoming", 58 | "abbreviation": "WY" 59 | }, 60 | "lat": "41.52" 61 | }, 62 | { 63 | "url": "http://www.ci.jackson.wy.us/", 64 | "long": "-110.76", 65 | "name": "Jackson", 66 | "state": { 67 | "name": "Wyoming", 68 | "abbreviation": "WY" 69 | }, 70 | "lat": "43.47" 71 | }, 72 | { 73 | "url": "http://www.kemmerer.org/", 74 | "long": "-110.53", 75 | "name": "Kemmerer", 76 | "state": { 77 | "name": "Wyoming", 78 | "abbreviation": "WY" 79 | }, 80 | "lat": "41.79" 81 | }, 82 | { 83 | "url": "http://www.ci.laramie.wy.us/", 84 | "long": "-105.59", 85 | "name": "Laramie", 86 | "state": { 87 | "name": "Wyoming", 88 | "abbreviation": "WY" 89 | }, 90 | "lat": "41.31" 91 | }, 92 | { 93 | "url": "http://lyman.govoffice.com/", 94 | "long": "-110.29", 95 | "name": "Lyman", 96 | "state": { 97 | "name": "Wyoming", 98 | "abbreviation": "WY" 99 | }, 100 | "lat": "41.32" 101 | }, 102 | { 103 | "url": "http://www.rawlins-wyoming.com/", 104 | "long": "-107.23", 105 | "name": "Rawlins", 106 | "state": { 107 | "name": "Wyoming", 108 | "abbreviation": "WY" 109 | }, 110 | "lat": "41.79" 111 | }, 112 | { 113 | "url": "http://www.riverton.wyoming.com/", 114 | "long": "-108.38", 115 | "name": "Riverton", 116 | "state": { 117 | "name": "Wyoming", 118 | "abbreviation": "WY" 119 | }, 120 | "lat": "43.02" 121 | }, 122 | { 123 | "url": "http://www.rswy.net/", 124 | "long": "-109.2", 125 | "name": "Rock Springs", 126 | "state": { 127 | "name": "Wyoming", 128 | "abbreviation": "WY" 129 | }, 130 | "lat": "41.58" 131 | }, 132 | { 133 | "url": "http://www.saratoga.govoffice2.com/", 134 | "long": "-106.8", 135 | "name": "Saratoga", 136 | "state": { 137 | "name": "Wyoming", 138 | "abbreviation": "WY" 139 | }, 140 | "lat": "41.45" 141 | }, 142 | { 143 | "url": "http://www.city-sheridan-wy.com/", 144 | "long": "-106.95", 145 | "name": "Sheridan", 146 | "state": { 147 | "name": "Wyoming", 148 | "abbreviation": "WY" 149 | }, 150 | "lat": "44.79" 151 | }, 152 | { 153 | "url": "http://www.thayne-wy.com/", 154 | "long": "-111", 155 | "name": "Thayne", 156 | "state": { 157 | "name": "Wyoming", 158 | "abbreviation": "WY" 159 | }, 160 | "lat": "42.92" 161 | }, 162 | { 163 | "url": "http://www.city-of-torrington.org/", 164 | "long": "-104.18", 165 | "name": "Torrington", 166 | "state": { 167 | "name": "Wyoming", 168 | "abbreviation": "WY" 169 | }, 170 | "lat": "42.06" 171 | }, 172 | { 173 | "url": "http://www.cityofworland.org/", 174 | "long": "-107.95", 175 | "name": "Worland", 176 | "state": { 177 | "name": "Wyoming", 178 | "abbreviation": "WY" 179 | }, 180 | "lat": "44.01" 181 | }, 182 | { 183 | "url": "http://www.wrightwyoming.com/", 184 | "long": "-105.47", 185 | "name": "Wright", 186 | "state": { 187 | "name": "Wyoming", 188 | "abbreviation": "WY" 189 | }, 190 | "lat": "43.74" 191 | } 192 | ] -------------------------------------------------------------------------------- /src/assets/data/genres.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 28, 4 | "text": "Action" 5 | }, 6 | { 7 | "id": 12, 8 | "text": "Adventure" 9 | }, 10 | { 11 | "id": 16, 12 | "text": "Animation" 13 | }, 14 | { 15 | "id": 35, 16 | "text": "Comedy" 17 | }, 18 | { 19 | "id": 80, 20 | "text": "Crime" 21 | }, 22 | { 23 | "id": 99, 24 | "text": "Documentary" 25 | }, 26 | { 27 | "id": 18, 28 | "text": "Drama" 29 | }, 30 | { 31 | "id": 10751, 32 | "text": "Family" 33 | }, 34 | { 35 | "id": 14, 36 | "text": "Fantasy" 37 | }, 38 | { 39 | "id": 36, 40 | "text": "History" 41 | }, 42 | { 43 | "id": 27, 44 | "text": "Horror" 45 | }, 46 | { 47 | "id": 10402, 48 | "text": "Music" 49 | }, 50 | { 51 | "id": 9648, 52 | "text": "Mystery" 53 | }, 54 | { 55 | "id": 10749, 56 | "text": "Romance" 57 | }, 58 | { 59 | "id": 878, 60 | "text": "Science Fiction" 61 | }, 62 | { 63 | "id": 10770, 64 | "text": "TV Movie" 65 | }, 66 | { 67 | "id": 53, 68 | "text": "Thriller" 69 | }, 70 | { 71 | "id": 10752, 72 | "text": "War" 73 | }, 74 | { 75 | "id": 37, 76 | "text": "Western" 77 | } 78 | ] 79 | -------------------------------------------------------------------------------- /src/assets/data/states.json: -------------------------------------------------------------------------------- 1 | /* 2 | by http://api.sba.gov/doc/ 3 | */ 4 | 5 | [ 6 | { 7 | "name": "Alabama", 8 | "abbreviation": "AL" 9 | }, 10 | { 11 | "name": "Alaska", 12 | "abbreviation": "AK" 13 | }, 14 | { 15 | "name": "Arizona", 16 | "abbreviation": "AZ" 17 | }, 18 | { 19 | "name": "Arkansas", 20 | "abbreviation": "AR" 21 | }, 22 | { 23 | "name": "California", 24 | "abbreviation": "CA" 25 | }, 26 | { 27 | "name": "Colorado", 28 | "abbreviation": "CO" 29 | }, 30 | { 31 | "name": "Connecticut", 32 | "abbreviation": "CT" 33 | }, 34 | { 35 | "name": "Delaware", 36 | "abbreviation": "DE" 37 | }, 38 | { 39 | "name": "Florida", 40 | "abbreviation": "FL" 41 | }, 42 | { 43 | "name": "Georgia", 44 | "abbreviation": "GA" 45 | }, 46 | { 47 | "name": "Idaho", 48 | "abbreviation": "ID" 49 | }, 50 | { 51 | "name": "Illinois", 52 | "abbreviation": "IL" 53 | }, 54 | { 55 | "name": "Indiana", 56 | "abbreviation": "IN" 57 | }, 58 | { 59 | "name": "Iowa", 60 | "abbreviation": "IA" 61 | }, 62 | { 63 | "name": "Kansas", 64 | "abbreviation": "KS" 65 | }, 66 | { 67 | "name": "Kentucky", 68 | "abbreviation": "KY" 69 | }, 70 | { 71 | "name": "Louisiana", 72 | "abbreviation": "LA" 73 | }, 74 | { 75 | "name": "Maine", 76 | "abbreviation": "ME" 77 | }, 78 | { 79 | "name": "Maryland", 80 | "abbreviation": "MD" 81 | }, 82 | { 83 | "name": "Massachusetts", 84 | "abbreviation": "MA" 85 | }, 86 | { 87 | "name": "Michigan", 88 | "abbreviation": "MI" 89 | }, 90 | { 91 | "name": "Minnesota", 92 | "abbreviation": "MN" 93 | }, 94 | { 95 | "name": "Mississippi", 96 | "abbreviation": "MS" 97 | }, 98 | { 99 | "name": "Missouri", 100 | "abbreviation": "MO" 101 | }, 102 | { 103 | "name": "Montana", 104 | "abbreviation": "MT" 105 | }, 106 | { 107 | "name": "Nebraska", 108 | "abbreviation": "NE" 109 | }, 110 | { 111 | "name": "Nevada", 112 | "abbreviation": "NV" 113 | }, 114 | { 115 | "name": "New Hampshire", 116 | "abbreviation": "NH" 117 | }, 118 | { 119 | "name": "New Jersey", 120 | "abbreviation": "NJ" 121 | }, 122 | { 123 | "name": "New Mexico", 124 | "abbreviation": "NM" 125 | }, 126 | { 127 | "name": "New York", 128 | "abbreviation": "NY" 129 | }, 130 | { 131 | "name": "North Carolina", 132 | "abbreviation": "NC" 133 | }, 134 | { 135 | "name": "North Dakota", 136 | "abbreviation": "ND" 137 | }, 138 | { 139 | "name": "Ohio", 140 | "abbreviation": "OH" 141 | }, 142 | { 143 | "name": "Oklahoma", 144 | "abbreviation": "OK" 145 | }, 146 | { 147 | "name": "Oregon", 148 | "abbreviation": "OR" 149 | }, 150 | { 151 | "name": "Pennsylvania", 152 | "abbreviation": "PA" 153 | }, 154 | { 155 | "name": "Rhode Island", 156 | "abbreviation": "RI" 157 | }, 158 | { 159 | "name": "South Carolina", 160 | "abbreviation": "SC" 161 | }, 162 | { 163 | "name": "South Dakota", 164 | "abbreviation": "SD" 165 | }, 166 | { 167 | "name": "Tennessee", 168 | "abbreviation": "TN" 169 | }, 170 | { 171 | "name": "Texas", 172 | "abbreviation": "TX" 173 | }, 174 | { 175 | "name": "Utah", 176 | "abbreviation": "UT" 177 | }, 178 | { 179 | "name": "Vermont", 180 | "abbreviation": "VT" 181 | }, 182 | { 183 | "name": "Virginia", 184 | "abbreviation": "VA" 185 | }, 186 | { 187 | "name": "Washington", 188 | "abbreviation": "WA" 189 | }, 190 | { 191 | "name": "West Virginia", 192 | "abbreviation": "WV" 193 | }, 194 | { 195 | "name": "Wisconsin", 196 | "abbreviation": "WI" 197 | }, 198 | { 199 | "name": "Wyoming", 200 | "abbreviation": "WY" 201 | } 202 | ] 203 | -------------------------------------------------------------------------------- /src/components/deni-react-treeview-item/DeniReactTreeViewItem.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import './DeniReactTreeViewItem.scss' 3 | 4 | import { 5 | getClassItem, 6 | getClassIcon, 7 | getClassExpandButton, 8 | getClassCheckbox, 9 | getClassIconAndText, 10 | getInnerText, 11 | treeviewItemContainerDoubleClick, 12 | treeviewItemContainerMouseDown, 13 | treeviewItemExpandButtonMouseDown, 14 | treeviewItemCheckboxMouseDown 15 | } from './DeniReactTreeviewItemHelper' 16 | import { DeniReactTreeviewItemProps } from './DeniReactTreeViewItemProps'; 17 | 18 | 19 | class DeniReactTreeViewItem extends React.Component { 20 | constructor(props) { 21 | super(props); 22 | this.state = { loading: false } 23 | } 24 | 25 | render() { 26 | const { treeview, item, level } = this.props 27 | const { selectRow, marginItems } = treeview.props 28 | const marginItem = marginItems ? parseInt(marginItems.toString()) : 30 29 | 30 | const marginLeft = 5; 31 | const marginLeftItems: number = level === 0 ? 0 : (treeview.props['showRoot'] ? level * marginItem : (level - 1) * marginItem); 32 | const cssStyle: any = { 33 | paddingLeft: (marginLeft + marginLeftItems) + 'px', 34 | } 35 | if (!treeview.props['showRoot'] && this.props.root) { 36 | cssStyle.display = 'none'; 37 | } 38 | 39 | return ( 40 |
46 |
50 | 51 |
55 | 56 |
57 |
58 |
59 | {getInnerText(treeview, item)} 60 |
61 |
62 | 63 |
64 | ) 65 | } 66 | 67 | } 68 | 69 | export default DeniReactTreeViewItem; -------------------------------------------------------------------------------- /src/components/deni-react-treeview-item/DeniReactTreeViewItemProps.ts: -------------------------------------------------------------------------------- 1 | import DeniReactTreeView from '../deni-react-treeview/DeniReactTreeView'; 2 | 3 | export interface DeniReactTreeviewItemProps { 4 | treeview: DeniReactTreeView, 5 | item: number, 6 | parent?: any, 7 | level: number, 8 | root?: any, 9 | selectRow?: boolean, 10 | expandAll?: boolean 11 | } 12 | -------------------------------------------------------------------------------- /src/components/deni-react-treeview-item/DeniReactTreeviewItemConsts.ts: -------------------------------------------------------------------------------- 1 | export const CHECKBOX_STATE = { 2 | CHECKED: 1, 3 | UNCHECKED: 2, 4 | UNDETERMINED: 3 5 | } 6 | -------------------------------------------------------------------------------- /src/components/deni-react-treeview-item/action-buttons/ActionButtons.scss: -------------------------------------------------------------------------------- 1 | .action-buttons-container { 2 | display: flex; 3 | flex: 1; 4 | justify-content: space-around; 5 | 6 | .action-buttons-container-text { 7 | flex: 1; 8 | justify-content: space-around; 9 | } 10 | 11 | .action-button { 12 | margin-right: 5px; 13 | cursor: pointer; 14 | opacity: 0.3; 15 | visibility: hidden; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/components/deni-react-treeview-item/action-buttons/ActionButtons.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import './ActionButtons.scss' 3 | import { ActionButtonsProps } from './ActionButtonsProps'; 4 | 5 | class ActionButtons extends React.Component { 6 | 7 | constructor(props) { 8 | super(props) 9 | } 10 | 11 | onClick(item, actionButton) { 12 | debugger 13 | console.log(this.props.onActionButtonClick) 14 | alert('sdjçflsjdflkdsjflçkdsj') 15 | } 16 | 17 | render() { 18 | const actionButtons: JSX.Element[] = this.props.buttons.map((actionButton, index) => { 19 | return ( 20 | 26 | {actionButton} 27 | 28 | ); 29 | }) 30 | 31 | return ( 32 |
33 | {this.props.item.text} 34 | {actionButtons} 35 |
36 | ) 37 | } 38 | 39 | } 40 | 41 | export default ActionButtons; -------------------------------------------------------------------------------- /src/components/deni-react-treeview-item/action-buttons/ActionButtonsProps.ts: -------------------------------------------------------------------------------- 1 | export interface ActionButtonsProps { 2 | buttons: any[], 3 | item: any, 4 | onActionButtonClick?: (item: any, actionButton: any) => void 5 | } 6 | -------------------------------------------------------------------------------- /src/components/deni-react-treeview-item/action-buttons/index.ts: -------------------------------------------------------------------------------- 1 | import ActionButtons from './ActionButtons' 2 | 3 | export default ActionButtons; 4 | -------------------------------------------------------------------------------- /src/components/deni-react-treeview/DeniReactTreeView.scss: -------------------------------------------------------------------------------- 1 | @import '../styles/style-base.scss'; 2 | 3 | .deni-react-treeview-container { 4 | font-family: tahoma,arial; 5 | font-size: 12px; 6 | padding: 0px; 7 | overflow-x: auto; 8 | overflow-y: auto; 9 | border: solid 1px; 10 | border-color: lighten($base-color, 2%); 11 | width: 400px; 12 | height: 350px; 13 | background-color: lighten(#f2f2f2, 3%); 14 | 15 | * { 16 | box-sizing: border-box; 17 | 18 | &.unselectable { 19 | @include unselectable; 20 | } 21 | 22 | } 23 | 24 | &.loading { 25 | background-image: url('data:image/gif;base64,R0lGODlhEAAQALMMAKqooJGOhp2bk7e1rZ2bkre1rJCPhqqon8PBudDOxXd1bISCef///wAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQFAAAMACwAAAAAEAAQAAAET5DJyYyhmAZ7sxQEs1nMsmACGJKmSaVEOLXnK1PuBADepCiMg/DQ+/2GRI8RKOxJfpTCIJNIYArS6aRajWYZCASDa41Ow+Fx2YMWOyfpTAQAIfkEBQAADAAsAAAAABAAEAAABE6QyckEoZgKe7MEQMUxhoEd6FFdQWlOqTq15SlT9VQM3rQsjMKO5/n9hANixgjc9SQ/CgKRUSgw0ynFapVmGYkEg3v1gsPibg8tfk7CnggAIfkEBQAADAAsAAAAABAAEAAABE2QycnOoZjaA/IsRWV1goCBoMiUJTW8A0XMBPZmM4Ug3hQEjN2uZygahDyP0RBMEpmTRCKzWGCkUkq1SsFOFQrG1tr9gsPc3jnco4A9EQAh+QQFAAAMACwAAAAAEAAQAAAETpDJyUqhmFqbJ0LMIA7McWDfF5LmAVApOLUvLFMmlSTdJAiM3a73+wl5HYKSEET2lBSFIhMIYKRSimFriGIZiwWD2/WCw+Jt7xxeU9qZCAAh+QQFAAAMACwAAAAAEAAQAAAETZDJyRCimFqbZ0rVxgwF9n3hSJbeSQ2rCWIkpSjddBzMfee7nQ/XCfJ+OQYAQFksMgQBxumkEKLSCfVpMDCugqyW2w18xZmuwZycdDsRACH5BAUAAAwALAAAAAAQABAAAARNkMnJUqKYWpunUtXGIAj2feFIlt5JrWybkdSydNNQMLaND7pC79YBFnY+HENHMRgyhwPGaQhQotGm00oQMLBSLYPQ9QIASrLAq5x0OxEAIfkEBQAADAAsAAAAABAAEAAABE2QycmUopham+da1cYkCfZ94UiW3kmtbJuRlGF0E4Iwto3rut6tA9wFAjiJjkIgZAYDTLNJgUIpgqyAcTgwCuACJssAdL3gpLmbpLAzEQA7'); 26 | background-repeat: no-repeat; 27 | background-position-x: 6px; 28 | background-position-y: 6px; 29 | // &:before { 30 | // content: ' ' 31 | // } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/components/deni-react-treeview/DeniReactTreeView.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import './DeniReactTreeView.scss' 3 | import DeniReactTreeViewItem from '../deni-react-treeview-item/DeniReactTreeViewItem' 4 | import { deniReactTreeviewApi } from './DeniReactTreeviewApi' 5 | import { loadingSetup, setTheme } from './DeniReactTreeviewHelper' 6 | import { DeniReactTreeviewProps } from './DeniReactTreeviewProps'; 7 | 8 | 9 | interface DeniReactTreeviewState { 10 | loading: boolean, 11 | theme: string, 12 | expandAll?: boolean, 13 | } 14 | 15 | class DeniReactTreeView extends React.Component { 16 | api: any; 17 | container: any; 18 | 19 | constructor(props: DeniReactTreeviewProps) { 20 | super(props); 21 | this.state = { 22 | loading: false, 23 | theme: props.theme || 'classic', 24 | expandAll: props.expandAll, 25 | }; 26 | this.expandAllFinished = this.expandAllFinished.bind(this); 27 | } 28 | 29 | componentDidUpdate(prevProps, prevState) { 30 | const { items } = this.props; 31 | const rootItem = this.api.getRootItem() 32 | if (prevProps.items !== items) { 33 | rootItem.children = items; 34 | //treeviewHelper.loadData.call(this, this.props.items); 35 | } 36 | if (prevState.rootItem !== rootItem && this.state.expandAll) { 37 | this.expandAllFinished(); 38 | } 39 | } 40 | 41 | componentDidMount() { 42 | this.api = deniReactTreeviewApi(this); 43 | setTheme(this, this.props.theme || 'classic'); 44 | loadingSetup(this); 45 | } 46 | 47 | expandAllFinished() { 48 | this.setState({ expandAll: false }); 49 | } 50 | 51 | render() { 52 | const rootItem = this.api ? this.api.getRootItem() : undefined 53 | const domTreeviewItem = (); 54 | let children = rootItem && rootItem.children; 55 | if (children && children.length === 0) { 56 | if (this.props.items && this.props.items.length > 0) { 57 | children = this.props.items; 58 | } 59 | } 60 | let className = 'deni-react-treeview-container unselectable ' + this.state.theme; 61 | if (this.props.className) { 62 | className += ' ' + this.props.className; 63 | } 64 | const hasItems = (children !== undefined && children.length > 0); 65 | if (this.state.loading && (!this.props.lazyLoad || !hasItems)) { 66 | className += ' loading'; 67 | } 68 | const showComponent = hasItems && (!this.state.loading || this.props.lazyLoad); 69 | const style = this.props.style || undefined 70 | 71 | return ( 72 | (showComponent) ? ( 73 |
this.container = elem} className={className} style={style} > 74 | {domTreeviewItem} 75 | {_createComponentsChildren(this, domTreeviewItem, 1, children, this.state.expandAll)} 76 |
77 | ) :
78 | ) 79 | } 80 | 81 | } 82 | 83 | //DeniReactTreeView.propTypes = treeviewProps.propTypes; 84 | //DeniReactTreeView.defaultProps = treeviewProps.defaultProps; 85 | 86 | function _createComponentsChildren(treeview, parent, level, children, expandAll = false) { 87 | if (expandAll) { 88 | children = children.map(c => { 89 | c.expanded = true; 90 | return c; 91 | }); 92 | } 93 | return ( 94 |
95 | { 96 | (parent.props.item && parent.props.item.expanded && children && children.length) ? 97 | children.map(function (child) { 98 | const domTreeviewItem = ; 105 | return ( 106 |
107 | {domTreeviewItem} 108 | {_createComponentsChildren(treeview, domTreeviewItem, level + 1, child.children)} 109 |
110 | ) 111 | }) 112 | : undefined 113 | } 114 |
115 | ); 116 | } 117 | 118 | export default DeniReactTreeView; -------------------------------------------------------------------------------- /src/components/deni-react-treeview/DeniReactTreeviewApi.ts: -------------------------------------------------------------------------------- 1 | import DeniReactTreeviewApiImpl from './DeniReactTreeviewApiImpl' 2 | import { load, loadData, setTheme } from './DeniReactTreeviewHelper' 3 | 4 | const deniReactTreeviewApi = scope => { 5 | return { 6 | 7 | // 8 | // 9 | // 10 | addItem: (text, isLeaf, parentNode) => { 11 | return DeniReactTreeviewApiImpl.addItem(scope, text, isLeaf, parentNode); 12 | }, 13 | 14 | // 15 | // folderToFind can be passed as a "id" or as a "object" ex: 16 | // 17 | // treeviewEl.api.findFolder(456) //456 is a id value or 18 | // treeviewEl.api.findFolder({name: 'Brazil'}) //it will searches for the first folder that match the passed data and leaf is not true 19 | // 20 | findFolder: (folderToFind) => { 21 | return DeniReactTreeviewApiImpl.findFolder(scope, folderToFind); 22 | }, 23 | 24 | // 25 | // Expand all the children from the rootItem recursively 26 | expandAll: () => { 27 | DeniReactTreeviewApiImpl.expandAll(scope); 28 | }, 29 | // 30 | // folderToFind can be passed as a "id" or as a "object" ex: 31 | // 32 | // treeviewEl.api.findFolder(456) //456 is a id value or 33 | // treeviewEl.api.findFolder({name: 'Brazil'}) //it will searches for the first folder that match the passed data and leaf is not true 34 | // 35 | findNode: (nodeToFind) => { 36 | return DeniReactTreeviewApiImpl.findNode(scope, nodeToFind); 37 | }, 38 | 39 | // 40 | // itemToFind can be passed as a "id" or as a "object" ex: 41 | // 42 | // treeviewEl.api.findItem(357) //357 is a id value or 43 | // treeviewEl.api.findItem({name: 'Dog'}) //it will searches for the first item that match the passed data and leaf is true 44 | // 45 | findItem: (itemToFind) => { 46 | return DeniReactTreeviewApiImpl.findItem(scope, itemToFind); 47 | }, 48 | 49 | // 50 | // 51 | // 52 | getItems: () => { 53 | return DeniReactTreeviewApiImpl.getItems(scope); 54 | }, 55 | 56 | // 57 | // 58 | // 59 | getParentNode: (item) => { 60 | return DeniReactTreeviewApiImpl.getParentNode(scope, item); 61 | }, 62 | 63 | 64 | // 65 | // 66 | // 67 | getRootItem: () => { 68 | return DeniReactTreeviewApiImpl.getRootItem(scope); 69 | }, 70 | 71 | // 72 | // 73 | // 74 | getSelectedItem: () => { 75 | return DeniReactTreeviewApiImpl.getSelectedItem(scope); 76 | }, 77 | 78 | // 79 | // 80 | // 81 | load: item => load(scope, item), 82 | 83 | // 84 | // 85 | // 86 | loadData: loadData.bind(scope), 87 | 88 | // 89 | // 90 | // 91 | removeItem: (id) => { 92 | DeniReactTreeviewApiImpl.removeItem(scope, id); 93 | }, 94 | 95 | // 96 | // itemToFind can be passed as a "id" or as a "object" ex: 97 | // 98 | // treeviewEl.api.selectItem(357) //357 is a id value or 99 | // treeviewEl.api.selectItem({name: 'Dog'}) //it will searches for the first item that match the passed data and leaf is true 100 | // 101 | selectItem: (itemToFind) => { 102 | DeniReactTreeviewApiImpl.selectItem(scope, itemToFind); 103 | }, 104 | 105 | // 106 | // 107 | // 108 | setTheme: (newTheme) => { 109 | setTheme(scope, newTheme); 110 | }, 111 | 112 | } 113 | 114 | } 115 | 116 | export { 117 | deniReactTreeviewApi 118 | }; -------------------------------------------------------------------------------- /src/components/deni-react-treeview/DeniReactTreeviewConsts.ts: -------------------------------------------------------------------------------- 1 | export const ROOT_ITEM = { 2 | id: -1, 3 | text: 'root', 4 | expanded: true, 5 | root: true 6 | } -------------------------------------------------------------------------------- /src/components/deni-react-treeview/DeniReactTreeviewHelper.ts: -------------------------------------------------------------------------------- 1 | import {ROOT_ITEM} from './DeniReactTreeviewConsts' 2 | import axios from 'axios'; 3 | 4 | const loadingSetup = treeview => { 5 | //by props.url 6 | if (treeview.props.url || treeview.props.json || treeview.props.lazyLoad) { 7 | if (treeview.props.autoLoad !== false) { 8 | treeview.api.load(); 9 | } 10 | } else { 11 | //by props.items 12 | if (treeview.props.items) { 13 | treeview.api.loadData(treeview, treeview.props.items); 14 | } 15 | } 16 | } 17 | 18 | const setTheme = (treeview, newTheme) => { 19 | const theme = newTheme || 'classic'; 20 | require('../styles/themes/' + theme + '-theme.scss') 21 | treeview.setState({ theme }); 22 | } 23 | 24 | const load = (treeview, item) => { 25 | treeview.setState({ 26 | loading: true 27 | }); 28 | 29 | return new Promise(function(success, reject) { 30 | 31 | if (treeview.props.url || treeview.props.json) { 32 | let urlToLoad = treeview.props.url || treeview.props.json; 33 | if (treeview.props.lazyLoad) { 34 | const currentItem = item || treeview.state.rootItem || ROOT_ITEM; 35 | delete currentItem['children']; 36 | urlToLoad += '?lazyLoad=true&item=' + JSON.stringify(currentItem); 37 | } 38 | 39 | axios.get(urlToLoad) 40 | .then(res => { 41 | treeview.setState({ 42 | loading: false 43 | }); 44 | treeview.api.loadData(treeview, res.data, item); 45 | success(res.data); 46 | }) 47 | .catch(error => { 48 | console.error(`Error loading data: ${error.message}`) 49 | }) 50 | } else if (treeview.props.lazyLoad) { 51 | treeview.setState({ 52 | loading: false 53 | }); 54 | reject('TODO: under construction'); 55 | } else { 56 | treeview.setState({ 57 | loading: false 58 | }); 59 | const msg = 'To use load function you must define lazyLoad:true or a valid url.'; 60 | console.error(msg); 61 | reject(msg); 62 | } 63 | }); 64 | } 65 | 66 | // 67 | // item is a optional param that when it is set data must be an array (children) 68 | // 69 | const loadData = (treeview, data, item) => { 70 | // 71 | const dataToLoad = data || []; 72 | 73 | //onBeforeLoad event 74 | if (treeview.props.onBeforeLoad) { 75 | treeview.props.onBeforeLoad(dataToLoad, item); 76 | } 77 | 78 | // 79 | if (item) { 80 | // 81 | if (dataToLoad instanceof Array) { 82 | item.children = dataToLoad; 83 | } else { 84 | throw new Error('When item param is set the data must be an array.'); 85 | } 86 | } else { 87 | treeview.setState({ 88 | rootItem: _resolveRootItem(dataToLoad) 89 | }); 90 | } 91 | 92 | //onAfterLoad event 93 | if (treeview.props.onAfterLoad) { 94 | treeview.props.onAfterLoad(dataToLoad, item); 95 | } 96 | 97 | } 98 | 99 | function _resolveRootItem(items) { 100 | let rootItem = Object.assign({}, ROOT_ITEM); 101 | 102 | if (items) { 103 | if (items instanceof Array) { 104 | rootItem['children'] = items; 105 | } else if (items instanceof Object) { 106 | rootItem = items; 107 | } else { 108 | throw new Error('Parameter "items" adjusted in a wrong way.'); 109 | } 110 | return rootItem; 111 | } 112 | return null; 113 | } 114 | 115 | export { 116 | loadingSetup, 117 | setTheme, 118 | load, 119 | loadData 120 | }; -------------------------------------------------------------------------------- /src/components/deni-react-treeview/DeniReactTreeviewProps.ts: -------------------------------------------------------------------------------- 1 | import { CSSProperties } from "react"; 2 | import DeniReactTreeView from "./DeniReactTreeView"; 3 | 4 | export interface DeniReactTreeviewProps { 5 | className?: string, 6 | style?: CSSProperties, 7 | actionButtons?: JSX.Element[], 8 | autoLoad?: boolean, 9 | json?: string, 10 | items?: any[], 11 | lazyLoad?: boolean, 12 | expandAll?: boolean, 13 | marginItems?: string | number, 14 | onAfterLoad?: (data: any, item: any) => void; 15 | onBeforeLoad?: (data: any, item: any) => void; 16 | onRenderItem?: (item: any, treeview: DeniReactTreeView) => JSX.Element; 17 | onSelectItem?: (item: any) => void; 18 | onCheckItem?: void, 19 | selectRow?: boolean, 20 | showCheckbox?: boolean, 21 | showIcon?: boolean, 22 | showRoot?: boolean, 23 | theme?: string, 24 | url?: string, 25 | 26 | onActionButtonClick?: (item: any, actionButton: any) => void; 27 | } -------------------------------------------------------------------------------- /src/components/index.ts: -------------------------------------------------------------------------------- 1 | import DeniReactTreeView from './deni-react-treeview/DeniReactTreeView'; 2 | export default DeniReactTreeView -------------------------------------------------------------------------------- /src/components/styles/style-base.scss: -------------------------------------------------------------------------------- 1 | $blue: #9DC2E1; 2 | $red: #ff8080; 3 | $green: #9ce2da; //#80ff80; 4 | $silver: #bfbfbf; 5 | $moonlight: #bfbfbf; 6 | $orange: #ffd280; 7 | $purple: #ff80ff; 8 | $metro: #b1b8cd; 9 | $base-color: $blue; 10 | 11 | @mixin unselectable { 12 | -webkit-touch-callout: none; /* iOS Safari */ 13 | -webkit-user-select: none; /* Chrome/Safari/Opera */ 14 | -khtml-user-select: none; /* Konqueror */ 15 | -moz-user-select: none; /* Firefox */ 16 | -ms-user-select: none; /* Internet Explorer/Edge */ 17 | user-select: none; /* Non-prefixed version, currently 18 | not supported by any browser */ 19 | } 20 | 21 | @mixin gradient-background ($end-color) { 22 | $selection-background-start-color: lighten($end-color, 20%); 23 | background: $selection-background-start-color; /* Old browsers */ 24 | background: -moz-linear-gradient(top, $selection-background-start-color 0%, $end-color 100%); /* FF3.6-15 */ 25 | background: -webkit-linear-gradient(top, $selection-background-start-color 0%,$end-color 100%); /* Chrome10-25,Safari5.1-6 */ 26 | background: linear-gradient(to bottom, $selection-background-start-color 0%, $end-color 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */ 27 | filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=$selection-background-start-color, endColorstr=$end-color,GradientType=0 ); /* IE6-9 */ 28 | } 29 | 30 | @mixin base-color($color: $blue) { 31 | $base-color: $color; 32 | } 33 | -------------------------------------------------------------------------------- /src/components/styles/themes/base-theme.scss: -------------------------------------------------------------------------------- 1 | @import '../style-base.scss'; 2 | @import './icons-theme.scss'; 3 | 4 | @mixin set-theme($theme-base-color: $base-color) { 5 | $base-color: $theme-base-color; 6 | color: darken($base-color, 45%) !important; 7 | 8 | border-color: darken($base-color, 10%) !important; 9 | 10 | &:hover { 11 | &.select-row { 12 | background-color: lighten($base-color, 20%); 13 | } 14 | &:not(.select-row) { 15 | background-color: transparent; 16 | } 17 | } 18 | 19 | &.selected { 20 | @include gradient-background($base-color); 21 | outline-color: lighten($base-color, 10%) !important; 22 | } 23 | .checkbox { 24 | border-color: lighten($base-color, 4%) !important; 25 | &.selected { 26 | border-color: darken($base-color, 8%) !important; 27 | } 28 | } 29 | .expand-button { 30 | color: darken($base-color, 45%) !important; 31 | } 32 | 33 | .icon-and-text { 34 | &:hover { 35 | &.select-row { 36 | background-color: transparent; 37 | } 38 | &:not(.select-row) { 39 | background-color: lighten($base-color, 20%); 40 | } 41 | } 42 | &.select-row { 43 | border: 0; 44 | padding: 1px; 45 | } 46 | &.selected { 47 | @include gradient-background($base-color); 48 | } 49 | 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/components/styles/themes/classic-theme.scss: -------------------------------------------------------------------------------- 1 | @import '../style-base.scss'; 2 | @import './base-theme.scss'; 3 | 4 | .deni-react-treeview-container.classic { 5 | border-color: lighten($blue, 2%); 6 | 7 | .deni-react-treeview-item-container.classic { 8 | @include set-theme($blue); 9 | 10 | .icon-and-text { 11 | .icon { 12 | background-image: $closed-folder-icon-blue-16; 13 | 14 | &.isleaf { 15 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACjElEQVR42o2SW0hUURSG/32OhnhAqJDCzF6kN0lLGtJCtLQyKIMotRjBy1sqVEZS9mKZBdKFHBJpJEKD0urBvAchhqY5kp6MHkRlMhpHR2fOHuZybu3KxhEr+/fL3g/rWx9rL4Kl1La+ta0XwiNUTVf9sgJF0yB5FVCfAqt9Lnx8yt7Ph4Qc6btVtIigkN+XJ28s9MTeHQLPETipF3aXB7NOJ2wLXnyamYVlwgq/jN5Fj+9QX3WhZxXg8ethmpMSzwA666rDxSBOKsHhViBa7XC5ndgWuRH1PSP9XlnJZJDFFYBHXe/p6bQEIanoGTZECJDhh98jg6gc5ue+oqwkBXlp8TB3WfBiYLx3yuYwiqbS6QDA3DVEjWk7BZ7n8Kc09IzAEBsFm+RG6+BndFsmhsdMxYkBwIO2d7QwI1HIrmgH0XmEMo7MA5qiQ9PZQF0SrDNOpBq2YPPWcLT0i+KYqTQuALjzvJeePZr8V4Nf0fHF4cD49DzKHnaKo7Uly4Cqpg568WS6kH21GxpREIZQEKKxEo4ZaXDJfrgWJBwwxGBPfDTONbxigOJlQLm5jVYaD65hAHgUP77ZKY5fbxI/BAPOm9vpTWOGkH2lExzHIKwrYYcnPNQwnhnpkKjGukciddcm5N9tFkdNJasBaxnouo5J2wKOVTaKYjDggrmDVhvThVOX2S9wPOu8tGnk5+zAMRPqk7HfEI2kuEjk32tmvxAEKK1rpTUFh9c00JjBFDPIYgYrAAW3W2hdcZaQU9GGdWwJOMIFCnRNxY+X5FaxLyEK6ckxOFPzdCUg90YjbbyUK+A/Mk89yCyvFwfvBy1SbF6VLWF7TIRPUdV/FRNNh6qowsDHyaG5l9d2fwfyXD4gAGnljAAAAABJRU5ErkJggg=='); 16 | } 17 | 18 | &.expanded { 19 | background-image: $opened-folder-icon-blue-16; 20 | } 21 | } 22 | } 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/components/styles/themes/green-theme.scss: -------------------------------------------------------------------------------- 1 | @import '../style-base.scss'; 2 | @import './base-theme.scss'; 3 | 4 | .deni-react-treeview-container.green { 5 | border-color: lighten($green, 2%); 6 | 7 | .deni-react-treeview-item-container.green { 8 | @include set-theme($green); 9 | 10 | .icon-and-text { 11 | .icon { 12 | background-image: $closed-folder-icon-green-16; 13 | 14 | &.isleaf { 15 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACjElEQVR42o2SW0hUURSG/32OhnhAqJDCzF6kN0lLGtJCtLQyKIMotRjBy1sqVEZS9mKZBdKFHBJpJEKD0urBvAchhqY5kp6MHkRlMhpHR2fOHuZybu3KxhEr+/fL3g/rWx9rL4Kl1La+ta0XwiNUTVf9sgJF0yB5FVCfAqt9Lnx8yt7Ph4Qc6btVtIigkN+XJ28s9MTeHQLPETipF3aXB7NOJ2wLXnyamYVlwgq/jN5Fj+9QX3WhZxXg8ethmpMSzwA666rDxSBOKsHhViBa7XC5ndgWuRH1PSP9XlnJZJDFFYBHXe/p6bQEIanoGTZECJDhh98jg6gc5ue+oqwkBXlp8TB3WfBiYLx3yuYwiqbS6QDA3DVEjWk7BZ7n8Kc09IzAEBsFm+RG6+BndFsmhsdMxYkBwIO2d7QwI1HIrmgH0XmEMo7MA5qiQ9PZQF0SrDNOpBq2YPPWcLT0i+KYqTQuALjzvJeePZr8V4Nf0fHF4cD49DzKHnaKo7Uly4Cqpg568WS6kH21GxpREIZQEKKxEo4ZaXDJfrgWJBwwxGBPfDTONbxigOJlQLm5jVYaD65hAHgUP77ZKY5fbxI/BAPOm9vpTWOGkH2lExzHIKwrYYcnPNQwnhnpkKjGukciddcm5N9tFkdNJasBaxnouo5J2wKOVTaKYjDggrmDVhvThVOX2S9wPOu8tGnk5+zAMRPqk7HfEI2kuEjk32tmvxAEKK1rpTUFh9c00JjBFDPIYgYrAAW3W2hdcZaQU9GGdWwJOMIFCnRNxY+X5FaxLyEK6ckxOFPzdCUg90YjbbyUK+A/Mk89yCyvFwfvBy1SbF6VLWF7TIRPUdV/FRNNh6qowsDHyaG5l9d2fwfyXD4gAGnljAAAAABJRU5ErkJggg=='); 16 | } 17 | 18 | &.expanded { 19 | background-image: $opened-folder-icon-green-16; 20 | } 21 | } 22 | } 23 | 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/components/styles/themes/metro-theme.scss: -------------------------------------------------------------------------------- 1 | @import '../style-base.scss'; 2 | @import './base-theme.scss'; 3 | 4 | .deni-react-treeview-container.metro { 5 | background-color: darken($metro, 50%) !important; 6 | border-color: lighten($metro, 2%); 7 | 8 | .deni-react-treeview-item-container.metro { 9 | color: lighten($base-color, 15%) !important; 10 | 11 | &:hover { 12 | background-color: transparent !important; 13 | } 14 | 15 | &.selected { 16 | @include gradient-background(darken($base-color, 52%)); 17 | outline-color: darken($base-color, 5%) !important; 18 | } 19 | .checkbox { 20 | border-color: lighten($base-color, 4%) !important; 21 | &.selected { 22 | border-color: darken($base-color, 15%) !important; 23 | background-color: transparent; 24 | } 25 | } 26 | .expand-button { 27 | color: lighten($base-color, 15%) !important; 28 | } 29 | .icon-and-text { 30 | &:hover { 31 | background-color: transparent !important; 32 | } 33 | &.selected { 34 | @include gradient-background(darken($base-color, 42%)); 35 | border-color: darken($base-color, 2%); 36 | } 37 | .icon { 38 | background-image: $closed-folder-icon-metro-16; 39 | 40 | &.isleaf { 41 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACjElEQVR42o2SW0hUURSG/32OhnhAqJDCzF6kN0lLGtJCtLQyKIMotRjBy1sqVEZS9mKZBdKFHBJpJEKD0urBvAchhqY5kp6MHkRlMhpHR2fOHuZybu3KxhEr+/fL3g/rWx9rL4Kl1La+ta0XwiNUTVf9sgJF0yB5FVCfAqt9Lnx8yt7Ph4Qc6btVtIigkN+XJ28s9MTeHQLPETipF3aXB7NOJ2wLXnyamYVlwgq/jN5Fj+9QX3WhZxXg8ethmpMSzwA666rDxSBOKsHhViBa7XC5ndgWuRH1PSP9XlnJZJDFFYBHXe/p6bQEIanoGTZECJDhh98jg6gc5ue+oqwkBXlp8TB3WfBiYLx3yuYwiqbS6QDA3DVEjWk7BZ7n8Kc09IzAEBsFm+RG6+BndFsmhsdMxYkBwIO2d7QwI1HIrmgH0XmEMo7MA5qiQ9PZQF0SrDNOpBq2YPPWcLT0i+KYqTQuALjzvJeePZr8V4Nf0fHF4cD49DzKHnaKo7Uly4Cqpg568WS6kH21GxpREIZQEKKxEo4ZaXDJfrgWJBwwxGBPfDTONbxigOJlQLm5jVYaD65hAHgUP77ZKY5fbxI/BAPOm9vpTWOGkH2lExzHIKwrYYcnPNQwnhnpkKjGukciddcm5N9tFkdNJasBaxnouo5J2wKOVTaKYjDggrmDVhvThVOX2S9wPOu8tGnk5+zAMRPqk7HfEI2kuEjk32tmvxAEKK1rpTUFh9c00JjBFDPIYgYrAAW3W2hdcZaQU9GGdWwJOMIFCnRNxY+X5FaxLyEK6ckxOFPzdCUg90YjbbyUK+A/Mk89yCyvFwfvBy1SbF6VLWF7TIRPUdV/FRNNh6qowsDHyaG5l9d2fwfyXD4gAGnljAAAAABJRU5ErkJggg=='); 42 | } 43 | 44 | &.expanded { 45 | background-image: $opened-folder-icon-metro-16; 46 | } 47 | } 48 | } 49 | 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/components/styles/themes/moonlight-theme.scss: -------------------------------------------------------------------------------- 1 | @import '../style-base.scss'; 2 | @import './base-theme.scss'; 3 | 4 | .deni-react-treeview-container.moonlight { 5 | background-color: darken($moonlight, 50%) !important; 6 | border-color: lighten($moonlight, 2%); 7 | 8 | .deni-react-treeview-item-container.moonlight { 9 | color: lighten($base-color, 15%) !important; 10 | 11 | &:hover { 12 | background-color: transparent !important; 13 | } 14 | 15 | &.selected { 16 | @include gradient-background(#E59E06); 17 | outline-color: darken($base-color, 5%) !important; 18 | color: darken($base-color, 80%) !important; 19 | } 20 | .checkbox { 21 | border-color: lighten($base-color, 30%) !important; 22 | &.selected { 23 | //border-color: darken($base-color, 20%) !important; 24 | background-color: transparent; 25 | } 26 | } 27 | .expand-button { 28 | color: lighten($base-color, 15%) !important; 29 | } 30 | .icon-and-text { 31 | &:hover { 32 | background-color: transparent !important; 33 | } 34 | &.selected { 35 | @include gradient-background(#E59E06); 36 | border-color: darken($base-color, 2%); 37 | color: darken($base-color, 65%); 38 | } 39 | .icon { 40 | background-image: $closed-folder-icon-metro-16; 41 | 42 | &.isleaf { 43 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACjElEQVR42o2SW0hUURSG/32OhnhAqJDCzF6kN0lLGtJCtLQyKIMotRjBy1sqVEZS9mKZBdKFHBJpJEKD0urBvAchhqY5kp6MHkRlMhpHR2fOHuZybu3KxhEr+/fL3g/rWx9rL4Kl1La+ta0XwiNUTVf9sgJF0yB5FVCfAqt9Lnx8yt7Ph4Qc6btVtIigkN+XJ28s9MTeHQLPETipF3aXB7NOJ2wLXnyamYVlwgq/jN5Fj+9QX3WhZxXg8ethmpMSzwA666rDxSBOKsHhViBa7XC5ndgWuRH1PSP9XlnJZJDFFYBHXe/p6bQEIanoGTZECJDhh98jg6gc5ue+oqwkBXlp8TB3WfBiYLx3yuYwiqbS6QDA3DVEjWk7BZ7n8Kc09IzAEBsFm+RG6+BndFsmhsdMxYkBwIO2d7QwI1HIrmgH0XmEMo7MA5qiQ9PZQF0SrDNOpBq2YPPWcLT0i+KYqTQuALjzvJeePZr8V4Nf0fHF4cD49DzKHnaKo7Uly4Cqpg568WS6kH21GxpREIZQEKKxEo4ZaXDJfrgWJBwwxGBPfDTONbxigOJlQLm5jVYaD65hAHgUP77ZKY5fbxI/BAPOm9vpTWOGkH2lExzHIKwrYYcnPNQwnhnpkKjGukciddcm5N9tFkdNJasBaxnouo5J2wKOVTaKYjDggrmDVhvThVOX2S9wPOu8tGnk5+zAMRPqk7HfEI2kuEjk32tmvxAEKK1rpTUFh9c00JjBFDPIYgYrAAW3W2hdcZaQU9GGdWwJOMIFCnRNxY+X5FaxLyEK6ckxOFPzdCUg90YjbbyUK+A/Mk89yCyvFwfvBy1SbF6VLWF7TIRPUdV/FRNNh6qowsDHyaG5l9d2fwfyXD4gAGnljAAAAABJRU5ErkJggg=='); 44 | } 45 | 46 | &.expanded { 47 | background-image: $opened-folder-icon-metro-16; 48 | } 49 | } 50 | } 51 | 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/components/styles/themes/orange-theme.scss: -------------------------------------------------------------------------------- 1 | @import '../style-base.scss'; 2 | @import './base-theme.scss'; 3 | 4 | .deni-react-treeview-container.orange { 5 | border-color: lighten($orange, 2%); 6 | 7 | .deni-react-treeview-item-container.orange { 8 | @include set-theme($orange); 9 | 10 | .icon-and-text { 11 | .icon { 12 | background-image: $closed-folder-icon-orange-16; 13 | 14 | &.isleaf { 15 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACjElEQVR42o2SW0hUURSG/32OhnhAqJDCzF6kN0lLGtJCtLQyKIMotRjBy1sqVEZS9mKZBdKFHBJpJEKD0urBvAchhqY5kp6MHkRlMhpHR2fOHuZybu3KxhEr+/fL3g/rWx9rL4Kl1La+ta0XwiNUTVf9sgJF0yB5FVCfAqt9Lnx8yt7Ph4Qc6btVtIigkN+XJ28s9MTeHQLPETipF3aXB7NOJ2wLXnyamYVlwgq/jN5Fj+9QX3WhZxXg8ethmpMSzwA666rDxSBOKsHhViBa7XC5ndgWuRH1PSP9XlnJZJDFFYBHXe/p6bQEIanoGTZECJDhh98jg6gc5ue+oqwkBXlp8TB3WfBiYLx3yuYwiqbS6QDA3DVEjWk7BZ7n8Kc09IzAEBsFm+RG6+BndFsmhsdMxYkBwIO2d7QwI1HIrmgH0XmEMo7MA5qiQ9PZQF0SrDNOpBq2YPPWcLT0i+KYqTQuALjzvJeePZr8V4Nf0fHF4cD49DzKHnaKo7Uly4Cqpg568WS6kH21GxpREIZQEKKxEo4ZaXDJfrgWJBwwxGBPfDTONbxigOJlQLm5jVYaD65hAHgUP77ZKY5fbxI/BAPOm9vpTWOGkH2lExzHIKwrYYcnPNQwnhnpkKjGukciddcm5N9tFkdNJasBaxnouo5J2wKOVTaKYjDggrmDVhvThVOX2S9wPOu8tGnk5+zAMRPqk7HfEI2kuEjk32tmvxAEKK1rpTUFh9c00JjBFDPIYgYrAAW3W2hdcZaQU9GGdWwJOMIFCnRNxY+X5FaxLyEK6ckxOFPzdCUg90YjbbyUK+A/Mk89yCyvFwfvBy1SbF6VLWF7TIRPUdV/FRNNh6qowsDHyaG5l9d2fwfyXD4gAGnljAAAAABJRU5ErkJggg=='); 16 | } 17 | 18 | &.expanded { 19 | background-image: $opened-folder-icon-orange-16; 20 | } 21 | } 22 | } 23 | 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/components/styles/themes/purple-theme.scss: -------------------------------------------------------------------------------- 1 | @import '../style-base.scss'; 2 | @import './base-theme.scss'; 3 | 4 | .deni-react-treeview-container.purple { 5 | border-color: lighten($purple, 2%); 6 | 7 | .deni-react-treeview-item-container.purple { 8 | @include set-theme($purple); 9 | 10 | .icon-and-text { 11 | .icon { 12 | background-image: $closed-folder-icon-purple-16; 13 | 14 | &.isleaf { 15 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACjElEQVR42o2SW0hUURSG/32OhnhAqJDCzF6kN0lLGtJCtLQyKIMotRjBy1sqVEZS9mKZBdKFHBJpJEKD0urBvAchhqY5kp6MHkRlMhpHR2fOHuZybu3KxhEr+/fL3g/rWx9rL4Kl1La+ta0XwiNUTVf9sgJF0yB5FVCfAqt9Lnx8yt7Ph4Qc6btVtIigkN+XJ28s9MTeHQLPETipF3aXB7NOJ2wLXnyamYVlwgq/jN5Fj+9QX3WhZxXg8ethmpMSzwA666rDxSBOKsHhViBa7XC5ndgWuRH1PSP9XlnJZJDFFYBHXe/p6bQEIanoGTZECJDhh98jg6gc5ue+oqwkBXlp8TB3WfBiYLx3yuYwiqbS6QDA3DVEjWk7BZ7n8Kc09IzAEBsFm+RG6+BndFsmhsdMxYkBwIO2d7QwI1HIrmgH0XmEMo7MA5qiQ9PZQF0SrDNOpBq2YPPWcLT0i+KYqTQuALjzvJeePZr8V4Nf0fHF4cD49DzKHnaKo7Uly4Cqpg568WS6kH21GxpREIZQEKKxEo4ZaXDJfrgWJBwwxGBPfDTONbxigOJlQLm5jVYaD65hAHgUP77ZKY5fbxI/BAPOm9vpTWOGkH2lExzHIKwrYYcnPNQwnhnpkKjGukciddcm5N9tFkdNJasBaxnouo5J2wKOVTaKYjDggrmDVhvThVOX2S9wPOu8tGnk5+zAMRPqk7HfEI2kuEjk32tmvxAEKK1rpTUFh9c00JjBFDPIYgYrAAW3W2hdcZaQU9GGdWwJOMIFCnRNxY+X5FaxLyEK6ckxOFPzdCUg90YjbbyUK+A/Mk89yCyvFwfvBy1SbF6VLWF7TIRPUdV/FRNNh6qowsDHyaG5l9d2fwfyXD4gAGnljAAAAABJRU5ErkJggg=='); 16 | } 17 | 18 | &.expanded { 19 | background-image: $opened-folder-icon-purple-16; 20 | } 21 | } 22 | } 23 | 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/components/styles/themes/red-theme.scss: -------------------------------------------------------------------------------- 1 | @import '../style-base.scss'; 2 | @import './base-theme.scss'; 3 | 4 | .deni-react-treeview-container.red { 5 | border-color: lighten($red, 2%); 6 | 7 | .deni-react-treeview-item-container.red { 8 | @include set-theme($red); 9 | 10 | .icon-and-text { 11 | .icon { 12 | background-image: $closed-folder-icon-red-16; 13 | 14 | &.isleaf { 15 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACjElEQVR42o2SW0hUURSG/32OhnhAqJDCzF6kN0lLGtJCtLQyKIMotRjBy1sqVEZS9mKZBdKFHBJpJEKD0urBvAchhqY5kp6MHkRlMhpHR2fOHuZybu3KxhEr+/fL3g/rWx9rL4Kl1La+ta0XwiNUTVf9sgJF0yB5FVCfAqt9Lnx8yt7Ph4Qc6btVtIigkN+XJ28s9MTeHQLPETipF3aXB7NOJ2wLXnyamYVlwgq/jN5Fj+9QX3WhZxXg8ethmpMSzwA666rDxSBOKsHhViBa7XC5ndgWuRH1PSP9XlnJZJDFFYBHXe/p6bQEIanoGTZECJDhh98jg6gc5ue+oqwkBXlp8TB3WfBiYLx3yuYwiqbS6QDA3DVEjWk7BZ7n8Kc09IzAEBsFm+RG6+BndFsmhsdMxYkBwIO2d7QwI1HIrmgH0XmEMo7MA5qiQ9PZQF0SrDNOpBq2YPPWcLT0i+KYqTQuALjzvJeePZr8V4Nf0fHF4cD49DzKHnaKo7Uly4Cqpg568WS6kH21GxpREIZQEKKxEo4ZaXDJfrgWJBwwxGBPfDTONbxigOJlQLm5jVYaD65hAHgUP77ZKY5fbxI/BAPOm9vpTWOGkH2lExzHIKwrYYcnPNQwnhnpkKjGukciddcm5N9tFkdNJasBaxnouo5J2wKOVTaKYjDggrmDVhvThVOX2S9wPOu8tGnk5+zAMRPqk7HfEI2kuEjk32tmvxAEKK1rpTUFh9c00JjBFDPIYgYrAAW3W2hdcZaQU9GGdWwJOMIFCnRNxY+X5FaxLyEK6ckxOFPzdCUg90YjbbyUK+A/Mk89yCyvFwfvBy1SbF6VLWF7TIRPUdV/FRNNh6qowsDHyaG5l9d2fwfyXD4gAGnljAAAAABJRU5ErkJggg=='); 16 | } 17 | 18 | &.expanded { 19 | background-image: $opened-folder-icon-red-16; 20 | } 21 | } 22 | } 23 | 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/components/styles/themes/silver-theme.scss: -------------------------------------------------------------------------------- 1 | @import '../style-base.scss'; 2 | @import './base-theme.scss'; 3 | 4 | .deni-react-treeview-container.silver { 5 | border-color: lighten($silver, 2%); 6 | 7 | .deni-react-treeview-item-container.silver { 8 | @include set-theme($silver); 9 | 10 | .icon-and-text { 11 | .icon { 12 | background-image: $closed-folder-icon-silver-16; 13 | 14 | &.isleaf { 15 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACjElEQVR42o2SW0hUURSG/32OhnhAqJDCzF6kN0lLGtJCtLQyKIMotRjBy1sqVEZS9mKZBdKFHBJpJEKD0urBvAchhqY5kp6MHkRlMhpHR2fOHuZybu3KxhEr+/fL3g/rWx9rL4Kl1La+ta0XwiNUTVf9sgJF0yB5FVCfAqt9Lnx8yt7Ph4Qc6btVtIigkN+XJ28s9MTeHQLPETipF3aXB7NOJ2wLXnyamYVlwgq/jN5Fj+9QX3WhZxXg8ethmpMSzwA666rDxSBOKsHhViBa7XC5ndgWuRH1PSP9XlnJZJDFFYBHXe/p6bQEIanoGTZECJDhh98jg6gc5ue+oqwkBXlp8TB3WfBiYLx3yuYwiqbS6QDA3DVEjWk7BZ7n8Kc09IzAEBsFm+RG6+BndFsmhsdMxYkBwIO2d7QwI1HIrmgH0XmEMo7MA5qiQ9PZQF0SrDNOpBq2YPPWcLT0i+KYqTQuALjzvJeePZr8V4Nf0fHF4cD49DzKHnaKo7Uly4Cqpg568WS6kH21GxpREIZQEKKxEo4ZaXDJfrgWJBwwxGBPfDTONbxigOJlQLm5jVYaD65hAHgUP77ZKY5fbxI/BAPOm9vpTWOGkH2lExzHIKwrYYcnPNQwnhnpkKjGukciddcm5N9tFkdNJasBaxnouo5J2wKOVTaKYjDggrmDVhvThVOX2S9wPOu8tGnk5+zAMRPqk7HfEI2kuEjk32tmvxAEKK1rpTUFh9c00JjBFDPIYgYrAAW3W2hdcZaQU9GGdWwJOMIFCnRNxY+X5FaxLyEK6ckxOFPzdCUg90YjbbyUK+A/Mk89yCyvFwfvBy1SbF6VLWF7TIRPUdV/FRNNh6qowsDHyaG5l9d2fwfyXD4gAGnljAAAAABJRU5ErkJggg=='); 16 | } 17 | 18 | &.expanded { 19 | background-image: $opened-folder-icon-silver-16; 20 | } 21 | } 22 | } 23 | 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/examples/ExampleUnderConstruction.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | const ExampleUnderConstruction: React.FC = () => { 4 | const style = { color: 'gray', fontSize: '22px', margin: '20px' } 5 | return
Example Under Development
6 | } 7 | 8 | export default ExampleUnderConstruction -------------------------------------------------------------------------------- /src/examples/api/AddItemAndSubitemApi/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { useRef } from 'react' 2 | import DeniReactTreeView from '../../../components' 3 | 4 | const AddItemAndSubitemApi: React.FC = () => { 5 | const treeviewRef = useRef(null) 6 | 7 | const addItemAndSubItem = () => { 8 | const api = treeviewRef.current?.api 9 | const rootNode = api.getRootItem(); 10 | 11 | const newItem = api.addItem("New Item", false, rootNode); 12 | const newSubItem = api.addItem("New Sub Item", true, newItem); 13 | 14 | api.selectItem(newSubItem); 15 | } 16 | 17 | return ( 18 |
19 | 20 | 24 |
25 | ) 26 | } 27 | 28 | export default AddItemAndSubitemApi -------------------------------------------------------------------------------- /src/examples/api/AddItemAndSubitemApi/source.md: -------------------------------------------------------------------------------- 1 | ```javascript 2 | import React, { useRef } from 'react' 3 | import DeniReactTreeView from 'deni-react-treeview' 4 | 5 | const AddItemAndSubitemApi: React.FC = () => { 6 | const treeviewRef = useRef(null) 7 | 8 | const addItemAndSubItem = () => { 9 | const api = treeviewRef.current.api 10 | const rootNode = api.getRootItem(); 11 | 12 | const newItem = api.addItem("New Item", false, rootNode); 13 | const newSubItem = api.addItem("New Sub Item", true, newItem); 14 | 15 | api.selectItem(newSubItem); 16 | } 17 | 18 | return ( 19 |
20 | 21 | 25 |
26 | ) 27 | } 28 | 29 | export default AddItemAndSubitemApi 30 | ``` 31 | -------------------------------------------------------------------------------- /src/examples/api/RemoveItemApi/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { useRef } from 'react' 2 | import DeniReactTreeView from '../../../components' 3 | 4 | const RemoveItemApi: React.FC = () => { 5 | const treeviewRef = useRef(null) 6 | 7 | const removeSelectedItem = () => { 8 | const api = treeviewRef.current?.api 9 | const selectedItem = api.getSelectedItem(); 10 | 11 | if (selectedItem) { 12 | api.removeItem(selectedItem.id); 13 | } else { 14 | alert('You have to select a item to remove it'); 15 | } 16 | } 17 | 18 | return ( 19 |
20 | 21 | 25 |
26 | ) 27 | } 28 | 29 | export default RemoveItemApi -------------------------------------------------------------------------------- /src/examples/api/RemoveItemApi/source.md: -------------------------------------------------------------------------------- 1 | ```javascript 2 | import React, { useRef } from 'react' 3 | import DeniReactTreeView from 'deni-react-treeview' 4 | 5 | const RemoveItemApi: React.FC = () => { 6 | const treeviewRef = useRef(null) 7 | 8 | const removeSelectedItem = () => { 9 | const api = treeviewRef.current?.api 10 | const selectedItem = api.getSelectedItem(); 11 | 12 | if (selectedItem) { 13 | api.removeItem(selectedItem.id); 14 | } else { 15 | alert('You have to select a item to remove it'); 16 | } 17 | } 18 | 19 | return ( 20 |
21 | 22 | 26 |
27 | ) 28 | } 29 | 30 | export default RemoveItemApi 31 | ``` 32 | -------------------------------------------------------------------------------- /src/examples/api/api.stories.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { storiesOf } from '@storybook/react'; 3 | 4 | import ExampleUnderConstruction from '../ExampleUnderConstruction' 5 | 6 | import AddItemAndSubitemApi from './AddItemAndSubitemApi' 7 | import RemoveItemApi from './RemoveItemApi' 8 | 9 | storiesOf('4 - Api', module) 10 | .add('addItem and subitem', () => , { notes: require('./AddItemAndSubitemApi/source.md').default }) 11 | .add('remove item', () => , { notes: require('./RemoveItemApi/source.md').default }) 12 | .add('find folder', () => ) 13 | .add('find node', () => ) 14 | .add('find item', () => ) 15 | .add('getItems()', () => ) 16 | .add('getParentNode(item)', () => ) 17 | .add('getRootItem()', () => ) 18 | .add('getSelectedItem()', () => ) 19 | .add('load()', () => ) 20 | .add('loadData(data)', () => ) 21 | .add('selectItem(item)', () => ) 22 | .add('setTheme(newTheme)', () => ) 23 | 24 | -------------------------------------------------------------------------------- /src/examples/binding/ToAJavaScriptObject/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import DeniReactTreeView from "../../../components" 3 | 4 | const ToAJavaScriptObject = () => { 5 | return 6 | } 7 | 8 | export default ToAJavaScriptObject 9 | 10 | const fruitsAndVegetables = [ 11 | { 12 | id: 100, 13 | text: 'Fruits', 14 | children: [ 15 | { 16 | id: 101, 17 | text: 'Orange', 18 | isLeaf: true 19 | }, 20 | { 21 | id: 102, 22 | text: 'Banana', 23 | isLeaf: true 24 | } 25 | ] 26 | }, 27 | { 28 | id: 200, 29 | text: 'Vegetables', 30 | children: [ 31 | { 32 | id: 201, 33 | text: 'Carrot', 34 | isLeaf: true 35 | }, 36 | { 37 | id: 202, 38 | text: 'Tomato', 39 | isLeaf: true 40 | } 41 | ] 42 | } 43 | ]; -------------------------------------------------------------------------------- /src/examples/binding/ToAJavaScriptObject/source.md: -------------------------------------------------------------------------------- 1 | ```javascript 2 | import React from 'react' 3 | import DeniReactTreeView from 'deni-react-treeview' 4 | 5 | const ToAJavaScriptObject = () => { 6 | return 7 | } 8 | 9 | const fruitsAndVegetables = [ 10 | { 11 | id: 100, 12 | text: 'Fruits', 13 | children: [ 14 | { 15 | id: 101, 16 | text: 'Orange', 17 | isLeaf: true 18 | }, 19 | { 20 | id: 102, 21 | text: 'Banana', 22 | isLeaf: true 23 | } 24 | ] 25 | }, 26 | { 27 | id: 200, 28 | text: 'Vegetables', 29 | children: [ 30 | { 31 | id: 201, 32 | text: 'Carrot', 33 | isLeaf: true 34 | }, 35 | { 36 | id: 202, 37 | text: 'Tomato', 38 | isLeaf: true 39 | } 40 | ] 41 | } 42 | ]; 43 | 44 | export default ToAJavaScriptObject 45 | ``` 46 | -------------------------------------------------------------------------------- /src/examples/binding/ToALocalJson/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import DeniReactTreeView from "../../../components" 3 | 4 | const ToALocalJson = () => { 5 | return 6 | } 7 | 8 | export default ToALocalJson -------------------------------------------------------------------------------- /src/examples/binding/ToALocalJson/source.md: -------------------------------------------------------------------------------- 1 | ```javascript 2 | import React from 'react' 3 | import DeniReactTreeView from 'deni-react-treeview' 4 | 5 | const toALocalJson = () => { 6 | return 7 | } 8 | 9 | export default toALocalJson 10 | ``` 11 | -------------------------------------------------------------------------------- /src/examples/binding/ToARemoteJson/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import DeniReactTreeView from "../../../components" 3 | 4 | const ToARemoteJson = () => { 5 | return 6 | } 7 | 8 | export default ToARemoteJson -------------------------------------------------------------------------------- /src/examples/binding/ToARemoteJson/source.md: -------------------------------------------------------------------------------- 1 | ```javascript 2 | import React from 'react' 3 | import DeniReactTreeView from 'deni-react-treeview' 4 | 5 | const toARemoteJson = () => { 6 | return 7 | } 8 | 9 | export default toARemoteJson 10 | ``` 11 | -------------------------------------------------------------------------------- /src/examples/binding/ToARemoteJsonInLazyLoad/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import DeniReactTreeView from "../../../components" 3 | 4 | const ToARemoteJsonInLazyLoad = () => { 5 | return 6 | } 7 | 8 | export default ToARemoteJsonInLazyLoad -------------------------------------------------------------------------------- /src/examples/binding/ToARemoteJsonInLazyLoad/source.md: -------------------------------------------------------------------------------- 1 | ```javascript 2 | import React from 'react' 3 | import DeniReactTreeView from 'deni-react-treeview' 4 | 5 | const ToARemoteJsonInLazyLoad = () => { 6 | return ( 7 | 11 | ) 12 | } 13 | 14 | export default ToARemoteJsonInLazyLoad 15 | ``` 16 | -------------------------------------------------------------------------------- /src/examples/binding/binding.stories.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { storiesOf } from '@storybook/react'; 3 | import ToALocalJson from './ToALocalJson' 4 | import ToARemoteJson from './ToARemoteJson' 5 | import ToARemoteJsonInLazyLoad from './ToARemoteJsonInLazyLoad' 6 | import ToAJavaScriptObject from './ToAJavaScriptObject' 7 | 8 | storiesOf('2 - Binding', module) 9 | .add('to a local JSON', () => , { notes: require('./ToALocalJson/source.md').default }) 10 | .add('to a remote JSON', () => , { notes: require('./ToARemoteJson/source.md').default }) 11 | .add('to a remote JSON (Lazy Load)ddf', () => , { notes: require('./ToARemoteJsonInLazyLoad/source.md').default }) 12 | .add('to a Javascript Object', () => , { notes: require('./ToAJavaScriptObject/source.md').default }) 13 | -------------------------------------------------------------------------------- /src/examples/events/OnAfterLoadEvent/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { useRef } from 'react' 2 | import DeniReactTreeView from '../../../components'; 3 | 4 | const OnAfterLoadEvent: React.FC = () => { 5 | const treeviewRef = useRef(null); 6 | 7 | const loadButtonClick = () => treeviewRef.current?.api.load() 8 | const onAfterLoad = (data, item) => alert(`onAfterLoad event: ${new Date()}`) 9 | 10 | return ( 11 |
12 | 13 | 19 |
20 | ) 21 | } 22 | 23 | export default OnAfterLoadEvent -------------------------------------------------------------------------------- /src/examples/events/OnAfterLoadEvent/source.md: -------------------------------------------------------------------------------- 1 | ```javascript 2 | import React, { useRef } from 'react' 3 | import DeniReactTreeView from 'deni-react-treeview'; 4 | 5 | const OnAfterLoadEvent: React.FC = () => { 6 | const treeviewRef = useRef(null); 7 | 8 | const loadButtonClick = () => treeviewRef.current.api.load() 9 | const onAfterLoad = (data, item) => alert(`onAfterLoad event: ${new Date()}`) 10 | 11 | return ( 12 |
13 | 14 | 20 |
21 | ) 22 | } 23 | 24 | export default OnAfterLoadEvent 25 | ``` 26 | -------------------------------------------------------------------------------- /src/examples/events/OnBeforeLoadEvent/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { useRef } from 'react' 2 | import DeniReactTreeView from '../../../components'; 3 | 4 | const OnBeforeLoadEvent: React.FC = () => { 5 | const treeviewRef = useRef(null); 6 | 7 | const loadButtonClick = () => treeviewRef.current?.api.load() 8 | const onBeforeLoad = (data, item) => alert(`onBeforeLoad event: ${new Date()}`) 9 | 10 | return ( 11 |
12 | 13 | 19 |
20 | ) 21 | } 22 | 23 | export default OnBeforeLoadEvent -------------------------------------------------------------------------------- /src/examples/events/OnBeforeLoadEvent/source.md: -------------------------------------------------------------------------------- 1 | ```javascript 2 | import React, { useRef } from 'react' 3 | import DeniReactTreeView from 'deni-react-treeview'; 4 | 5 | const OnBeforeLoadEvent: React.FC = () => { 6 | const treeviewRef = useRef(null); 7 | 8 | const loadButtonClick = () => treeviewRef.current.api.load() 9 | const onBeforeLoad = (data, item) => alert(`onBeforeLoad event: ${new Date()}`) 10 | 11 | return ( 12 |
13 | 14 | 20 |
21 | ) 22 | } 23 | 24 | export default OnBeforeLoadEvent 25 | ``` 26 | -------------------------------------------------------------------------------- /src/examples/events/OnRenderItemEvent/OnRenderItemEvent.scss: -------------------------------------------------------------------------------- 1 | .onrenderitem-example { 2 | 3 | .deni-react-treeview-item-container { 4 | 5 | .icon-and-text { 6 | cursor: default !important; 7 | } 8 | 9 | .treeview-item-example { 10 | display: flex; 11 | flex: 1; 12 | 13 | .treeview-item-example-text { 14 | flex: 1; 15 | } 16 | 17 | .actionButton { 18 | margin-right: 5px; 19 | cursor: pointer; 20 | opacity: 0.5; 21 | 22 | &.trash { 23 | color: #ff6666; 24 | } 25 | 26 | &.edit { 27 | color: #006699; //#00cc44; 28 | margin-top: 1px; 29 | } 30 | } 31 | } 32 | 33 | &:hover { 34 | .actionButton { 35 | visibility: visible; 36 | opacity: 1; 37 | } 38 | } 39 | 40 | } 41 | } -------------------------------------------------------------------------------- /src/examples/events/OnRenderItemEvent/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { useRef } from 'react' 2 | import { FaTrash, FaEdit } from 'react-icons/fa'; 3 | import DeniReactTreeView from '../../../components' 4 | import './OnRenderItemEvent.scss' 5 | 6 | const OnRenderItemEvent: React.FC = () => { 7 | const treeviewRef = useRef(null) 8 | 9 | const deleteItemClick = id => { 10 | if (treeviewRef.current) treeviewRef.current.api.removeItem(id); 11 | } 12 | 13 | const editItemClick = item => { 14 | alert('Edit item: ' + JSON.stringify(item, null, 2)) 15 | } 16 | 17 | const onRenderItem = (item, treeview) => { 18 | return ( 19 |
20 | {item.text} 21 | deleteItemClick(item.id)}> 22 | editItemClick(item)}> 23 |
24 | ) 25 | } 26 | 27 | return ( 28 | <> 29 | 36 |
37 | OnRenderItemEvent.scss 38 | 39 | ) 40 | } 41 | 42 | export default OnRenderItemEvent -------------------------------------------------------------------------------- /src/examples/events/OnRenderItemEvent/source.md: -------------------------------------------------------------------------------- 1 | ```javascript 2 | import React, { useRef } from 'react' 3 | import { FaTrash, FaEdit } from 'react-icons/fa'; 4 | import DeniReactTreeView from 'deni-react-treeview' 5 | import './OnRenderItemEvent.scss' 6 | 7 | const OnRenderItemEvent: React.FC = () => { 8 | const treeviewRef = useRef(null) 9 | 10 | const deleteItemClick = id => { 11 | if (treeviewRef.current) treeviewRef.current.api.removeItem(id); 12 | } 13 | 14 | const editItemClick = item => { 15 | alert('Edit item: ' + JSON.stringify(item, null, 2)) 16 | } 17 | 18 | const onRenderItem = (item, treeview) => { 19 | return ( 20 |
21 | {item.text} 22 | deleteItemClick(item.id)}> 23 | editItemClick(item)}> 24 |
25 | ) 26 | } 27 | 28 | return ( 29 | 36 | ) 37 | } 38 | 39 | export default OnRenderItemEvent 40 | ``` 41 | -------------------------------------------------------------------------------- /src/examples/events/OnSelectItemEvent/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import DeniReactTreeView from '../../../components' 3 | 4 | const OnSelectItemEvent: React.FC = () => { 5 | const onSelectItemHandler = item => alert(`onSelectItem - item : ${item.text}`) 6 | 7 | return ( 8 | 12 | ) 13 | } 14 | 15 | export default OnSelectItemEvent -------------------------------------------------------------------------------- /src/examples/events/OnSelectItemEvent/source.md: -------------------------------------------------------------------------------- 1 | ```javascript 2 | import React from 'react' 3 | import DeniReactTreeView from 'deni-react-treeview' 4 | 5 | const OnSelectItemEvent: React.FC = () => { 6 | const onSelectItemHandler = item => alert(`onSelectItem - item : ${item.text}`) 7 | 8 | return ( 9 | 13 | ) 14 | } 15 | 16 | export default OnSelectItemEvent 17 | ``` 18 | -------------------------------------------------------------------------------- /src/examples/events/events.stories.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable react/display-name */ 2 | import React from 'react'; 3 | import { storiesOf } from '@storybook/react'; 4 | 5 | import OnSelectItemEvent from './OnSelectItemEvent' 6 | import OnRenderItemEvent from './OnRenderItemEvent' 7 | import OnBeforeLoadEvent from './OnBeforeLoadEvent' 8 | import OnAfterLoadEvent from './OnAfterLoadEvent' 9 | import ExampleUnderConstruction from '../ExampleUnderConstruction'; 10 | 11 | storiesOf('5 - Events', module) 12 | .add('onRenderItem', () => , { notes: require('./OnRenderItemEvent/source.md').default }) 13 | .add('onBeforeLoad', () => , { notes: require('./OnBeforeLoadEvent/source.md').default }) 14 | .add('onAfterLoad', () => , { notes: require('./OnAfterLoadEvent/source.md').default }) 15 | .add('onSelectItem', () => , { notes: require('./OnSelectItemEvent/source.md').default }) 16 | .add('onExpanded', () => ) 17 | .add('onColapsed', () => ) 18 | .add('onLazyLoad (manual lazy load)', () => ) -------------------------------------------------------------------------------- /src/examples/options/ActionButtonsOption/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import DeniReactTreeView from '../../../components' 3 | import { FaTrash, FaEdit } from 'react-icons/fa'; 4 | 5 | const ActionButtonsOption: React.FC = () => { 6 | const onActionButtonClick = (item, actionButton) => { 7 | const buttonName = actionButton.type.name; 8 | 9 | switch (buttonName) { 10 | case 'FaTrash': 11 | alert('Action: trash, Item: ' + item.text); 12 | break; 13 | case 'FaEdit': 14 | alert('Action: edit, Item: ' + item.text); 15 | break; 16 | default: 17 | } 18 | } 19 | 20 | const actionButtons = [ 21 | (), 22 | () 23 | ]; 24 | 25 | return ( 26 | 32 | ) 33 | } 34 | 35 | export default ActionButtonsOption -------------------------------------------------------------------------------- /src/examples/options/ActionButtonsOption/source.md: -------------------------------------------------------------------------------- 1 | ```javascript 2 | import React from 'react' 3 | import DeniReactTreeView from 'deni-react-treeview' 4 | import { FaTrash, FaEdit } from 'react-icons/fa'; 5 | 6 | const ActionButtonsOption: React.FC = () => { 7 | const onActionButtonClick = (item, actionButton) => { 8 | const buttonName = actionButton.type.name; 9 | 10 | switch (buttonName) { 11 | case 'FaTrash': 12 | alert('Action: trash, Item: ' + item.text); 13 | break; 14 | case 'FaEdit': 15 | alert('Action: edit, Item: ' + item.text); 16 | break; 17 | default: 18 | } 19 | } 20 | 21 | const actionButtons = [ 22 | (), 23 | () 24 | ]; 25 | 26 | return ( 27 | 33 | ) 34 | } 35 | 36 | export default ActionButtonsOption 37 | ``` 38 | -------------------------------------------------------------------------------- /src/examples/options/AutoLoadFalseOption/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { useRef } from 'react' 2 | import DeniReactTreeView from '../../../components' 3 | 4 | const AutoLoadFalseOption: React.FC = () => { 5 | const treeviewRef = useRef(null); 6 | const loadButtonClick = () => treeviewRef.current?.api.load() 7 | 8 | return ( 9 |
10 | 11 | 16 |
17 | ) 18 | 19 | } 20 | 21 | export default AutoLoadFalseOption -------------------------------------------------------------------------------- /src/examples/options/AutoLoadFalseOption/source.md: -------------------------------------------------------------------------------- 1 | ```javascript 2 | import React, { useRef } from 'react' 3 | import DeniReactTreeView from 'deni-react-treeview' 4 | 5 | const AutoLoadFalseOption: React.FC = () => { 6 | const treeviewRef = useRef(null); 7 | const loadButtonClick = () => treeviewRef.current.api.load() 8 | 9 | return ( 10 |
11 | 12 | 17 |
18 | ) 19 | 20 | } 21 | 22 | export default AutoLoadFalseOption 23 | ``` 24 | -------------------------------------------------------------------------------- /src/examples/options/LazyLoadTrueOption/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import DeniReactTreeView from '../../../components' 3 | 4 | const LazyLoadTrueOption: React.FC = () => { 5 | return 6 | } 7 | 8 | export default LazyLoadTrueOption -------------------------------------------------------------------------------- /src/examples/options/LazyLoadTrueOption/source.md: -------------------------------------------------------------------------------- 1 | ```javascript 2 | import React from 'react' 3 | import DeniReactTreeView from 'deni-react-treeview' 4 | 5 | const LazyLoadTrueOption: React.FC = () => { 6 | return 7 | } 8 | 9 | export default LazyLoadTrueOption 10 | ``` 11 | -------------------------------------------------------------------------------- /src/examples/options/MarginItemsOption/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import DeniReactTreeView from '../../../components' 3 | 4 | const MarginItemsOption: React.FC = () => { 5 | return ( 6 | 10 | ) 11 | } 12 | 13 | export default MarginItemsOption -------------------------------------------------------------------------------- /src/examples/options/MarginItemsOption/source.md: -------------------------------------------------------------------------------- 1 | ```javascript 2 | import React from 'react' 3 | import DeniReactTreeView from 'deni-react-treeview' 4 | 5 | const MarginItemsOption: React.FC = () => { 6 | return ( 7 | 11 | ) 12 | } 13 | 14 | export default MarginItemsOption 15 | ``` 16 | -------------------------------------------------------------------------------- /src/examples/options/SelectRowOption/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import DeniReactTreeView from '../../../components' 3 | 4 | const SelectRowOption: React.FC = () => { 5 | return ( 6 | 10 | ) 11 | } 12 | 13 | export default SelectRowOption -------------------------------------------------------------------------------- /src/examples/options/SelectRowOption/source.md: -------------------------------------------------------------------------------- 1 | ```javascript 2 | import React from 'react' 3 | import DeniReactTreeView from 'deni-react-treeview' 4 | 5 | const SelectRowOption: React.FC = () => { 6 | return ( 7 | 11 | ) 12 | } 13 | 14 | export default SelectRowOption 15 | ``` 16 | -------------------------------------------------------------------------------- /src/examples/options/ShowCheckboxOption/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import DeniReactTreeView from '../../../components' 3 | 4 | const ShowCheckboxOption: React.FC = () => { 5 | return ( 6 | 10 | ) 11 | } 12 | 13 | export default ShowCheckboxOption -------------------------------------------------------------------------------- /src/examples/options/ShowCheckboxOption/source.md: -------------------------------------------------------------------------------- 1 | ```javascript 2 | import React from 'react' 3 | import DeniReactTreeView from 'deni-react-treeview' 4 | 5 | const ShowCheckboxOption: React.FC = () => { 6 | return ( 7 | 11 | ) 12 | } 13 | 14 | export default ShowCheckboxOption 15 | ``` 16 | -------------------------------------------------------------------------------- /src/examples/options/ShowIconOption/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import DeniReactTreeView from '../../../components' 3 | 4 | const ShowIconOption: React.FC = () => { 5 | return ( 6 | 10 | ) 11 | } 12 | 13 | export default ShowIconOption -------------------------------------------------------------------------------- /src/examples/options/ShowIconOption/source.md: -------------------------------------------------------------------------------- 1 | ```javascript 2 | import React from 'react' 3 | import DeniReactTreeView from 'deni-react-treeview' 4 | 5 | const ShowIconOption: React.FC = () => { 6 | return ( 7 | 11 | ) 12 | } 13 | 14 | export default ShowIconOption 15 | ``` 16 | -------------------------------------------------------------------------------- /src/examples/options/ShowRootOption/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import DeniReactTreeView from '../../../components' 3 | 4 | const ShowRootOption: React.FC = () => { 5 | return ( 6 | 10 | ) 11 | } 12 | 13 | export default ShowRootOption -------------------------------------------------------------------------------- /src/examples/options/ShowRootOption/source.md: -------------------------------------------------------------------------------- 1 | ```javascript 2 | import React from 'react' 3 | import DeniReactTreeView from 'deni-react-treeview' 4 | 5 | const ShowRootOption: React.FC = () => { 6 | return ( 7 | 11 | ) 12 | } 13 | 14 | export default ShowRootOption 15 | ``` 16 | -------------------------------------------------------------------------------- /src/examples/options/ThemeOption/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import DeniReactTreeView from '../../../components' 3 | 4 | const ThemeOption: React.FC = () => { 5 | return ( 6 | 10 | ) 11 | } 12 | 13 | export default ThemeOption -------------------------------------------------------------------------------- /src/examples/options/ThemeOption/source.md: -------------------------------------------------------------------------------- 1 | ```javascript 2 | import React from 'react' 3 | import DeniReactTreeView from 'deni-react-treeview' 4 | 5 | const ThemeOption: React.FC = () => { 6 | return ( 7 | 11 | ) 12 | } 13 | 14 | export default ThemeOption 15 | ``` 16 | -------------------------------------------------------------------------------- /src/examples/options/options.stories.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { storiesOf } from '@storybook/react'; 3 | import DeniReactTreeView from '../../components'; 4 | import AutoLoadFalseOption from './AutoLoadFalseOption' 5 | import ActionButtonsOption from './ActionButtonsOption' 6 | import LazyLoadTrueOption from './LazyLoadTrueOption' 7 | import MarginItemsOption from './MarginItemsOption' 8 | import SelectRowOption from './SelectRowOption' 9 | import ShowCheckboxOption from './ShowCheckboxOption' 10 | import ShowIconOption from './ShowIconOption' 11 | import ShowRootOption from './ShowRootOption' 12 | import ThemeOption from './ThemeOption' 13 | 14 | const countriesURL = 'https://raw.githubusercontent.com/denimar/deni-react-treeview/develop/src/assets/data/countries.json' 15 | 16 | storiesOf('3 - Options', module) 17 | .add('autoLoad = false', () => , { notes: require('./AutoLoadFalseOption/source.md').default }) 18 | .add('lazyLoad = true', () => , { notes: require('./LazyLoadTrueOption/source.md').default }) 19 | .add('marginItems = 80', () => , { notes: require('./MarginItemsOption/source.md').default }) 20 | .add('selectRow = true', () => , { notes: require('./SelectRowOption/source.md').default }) 21 | .add('showCheckbox = true', () => , { notes: require('./ShowCheckboxOption/source.md').default }) 22 | .add('showIcon = false', () => , { notes: require('./ShowIconOption/source.md').default }) 23 | .add('showRoot = true', () => , { notes: require('./ShowRootOption/source.md').default }) 24 | .add('theme = "metro"', () => , { notes: require('./ThemeOption/source.md').default }) 25 | .add('actionButtons', () => , { notes: require('./ThemeOption/source.md').default }) -------------------------------------------------------------------------------- /src/examples/theming/CustomizedTheme/images/dog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denimar/deni-react-treeview/a157c9a39f13065465df9512f51e39083658954a/src/examples/theming/CustomizedTheme/images/dog.png -------------------------------------------------------------------------------- /src/examples/theming/CustomizedTheme/images/folder-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denimar/deni-react-treeview/a157c9a39f13065465df9512f51e39083658954a/src/examples/theming/CustomizedTheme/images/folder-green.png -------------------------------------------------------------------------------- /src/examples/theming/CustomizedTheme/images/menu-background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/denimar/deni-react-treeview/a157c9a39f13065465df9512f51e39083658954a/src/examples/theming/CustomizedTheme/images/menu-background.jpg -------------------------------------------------------------------------------- /src/examples/theming/CustomizedTheme/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import DeniReactTreeView from "../../../components" 3 | import './theming-customizations.scss' 4 | 5 | const CustomeziedTheme = () => { 6 | return ( 7 |
8 | 11 | 12 |
13 | theming-customizations.scss 14 |
15 | ) 16 | } 17 | 18 | export default CustomeziedTheme -------------------------------------------------------------------------------- /src/examples/theming/CustomizedTheme/source.md: -------------------------------------------------------------------------------- 1 | ```javascript 2 | import React from 'react' 3 | import DeniReactTreeView from "../../../components" 4 | import './theming-customizations.scss' 5 | 6 | const CustomeziedTheme = () => { 7 | return ( 8 |
9 | 12 | 13 |
14 | ) 15 | } 16 | 17 | export default CustomeziedTheme 18 | ``` 19 | -------------------------------------------------------------------------------- /src/examples/theming/CustomizedTheme/theming-customizations.scss: -------------------------------------------------------------------------------- 1 | .theme-customization { 2 | height: 100%; 3 | 4 | .deni-react-treeview-container { 5 | background: linear-gradient(rgba(255,255,255,.8), rgba(255,255,255,.8)), url("images/menu-background.jpg"); 6 | background-size: 100% 100%; 7 | background-repeat: no-repeat; 8 | border-color: #004D40;// rgba(96, 214, 111, 1) !important; 9 | font-family: tahoma; 10 | font-size: 14px; 11 | width: 350px; 12 | height: 500px; 13 | opacity: 1; 14 | //box-shadow: 2px 2px 2px #E0F7FA, 2px -2px 2px #E0F7FA, -2px -2px 2px #E0F7FA, -2px 2px 2px #E0F7FA; 15 | box-shadow: 3px 3px 4px #B2DFDB; 16 | border-radius: 5px; 17 | 18 | 19 | &::-webkit-scrollbar { 20 | width: 8px; 21 | } 22 | 23 | /* Track */ 24 | &::-webkit-scrollbar-track { 25 | background: rgba(144, 164, 174, .1); 26 | } 27 | 28 | /* Handle */ 29 | &::-webkit-scrollbar-thumb { 30 | background: rgba(144, 164, 174, .3); 31 | } 32 | 33 | /* Handle on hover */ 34 | &::-webkit-scrollbar-thumb:hover { 35 | background: rgba(144, 164, 174, .6); 36 | } 37 | 38 | 39 | /* changing the font color, font size and line's height */ 40 | .deni-react-treeview-item-container { 41 | height: 28px; 42 | 43 | /* changing the font color, and padding top and bottom (left is not recommended) */ 44 | .icon-and-text { 45 | color: #00695C; 46 | padding-top: 13px; 47 | padding-bottom: 13px; 48 | display: flex; 49 | flex-direction: row; 50 | align-items: center; 51 | 52 | /* changing the selected item properties */ 53 | &.selected { 54 | color: #004D40 !important; 55 | border-color: #80CBC4; 56 | background: linear-gradient(to bottom, #E0F2F1 0%, #80CBC4 100%) !important; 57 | } 58 | 59 | /* changing the icons of the folders expanded */ 60 | .icon { 61 | width: 24px !important; 62 | height: 24px !important; 63 | 64 | /* changing the icons of the folders colapsed */ 65 | //&.colapsed { 66 | background-image: url(images/folder-green.png) !important; 67 | background-size: 24px 24px; 68 | //} 69 | /* changing the icons of the folders expanded */ 70 | &.expanded { 71 | background-image: url(images/folder-green.png) !important; 72 | } 73 | 74 | /* changing the icons of the items */ 75 | &.isleaf { 76 | background-image: url(images/dog.png) !important; 77 | } 78 | 79 | } 80 | 81 | 82 | } 83 | 84 | } 85 | 86 | } 87 | 88 | } -------------------------------------------------------------------------------- /src/examples/theming/PredefinedThemes/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import DeniReactTreeView from "../../../components" 3 | 4 | const themes = [ 'classic', 'metro', 'moonlight', 'purple', 'green', 'orange', 'red', 'silver' ] 5 | 6 | const PredefinedThemes = () => { 7 | return ( 8 |
9 | { 10 | themes.map((theme, index) => { 11 | return 18 | }) 19 | } 20 |
21 | ) 22 | } 23 | 24 | export default PredefinedThemes -------------------------------------------------------------------------------- /src/examples/theming/PredefinedThemes/source.md: -------------------------------------------------------------------------------- 1 | ```javascript 2 | import React from 'react' 3 | import DeniReactTreeView from "deni-react-treeview" 4 | 5 | const themes = [ 'classic', 'metro', 'moonlight', 'purple', 'green', 'orange', 'red', 'silver' ] 6 | 7 | const PredefinedThemes = () => { 8 | return ( 9 |
10 | { 11 | themes.map((theme, index) => { 12 | return ( 13 | 20 | ) 21 | }) 22 | } 23 |
24 | ) 25 | } 26 | 27 | export default PredefinedThemes 28 | ``` 29 | -------------------------------------------------------------------------------- /src/examples/theming/theming.stories.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { storiesOf } from '@storybook/react'; 3 | import PredefinedThemes from './PredefinedThemes' 4 | import CustomizedTheme from './CustomizedTheme' 5 | 6 | storiesOf('1 - Theming', module) 7 | .add('predefined themes', () => , { notes: require('./PredefinedThemes/source.md').default }) 8 | .add('customized theme', () => , { notes: require('./CustomizedTheme/source.md').default }) -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import DeniReactTreeView from './components/deni-react-treeview/DeniReactTreeView'; 2 | export default DeniReactTreeView -------------------------------------------------------------------------------- /stylelint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: 'stylelint-config-standard', 3 | ignoreFiles: ['src/**/*.snap'], 4 | }; 5 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowSyntheticDefaultImports": true, 4 | "declaration": true, 5 | "esModuleInterop": true, 6 | "experimentalDecorators": true, 7 | "jsx": "react", 8 | "lib": ["dom", "es5"], 9 | "module": "esNext", 10 | "moduleResolution": "node", 11 | "noImplicitAny": false, 12 | "noImplicitReturns": true, 13 | "noUnusedLocals": true, 14 | "noUnusedParameters": false, 15 | "outDir": "./dist", 16 | "pretty": true, 17 | "sourceMap": true, 18 | "strict": true, 19 | "target": "es5" 20 | }, 21 | "exclude": ["node_modules", "**/*.stories.*", "**/*.test.*", "**/*.spec.*"], 22 | "include": ["./src"] 23 | } 24 | --------------------------------------------------------------------------------