diff --git a/dist/pivot.css b/dist/pivot.css
index 4df17e82..dc2da7dd 100644
--- a/dist/pivot.css
+++ b/dist/pivot.css
@@ -1,6 +1,5 @@
.pvtUi { color: #333; }
-
table.pvtTable {
font-size: 8pt;
text-align: left;
@@ -112,3 +111,146 @@ table.pvtTable tbody tr td {
.pvtCheckContainer p{ margin: 5px; }
.pvtRendererArea { padding: 5px;}
+
+.pvtUI2
+{
+ display: grid;
+ grid-template-columns: [rowGroups] auto [reportArea] auto [nargin ] 1fr [end];
+ grid-template-rows: 34px 34px auto;
+}
+
+.pvtUI2 > div:first-child
+{
+ grid-column: 1;
+ grid-row: 1;
+ margin-top: 4px;
+
+}
+.pvtUI2 > div:nth-child(2)
+{
+ grid-column: 2;
+ grid-row: 1;
+ margin-top: 4px;
+}
+.pvtUI2 > div:nth-child(3)
+{
+ grid-column: 1;
+ grid-row: 2;
+ margin-top: 4px;
+}
+.pvtUI2 > div:nth-child(4)
+{
+ grid-column: 2;
+ grid-row: 2;
+ margin-top: 4px;
+}
+.pvtUI2 > div:nth-child(5)
+{
+ grid-column: 1;
+ grid-row: 5;
+ margin-top: 4px;
+}
+.pvtUI2 > div:nth-child(6)
+{
+ grid-column: 2;
+ grid-row: 5;
+ margin-top: 4px;
+}
+
+.pvtUI2 > .pvtVals
+{
+ text-align: left;
+}
+
+.pvtUI2 > div:first-child
+{
+ margin-top: 8px;
+}
+
+.pvtUI2 > .pvtRendererArea
+{
+ overflow: auto;
+}
+
+@media handheld, only screen and (max-width: 800px)
+{
+ .pvtUIResponsive
+ {
+ display: grid;
+ grid-template-columns: auto [margin ] 1fr [end];
+ }
+
+ .pvtUIResponsive > div:first-child,
+ .pvtUIResponsive > .pvtUnused,
+ .pvtUIResponsive > .pvtVals,
+ .pvtUIResponsive > .pvtCols,
+ .pvtUIResponsive > .pvtRows,
+ .pvtUIResponsive > .pvtRendererArea
+ {
+ grid-column: 1;
+ margin-top: 4px;
+ }
+
+}
+
+@media only screen and (min-width: 801px)
+{
+ .pvtUIResponsive
+ {
+ display: grid;
+ grid-template-columns: [left] auto [reportArea] auto [margin ] 1fr [end];
+ grid-template-rows: [rendererControl] 34px [columnGroups] 34px [reportArea] auto [end];
+ }
+
+ .pvtUIResponsive > div:first-child
+ {
+ grid-column: 1;
+ grid-row: 1;
+ margin-top: 4px;
+ }
+
+ .pvtUIResponsive > .pvtUnused
+ {
+ grid-column: 2;
+ grid-row: 1;
+ margin-top: 4px;
+ }
+
+ .pvtUIResponsive > .pvtVals
+ {
+ grid-column: 1;
+ grid-row: 2;
+ margin-top: 4px;
+ }
+
+ .pvtUIResponsive > .pvtCols
+ {
+ grid-column: 2;
+ grid-row: 2;
+ margin-top: 4px;
+ }
+
+ .pvtUIResponsive > .pvtRows
+ {
+ grid-column: 1;
+ grid-row: 5;
+ margin-top: 4px;
+ }
+
+ .pvtUIResponsive > .pvtRendererArea
+ {
+ grid-column: 2;
+ grid-row: 5;
+ margin-top: 4px;
+ }
+
+}
+
+.pvtUIResponsive .pvtVals
+{
+ text-align: left;
+}
+
+.pvtUIResponsive .pvtRendererArea {
+ overflow: auto;
+}
diff --git a/package.json b/package.json
index c32985bd..226808fe 100644
--- a/package.json
+++ b/package.json
@@ -39,12 +39,13 @@
"gulp": "^3.8.10",
"run-sequence": "^1.0.2",
"gulp-tag-version": "^1.2.1",
- "gulp-git": "^0.5.5",
+ "gulp-git": "^2.8.0",
"gulp-bump": "^0.1.11",
"gulp-filter": "^1.0.2",
"gulp-util": "^3.0.1",
"gulp-rename": "^1.2.0",
"gulp-minify-css": "^0.3.11",
- "gulp-concat": "^2.4.2"
+ "gulp-concat": "^2.4.2",
+ "natives": "^1.1.6"
}
}
diff --git a/src/pivot.coffee b/src/pivot.coffee
index 45c28261..86df1a25 100644
--- a/src/pivot.coffee
+++ b/src/pivot.coffee
@@ -652,7 +652,11 @@ callWithJQuery ($) ->
###
- Pivot Table UI: calls Pivot Table core above with options set by user
+ Pivot Table UI: calls Pivot Table core above with options set by user.
+ Set the 'tag' option to 'table' (the default) to have the layout HTML
+ use the
and related tags. Use a value of 'div' to hve the layout
+ HTML use a series of tags for the renderer, page fields, aggregator,
+ columns, rows and report areas.
###
$.fn.pivotUI = (input, inputOpts, overwrite = false, locale="en") ->
@@ -676,6 +680,8 @@ callWithJQuery ($) ->
showUI: true
filter: -> true
sorters: {}
+ tag: 'table'
+ responsive: false
localeStrings = $.extend(true, {}, locales.en.localeStrings, locales[locale].localeStrings)
localeDefaults =
@@ -709,21 +715,31 @@ callWithJQuery ($) ->
recordsProcessed++
#start building the output
- uiTable = $("
", "class": "pvtUi").attr("cellpadding", 5)
+ if opts.tag == 'div'
+ uiTable = $("", "class": "pvtUi")
+ if opts.responsive
+ uiTable.addClass('pvtUIResponsive')
+ else
+ uiTable.addClass('pvtUI2');
+ else
+ uiTable = $("
", "class": "pvtUi").attr("cellpadding", 5)
#renderer control
- rendererControl = $("").addClass("pvtUiCell")
+ rendererControl = $(if opts.tag == 'div' then "" else " ").addClass("pvtUiCell")
+ if ( opts.responsive )
+ rendererControl.addClass('pvtAxisContainer');
renderer = $(" | |