@bennerinformatics/ember-fw-table 2.0.20 → 2.1.0
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.
- package/README.md +6 -0
- package/addon/classes/Row.js +80 -74
- package/addon/classes/Table.js +152 -147
- package/addon/components/fw-cell-action.js +19 -15
- package/addon/components/fw-cell-boolean.js +13 -12
- package/addon/components/fw-cell-nullable.js +15 -12
- package/addon/components/fw-cell-permission-icon.js +28 -12
- package/addon/components/fw-column-sortable.js +12 -4
- package/addon/components/fw-column-title.js +21 -13
- package/addon/components/fw-delete-modal.js +80 -61
- package/addon/components/fw-expandable-row.js +5 -0
- package/addon/components/fw-pagination-wrapper.js +600 -681
- package/addon/components/fw-row-toggle-index.js +14 -14
- package/addon/components/fw-row-toggle.js +12 -5
- package/addon/components/fw-table-expanded-row.js +23 -24
- package/addon/components/fw-table-expanded-rows.js +8 -4
- package/addon/components/fw-table-resort.js +31 -18
- package/addon/components/fw-table-sortable.js +414 -398
- package/addon/documentation.js +63 -98
- package/addon/templates/components/fw-delete-modal.hbs +2 -7
- package/addon/templates/components/fw-pagination-wrapper.hbs +45 -74
- package/addon/templates/components/fw-table-expanded-row.hbs +23 -23
- package/addon/templates/components/fw-table-expanded-rows.hbs +1 -1
- package/addon/templates/components/fw-table-resort.hbs +4 -4
- package/addon/templates/components/fw-table-sortable.hbs +54 -77
- package/addon/utils/base-cells.js +75 -40
- package/addon/utils/export.js +78 -76
- package/addon/utils/formats.js +93 -46
- package/addon/utils/table.js +36 -35
- package/app/breakpoints.js +1 -1
- package/app/components/fw-cell-permission-icon.js +1 -1
- package/app/initializers/responsive.js +1 -1
- package/codemods.log +16 -0
- package/index.js +10 -9
- package/package.json +65 -67
- package/yuidoc-ember-theme/LICENSE +21 -0
- package/yuidoc-ember-theme/README.md +88 -0
- package/yuidoc-ember-theme/assets/css/custom.css +82 -0
- package/yuidoc-ember-theme/assets/css/external-small.png +0 -0
- package/yuidoc-ember-theme/assets/css/main.css +793 -0
- package/yuidoc-ember-theme/assets/css/theme.css +547 -0
- package/yuidoc-ember-theme/assets/icons/android-icon-144x144.png +0 -0
- package/yuidoc-ember-theme/assets/icons/android-icon-192x192.png +0 -0
- package/yuidoc-ember-theme/assets/icons/android-icon-36x36.png +0 -0
- package/yuidoc-ember-theme/assets/icons/android-icon-48x48.png +0 -0
- package/yuidoc-ember-theme/assets/icons/android-icon-72x72.png +0 -0
- package/yuidoc-ember-theme/assets/icons/android-icon-96x96.png +0 -0
- package/yuidoc-ember-theme/assets/icons/apple-icon-114x114.png +0 -0
- package/yuidoc-ember-theme/assets/icons/apple-icon-120x120.png +0 -0
- package/yuidoc-ember-theme/assets/icons/apple-icon-144x144.png +0 -0
- package/yuidoc-ember-theme/assets/icons/apple-icon-152x152.png +0 -0
- package/yuidoc-ember-theme/assets/icons/apple-icon-180x180.png +0 -0
- package/yuidoc-ember-theme/assets/icons/apple-icon-57x57.png +0 -0
- package/yuidoc-ember-theme/assets/icons/apple-icon-60x60.png +0 -0
- package/yuidoc-ember-theme/assets/icons/apple-icon-72x72.png +0 -0
- package/yuidoc-ember-theme/assets/icons/apple-icon-76x76.png +0 -0
- package/yuidoc-ember-theme/assets/icons/apple-icon-precomposed.png +0 -0
- package/yuidoc-ember-theme/assets/icons/apple-icon.png +0 -0
- package/yuidoc-ember-theme/assets/icons/browserconfig.xml +2 -0
- package/yuidoc-ember-theme/assets/icons/favicon-16x16.png +0 -0
- package/yuidoc-ember-theme/assets/icons/favicon-32x32.png +0 -0
- package/yuidoc-ember-theme/assets/icons/favicon-96x96.png +0 -0
- package/yuidoc-ember-theme/assets/icons/favicon.ico +0 -0
- package/yuidoc-ember-theme/assets/icons/manifest.json +41 -0
- package/yuidoc-ember-theme/assets/icons/ms-icon-144x144.png +0 -0
- package/yuidoc-ember-theme/assets/icons/ms-icon-150x150.png +0 -0
- package/yuidoc-ember-theme/assets/icons/ms-icon-310x310.png +0 -0
- package/yuidoc-ember-theme/assets/icons/ms-icon-70x70.png +0 -0
- package/yuidoc-ember-theme/assets/img/ember-logo.png +0 -0
- package/yuidoc-ember-theme/assets/img/fw-logo.png +0 -0
- package/yuidoc-ember-theme/assets/img/spinner.gif +0 -0
- package/yuidoc-ember-theme/assets/index.html +10 -0
- package/yuidoc-ember-theme/assets/js/yuidoc-bootstrap.js +274 -0
- package/yuidoc-ember-theme/assets/vendor/bootstrap/css/bootstrap.css +6760 -0
- package/yuidoc-ember-theme/assets/vendor/bootstrap/css/bootstrap.min.css +6 -0
- package/yuidoc-ember-theme/assets/vendor/bootstrap/fonts/glyphicons-halflings-regular.eot +0 -0
- package/yuidoc-ember-theme/assets/vendor/bootstrap/fonts/glyphicons-halflings-regular.svg +288 -0
- package/yuidoc-ember-theme/assets/vendor/bootstrap/fonts/glyphicons-halflings-regular.ttf +0 -0
- package/yuidoc-ember-theme/assets/vendor/bootstrap/fonts/glyphicons-halflings-regular.woff +0 -0
- package/yuidoc-ember-theme/assets/vendor/bootstrap/fonts/glyphicons-halflings-regular.woff2 +0 -0
- package/yuidoc-ember-theme/assets/vendor/bootstrap/img/glyphicons-halflings-white.png +0 -0
- package/yuidoc-ember-theme/assets/vendor/bootstrap/img/glyphicons-halflings.png +0 -0
- package/yuidoc-ember-theme/assets/vendor/bootstrap/js/bootstrap.js +2363 -0
- package/yuidoc-ember-theme/assets/vendor/bootstrap/js/bootstrap.min.js +7 -0
- package/yuidoc-ember-theme/assets/vendor/font-awesome/css/font-awesome.css +2199 -0
- package/yuidoc-ember-theme/assets/vendor/font-awesome/css/font-awesome.min.css +4 -0
- package/yuidoc-ember-theme/assets/vendor/font-awesome/fonts/FontAwesome.otf +0 -0
- package/yuidoc-ember-theme/assets/vendor/font-awesome/fonts/fontawesome-webfont.eot +0 -0
- package/yuidoc-ember-theme/assets/vendor/font-awesome/fonts/fontawesome-webfont.svg +685 -0
- package/yuidoc-ember-theme/assets/vendor/font-awesome/fonts/fontawesome-webfont.ttf +0 -0
- package/yuidoc-ember-theme/assets/vendor/font-awesome/fonts/fontawesome-webfont.woff +0 -0
- package/yuidoc-ember-theme/assets/vendor/font-awesome/fonts/fontawesome-webfont.woff2 +0 -0
- package/yuidoc-ember-theme/assets/vendor/github-slugger/slugger.js +59 -0
- package/yuidoc-ember-theme/assets/vendor/jquery/jquery.min.js +6 -0
- package/yuidoc-ember-theme/assets/vendor/jquery-ui/jquery-ui.min.js +6 -0
- package/yuidoc-ember-theme/assets/vendor/prettify/prettify-min.css +1 -0
- package/yuidoc-ember-theme/assets/vendor/prettify/prettify-min.js +1 -0
- package/{bitbucket-helpers-override.js → yuidoc-ember-theme/helpers/bitbucket-helpers-override.js} +240 -240
- package/yuidoc-ember-theme/helpers/helpers.js +236 -0
- package/yuidoc-ember-theme/layouts/main.handlebars +111 -0
- package/yuidoc-ember-theme/layouts/xhr.handlebars +7 -0
- package/yuidoc-ember-theme/package.json +15 -0
- package/yuidoc-ember-theme/partials/attrs.handlebars +144 -0
- package/yuidoc-ember-theme/partials/classes.handlebars +229 -0
- package/yuidoc-ember-theme/partials/events.handlebars +140 -0
- package/yuidoc-ember-theme/partials/files.handlebars +9 -0
- package/yuidoc-ember-theme/partials/index.handlebars +25 -0
- package/yuidoc-ember-theme/partials/method.handlebars +193 -0
- package/yuidoc-ember-theme/partials/module.handlebars +108 -0
- package/yuidoc-ember-theme/partials/options.handlebars +22 -0
- package/yuidoc-ember-theme/partials/props.handlebars +122 -0
- package/yuidoc-ember-theme/partials/sidebar.handlebars +77 -0
- package/yuidoc-ember-theme/theme.json +4 -0
- package/yuidoc-ember-theme/yarn.lock +4 -0
- package/yuidoc.json +23 -21
package/addon/utils/export.js
CHANGED
|
@@ -1,76 +1,78 @@
|
|
|
1
|
-
import EmberObject from '@ember/object';
|
|
2
|
-
import {isEmpty, isNone} from '@ember/utils';
|
|
3
|
-
import Papa from 'papaparse';
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
* @class Export
|
|
7
|
-
* @module Utils
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* Creates a CSV file from a data array and a title
|
|
11
|
-
* @
|
|
12
|
-
* @param {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
//
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
link.
|
|
25
|
-
link.setAttribute('
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
*
|
|
33
|
-
* @
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
let
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
//
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
1
|
+
import EmberObject from '@ember/object';
|
|
2
|
+
import {isEmpty, isNone} from '@ember/utils';
|
|
3
|
+
import Papa from 'papaparse';
|
|
4
|
+
/**
|
|
5
|
+
* An internal util that is used in ember-fw-table for the export functionality, both in the `FwTableSortable` and `FwPaginationWrapper`.
|
|
6
|
+
* @class Export
|
|
7
|
+
* @module Utils
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Creates a CSV file from a data array and a title
|
|
11
|
+
* @method createCSV
|
|
12
|
+
* @param {Array} data Array of table cells
|
|
13
|
+
* @param {Title} [name=null] Name to export
|
|
14
|
+
*/
|
|
15
|
+
export function createCSV(data, name = null) {
|
|
16
|
+
// first step, we need to extra the cells into "Cell","Cell 2" format, use JSON.stringify as it makes most escapes
|
|
17
|
+
// regex removes the brackets, as its an array we are calling stringify on
|
|
18
|
+
let rows = Papa.unparse(data);
|
|
19
|
+
|
|
20
|
+
// next, join that using newlines and export as data CSV
|
|
21
|
+
let encodedUri = `data:text/csv;charset=utf-8,${encodeURIComponent(rows)}`;
|
|
22
|
+
|
|
23
|
+
// downloading is a bit weird. We create a link element with the name and URL then click the element
|
|
24
|
+
let link = document.createElement('a');
|
|
25
|
+
link.setAttribute('href', encodedUri);
|
|
26
|
+
link.setAttribute('download', `${name || 'Export'}.csv`);
|
|
27
|
+
document.body.appendChild(link); // Required for FF
|
|
28
|
+
link.click(); // This will download the data file
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Exports an Ember Light Table to CSV
|
|
33
|
+
* @method exportTable
|
|
34
|
+
* @param {Table} table Table class, just needs to include rows and columns
|
|
35
|
+
* @param {String} [title='Export'] Title to use for exporting
|
|
36
|
+
*/
|
|
37
|
+
export default function exportTable(table, title = 'Export') {
|
|
38
|
+
// start by filtering out columns which opted out of exporting. Examples include action buttons and the row toggle
|
|
39
|
+
let columns = table.get('columns').filter(({canExport}) => {
|
|
40
|
+
// if canExport is defined, require it to be true
|
|
41
|
+
return isNone(canExport) || canExport;
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// ensure we have columns and data
|
|
45
|
+
if (isEmpty(columns)) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// start the data with just the labels from the columns
|
|
50
|
+
let data = [columns.map(({exportLabel, label}) => exportLabel || label)];
|
|
51
|
+
|
|
52
|
+
// next, populate data by iterating through the current rows
|
|
53
|
+
table.get('rows').forEach((row) => {
|
|
54
|
+
// in each row, iterate through the columns
|
|
55
|
+
let rowData = columns.map((column) => {
|
|
56
|
+
let {valuePath, format} = column;
|
|
57
|
+
// flat value pulled from the model
|
|
58
|
+
let rawValue = valuePath ? row.get(valuePath) : '';
|
|
59
|
+
let value = rawValue;
|
|
60
|
+
// if we have a format function and a value, run the function
|
|
61
|
+
if (format && typeof format === 'function') {
|
|
62
|
+
// so, typically there is a cell object which contains data as the functions "this"
|
|
63
|
+
// but we are in a action so simulate it by passing in the data we expect the function to have
|
|
64
|
+
// while we are here, might as well pass in an export parameter so they can modify behavior for export if desired
|
|
65
|
+
value = format.call(EmberObject.create({column, row, table, rawValue, export: true}), rawValue);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// return the value, though convert null/undefined into a string
|
|
69
|
+
return isNone(value) ? '' : value;
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
// add that data into the main array
|
|
73
|
+
data.pushObject(rowData);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// finally, pass our 2 dimensional array to the function to convert to a file download
|
|
77
|
+
createCSV(data, title);
|
|
78
|
+
}
|
package/addon/utils/formats.js
CHANGED
|
@@ -1,46 +1,93 @@
|
|
|
1
|
-
/* global moment */
|
|
2
|
-
import {htmlSafe} from '@ember/string';
|
|
3
|
-
import {isNone} from '@ember/utils';
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*
|
|
11
|
-
* @
|
|
12
|
-
* @
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
1
|
+
/* global moment */
|
|
2
|
+
import {htmlSafe} from '@ember/string';
|
|
3
|
+
import {isNone} from '@ember/utils';
|
|
4
|
+
/**
|
|
5
|
+
* These utils are designed for helping you be able to easily format a column by passing this function into the `format` attribute of the column. To use these functions, all you need to do
|
|
6
|
+
* is import them at the top of the Javascript file, with the following import:
|
|
7
|
+
* ```js
|
|
8
|
+
* import {functionName} from '@bennerinformatics/ember-fw-table/utils/formats';
|
|
9
|
+
* ```
|
|
10
|
+
* Then you use it in the column array to format it appropriately. Each function gives you an example of how to use it.
|
|
11
|
+
* @class Format
|
|
12
|
+
* @module Utils
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Format function which replaces the value with a basic Yes/No format for if its true or false. Designed to be used in the following way with a boolean column (after importing `formatBoolean` in the way described above):
|
|
16
|
+
* ```js
|
|
17
|
+
* column: [{
|
|
18
|
+
* label: 'My Boolean',
|
|
19
|
+
* valuePath: 'myBoolean',
|
|
20
|
+
* format: formatBoolean
|
|
21
|
+
* ...
|
|
22
|
+
* }...],
|
|
23
|
+
* @method formatBoolean
|
|
24
|
+
* @param {Any} value Value to test
|
|
25
|
+
* @return {String} "Yes" if the value is truthy, "No" otherwise
|
|
26
|
+
*/
|
|
27
|
+
export function formatBoolean(value) {
|
|
28
|
+
return value ? 'Yes' : 'No';
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Generates a format function which returns the value or an italic default text if the value is null. Designed to be used in the following way with a column that may have a null value (after importing `formatNullable` in the way described above):
|
|
33
|
+
* ```js
|
|
34
|
+
* column: [
|
|
35
|
+
* //if null, will display the default "None" in italics
|
|
36
|
+
* {
|
|
37
|
+
* label: 'Some Column',
|
|
38
|
+
* valuePath: 'someColumn',
|
|
39
|
+
* format: formatNullable
|
|
40
|
+
* ...
|
|
41
|
+
* },
|
|
42
|
+
* //if null, will display "No Value" instead of "None" in italics
|
|
43
|
+
* {
|
|
44
|
+
* label: 'Some Column',
|
|
45
|
+
* valueText: 'someColumn',
|
|
46
|
+
* format: formatNullable('No Value')
|
|
47
|
+
* }
|
|
48
|
+
* ...],
|
|
49
|
+
* @method formatNullable
|
|
50
|
+
* @param {String} [nullText='None'] Text if the value is null
|
|
51
|
+
* @return {Function} Function to pass into the column format
|
|
52
|
+
*/
|
|
53
|
+
export function formatNullable(nullText = 'None') {
|
|
54
|
+
return function(value) {
|
|
55
|
+
if (isNone(value)) {
|
|
56
|
+
return this['export'] ? '' : htmlSafe(`<i>${nullText}</i>`);
|
|
57
|
+
}
|
|
58
|
+
return value;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Generates a function which formats a moment based on the specified format. Designed to be used in the following way with a column displaying a date (after importing `formatMoment` in the way described above):
|
|
64
|
+
* ```js
|
|
65
|
+
* column: [
|
|
66
|
+
* //will display date as 1970-01-01
|
|
67
|
+
* {
|
|
68
|
+
* label: 'Some Column',
|
|
69
|
+
* valuePath: 'someColumn',
|
|
70
|
+
* format: formatMoment('YYYY-MM-DD')
|
|
71
|
+
* ...
|
|
72
|
+
* },
|
|
73
|
+
* //will display date in the table as 1970-01-01, but when exporting display 01-01-1970
|
|
74
|
+
* {
|
|
75
|
+
* label: 'Some Column',
|
|
76
|
+
* valueText: 'someColumn',
|
|
77
|
+
* format: formatMoment('YYYY-MM-DD', 'MM-DD-YYYY')
|
|
78
|
+
* }
|
|
79
|
+
* ...],
|
|
80
|
+
* @method formatMoment
|
|
81
|
+
* @param {String} format moment format. For a list of valid strings, see [Moment docs](https://momentjs.com/docs/#/displaying/format/)
|
|
82
|
+
* @param {String} exportFormat moment format used on exporting
|
|
83
|
+
* @return {Function} Function to pass into a column which formats by a moment
|
|
84
|
+
*/
|
|
85
|
+
export function formatMoment(format, exportFormat = null) {
|
|
86
|
+
return function(date) {
|
|
87
|
+
if (moment.isMoment(date)) {
|
|
88
|
+
// if we are exporting and have an export format, use that
|
|
89
|
+
let useFormat = exportFormat && this['export'] ? exportFormat : format;
|
|
90
|
+
return date.format(useFormat);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}
|
package/addon/utils/table.js
CHANGED
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
import {isEmpty} from '@ember/utils';
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* @class TableUtil
|
|
5
|
-
* @module Utils
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Checks if a row should be show in expanded view given the context
|
|
9
|
-
* @
|
|
10
|
-
* @param {
|
|
11
|
-
* @param {
|
|
12
|
-
* @
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
let
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
1
|
+
import {isEmpty} from '@ember/utils';
|
|
2
|
+
/**
|
|
3
|
+
* This is an internal util that is used to help with the logic for expanded rows.
|
|
4
|
+
* @class TableUtil
|
|
5
|
+
* @module Utils
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Checks if a row should be show in expanded view given the context
|
|
9
|
+
* @method showExpanded
|
|
10
|
+
* @param {Table} table Table class instance
|
|
11
|
+
* @param {Row} row Row class instance
|
|
12
|
+
* @param {Column} column Column class instance
|
|
13
|
+
* @return {boolean} True if it is shown in this context, false otherwise
|
|
14
|
+
*/
|
|
15
|
+
export function showExpanded(table, row, column) {
|
|
16
|
+
// if show expanded is defined, use that
|
|
17
|
+
let showExpanded = column.get('showExpanded');
|
|
18
|
+
let showExpandedType = typeof showExpanded;
|
|
19
|
+
// flat boolean? just return
|
|
20
|
+
if (showExpandedType === 'boolean') {
|
|
21
|
+
return showExpanded;
|
|
22
|
+
}
|
|
23
|
+
// key? fetch from the row
|
|
24
|
+
if (showExpandedType === 'string') {
|
|
25
|
+
return row.get(showExpanded);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// no value path? show it
|
|
29
|
+
let valuePath = column.get('valuePath');
|
|
30
|
+
if (isEmpty(valuePath)) {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// hides undefined, null, and empty arrays, but not false and 0
|
|
35
|
+
return !isEmpty(row.get(valuePath));
|
|
36
|
+
}
|
package/app/breakpoints.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {default} from '@bennerinformatics/ember-fw-table/breakpoints';
|
|
1
|
+
export {default} from '@bennerinformatics/ember-fw-table/breakpoints';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {default} from '@bennerinformatics/ember-fw-table/components/fw-cell-permission-icon';
|
|
1
|
+
export {default} from '@bennerinformatics/ember-fw-table/components/fw-cell-permission-icon';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {default} from '@bennerinformatics/ember-fw-table/initializers/responsive';
|
|
1
|
+
export {default} from '@bennerinformatics/ember-fw-table/initializers/responsive';
|
package/codemods.log
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
2024-07-08T21:10:22.429Z [warn] WARNING: {{fw-fullscreen-modal}} was not converted as it has positional parameters which can't be automatically converted. Source: addon/templates/components/fw-delete-modal.hbs
|
|
2
|
+
2024-07-08T21:10:22.475Z [warn] WARNING: {{yield}} was not converted as it has positional parameters which can't be automatically converted. Source: addon/templates/components/fw-pagination-wrapper.hbs
|
|
3
|
+
2024-07-08T21:10:22.478Z [warn] WARNING: {{fw-table-sortable}} was not converted as it has positional parameters which can't be automatically converted. Source: addon/templates/components/fw-pagination-wrapper.hbs
|
|
4
|
+
2024-07-08T21:10:22.478Z [warn] WARNING: {{yield}} was not converted as it has positional parameters which can't be automatically converted. Source: addon/templates/components/fw-pagination-wrapper.hbs
|
|
5
|
+
2024-07-08T21:10:22.600Z [warn] WARNING: {{yield}} was not converted as it has positional parameters which can't be automatically converted. Source: addon/templates/components/fw-table-resort.hbs
|
|
6
|
+
2024-07-08T21:10:22.633Z [warn] WARNING: {{yield}} was not converted as it has positional parameters which can't be automatically converted. Source: addon/templates/components/fw-table-sortable.hbs
|
|
7
|
+
2024-07-08T21:10:22.633Z [warn] WARNING: {{or}} was not converted as it has positional parameters which can't be automatically converted. Source: addon/templates/components/fw-table-sortable.hbs
|
|
8
|
+
2024-07-08T21:10:22.634Z [warn] WARNING: {{light-table}} was not converted as it has positional parameters which can't be automatically converted. Source: addon/templates/components/fw-table-sortable.hbs
|
|
9
|
+
2024-07-08T21:10:22.637Z [warn] WARNING: {{yield}} was not converted as it has positional parameters which can't be automatically converted. Source: addon/templates/components/fw-table-sortable.hbs
|
|
10
|
+
2024-07-09T14:00:38.763Z [warn] WARNING: {{yield}} was not converted as it has positional parameters which can't be automatically converted. Source: addon/templates/components/fw-pagination-wrapper.hbs
|
|
11
|
+
2024-07-09T14:00:38.767Z [warn] WARNING: {{yield}} was not converted as it has positional parameters which can't be automatically converted. Source: addon/templates/components/fw-pagination-wrapper.hbs
|
|
12
|
+
2024-07-09T14:00:38.954Z [warn] WARNING: {{yield}} was not converted as it has positional parameters which can't be automatically converted. Source: addon/templates/components/fw-table-resort.hbs
|
|
13
|
+
2024-07-09T14:00:38.988Z [warn] WARNING: {{yield}} was not converted as it has positional parameters which can't be automatically converted. Source: addon/templates/components/fw-table-sortable.hbs
|
|
14
|
+
2024-07-09T14:00:38.988Z [warn] WARNING: {{or}} was not converted as it has positional parameters which can't be automatically converted. Source: addon/templates/components/fw-table-sortable.hbs
|
|
15
|
+
2024-07-09T14:00:38.988Z [warn] WARNING: {{light-table}} was not converted as it has positional parameters which can't be automatically converted. Source: addon/templates/components/fw-table-sortable.hbs
|
|
16
|
+
2024-07-09T14:00:38.989Z [warn] WARNING: {{yield}} was not converted as it has positional parameters which can't be automatically converted. Source: addon/templates/components/fw-table-sortable.hbs
|
package/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
/* eslint-env node */
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
name: '@bennerinformatics/ember-fw-table',
|
|
6
|
-
included() {
|
|
7
|
-
this._super.included.apply(this, arguments);
|
|
8
|
-
}
|
|
9
|
-
|
|
1
|
+
/* eslint-env node */
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
module.exports = {
|
|
5
|
+
name: '@bennerinformatics/ember-fw-table',
|
|
6
|
+
included() {
|
|
7
|
+
this._super.included.apply(this, arguments);
|
|
8
|
+
},
|
|
9
|
+
isDevelopingAddon: () => true
|
|
10
|
+
};
|
package/package.json
CHANGED
|
@@ -1,67 +1,65 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@bennerinformatics/ember-fw-table",
|
|
3
|
-
"version": "2.0
|
|
4
|
-
"description": "Additional resources related to tables for the Ember FW App System.",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"ember-addon",
|
|
7
|
-
"fw"
|
|
8
|
-
],
|
|
9
|
-
"license": "MIT",
|
|
10
|
-
"author": "David Burnett <djburnett@olivet.edu>",
|
|
11
|
-
"directories": {
|
|
12
|
-
"doc": "doc",
|
|
13
|
-
"test": "tests"
|
|
14
|
-
},
|
|
15
|
-
"repository": "",
|
|
16
|
-
"scripts": {
|
|
17
|
-
"build": "ember build",
|
|
18
|
-
"start": "ember server",
|
|
19
|
-
"test": "npm run lint && ember try:each",
|
|
20
|
-
"lint": "ember test --launch phantomjs --filter=\"ESLint\""
|
|
21
|
-
},
|
|
22
|
-
"dependencies": {
|
|
23
|
-
"ember-cli-babel": "
|
|
24
|
-
"ember-cli-htmlbars": "^3.1.0",
|
|
25
|
-
"ember-light-table": "
|
|
26
|
-
"ember-papaparse": "^1.0.0",
|
|
27
|
-
"ember-truth-helpers": "^2.1.0",
|
|
28
|
-
"node-sass": "^4.12.0",
|
|
29
|
-
"papaparse": "^5.0.2"
|
|
30
|
-
},
|
|
31
|
-
"devDependencies": {
|
|
32
|
-
"@bennerinformatics/ember-fw": "^2.0.
|
|
33
|
-
"broccoli-asset-rev": "^3.0.0",
|
|
34
|
-
"ember-ajax": "^5.0.0",
|
|
35
|
-
"ember-cli": "~3.10.0",
|
|
36
|
-
"ember-cli-addon-docs-yuidoc": "^1.0.0",
|
|
37
|
-
"ember-cli-app-version": "^3.2.0",
|
|
38
|
-
"ember-cli-dependency-checker": "^3.2.0",
|
|
39
|
-
"ember-cli-eslint": "^5.1.0",
|
|
40
|
-
"ember-cli-htmlbars-inline-precompile": "^2.1.0",
|
|
41
|
-
"ember-cli-inject-live-reload": "^2.0.1",
|
|
42
|
-
"ember-cli-qunit": "^4.4.0",
|
|
43
|
-
"ember-cli-shims": "^1.2.0",
|
|
44
|
-
"ember-cli-sri": "^2.1.0",
|
|
45
|
-
"ember-cli-uglify": "^3.0.0",
|
|
46
|
-
"ember-cli-yuidoc": "^0.8.8",
|
|
47
|
-
"ember-disable-prototype-extensions": "^1.1.3",
|
|
48
|
-
"ember-export-application-global": "^2.0.0",
|
|
49
|
-
"ember-load-initializers": "^2.0.0",
|
|
50
|
-
"ember-resolver": "^5.2.1",
|
|
51
|
-
"ember-responsive": "^3.0.5",
|
|
52
|
-
"ember-sortable": "1.12.9",
|
|
53
|
-
"ember-source": "~3.10.0",
|
|
54
|
-
"eslint-plugin-ember": "^6.9.1",
|
|
55
|
-
"eslint-plugin-ember-suave": "^1.0.0",
|
|
56
|
-
"loader.js": "^4.7.0",
|
|
57
|
-
"moment": "^2.24.0"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@bennerinformatics/ember-fw-table",
|
|
3
|
+
"version": "2.1.0",
|
|
4
|
+
"description": "Additional resources related to tables for the Ember FW App System.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ember-addon",
|
|
7
|
+
"fw"
|
|
8
|
+
],
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"author": "David Burnett <djburnett@olivet.edu>",
|
|
11
|
+
"directories": {
|
|
12
|
+
"doc": "doc",
|
|
13
|
+
"test": "tests"
|
|
14
|
+
},
|
|
15
|
+
"repository": "",
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "ember build",
|
|
18
|
+
"start": "ember server",
|
|
19
|
+
"test": "npm run lint && ember try:each",
|
|
20
|
+
"lint": "ember test --launch phantomjs --filter=\"ESLint\""
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"ember-cli-babel": "7.13.2",
|
|
24
|
+
"ember-cli-htmlbars": "^3.1.0",
|
|
25
|
+
"ember-light-table": "2.0.0-beta.5",
|
|
26
|
+
"ember-papaparse": "^1.0.0",
|
|
27
|
+
"ember-truth-helpers": "^2.1.0",
|
|
28
|
+
"node-sass": "^4.12.0",
|
|
29
|
+
"papaparse": "^5.0.2"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@bennerinformatics/ember-fw": "^2.0.29",
|
|
33
|
+
"broccoli-asset-rev": "^3.0.0",
|
|
34
|
+
"ember-ajax": "^5.0.0",
|
|
35
|
+
"ember-cli": "~3.10.0",
|
|
36
|
+
"ember-cli-addon-docs-yuidoc": "^1.0.0",
|
|
37
|
+
"ember-cli-app-version": "^3.2.0",
|
|
38
|
+
"ember-cli-dependency-checker": "^3.2.0",
|
|
39
|
+
"ember-cli-eslint": "^5.1.0",
|
|
40
|
+
"ember-cli-htmlbars-inline-precompile": "^2.1.0",
|
|
41
|
+
"ember-cli-inject-live-reload": "^2.0.1",
|
|
42
|
+
"ember-cli-qunit": "^4.4.0",
|
|
43
|
+
"ember-cli-shims": "^1.2.0",
|
|
44
|
+
"ember-cli-sri": "^2.1.0",
|
|
45
|
+
"ember-cli-uglify": "^3.0.0",
|
|
46
|
+
"ember-cli-yuidoc": "^0.8.8",
|
|
47
|
+
"ember-disable-prototype-extensions": "^1.1.3",
|
|
48
|
+
"ember-export-application-global": "^2.0.0",
|
|
49
|
+
"ember-load-initializers": "^2.0.0",
|
|
50
|
+
"ember-resolver": "^5.2.1",
|
|
51
|
+
"ember-responsive": "^3.0.5",
|
|
52
|
+
"ember-sortable": "1.12.9",
|
|
53
|
+
"ember-source": "~3.10.0",
|
|
54
|
+
"eslint-plugin-ember": "^6.9.1",
|
|
55
|
+
"eslint-plugin-ember-suave": "^1.0.0",
|
|
56
|
+
"loader.js": "^4.7.0",
|
|
57
|
+
"moment": "^2.24.0"
|
|
58
|
+
},
|
|
59
|
+
"engines": {
|
|
60
|
+
"node": ">= 0.10.0"
|
|
61
|
+
},
|
|
62
|
+
"ember-addon": {
|
|
63
|
+
"configPath": "tests/dummy/config"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014 Kevin Lakotko, Tony Barone, Brian Reavis
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|