@bennerinformatics/ember-fw-table 2.1.3 → 2.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/addon/components/fw-pagination-wrapper.js +2 -2
  2. package/addon/components/fw-table-resort.js +16 -2
  3. package/addon/components/fw-table-sortable.js +14 -3
  4. package/addon/templates/components/fw-table-resort.hbs +7 -4
  5. package/docs/api.js +61 -0
  6. package/docs/assets/css/custom.css +82 -0
  7. package/docs/assets/css/external-small.png +0 -0
  8. package/docs/assets/css/logo.png +0 -0
  9. package/docs/assets/css/main.css +793 -0
  10. package/docs/assets/css/theme.css +547 -0
  11. package/docs/assets/favicon.ico +0 -0
  12. package/docs/assets/icons/android-icon-144x144.png +0 -0
  13. package/docs/assets/icons/android-icon-192x192.png +0 -0
  14. package/docs/assets/icons/android-icon-36x36.png +0 -0
  15. package/docs/assets/icons/android-icon-48x48.png +0 -0
  16. package/docs/assets/icons/android-icon-72x72.png +0 -0
  17. package/docs/assets/icons/android-icon-96x96.png +0 -0
  18. package/docs/assets/icons/apple-icon-114x114.png +0 -0
  19. package/docs/assets/icons/apple-icon-120x120.png +0 -0
  20. package/docs/assets/icons/apple-icon-144x144.png +0 -0
  21. package/docs/assets/icons/apple-icon-152x152.png +0 -0
  22. package/docs/assets/icons/apple-icon-180x180.png +0 -0
  23. package/docs/assets/icons/apple-icon-57x57.png +0 -0
  24. package/docs/assets/icons/apple-icon-60x60.png +0 -0
  25. package/docs/assets/icons/apple-icon-72x72.png +0 -0
  26. package/docs/assets/icons/apple-icon-76x76.png +0 -0
  27. package/docs/assets/icons/apple-icon-precomposed.png +0 -0
  28. package/docs/assets/icons/apple-icon.png +0 -0
  29. package/docs/assets/icons/browserconfig.xml +2 -0
  30. package/docs/assets/icons/favicon-16x16.png +0 -0
  31. package/docs/assets/icons/favicon-32x32.png +0 -0
  32. package/docs/assets/icons/favicon-96x96.png +0 -0
  33. package/docs/assets/icons/favicon.ico +0 -0
  34. package/docs/assets/icons/manifest.json +41 -0
  35. package/docs/assets/icons/ms-icon-144x144.png +0 -0
  36. package/docs/assets/icons/ms-icon-150x150.png +0 -0
  37. package/docs/assets/icons/ms-icon-310x310.png +0 -0
  38. package/docs/assets/icons/ms-icon-70x70.png +0 -0
  39. package/docs/assets/img/ember-logo.png +0 -0
  40. package/docs/assets/img/fw-logo.png +0 -0
  41. package/docs/assets/img/spinner.gif +0 -0
  42. package/docs/assets/index.html +10 -0
  43. package/docs/assets/js/api-filter.js +56 -0
  44. package/docs/assets/js/api-list.js +255 -0
  45. package/docs/assets/js/api-search.js +98 -0
  46. package/docs/assets/js/apidocs.js +376 -0
  47. package/docs/assets/js/yui-prettify.js +17 -0
  48. package/docs/assets/js/yuidoc-bootstrap.js +274 -0
  49. package/docs/assets/vendor/bootstrap/css/bootstrap.css +6760 -0
  50. package/docs/assets/vendor/bootstrap/css/bootstrap.min.css +6 -0
  51. package/docs/assets/vendor/bootstrap/fonts/glyphicons-halflings-regular.eot +0 -0
  52. package/docs/assets/vendor/bootstrap/fonts/glyphicons-halflings-regular.svg +288 -0
  53. package/docs/assets/vendor/bootstrap/fonts/glyphicons-halflings-regular.ttf +0 -0
  54. package/docs/assets/vendor/bootstrap/fonts/glyphicons-halflings-regular.woff +0 -0
  55. package/docs/assets/vendor/bootstrap/fonts/glyphicons-halflings-regular.woff2 +0 -0
  56. package/docs/assets/vendor/bootstrap/img/glyphicons-halflings-white.png +0 -0
  57. package/docs/assets/vendor/bootstrap/img/glyphicons-halflings.png +0 -0
  58. package/docs/assets/vendor/bootstrap/js/bootstrap.js +2363 -0
  59. package/docs/assets/vendor/bootstrap/js/bootstrap.min.js +7 -0
  60. package/docs/assets/vendor/font-awesome/css/font-awesome.css +2199 -0
  61. package/docs/assets/vendor/font-awesome/css/font-awesome.min.css +4 -0
  62. package/docs/assets/vendor/font-awesome/fonts/FontAwesome.otf +0 -0
  63. package/docs/assets/vendor/font-awesome/fonts/fontawesome-webfont.eot +0 -0
  64. package/docs/assets/vendor/font-awesome/fonts/fontawesome-webfont.svg +685 -0
  65. package/docs/assets/vendor/font-awesome/fonts/fontawesome-webfont.ttf +0 -0
  66. package/docs/assets/vendor/font-awesome/fonts/fontawesome-webfont.woff +0 -0
  67. package/docs/assets/vendor/font-awesome/fonts/fontawesome-webfont.woff2 +0 -0
  68. package/docs/assets/vendor/github-slugger/slugger.js +59 -0
  69. package/docs/assets/vendor/jquery/jquery.min.js +6 -0
  70. package/docs/assets/vendor/jquery-ui/jquery-ui.min.js +6 -0
  71. package/docs/assets/vendor/prettify/CHANGES.html +130 -0
  72. package/docs/assets/vendor/prettify/COPYING +202 -0
  73. package/docs/assets/vendor/prettify/README.html +203 -0
  74. package/docs/assets/vendor/prettify/prettify-min.css +1 -0
  75. package/docs/assets/vendor/prettify/prettify-min.js +1 -0
  76. package/docs/classes/BaseCells.html +484 -0
  77. package/docs/classes/Export.html +457 -0
  78. package/docs/classes/Format.html +577 -0
  79. package/docs/classes/FwCellAction.html +312 -0
  80. package/docs/classes/FwCellBoolean.html +311 -0
  81. package/docs/classes/FwCellNullable.html +312 -0
  82. package/docs/classes/FwCellPermissionIcon.html +321 -0
  83. package/docs/classes/FwColumnSortable.html +358 -0
  84. package/docs/classes/FwColumnTitle.html +314 -0
  85. package/docs/classes/FwDeleteModal.html +485 -0
  86. package/docs/classes/FwExpandableRow.html +307 -0
  87. package/docs/classes/FwPaginationWrapper.html +2129 -0
  88. package/docs/classes/FwRowToggle.html +355 -0
  89. package/docs/classes/FwRowToggleIndex.html +312 -0
  90. package/docs/classes/FwTableExpandedRow.html +307 -0
  91. package/docs/classes/FwTableResort.html +827 -0
  92. package/docs/classes/FwTableSortable.html +1293 -0
  93. package/docs/classes/Row.html +352 -0
  94. package/docs/classes/Table.html +672 -0
  95. package/docs/classes/TableUtil.html +410 -0
  96. package/docs/classes/index.html +10 -0
  97. package/docs/data.json +2324 -0
  98. package/docs/elements/index.html +10 -0
  99. package/docs/files/addon_classes_Row.js.html +318 -0
  100. package/docs/files/addon_classes_Table.js.html +390 -0
  101. package/docs/files/addon_components_fw-cell-action.js.html +257 -0
  102. package/docs/files/addon_components_fw-cell-boolean.js.html +251 -0
  103. package/docs/files/addon_components_fw-cell-nullable.js.html +253 -0
  104. package/docs/files/addon_components_fw-cell-permission-icon.js.html +266 -0
  105. package/docs/files/addon_components_fw-column-sortable.js.html +281 -0
  106. package/docs/files/addon_components_fw-column-title.js.html +259 -0
  107. package/docs/files/addon_components_fw-delete-modal.js.html +318 -0
  108. package/docs/files/addon_components_fw-expandable-row.js.html +248 -0
  109. package/docs/files/addon_components_fw-pagination-wrapper.js.html +838 -0
  110. package/docs/files/addon_components_fw-row-toggle-index.js.html +252 -0
  111. package/docs/files/addon_components_fw-row-toggle.js.html +270 -0
  112. package/docs/files/addon_components_fw-table-expanded-row.js.html +261 -0
  113. package/docs/files/addon_components_fw-table-expanded-rows.js.html +263 -0
  114. package/docs/files/addon_components_fw-table-resort.js.html +457 -0
  115. package/docs/files/addon_components_fw-table-sortable.js.html +663 -0
  116. package/docs/files/addon_documentation.js.html +301 -0
  117. package/docs/files/addon_initializers_responsive.js.html +253 -0
  118. package/docs/files/addon_utils_base-cells.js.html +313 -0
  119. package/docs/files/addon_utils_export.js.html +316 -0
  120. package/docs/files/addon_utils_formats.js.html +335 -0
  121. package/docs/files/addon_utils_table.js.html +274 -0
  122. package/docs/files/index.html +10 -0
  123. package/docs/index.html +252 -0
  124. package/docs/modules/CellComponents.html +313 -0
  125. package/docs/modules/ColumnComponents.html +284 -0
  126. package/docs/modules/Components.html +285 -0
  127. package/docs/modules/Introduction.html +261 -0
  128. package/docs/modules/Utils.html +285 -0
  129. package/docs/modules/index.html +10 -0
  130. package/package.json +65 -65
@@ -414,7 +414,7 @@ export default Component.extend({
414
414
  },
415
415
 
416
416
  /**
417
- * Query for settign a new sort order. Internal method.
417
+ * Query for setting a new sort order. Internal method.
418
418
  * @method querySort
419
419
  * @private
420
420
  * @param {Number} page Page number to start
@@ -551,7 +551,7 @@ export default Component.extend({
551
551
  page = max;
552
552
  }
553
553
 
554
- // if we havve entries at the page number, use those
554
+ // if we have entries at the page number, use those
555
555
  // if missing, query them
556
556
  if (isNone(this.pageEntries.objectAt(page - 1))) {
557
557
  this.incrementProperty('pagesSearching');
@@ -80,6 +80,16 @@ const TableResort = Component.extend({
80
80
  */
81
81
  deleteIcon: 'fa-regular fa-trash-can',
82
82
 
83
+ /**
84
+ * If true, show the order (sortKey) in the table, to the right of the handle
85
+ *
86
+ * @public
87
+ * @default false
88
+ * @property showOrder
89
+ * @type {Boolean}
90
+ */
91
+ showOrder: false,
92
+
83
93
  /**
84
94
  * String pointer to the model's sort key, will be used to sort the items and modify the key later
85
95
  *
@@ -179,8 +189,12 @@ const TableResort = Component.extend({
179
189
  if (activeFilter) {
180
190
  items = items.filter(activeFilter);
181
191
  }
182
- items.forEach((item, index) => {
183
- item.set(this.sortKey, index + 1);
192
+ let index = 1;
193
+ items.forEach((item) => {
194
+ // If items are deleted, they will typically still be included in the array at this point, so we check isDeleted
195
+ if (!item.isDeleted) {
196
+ item.set(this.sortKey, index++);
197
+ }
184
198
  });
185
199
  },
186
200
 
@@ -224,7 +224,18 @@ const TableSortable = Component.extend({
224
224
  sortOrder: computed('_defaultSort.[]', 'sortColumn', function() {
225
225
  let sortColumn = this.sortColumn;
226
226
  if (sortColumn) {
227
- return [sortColumn].pushObjects(this._defaultSort);
227
+ // this addresses a bug where sorting by the default sort column would break
228
+ // in that case just sort by the selected column and ignore the default sort
229
+ if (this._defaultSort.any((sort) => {
230
+ return sort === sortColumn || sort === `${sortColumn}:desc` || `${sort}:desc` === sortColumn;
231
+ })) {
232
+ return [sortColumn];
233
+ }
234
+ // otherwise add the sort column to the front of the default sort array so the default sort is done after
235
+ let sortOrder = this._defaultSort.slice();
236
+ sortOrder.unshift(sortColumn);
237
+
238
+ return sortOrder;
228
239
  }
229
240
  return this._defaultSort;
230
241
  }),
@@ -239,7 +250,7 @@ const TableSortable = Component.extend({
239
250
  sortedData: sort('data', 'sortOrder'),
240
251
 
241
252
  /**
242
- * Internal table instance, in general changes to the table should be done to columns or data so they update propery
253
+ * Internal table instance, in general changes to the table should be done to columns or data so they update properly
243
254
  *
244
255
  * @protected
245
256
  * @property table
@@ -375,7 +386,7 @@ const TableSortable = Component.extend({
375
386
  // determine how we are sorting
376
387
  let sortKey = column.sortKey || column.valuePath;
377
388
 
378
- // if the column is now decending, sort decending
389
+ // if the column is now descending, sort descending
379
390
  if (!column.ascending) {
380
391
  sortKey = `${sortKey}:desc`;
381
392
  }
@@ -1,10 +1,13 @@
1
- <SortableGroup @tagName="ul" @class="js-list-sort resort-list" @onChange={{action "reorderItems"}} as |group|>
1
+ <ul {{sortable-group onChange=(action "reorderItems")}} class="js-list-sort resort-list">
2
2
  {{#each sortedItems as |item|}}
3
- <SortableItem @tagName="li" @model={{item}} @group={{group}} @handle=".handle" @spacing={{spacing}}>
3
+ <li {{sortable-item model=item handle=".handle" spacing=spacing}}>
4
4
  <div class="input-group">
5
5
  <span class="input-group-addon handle draggable">
6
6
  <i class="fa-solid fa-ellipsis-vertical fa-2"></i>
7
7
  </span>
8
+ {{#if showOrder}}
9
+ <span class="input-group-addon">{{get item sortKey}}</span>
10
+ {{/if}}
8
11
  {{#if hasBlock}}
9
12
  {{#if allowExpand}}
10
13
  {{#if item.unexpandable}}
@@ -35,8 +38,8 @@
35
38
  <span class="input-group-addon"/>
36
39
  {{/if}}
37
40
  </div>
38
- </SortableItem>
41
+ </li>
39
42
  {{else}}
40
43
  {{empty}}
41
44
  {{/each}}
42
- </SortableGroup>
45
+ </ul>
package/docs/api.js ADDED
@@ -0,0 +1,61 @@
1
+ YUI.add("yuidoc-meta", function(Y) {
2
+ Y.YUIDoc = { meta: {
3
+ "classes": [
4
+ "BaseCells",
5
+ "Export",
6
+ "Format",
7
+ "FwCellAction",
8
+ "FwCellBoolean",
9
+ "FwCellNullable",
10
+ "FwCellPermissionIcon",
11
+ "FwColumnSortable",
12
+ "FwColumnTitle",
13
+ "FwDeleteModal",
14
+ "FwExpandableRow",
15
+ "FwPaginationWrapper",
16
+ "FwRowToggle",
17
+ "FwRowToggleIndex",
18
+ "FwTableExpandedRow",
19
+ "FwTableResort",
20
+ "FwTableSortable",
21
+ "Row",
22
+ "Table",
23
+ "TableUtil"
24
+ ],
25
+ "modules": [
26
+ "CellComponents",
27
+ "ColumnComponents",
28
+ "Components",
29
+ "Introduction",
30
+ "Utils"
31
+ ],
32
+ "allModules": [
33
+ {
34
+ "displayName": "CellComponents",
35
+ "name": "CellComponents",
36
+ "description": "Cell Components in Ember FW Table.\n\nFor each of these cell components, you call them in the following way:\n```js\ncolumn: [\n {\n label: 'Actions',\n cellComponent: 'fw-cell-action'\n }\n]\n```"
37
+ },
38
+ {
39
+ "displayName": "ColumnComponents",
40
+ "name": "ColumnComponents",
41
+ "description": "Column Components in Ember FW Table.\n\nFor each of these column components, call them in the following way:\n\n```js\ncolumns: [\n {\n label: 'Column',\n component: 'fw-column-title'\n }\n]\n\n```"
42
+ },
43
+ {
44
+ "displayName": "Components",
45
+ "name": "Components",
46
+ "description": "Components defined by Ember FW Table."
47
+ },
48
+ {
49
+ "displayName": "Introduction",
50
+ "name": "Introduction",
51
+ "description": "The primary purpose of ember-fw-table is to make a simplified form of ember-light-table,\n and which is easier to use than its parent. Within it as well, we have added a few extra\n things that make more complicated aspects of tables also easier to incorporate (such as\n paginated tables). For more information on ember-light-table,\n [see their documentation](https://adopted-ember-addons.github.io/ember-light-table/docs). For a more\n comprehensive guide to Ember FW Table, see our [Ember FW Table](https://linformatics.bitbucket.io/docs/addons/client/ember-fw-table).\n This is just designed to be API docs to briefly describe various elements and how to use them."
52
+ },
53
+ {
54
+ "displayName": "Utils",
55
+ "name": "Utils",
56
+ "description": "Utils defined in Ember FW Table."
57
+ }
58
+ ],
59
+ "elements": []
60
+ } };
61
+ });
@@ -0,0 +1,82 @@
1
+ /*
2
+ * Custom styles for the YUIDoc Bootstrap Theme
3
+ * Authors: kevinlacotaco
4
+ * tonybaroneee
5
+ */
6
+
7
+ /* -- Navigation Bar -------------------------------------------------------- */
8
+
9
+ .navbar .navbar-inner .brand {
10
+ height: 40px;
11
+ margin: 0;
12
+ padding: 0 5px 0 10px;
13
+ cursor: default;
14
+ }
15
+
16
+ .navbar-text {
17
+ font-size: 12px;
18
+ padding-left: 5px;
19
+ cursor: default;
20
+ }
21
+ .navbar-default {
22
+ background-color: #7E3DB7 !important;
23
+ }
24
+ .navbar-brand span {
25
+ color: white !important;
26
+ font-weight: 700 !important;
27
+ font-size: 16px !important;
28
+ }
29
+ .navbar-form {
30
+ margin-right: 3px;
31
+ }
32
+ .navbar-right li a {
33
+ color: white !important;
34
+ }
35
+ #options-form {
36
+ margin-top: 20px;
37
+ }
38
+
39
+ /* -- Sidebar --------------------------------------------------------------- */
40
+
41
+ #sidebar .tab-content {
42
+ border: 1px solid #DFDFDF;
43
+ border-top: 0px;
44
+ padding-bottom: 5px;
45
+ -webkit-border-radius: 0 0 4px 4px;
46
+ -moz-border-radius: 0 0 4px 4px;
47
+ border-radius: 0 0 4px 4px;
48
+ }
49
+
50
+ #api-tabview-filter input {
51
+ width: 94.5%;
52
+ }
53
+
54
+ #sidebar .tab-pane li a {
55
+ overflow: hidden;
56
+ white-space: nowrap;
57
+ text-overflow: ellipsis;
58
+ }
59
+
60
+ #sidebar .tab-pane li a:hover,
61
+ #sidebar .tab-pane li a:focus {
62
+ outline: 0;
63
+ border: 0;
64
+ text-decoration: none;
65
+ color: #ffffff;
66
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
67
+ background-color: #0088cc;
68
+ }
69
+
70
+ /* -- Content --------------------------------------------------------------- */
71
+
72
+ .content {
73
+ padding-bottom: 50px;
74
+ }
75
+
76
+ .content .page-header h1 small {
77
+ padding-left: 5px;
78
+ }
79
+
80
+ .content .well:not(.moduledesc) p {
81
+ margin: 9px 0;
82
+ }
Binary file