├── .bowerrc ├── .editorconfig ├── .github ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md └── stale.yml ├── .gitignore ├── .jshintrc ├── .travis.yml ├── CONTRIBUTING.md ├── HISTORY.md ├── LICENSE ├── OSS_Notice.pdf ├── README.md ├── aha-table.html ├── bower.json ├── contacts-mini.json ├── contacts.json ├── css ├── aha-table-styles.html ├── px-data-table-cell-styles.html ├── px-data-table-highlight-styles.html └── px-data-table-styles.html ├── demo-angular.html ├── demo.html ├── demo ├── index.html ├── px-data-table-column-demo.html ├── px-data-table-demo.html └── px-data-table-highlight-demo.html ├── deploy.enc ├── docs ├── client-side-data.md └── server-side-data.md ├── favicon.ico ├── gulpfile.js ├── index.html ├── monogram-wdmk.png ├── package-lock.json ├── package.json ├── preventAutoSynch.md ├── px-data-table-cell.html ├── px-data-table-column.html ├── px-data-table-highlight.html ├── px-data-table.html ├── px-edit-cell.html ├── px-example-highlight.html ├── px-pagination.html ├── sass ├── aha-table.scss ├── px-data-table-cell.scss ├── px-data-table-highlight.scss └── px-data-table.scss ├── test ├── px-data-table-cell-fixture.html ├── px-data-table-cell-test.js ├── px-data-table-fixture.html ├── px-data-table-remote-paradigm-fixture.html ├── px-data-table-remote-paradigm-test.js └── px-data-table-test.js ├── wct.conf.json └── yarn.lock /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "./bower_components" 3 | } 4 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | 8 | [*] 9 | 10 | # Change these settings to your own preference 11 | indent_style = space 12 | indent_size = 2 13 | 14 | # We recommend you to keep these unchanged 15 | end_of_line = lf 16 | charset = utf-8 17 | trim_trailing_whitespace = true 18 | insert_final_newline = true 19 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | # Submit an Issue Hi, Thanks for helping us improve the Predix UI platform by submitting an issue. Before you begin, please check the list of existing issues to avoid submitting a duplicate issue. To help us solve this issue as fast as possible, please fill out the following sections: ## Expected behavior and actual behavior: ## Steps to reproduce the problem: ## Environment (_component version number, Browser (including version), operating system, hardware, etc_): ## Screenshots (_optional, but very helpful_): ## Code examples help us better understand the issue - follow the appropriate codepen for the component by going to https://predix-ui.com, finding the component in question, and clicking on the pencil icon under the demo. 2 | Once you've created your code example, you can save it under a new url. 3 | Please note that you should NOT use the same methods for production as the ones used in codepen - these methods are not production ready. -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | # Pull Request Hi, Thanks for helping us improve the Predix UI platform by submitting a Pull Request. To help us merge your Pull Request as fast as possible, please fill out the following sections: * ## A description of the changes proposed in the pull request: * ## A reference to a related issue (if applicable): * ## @mentions of the person or team responsible for reviewing proposed changes: * ## working tests: #### The tests need to be functional and/or unit tests, written for the wct framework, and placed in the test folder, following our testing guidelines. -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Issues/PRs with no activity for a year will be marked as stale 2 | daysUntilStale: 365 3 | 4 | # If no one has replied inside a week after an issue is marked stale, close it. 5 | daysUntilClose: 7 6 | 7 | staleLabel: wontfix 8 | markComment: > 9 | This issue or PR has been automatically marked as stale because there has been 10 | no activity in over a year. It will be closed in 1 week if no further activity occurs. 11 | Thanks for your contribution, and please don't hesitate to comment if this issue/PR 12 | is still relevant. 13 | exemptLabels: 14 | - pinned 15 | - security 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | temp 4 | bower_components 5 | .idea 6 | reports 7 | .yo-rc.json 8 | bower_components-*/ 9 | bower-*.json 10 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "esversion": 6, 3 | "curly": true, 4 | "eqeqeq": true, 5 | "immed": true, 6 | "latedef": true, 7 | "noarg": true, 8 | "sub": true, 9 | "undef": true, 10 | "boss": true, 11 | "eqnull": true, 12 | "node": true, 13 | "browser": true, 14 | "expr": true, 15 | "globals": { 16 | "it": false, 17 | "xit": false, 18 | "describe": false, 19 | "xdescribe": false, 20 | "before": false, 21 | "after": false, 22 | "beforeEach": false, 23 | "afterEach": false, 24 | "expect": false, 25 | "spyOn": false, 26 | "alert": false, 27 | "require": false, 28 | "requirejs": false, 29 | "Card": true, 30 | "iOS": false, 31 | "$": true, 32 | "define": false, 33 | "angular": false, 34 | "Polymer": false, 35 | "suite": false, 36 | "test": false, 37 | "assert": false, 38 | "flush": false, 39 | "suiteSetup": false 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | dist: trusty 3 | language: node_js 4 | node_js: 5 | - 9 6 | branches: 7 | except: 8 | - gh-pages 9 | addons: 10 | firefox: latest 11 | apt: 12 | sources: 13 | - google-chrome 14 | packages: 15 | - google-chrome-stable 16 | before_script: 17 | - yarn add web-component-tester@^6.0.0 18 | - yarn add bower 19 | - export PATH=$PWD/node_modules/.bin:$PATH 20 | - bower install 21 | script: 22 | - xvfb-run wct --skip-plugin sauce 23 | - if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then wct --plugin sauce --skip-plugin 24 | local; fi 25 | env: 26 | global: 27 | - secure: ZommiDhwGyzSRbJq38uHaRvxBhk8SQy4pfszlLbK9VK64Kk8E7zSsgITiL/bkVUgescK0M72PIDdTBA+gzTkmTDAU3ka/7jXzRafsWdNsyCHG1+NO9i5lJX1Y342X/RGMHwjULRlNXQ0pw15j5p3t1O2EsMs1ZoSv2Y65FRwqB9pbIbX+ahZwOe0QXGfKo/YoYBALdfXYqzMEzJRjuwqQeZqFv+ZcayTVKiktE/8ti/2TbHJdOOErlkcZWG451ZPKNqm7MyQCVcwvIXQ3q/PADyc/nXumhqDgPPucQFCOH53KopRqSTZN6ThTE0iEPnnxeHTNoQnTTVdrz44TFCi7zcZEN210CAAG+QIQBNJIabR60W4tL1YFVJ0w66gZ/1wBspmrrIxbmfCxYE5cVenNpQbBr462BS89ROQcFWi7CghEW3xRvKbgZ0vLjCH3m8njCfazX+19aPibu2O2SadzkJPoc6j/GlKC4vUMxilGg1WERKq93aMWXe6hejbwegFHW1xB7HGggbR+MU+2UYpLq3fj1QjC740Z51lQ+zRCeZEZvw94rwLWXdnR3aHu8yZTlaDZl7jBJ0zeHboQliKx0SgNIXUDridAZhxOnzQ4kYWbFFuspZtsmnbKXOZkcM+lMP9t0NLX9fHSHr+mnrht88lL5XdFrxZDq62EYd/Y3E= 28 | - secure: pYIrb3gfkOjD0q7eRLP29aMAC9s4eYKdQRXgz1yc/FWX44lOXFNnjugc9MKCPqi9uoz2QBDm9yLHZbhOccRLsN/Hu1WCGep4LPwGW9a/Fpv7TXmdWmZDf+/u4jq8hB3sUe0emslztemGCrZYc+XiPQREIeFYx4EaN6IdklzNrB3pT8LLqdvvd99YmxXLGYwx3CGayeh+HI/68U2AY709WXHUqQkdQ5mm5RtRfg0eA2gVp/6gYpxs5qsAymhvYB5fTUP0aSH2+VLrVE1R0E6+aaphf884k4NeDwlc6/6E/2+HgHcAWmhPd8dNPh9QkxsjCAOCgOskLWoF2WwSw6Tel2KWUvWpA2tt+wrGA8dRduyXk5VVe4w+TAR36vAgjMPEUy1r5AZoQGzemkVpNXOM/C9BH5fuWy5GOQfVD3YZpk6d1SgBVf2PEvi8Eioy+IvJeLVINgWIDIk30fYjllNEDXav09DgCTp0h1uEXbcGo8dr4YdCVGOdYUQbJaU2FTqNXeKUtXJAnpmX+O25Dti/8x3RyJdrOhIpT+ww08igRsK5Xar0wAJid43Ji8R/mfwe8uweGxegbihAwekK6pqoaBGWG0O8KzbvJJxSiFBqzpWflC2FVBs46zuNoXkptU+GZgi1MGdvhsVvr36iZ7/juwUzi8/SMNKUtB0ptI1hIGc= 29 | - secure: RLK7NvDy21kCLsaf3qJRFmfWxBV9lp9M1EVtmaYpBDHiP6pfG5Y1Q/gHpYxVfQfdcFSbEiyzUNxeyNBJkSbnLYqENSCQX2bgT7C6sIwu+CV7chpLFRCDQQi3ysFaP83YGGuPfkuZy9VP9C4Gx6OLAv7shJsXAZnMDP01WxUo7GH8GPV69ri8RDChLH9iBMeAtSddN5WkFLMYIi/lEcEQqc3pCZ7TbJmrQrY2axoG2pqq0qMs+8gAiNw5LCMh6Qs/2UUglh+Id3kqzh7gFw9mAmfvkQqyyAE3hXbnUMLnKCFjcOUkDRtrczt1JzZ2E1Tg8j/iYW0HC7iLoYtEoTKLyvE6uc4QOGY9G6ACvo2yAULvvPz5cA9Qbpb95V+e26X2a8TxUbpGf+vxHH8qh2w8lutuihIDALoPHYMcpGJgP+cLa3tES+btoyAzZ6XhtfQrinCUtMJcguTFia9NprVSSzmrc9WkYi2+7aB9uy+oEiNs3VXUql5i9usn47MvdT0FKdPWNefrpl+vghBPFkSO0eQQxWXvPGVnc6cctNr/IppVhzlA/sFyEH8JbBdmhxiWJE/Iji49irQhCTQTdkA7eNv/A2h57gKatoZrca7D+rrVQr0sxxxPABRbrtymn3j8ch1dd9PHx/6muSjvcEZXXSO6e4nryXYVp5A6lkYrXKk= 30 | - secure: tbmYi+lGHiwo/69fMTjAEdrmJaXjig+ovC3OsIRlivtUtewP1Y5nHR4wvSHZmsgRNWjsCQ/xar8sZRWqqm4Y4k28ADAet92LXmigWW7QK490Jyt+odJ3RZVRBLCiJ9mps7LcrhoRMEOtjgUFpbOKO/eGSX9t/lQ8n5rRsIuEzWOM14zZKmSVxpMjA1usEOqU+sw+0o2LcB2EfGslCk3Mfn9O0iI+qpvtPgNxNB5y1DmDqJQ0H0B3ntzmYRGeo0Y5X9crn24R9yfTulugyI9WD6UEwLir+JmrzZOvAeqqD/Ve9W/FxzhVaXrKzZG6Tca807qAXS7tL1SYpdecjpb4QEjSDc/CXpaSB20DWA5Wjpmq2mZGuDugNIHX6nZ6MXxwXRMEpFyRS6Cm6g0F2oKMUJwV2O77dmIMDJvmCYP0kMDnhKXVxCJrKBk/Oe0okX6RXCgDHybVXr9gvMoCYQxejT0O/ojVR++ysQmF6U2geZLwxlPrShrIPOqKwmXQBg3uwgyO6E8fSCbKrMfDOvxyexeEfjf501XQiKbU0i9b52NdFC3KWpmX4tdlPZvJ/lA6YlNqp5NK1R8ATnaWB57mk5n6+EIa5G9pz6jwLn0JWGDyU0f5JI6cdfw3N6EUACKx7w6mbJzoOVaQlWMOumGk7R2Yygx8cl5kcJc8IfK3pEo= 31 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Predix UI Hi, Want to contribute your suggestions to Predix UI? **Here's how you can help.** Please follow the below steps carefully, so your suggestions will be clear and developers can make effective fixes. ## Using the GitHub issue tracker The GitHub issue tracker is the preferred channel for [bug reports](#bug-reports), [features requests](#feature-requests) and [submitting pull requests](#pull-requests), so please respect the following restrictions: * Please **do not** use the GitHub issue tracker for personal support requests. Stack Overflow ([`predix ui`](https://stackoverflow.com/questions/tagged/predix-ui) tag), or [Predix.io](https://predix.io) are better places to get help. * Please **do not** derail or troll issues. Keep the discussion on topic and respect the opinions of others. * Please **do not** post vague comments like "+1" or ":thumbsup:". Use [GitHub's "reactions" feature](https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments). We reserve the right to delete comments. ## Issues and labels Our bug tracker utilizes several labels to help organize and identify issues. Here's what they represent and how we use them: - `browser bug` - Issues that are reported to us, but are actually the result of a browser-specific bug. These issues are diagnosed with reduced test cases and result in an issue opened on that browser's own bug tracker. - `confirmed` - Issues that have been confirmed with a reduced test case and identify a bug in a Predix UI component. - `css` - Issues stemming from our compiled CSS or source Sass files. - `docs` - Issues for improving or updating our documentation. - `examples` - Issues involving the example templates included in our docs. - `enhancement` - Issues asking for a new feature to be added, or an existing one to be extended or modified. New features require a minor version bump (e.g., `v3.0.0` to `v3.1.0`). - `grunt` - Issues with our included JavaScript-based Gruntfile, which is used to run all our tests, concatenate and compile source files, and more. - `help wanted` - Issues that we need or would like the community to help us resolve. - `js` - Issues stemming from our compiled or source JavaScript files. - `meta` - Issues with the project itself or our GitHub repository. ## Bug reports A bug is a _demonstrable problem_ caused by the code in the repository. Good bug reports are extremely helpful. Guidelines for bug reports: 0. **Validate and lint your code**; [validate your HTML](http://html5.validator.nu) and [lint your HTML](http://www.dirtymarkup.com/) to ensure your problem isn't caused by a simple error in your own code. 1. **Use the GitHub issue search**; check if the issue has already been reported. 2. **Check if the issue has been fixed**; try to reproduce the issue by using the latest `master` or development branch in the repository. 3. **Isolate the problem**; ideally create a [reduced test case](https://css-tricks.com/reduced-test-cases/) and a live example using [CodePen](http://codepen.io/mdwragg/pen/LNwmpB) or [jsfiddle](https://jsfiddle.net/Lqmcwhw0/3/). A good bug report shouldn't require others to get more information. Please be as detailed as possible in your report. What is your environment? What steps will reproduce the issue? What browser(s) and OS experience the problem? Do other browsers show the bug differently? What would you expect for the outcome? Such details will help people fix potential bugs. Example: > Short and descriptive example bug report title > > A summary of the issue and the browser/OS environment in which it occurs. If > suitable, include the steps required to reproduce the bug. > > 1. This is the first step > 2. This is the second step > 3. Further steps, etc. > > `` - a link to the reduced test case > > Any other information relevant to the bug report. This might include the lines of code that you have identified as > causing the bug, and potential solutions (and your opinions on their > merits). ## Feature Requests Feature requests are welcome, but before opening one, determine if your idea suits the scope and aims of Predix UI. *You* need to make a strong case and convince the Predix UI team to adopt your feature. Please provide as much detail and context as possible. ## Pull Requests Your pull requests�patches, improvements, and new features�are a big help. The requests should be focused and avoid unrelated commits. **Please ask** before making a significant pull request (e.g., implementing features, refactoring code, or porting to a different language) that Predix UI developers might not merge into the component. Please follow the [coding guidelines](#code-guidelines) used throughout the project (indentation, accurate comments, etc.) and any other requirements (such as test coverage). **Do not edit any of the CSS files directly!** The files are automatically generated. You should edit the source files in [`sass/`] instead. **Do not edit the `gh-pages` branch.** That branch is generated from the documentation source files and is managed separately by the Predix UI team. Please use the following process to have your work considered for the project: 1. [Fork](https://help.github.com/fork-a-repo/) the component. 2. Create a new topic branch (off the main project development branch) to contain your feature, change, or fix: ``` bash git checkout -b ``` 3. Commit your changes in logical chunks. Please adhere to these [git commit message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) or your code is unlikely to be merged into the main project. Use Git's [interactive rebase](https://help.github.com/articles/interactive-rebase) feature to tidy up your commits before making them public. 4. Locally merge (or rebase) the latest commits into your branch: ``` bash git pull [--rebase] origin master ``` 5. Push your topic branch up to your fork: ``` bash git push origin ``` 6. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) with a clear title and description against the `master` branch. ## Code guidelines ### HTML [Adhere to the Code Guide.](http://codeguide.co/#html) - Use tags and elements appropriate for an HTML5 doctype (e.g., self-closing tags). - Use [WAI-ARIA](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) attributes in documentation examples to promote accessibility. ### CSS [Adhere to the Code Guide.](http://codeguide.co/#css) - When feasible, default color palettes should comply with [WCAG color contrast guidelines](http://www.w3.org/TR/WCAG20/#visual-audio-contrast). - Except in rare cases, don't remove default `:focus` styles (via e.g. `outline: none;`) without providing alternative styles. See [this A11Y Project post](http://a11yproject.com/posts/never-remove-css-outlines/) for more details. ### JS - 2 spaces (no tabs) - "Attractive" - no errors / warnings -------------------------------------------------------------------------------- /HISTORY.md: -------------------------------------------------------------------------------- 1 | v6.1.3 2 | ================== 3 | * Fixed a bug when column that is initially hidden ("hide" attribute present in DOM when created) has no filter box when picked via the column chooser. 4 | * Fixed a bug causing an edit made on any page other than page 1 to navigate back to page 1. 5 | 6 | v6.1.2 7 | ================== 8 | * Remove ES6 arrow function 9 | 10 | v6.1.1 11 | ================== 12 | * Fixed a bug when dynamically adding data and columns 13 | 14 | v6.1.0 15 | ================== 16 | * merge #198 17 | 18 | v6.0.0 19 | ================== 20 | * sortable should be false by default 21 | 22 | v5.1.13 23 | ================== 24 | * merge #196, fix #179 25 | 26 | v5.1.12 27 | ================== 28 | * fixing demo pages for IE11 29 | 30 | v5.1.11 31 | ================== 32 | * update demo so it doesn't look broken on site 33 | 34 | v5.1.10 35 | ================== 36 | * update demo so it doesn't look broken on site 37 | 38 | v5.1.9 39 | ================== 40 | * add missing localization for "No Results" (#186) 41 | 42 | v5.1.8 43 | ================== 44 | * fix #182 45 | 46 | v5.1.7 47 | ================== 48 | * add missing localization for "Selected" 49 | 50 | v5.1.6 51 | ================== 52 | * add css vars for hovered rows 53 | 54 | v5.1.5 55 | ================== 56 | * fix demo 57 | 58 | v5.1.4 59 | ================== 60 | * fix #170, pagination styles 61 | 62 | v5.1.3 63 | ================== 64 | * fix #171 65 | 66 | v5.1.2 67 | ================== 68 | * add device flags 69 | 70 | v5.1.1 71 | ================== 72 | * revert 5.1.0, unintended side effects 73 | 74 | v5.1.0 75 | ================== 76 | * add content slot for actions/menus 77 | 78 | v5.0.4 79 | ================== 80 | * add standardized events for editing 81 | * fix display issue of edit field 82 | 83 | v5.0.3 84 | ================== 85 | * Demo z-index fix. 86 | 87 | v5.0.2 88 | ================== 89 | * fixing selecting and filtering + documentation updates (https://github.com/PredixDev/px-data-table/pull/168) 90 | 91 | v5.0.1 92 | ================== 93 | * test fixes and migrating to WCT 6.x 94 | 95 | v5.0.0 96 | ================== 97 | * remote data source support. https://github.com/PredixDev/px-data-table/pull/126 98 | 99 | v4.0.15 100 | ================== 101 | * fix #164 pagination bug 102 | 103 | v4.0.14 104 | ================== 105 | * fix #160 and remove infinite loop issue 106 | 107 | v4.0.13 108 | ================== 109 | * update to work with latest dropdown 110 | 111 | v4.0.12 112 | ================== 113 | * fix history 114 | 115 | v4.0.11 116 | ================== 117 | * merge #157 118 | 119 | v4.0.10 120 | ================== 121 | * merge #155 122 | 123 | v4.0.9 124 | ================== 125 | * fix pagination (#152) 126 | 127 | v4.0.8 128 | ================== 129 | * fix padding of html columns (#151) and pagination buttons 130 | 131 | v4.0.7 132 | ================== 133 | * fix docs 134 | 135 | v4.0.6 136 | ================== 137 | * fix highlight demo to calculate path (#149) 138 | 139 | v4.0.5 140 | ================== 141 | * Fix for sub-component demos to refer to shared API docs. 142 | 143 | v4.0.4 144 | ================== 145 | * Fix comment for analyzer 146 | 147 | v4.0.3 148 | ================== 149 | * fix pagination alignment in IE 150 | 151 | v4.0.2 152 | ================== 153 | * fix bugs 154 | 155 | v4.0.1 156 | ================== 157 | * fix pagination icons & dropdown 158 | * fix bug with select column 159 | 160 | v4.0.0 161 | ================== 162 | * major release for redesign 163 | 164 | v3.0.4 165 | ================== 166 | * remove old component image 167 | * update README 168 | 169 | v3.0.3 170 | ================== 171 | * fix #139, #140 (merge #142) 172 | 173 | v3.0.2 174 | ================== 175 | * add check for single select 176 | 177 | v3.0.1 178 | ================== 179 | * move px-row-click event 180 | 181 | v3.0.0 182 | ================== 183 | * replace pxLocalizeBehavior with appLocalizeBehavior for localization 184 | 185 | v2.1.7 186 | ================== 187 | * fixed filter behavior #79 and #90 188 | 189 | v2.1.6 190 | ================== 191 | * fixed #128 and added placeholder #107 192 | 193 | v2.1.5 194 | ================== 195 | * fixed #93 - font-awesome path issue & 404s in certain app configurations 196 | 197 | v2.1.4 198 | ================== 199 | * fixed #120 200 | 201 | v2.1.3 202 | ================== 203 | * cutover to PxLocalizeBehavior 204 | 205 | v2.1.2 206 | ================== 207 | * update dependencies 208 | 209 | v2.1.1 210 | ================== 211 | * merge PR #113 to fix issue #86, fixes behavior of select all checkbox with filters 212 | 213 | v2.1.0 214 | ================== 215 | * re-add a11y and i18n changes from 2.0.1 and 2.0.2 216 | 217 | v2.0.4 218 | ================== 219 | * fixed column duplication / hiding issues 220 | 221 | v2.0.3 222 | ================== 223 | * revert 2.0.1 and 2.0.2 224 | 225 | v2.0.0 226 | ================== 227 | * This release addresses a number of issues (PR #112): 228 | * fixes the behavior of the selectable column (currently appears in the wrong place when turned on dynamically) 229 | * adds an option for single-select (radio button vs checkbox) 230 | * fires the row-click behavior for non-editable cells 231 | * fixes the validateEvent error 232 | * changes the behavior of row declaration (it will create all of the columns found in data with default settings then override the settings for any columns declared in lightDOM). 233 | 234 | v1.15.21 235 | ================== 236 | * Issue #108 237 | 238 | v1.15.20 239 | ================== 240 | * fixed spacing of pagination buttons 241 | * fixed borders for table--rows and table--columns 242 | 243 | v1.15.19 244 | ================== 245 | * several minor fixes: 246 | * fixed #102 247 | * removed misleading references to highlight-color 248 | * copied style variables to highlight API 249 | 250 | v1.15.18 251 | ================== 252 | * updated css variable naming for dropdown 253 | 254 | v1.15.17 255 | ================== 256 | * fixed enableColumnResize so that it actually works 257 | 258 | v1.15.16 259 | ================== 260 | * fixed #79 to support pasting in filter fields 261 | 262 | v1.15.15 263 | ================== 264 | * fixed CodePen for subcomponent 265 | 266 | v1.15.14 267 | ================== 268 | * fixed badges for subcomponent pages 269 | 270 | v1.15.13 271 | ================== 272 | * updated to px-demo 273 | 274 | v1.15.12 275 | ================== 276 | * fix up column demo to correctly configure dropdown columns 277 | 278 | v1.15.11 279 | ================== 280 | * bower updated so px-demo-snippet and px-api-viewer have new grays 281 | 282 | v1.15.10 283 | ================== 284 | * fixed failing unit test with new grays 285 | 286 | v1.15.8 287 | ================== 288 | * hide ms-clear to fix issue #90 in IE 289 | 290 | v1.15.7 291 | ================== 292 | * Update colors design to pick up new colors 293 | 294 | v1.15.6 295 | ================== 296 | * changing ghp.sh to account for Alpha releases 297 | 298 | v1.15.5 299 | ================== 300 | * Fixed validation failure icon. Fix up imports of px-polymer-font-awesome. 301 | 302 | v1.15.4 303 | ================== 304 | * Fixed polymer-font-awesome icon 305 | 306 | v1.15.3 307 | ================== 308 | * Scripting to CI/CD and preparing for docs push 309 | 310 | v1.15.2 311 | ================== 312 | * Fix pagination button icons and column sort icons. Fix double-tap selection of column headers and add nowrap for first column 313 | 314 | v1.15.1 315 | ================== 316 | * Update missed design depndencies 317 | 318 | v1.15.0 319 | ================== 320 | * Updated dependencies 321 | 322 | v1.14.22 323 | ================== 324 | * Fixed striping table row style 325 | 326 | v1.14.21 327 | ================== 328 | * added style variables for header row 329 | 330 | v1.14.18 331 | ================== 332 | * Fix sort icon wrapping onto newline issue 333 | 334 | v1.14.17 335 | ================== 336 | * changing all devDeps to ^ 337 | 338 | v1.14.16 339 | ================== 340 | * Update px-theme to 2.0.1 and update test fixtures 341 | 342 | v1.14.15 343 | ================== 344 | * small change to demo options 345 | 346 | v1.14.14 347 | ================== 348 | * fixed typo in documentation 349 | 350 | v1.14.12 351 | ================== 352 | * Ensure cell tooltip is removed on detached 353 | 354 | v1.14.11 355 | ================== 356 | * update dependencies for dropdown 357 | 358 | v1.14.10 359 | ================== 360 | * Fix dropdown css variable names to point to correct name. 361 | 362 | v1.14.9 363 | ================== 364 | * removing px-theme style call 365 | 366 | v1.14.8 367 | ================== 368 | * changing Gruntfile.js to gulpfile.js 369 | 370 | v1.14.7 371 | ================== 372 | * added css variables 373 | 374 | v1.14.6 375 | ================== 376 | * bower updating px-demo-snippet 377 | 378 | v1.14.5 379 | ================ 380 | * Fix for error with auto-generated columns with white spaces in names. 381 | 382 | v1.14.4 383 | ================ 384 | * updated to latest version of dropdown 385 | 386 | v1.14.2 387 | ================ 388 | * fixed codepen 389 | 390 | v1.14.1 391 | ================ 392 | * Update dependencies 393 | 394 | v1.13.3 395 | ================ 396 | * Hide scrollbar if not needed 397 | 398 | v1.13.2 399 | ================ 400 | * Remove gruntfile 401 | 402 | v1.13.1 403 | ================ 404 | * Fix for column chooser and long column names 405 | 406 | v1.13.0 407 | ================ 408 | * Move to gulp and style modules 409 | 410 | v1.12.7 411 | ================ 412 | * Added wrapping for long column headers 413 | 414 | v1.12.6 415 | ================ 416 | * added support for parent-name in demo-snippet 417 | 418 | v1.12.5 419 | ================ 420 | * Update ghp to include secondary demo pages 421 | 422 | v1.12.4 423 | ================ 424 | * Added new demo pages 425 | 426 | v1.12.3 427 | ================ 428 | * added image to readme 429 | 430 | v1.12.2 431 | ================ 432 | * vulcanized old demo page as well. 433 | 434 | v1.12.1 435 | ================ 436 | * added vulcanize to demo page 437 | 438 | v1.12.0 439 | ================ 440 | * Fixes to allow re-cycling of existing data table element with new data 441 | 442 | v1.11.1 443 | ================ 444 | * Fix bug that when table was selectable but not filterable, select all button (and row) were hidden. 445 | 446 | v1.11.0 447 | ================ 448 | * Upgrade to Polymer 1.5.0 449 | 450 | v1.10.3 451 | ================ 452 | * Filterable hide fix & merge. 453 | 454 | v1.10.2 455 | ================ 456 | * Fix & tests for empty filter header row showing when no columns are marked as filterable. 457 | 458 | v1.10.1 459 | ================ 460 | * Fix & tests for https://github.com/PredixDev/px-data-table/issues/30 461 | 462 | v1.10.0 463 | ================ 464 | * Added cell click event. 465 | 466 | v1.9.5 467 | ================ 468 | * Upping bower dependencies to latest polymer-font-awesome to stop bower resolution conflicts. 469 | 470 | v1.9.4 471 | ================ 472 | * added oss_notice to bower ignore 473 | 474 | v1.9.3 475 | ================ 476 | * added pull request test for travis and updated OSS Notice 477 | 478 | v1.9.2 479 | ================ 480 | * added auto github pages functionality 481 | 482 | v1.9.1 483 | ================ 484 | * fix racing condition that could lead to the same column being shown several times if px-data-column was defined in HTML + the data changed several time in succession at init 485 | 486 | v1.9.0 487 | ================ 488 | * Many fixes to move highlight and selection styles onto px-data-table-cell. 489 | * Fixes to make highlight style consistent. 490 | * Highlight style fixes to make it in combination with selection styles and validation modes. 491 | 492 | v1.8.2 493 | ================ 494 | * cosmetic enhancements for column reordering 495 | 496 | v1.8.1 497 | ================= 498 | * make sure insertion indicator when moving columns has a consistent size. Make sure 'select' column can't be dragged 499 | 500 | v1.8.0 501 | ================= 502 | * Upgrade to Polymer 1.4.0 503 | 504 | v1.7.1 505 | ================= 506 | * Added auto github pages rebuilding on tag push 507 | 508 | v1.7.0 509 | ================= 510 | * Added enable-column-resize attribute on px-data-table, allowing the user to resize columns by clicking and dragging the right border of a header 511 | 512 | v1.6.2 513 | ================= 514 | * fix bug when dropping first user defined column on 'selected' column 515 | 516 | v1.6.1 517 | ================= 518 | * Columns tracked directly in the light dom: if adding data through the dataTable attribute px-data-table-column will be added in the light dom for each appropriate column. The column order is tracked within the light dom as well. 519 | 520 | v1.6.0 521 | ================= 522 | * Added columns hiding/showing functionality: hideColumn(columnName) and showColumn(columnName) API functions and show-column-chooser attribute on px-data-table, adding a dropdown allowing to select which column should be hidden. 523 | * Added column reordering functionality: drag and drop column headers. Enabled through the enable-column-reorder attribute on px-data-table. 524 | 525 | v1.5.2 526 | ================= 527 | * added a css variable for dropdown border. 528 | 529 | v1.5.1 530 | ================= 531 | * fixed an issue with dropdown tooltips within data table 532 | 533 | v1.5.0 534 | ================= 535 | * Fixes to correctly notify table-data attribute when changes happen to the table data and propagate them out of the component. 536 | * Fixes to make table react correctly when the underlying model (table-data) changes. 537 | * Fixes to dropdown width and to make the cell text (character) width consistent with other column definitions. 538 | * Sass fixes for shadow DOM. 539 | 540 | v1.4.0 541 | ================= 542 | * Added css variable to support custom cell padding: --px-data-table-padding-top, --px-data-table-padding-bottom, --px-data-table-padding-left, --px-data-table-padding-right 543 | 544 | v1.3.1 545 | ================= 546 | * Updated dropdown to latest version 547 | 548 | v1.3.0 549 | ================= 550 | * Added Dropdown functionality 551 | 552 | v1.2.0 553 | ======= 554 | * Initial support for cell and row highlighting. See demo.html for an example. 555 | * Support for 'high'/'medium'/'low' highlight styles on given cell or row. 556 | * Light DOM observation of addition and removal of px-data-table-columns elements. Table now dynamically reacts to these changes. 557 | * Remove 'x' from input elements on IE and Edge. 558 | * Fix for making highlight and selected rows consistent when filtering or ordering of columns. 559 | * Fixes for IE when using column and cell highlight. 560 | * More tests. 561 | 562 | 563 | v1.1.3 564 | ================= 565 | * Move bower components to use registered component names. 566 | 567 | v1.1.2 568 | ================= 569 | * Fix 1px border-collapse padding bug. 570 | 571 | v1.1.1 572 | ================= 573 | * Updated README with preventing auto-synching your info. 574 | 575 | v1.1.0 576 | ================= 577 | * Add hide-pagination-control property to allow user to control if the data table pagination controls are available or not to the user. 578 | 579 | v1.0.5 580 | ================= 581 | * Fixes for table borders disappearing in Safari 582 | * Fixes for column only and row only cell borders. 583 | * Removal of '5' row option in pagination control to match data table design. 584 | 585 | v1.0.3 586 | ================= 587 | * Updated License 588 | 589 | v1.0.2 590 | ================= 591 | * removed extraneous 5 from array which was causing a dropdown bug 592 | 593 | v1.0.1 594 | ================== 595 | * Fixes missing tooltip and incorrect positioning on validation error. 596 | 597 | v1.0.0 598 | ================== 599 | * Now possible to set a column as 'editable' and allow the cell to be selected and the content edited. 600 | * Per-cell validation is now possible. As a cell is edited and the change accepted a (developer supplied) validation routine is executed, a cell will be marked as 601 | 602 | v0.0.1 603 | ================== 604 | * Initial release 605 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /OSS_Notice.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/predixdesignsystem/px-data-table/c47304350303f66af6a9f447487218cdabb0b86e/OSS_Notice.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # px-data-table [![Build Status](https://travis-ci.org/predixdesignsystem​/px-data-table.svg?branch=master)](https://travis-ci.org/predixdesignsystem/px-data-table) 2 | 3 | ## Overview 4 | 5 | `Px-data-table` is a Predix UI component which defines a data table, optionally using a sub-element for advanced column settings. 6 | 7 | ## Usage 8 | 9 | ### Prerequisites 10 | 11 | 1. node.js 12 | 2. npm 13 | 3. bower 14 | 4. [webcomponents-lite.js polyfill](https://github.com/webcomponents/webcomponentsjs) 15 | 16 | Node, npm and bower are necessary to install the component and dependencies. webcomponents.js adds support for web components and custom elements to your application. 17 | 18 | ### Getting Started 19 | 20 | First, install the component via bower on the command line. 21 | 22 | ``` 23 | bower install https://github.com/predixdesignsystem​/px-data-table.git --save 24 | ``` 25 | 26 | Second, import the component to your application with the following tag in your head. 27 | 28 | ```html 29 | 30 | ``` 31 | 32 | Finally, use the component in your application: 33 | 34 | ```html 35 | Minimum - Client-Side Sort/Filter/Pagination: 36 | 37 | 40 | 41 | 42 | Minimum - Server-Side Sort/Filter/Pagination: 43 | 44 | 50 | 51 | ``` 52 | 53 | ### Client-Side VS Server-Side Data Paradigms 54 | 55 | There are two main paradigms for the source of data in a table. 56 | 57 | In a _Client-Side_ model, the browser makes one request for the _complete set_ of data. 58 | This means that sorting, filtering, and pagination all happen in memory on the client. 59 | While this produces snappy tables with reasonably sized data sets, it can lead to a sluggish UI 60 | for larger data sets. This works great with data sets that don't change frequently, 61 | since the full payload would have to be resent for every update. 62 | 63 | In a _Server-Side_ model, the browser makes a request for a _subset_ of data for a particular page. 64 | Sorting, filtering, and pagination requests will have to be made to a service for a new _subset_ of data 65 | that matches the user's intended criteria. This prevents the browser from being overwhelmed with excessively 66 | large data sets by only exposing one page's worth of data at a time. This is ideal for larger data sets or 67 | where it is preferable to make multiple small requests instead of fewer larger requests. Due to the increased 68 | frequency of requests, the UI is more likely to display data in sync with the server. 69 | 70 | ### Client Side Sort/Filter/Pagination 71 | 72 | For more details and complex examples: [Client-Side Data Reference](docs/client-side-data.md) 73 | 74 | ### Server Side Sort/Filter/Pagination 75 | 76 | For more details and complex examples: [Server-Side Data Reference](docs/server-side-data.md) 77 | 78 | ### Integrating with other frameworks (ex: Angular): 79 | 80 | You may not be able to use 2-way binding with the objects/arrays in other frameworks such as Angular. 81 | 82 | We suggest instead to use events and selectors, for example: 83 | 84 | ``` 85 | document.getElementById("myDataTable").addEventListener("px-row-click", function(e) { 86 | ... 87 | }); 88 | 89 | document.getElementById("myDataTable").addEventListener("px-select-all-click", function(e) { 90 | ... 91 | }); 92 | 93 | $scope.doSomethingWithSelectedRows = function() { 94 | $scope.allSelectedRows = document.getElementById("myDataTable").selectedRows; 95 | }; 96 | ``` 97 | 98 | You may also want to prevent your data from auto-synching with your model. If so, we've written up a [little explanation] to help you with that. 99 | 100 | ## Documentation 101 | 102 | Read the full API and view the demo [here](https://www.predix-ui.com/#/elements/data-table/px-data-table). 103 | 104 | ## Local Development 105 | 106 | From the component's directory... 107 | 108 | ``` 109 | $ npm install 110 | $ bower install 111 | $ gulp sass 112 | ``` 113 | 114 | From the component's directory, to start a local server run: 115 | 116 | ``` 117 | $ gulp serve 118 | ``` 119 | 120 | The root of that server (e.g. http://localhost:8080/) will automatically open in your default browser with the API documentation page and interactive working examples. 121 | 122 | `gulp serve` also runs `gulp watch` concurrently so that when you make a change to your source files and save them, your preview will be updated in any browsers you have opened and turned on in LiveReload. 123 | 124 | ### GE Coding Style Guide 125 | 126 | [GE JS Developer's Guide](https://github.com/GeneralElectric/javascript) 127 | 128 | ## Known Issues 129 | 130 | Please use [Github Issues](https://github.com/predixdesignsystem/px-data-table/issues) to submit any bugs you might find. 131 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "px-data-table", 3 | "version": "6.1.4", 4 | "main": [ 5 | "px-data-table.html" 6 | ], 7 | "ignore": [ 8 | "*.enc", 9 | "**/.*", 10 | "bower_components", 11 | "node_modules", 12 | "gulpfile.js", 13 | "scripts", 14 | ".github", 15 | "sass", 16 | "*.md", 17 | "wct.conf.json", 18 | "test", 19 | "OSS_Notice.pdf", 20 | "*.png", 21 | "npm-debug.log" 22 | ], 23 | "dependencies": { 24 | "polymer": "^1.7.0", 25 | "px-tooltip": "^1.0.0", 26 | "iron-a11y-keys-behavior": "^2.0.0", 27 | "px-icon-set": "^2.0.0", 28 | "px-validation": "^1.0.0", 29 | "px-dropdown": "4.3.4", 30 | "app-localize-behavior": "^2.0.0" 31 | }, 32 | "devDependencies": { 33 | "px-theme": "^3.0.0", 34 | "px-starter-kit-design": "^1.0.0", 35 | "iron-ajax": "^2.0.0", 36 | "promise-polyfill": "polymerlabs/promise-polyfill#^1.0.1", 37 | "px-toggle-design": "^2.0.0", 38 | "px-demo": "^2.0.0", 39 | "px-layout-design": "^1.0.0", 40 | "px-tables-design": "^2.0.0", 41 | "px-button-group-design": "^2.0.0", 42 | "px-forms-design": "^2.0.0", 43 | "web-component-tester": "^6.3.0" 44 | }, 45 | "resolutions": { 46 | "webcomponentsjs": "^0.7.24", 47 | "promise-polyfill": "^1.0.0", 48 | "px-overlay": "^1.1.1" 49 | }, 50 | "license": "Apache-2.0" 51 | } 52 | -------------------------------------------------------------------------------- /contacts-mini.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "first": "Valentine", 4 | "last": "Meyer", 5 | "image": "https://s3.amazonaws.com/uifaces/faces/twitter/iboldurev/73.jpg", 6 | "boolean": true, 7 | "guid": "8c3bd9ad-e8d6-4ea4-85e6-d145295f3f91", 8 | "integer": 99, 9 | "date": "Sat Feb 17 1973 03:45:57 GMT-0800 (PST)", 10 | "address": "4 Whitty Lane", 11 | "city": "Nicholson", 12 | "state": "South Carolina", 13 | "zip": 41343, 14 | "country": "Germany", 15 | "email": "valentinemeyer@scentric.com", 16 | "phone": "(956) 428-2996", 17 | "color": "" 18 | }, 19 | { 20 | "first": "Silva", 21 | "last": "Alexander", 22 | "image": "https://s3.amazonaws.com/uifaces/faces/twitter/smalonso/73.jpg", 23 | "boolean": true, 24 | "guid": "37224065-ac71-4716-be9a-108ecddfee47", 25 | "integer": 16, 26 | "date": "Wed Aug 02 1995 07:03:12 GMT-0700 (PDT)", 27 | "address": "2 Berkeley Place", 28 | "city": "Manila", 29 | "state": "Michigan", 30 | "zip": 22009, 31 | "country": "Thailand", 32 | "email": "silvaalexander@gmail.com", 33 | "phone": "(823) 415-2224", 34 | "color": "" 35 | }, 36 | { 37 | "first": "Hopkins", 38 | "last": "Wong", 39 | "image": "https://s3.amazonaws.com/uifaces/faces/twitter/taherrapee/73.jpg", 40 | "boolean": false, 41 | "guid": "1ea0922e-179d-4057-abeb-d8fe63e55da8", 42 | "integer": 94, 43 | "date": "Wed Sep 21 2011 04:03:55 GMT-0700 (PDT)", 44 | "address": "4 Tompkins Avenue", 45 | "city": "Movico", 46 | "state": "Maine", 47 | "zip": 89440, 48 | "country": "Seychelles", 49 | "email": "hopkinswong@hotmail.com", 50 | "phone": "(814) 488-2063", 51 | "color": "" 52 | }, 53 | { 54 | "first": "Joe", 55 | "last": "Sherman", 56 | "image": "https://s3.amazonaws.com/uifaces/faces/twitter/ismailmayat/73.jpg", 57 | "boolean": true, 58 | "guid": "46a4a1bc-97af-46e0-aedd-c3cc42e6b8f5", 59 | "integer": 27, 60 | "date": "Wed Jul 07 2010 05:48:57 GMT-0700 (PDT)", 61 | "address": "3 Stratford Road", 62 | "city": "Makena", 63 | "state": "Kansas", 64 | "zip": 21389, 65 | "country": "Chad", 66 | "email": "joejoe@yahoo.com", 67 | "phone": "(887) 497-3612", 68 | "color": "" 69 | }, 70 | { 71 | "first": "Jane", 72 | "last": "Bartlett", 73 | "image": "https://s3.amazonaws.com/uifaces/faces/twitter/carlyson/73.jpg", 74 | "boolean": false, 75 | "guid": "17aac57d-4644-44d8-8a6b-b2eedd3d42dc", 76 | "integer": 49, 77 | "date": "Sun Mar 14 1999 23:13:33 GMT-0800 (PST)", 78 | "address": "4 Luquer Street", 79 | "city": "Newcastle", 80 | "state": "Iowa", 81 | "zip": 72190, 82 | "country": "Uruguay", 83 | "email": "jane@scentric.com", 84 | "phone": "(957) 412-3261", 85 | "color": "" 86 | } 87 | 88 | ] 89 | -------------------------------------------------------------------------------- /css/px-data-table-highlight-styles.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 23 | -------------------------------------------------------------------------------- /css/px-data-table-styles.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 23 | -------------------------------------------------------------------------------- /demo-angular.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | px-data-table Demo 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 |

Data table demos

36 | 37 |

A very simple data table. Just displays data and has sortable columns.

38 | 39 |
40 | 41 | {{tabledata}} 42 |
43 | 44 | 45 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /demo.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | px-data-table Demo 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 192 | 193 | 194 | 195 | -------------------------------------------------------------------------------- /demo/index.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 35 | 36 | 62 | -------------------------------------------------------------------------------- /demo/px-data-table-column-demo.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 127 | 128 | 129 | 261 | -------------------------------------------------------------------------------- /demo/px-data-table-demo.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 190 | 191 | 192 | 447 | -------------------------------------------------------------------------------- /demo/px-data-table-highlight-demo.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 118 | 119 | 120 | 219 | -------------------------------------------------------------------------------- /deploy.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/predixdesignsystem/px-data-table/c47304350303f66af6a9f447487218cdabb0b86e/deploy.enc -------------------------------------------------------------------------------- /docs/client-side-data.md: -------------------------------------------------------------------------------- 1 | # Client-Side Sort/Filter/Pagination 2 | 3 | ## Advanced 4 | 5 | ```html 6 | 13 | 19 | 20 | 21 | 22 | 23 | 24 | ``` 25 | -------------------------------------------------------------------------------- /docs/server-side-data.md: -------------------------------------------------------------------------------- 1 | # Server-Side Sort/Filter/Pagination 2 | 3 | ## Advanced Example 4 | 5 | In the following example `serverResponse` is an object that is updated upon the response of a server. 6 | 7 | ```html 8 | 9 | 16 | 21 | 22 | 23 | 24 | 25 | 26 | ``` 27 | 28 | ## Usage 29 | 30 | For container element `ContainerEl`, create the following event listeners and request new data based on the user-intended change. Upon receiving updated data, update the variables bound to the `table-data`, `total-entries`, and `first-item-index` attributes. 31 | 32 | ### Events 33 | 34 | For full descriptions, run `gulp serve` and check out the [demo page](../demo/index.html). 35 | 36 | - `px-data-table-init` 37 | - `px-page-change-intent` 38 | - `px-page-size-change-intent` 39 | - `px-filter-change-intent` 40 | - `px-sort-change-intent`s 41 | 42 | 43 | ## Example Usage 44 | 45 | ### Markup 46 | 47 | ```html 48 |
49 | 56 | 57 | 58 |
59 | ``` 60 | 61 | ### Data Binding 62 | 63 | ```javascript 64 | var rdt = document.getElementById('remoteDataTable'); 65 | 66 | rdt.remoteData = { 67 | totalRecordsCount: 0, 68 | recordIndexOfSubset: 0, 69 | dataSubset: [] 70 | }; 71 | 72 | rdt.addEventListener('px-page-change-intent', (evt) => { 73 | composeFetchRequest({page: evt.detail}); 74 | }); 75 | 76 | function composeFetchRequest(options) { 77 | fetchNewData('/someUrl', objToUrlParams(options)); 78 | } 79 | 80 | function handleNewDataReceived (serverResponse) { 81 | rdt.remoteData = { 82 | totalRecordsCount: serverResponse.totalRecordsCount, 83 | recordIndexOfSubset: serverResponse.recordIndexOfSubset, 84 | dataSubset: serverResponse.dataSubset 85 | }; 86 | } 87 | 88 | function objToUrlParams (params) { 89 | return Object.keys(params).map(function(k) { 90 | return encodeURIComponent(k) + '=' + encodeURIComponent(a[k]) 91 | }).join('&'); 92 | } 93 | ``` 94 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/predixdesignsystem/px-data-table/c47304350303f66af6a9f447487218cdabb0b86e/favicon.ico -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright (c) 2018, General Electric 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | 'use strict'; 19 | const path = require('path'); 20 | const gulp = require('gulp'); 21 | const pkg = require('./package.json'); 22 | const $ = require('gulp-load-plugins')(); 23 | const gulpSequence = require('gulp-sequence'); 24 | const importOnce = require('node-sass-import-once'); 25 | const stylemod = require('gulp-style-modules'); 26 | const browserSync = require('browser-sync').create(); 27 | const gulpif = require('gulp-if'); 28 | const combiner = require('stream-combiner2'); 29 | const bump = require('gulp-bump'); 30 | const argv = require('yargs').argv; 31 | const { ensureLicense } = require('ensure-px-license'); 32 | 33 | const sassOptions = { 34 | importer: importOnce, 35 | importOnce: { 36 | index: true, 37 | bower: true 38 | } 39 | }; 40 | 41 | gulp.task('clean', function() { 42 | return gulp.src(['.tmp', 'css'], { 43 | read: false 44 | }).pipe($.clean()); 45 | }); 46 | 47 | function handleError(err){ 48 | console.log(err.toString()); 49 | this.emit('end'); 50 | } 51 | 52 | function buildCSS(){ 53 | return combiner.obj([ 54 | $.sass(sassOptions), 55 | $.autoprefixer({ 56 | browsers: ['last 2 versions'], 57 | cascade: false, 58 | flexbox: false 59 | }), 60 | gulpif(!argv.debug, $.cssmin()) 61 | ]).on('error', handleError); 62 | } 63 | 64 | gulp.task('sass', function() { 65 | return gulp.src(['./sass/*.scss']) 66 | .pipe(buildCSS()) 67 | .pipe(stylemod({ 68 | moduleId: function(file) { 69 | return path.basename(file.path, path.extname(file.path)) + '-styles'; 70 | } 71 | })) 72 | .pipe(ensureLicense()) 73 | .pipe(gulp.dest('css')) 74 | .pipe(browserSync.stream({match: 'css/*.html'})); 75 | }); 76 | 77 | gulp.task('watch', function() { 78 | gulp.watch(['sass/*.scss'], ['sass']); 79 | }); 80 | 81 | gulp.task('serve', function() { 82 | browserSync.init({ 83 | port: 8080, 84 | notify: false, 85 | reloadOnRestart: true, 86 | logPrefix: `${pkg.name}`, 87 | https: false, 88 | server: ['./', 'bower_components'], 89 | }); 90 | 91 | gulp.watch(['css/*-styles.html', '*.html', '*.js', 'demo/*.html']).on('change', browserSync.reload); 92 | gulp.watch(['sass/*.scss'], ['sass']); 93 | 94 | }); 95 | 96 | gulp.task('bump:patch', function(){ 97 | gulp.src(['./bower.json', './package.json']) 98 | .pipe(bump({type:'patch'})) 99 | .pipe(gulp.dest('./')); 100 | }); 101 | 102 | gulp.task('bump:minor', function(){ 103 | gulp.src(['./bower.json', './package.json']) 104 | .pipe(bump({type:'minor'})) 105 | .pipe(gulp.dest('./')); 106 | }); 107 | 108 | gulp.task('bump:major', function(){ 109 | gulp.src(['./bower.json', './package.json']) 110 | .pipe(bump({type:'major'})) 111 | .pipe(gulp.dest('./')); 112 | }); 113 | 114 | gulp.task('license', function() { 115 | return gulp.src(['./**/*.{html,js,css,scss}', '!./node_modules/**/*', '!./bower_components?(-1.x)/**/*']) 116 | .pipe(ensureLicense()) 117 | .pipe(gulp.dest('.')); 118 | }); 119 | 120 | gulp.task('default', function(callback) { 121 | gulpSequence('clean', 'sass', 'license')(callback); 122 | }); 123 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Predix UI 23 | 24 | 28 | 57 | 58 | 61 | 62 | 63 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 76 | 81 | 82 | 85 | 86 | 87 | 90 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 106 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /monogram-wdmk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/predixdesignsystem/px-data-table/c47304350303f66af6a9f447487218cdabb0b86e/monogram-wdmk.png -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "px-data-table", 3 | "author": "General Electric", 4 | "description": "A Px component", 5 | "version": "6.1.4", 6 | "extName": null, 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/PredixDev/px-data-table.git" 10 | }, 11 | "homepage": "https://www.predix-ui.com/", 12 | "devDependencies": { 13 | "browser-sync": "^2.13.0", 14 | "ensure-px-license": "^1.0.0", 15 | "gulp": "^3.9.1", 16 | "gulp-autoprefixer": "^3.1.0", 17 | "gulp-bump": "^2.4.0", 18 | "gulp-clean": "^0.3.2", 19 | "gulp-concat": "^2.6.0", 20 | "gulp-cssmin": "^0.1.7", 21 | "gulp-if": "^2.0.1", 22 | "gulp-load-plugins": "^1.2.4", 23 | "gulp-match": "^1.0.2", 24 | "gulp-rename": "^1.2.2", 25 | "gulp-sass": "^4.0.1", 26 | "gulp-sequence": "^0.4.5", 27 | "gulp-style-modules": "^0.1.0", 28 | "node-sass-import-once": "^1.2.0", 29 | "stream-combiner2": "^1.1.1", 30 | "sw-precache": "^4.2.3", 31 | "yargs": "^5.0.0" 32 | }, 33 | "license": "Apache-2.0" 34 | } 35 | -------------------------------------------------------------------------------- /preventAutoSynch.md: -------------------------------------------------------------------------------- 1 | #Preventing auto-synchronization of your Model Data and your Database 2 | 3 | ##Table of Contents 4 | ###Preventing auto-synchronization of your Model Data and your Database 5 | ###Problem 6 | ###Explanation 7 | ###Recommendation 8 | ###Recommended User Flow 9 | 10 | ##Problem: 11 | When A user enters invalid data into an input text box, the invalid data entered should NOT be synchronized automatically to the database. 12 | 13 | ##Explanation: 14 | Occasionally, A developer might have the need to prevent the data from auto synchronizing directly from the user's browser into a database. 15 | This need will only come up with components that have an "edit" functionality, such as the Data Table (px-data-table). 16 | An example for such as event could be when a user updates a field with invalid data (letters where numbers are expected, etc). 17 | In such a case, the user will be presented with visual cues, telling them that the data entered is invalid. The user can then hit escape to revert back to the previous data, or correct their data. 18 | While the data is invalid, the developer should block automatic synchronization, since they likely do not want invalid data stored in the database. 19 | 20 | ##Recommendation: 21 | While the data is in error state, unless you WANT incorrect data to be synchronized to the database (and if you're reading this, that's probably not what you want), a barrier should be set up between the data model on the browser, and what's sent back to the database itself. 22 | Because of the nature of data binding in Polymer, there is no way to stop the data entered into a text field from synching with the model object that sits on the front-end. This means the data barrier should be set up at 23 | the end point connecting your model data on the front-end with the database itself. 24 | We recommend that a barrier be set up, preventing automatic synchronization of your model data with your database, and optionally adding an action component - such as a "Save" button - on the page. This allows for the data to only be synchronized when requested by the user - not automatically. 25 | 26 | ##Recommended User Flow: 27 | 1. User enters text into a text box. 28 | 2. Text is invalid. 29 | 3. User is presented with visual indicators, letting them know their data is invalid. 30 | 4. In the background, the data IS synchronized between the input text and your model (Polymer does this automatically), BUT NOT with your database. 31 | 5. The user tries saving the data by clicking on the above mentioned "Save" button, and is presented with a message, explaining that a save is not possible while invalid data is present. 32 | 6. User fixes data. 33 | 7. User clicks the "Save" button. 34 | 8. Data is synchronized between the model and the Database. 35 | 9. OPTIONAL. Auto-synchronization CAN be set up, even without a save button in place - the key with such a scenario is to ensure data validity every time auto-synchronization happens - if the data is invalid, no synchronization happens. At that point, it's up to the developer to make sure the user knows the data has NOT been saved - because the data is invalid - but it WILL be saved again once the data is fixed. 36 | -------------------------------------------------------------------------------- /px-data-table-cell.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 101 | 102 | 409 | 410 | 411 | 430 | 449 | -------------------------------------------------------------------------------- /px-data-table-column.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | 52 | 53 | 56 | 57 | 58 | 225 | -------------------------------------------------------------------------------- /px-data-table-highlight.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 47 | 48 | 54 | 55 | 56 | 118 | -------------------------------------------------------------------------------- /px-edit-cell.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 25 | 51 | 52 | -------------------------------------------------------------------------------- /px-example-highlight.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | 31 | -------------------------------------------------------------------------------- /px-pagination.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 36 | 37 | 67 | 68 | 69 | 455 | -------------------------------------------------------------------------------- /sass/aha-table.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, General Electric 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // Settings 18 | @import "px-defaults-design/_settings.defaults.scss"; 19 | @import "px-mixins-design/_tools.mixins.scss"; 20 | // Generic 21 | @import "px-normalize-design/_generic.normalize.scss"; 22 | @import "px-box-sizing-design/_generic.box-sizing.scss"; 23 | @import "px-helpers-design/_generic.helpers.scss"; 24 | // Base 25 | @import "px-flexbox-design/_base.flexbox.scss"; 26 | @import "px-viewport-design/_base.viewport.scss"; 27 | 28 | $inuit-enable-input--tiny: true; 29 | $inuit-enable-text-input--bare: true; 30 | $inuit-enable-validation-states : true; 31 | 32 | @import "px-forms-design/_base.forms.scss"; 33 | 34 | $inuit-enable-table--fixed: true; 35 | $inuit-enable-table--small: true; 36 | $inuit-enable-table--large: true; 37 | $inuit-enable-table--cells: true; 38 | $inuit-enable-table--columns: true; 39 | $inuit-table-border-color: var(--px-data-table-border-color, gray); 40 | $inuit-table-separator-color: var(--px-data-table-separator-color, gray); 41 | 42 | @import "px-tables-design/_base.tables.scss"; 43 | 44 | @import "px-layout-design/_objects.layout.scss"; 45 | 46 | $inuit-enable-btn--bare: true; 47 | $inuit-enable-btn--primary: true; 48 | $inuit-enable-btn--tertiary: true; 49 | $inuit-enable-btn--icon: true; 50 | $inuit-enable-btn--disabled: true; 51 | 52 | 53 | $fa-font-path : "../../font-awesome/fonts"; 54 | @import "px-buttons-design/_objects.buttons.scss"; 55 | 56 | :host { 57 | display: block; 58 | overflow-x: hidden; 59 | width: 100%; 60 | } 61 | 62 | .table { 63 | @extend table; 64 | display: table !important; 65 | margin-bottom: 0rem; 66 | } 67 | 68 | .table--cells th { 69 | border-bottom: 1px solid $inuit-table-border-color; 70 | } 71 | 72 | .table--cells #pagination { 73 | border-left: 1px solid $inuit-table-separator-color; 74 | border-right: 1px solid $inuit-table-separator-color; 75 | } 76 | 77 | th { 78 | text-align: left; 79 | } 80 | 81 | .th { 82 | @extend th; 83 | display: table-cell; 84 | resize: horizontal; 85 | font-weight: bold; 86 | color: var(--px-data-table-header-text-color, inherit); 87 | background-color: var(--px-data-table-header-background-color, inherit); 88 | } 89 | 90 | px-icon.sorting { 91 | width: 1rem; 92 | height: 1rem; 93 | margin-left: 0.3333rem; 94 | } 95 | 96 | .tr { 97 | display: table-row; 98 | } 99 | 100 | .tr:not(.tr--filter):not(.tr--header):hover { 101 | background: var(--px-data-table-row-background-color--hover); 102 | cursor: var(--px-data-table-row-cursor--hover); 103 | } 104 | 105 | .td.td { 106 | @extend td; 107 | display: table-cell; 108 | vertical-align: middle; 109 | } 110 | 111 | .td.td[hidden] { 112 | display: none; 113 | } 114 | 115 | .table.aha-table .td.td { 116 | padding-top: var(--px-data-table-padding-top); 117 | padding-bottom: var(--px-data-table-padding-bottom); 118 | padding-left: var(--px-data-table-padding-left, $inuit-base-spacing-unit--small); 119 | padding-right: var(--px-data-table-padding-right, $inuit-base-spacing-unit--small); 120 | } 121 | 122 | .scroll-body { 123 | display: block; 124 | overflow-x: auto; 125 | overflow-y: hidden; 126 | padding-left: 1px; /*firefox border collapse fix*/ 127 | padding-right: 1px; /*firefox border collapse fix*/ 128 | } 129 | 130 | .column-head { 131 | white-space: pre-line; 132 | user-select: none; 133 | &--selected { 134 | white-space: nowrap; 135 | user-select: none; 136 | } 137 | min-height: calculateRem(16px); 138 | } 139 | 140 | label { 141 | margin: 0; 142 | } 143 | 144 | .sorted-text { 145 | color: var(--px-data-table-cell-text-color--sorted, blue); 146 | } 147 | 148 | .sorted-text-hover:hover { 149 | color: var(--px-data-table-text-color--hover, blue); 150 | cursor: pointer; 151 | } 152 | 153 | .no-results { 154 | color: var(--px-data-table-results-text-color--none, black); 155 | height: 2rem; 156 | align-items: center; 157 | } 158 | 159 | .columnChooser { 160 | flex-direction: row-reverse; 161 | align-items: center; 162 | margin-right: 2px; 163 | } 164 | 165 | .moveable { 166 | cursor: move; 167 | } 168 | 169 | .header--drag-handle { 170 | cursor: col-resize; 171 | width: 15px; 172 | min-height: 100%; 173 | } 174 | 175 | .header--container { 176 | justify-content: space-between; 177 | } 178 | 179 | .aha-insertion-indicator-th.aha-insertion-indicator-th.aha-insertion-indicator-th { 180 | border: none; 181 | max-width:4px; 182 | min-width:4px; 183 | width:4px; 184 | padding: 0; 185 | } 186 | 187 | .table .aha-insertion-indicator-td { 188 | border: none; 189 | max-width:4px; 190 | min-width:4px; 191 | width:4px; 192 | padding: 0; 193 | background-color: var(--px-data-table-insertion-indicator-td-background-color, blue); 194 | } 195 | 196 | .insertion-indicator.insertion-indicator.insertion-indicator { 197 | border:none; 198 | max-width:4px; 199 | min-width:4px; 200 | width:4px; 201 | padding: 0; 202 | background-color: var(--px-data-table-insertion-indicator-td-background-color, blue); 203 | } 204 | 205 | .striped:nth-child(even) { 206 | background-color: var(--px-data-table-background-color-striped--even, rgba(black,0.07)); 207 | } 208 | 209 | .dragged { 210 | color: var(--px-data-table-text-color--dragged, blue); 211 | } 212 | 213 | .text-input--filter { 214 | background-color: var(--px-data-table-text-input-background-color--filter, white); 215 | border: none; 216 | } 217 | 218 | .tr--filter { 219 | background-color: var(--px-data-table-tr--filter, white); 220 | height: 40px; 221 | } 222 | 223 | .tr--filter span.td.td.aha-table { 224 | padding: 0; 225 | } 226 | 227 | .tr--filter #selectAllCheckbox { 228 | margin-left: $inuit-base-spacing-unit--small; 229 | } 230 | 231 | .selected-cell__selected.selected-cell__selected { 232 | background-color: var(--px-data-table-cell-background-color--selected, blue); 233 | border-top: 1px double var(--px-data-table-cell-border-color--selected, blue) !important; 234 | border-bottom: 1px double var(--px-data-table-cell-border-color--selected, blue) !important; 235 | } 236 | 237 | .cell--value__validation-failed{ 238 | border: $inuit-table-border-width double var(--px-data-table-cell-border-validation--failed, red) !important; 239 | } 240 | 241 | .px-data-table-highlight--high{ 242 | background-color: var(--px-data-table-highlight--high, rgba(red,0.4)); 243 | } 244 | 245 | .px-data-table-highlight--medium{ 246 | background-color: var(--px-data-table-highlight--medium, rgba(yellow,0.4)); 247 | } 248 | 249 | .px-data-table-highlight--low{ 250 | background-color: var(--px-data-table-highlight--low, rgba(blue,0.4)); 251 | } 252 | 253 | .pagination { 254 | border-bottom: 1px solid $inuit-table-border-color; 255 | user-select: none; 256 | -webkit-tap-highlight-color: transparent; 257 | padding-top: 0.8rem; 258 | padding-bottom: 0.8rem; 259 | } 260 | 261 | .paginationContainer, .pagesize { 262 | display: flex; 263 | flex-direction: row; 264 | align-items: center; 265 | justify-content: space-between; 266 | flex-wrap: wrap; 267 | } 268 | 269 | .rowsPerPage { 270 | color: var(--px-data-table-header-text-color, gray); 271 | } 272 | 273 | .paginationContainer #dropdown { 274 | line-height: calculateRem(30px); 275 | --px-btn-min-width: 0; 276 | } 277 | 278 | .paginationContainer .btn { 279 | padding-left: calculateRem(7px); 280 | padding-right: calculateRem(7px); 281 | line-height: calculateRem(22px); 282 | height: auto; 283 | min-width: 0; 284 | } 285 | 286 | .paginationContainer .btn + .btn { 287 | margin-left: calculateRem(6px); 288 | } 289 | 290 | .btn#next { 291 | padding: 0; 292 | margin-left: calculateRem(13px); 293 | } 294 | .btn#previous { 295 | padding: 0; 296 | margin-left: calculateRem(20px); 297 | margin-right: calculateRem(7px); 298 | } 299 | 300 | // Trumps 301 | $inuit-enable-margins--none: true; 302 | $inuit-enable-margins--small: true; 303 | $inuit-enable-margins--tiny: true; 304 | $inuit-enable-margins--large: true; 305 | $inuit-enable-paddings--none: true; 306 | $inuit-enable-paddings--small: true; 307 | $inuit-enable-paddings--large: true; 308 | $inuit-enable-paddings--none: true; 309 | @import "px-spacing-responsive-design/_trumps.spacing-responsive.scss"; 310 | @import "px-widths-responsive-design/_trumps.widths-responsive.scss"; 311 | -------------------------------------------------------------------------------- /sass/px-data-table-cell.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, General Electric 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // Settings 18 | @import "px-defaults-design/_settings.defaults.scss"; 19 | @import "px-mixins-design/_tools.mixins.scss"; 20 | // Generic 21 | @import "px-normalize-design/_generic.normalize.scss"; 22 | @import "px-box-sizing-design/_generic.box-sizing.scss"; 23 | @import "px-helpers-design/_generic.helpers.scss"; 24 | // Base 25 | @import "px-flexbox-design/_base.flexbox.scss"; 26 | @import "px-viewport-design/_base.viewport.scss"; 27 | 28 | $inuit-enable-input--tiny: true; 29 | 30 | @import "px-forms-design/_base.forms.scss"; 31 | 32 | $inuit-enable-table--fixed: true; 33 | $inuit-enable-table--small: true; 34 | $inuit-enable-table--large: true; 35 | $inuit-enable-table--rows: true; 36 | $inuit-enable-table--columns: true; 37 | $inuit-table-border-color: var(--px-data-table-border-color, gray); 38 | $inuit-table-separator-color: var(--px-data-table-separator-color, gray); 39 | 40 | @import "px-tables-design/_base.tables.scss"; 41 | 42 | @import "px-layout-design/_objects.layout.scss"; 43 | 44 | 45 | :host { 46 | @extend td; 47 | display: table-cell; 48 | vertical-align: middle; 49 | ::-ms-clear { 50 | display: none; 51 | } 52 | max-height: calculateRem(40px); 53 | height: calculateRem(40px); 54 | } 55 | 56 | :host(.td__dropdown) { 57 | padding-top: 0!important; 58 | padding-bottom: 0!important; 59 | } 60 | 61 | :host(.cell__edit) { 62 | background-color: var(--px-data-table-cell-background-color--edit,$inuit-forms-background); 63 | border: $inuit-table-border-width double var(--px-data-table-cell-border-color--edit,blue) !important; 64 | & input, textarea { 65 | &:focus { 66 | color: var(--px-data-table-cell-text-color--editing, black); 67 | } 68 | outline: none; 69 | background-color: transparent; 70 | box-shadow: none; 71 | } 72 | } 73 | 74 | :host(.cell--value__highlight--selected.cell--value__highlight--selected.cell--value__highlight--selected.cell--value__highlight--selected.cell--value__highlight--selected){ 75 | border-top: $inuit-table-border-width double var(--px-data-table-cell-border-color--selected, blue); 76 | border-bottom: $inuit-table-border-width double var(--px-data-table-cell-border-color--selected, blue); 77 | } 78 | 79 | :host(.cell--value__highlight--selected__row.cell--value__highlight--selected__row.cell--value__highlight--selected__row.cell--value__highlight--selected__row.cell--value__highlight--selected__row){ 80 | border-top: $inuit-table-border-width double var(--px-data-table-cell-border-color--selected, blue); 81 | border-bottom: $inuit-table-border-width double var(--px-data-table-cell-border-color--selected, blue); 82 | } 83 | 84 | :host(.px-data-table-highlight--high){ 85 | background-color: var(--px-data-table-highlight--high, rgba(red, 0.4)); 86 | } 87 | 88 | :host(.px-data-table-highlight--medium){ 89 | background-color: var(--px-data-table-highlight--medium, rgba(yellow, 0.4)); 90 | } 91 | 92 | :host(.px-data-table-highlight--low){ 93 | background-color: var(--px-data-table-highlight--low, rgba(blue, 0.4)); 94 | } 95 | 96 | :host(.selected) { 97 | background-color: var(--px-data-table-cell-background-color--selected, blue); 98 | color: var(--px-data-table-cell-text-color--selected, white); 99 | border-top: $inuit-table-border-width double var(--px-data-table-cell-border-color--selected, blue) !important; 100 | border-bottom: $inuit-table-border-width double var(--px-data-table-cell-border-color--selected, blue) !important; 101 | 102 | } 103 | 104 | .cell--value--icon__validation-failed { 105 | color: var(--px-data-table-cell-text-color-validation--failed, red); 106 | } 107 | 108 | .viewing, .ddviewing { 109 | white-space: nowrap; 110 | } 111 | 112 | px-dropdown { 113 | width: 100%; 114 | } 115 | 116 | $px-data-table-cell-inner-height : calculateRem(18px); 117 | 118 | .cell--edit { 119 | width: 100%; 120 | & input { 121 | max-height: $px-data-table-cell-inner-height; 122 | } 123 | & input { 124 | border: none; 125 | outline: none; 126 | background-color: transparent; 127 | box-shadow: 0 0 0 0; 128 | } 129 | & input[type=text]:focus { 130 | box-shadow: 0 0 0 0; 131 | } 132 | } 133 | 134 | .cell--value { 135 | @extend .flex; 136 | } 137 | 138 | .cell--value__empty { 139 | height: $px-data-table-cell-inner-height; 140 | width: calculateRem(1px); 141 | } 142 | 143 | .cell-status--container { 144 | margin-left: auto; 145 | width: calculateRem(14px); 146 | } 147 | 148 | .cell--status--container--icon { 149 | width: calculateRem(14px); 150 | height: calculateRem(14px); 151 | } 152 | 153 | // Trumps 154 | $inuit-enable-margins--none: true; 155 | $inuit-enable-margins--small: true; 156 | $inuit-enable-margins--tiny: true; 157 | $inuit-enable-margins--large: true; 158 | $inuit-enable-paddings--none: true; 159 | $inuit-enable-paddings--small: true; 160 | $inuit-enable-paddings--large: true; 161 | @import "px-spacing-responsive-design/_trumps.spacing-responsive.scss"; 162 | @import "px-widths-responsive-design/_trumps.widths-responsive.scss"; 163 | -------------------------------------------------------------------------------- /sass/px-data-table-highlight.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, General Electric 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | :host{ 18 | --cell--value__highlight--high--color: red; 19 | --cell--value__highlight--medium--color: yellow; 20 | --cell--value__highlight--low--color: blue; 21 | } 22 | -------------------------------------------------------------------------------- /sass/px-data-table.scss: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, General Electric 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // Settings 18 | 19 | // Generic 20 | @import "px-normalize-design/_generic.normalize.scss"; 21 | @import "px-box-sizing-design/_generic.box-sizing.scss"; 22 | @import "px-helpers-design/_generic.helpers.scss"; 23 | 24 | // Base 25 | @import "px-flexbox-design/_base.flexbox.scss"; 26 | @import "px-viewport-design/_base.viewport.scss"; 27 | @import "px-forms-design/_base.forms.scss"; 28 | 29 | @import "px-layout-design/_objects.layout.scss"; 30 | 31 | $fa-font-path : "../../font-awesome/fonts"; 32 | $inuit-enable-btn--bare : true; 33 | @import "px-button-group-design/_objects.button-group.scss"; 34 | @import "px-button-group-design/_objects.button-group.scss"; 35 | 36 | // Trumps 37 | $inuit-enable-paddings--small : true; 38 | @import "px-spacing-responsive-design/_trumps.spacing-responsive.scss"; 39 | @import "px-widths-responsive-design/_trumps.widths-responsive.scss"; 40 | 41 | -------------------------------------------------------------------------------- /test/px-data-table-cell-fixture.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | px-data-table PX-Data-Table Cell Tests 24 | 25 | 26 | 27 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | Hello 39 |
40 | 46 | 47 |
48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /test/px-data-table-cell-test.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright (c) 2018, General Electric 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | document.addEventListener("WebComponentsReady", function() { 19 | 20 | runTests(); 21 | }); 22 | 23 | function runTests() { 24 | suite('Data Table Cell', function() { 25 | 26 | var cell = null; 27 | 28 | setup(function(done) { 29 | cell = Polymer.dom(document).querySelector('px-data-table-cell'); 30 | this.timeout(10*1000); // adding table data may take a while 31 | flush(function () { done(); }); 32 | }); 33 | 34 | teardown(function (done) { 35 | flush(function () { done(); }); 36 | }); 37 | 38 | test('Check cell element exists', function() { 39 | assert.isTrue(cell !== null); 40 | assert.isTrue(true); 41 | }); 42 | 43 | test('Check edit updates model data', function(done){ 44 | 45 | var editCell = Polymer.dom(cell.root).querySelector('px-edit-cell'); 46 | var inputEl = Polymer.dom(editCell).querySelector('input'); 47 | 48 | cell.addEventListener('save', assertFunction ); 49 | 50 | cell.click(); 51 | var e = {'target':{value:'xxxx'}}; 52 | inputEl.value = 'xxxx'; 53 | 54 | flush(function(){ 55 | cell.saveCell(e); 56 | }); 57 | 58 | // function hoisting means this is defined before the test is executed 59 | function assertFunction(evt){ 60 | 61 | assert.equal(evt.detail.newValue, 'xxxx'); 62 | 63 | // prevent multiple "done" calls 64 | cell.removeEventListener('save', assertFunction); 65 | done(); 66 | } 67 | }); 68 | }); 69 | } 70 | -------------------------------------------------------------------------------- /test/px-data-table-fixture.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | px-data-table Tests 25 | 26 | 27 | 28 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |

Data table demos

41 | 42 |

A very simple data table. Just displays data and has a sortable column.

43 | 44 | 45 | 46 | 47 |
48 | 49 |

Filterable column and selectable rows.

50 | 51 | 52 | 53 | 54 |
55 | 56 |

Display as columns instead of a grid.

57 | 58 | 59 |
60 | 61 |

Display as rows instead of a grid.

62 | 63 | 64 |

Very customized data table, with:

65 |
    66 |
  • Filter - only First and Color columns
  • 67 |
  • Custom filtering functions - on an entire word in the First column and on the button text in the Color column
  • 68 |
  • Sorting - on the first three columns
  • 69 |
  • Custom sorting functions - by the email domain in the Email column
  • 70 |
  • Html rendering - in the Color column
  • 71 |
  • Ellipsis - in Date column
  • 72 |
  • Interacting with the selected rows... there are {{mySelectedRows.length}} rows selected
  • 73 |
  • ... and you can
  • 74 |
  • ... and you can receive px-row-click events from the table, which can be used by taking action on the row
  • 75 |
76 | 77 | 78 | 79 | 80 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 97 | 98 | 99 | 100 | 101 | 105 | 106 | 109 | 110 | 111 | 112 | 113 |
114 | 115 |

Filterable row test table

116 | 117 | 118 | 119 |
120 | 121 |

Reset the table with another set of data

122 | 123 | 124 | 125 |
126 | 127 |

Update the table data with adddtional set of data

128 | 129 | 130 | 131 |
132 | 133 | 135 | 136 | 143 | 147 | 148 |

Selection after data update does not contain unreached data

149 | 150 | 151 |

Changing dropdown items works correctly

152 | 156 | 161 | 162 | 163 | 164 | 165 | 166 | -------------------------------------------------------------------------------- /test/px-data-table-remote-paradigm-fixture.html: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | px-data-table Remote Data Paradigm Tests 24 | 25 | 26 | 27 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |

Data table demos

40 | 41 |

Remote Data, Page 1 of 10

42 | 47 | 48 | 49 |

Remote Data, Page 2 of 10

50 | 57 | 58 | 59 |
60 | 61 |

Remote Data, Page Size Dopdown

62 | 69 | 70 | 71 |

Remote Data, Filtering

72 | 78 | 79 | 80 |

Remote Data, Filtering

81 | 87 | 88 | 89 |
90 | 91 |

Remote Data, Sorting

92 | 98 | 99 | 100 |

Remote Data, Sorting

101 | 107 | 108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /wct.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "verbose": false, 3 | "plugins": { 4 | "local": { 5 | "browsers": ["chrome", "firefox"] 6 | }, 7 | "sauce": { 8 | "disabled": true, 9 | "browsers": [ 10 | { 11 | "browserName": "microsoftedge", 12 | "platform": "Windows 10", 13 | "version": "" 14 | }, 15 | { 16 | "browserName": "internet explorer", 17 | "platform": "Windows 8.1", 18 | "version": "11" 19 | }, 20 | { 21 | "browserName": "safari", 22 | "platform": "OS X 10.12", 23 | "version": "10" 24 | } 25 | ] 26 | } 27 | }, 28 | "suites": [ 29 | "test/px-data-table-fixture.html", 30 | "test/px-data-table-cell-fixture.html", 31 | "test/px-data-table-remote-paradigm-fixture.html" 32 | ] 33 | } 34 | --------------------------------------------------------------------------------