@openui5/sap.ui.documentation 1.125.0 → 1.126.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.
Files changed (43) hide show
  1. package/.reuse/dep5 +4 -4
  2. package/THIRDPARTY.txt +6 -6
  3. package/package.json +7 -7
  4. package/src/sap/ui/documentation/.library +7 -7
  5. package/src/sap/ui/documentation/library.js +2 -2
  6. package/src/sap/ui/documentation/messagebundle_ar.properties +2 -2
  7. package/src/sap/ui/documentation/sdk/Component.js +18 -14
  8. package/src/sap/ui/documentation/sdk/blocks/IndexEntry.js +1 -4
  9. package/src/sap/ui/documentation/sdk/blocks/IndexEntry.view.xml +1 -1
  10. package/src/sap/ui/documentation/sdk/blocks/IndexEntryController.controller.js +15 -0
  11. package/src/sap/ui/documentation/sdk/controller/ApiDetailIndexDeprecatedExperimental.controller.js +7 -6
  12. package/src/sap/ui/documentation/sdk/controller/ApiMaster.controller.js +17 -9
  13. package/src/sap/ui/documentation/sdk/controller/App.controller.js +1 -0
  14. package/src/sap/ui/documentation/sdk/controller/MasterTreeBaseController.js +1 -3
  15. package/src/sap/ui/documentation/sdk/controller/TopicDetail.controller.js +16 -12
  16. package/src/sap/ui/documentation/sdk/controller/config/datatable.js +1 -3
  17. package/src/sap/ui/documentation/sdk/controller/util/XML2JSONUtils.js +1 -1
  18. package/src/sap/ui/documentation/sdk/css/style.css +4 -0
  19. package/src/sap/ui/documentation/sdk/manifest.json +1 -1
  20. package/src/sap/ui/documentation/sdk/thirdparty/DataTables/Buttons-3.0.0/css/buttons.dataTables.css +559 -0
  21. package/src/sap/ui/documentation/sdk/thirdparty/DataTables/Buttons-3.0.0/css/buttons.jqueryui.css +414 -0
  22. package/src/sap/ui/documentation/sdk/thirdparty/DataTables/Buttons-3.0.0/js/buttons.colVis.js +261 -0
  23. package/src/sap/ui/documentation/sdk/thirdparty/DataTables/Buttons-3.0.0/js/buttons.html5.js +1687 -0
  24. package/src/sap/ui/documentation/sdk/thirdparty/DataTables/Buttons-3.0.0/js/buttons.jqueryui.js +98 -0
  25. package/src/sap/ui/documentation/sdk/thirdparty/DataTables/Buttons-3.0.0/js/dataTables.buttons.js +2750 -0
  26. package/src/sap/ui/documentation/sdk/thirdparty/DataTables/DataTables-2.0.1/css/dataTables.jqueryui.css +1636 -0
  27. package/src/sap/ui/documentation/sdk/thirdparty/DataTables/DataTables-2.0.1/js/dataTables.jqueryui.js +106 -0
  28. package/src/sap/ui/documentation/sdk/thirdparty/DataTables/DataTables-2.0.1/js/dataTables.js +13429 -0
  29. package/src/sap/ui/documentation/sdk/thirdparty/highlight.js/highlight.js +3 -3
  30. package/src/sap/ui/documentation/sdk/view/ControlsMaster.view.xml +1 -1
  31. package/src/sap/ui/documentation/sdk/view/Footer.fragment.xml +11 -3
  32. package/src/sap/ui/documentation/themes/base/Documentation.less +36 -4
  33. package/src/sap/ui/documentation/themes/sap_belize/library.source.less +7 -7
  34. package/src/sap/ui/documentation/themes/sap_belize_hcb/library.source.less +7 -7
  35. package/src/sap/ui/documentation/themes/sap_belize_hcw/library.source.less +7 -7
  36. package/src/sap/ui/documentation/sdk/thirdparty/DataTables/Buttons-1.4.0/css/buttons.jqueryui.css +0 -218
  37. package/src/sap/ui/documentation/sdk/thirdparty/DataTables/Buttons-1.4.0/js/buttons.colVis.js +0 -206
  38. package/src/sap/ui/documentation/sdk/thirdparty/DataTables/Buttons-1.4.0/js/buttons.html5.js +0 -1385
  39. package/src/sap/ui/documentation/sdk/thirdparty/DataTables/Buttons-1.4.0/js/buttons.jqueryui.js +0 -62
  40. package/src/sap/ui/documentation/sdk/thirdparty/DataTables/Buttons-1.4.0/js/dataTables.buttons.js +0 -1804
  41. package/src/sap/ui/documentation/sdk/thirdparty/DataTables/DataTables-1.10.15/css/dataTables.jqueryui.css +0 -482
  42. package/src/sap/ui/documentation/sdk/thirdparty/DataTables/DataTables-1.10.15/js/dataTables.jqueryui.js +0 -164
  43. package/src/sap/ui/documentation/sdk/thirdparty/DataTables/DataTables-1.10.15/js/jquery.dataTables.js +0 -15002
@@ -998,10 +998,10 @@ var hljs = (function () {
998
998
  * @param {string} message
999
999
  */
1000
1000
  const deprecated = (version, message) => {
1001
- if (seenDeprecations[`1.125.0/${message}`]) return;
1001
+ if (seenDeprecations[`1.126.0/${message}`]) return;
1002
1002
 
1003
- console.log(`Deprecated as of 1.125.0. ${message}`);
1004
- seenDeprecations[`1.125.0/${message}`] = true;
1003
+ console.log(`Deprecated as of 1.126.0. ${message}`);
1004
+ seenDeprecations[`1.126.0/${message}`] = true;
1005
1005
  };
1006
1006
 
1007
1007
  /* eslint-disable no-throw-literal */
@@ -22,7 +22,7 @@
22
22
 
23
23
  <!-- Navigation List -->
24
24
  <content>
25
- <l:FixFlex fixFirst="false">
25
+ <l:FixFlex id="treeContainer" fixFirst="false" minFlexSize="100">
26
26
  <l:flexContent>
27
27
  <List id="exploredMasterList"
28
28
  mode="{viewModel>/listMode}"
@@ -20,27 +20,35 @@
20
20
  class="sapUiTinyMarginTop">
21
21
  <items>
22
22
  <Link
23
- class="sapUiLargeMarginEnd sapUiTinyMarginBottom"
23
+ class="sapUiLargeMarginEnd sapUiTinyMarginBottom sapUiDocumentationFooterLink"
24
+ visible="{appView>/bCNICPShow}"
25
+ text="ICP 粤B2-20040246-26"
26
+ href="https://beian.miit.gov.cn/"
27
+ target="_blank" />
28
+ <Link
29
+ class="sapUiLargeMarginEnd sapUiTinyMarginBottom sapUiDocumentationFooterLink"
24
30
  text="{i18n>FOOTER_LEGAL_DISCOLURE}"
25
31
  href="https://www.sap.com/corporate/en/legal/impressum.html"
26
32
  target="_blank"/>
27
33
  <Link
28
- class="sapUiLargeMarginEnd sapUiTinyMarginBottom"
34
+ class="sapUiLargeMarginEnd sapUiTinyMarginBottom sapUiDocumentationFooterLink"
29
35
  text="{i18n>FOOTER_PRIVACY}"
30
36
  href="https://www.sap.com/corporate/en/legal/privacy.html"
31
37
  target="_blank"/>
32
38
  <Link
39
+ class="sapUiDocumentationFooterLink"
33
40
  text="{i18n>FOOTER_TERMS}"
34
41
  href="https://www.sap.com/corporate/en/legal/terms-of-use.html"
35
42
  visible="{= !${versionData>/isOpenUI5} &amp;&amp; !${versionData>/isDevEnv} }"
36
43
  target="_blank"/>
37
44
  <Link
38
- class="sapUiTinyMarginBottom sapUiLargeMarginEnd"
45
+ class="sapUiTinyMarginBottom sapUiLargeMarginEnd sapUiDocumentationFooterLink"
39
46
  text="{i18n>FOOTER_LICENSE}"
40
47
  href="LICENSE.txt"
41
48
  visible="{versionData>/isOpenUI5}"
42
49
  target="_blank"/>
43
50
  <Link
51
+ class="sapUiDocumentationFooterLink"
44
52
  text="{i18n>FOOTER_TERMS}"
45
53
  href="TermsOfUse.txt"
46
54
  visible="{versionData>/isOpenUI5}"
@@ -748,7 +748,7 @@ html.sap-tablet:not(.sap-desktop) {
748
748
  color: @sapBrandColor;
749
749
  }
750
750
 
751
- .dataTables_wrapper {
751
+ .dt-container {
752
752
  .sapUiDocumentationDatatableFilterWrapper {
753
753
  padding: 0.3rem;
754
754
  }
@@ -760,9 +760,10 @@ html.sap-tablet:not(.sap-desktop) {
760
760
  background: transparent;
761
761
  }
762
762
  .dt-buttons {
763
- height: 30px;
764
763
  .dt-button {
765
- height: 100%;
764
+ margin-bottom: 0;
765
+ color: @sapUiBaseText;
766
+ //background-color: @sapUiBaseBG;
766
767
  }
767
768
  }
768
769
  .pagingWrapper {
@@ -782,7 +783,7 @@ html.sap-tablet:not(.sap-desktop) {
782
783
 
783
784
  .dataTables_length {
784
785
  margin-left: 0.5rem;
785
- margin-top: 0.5rem;
786
+ margin-top: 0.25rem;
786
787
  }
787
788
 
788
789
  .datatable {
@@ -804,6 +805,37 @@ html.sap-tablet:not(.sap-desktop) {
804
805
  }
805
806
  }
806
807
  }
808
+ div.dt-button-collection,
809
+ .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default {
810
+
811
+ background: @sapUiBaseBG;
812
+ color: @sapUiBaseText;
813
+ border-color: darken(@sapUiListTableGroupHeaderBorderColor, 10);
814
+ }
815
+
816
+ table.dataTable thead > tr > th.dt-orderable-asc span.dt-column-order:before,
817
+ table.dataTable thead > tr > th.dt-orderable-asc span.dt-column-order:after,
818
+ table.dataTable thead > tr > th.dt-orderable-desc span.dt-column-order:before,
819
+ table.dataTable thead > tr > th.dt-orderable-desc span.dt-column-order:after,
820
+ table.dataTable thead > tr > th.dt-ordering-asc span.dt-column-order:before,
821
+ table.dataTable thead > tr > th.dt-ordering-asc span.dt-column-order:after,
822
+ table.dataTable thead > tr > th.dt-ordering-desc span.dt-column-order:before,
823
+ table.dataTable thead > tr > th.dt-ordering-desc span.dt-column-order:after,
824
+ table.dataTable thead > tr > td.dt-orderable-asc span.dt-column-order:before,
825
+ table.dataTable thead > tr > td.dt-orderable-asc span.dt-column-order:after,
826
+ table.dataTable thead > tr > td.dt-orderable-desc span.dt-column-order:before,
827
+ table.dataTable thead > tr > td.dt-orderable-desc span.dt-column-order:after,
828
+ table.dataTable thead > tr > td.dt-ordering-asc span.dt-column-order:before,
829
+ table.dataTable thead > tr > td.dt-ordering-asc span.dt-column-order:after,
830
+ table.dataTable thead > tr > td.dt-ordering-desc span.dt-column-order:before,
831
+ table.dataTable thead > tr > td.dt-ordering-desc span.dt-column-order:after {
832
+ opacity: 0.3;
833
+ }
834
+
835
+ }
836
+
837
+ .line-through {
838
+ text-decoration: line-through;
807
839
  }
808
840
 
809
841
  html.sapUiMedia-Std-Desktop {
@@ -4,13 +4,13 @@
4
4
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
5
  */
6
6
 
7
- /***********************************************************************************
8
- /* Due to deprecation of the Belize theme family with SAPUI5 version 1.120 the
9
- /* inheritance of the base theme is now updated to an inheritance of a static
10
- /* copy of the base theme named sap_belize_base. The respective
11
- /* control css files of base are copied to the sap_belize_base theme folder.
12
- /* This decoupling of the base theme is introduced with SAPUI5 version 1.125.
13
- ***********************************************************************************/
7
+ /* ============================================================================ */
8
+ /* Due to deprecation of the Belize theme family with SAPUI5 version 1.120 the */
9
+ /* inheritance of the base theme is now updated to an inheritance of a static */
10
+ /* copy of the base theme named sap_belize_base. The respective */
11
+ /* control css files of base are copied to the sap_belize_base theme folder. */
12
+ /* This decoupling of the base theme is introduced with SAPUI5 version 1.125. */
13
+ /* ============================================================================ */
14
14
 
15
15
 
16
16
  @import "../sap_belize_base/library.source.less";
@@ -4,13 +4,13 @@
4
4
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
5
  */
6
6
 
7
- /***********************************************************************************
8
- /* Due to deprecation of the Belize theme family with SAPUI5 version 1.120 the
9
- /* inheritance of the base theme is now updated to an inheritance of a static
10
- /* copy of the base theme named sap_belize_base. The respective
11
- /* control css files of base are copied to the sap_belize_base theme folder.
12
- /* This decoupling of the base theme is introduced with SAPUI5 version 1.125.
13
- ***********************************************************************************/
7
+ /* ============================================================================ */
8
+ /* Due to deprecation of the Belize theme family with SAPUI5 version 1.120 the */
9
+ /* inheritance of the base theme is now updated to an inheritance of a static */
10
+ /* copy of the base theme named sap_belize_base. The respective */
11
+ /* control css files of base are copied to the sap_belize_base theme folder. */
12
+ /* This decoupling of the base theme is introduced with SAPUI5 version 1.125. */
13
+ /* ============================================================================ */
14
14
 
15
15
 
16
16
  @import "../sap_belize_base/library.source.less";
@@ -4,13 +4,13 @@
4
4
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
5
  */
6
6
 
7
- /***********************************************************************************
8
- /* Due to deprecation of the Belize theme family with SAPUI5 version 1.120 the
9
- /* inheritance of the base theme is now updated to an inheritance of a static
10
- /* copy of the base theme named sap_belize_base. The respective
11
- /* control css files of base are copied to the sap_belize_base theme folder.
12
- /* This decoupling of the base theme is introduced with SAPUI5 version 1.125.
13
- ***********************************************************************************/
7
+ /* ============================================================================ */
8
+ /* Due to deprecation of the Belize theme family with SAPUI5 version 1.120 the */
9
+ /* inheritance of the base theme is now updated to an inheritance of a static */
10
+ /* copy of the base theme named sap_belize_base. The respective */
11
+ /* control css files of base are copied to the sap_belize_base theme folder. */
12
+ /* This decoupling of the base theme is introduced with SAPUI5 version 1.125. */
13
+ /* ============================================================================ */
14
14
 
15
15
 
16
16
  @import "../sap_belize_base/library.source.less";
@@ -1,218 +0,0 @@
1
- @keyframes dtb-spinner {
2
- 100% {
3
- transform: rotate(360deg);
4
- }
5
- }
6
- @-o-keyframes dtb-spinner {
7
- 100% {
8
- -o-transform: rotate(360deg);
9
- transform: rotate(360deg);
10
- }
11
- }
12
- @-ms-keyframes dtb-spinner {
13
- 100% {
14
- -ms-transform: rotate(360deg);
15
- transform: rotate(360deg);
16
- }
17
- }
18
- @-webkit-keyframes dtb-spinner {
19
- 100% {
20
- -webkit-transform: rotate(360deg);
21
- transform: rotate(360deg);
22
- }
23
- }
24
- @-moz-keyframes dtb-spinner {
25
- 100% {
26
- -moz-transform: rotate(360deg);
27
- transform: rotate(360deg);
28
- }
29
- }
30
- div.dt-button-info {
31
- position: fixed;
32
- top: 50%;
33
- left: 50%;
34
- width: 400px;
35
- margin-top: -100px;
36
- margin-left: -200px;
37
- background-color: white;
38
- border: 2px solid #111;
39
- box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.3);
40
- border-radius: 3px;
41
- text-align: center;
42
- z-index: 21;
43
- }
44
- div.dt-button-info h2 {
45
- padding: 0.5em;
46
- margin: 0;
47
- font-weight: normal;
48
- border-bottom: 1px solid #ddd;
49
- background-color: #f3f3f3;
50
- }
51
- div.dt-button-info > div {
52
- padding: 1em;
53
- }
54
-
55
- div.dt-buttons {
56
- position: relative;
57
- float: left;
58
- }
59
- div.dt-buttons .dt-button {
60
- margin-right: 0;
61
- }
62
- div.dt-buttons .dt-button span.ui-icon {
63
- display: inline-block;
64
- vertical-align: middle;
65
- margin-top: -2px;
66
- }
67
- div.dt-buttons .dt-button:active {
68
- outline: none;
69
- }
70
- div.dt-buttons .dt-button:hover > span {
71
- background-color: rgba(0, 0, 0, 0.05);
72
- }
73
-
74
- div.dt-button-collection {
75
- position: absolute;
76
- top: 0;
77
- left: 0;
78
- width: 150px;
79
- margin-top: 3px;
80
- padding: 8px 8px 4px 8px;
81
- border: 1px solid #ccc;
82
- border: 1px solid rgba(0, 0, 0, 0.4);
83
- background-color: #f3f3f3;
84
- background-color: rgba(255, 255, 255, 0.3);
85
- overflow: hidden;
86
- z-index: 2002;
87
- border-radius: 5px;
88
- box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.3);
89
- z-index: 2002;
90
- -webkit-column-gap: 8px;
91
- -moz-column-gap: 8px;
92
- -ms-column-gap: 8px;
93
- -o-column-gap: 8px;
94
- column-gap: 8px;
95
- -webkit-column-gap: 0;
96
- -moz-column-gap: 0;
97
- -ms-column-gap: 0;
98
- -o-column-gap: 0;
99
- column-gap: 0;
100
- }
101
- div.dt-button-collection .dt-button {
102
- position: relative;
103
- left: 0;
104
- right: 0;
105
- display: block;
106
- float: none;
107
- margin-right: 0;
108
- }
109
- div.dt-button-collection .dt-button:last-child {
110
- margin-bottom: 4px;
111
- }
112
- div.dt-button-collection .dt-button:hover > span {
113
- background-color: rgba(0, 0, 0, 0.05);
114
- }
115
- div.dt-button-collection.fixed {
116
- position: fixed;
117
- top: 50%;
118
- left: 50%;
119
- margin-left: -75px;
120
- border-radius: 0;
121
- }
122
- div.dt-button-collection.fixed.two-column {
123
- margin-left: -150px;
124
- }
125
- div.dt-button-collection.fixed.three-column {
126
- margin-left: -225px;
127
- }
128
- div.dt-button-collection.fixed.four-column {
129
- margin-left: -300px;
130
- }
131
- div.dt-button-collection > * {
132
- -webkit-column-break-inside: avoid;
133
- break-inside: avoid;
134
- }
135
- div.dt-button-collection.two-column {
136
- width: 300px;
137
- padding-bottom: 1px;
138
- -webkit-column-count: 2;
139
- -moz-column-count: 2;
140
- -ms-column-count: 2;
141
- -o-column-count: 2;
142
- column-count: 2;
143
- }
144
- div.dt-button-collection.three-column {
145
- width: 450px;
146
- padding-bottom: 1px;
147
- -webkit-column-count: 3;
148
- -moz-column-count: 3;
149
- -ms-column-count: 3;
150
- -o-column-count: 3;
151
- column-count: 3;
152
- }
153
- div.dt-button-collection.four-column {
154
- width: 600px;
155
- padding-bottom: 1px;
156
- -webkit-column-count: 4;
157
- -moz-column-count: 4;
158
- -ms-column-count: 4;
159
- -o-column-count: 4;
160
- column-count: 4;
161
- }
162
-
163
- div.dt-button-background {
164
- position: fixed;
165
- top: 0;
166
- left: 0;
167
- width: 100%;
168
- height: 100%;
169
- background: rgba(0, 0, 0, 0.7);
170
- /* Fallback */
171
- background: -ms-radial-gradient(center, ellipse farthest-corner, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%);
172
- /* IE10 Consumer Preview */
173
- background: -moz-radial-gradient(center, ellipse farthest-corner, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%);
174
- /* Firefox */
175
- background: -o-radial-gradient(center, ellipse farthest-corner, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%);
176
- /* Opera */
177
- background: -webkit-gradient(radial, center center, 0, center center, 497, color-stop(0, rgba(0, 0, 0, 0.3)), color-stop(1, rgba(0, 0, 0, 0.7)));
178
- /* Webkit (Safari/Chrome 10) */
179
- background: -webkit-radial-gradient(center, ellipse farthest-corner, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%);
180
- /* Webkit (Chrome 11+) */
181
- background: radial-gradient(ellipse farthest-corner at center, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%);
182
- /* W3C Markup, IE10 Release Preview */
183
- z-index: 2001;
184
- }
185
-
186
- @media screen and (max-width: 640px) {
187
- div.dt-buttons {
188
- float: none !important;
189
- text-align: center;
190
- }
191
- }
192
- button.dt-button.processing,
193
- div.dt-button.processing,
194
- a.dt-button.processing {
195
- color: rgba(0, 0, 0, 0.2);
196
- }
197
- button.dt-button.processing:after,
198
- div.dt-button.processing:after,
199
- a.dt-button.processing:after {
200
- position: absolute;
201
- top: 50%;
202
- left: 50%;
203
- width: 16px;
204
- height: 16px;
205
- margin: -8px 0 0 -8px;
206
- box-sizing: border-box;
207
- display: block;
208
- content: ' ';
209
- border: 2px solid #282828;
210
- border-radius: 50%;
211
- border-left-color: transparent;
212
- border-right-color: transparent;
213
- animation: dtb-spinner 1500ms infinite linear;
214
- -o-animation: dtb-spinner 1500ms infinite linear;
215
- -ms-animation: dtb-spinner 1500ms infinite linear;
216
- -webkit-animation: dtb-spinner 1500ms infinite linear;
217
- -moz-animation: dtb-spinner 1500ms infinite linear;
218
- }
@@ -1,206 +0,0 @@
1
- /*!
2
- * Column visibility buttons for Buttons and DataTables.
3
- * 2016 SpryMedia Ltd - datatables.net/license
4
- */
5
-
6
- (function (factory) {
7
- if (typeof define === 'function' && define.amd) {
8
- // AMD
9
- define(['jquery', 'datatables.net', 'datatables.net-buttons'], function ($) {
10
- return factory($, window, document);
11
- });
12
- }
13
- else if (typeof exports === 'object') {
14
- // CommonJS
15
- module.exports = function (root, $) {
16
- if (!root) {
17
- root = window;
18
- }
19
-
20
- if (!$ || !$.fn.dataTable) {
21
- $ = require('datatables.net')(root, $).$;
22
- }
23
-
24
- if (!$.fn.dataTable.Buttons) {
25
- require('datatables.net-buttons')(root, $);
26
- }
27
-
28
- return factory($, root, root.document);
29
- };
30
- }
31
- else {
32
- // Browser
33
- factory(jQuery, window, document);
34
- }
35
- }(function ($, window, document, undefined) {
36
- 'use strict';
37
- var DataTable = $.fn.dataTable;
38
-
39
-
40
- $.extend(DataTable.ext.buttons, {
41
- // A collection of column visibility buttons
42
- colvis: function (dt, conf) {
43
- return {
44
- extend: 'collection',
45
- text: function (dt) {
46
- return dt.i18n('buttons.colvis', 'Column visibility');
47
- },
48
- className: 'buttons-colvis',
49
- buttons: [{
50
- extend: 'columnsToggle',
51
- columns: conf.columns,
52
- columnText: conf.columnText
53
- }]
54
- };
55
- },
56
-
57
- // Selected columns with individual buttons - toggle column visibility
58
- columnsToggle: function (dt, conf) {
59
- var columns = dt.columns(conf.columns).indexes().map(function (idx) {
60
- return {
61
- extend: 'columnToggle',
62
- columns: idx,
63
- columnText: conf.columnText
64
- };
65
- }).toArray();
66
-
67
- return columns;
68
- },
69
-
70
- // Single button to toggle column visibility
71
- columnToggle: function (dt, conf) {
72
- return {
73
- extend: 'columnVisibility',
74
- columns: conf.columns,
75
- columnText: conf.columnText
76
- };
77
- },
78
-
79
- // Selected columns with individual buttons - set column visibility
80
- columnsVisibility: function (dt, conf) {
81
- var columns = dt.columns(conf.columns).indexes().map(function (idx) {
82
- return {
83
- extend: 'columnVisibility',
84
- columns: idx,
85
- visibility: conf.visibility,
86
- columnText: conf.columnText
87
- };
88
- }).toArray();
89
-
90
- return columns;
91
- },
92
-
93
- // Single button to set column visibility
94
- columnVisibility: {
95
- columns: undefined, // column selector
96
- text: function (dt, button, conf) {
97
- return conf._columnText(dt, conf);
98
- },
99
- className: 'buttons-columnVisibility',
100
- action: function (e, dt, button, conf) {
101
- var col = dt.columns(conf.columns);
102
- var curr = col.visible();
103
-
104
- col.visible(conf.visibility !== undefined ?
105
- conf.visibility :
106
- !(curr.length ? curr[0] : false)
107
- );
108
- },
109
- init: function (dt, button, conf) {
110
- var that = this;
111
-
112
- dt
113
- .on('column-visibility.dt' + conf.namespace, function (e, settings) {
114
- if (!settings.bDestroying && settings.nTable == dt.settings()[0].nTable) {
115
- that.active(dt.column(conf.columns).visible());
116
- }
117
- })
118
- .on('column-reorder.dt' + conf.namespace, function (e, settings, details) {
119
- // Don't rename buttons based on column name if the button
120
- // controls more than one column!
121
- if (dt.columns(conf.columns).count() !== 1) {
122
- return;
123
- }
124
-
125
- if (typeof conf.columns === 'number') {
126
- conf.columns = details.mapping[conf.columns];
127
- }
128
-
129
- var col = dt.column(conf.columns);
130
-
131
- that.text(conf._columnText(dt, conf));
132
- that.active(col.visible());
133
- });
134
-
135
- this.active(dt.column(conf.columns).visible());
136
- },
137
- destroy: function (dt, button, conf) {
138
- dt
139
- .off('column-visibility.dt' + conf.namespace)
140
- .off('column-reorder.dt' + conf.namespace);
141
- },
142
-
143
- _columnText: function (dt, conf) {
144
- // Use DataTables' internal data structure until this is presented
145
- // is a public API. The other option is to use
146
- // `$( column(col).node() ).text()` but the node might not have been
147
- // populated when Buttons is constructed.
148
- var idx = dt.column(conf.columns).index();
149
- var title = dt.settings()[0].aoColumns[idx].sTitle
150
- .replace(/\n/g, " ") // remove new lines
151
- .replace(/<.*?>/g, "") // strip HTML
152
- .replace(/^\s+|\s+$/g, ""); // trim
153
-
154
- return conf.columnText ?
155
- conf.columnText(dt, idx, title) :
156
- title;
157
- }
158
- },
159
-
160
-
161
- colvisRestore: {
162
- className: 'buttons-colvisRestore',
163
-
164
- text: function (dt) {
165
- return dt.i18n('buttons.colvisRestore', 'Restore visibility');
166
- },
167
-
168
- init: function (dt, button, conf) {
169
- conf._visOriginal = dt.columns().indexes().map(function (idx) {
170
- return dt.column(idx).visible();
171
- }).toArray();
172
- },
173
-
174
- action: function (e, dt, button, conf) {
175
- dt.columns().every(function (i) {
176
- // Take into account that ColReorder might have disrupted our
177
- // indexes
178
- var idx = dt.colReorder && dt.colReorder.transpose ?
179
- dt.colReorder.transpose(i, 'toOriginal') :
180
- i;
181
-
182
- this.visible(conf._visOriginal[idx]);
183
- });
184
- }
185
- },
186
-
187
-
188
- colvisGroup: {
189
- className: 'buttons-colvisGroup',
190
-
191
- action: function (e, dt, button, conf) {
192
- dt.columns(conf.show).visible(true, false);
193
- dt.columns(conf.hide).visible(false, false);
194
-
195
- dt.columns.adjust();
196
- },
197
-
198
- show: [],
199
-
200
- hide: []
201
- }
202
- });
203
-
204
-
205
- return DataTable.Buttons;
206
- }));