@hpcc-js/dgrid
Advanced tools
Comparing version 3.1.0 to 3.2.0
@@ -1,496 +0,500 @@ | ||
var F=Object.defineProperty;var d=(n,t)=>F(n,"name",{value:t,configurable:!0});var E="@hpcc-js/dgrid",Y="3.1.0",L="3.2.0";import{HTMLWidget as z}from"@hpcc-js/common";globalThis["@hpcc-js/dgrid-shim"]||console.error('dgrid-shim not loaded, please add `<script src="https://cdn.jsdelivr.net/npm/@hpcc-js/dgrid-shim@2.26.0/dist/index.min.js"><\/script>` or similar to your HTML file');var u=globalThis["@hpcc-js/dgrid-shim"].Deferred,x=globalThis["@hpcc-js/dgrid-shim"].Memory,_=globalThis["@hpcc-js/dgrid-shim"].QueryResults,I=globalThis["@hpcc-js/dgrid-shim"].Grid,v=globalThis["@hpcc-js/dgrid-shim"].PagingGrid,j=globalThis["@hpcc-js/dgrid-shim"].domConstruct;function B(n){return String(n).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}d(B,"entitiesEncode");function Q(n){switch(Object.prototype.toString.call(n)){case"[object Undefined]":case"[object Boolean]":case"[object Number]":return n;case"[object String]":return B(n);default:console.warn("Unknown cell type: "+Object.prototype.toString.call(n))}return n}d(Q,"safeEncode");var M="<br><hr class='dgrid-fakeline'>",H="<br><hr class='dgrid-fakeline' style='visibility: hidden'>",c=class{constructor(t,e){this._renderHtml=e;this._columns=t,this.flattenColumns(t)}static{d(this,"RowFormatter")}_columns;_flattenedColumns=[];_columnIdx={};_formattedRow={};flattenColumns(t){for(let e of t)this.flattenColumn(e)}flattenColumn(t){if(t.children)for(let e of t.children)this.flattenColumn(e);else this._columnIdx[t.field]=this._flattenedColumns.length,this._flattenedColumns.push(t.field)}format(t){return this._formattedRow={},this.formatRow(this._columns,t),this.row()}calcDepth(t,e){let r=1;for(let o of t)if(o.children&&e[o.leafID]){let i=0;for(let s of e[o.leafID])s instanceof Array,i+=this.calcDepth(o.children,s);r=Math.max(r,i)}return r}formatCell(t,e,r){if(t.children){let o=0;e instanceof Array||(e instanceof Object&&e.Row instanceof Array?e=e.Row:e=[e]);for(let i of e)o=Math.max(o,this.formatRow(t.children,i))}else if(t.isSet&&(e=JSON.stringify(e.Item)),this._formattedRow[t.field]===void 0?this._formattedRow[t.field]=""+e===void 0?"":this._renderHtml?e:Q(e):(this._formattedRow[t.field]+=M,this._formattedRow[t.field]+=""+e===void 0?"":this._renderHtml?e:Q(e)),r>1){let o=[];o.length=r;let i=o.join(H);this._formattedRow[t.field]+=i}}formatRow(t,e=[],r=0){let o=this.calcDepth(t,e);for(let i of t)this.formatCell(i,e[i.leafID],o);return o}row(){let t={};for(let e of this._flattenedColumns)t[e]=this._formattedRow[e];return t}};var f=class{static{d(this,"DBStore")}_db;Model;idProperty;constructor(t){this._db=t}_renderHtml=!0;renderHtml(t){this._renderHtml=t}db2Columns(t,e,r="",o,i){return e?e.map((s,a)=>{let p={label:s.label(),leafID:""+a,field:r+a,idx:a,className:"resultGridCell",sortable:t,isSet:!1};switch(s.type()){case"nested":p.children=this.db2Columns(!1,s.children(),r+a+"_",o),p.sortable=!1;break;default:p.formatter=o,p.renderCell=i}return p}):[]}columns(t,e,r){return this.db2Columns(t,this._db.fields(),"",e,r)}getIdentity(t){return t.__hpcc_id}get(t){return this._db.row(t+1)}_fetchRange(t){let e=new c(this.columns(!1),this._renderHtml);return this._db.data().slice(t.start,t.end).map((r,o)=>({...e.format(r),__hpcc_id:t.start+o,__origRow:r}))}fetchRange(t){let e=this._fetchRange(t),r=new u;return r.totalLength=new u,r.resolve(e),r.totalLength.resolve(this._db.length()-1),r}sort(t){return this._db.data().sort((e,r)=>{for(let o of t){let i=o.property;if(e[i]===void 0&&r[i]!==void 0||e[i]<r[i])return o.descending?1:-1;if(e[i]!==void 0&&r[i]===void 0||e[i]>r[i])return o.descending?-1:1}return 0}),this}};(function(){if(!document.getElementById("f79652bc")){var n=document.createElement("style");n.id="f79652bc",n.textContent=`\uFEFF | ||
.dijitTooltip { | ||
position: absolute; | ||
z-index: 2000; | ||
display: block; | ||
left: 0; | ||
top: -10000px; | ||
overflow: visible; | ||
font-family: Verdana, Geneva, sans-serif; | ||
font-size: 12px; | ||
(function(){"use strict";try{if(typeof document<"u"){var i=document.createElement("style");i.appendChild(document.createTextNode(".dijitTooltip{position:absolute;z-index:2000;display:block;left:0;top:-10000px;overflow:visible;font-family:Verdana,Geneva,sans-serif;font-size:12px}.dijitTooltipContainer{border:solid black 2px;background:#b8b5b5;color:#000;font-size:small}.dijitTooltipFocusNode{padding:2px}.dijitTooltipConnector{position:absolute}.dj_a11y .dijitTooltipConnector,.dijitTooltipData{display:none}.dijitTooltip{background:transparent}.dijitTooltipContainer{background-color:#424242;opacity:1;-ms-filter:none;filter:none;padding:4px 8px;border-radius:3px}.dijitTooltip .dijitTooltipContainer{color:#fff;border:0 none}.dijitTooltipConnector{z-index:2;width:auto;height:auto;opacity:1;-ms-filter:none;filter:none}.dijitTooltipABRight .dijitTooltipConnector{left:auto!important;right:8px}.dijitTooltipBelow{padding-top:4px}.dijitTooltipBelow .dijitTooltipConnector{top:0;left:8px;border-bottom:4px solid #424242;border-left:4px solid transparent;border-right:4px solid transparent;border-top:0}.dijitTooltipAbove{padding-bottom:4px}.dijitTooltipAbove .dijitTooltipConnector{bottom:0;left:8px;border-top:4px solid #424242;border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:0}.dijitTooltipLeft{padding-right:4px}.dijitTooltipLeft .dijitTooltipConnector{right:0;border-left:4px solid #424242;border-bottom:4px solid transparent;border-top:4px solid transparent;border-right:0}.dijitTooltipRight{padding-left:4px}.dijitTooltipRight .dijitTooltipConnector{left:0;border-bottom:4px solid transparent;border-top:4px solid transparent;border-right:4px solid #424242}.dgrid{position:relative;overflow:hidden;border:1px solid #ddd;height:30em;display:block}.dgrid-header{background-color:#eee}.dgrid-header-row{position:absolute;right:17px;left:0}.dgrid-header-scroll{position:absolute;top:0;right:0}.dgrid-footer{position:absolute;bottom:0;width:100%}.dgrid-header-hidden{font-size:0;height:0!important;border-top:none!important;border-bottom:none!important;margin-top:0!important;margin-bottom:0!important;padding-top:0!important;padding-bottom:0!important}.dgrid-footer-hidden{display:none}.dgrid-sortable{cursor:pointer}.dgrid-header,.dgrid-header-row,.dgrid-footer{overflow:hidden;background-color:#eee}.dgrid-row-table{border-collapse:collapse;border:none;table-layout:fixed;empty-cells:show;width:100%;height:100%}.dgrid-cell{padding:3px;text-align:left;overflow:hidden;vertical-align:top;border:1px solid #ddd;border-top-style:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;text-overflow:ellipsis;white-space:nowrap}.dgrid-content{position:relative;height:99%}.dgrid-scroller{overflow-x:auto;overflow-y:scroll;position:absolute;top:0;margin-top:25px;bottom:0;width:100%}.dgrid-preload{font-size:0;line-height:0}.dgrid-loading{position:relative;height:100%}.dgrid-above{position:absolute;bottom:0}.ui-icon{width:12px;height:16px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAADwCAMAAADYSUr5AAAA7VBMVEUkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiTww4gUAAAATnRSTlMAGBAyBAhQv4OZLiJUcEBmYBoSzQwgPBZCSEoeWiYwUiyFNIeBw2rJz8c4RBy9uXyrtaWNqa2zKP2fJO8KBgKPo2KVoa9s351GPm5+kWho0kj9AAAPhUlEQVR4nO1djWLbthEGyUiq5YSSLXtp7FpLOmfzkmxr126tmi2p03RJ1/Xe/3EGg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E9wG7jgIyMjIyM+434c2R3HeV/Ffx6jtZu6ijl8h59T655jhR+rdHzDOP6beABCheb8O8/WFXeOyzgf5oAhVYnKxP7CwaAf1afJu8bSrhS6tdaXeGnrRenOqOlz9d6QwYnA/3TLd+GE7qe3chA5YF5DfY0vK3adfOX/gyNp2BW25MHdxAB9qvRiiP3/XpQQFGYDU4+Mi///XumXG8pjvaUAOsBGlf4jJt+YYEzeEzAdw06F19R3juM7D1wita86GR0CKfDHgLuXCc4Bri6vMLdfjMc4VNSUNsdodo2xu/1+Xl/K5+az8jIyMhYG/z5gJTMF1GtKq/a3rpyCvz5gJTMl9GtKq/a3rpyCmfQ4WwZmS+kXFVetb115ST48wEf/AGcfG1iw+tWbpbS2vJ3nQxcVr3lH3z5h972FUTLzYpOVk7l5hD+eYcYwDcAnewOotrZ4OtrPDucqi/LRX0/RR4qx7Nn4U8g+qjffvuN6Gf+nC85vwauHjaYyubqvWYKY4VEfSUMitdnBCT1Ue63R5439m+OgCn6DroAAaHPVQxKth/wkJgHmG8bmQMsT0D6EjDfvhVRKO3ywOQUgRA7nmL1uawZmHf1k+DPBwQ6NdcJ+k6Md1LA5f5ONdhJ8vZ5J0vLHT99srkGOjmJbd/G1r2Nriqnse1AZt1AalU5jW2HsuuG0qvKGRkZGRkZGRG0gcONyXsP9v8D0/IdJADiBNiXl3327WRGgOL/9HC/0XwlIURkRhC4tz6Z/fu7fUf2gHvfB9z3u0BGRkZGRkbGplHcnkgguQoSqtUXuhbs/wPtMwqV0HUJAvj5vk32b8IDuL23yn7qAXZ5u32hbRX7d3o82Df1FZXvbh9QOfhyxldr/+3xgXU9oKmvsHyr7F/XA269/eveBXrsv7N9QALe/tvjA0kPWAXGbvebkbHn+D/J5nMcHzx1UAAAAABJRU5ErkJggg==)}.dgrid-sort-arrow{background-position:-64px -16px;display:block;float:right;margin:0 4px 0 5px;height:12px}.dgrid-sort-up .dgrid-sort-arrow{background-position:0px -16px}.dgrid-selected{background-color:#bbb}.dgrid-input{width:99%}html.has-mozilla .dgrid .dgrid-row:focus,html.has-mozilla .dgrid .dgrid-cell:focus{outline:1px dotted}html.has-mozilla .dgrid-focus{outline-offset:-1px}.dgrid-scrollbar-measure{width:100px;height:100px;overflow:scroll;position:absolute;top:-9999px}.dgrid-autoheight{height:auto}.dgrid-autoheight .dgrid-scroller{position:relative;overflow-y:hidden}.dgrid-autoheight .dgrid-header-scroll{display:none}.dgrid-autoheight .dgrid-header{right:0}.dgrid-column-set{overflow:hidden;width:100%;position:relative;height:100%;-ms-touch-action:pan-y;touch-action:pan-y}.dgrid-column-set-cell{vertical-align:top;height:100%}.dgrid-column-set-scroller-container{font-size:0;position:absolute;bottom:0}.dgrid-autoheight .dgrid-column-set-scroller-container{position:relative}.dgrid-column-set-scroller{display:inline-block;overflow-x:auto;overflow-y:hidden}.dgrid-column-set-scroller-content{height:1px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.dgrid-expando-icon{width:16px;height:16px}.dgrid-tree-container{-webkit-transition-duration:.3s;-moz-transition-duration:.3s;-o-transition-duration:.3s;-ms-transition-duration:.3s;transition-duration:.3s;overflow:hidden}.dgrid-tree-container.dgrid-tree-resetting{-webkit-transition-duration:0;-moz-transition-duration:0;-o-transition-duration:0;-ms-transition-duration:0;transition-duration:0}.dgrid-hider-toggle{background-position:0 -192px;background-color:transparent;border:none;cursor:pointer;position:absolute;right:0;top:0}.dgrid-rtl-swap .dgrid-hider-toggle{right:auto;left:0}.dgrid-hider-menu{position:absolute;top:0;right:17px;width:184px;background-color:#fff;border:1px solid #000;z-index:99999;padding:4px;overflow-x:hidden;overflow-y:auto}.dgrid-rtl-swap .dgrid-hider-menu{right:auto;left:17px}.dgrid-hider-menu-row{position:relative;padding:2px}.dgrid-hider-menu-check{position:absolute;top:2px;left:2px;padding:0}.dgrid-hider-menu-label{display:block;padding-left:20px}.dgrid-header .dojoDndTarget .dgrid-cell{display:table-cell}.dgrid-header .dojoDndItemBefore{border-left:2px dotted #000!important}.dgrid-header .dojoDndItemAfter{border-right:2px dotted #000!important}.dgrid-column-resizer{cursor:col-resize;position:absolute;width:2px;background-color:#666;z-index:1000}.dgrid-resize-handle{height:100px;width:0;position:absolute;right:-4px;top:-4px;cursor:col-resize;z-index:999;border-left:5px solid transparent;outline:none}.dgrid-resize-header-container{height:100%}.dgrid-resize-guard{cursor:col-resize;position:absolute;bottom:0;left:0;right:0;top:0}html.has-touch .dgrid-resize-handle{border-left:20px solid transparent}html.has-touch .dgrid-column-resizer{width:2px}.dgrid-resize-header-container{position:relative}.dgrid-header .dgrid-cell{overflow:hidden}.dgrid-spacer-row{height:0}.dgrid-spacer-row th{padding-top:0;padding-bottom:0;border-top:none;border-bottom:none}.dgrid-status{padding:2px}.dgrid-pagination .dgrid-status{float:left}.dgrid-pagination .dgrid-navigation,.dgrid-pagination .dgrid-page-size{float:right}.dgrid-navigation .dgrid-page-link{cursor:pointer;font-weight:700;text-decoration:none;color:inherit;padding:0 4px}.dgrid-first,.dgrid-last,.dgrid-next,.dgrid-previous{font-size:130%}.dgrid-pagination .dgrid-page-disabled{color:#aaa;cursor:default}.dgrid-page-input{margin-top:1px;width:2em;text-align:center}.dgrid-page-size{margin:1px 4px 0}.dgrid-rtl-swap .dgrid-header-row{right:0;left:17px}.dgrid-rtl-swap .dgrid-header-scroll{left:0;right:auto}.dgrid-rtl .dgrid-cell{text-align:right}.dgrid-rtl .dgrid-sort-arrow{float:left;margin:0 5px 0 4px}.dgrid-rtl .ui-icon-triangle-1-e{background-position:-96px -16px}.dgrid-rtl .ui-icon-triangle-1-se{background-position:-80px -16px}.dgrid-rtl .dgrid-pagination .dgrid-status,.dgrid-rtl .dgrid-pagination .dgrid-page-size{float:right}.dgrid-rtl .dgrid-pagination .dgrid-navigation{float:left}.dgrid-rtl.dgrid-autoheight .dgrid-header{left:0}.dgrid_Table .placeholder{border:none;padding:0;overflow:hidden}.dgrid_Table .dgrid-fakeline{border:0px;border-bottom:1px solid rgb(221,221,221);margin:2px -3px}.dgrid_Table .dgrid-sortable .dgrid-sort-arrow.ui-icon{margin:0}")),document.head.appendChild(i)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})(); | ||
var __defProp = Object.defineProperty; | ||
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value; | ||
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value); | ||
import { HTMLWidget, Palette, PropertyExt, format, select } from "@hpcc-js/common"; | ||
import { hashSum } from "@hpcc-js/util"; | ||
const PKG_NAME = "@hpcc-js/dgrid", PKG_VERSION = "3.1.0", BUILD_VERSION = "3.2.1"; | ||
globalThis["@hpcc-js/dgrid-shim"] || console.error('dgrid-shim not loaded, please add `<script src="https://cdn.jsdelivr.net/npm/@hpcc-js/dgrid-shim@2.26.0/dist/index.min.js"><\/script>` or similar to your HTML file'); | ||
const Deferred = globalThis["@hpcc-js/dgrid-shim"].Deferred, Memory = globalThis["@hpcc-js/dgrid-shim"].Memory, QueryResults = globalThis["@hpcc-js/dgrid-shim"].QueryResults, Grid = globalThis["@hpcc-js/dgrid-shim"].Grid, PagingGrid = globalThis["@hpcc-js/dgrid-shim"].PagingGrid, domConstruct = globalThis["@hpcc-js/dgrid-shim"].domConstruct; | ||
function entitiesEncode(str) { | ||
return String(str).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """); | ||
} | ||
.dijitTooltipContainer { | ||
border: solid black 2px; | ||
background: #b8b5b5; | ||
color: black; | ||
font-size: small; | ||
function safeEncode(item) { | ||
switch (Object.prototype.toString.call(item)) { | ||
case "[object Undefined]": | ||
case "[object Boolean]": | ||
case "[object Number]": | ||
return item; | ||
case "[object String]": | ||
return entitiesEncode(item); | ||
default: | ||
console.warn("Unknown cell type: " + Object.prototype.toString.call(item)); | ||
} | ||
return item; | ||
} | ||
.dijitTooltipFocusNode { | ||
padding: 2px 2px 2px 2px; | ||
const LINE_SPLITTER = "<br><hr class='dgrid-fakeline'>", LINE_SPLITTER2 = "<br><hr class='dgrid-fakeline' style='visibility: hidden'>"; | ||
class RowFormatter { | ||
constructor(columns, _renderHtml) { | ||
__publicField(this, "_columns"); | ||
__publicField(this, "_flattenedColumns", []); | ||
__publicField(this, "_columnIdx", {}); | ||
__publicField(this, "_formattedRow", {}); | ||
this._renderHtml = _renderHtml, this._columns = columns, this.flattenColumns(columns); | ||
} | ||
flattenColumns(columns) { | ||
for (const column of columns) | ||
this.flattenColumn(column); | ||
} | ||
flattenColumn(column) { | ||
if (column.children) | ||
for (const childColumn of column.children) this.flattenColumn(childColumn); | ||
else | ||
this._columnIdx[column.field] = this._flattenedColumns.length, this._flattenedColumns.push(column.field); | ||
} | ||
format(row) { | ||
return this._formattedRow = {}, this.formatRow(this._columns, row), this.row(); | ||
} | ||
calcDepth(columns, row) { | ||
let maxChildDepth = 1; | ||
for (const column of columns) | ||
if (column.children && row[column.leafID]) { | ||
let childDepth = 0; | ||
for (const childRow of row[column.leafID]) | ||
childDepth += this.calcDepth(column.children, childRow); | ||
maxChildDepth = Math.max(maxChildDepth, childDepth); | ||
} | ||
return maxChildDepth; | ||
} | ||
formatCell(column, cell, maxChildDepth) { | ||
if (column.children) { | ||
let childDepth = 0; | ||
cell instanceof Array || (cell instanceof Object && cell.Row instanceof Array ? cell = cell.Row : cell = [cell]); | ||
for (const row of cell) | ||
childDepth = Math.max(childDepth, this.formatRow(column.children, row)); | ||
} else if (column.isSet && (cell = JSON.stringify(cell.Item)), this._formattedRow[column.field] === void 0 ? this._formattedRow[column.field] = "" + (cell === void 0 ? "" : this._renderHtml ? cell : safeEncode(cell)) : (this._formattedRow[column.field] += LINE_SPLITTER, this._formattedRow[column.field] += "" + (cell === void 0 ? "" : this._renderHtml ? cell : safeEncode(cell))), maxChildDepth > 1) { | ||
const paddingArr = []; | ||
paddingArr.length = maxChildDepth; | ||
const padding = paddingArr.join(LINE_SPLITTER2); | ||
this._formattedRow[column.field] += padding; | ||
} | ||
} | ||
formatRow(columns, row = [], rowIdx = 0) { | ||
const maxChildDepth = this.calcDepth(columns, row); | ||
for (const column of columns) | ||
this.formatCell(column, row[column.leafID], maxChildDepth); | ||
return maxChildDepth; | ||
} | ||
row() { | ||
const retVal = {}; | ||
for (const column of this._flattenedColumns) | ||
retVal[column] = this._formattedRow[column]; | ||
return retVal; | ||
} | ||
} | ||
.dijitTooltipConnector { | ||
position: absolute; | ||
class DBStore { | ||
constructor(db) { | ||
__publicField(this, "_db"); | ||
__publicField(this, "Model"); | ||
__publicField(this, "idProperty"); | ||
__publicField(this, "_renderHtml", !0); | ||
this._db = db; | ||
} | ||
renderHtml(_) { | ||
this._renderHtml = _; | ||
} | ||
db2Columns(sortable, fields, prefix = "", formatter, renderCell) { | ||
return fields ? fields.map((field, idx) => { | ||
const column = { | ||
label: field.label(), | ||
leafID: "" + idx, | ||
field: prefix + idx, | ||
idx, | ||
className: "resultGridCell", | ||
sortable, | ||
isSet: !1 | ||
}; | ||
switch (field.type()) { | ||
case "nested": | ||
column.children = this.db2Columns(!1, field.children(), prefix + idx + "_", formatter), column.sortable = !1; | ||
break; | ||
default: | ||
column.formatter = formatter, column.renderCell = renderCell; | ||
} | ||
return column; | ||
}) : []; | ||
} | ||
columns(sortable, formatter, renderCell) { | ||
return this.db2Columns(sortable, this._db.fields(), "", formatter, renderCell); | ||
} | ||
getIdentity(object) { | ||
return object.__hpcc_id; | ||
} | ||
get(row) { | ||
return this._db.row(row + 1); | ||
} | ||
_fetchRange(opts) { | ||
const rowFormatter = new RowFormatter(this.columns(!1), this._renderHtml); | ||
return this._db.data().slice(opts.start, opts.end).map((row, idx) => ({ | ||
...rowFormatter.format(row), | ||
__hpcc_id: opts.start + idx, | ||
__origRow: row | ||
})); | ||
} | ||
fetchRange(opts) { | ||
const data = this._fetchRange(opts), retVal = new Deferred(); | ||
return retVal.totalLength = new Deferred(), retVal.resolve(data), retVal.totalLength.resolve(this._db.length() - 1), retVal; | ||
} | ||
sort(opts) { | ||
return this._db.data().sort((l, r) => { | ||
for (const item of opts) { | ||
const idx = item.property; | ||
if (l[idx] === void 0 && r[idx] !== void 0 || l[idx] < r[idx]) return item.descending ? 1 : -1; | ||
if (l[idx] !== void 0 && r[idx] === void 0 || l[idx] > r[idx]) return item.descending ? -1 : 1; | ||
} | ||
return 0; | ||
}), this; | ||
} | ||
} | ||
.dj_a11y .dijitTooltipConnector { | ||
display: none; | ||
class Common extends HTMLWidget { | ||
constructor() { | ||
super(); | ||
__publicField(this, "_columns", []); | ||
__publicField(this, "_store", new DBStore(this._db)); | ||
__publicField(this, "_dgridDiv"); | ||
__publicField(this, "_dgrid"); | ||
__publicField(this, "_prevPaging"); | ||
__publicField(this, "_prevSortBy"); | ||
__publicField(this, "_prevSortByDescending"); | ||
__publicField(this, "_prevMultiSelect"); | ||
__publicField(this, "_supressEvents"); | ||
this._tag = "div"; | ||
} | ||
formatSortBy() { | ||
const idx = this.columns().indexOf(this.sortBy()); | ||
return idx >= 0 ? [{ property: idx.toString(), descending: this.sortByDescending() }] : void 0; | ||
} | ||
selection(_) { | ||
var _a; | ||
if (!arguments.length) { | ||
const retVal = []; | ||
for (const id in this._dgrid.selection) | ||
if (this._dgrid.selection[id]) { | ||
const storeItem = this._store.get(+id); | ||
retVal.push(this.rowToObj(storeItem)); | ||
} | ||
return retVal; | ||
} | ||
this._supressEvents = !0, (_a = this._dgrid) == null || _a.clearSelection(); | ||
let first = !0; | ||
this.data().forEach((row, idx) => { | ||
var _a2, _b; | ||
if (_.indexOf(row) >= 0) { | ||
const row2 = (_a2 = this._dgrid) == null ? void 0 : _a2.row(idx); | ||
row2.element && first && (first = !1, row2.element.scrollIntoView()), (_b = this._dgrid) == null || _b.select(idx); | ||
} | ||
}), this._supressEvents = !1; | ||
} | ||
enter(domNode, element) { | ||
super.enter(domNode, element), this._dgridDiv = element.append("div").attr("class", "flat"); | ||
} | ||
update(domNode, element) { | ||
super.update(domNode, element), this._store.renderHtml(this.renderHtml()), (!this._dgrid || this._prevPaging !== this.pagination() || this._prevSortBy !== this.sortBy() || this._prevSortByDescending !== this.sortByDescending() || this._prevMultiSelect !== this.multiSelect()) && (this._prevPaging = this.pagination(), this._prevSortBy = this.sortBy(), this._prevSortByDescending = this.sortByDescending(), this._prevMultiSelect = this.multiSelect(), this._dgrid && (this._dgrid.destroy(), this._dgridDiv = element.append("div").attr("class", "flat")), this._dgrid = new (this._prevPaging ? PagingGrid : Grid)({ | ||
columns: this._columns, | ||
collection: this._store, | ||
sort: this.formatSortBy(), | ||
selectionMode: this.multiSelect() ? "extended" : "single", | ||
deselectOnRefresh: !0, | ||
cellNavigation: !1, | ||
pagingLinks: 1, | ||
pagingTextBox: !0, | ||
previousNextArrows: !0, | ||
firstLastArrows: !0, | ||
rowsPerPage: this.pageSize(), | ||
pageSizeOptions: [1, 10, 25, 50, 100, 1e3] | ||
}, this._dgridDiv.node()), this._dgrid.on("dgrid-select", (evt) => { | ||
this._supressEvents || evt.rows && evt.rows.length && evt.rows[0].data && this.click(this.rowToObj(evt.rows[0].data.__origRow), "", !0, { selection: this.selection() }); | ||
}), this._dgrid.on("dgrid-deselect", (evt) => { | ||
this._supressEvents || evt.rows && evt.rows.length && evt.rows[0].data && this.click(this.rowToObj(evt.rows[0].data.__origRow), "", !1, { selection: this.selection() }); | ||
}), this._dgrid.refresh({})), this._dgrid.noDataMessage = `<span class='dojoxGridNoData'>${this.noDataMessage()}</span>`, this._dgrid.loadingMessage = `<span class='dojoxGridNoData'>${this.loadingMessage()}</span>`, this._dgridDiv.style("width", this.width() + "px").style("height", this.height() - 2 + "px"), this._dgrid.resize(); | ||
} | ||
exit(domNode, element) { | ||
delete this._prevPaging, this._dgrid && (this._dgrid.destroy(), delete this._dgrid), super.exit(domNode, element); | ||
} | ||
click(row, col, sel, more) { | ||
} | ||
} | ||
.dijitTooltipData { | ||
display:none; | ||
Common.prototype._class += " dgrid_Common"; | ||
Common.prototype.publish("noDataMessage", "...empty...", "string", "No Data Message"); | ||
Common.prototype.publish("loadingMessage", "loading...", "string", "Loading Message"); | ||
Common.prototype.publish("pagination", !1, "boolean", "Enable paging"); | ||
Common.prototype.publish("pageSize", 25, "number", "Page size"); | ||
Common.prototype.publish("sortable", !1, "boolean", "Enable sorting by column"); | ||
Common.prototype.publish("sortBy", null, "set", "Default 'sort by' Column ID", function() { | ||
return this.columns(); | ||
}, { optional: !0 }); | ||
Common.prototype.publish("sortByDescending", !1, "boolean", "Default 'sort by' descending", void 0, { disable: (self) => !self.sortBy() }); | ||
Common.prototype.publish("multiSelect", !1, "boolean", "Multiple Selection"); | ||
Common.prototype.publish("renderHtml", !0, "boolean", "Render HTML"); | ||
class DatasourceCache { | ||
constructor(datasource) { | ||
__publicField(this, "_datasource"); | ||
__publicField(this, "_prevHash"); | ||
__publicField(this, "_fetchCache", {}); | ||
this._datasource = datasource; | ||
} | ||
validateCache() { | ||
const hash = this.hash(); | ||
this._prevHash !== hash && (this._prevHash = hash, this._fetchCache = {}); | ||
} | ||
id() { | ||
return this._datasource.id(); | ||
} | ||
hash() { | ||
return this._datasource.hash(); | ||
} | ||
label() { | ||
return this._datasource.label(); | ||
} | ||
outFields() { | ||
return this._datasource.outFields(); | ||
} | ||
total() { | ||
return this._datasource.total(); | ||
} | ||
fetch(from, count) { | ||
this.validateCache(); | ||
const cacheID = `${from}->${count}`; | ||
let retVal = this._fetchCache[cacheID]; | ||
return retVal || (retVal = this._datasource.fetch(from, count), this._fetchCache[cacheID] = retVal), retVal; | ||
} | ||
} | ||
.dijitTooltip { | ||
/* the outermost dom node, holding the connector and container */ | ||
background: transparent; /* make the area on the sides of the arrow transparent */ | ||
class DatasourceStore { | ||
constructor(datasource, renderHtml) { | ||
__publicField(this, "_datasource"); | ||
__publicField(this, "_columnsIdx", {}); | ||
__publicField(this, "_columns"); | ||
__publicField(this, "rowFormatter"); | ||
this._datasource = new DatasourceCache(datasource), this._columnsIdx = {}, this._columns = this.db2Columns(this._datasource.outFields()).map((column, idx) => (this._columnsIdx[column.field] = idx, column)), this.rowFormatter = new RowFormatter(this._columns, renderHtml); | ||
} | ||
columns() { | ||
return this._columns; | ||
} | ||
db2Columns(fields, prefix = "") { | ||
return fields ? fields.map((field, idx) => { | ||
const column = { | ||
field: prefix + field.id, | ||
leafID: field.id, | ||
label: field.id, | ||
idx, | ||
className: "resultGridCell", | ||
sortable: !0, | ||
isSet: !1 | ||
}; | ||
return field.type === "dataset" ? column.children = this.db2Columns(field.children, prefix + field.id + "_") : column.formatter = (cell, row) => { | ||
switch (typeof cell) { | ||
case "string": | ||
return cell.replace(/\t/g, " "); | ||
} | ||
return cell; | ||
}, column; | ||
}) : []; | ||
} | ||
getIdentity(row) { | ||
return row.__hpcc_id; | ||
} | ||
_request(start, end) { | ||
return this._datasource ? this._datasource.fetch(start, end - start).then((response) => ({ | ||
totalLength: this._datasource.total(), | ||
data: response.map((row, idx) => { | ||
const formattedRow = this.rowFormatter.format(row); | ||
return formattedRow.__hpcc_id = start + idx, formattedRow.__origRow = row, formattedRow; | ||
}) | ||
})) : Promise.resolve({ totalLength: 0, data: [] }); | ||
} | ||
fetchRange(options) { | ||
const retVal = new Deferred(); | ||
return this._request(options.start, options.end).then((response) => retVal.resolve(response)), new QueryResults(retVal.then((response) => response.data), { | ||
totalLength: retVal.then((response) => response.totalLength) | ||
}); | ||
} | ||
} | ||
.dijitTooltipContainer { | ||
background-color: #424242; | ||
opacity: 1; | ||
-ms-filter: none; | ||
filter: none; | ||
padding: 4px 8px; | ||
border-radius: 3px; | ||
class DatasourceTable extends Common { | ||
constructor() { | ||
super(); | ||
__publicField(this, "_prevDatasource"); | ||
} | ||
invalidate() { | ||
return delete this._prevDatasource, this; | ||
} | ||
enter(domNode, element) { | ||
super.enter(domNode, element); | ||
} | ||
update(domNode, element) { | ||
super.update(domNode, element); | ||
} | ||
render(callback) { | ||
return super.render((w) => { | ||
if (this._prevDatasource !== this.datasource()) | ||
if (this._dgrid.set("collection", new Memory()), this._dgrid.set("columns", []), this._prevDatasource = this.datasource(), this._prevDatasource) { | ||
const store = new DatasourceStore(this._prevDatasource, this.renderHtml()); | ||
this._dgrid.set("columns", store.columns()), this._dgrid.set("collection", store), callback && callback(w); | ||
} else | ||
callback && callback(w); | ||
else | ||
callback && callback(w); | ||
}); | ||
} | ||
click(row, col, sel) { | ||
} | ||
} | ||
.dijitTooltip .dijitTooltipContainer { | ||
color: #fff; | ||
border: 0 none; | ||
DatasourceTable.prototype._class += " dgrid_DatasourceTable"; | ||
DatasourceTable.prototype.publish("datasource", null, "object", "Datasource"); | ||
class ColumnFormat extends PropertyExt { | ||
constructor() { | ||
super(); | ||
__publicField(this, "_owner"); | ||
} | ||
owner(_) { | ||
return arguments.length ? (this._owner = _, this) : this._owner; | ||
} | ||
valid() { | ||
return !!this.column(); | ||
} | ||
formatterFunc() { | ||
const defaultFormatter = this._owner.formatterFunc(); | ||
if (this.valid() && this.format()) { | ||
const numberFormatter = format(this.format()); | ||
return function(cell, row) { | ||
return typeof cell == "number" ? numberFormatter(cell) : defaultFormatter.call(this, cell, row); | ||
}; | ||
} | ||
return defaultFormatter; | ||
} | ||
renderCellFunc() { | ||
const defaultRenderCell = this._owner.renderCellFunc(), defaultFormatter = this.formatterFunc(); | ||
if (this.valid() && this.paletteID()) { | ||
const columns = this._owner.columns(), palette = Palette.rainbow(this.paletteID()), min = this.min(), max = this.max(), valueColIdx = this.valueColumn() ? columns.indexOf(this.valueColumn()) : void 0; | ||
return function(row, cell, cellElement) { | ||
defaultRenderCell && defaultRenderCell.call(this, row, cell, cellElement); | ||
const value = valueColIdx ? row.__origRow[valueColIdx] : cell, background = palette(value, min, max), cellText = defaultFormatter.call(this, cell, row); | ||
select(cellElement).style("background", background).style("color", background && Palette.textColor(background)).text((cellText == null ? void 0 : cellText.html) ?? cellText ?? cell); | ||
}; | ||
} | ||
return defaultRenderCell; | ||
} | ||
} | ||
.dijitTooltipConnector { | ||
/* the arrow */ | ||
z-index: 2; | ||
width: auto; | ||
height: auto; | ||
opacity: 1; | ||
-ms-filter: none; | ||
filter: none; | ||
ColumnFormat.prototype._class += " dgrid_Table.ColumnFormat"; | ||
ColumnFormat.prototype.publish("column", null, "set", "Column", function() { | ||
return this._owner.columns(); | ||
}, { optional: !0 }); | ||
ColumnFormat.prototype.publish("width", null, "number", "Width", null, { optional: !0 }); | ||
ColumnFormat.prototype.publish("format", null, "string", "Format (d3-format)", null, { optional: !0 }); | ||
ColumnFormat.prototype.publish("paletteID", null, "set", "Color palette for this widget", ["", ...Palette.rainbow("default").switch()], { optional: !0 }); | ||
ColumnFormat.prototype.publish("min", 0, "number", "Min Value", null, { disable: (cf) => !cf.paletteID() }); | ||
ColumnFormat.prototype.publish("max", 100, "number", "Max Value", null, { disable: (cf) => !cf.paletteID() }); | ||
ColumnFormat.prototype.publish("valueColumn", null, "set", "Column", function() { | ||
return this._owner.columns(); | ||
}, { optional: !0, disable: (cf) => !cf.paletteID() }); | ||
class Table extends Common { | ||
constructor() { | ||
super(); | ||
__publicField(this, "_prevColsHash"); | ||
__publicField(this, "_prevFieldsHash"); | ||
__publicField(this, "_colsRefresh", !1); | ||
__publicField(this, "_dataRefresh", !1); | ||
__publicField(this, "_prevHash"); | ||
} | ||
fields(_) { | ||
const retVal = super.fields.apply(this, arguments); | ||
if (arguments.length) { | ||
const hash = hashSum({ _ }); | ||
this._prevFieldsHash !== hash && (this._prevFieldsHash = hash, this._colsRefresh = !0); | ||
} | ||
return retVal; | ||
} | ||
columns(_, asDefault) { | ||
const retVal = super.columns.apply(this, arguments); | ||
if (arguments.length) { | ||
const hash = hashSum({ _ }); | ||
this._prevColsHash !== hash && (this._prevColsHash = hash, this._colsRefresh = !0); | ||
} | ||
return retVal; | ||
} | ||
data(_) { | ||
const retVal = super.data.apply(this, arguments); | ||
return arguments.length && (this._dataRefresh = !0), retVal; | ||
} | ||
enter(domNode, element) { | ||
super.enter(domNode, element); | ||
} | ||
guessWidth(columns, data) { | ||
const sortablePadding = this.sortable() ? 12 : 0; | ||
for (const column of columns) | ||
if (column.children) { | ||
let sampleData = []; | ||
for (let i = 0; i < Math.min(3, data.length); ++i) | ||
sampleData = sampleData.concat(data[i][column.idx]); | ||
this.guessWidth(column.children, sampleData); | ||
} else | ||
column.width = data.reduce((prevVal, row) => { | ||
const cell = ("" + row[column.idx]).trim(); | ||
return Math.max(prevVal, this.textSize(cell).width); | ||
}, this.textSize("" + column.label, void 0, void 0, !0).width + sortablePadding) + 8; | ||
} | ||
update(domNode, element) { | ||
super.update(domNode, element); | ||
const hash = this.hashSum(); | ||
if (this._prevHash !== hash && (this._prevHash = hash, this._colsRefresh = !0), this._colsRefresh) { | ||
switch (this._columns = this._store.columns(this.sortable(), this.formatterFunc(), this.renderCellFunc()), this.columnWidth()) { | ||
case "auto": | ||
const tenRows = this.data().filter((row, idx) => idx < 10); | ||
this.guessWidth(this._columns, tenRows); | ||
break; | ||
} | ||
const columns = this.columns(); | ||
for (const columnFormat of this.columnFormats()) | ||
if (columnFormat.valid()) { | ||
const colIdx = columns.indexOf(columnFormat.column()); | ||
this._columns[colIdx] && (this._columns[colIdx].hidden = columnFormat.width() === 0, this._columns[colIdx].width = columnFormat.width() || this._columns[colIdx].width, this._columns[colIdx].formatter = columnFormat.formatterFunc(), this._columns[colIdx].renderCell = columnFormat.renderCellFunc()); | ||
} | ||
this._dgrid.set("columns", this._columns.filter((col) => !col.hidden)), this._colsRefresh = !1; | ||
} | ||
(this._colsRefresh || this._dataRefresh) && (this._colsRefresh ? this._dgrid.refresh({}) : this._dgrid.refresh(), this._colsRefresh = !1, this._dataRefresh = !1); | ||
} | ||
exit(domNode, element) { | ||
delete this._prevColsHash, delete this._prevFieldsHash, super.exit(domNode, element); | ||
} | ||
// Cell --- | ||
formatterFunc() { | ||
return function(cell, row) { | ||
switch (typeof cell) { | ||
case "string": | ||
return { | ||
html: cell.replace(/\t/g, " ").trim() | ||
}; | ||
case "undefined": | ||
return ""; | ||
} | ||
return cell; | ||
}; | ||
} | ||
renderCellFunc() { | ||
} | ||
// Events --- | ||
click(row, col, sel) { | ||
} | ||
} | ||
.dijitTooltipABRight .dijitTooltipConnector { | ||
/* above or below tooltip, but the arrow appears on the right, | ||
and the right edges of target and tooltip are aligned rather than the left */ | ||
left: auto !important; | ||
right: 8px; | ||
} | ||
.dijitTooltipBelow { | ||
/* leave room for arrow above content */ | ||
padding-top: 4px; | ||
} | ||
.dijitTooltipBelow .dijitTooltipConnector { | ||
/* the arrow piece for tooltips below an element */ | ||
top: 0; | ||
left: 8px; | ||
border-bottom: 4px solid #424242; | ||
border-left: 4px solid transparent; | ||
border-right: 4px solid transparent; | ||
border-top: 0; | ||
} | ||
.dijitTooltipAbove { | ||
/* leave room for arrow below content */ | ||
padding-bottom: 4px; | ||
} | ||
.dijitTooltipAbove .dijitTooltipConnector { | ||
/* the arrow piece for tooltips above an element */ | ||
bottom: 0; | ||
left: 8px; | ||
border-top: 4px solid #424242; | ||
border-left: 4px solid transparent; | ||
border-right: 4px solid transparent; | ||
border-bottom: 0; | ||
} | ||
.dijitTooltipLeft { | ||
padding-right: 4px; | ||
} | ||
.dijitTooltipLeft .dijitTooltipConnector { | ||
/* the arrow piece for tooltips to the left of an element, bottom borders aligned */ | ||
right: 0; | ||
border-left: 4px solid #424242; | ||
border-bottom: 4px solid transparent; | ||
border-top: 4px solid transparent; | ||
border-right: 0; | ||
} | ||
.dijitTooltipRight { | ||
padding-left: 4px; | ||
} | ||
.dijitTooltipRight .dijitTooltipConnector { | ||
/* the arrow piece for tooltips to the right of an element, bottom borders aligned */ | ||
left: 0; | ||
border-bottom: 4px solid transparent; | ||
border-top: 4px solid transparent; | ||
border-right: 4px solid #424242; | ||
} | ||
.dgrid { | ||
position: relative; | ||
overflow: hidden; | ||
border: 1px solid #ddd; | ||
height: 30em; | ||
display: block; | ||
} | ||
.dgrid-header { | ||
background-color: #eee; | ||
} | ||
.dgrid-header-row { | ||
position: absolute; | ||
right: 17px; | ||
left: 0; | ||
} | ||
.dgrid-header-scroll { | ||
position: absolute; | ||
top: 0; | ||
right: 0; | ||
} | ||
.dgrid-footer { | ||
position: absolute; | ||
bottom: 0; | ||
width: 100%; | ||
} | ||
.dgrid-header-hidden { | ||
font-size: 0; | ||
height: 0 !important; | ||
border-top: none !important; | ||
border-bottom: none !important; | ||
margin-top: 0 !important; | ||
margin-bottom: 0 !important; | ||
padding-top: 0 !important; | ||
padding-bottom: 0 !important; | ||
} | ||
.dgrid-footer-hidden { | ||
display: none; | ||
} | ||
.dgrid-sortable { | ||
cursor: pointer; | ||
} | ||
.dgrid-header, | ||
.dgrid-header-row, | ||
.dgrid-footer { | ||
overflow: hidden; | ||
background-color: #eee; | ||
} | ||
.dgrid-row-table { | ||
border-collapse: collapse; | ||
border: none; | ||
table-layout: fixed; | ||
empty-cells: show; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
.dgrid-cell { | ||
padding: 3px; | ||
text-align: left; | ||
overflow: hidden; | ||
vertical-align: top; | ||
border: 1px solid #ddd; | ||
border-top-style: none; | ||
-webkit-box-sizing: border-box; | ||
-moz-box-sizing: border-box; | ||
box-sizing: border-box; | ||
text-overflow: ellipsis; | ||
white-space: nowrap; | ||
} | ||
.dgrid-content { | ||
position: relative; | ||
height: 99%; | ||
} | ||
.dgrid-scroller { | ||
overflow-x: auto; | ||
overflow-y: scroll; | ||
position: absolute; | ||
top: 0px; | ||
margin-top: 25px; | ||
bottom: 0px; | ||
width: 100%; | ||
} | ||
.dgrid-preload { | ||
font-size: 0; | ||
line-height: 0; | ||
} | ||
.dgrid-loading { | ||
position: relative; | ||
height: 100%; | ||
} | ||
.dgrid-above { | ||
position: absolute; | ||
bottom: 0; | ||
} | ||
.ui-icon { | ||
width: 12px; | ||
height: 16px; | ||
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAADwCAMAAADYSUr5AAAA7VBMVEUkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIiQkIi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md1LA5f5ONdhJ8vZ5J0vLHT99srkGOjmJbd/G1r2Nriqnse1AZt1AalU5jW2HsuuG0qvKGRkZGRkZGRG0gcONyXsP9v8D0/IdJADiBNiXl3327WRGgOL/9HC/0XwlIURkRhC4tz6Z/fu7fUf2gHvfB9z3u0BGRkZGRkbGplHcnkgguQoSqtUXuhbs/wPtMwqV0HUJAvj5vk32b8IDuL23yn7qAXZ5u32hbRX7d3o82Df1FZXvbh9QOfhyxldr/+3xgXU9oKmvsHyr7F/XA269/eveBXrsv7N9QALe/tvjA0kPWAXGbvebkbHn+D/J5nMcHzx1UAAAAABJRU5ErkJggg==); | ||
} | ||
.dgrid-sort-arrow { | ||
background-position: -64px -16px; | ||
display: block; | ||
float: right; | ||
margin: 0 4px 0 5px; | ||
height: 12px; | ||
} | ||
.dgrid-sort-up .dgrid-sort-arrow { | ||
background-position: 0px -16px; | ||
} | ||
.dgrid-selected { | ||
background-color: #bbb; | ||
} | ||
.dgrid-input { | ||
width: 99%; | ||
} | ||
html.has-mozilla .dgrid .dgrid-row:focus, | ||
html.has-mozilla .dgrid .dgrid-cell:focus { | ||
outline: 1px dotted; | ||
} | ||
html.has-mozilla .dgrid-focus { | ||
outline-offset: -1px; | ||
} | ||
.dgrid-scrollbar-measure { | ||
width: 100px; | ||
height: 100px; | ||
overflow: scroll; | ||
position: absolute; | ||
top: -9999px; | ||
} | ||
.dgrid-autoheight { | ||
height: auto; | ||
} | ||
.dgrid-autoheight .dgrid-scroller { | ||
position: relative; | ||
overflow-y: hidden; | ||
} | ||
.dgrid-autoheight .dgrid-header-scroll { | ||
display: none; | ||
} | ||
.dgrid-autoheight .dgrid-header { | ||
right: 0; | ||
} | ||
.dgrid-column-set { | ||
overflow: hidden; | ||
width: 100%; | ||
position: relative; | ||
height: 100%; | ||
-ms-touch-action: pan-y; | ||
touch-action: pan-y; | ||
} | ||
.dgrid-column-set-cell { | ||
vertical-align: top; | ||
height: 100%; | ||
} | ||
.dgrid-column-set-scroller-container { | ||
font-size: 0; | ||
position: absolute; | ||
bottom: 0; | ||
} | ||
.dgrid-autoheight .dgrid-column-set-scroller-container { | ||
position: relative; | ||
} | ||
.dgrid-column-set-scroller { | ||
display: inline-block; | ||
overflow-x: auto; | ||
overflow-y: hidden; | ||
} | ||
.dgrid-column-set-scroller-content { | ||
height: 1px; | ||
} | ||
.ui-icon-triangle-1-e { | ||
background-position: -32px -16px; | ||
} | ||
.ui-icon-triangle-1-se { | ||
background-position: -48px -16px; | ||
} | ||
.dgrid-expando-icon { | ||
width: 16px; | ||
height: 16px; | ||
} | ||
.dgrid-tree-container { | ||
-webkit-transition-duration: 0.3s; | ||
-moz-transition-duration: 0.3s; | ||
-o-transition-duration: 0.3s; | ||
-ms-transition-duration: 0.3s; | ||
transition-duration: 0.3s; | ||
overflow: hidden; | ||
} | ||
.dgrid-tree-container.dgrid-tree-resetting { | ||
-webkit-transition-duration: 0; | ||
-moz-transition-duration: 0; | ||
-o-transition-duration: 0; | ||
-ms-transition-duration: 0; | ||
transition-duration: 0; | ||
} | ||
.dgrid-hider-toggle { | ||
background-position: 0 -192px; | ||
background-color: transparent; | ||
border: none; | ||
cursor: pointer; | ||
position: absolute; | ||
right: 0; | ||
top: 0; | ||
} | ||
.dgrid-rtl-swap .dgrid-hider-toggle { | ||
right: auto; | ||
left: 0; | ||
} | ||
.dgrid-hider-menu { | ||
position: absolute; | ||
top: 0; | ||
right: 17px; | ||
width: 184px; | ||
background-color: #fff; | ||
border: 1px solid #000; | ||
z-index: 99999; | ||
padding: 4px; | ||
overflow-x: hidden; | ||
overflow-y: auto; | ||
} | ||
.dgrid-rtl-swap .dgrid-hider-menu { | ||
right: auto; | ||
left: 17px; | ||
} | ||
.dgrid-hider-menu-row { | ||
position: relative; | ||
padding: 2px; | ||
} | ||
.dgrid-hider-menu-check { | ||
position: absolute; | ||
top: 2px; | ||
left: 2px; | ||
padding: 0; | ||
} | ||
.dgrid-hider-menu-label { | ||
display: block; | ||
padding-left: 20px; | ||
} | ||
.dgrid-header .dojoDndTarget .dgrid-cell { | ||
display: table-cell; | ||
} | ||
.dgrid-header .dojoDndItemBefore { | ||
border-left: 2px dotted #000 !important; | ||
} | ||
.dgrid-header .dojoDndItemAfter { | ||
border-right: 2px dotted #000 !important; | ||
} | ||
.dgrid-column-resizer { | ||
cursor: col-resize; | ||
position: absolute; | ||
width: 2px; | ||
background-color: #666; | ||
z-index: 1000; | ||
} | ||
.dgrid-resize-handle { | ||
height: 100px; | ||
width: 0; | ||
position: absolute; | ||
right: -4px; | ||
top: -4px; | ||
cursor: col-resize; | ||
z-index: 999; | ||
border-left: 5px solid transparent; | ||
outline: none; | ||
} | ||
.dgrid-resize-header-container { | ||
height: 100%; | ||
} | ||
.dgrid-resize-guard { | ||
cursor: col-resize; | ||
position: absolute; | ||
bottom: 0; | ||
left: 0; | ||
right: 0; | ||
top: 0; | ||
} | ||
html.has-touch .dgrid-resize-handle { | ||
border-left: 20px solid transparent; | ||
} | ||
html.has-touch .dgrid-column-resizer { | ||
width: 2px; | ||
} | ||
.dgrid-resize-header-container { | ||
position: relative; | ||
} | ||
.dgrid-header .dgrid-cell { | ||
overflow: hidden; | ||
} | ||
.dgrid-spacer-row { | ||
height: 0; | ||
} | ||
.dgrid-spacer-row th { | ||
padding-top: 0; | ||
padding-bottom: 0; | ||
border-top: none; | ||
border-bottom: none; | ||
} | ||
.dgrid-status { | ||
padding: 2px; | ||
} | ||
.dgrid-pagination .dgrid-status { | ||
float: left; | ||
} | ||
.dgrid-pagination .dgrid-navigation, | ||
.dgrid-pagination .dgrid-page-size { | ||
float: right; | ||
} | ||
.dgrid-navigation .dgrid-page-link { | ||
cursor: pointer; | ||
font-weight: bold; | ||
text-decoration: none; | ||
color: inherit; | ||
padding: 0 4px; | ||
} | ||
.dgrid-first, | ||
.dgrid-last, | ||
.dgrid-next, | ||
.dgrid-previous { | ||
font-size: 130%; | ||
} | ||
.dgrid-pagination .dgrid-page-disabled { | ||
color: #aaa; | ||
cursor: default; | ||
} | ||
.dgrid-page-input { | ||
margin-top: 1px; | ||
width: 2em; | ||
text-align: center; | ||
} | ||
.dgrid-page-size { | ||
margin: 1px 4px 0 4px; | ||
} | ||
.dgrid-rtl-swap .dgrid-header-row { | ||
right: 0; | ||
left: 17px; | ||
} | ||
.dgrid-rtl-swap .dgrid-header-scroll { | ||
left: 0px; | ||
right: auto; | ||
} | ||
.dgrid-rtl .dgrid-cell { | ||
text-align: right; | ||
} | ||
.dgrid-rtl .dgrid-sort-arrow { | ||
float: left; | ||
margin: 0 5px 0 4px; | ||
} | ||
.dgrid-rtl .ui-icon-triangle-1-e { | ||
background-position: -96px -16px; | ||
} | ||
.dgrid-rtl .ui-icon-triangle-1-se { | ||
background-position: -80px -16px; | ||
} | ||
.dgrid-rtl .dgrid-pagination .dgrid-status { | ||
float: right; | ||
} | ||
.dgrid-rtl .dgrid-pagination .dgrid-page-size { | ||
float: right; | ||
} | ||
.dgrid-rtl .dgrid-pagination .dgrid-navigation { | ||
float: left; | ||
} | ||
.dgrid-rtl.dgrid-autoheight .dgrid-header { | ||
left: 0; | ||
} | ||
.dgrid_Table .placeholder { | ||
border:none; | ||
padding:0px; | ||
overflow:hidden; | ||
} | ||
.dgrid_Table .dgrid-fakeline { | ||
border: 0px; | ||
border-bottom: 1px solid rgb(221, 221, 221); | ||
margin: 0px; | ||
margin-left:-3px; | ||
margin-top:2px; | ||
margin-right:-3px; | ||
margin-bottom:2px; | ||
} | ||
.dgrid_Table .dgrid-sortable .dgrid-sort-arrow.ui-icon { | ||
margin:0px; | ||
}`,document.head.appendChild(n)}})();var l=class extends z{static{d(this,"Common")}_columns=[];_store=new f(this._db);_dgridDiv;_dgrid;_prevPaging;_prevSortBy;_prevSortByDescending;_prevMultiSelect;constructor(){super(),this._tag="div"}formatSortBy(){let t=this.columns().indexOf(this.sortBy());return t>=0?[{property:t.toString(),descending:this.sortByDescending()}]:void 0}_supressEvents;selection(t){if(!arguments.length){let r=[];for(let o in this._dgrid.selection)if(this._dgrid.selection[o]){let i=this._store.get(+o);r.push(this.rowToObj(i))}return r}this._supressEvents=!0,this._dgrid?.clearSelection();let e=!0;this.data().forEach((r,o)=>{if(t.indexOf(r)>=0){let i=this._dgrid?.row(o);i.element&&e&&(e=!1,i.element.scrollIntoView()),this._dgrid?.select(o)}}),this._supressEvents=!1}enter(t,e){super.enter(t,e),this._dgridDiv=e.append("div").attr("class","flat")}update(t,e){super.update(t,e),this._store.renderHtml(this.renderHtml()),(!this._dgrid||this._prevPaging!==this.pagination()||this._prevSortBy!==this.sortBy()||this._prevSortByDescending!==this.sortByDescending()||this._prevMultiSelect!==this.multiSelect())&&(this._prevPaging=this.pagination(),this._prevSortBy=this.sortBy(),this._prevSortByDescending=this.sortByDescending(),this._prevMultiSelect=this.multiSelect(),this._dgrid&&(this._dgrid.destroy(),this._dgridDiv=e.append("div").attr("class","flat")),this._dgrid=new(this._prevPaging?v:I)({columns:this._columns,collection:this._store,sort:this.formatSortBy(),selectionMode:this.multiSelect()?"extended":"single",deselectOnRefresh:!0,cellNavigation:!1,pagingLinks:1,pagingTextBox:!0,previousNextArrows:!0,firstLastArrows:!0,rowsPerPage:this.pageSize(),pageSizeOptions:[1,10,25,50,100,1e3]},this._dgridDiv.node()),this._dgrid.on("dgrid-select",r=>{this._supressEvents||r.rows&&r.rows.length&&r.rows[0].data&&this.click(this.rowToObj(r.rows[0].data.__origRow),"",!0,{selection:this.selection()})}),this._dgrid.on("dgrid-deselect",r=>{this._supressEvents||r.rows&&r.rows.length&&r.rows[0].data&&this.click(this.rowToObj(r.rows[0].data.__origRow),"",!1,{selection:this.selection()})}),this._dgrid.refresh({})),this._dgrid.noDataMessage=`<span class='dojoxGridNoData'>${this.noDataMessage()}</span>`,this._dgrid.loadingMessage=`<span class='dojoxGridNoData'>${this.loadingMessage()}</span>`,this._dgridDiv.style("width",this.width()+"px").style("height",this.height()-2+"px"),this._dgrid.resize()}exit(t,e){delete this._prevPaging,this._dgrid&&(this._dgrid.destroy(),delete this._dgrid),super.exit(t,e)}click(t,e,r,o){}};l.prototype._class+=" dgrid_Common";l.prototype.publish("noDataMessage","...empty...","string","No Data Message");l.prototype.publish("loadingMessage","loading...","string","Loading Message");l.prototype.publish("pagination",!1,"boolean","Enable paging");l.prototype.publish("pageSize",25,"number","Page size");l.prototype.publish("sortable",!1,"boolean","Enable sorting by column");l.prototype.publish("sortBy",null,"set","Default 'sort by' Column ID",function(){return this.columns()},{optional:!0});l.prototype.publish("sortByDescending",!1,"boolean","Default 'sort by' descending",void 0,{disable:d(n=>!n.sortBy(),"disable")});l.prototype.publish("multiSelect",!1,"boolean","Multiple Selection");l.prototype.publish("renderHtml",!0,"boolean","Render HTML");var A=class{static{d(this,"DatasourceCache")}_datasource;_prevHash;_fetchCache={};constructor(t){this._datasource=t}validateCache(){let t=this.hash();this._prevHash!==t&&(this._prevHash=t,this._fetchCache={})}id(){return this._datasource.id()}hash(){return this._datasource.hash()}label(){return this._datasource.label()}outFields(){return this._datasource.outFields()}total(){return this._datasource.total()}fetch(t,e){this.validateCache();let r=`${t}->${e}`,o=this._fetchCache[r];return o||(o=this._datasource.fetch(t,e),this._fetchCache[r]=o),o}},b=class{static{d(this,"DatasourceStore")}_datasource;_columnsIdx={};_columns;rowFormatter;constructor(t,e){this._datasource=new A(t),this._columnsIdx={},this._columns=this.db2Columns(this._datasource.outFields()).map((r,o)=>(this._columnsIdx[r.field]=o,r)),this.rowFormatter=new c(this._columns,e)}columns(){return this._columns}db2Columns(t,e=""){return t?t.map((r,o)=>{let i={field:e+r.id,leafID:r.id,label:r.id,idx:o,className:"resultGridCell",sortable:!0,isSet:!1};return r.type==="dataset"?i.children=this.db2Columns(r.children,e+r.id+"_"):i.formatter=(s,a)=>{switch(typeof s){case"string":return s.replace(/\t/g," ")}return s},i}):[]}getIdentity(t){return t.__hpcc_id}_request(t,e){return this._datasource?this._datasource.fetch(t,e-t).then(o=>({totalLength:this._datasource.total(),data:o.map((i,s)=>{let a=this.rowFormatter.format(i);return a.__hpcc_id=t+s,a.__origRow=i,a})})):Promise.resolve({totalLength:0,data:[]})}fetchRange(t){let e=new u;return this._request(t.start,t.end).then(r=>e.resolve(r)),new _(e.then(r=>r.data),{totalLength:e.then(r=>r.totalLength)})}};var y=class extends l{static{d(this,"DatasourceTable")}_prevDatasource;constructor(){super()}invalidate(){return delete this._prevDatasource,this}enter(t,e){super.enter(t,e)}update(t,e){super.update(t,e)}render(t){return super.render(e=>{if(this._prevDatasource!==this.datasource())if(this._dgrid.set("collection",new x),this._dgrid.set("columns",[]),this._prevDatasource=this.datasource(),this._prevDatasource){let r=new b(this._prevDatasource,this.renderHtml());this._dgrid.set("columns",r.columns()),this._dgrid.set("collection",r),t&&t(e)}else t&&t(e);else t&&t(e)})}click(t,e,r){}};y.prototype._class+=" dgrid_DatasourceTable";y.prototype.publish("datasource",null,"object","Datasource");import{Palette as C,PropertyExt as P}from"@hpcc-js/common";import{hashSum as T}from"@hpcc-js/util";import{format as G}from"@hpcc-js/common";import{select as N}from"@hpcc-js/common";var h=class extends P{static{d(this,"ColumnFormat")}_owner;constructor(){super()}owner(t){return arguments.length?(this._owner=t,this):this._owner}valid(){return!!this.column()}formatterFunc(){let t=this._owner.formatterFunc();if(this.valid()&&this.format()){let e=G(this.format());return function(r,o){return typeof r=="number"?e(r):t.call(this,r,o)}}return t}renderCellFunc(){let t=this._owner.renderCellFunc(),e=this.formatterFunc();if(this.valid()&&this.paletteID()){let r=this._owner.columns(),o=C.rainbow(this.paletteID()),i=this.min(),s=this.max(),a=this.valueColumn()?r.indexOf(this.valueColumn()):void 0;return function(m,p,k){t&&t.call(this,m,p,k);let R=a?m.__origRow[a]:p,w=o(R,i,s),D=e.call(this,p,m);N(k).style("background",w).style("color",w&&C.textColor(w)).text(D?.html??D??p)}}return t}};h.prototype._class+=" dgrid_Table.ColumnFormat";h.prototype.publish("column",null,"set","Column",function(){return this._owner.columns()},{optional:!0});h.prototype.publish("width",null,"number","Width",null,{optional:!0});h.prototype.publish("format",null,"string","Format (d3-format)",null,{optional:!0});h.prototype.publish("paletteID",null,"set","Color palette for this widget",["",...C.rainbow("default").switch()],{optional:!0});h.prototype.publish("min",0,"number","Min Value",null,{disable:d(n=>!n.paletteID(),"disable")});h.prototype.publish("max",100,"number","Max Value",null,{disable:d(n=>!n.paletteID(),"disable")});h.prototype.publish("valueColumn",null,"set","Column",function(){return this._owner.columns()},{optional:!0,disable:d(n=>!n.paletteID(),"disable")});var g=class extends l{static{d(this,"Table")}_prevColsHash;_prevFieldsHash;_colsRefresh=!1;_dataRefresh=!1;constructor(){super()}fields(t){let e=super.fields.apply(this,arguments);if(arguments.length){let r=T({_:t});this._prevFieldsHash!==r&&(this._prevFieldsHash=r,this._colsRefresh=!0)}return e}columns(t,e){let r=super.columns.apply(this,arguments);if(arguments.length){let o=T({_:t});this._prevColsHash!==o&&(this._prevColsHash=o,this._colsRefresh=!0)}return r}data(t){let e=super.data.apply(this,arguments);return arguments.length&&(this._dataRefresh=!0),e}enter(t,e){super.enter(t,e)}guessWidth(t,e){let r=this.sortable()?12:0;for(let o of t)if(o.children){let i=[];for(let s=0;s<Math.min(3,e.length);++s)i=i.concat(e[s][o.idx]);this.guessWidth(o.children,i)}else o.width=e.reduce((i,s)=>{let a=(""+s[o.idx]).trim();return Math.max(i,this.textSize(a).width)},this.textSize(""+o.label,void 0,void 0,!0).width+r)+8}_prevHash;update(t,e){super.update(t,e);let r=this.hashSum();if(this._prevHash!==r&&(this._prevHash=r,this._colsRefresh=!0),this._colsRefresh){switch(this._columns=this._store.columns(this.sortable(),this.formatterFunc(),this.renderCellFunc()),this.columnWidth()){case"auto":let i=this.data().filter((s,a)=>a<10);this.guessWidth(this._columns,i);break}let o=this.columns();for(let i of this.columnFormats())if(i.valid()){let s=o.indexOf(i.column());this._columns[s]&&(this._columns[s].hidden=i.width()===0,this._columns[s].width=i.width()||this._columns[s].width,this._columns[s].formatter=i.formatterFunc(),this._columns[s].renderCell=i.renderCellFunc())}this._dgrid.set("columns",this._columns.filter(i=>!i.hidden)),this._colsRefresh=!1}(this._colsRefresh||this._dataRefresh)&&(this._colsRefresh?this._dgrid.refresh({}):this._dgrid.refresh(),this._colsRefresh=!1,this._dataRefresh=!1)}exit(t,e){delete this._prevColsHash,delete this._prevFieldsHash,super.exit(t,e)}formatterFunc(){return function(t,e){switch(typeof t){case"string":return{html:t.replace(/\t/g," ").trim()};case"undefined":return""}return t}}renderCellFunc(){}click(t,e,r){}};g.prototype._class+=" dgrid_Table";g.prototype.publish("columnWidth","auto","set","Default column width",["auto","none"]);g.prototype.publish("columnFormats",[],"propertyArray","Source Columns",null,{autoExpand:h});export{L as BUILD_VERSION,h as ColumnFormat,l as Common,f as DBStore,A as DatasourceCache,b as DatasourceStore,y as DatasourceTable,u as Deferred,I as Grid,x as Memory,E as PKG_NAME,Y as PKG_VERSION,v as PagingGrid,_ as QueryResults,c as RowFormatter,g as Table,j as domConstruct}; | ||
Table.prototype._class += " dgrid_Table"; | ||
Table.prototype.publish("columnWidth", "auto", "set", "Default column width", ["auto", "none"]); | ||
Table.prototype.publish("columnFormats", [], "propertyArray", "Source Columns", null, { autoExpand: ColumnFormat }); | ||
export { | ||
BUILD_VERSION, | ||
ColumnFormat, | ||
Common, | ||
DBStore, | ||
DatasourceCache, | ||
DatasourceStore, | ||
DatasourceTable, | ||
Deferred, | ||
Grid, | ||
Memory, | ||
PKG_NAME, | ||
PKG_VERSION, | ||
PagingGrid, | ||
QueryResults, | ||
RowFormatter, | ||
Table, | ||
domConstruct | ||
}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@hpcc-js/dgrid", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"description": "hpcc-js - Viz DGrid", | ||
"type": "module", | ||
"main": "./dist/index.umd.cjs", | ||
"module": "./dist/index.js", | ||
"exports": { | ||
".": { | ||
"types": "./types/index.d.ts", | ||
"default": "./dist/index.js" | ||
"import": "./dist/index.js", | ||
"require": "./dist/index.umd.cjs" | ||
}, | ||
"./dist/*": "./dist/*" | ||
}, | ||
"module": "./dist/index.js", | ||
"browser": "./dist/index.js", | ||
"browser": "./dist/index.umd.cjs", | ||
"types": "./types/index.d.ts", | ||
@@ -23,4 +25,4 @@ "files": [ | ||
"clean": "rimraf --glob lib* types dist *.tsbuildinfo .turbo", | ||
"bundle": "node esbuild.js", | ||
"bundle-watch": "npm run bundle -- --development --watch", | ||
"bundle": "vite build", | ||
"bundle-watch": "vite --port 5506", | ||
"gen-types": "tsc --project tsconfig.json", | ||
@@ -36,12 +38,12 @@ "gen-types-watch": "npm run gen-types -- --watch", | ||
"update": "npx --yes npm-check-updates -u -t minor", | ||
"update-major": "npx -yes npm-check-updates -u" | ||
"update-major": "npx --yes npm-check-updates -u" | ||
}, | ||
"dependencies": { | ||
"@hpcc-js/common": "^3.2.0", | ||
"@hpcc-js/common": "^3.3.0", | ||
"@hpcc-js/dgrid-shim": "^3.1.0", | ||
"@hpcc-js/util": "^3.2.0" | ||
"@hpcc-js/util": "^3.3.0" | ||
}, | ||
"devDependencies": { | ||
"@hpcc-js/ddl-shim": "^3.0.0", | ||
"@hpcc-js/esbuild-plugins": "^1.3.0", | ||
"@hpcc-js/esbuild-plugins": "^1.4.0", | ||
"@testing-library/dom": "10.4.0", | ||
@@ -62,3 +64,3 @@ "d3-format": "^1", | ||
"homepage": "https://github.com/hpcc-systems/Visualization", | ||
"gitHead": "658c50fd965a7744ba8db675ba6878607c44d5e2" | ||
"gitHead": "145a4d4c8189c70f08e9804e63959d6dd398bd9f" | ||
} |
export const PKG_NAME = "@hpcc-js/dgrid"; | ||
export const PKG_VERSION = "3.1.0"; | ||
export const BUILD_VERSION = "3.2.0"; | ||
export const BUILD_VERSION = "3.2.1"; |
@@ -1,2 +0,3 @@ | ||
define({ | ||
// eslint-disable-next-line no-undef | ||
define({ | ||
load: function (name, req, onload, config) { | ||
@@ -3,0 +4,0 @@ if (config.isBuild) { |
@@ -110,6 +110,6 @@ | ||
if (this._formattedRow[column.field] === undefined) { | ||
this._formattedRow[column.field] = "" + cell === undefined ? "" : (this._renderHtml ? cell : safeEncode(cell)); | ||
this._formattedRow[column.field] = "" + (cell === undefined ? "" : (this._renderHtml ? cell : safeEncode(cell))); | ||
} else { | ||
this._formattedRow[column.field] += LINE_SPLITTER; | ||
this._formattedRow[column.field] += "" + cell === undefined ? "" : (this._renderHtml ? cell : safeEncode(cell)); | ||
this._formattedRow[column.field] += "" + (cell === undefined ? "" : (this._renderHtml ? cell : safeEncode(cell))); | ||
} | ||
@@ -116,0 +116,0 @@ if (maxChildDepth > 1) { |
export declare const PKG_NAME = "@hpcc-js/dgrid"; | ||
export declare const PKG_VERSION = "3.1.0"; | ||
export declare const BUILD_VERSION = "3.2.0"; | ||
export declare const BUILD_VERSION = "3.2.1"; |
Sorry, the diff of this file is not supported yet
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
217456
29
2247
0
1
2
Updated@hpcc-js/common@^3.3.0
Updated@hpcc-js/util@^3.3.0