@bennerinformatics/ember-fw-table 2.1.4 → 2.1.6
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/addon/components/fw-table-resort.js +18 -4
- package/addon/components/fw-table-sortable.js +23 -0
- package/addon/templates/components/fw-table-resort.hbs +3 -0
- package/addon/templates/components/fw-table-sortable.hbs +10 -1
- package/docs/api.js +61 -0
- package/docs/assets/css/custom.css +82 -0
- package/docs/assets/css/external-small.png +0 -0
- package/docs/assets/css/logo.png +0 -0
- package/docs/assets/css/main.css +793 -0
- package/docs/assets/css/theme.css +547 -0
- package/docs/assets/favicon.ico +0 -0
- package/docs/assets/icons/android-icon-144x144.png +0 -0
- package/docs/assets/icons/android-icon-192x192.png +0 -0
- package/docs/assets/icons/android-icon-36x36.png +0 -0
- package/docs/assets/icons/android-icon-48x48.png +0 -0
- package/docs/assets/icons/android-icon-72x72.png +0 -0
- package/docs/assets/icons/android-icon-96x96.png +0 -0
- package/docs/assets/icons/apple-icon-114x114.png +0 -0
- package/docs/assets/icons/apple-icon-120x120.png +0 -0
- package/docs/assets/icons/apple-icon-144x144.png +0 -0
- package/docs/assets/icons/apple-icon-152x152.png +0 -0
- package/docs/assets/icons/apple-icon-180x180.png +0 -0
- package/docs/assets/icons/apple-icon-57x57.png +0 -0
- package/docs/assets/icons/apple-icon-60x60.png +0 -0
- package/docs/assets/icons/apple-icon-72x72.png +0 -0
- package/docs/assets/icons/apple-icon-76x76.png +0 -0
- package/docs/assets/icons/apple-icon-precomposed.png +0 -0
- package/docs/assets/icons/apple-icon.png +0 -0
- package/docs/assets/icons/browserconfig.xml +2 -0
- package/docs/assets/icons/favicon-16x16.png +0 -0
- package/docs/assets/icons/favicon-32x32.png +0 -0
- package/docs/assets/icons/favicon-96x96.png +0 -0
- package/docs/assets/icons/favicon.ico +0 -0
- package/docs/assets/icons/manifest.json +41 -0
- package/docs/assets/icons/ms-icon-144x144.png +0 -0
- package/docs/assets/icons/ms-icon-150x150.png +0 -0
- package/docs/assets/icons/ms-icon-310x310.png +0 -0
- package/docs/assets/icons/ms-icon-70x70.png +0 -0
- package/docs/assets/img/ember-logo.png +0 -0
- package/docs/assets/img/fw-logo.png +0 -0
- package/docs/assets/img/spinner.gif +0 -0
- package/docs/assets/index.html +10 -0
- package/docs/assets/js/api-filter.js +56 -0
- package/docs/assets/js/api-list.js +255 -0
- package/docs/assets/js/api-search.js +98 -0
- package/docs/assets/js/apidocs.js +376 -0
- package/docs/assets/js/yui-prettify.js +17 -0
- package/docs/assets/js/yuidoc-bootstrap.js +274 -0
- package/docs/assets/vendor/bootstrap/css/bootstrap.css +6760 -0
- package/docs/assets/vendor/bootstrap/css/bootstrap.min.css +6 -0
- package/docs/assets/vendor/bootstrap/fonts/glyphicons-halflings-regular.eot +0 -0
- package/docs/assets/vendor/bootstrap/fonts/glyphicons-halflings-regular.svg +288 -0
- package/docs/assets/vendor/bootstrap/fonts/glyphicons-halflings-regular.ttf +0 -0
- package/docs/assets/vendor/bootstrap/fonts/glyphicons-halflings-regular.woff +0 -0
- package/docs/assets/vendor/bootstrap/fonts/glyphicons-halflings-regular.woff2 +0 -0
- package/docs/assets/vendor/bootstrap/img/glyphicons-halflings-white.png +0 -0
- package/docs/assets/vendor/bootstrap/img/glyphicons-halflings.png +0 -0
- package/docs/assets/vendor/bootstrap/js/bootstrap.js +2363 -0
- package/docs/assets/vendor/bootstrap/js/bootstrap.min.js +7 -0
- package/docs/assets/vendor/font-awesome/css/font-awesome.css +2199 -0
- package/docs/assets/vendor/font-awesome/css/font-awesome.min.css +4 -0
- package/docs/assets/vendor/font-awesome/fonts/FontAwesome.otf +0 -0
- package/docs/assets/vendor/font-awesome/fonts/fontawesome-webfont.eot +0 -0
- package/docs/assets/vendor/font-awesome/fonts/fontawesome-webfont.svg +685 -0
- package/docs/assets/vendor/font-awesome/fonts/fontawesome-webfont.ttf +0 -0
- package/docs/assets/vendor/font-awesome/fonts/fontawesome-webfont.woff +0 -0
- package/docs/assets/vendor/font-awesome/fonts/fontawesome-webfont.woff2 +0 -0
- package/docs/assets/vendor/github-slugger/slugger.js +59 -0
- package/docs/assets/vendor/jquery/jquery.min.js +6 -0
- package/docs/assets/vendor/jquery-ui/jquery-ui.min.js +6 -0
- package/docs/assets/vendor/prettify/CHANGES.html +130 -0
- package/docs/assets/vendor/prettify/COPYING +202 -0
- package/docs/assets/vendor/prettify/README.html +203 -0
- package/docs/assets/vendor/prettify/prettify-min.css +1 -0
- package/docs/assets/vendor/prettify/prettify-min.js +1 -0
- package/docs/classes/BaseCells.html +484 -0
- package/docs/classes/Export.html +457 -0
- package/docs/classes/Format.html +577 -0
- package/docs/classes/FwCellAction.html +312 -0
- package/docs/classes/FwCellBoolean.html +311 -0
- package/docs/classes/FwCellNullable.html +312 -0
- package/docs/classes/FwCellPermissionIcon.html +321 -0
- package/docs/classes/FwColumnSortable.html +358 -0
- package/docs/classes/FwColumnTitle.html +314 -0
- package/docs/classes/FwDeleteModal.html +485 -0
- package/docs/classes/FwExpandableRow.html +307 -0
- package/docs/classes/FwPaginationWrapper.html +2129 -0
- package/docs/classes/FwRowToggle.html +355 -0
- package/docs/classes/FwRowToggleIndex.html +312 -0
- package/docs/classes/FwTableExpandedRow.html +307 -0
- package/docs/classes/FwTableResort.html +827 -0
- package/docs/classes/FwTableSortable.html +1293 -0
- package/docs/classes/Row.html +352 -0
- package/docs/classes/Table.html +672 -0
- package/docs/classes/TableUtil.html +410 -0
- package/docs/classes/index.html +10 -0
- package/docs/data.json +2324 -0
- package/docs/elements/index.html +10 -0
- package/docs/files/addon_classes_Row.js.html +318 -0
- package/docs/files/addon_classes_Table.js.html +390 -0
- package/docs/files/addon_components_fw-cell-action.js.html +257 -0
- package/docs/files/addon_components_fw-cell-boolean.js.html +251 -0
- package/docs/files/addon_components_fw-cell-nullable.js.html +253 -0
- package/docs/files/addon_components_fw-cell-permission-icon.js.html +266 -0
- package/docs/files/addon_components_fw-column-sortable.js.html +281 -0
- package/docs/files/addon_components_fw-column-title.js.html +259 -0
- package/docs/files/addon_components_fw-delete-modal.js.html +318 -0
- package/docs/files/addon_components_fw-expandable-row.js.html +248 -0
- package/docs/files/addon_components_fw-pagination-wrapper.js.html +838 -0
- package/docs/files/addon_components_fw-row-toggle-index.js.html +252 -0
- package/docs/files/addon_components_fw-row-toggle.js.html +270 -0
- package/docs/files/addon_components_fw-table-expanded-row.js.html +261 -0
- package/docs/files/addon_components_fw-table-expanded-rows.js.html +263 -0
- package/docs/files/addon_components_fw-table-resort.js.html +457 -0
- package/docs/files/addon_components_fw-table-sortable.js.html +663 -0
- package/docs/files/addon_documentation.js.html +301 -0
- package/docs/files/addon_initializers_responsive.js.html +253 -0
- package/docs/files/addon_utils_base-cells.js.html +313 -0
- package/docs/files/addon_utils_export.js.html +316 -0
- package/docs/files/addon_utils_formats.js.html +335 -0
- package/docs/files/addon_utils_table.js.html +274 -0
- package/docs/files/index.html +10 -0
- package/docs/index.html +252 -0
- package/docs/modules/CellComponents.html +313 -0
- package/docs/modules/ColumnComponents.html +284 -0
- package/docs/modules/Components.html +285 -0
- package/docs/modules/Introduction.html +261 -0
- package/docs/modules/Utils.html +285 -0
- package/docs/modules/index.html +10 -0
- package/package.json +64 -64
- package/.yalc/ember-sortable/.huskyrc +0 -5
- package/.yalc/ember-sortable/CHANGELOG.md +0 -755
- package/.yalc/ember-sortable/CODE_OF_CONDUCT.md +0 -6
- package/.yalc/ember-sortable/LICENSE.md +0 -9
- package/.yalc/ember-sortable/MIGRATION_GUIDE_MODIFIERS.md +0 -95
- package/.yalc/ember-sortable/MIGRATION_GUIDE_V2.md +0 -120
- package/.yalc/ember-sortable/Makefile +0 -24
- package/.yalc/ember-sortable/README.md +0 -423
- package/.yalc/ember-sortable/RELEASE.md +0 -60
- package/.yalc/ember-sortable/V2_MIGRATION_RFC.md +0 -1100
- package/.yalc/ember-sortable/addon/modifiers/sortable-group.js +0 -754
- package/.yalc/ember-sortable/addon/modifiers/sortable-handle.js +0 -29
- package/.yalc/ember-sortable/addon/modifiers/sortable-item.js +0 -869
- package/.yalc/ember-sortable/addon/services/ember-sortable.js +0 -92
- package/.yalc/ember-sortable/addon/system/scroll-container.js +0 -53
- package/.yalc/ember-sortable/addon/system/scroll-parent.js +0 -33
- package/.yalc/ember-sortable/addon/utils/constant.js +0 -9
- package/.yalc/ember-sortable/addon/utils/coordinate.js +0 -34
- package/.yalc/ember-sortable/addon/utils/css-calculation.js +0 -20
- package/.yalc/ember-sortable/addon/utils/defaults.js +0 -26
- package/.yalc/ember-sortable/addon/utils/keyboard.js +0 -32
- package/.yalc/ember-sortable/addon-test-support/helpers/drag.js +0 -111
- package/.yalc/ember-sortable/addon-test-support/helpers/index.js +0 -4
- package/.yalc/ember-sortable/addon-test-support/helpers/reorder.js +0 -41
- package/.yalc/ember-sortable/addon-test-support/utils/keyboard.js +0 -32
- package/.yalc/ember-sortable/addon-test-support/utils/offset.js +0 -14
- package/.yalc/ember-sortable/app/modifiers/sortable-group.js +0 -1
- package/.yalc/ember-sortable/app/modifiers/sortable-handle.js +0 -1
- package/.yalc/ember-sortable/app/modifiers/sortable-item.js +0 -1
- package/.yalc/ember-sortable/app/services/ember-sortable-internal-state.js +0 -1
- package/.yalc/ember-sortable/config/environment.js +0 -5
- package/.yalc/ember-sortable/demo.gif +0 -0
- package/.yalc/ember-sortable/index.js +0 -5
- package/.yalc/ember-sortable/package.json +0 -65
- package/.yalc/ember-sortable/yalc.sig +0 -1
- package/yalc.lock +0 -10
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title>addon\components\fw-table-resort.js - Ember-FW-Table</title>
|
|
6
|
+
<meta name="description" content="A set of components surrounding the functionality of the fw-table-sortable, which is a simplified table, with ember-light-table as its internals.">
|
|
7
|
+
<link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
|
|
8
|
+
<link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
|
|
9
|
+
<link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
|
|
10
|
+
<link rel="stylesheet" href="../assets/css/custom.css">
|
|
11
|
+
<link rel="stylesheet" href="../assets/vendor/bootstrap/css/bootstrap.css">
|
|
12
|
+
<link rel="stylesheet" href="../assets/vendor/font-awesome/css/font-awesome.min.css">
|
|
13
|
+
<link rel="stylesheet" href="../assets/css/theme.css">
|
|
14
|
+
<link href='https://fonts.googleapis.com/css?family=Open+Sans:300,400,500,600,700' rel='stylesheet' type='text/css'>
|
|
15
|
+
<!-- favicon information -->
|
|
16
|
+
<link rel="apple-touch-icon" sizes="57x57" href="/assets/icons/apple-icon-57x57.png">
|
|
17
|
+
<link rel="apple-touch-icon" sizes="60x60" href="/assets/icons/apple-icon-60x60.png">
|
|
18
|
+
<link rel="apple-touch-icon" sizes="72x72" href="/assets/icons/apple-icon-72x72.png">
|
|
19
|
+
<link rel="apple-touch-icon" sizes="76x76" href="/assets/icons/apple-icon-76x76.png">
|
|
20
|
+
<link rel="apple-touch-icon" sizes="114x114" href="/assets/icons/apple-icon-114x114.png">
|
|
21
|
+
<link rel="apple-touch-icon" sizes="120x120" href="/assets/icons/apple-icon-120x120.png">
|
|
22
|
+
<link rel="apple-touch-icon" sizes="144x144" href="/assets/icons/apple-icon-144x144.png">
|
|
23
|
+
<link rel="apple-touch-icon" sizes="152x152" href="/assets/icons/apple-icon-152x152.png">
|
|
24
|
+
<link rel="apple-touch-icon" sizes="180x180" href="/assets/icons/apple-icon-180x180.png">
|
|
25
|
+
<link rel="icon" type="image/png" sizes="192x192" href="/assets/icons/android-icon-192x192.png">
|
|
26
|
+
<link rel="icon" type="image/png" sizes="32x32" href="/assets/icons/favicon-32x32.png">
|
|
27
|
+
<link rel="icon" type="image/png" sizes="96x96" href="/assets/icons/favicon-96x96.png">
|
|
28
|
+
<link rel="icon" type="image/png" sizes="16x16" href="/assets/icons/favicon-16x16.png">
|
|
29
|
+
<link rel="manifest" href="/assets/icons/manifest.json">
|
|
30
|
+
<meta name="msapplication-TileImage" content="/assets/icons/ms-icon-144x144.png">
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
<style>
|
|
34
|
+
body a {
|
|
35
|
+
color: #7E3DB7;
|
|
36
|
+
}
|
|
37
|
+
body a:hover {
|
|
38
|
+
color: #7E3DB7;
|
|
39
|
+
opacity: 0.5;
|
|
40
|
+
}
|
|
41
|
+
.navbar.navbar-default .navbar-nav> li> a:focus, .navbar.navbar-default .navbar-nav> li> a:hover {
|
|
42
|
+
color: #7E3DB7;
|
|
43
|
+
}
|
|
44
|
+
.navbar.navbar-default .navbar-nav> .active> a, .navbar.navbar-default .navbar-nav> .active> a:focus, .navbar.navbar-default .navbar-nav> .active> a:hover {
|
|
45
|
+
color: #7E3DB7;
|
|
46
|
+
}
|
|
47
|
+
#docs-main .page-header {
|
|
48
|
+
color: #7E3DB7;
|
|
49
|
+
}
|
|
50
|
+
#docs-main .page-section .nav-tabs {
|
|
51
|
+
border-bottom: 1px solid #7E3DB7;
|
|
52
|
+
}
|
|
53
|
+
#docs-main .page-section .nav-tabs> li.active a {
|
|
54
|
+
background: #7E3DB7;
|
|
55
|
+
border: 1px solid #7E3DB7;
|
|
56
|
+
}
|
|
57
|
+
#sidebar li.panel .panel-body ol> li.active, #sidebar li.panel .panel-body ol> li:hover {
|
|
58
|
+
background: #efefef;
|
|
59
|
+
}
|
|
60
|
+
</style>
|
|
61
|
+
</head>
|
|
62
|
+
<body>
|
|
63
|
+
<nav class="navbar navbar-default">
|
|
64
|
+
<div class="container-fluid">
|
|
65
|
+
<div class="navbar-header">
|
|
66
|
+
<a href="../" class="navbar-brand">
|
|
67
|
+
<img src="..\assets\img\fw-logo.png" alt="enterprise logo">
|
|
68
|
+
<span>Ember-FW-Table (API)</span>
|
|
69
|
+
</a>
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<div class="collapse navbar-collapse" id="nav">
|
|
73
|
+
<ul class="nav navbar-nav navbar-right">
|
|
74
|
+
<li><a href="https://linformatics.bitbucket.io/docs/">Docs</a></li>
|
|
75
|
+
<li><a href="https://linformatics.bitbucket.io/downloads/">Downloads</a></li>
|
|
76
|
+
<li><a href="https://linformatics.bitbucket.io/api/">API</a></li>
|
|
77
|
+
<li><a href="https://bitbucket.org/linformatics/ember-fw-table" class="fa fa-github github"></a></li>
|
|
78
|
+
</ul>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</nav>
|
|
82
|
+
<div id="main-wrapper" class="row">
|
|
83
|
+
<div id="content-wrapper">
|
|
84
|
+
<ol class="panel-group" id="sidebar" role="tablist" aria-multiselectable="true">
|
|
85
|
+
<li class="panel panel-default">
|
|
86
|
+
<div class="panel-heading" role="tab" id="sidebar-search-heading">
|
|
87
|
+
<h4 class="panel-title">
|
|
88
|
+
<a role="button" data-toggle="collapse" href="#sidebar-search" aria-expanded="true" aria-controls="collapseOne">
|
|
89
|
+
Search
|
|
90
|
+
</a>
|
|
91
|
+
</h4>
|
|
92
|
+
</div>
|
|
93
|
+
<div id="sidebar-search" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="sidebar-search-heading">
|
|
94
|
+
<div class="panel-body">
|
|
95
|
+
<div id="api-tabview-filter">
|
|
96
|
+
<input type="search" id="api-filter" placeholder="Search...">
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
</li>
|
|
101
|
+
<li class="panel panel-default">
|
|
102
|
+
<div class="panel-heading" role="tab" id="sidebar-version-heading">
|
|
103
|
+
<h4 class="panel-title">
|
|
104
|
+
<a role="button" href="https://bitbucket.org/linformatics/ember-fw-table/commits/04d3b2ce" target="_blank">
|
|
105
|
+
Tag: 2.1.4.04d3b2ce
|
|
106
|
+
</a>
|
|
107
|
+
</h4>
|
|
108
|
+
</div>
|
|
109
|
+
</li>
|
|
110
|
+
<li class="panel panel-default">
|
|
111
|
+
<div class="panel-heading" role="tab" id="sidebar-modules-heading">
|
|
112
|
+
<h4 class="panel-title">
|
|
113
|
+
<a role="button" data-toggle="collapse" href="#sidebar-modules" aria-expanded="true" aria-controls="collapseOne">
|
|
114
|
+
Modules
|
|
115
|
+
</a>
|
|
116
|
+
</h4>
|
|
117
|
+
</div>
|
|
118
|
+
<div id="sidebar-modules" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="sidebar-modules-heading">
|
|
119
|
+
<div class="panel-body">
|
|
120
|
+
<ol>
|
|
121
|
+
<li>
|
|
122
|
+
<a href="../modules/CellComponents.html">CellComponents</a>
|
|
123
|
+
</li>
|
|
124
|
+
<li>
|
|
125
|
+
<a href="../modules/ColumnComponents.html">ColumnComponents</a>
|
|
126
|
+
</li>
|
|
127
|
+
<li>
|
|
128
|
+
<a href="../modules/Components.html">Components</a>
|
|
129
|
+
</li>
|
|
130
|
+
<li>
|
|
131
|
+
<a href="../modules/Introduction.html">Introduction</a>
|
|
132
|
+
</li>
|
|
133
|
+
<li>
|
|
134
|
+
<a href="../modules/Utils.html">Utils</a>
|
|
135
|
+
</li>
|
|
136
|
+
</ol>
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
</li>
|
|
140
|
+
|
|
141
|
+
<li class="panel panel-default">
|
|
142
|
+
<div class="panel-heading" role="tab" id="sidebar-classes-heading">
|
|
143
|
+
<h4 class="panel-title">
|
|
144
|
+
<a role="button" data-toggle="collapse" href="#sidebar-classes" aria-expanded="true" aria-controls="collapseOne">
|
|
145
|
+
Classes
|
|
146
|
+
</a>
|
|
147
|
+
</h4>
|
|
148
|
+
</div>
|
|
149
|
+
<div id="sidebar-classes" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="sidebar-classes-heading">
|
|
150
|
+
<div class="panel-body">
|
|
151
|
+
<ol>
|
|
152
|
+
<li>
|
|
153
|
+
<a href="../classes/BaseCells.html">BaseCells</a>
|
|
154
|
+
</li>
|
|
155
|
+
<li>
|
|
156
|
+
<a href="../classes/Export.html">Export</a>
|
|
157
|
+
</li>
|
|
158
|
+
<li>
|
|
159
|
+
<a href="../classes/Format.html">Format</a>
|
|
160
|
+
</li>
|
|
161
|
+
<li>
|
|
162
|
+
<a href="../classes/FwCellAction.html">FwCellAction</a>
|
|
163
|
+
</li>
|
|
164
|
+
<li>
|
|
165
|
+
<a href="../classes/FwCellBoolean.html">FwCellBoolean</a>
|
|
166
|
+
</li>
|
|
167
|
+
<li>
|
|
168
|
+
<a href="../classes/FwCellNullable.html">FwCellNullable</a>
|
|
169
|
+
</li>
|
|
170
|
+
<li>
|
|
171
|
+
<a href="../classes/FwCellPermissionIcon.html">FwCellPermissionIcon</a>
|
|
172
|
+
</li>
|
|
173
|
+
<li>
|
|
174
|
+
<a href="../classes/FwColumnSortable.html">FwColumnSortable</a>
|
|
175
|
+
</li>
|
|
176
|
+
<li>
|
|
177
|
+
<a href="../classes/FwColumnTitle.html">FwColumnTitle</a>
|
|
178
|
+
</li>
|
|
179
|
+
<li>
|
|
180
|
+
<a href="../classes/FwDeleteModal.html">FwDeleteModal</a>
|
|
181
|
+
</li>
|
|
182
|
+
<li>
|
|
183
|
+
<a href="../classes/FwPaginationWrapper.html">FwPaginationWrapper</a>
|
|
184
|
+
</li>
|
|
185
|
+
<li>
|
|
186
|
+
<a href="../classes/FwRowToggle.html">FwRowToggle</a>
|
|
187
|
+
</li>
|
|
188
|
+
<li>
|
|
189
|
+
<a href="../classes/FwRowToggleIndex.html">FwRowToggleIndex</a>
|
|
190
|
+
</li>
|
|
191
|
+
<li>
|
|
192
|
+
<a href="../classes/FwTableResort.html">FwTableResort</a>
|
|
193
|
+
</li>
|
|
194
|
+
<li>
|
|
195
|
+
<a href="../classes/FwTableSortable.html">FwTableSortable</a>
|
|
196
|
+
</li>
|
|
197
|
+
<li>
|
|
198
|
+
<a href="../classes/Row.html">Row</a>
|
|
199
|
+
</li>
|
|
200
|
+
<li>
|
|
201
|
+
<a href="../classes/Table.html">Table</a>
|
|
202
|
+
</li>
|
|
203
|
+
<li>
|
|
204
|
+
<a href="../classes/TableUtil.html">TableUtil</a>
|
|
205
|
+
</li>
|
|
206
|
+
</ol>
|
|
207
|
+
</div>
|
|
208
|
+
</div>
|
|
209
|
+
</li>
|
|
210
|
+
</ol>
|
|
211
|
+
<div class="content-container">
|
|
212
|
+
<div class="apidocs">
|
|
213
|
+
<div id="docs-main">
|
|
214
|
+
<div class="content">
|
|
215
|
+
<div class="page-header">
|
|
216
|
+
<h1><i class="fa fa-file-code-o" aria-hidden="true"></i> File</h1>
|
|
217
|
+
</div>
|
|
218
|
+
|
|
219
|
+
<div class="file">
|
|
220
|
+
<pre class="prettyprint linenums">
|
|
221
|
+
import Component from '@ember/component';
|
|
222
|
+
import {defineProperty} from '@ember/object';
|
|
223
|
+
import {alias, filter, filterBy, sort} from '@ember/object/computed';
|
|
224
|
+
import layout from '../templates/components/fw-table-resort';
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* This table contains client-side logic to resort a "table" of models. This resort table will not call the actual serverside "save" function, so you will need to persist the changes to the database yourself,
|
|
228
|
+
* but it will do everything else for you (ie all you should have to do is call save, and the reorder will work). A basic usage example is the following:
|
|
229
|
+
*
|
|
230
|
+
* ```handlebars
|
|
231
|
+
* <FwTableResort @items={{items}} @titleKey='name' @sortKey='sorted' />
|
|
232
|
+
* ```
|
|
233
|
+
*
|
|
234
|
+
* If used in a block format instead, it is possible to fully define the title area, such as to replace it with input fields, which also adds a cheveron to expand if desired
|
|
235
|
+
* ```handlebars
|
|
236
|
+
* <FwTableResort @items={{items}} @sortKey='sorted' as |item expanded|>
|
|
237
|
+
* {{input item.name}}
|
|
238
|
+
* </FwTableResort>
|
|
239
|
+
* ```
|
|
240
|
+
* Currently the only way to have a display title different from the default sort is to use the block format manually (set the `titleKey` to the desired default sort, and then manually display
|
|
241
|
+
* the other desired property).
|
|
242
|
+
* @class FwTableResort
|
|
243
|
+
* @public
|
|
244
|
+
* @module Components
|
|
245
|
+
*/
|
|
246
|
+
const TableResort = Component.extend({
|
|
247
|
+
layout,
|
|
248
|
+
tagName: 'section',
|
|
249
|
+
classNames: ['panel-body', 'fw-table-resort'],
|
|
250
|
+
/**
|
|
251
|
+
* Required property. This is what you pass the array of items you wish to sort with the table.
|
|
252
|
+
* @public
|
|
253
|
+
* @property items
|
|
254
|
+
* @type {Boolean}
|
|
255
|
+
*/
|
|
256
|
+
/**
|
|
257
|
+
* If true, show an expand button for more fields
|
|
258
|
+
*
|
|
259
|
+
* @public
|
|
260
|
+
* @property allowExpand
|
|
261
|
+
* @type {Boolean}
|
|
262
|
+
*/
|
|
263
|
+
allowExpand: false,
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Filter called to check if an item is active
|
|
267
|
+
*
|
|
268
|
+
* @public
|
|
269
|
+
* @property activeFilter
|
|
270
|
+
* @type {Function}
|
|
271
|
+
*/
|
|
272
|
+
activeFilter: null,
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Key used to determine if an item is active
|
|
276
|
+
*
|
|
277
|
+
* @public
|
|
278
|
+
* @property activeKey
|
|
279
|
+
* @type {String}
|
|
280
|
+
*/
|
|
281
|
+
activeKey: null,
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* If defined with an action, adds a delete button to delete items
|
|
285
|
+
*
|
|
286
|
+
* @public
|
|
287
|
+
* @default true
|
|
288
|
+
* @property delete
|
|
289
|
+
* @type {Action}
|
|
290
|
+
*/
|
|
291
|
+
delete: () => {},
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* The icon that will be used for the delete button. Useful if you want the button to do something other than delete.
|
|
295
|
+
*
|
|
296
|
+
* @public
|
|
297
|
+
* @default fa-regular fa-trash-can
|
|
298
|
+
* @property deleteIcon
|
|
299
|
+
* @type {String}
|
|
300
|
+
*/
|
|
301
|
+
deleteIcon: 'fa-regular fa-trash-can',
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* String pointer to the model's sort key, will be used to sort the items and modify the key later
|
|
305
|
+
*
|
|
306
|
+
* @public
|
|
307
|
+
* @property sortKey
|
|
308
|
+
* @type {String}
|
|
309
|
+
*/
|
|
310
|
+
sortKey: '',
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Default sort for if the sort key is undefined and title to display if no block is used
|
|
314
|
+
* @public
|
|
315
|
+
* @property title
|
|
316
|
+
* @type {String}
|
|
317
|
+
*/
|
|
318
|
+
titleKey: null,
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Spacing between sortable items
|
|
322
|
+
*
|
|
323
|
+
* @public
|
|
324
|
+
* @property spacing
|
|
325
|
+
* @type {Number}
|
|
326
|
+
*/
|
|
327
|
+
spacing: 15,
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* Tolerance before dragging starts
|
|
331
|
+
*
|
|
332
|
+
* @public
|
|
333
|
+
* @property distance
|
|
334
|
+
* @type {Number}
|
|
335
|
+
*/
|
|
336
|
+
distance: 0,
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* An internal list of all items which will be shown in the table (takes into account activeKey and activeFilter)
|
|
340
|
+
*
|
|
341
|
+
* @private
|
|
342
|
+
* @property viewableItems
|
|
343
|
+
* @type {Array}
|
|
344
|
+
*/
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Sort order as defined by passed properties
|
|
348
|
+
* @private
|
|
349
|
+
* @property _sortOrder
|
|
350
|
+
* @type {Array}
|
|
351
|
+
*/
|
|
352
|
+
_sortOrder: null,
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Sorted list of items in the table
|
|
356
|
+
*
|
|
357
|
+
* @private
|
|
358
|
+
* @property sortedItems
|
|
359
|
+
* @type {Array}
|
|
360
|
+
*/
|
|
361
|
+
sortedItems: sort('viewableItems', '_sortOrder'),
|
|
362
|
+
|
|
363
|
+
didReceiveAttrs() {
|
|
364
|
+
this._super(...arguments);
|
|
365
|
+
|
|
366
|
+
// determine the default sort order from the sortkey
|
|
367
|
+
this.set('_sortOrder', [this.sortKey]);
|
|
368
|
+
// if we have a fallback for default is null, add that as well
|
|
369
|
+
if (this.titleKey) {
|
|
370
|
+
this._sortOrder.pushObject(this.titleKey);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
// determine how we will filter the viewable items based on what the user gave
|
|
374
|
+
// if its a key, either filter type
|
|
375
|
+
let activeKey = this.activeKey;
|
|
376
|
+
if (activeKey) {
|
|
377
|
+
// have a function? use that
|
|
378
|
+
let activeFilter = this.activeFilter;
|
|
379
|
+
if (activeFilter) {
|
|
380
|
+
defineProperty(this, 'viewableItems', filter(`items.@each.${activeKey}`, activeFilter));
|
|
381
|
+
} else {
|
|
382
|
+
// otherwise do a flat filterBy
|
|
383
|
+
defineProperty(this, 'viewableItems', filterBy('items', activeKey));
|
|
384
|
+
}
|
|
385
|
+
} else {
|
|
386
|
+
// no key? just display all
|
|
387
|
+
defineProperty(this, 'viewableItems', alias('items'));
|
|
388
|
+
}
|
|
389
|
+
},
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* Helper function to sort a list of passed items
|
|
393
|
+
* @method reorderItems
|
|
394
|
+
* @param {DS.Model[]} items Model array
|
|
395
|
+
* @private
|
|
396
|
+
*/
|
|
397
|
+
reorderItems(items) {
|
|
398
|
+
let activeFilter = this.activeFilter;
|
|
399
|
+
if (activeFilter) {
|
|
400
|
+
items = items.filter(activeFilter);
|
|
401
|
+
}
|
|
402
|
+
items.forEach((item, index) => {
|
|
403
|
+
item.set(this.sortKey, index + 1);
|
|
404
|
+
});
|
|
405
|
+
},
|
|
406
|
+
|
|
407
|
+
actions: {
|
|
408
|
+
/**
|
|
409
|
+
* Called when the expand button is clicked on any row
|
|
410
|
+
* @param {DS.Model} item Model clicked
|
|
411
|
+
*/
|
|
412
|
+
toggleExpanded(item) {
|
|
413
|
+
item.toggleProperty('expanded');
|
|
414
|
+
},
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Called whenever an item is moved to reorders items based on their index in the array
|
|
418
|
+
* @param {DS.Model[]} items The items to reorder
|
|
419
|
+
*/
|
|
420
|
+
reorderItems(items) {
|
|
421
|
+
this.reorderItems(items);
|
|
422
|
+
},
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* Called when the delete button is pressed to redirect that call to the passed in action
|
|
426
|
+
* @param {Model} item Model to delete
|
|
427
|
+
*/
|
|
428
|
+
deleteItem(item) {
|
|
429
|
+
this.delete(item);
|
|
430
|
+
this.reorderItems(this.sortedItems);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
});
|
|
434
|
+
|
|
435
|
+
TableResort.reopenClass({
|
|
436
|
+
positionalParams: ['items']
|
|
437
|
+
});
|
|
438
|
+
|
|
439
|
+
export default TableResort;
|
|
440
|
+
|
|
441
|
+
</pre>
|
|
442
|
+
</div>
|
|
443
|
+
</div>
|
|
444
|
+
</div>
|
|
445
|
+
</div>
|
|
446
|
+
</div>
|
|
447
|
+
</div>
|
|
448
|
+
</div>
|
|
449
|
+
<script src="../assets/vendor/prettify/prettify-min.js"></script>
|
|
450
|
+
<script>prettyPrint();</script>
|
|
451
|
+
<script src="../assets/vendor/jquery/jquery.min.js"></script>
|
|
452
|
+
<script src="../assets/vendor/jquery-ui/jquery-ui.min.js"></script>
|
|
453
|
+
<script src="../assets/vendor/bootstrap/js/bootstrap.js"></script>
|
|
454
|
+
<script src="../assets/vendor/github-slugger/slugger.js"></script>
|
|
455
|
+
<script src="../assets/js/yuidoc-bootstrap.js"></script>
|
|
456
|
+
</body>
|
|
457
|
+
</html>
|