tsgrid-ui 2.10.0 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -0
- package/dist/chunks/chunk-KXOFRWPD.js +8801 -0
- package/dist/chunks/chunk-KXOFRWPD.js.map +1 -0
- package/dist/grid.d.ts +4 -0
- package/dist/grid.es6.js +14 -0
- package/dist/grid.es6.js.map +1 -0
- package/dist/layout.d.ts +1 -1
- package/dist/popup.d.ts +1 -1
- package/dist/tsgrid-BEnny8OX.d.ts +575 -0
- package/dist/tsgrid-ui.d.ts +3 -577
- package/dist/tsgrid-ui.es6.js +5 -8781
- package/dist/tsgrid-ui.es6.js.map +1 -1
- package/dist/tsgrid-ui.js +1 -1
- package/dist/tsgrid-ui.min.js +1 -1
- package/dist/tsutils-message-BC0wOHZs.d.ts +82 -0
- package/dist/utils.d.ts +1 -1
- package/package.json +2 -1
package/dist/tsgrid-ui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* tsgrid-ui 2.
|
|
1
|
+
/* tsgrid-ui 2.11.0 (c) 2014 vitmalina@gmail.com, (c) 2026 DaverSoGT — MIT */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
package/dist/tsgrid-ui.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* tsgrid-ui 2.
|
|
1
|
+
/* tsgrid-ui 2.11.0 (c) 2014 vitmalina@gmail.com, (c) 2026 DaverSoGT — MIT */
|
|
2
2
|
"use strict";var et=Object.defineProperty;var _i=Object.getOwnPropertyDescriptor;var ki=Object.getOwnPropertyNames;var Ci=Object.prototype.hasOwnProperty;var Ei=(n,e)=>{for(var s in e)et(n,s,{get:e[s],enumerable:!0})},Si=(n,e,s,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ki(e))!Ci.call(n,i)&&i!==s&&et(n,i,{get:()=>e[i],enumerable:!(t=_i(e,i))||t.enumerable});return n};var Ri=n=>Si(et({},"__esModule",{value:!0}),n);var Vi={};Ei(Vi,{Tooltip:()=>oe,TsAlert:()=>Yt,TsBase:()=>ne,TsColor:()=>De,TsConfirm:()=>Xt,TsDate:()=>qe,TsDialog:()=>Me,TsEvent:()=>$e,TsField:()=>de,TsForm:()=>Je,TsGrid:()=>Ke,TsLayout:()=>Ye,TsLocale:()=>_e,TsMenu:()=>ie,TsPopup:()=>he,TsPrompt:()=>Kt,TsSidebar:()=>We,TsTabs:()=>Te,TsToolbar:()=>pe,TsTooltip:()=>G,TsUi:()=>se,TsUtils:()=>p,query:()=>Ee});var _e={locale:"en-US",dateFormat:"m/d/yyyy",timeFormat:"hh:mi pm",datetimeFormat:"m/d/yyyy|hh:mi pm",currencyPrefix:"$",currencySuffix:"",currencyPrecision:2,groupSymbol:",",decimalSymbol:".",shortmonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],fullmonths:["January","February","March","April","May","June","July","August","September","October","November","December"],shortdays:["M","T","W","T","F","S","S"],fulldays:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],weekStarts:"S",phrases:{"${count} letters or more...":"---","Add new record":"---","Add New":"---","Advanced Search":"---",after:"---","AJAX error. See console for more details.":"---","All Fields":"---",All:"---",Any:"---","Are you sure you want to delete ${count} ${records}?":"---","Attach files by dragging and dropping or Click to Select":"---",before:"---","begins with":"---",begins:"---",between:"---",buffered:"---",Cancel:"---",Close:"---",Column:"---",Confirmation:"---",contains:"---",Copied:"---","Copy to clipboard":"---","Current Date & Time":"---","Delete selected records":"---",Delete:"---",'Do you want to delete search item "${item}"?':"---","Edit selected record":"---",Edit:"---","Empty list":"---","ends with":"---",ends:"---","Field should be at least ${count} characters.":"---",Hide:"---",in:"---","is not":"---",is:"---","less than":"---","Line #":"---","Load ${count} more...":"---","Loading...":"---","Maximum number of files is ${count}":"---","Maximum total size is ${count}":"---",Modified:"---","more than":"---","Multiple Fields":"---",Name:"---","No items found":"---","No matches":"---",No:"---",none:"---","Not a float":"---","Not a hex number":"---","Not a valid date":"---","Not a valid email":"---","Not alpha-numeric":"---","Not an integer":"---","Not in money format":"---","not in":"---",Notification:"---",of:"---",Ok:"---",Opacity:"---","Record ID":"---",record:"---",records:"---","Refreshing...":"---",RegEx:"---",regex:"---","Reload data in the list":"---",Remove:"---","Remove This Field":"---","Request aborted.":"---","Required field":"---",Reset:"---","Restore Default State":"---","Returned data is not in valid JSON format.":"---","Save changed records":"---","Save Grid State":"---",Save:"---","Saved Searches":"---","Saving...":"---","Search took ${count} seconds":"---",Search:"---","Select Hour":"---","Select Minute":"---",selected:"---","Server Response ${count} seconds":"---","Show/hide columns":"---",Show:"---",Size:"---",Skip:"---","Sorting took ${count} seconds":"---","Type to search...":"---",Type:"---",Yes:"---",Yesterday:"---","Your remote data source record count has changed, reloading from the first record.":"---"}};var Ie=class n{static version=.8;context;nodes;length;constructor(e,s){this.context=s??document;let t=[];if(Array.isArray(e))t=e;else if(e instanceof Node||e instanceof Window)t=[e];else if(e instanceof n)t=e.nodes;else if(typeof e=="string"){if(typeof this.context.querySelector!="function")throw new Error("Invalid context");t=Array.from(this.context.querySelectorAll(e))}else if(e==null)t=[];else{let i=Array.from(e??[]);if(typeof e=="object"&&Array.isArray(i))t=i;else throw new Error(`Invalid selector "${e}"`)}this.nodes=t,this.length=t.length,this.each((i,o)=>{this[o]=i})}static _fragment(e){let s=document.createElement("template");return s.innerHTML=e,s.content.childNodes.forEach(t=>{let i=n._scriptConvert(t);i!=t&&s.content.replaceChild(i,t)}),s.content}static _scriptConvert(e){let s=t=>{let o=t.ownerDocument.createElement("script");o.text=t.text;let l=t.attributes;for(let a=0;a<l.length;a++){let r=l[a];r&&o.setAttribute(r.name,r.value)}return o};return e.tagName=="SCRIPT"&&(e=s(e)),e.querySelectorAll&&e.querySelectorAll("script").forEach(t=>{t.parentNode.replaceChild(s(t),t)}),e}static _fixProp(e){let s={cellpadding:"cellPadding",cellspacing:"cellSpacing",class:"className",colspan:"colSpan",contenteditable:"contentEditable",for:"htmlFor",frameborder:"frameBorder",maxlength:"maxLength",readonly:"readOnly",rowspan:"rowSpan",tabindex:"tabIndex",usemap:"useMap"};return s[e]?s[e]:e}_insert(e,s){let t=[],i=this.length;if(i<1)return this;if(typeof s=="string")this.each(o=>{let l=n._fragment(s);t.push(...l.childNodes),o[e]?.(l)});else if(s instanceof n){let o=i==1;s.each(l=>{this.each(a=>{let r=o?l:l.cloneNode(!0);t.push(r),a[e]?.(r),n._scriptConvert(r)})}),o||s.remove()}else if(s instanceof Node)this.each(o=>{let l=i===1?s:n._fragment(s.outerHTML);t.push(...i===1?[s]:l.childNodes),o[e]?.(l)}),i>1&&s.remove();else throw new Error(`Incorrect argument for "${e}(html)". It expects one string argument.`);return e=="replaceWith"?new n(t,this.context):this}_save(e,s,t){e._mQuery=e._mQuery??{},Array.isArray(t)?(e._mQuery[s]=e._mQuery[s]??[],e._mQuery[s].push(...t)):t!=null?e._mQuery[s]=t:delete e._mQuery[s]}get(e){if(e==null)return this.nodes;e<0&&(e=this.length+e);let s=this[e];return s||null}eq(e){e<0&&(e=this.length+e);let s=this[e],t=s!=null?[s]:[];return new n(t,this.context)}then(e){let s=e(this);return s??this}find(e){let s=[];return this.each(t=>{let i=Array.from(t.querySelectorAll(e));i.length>0&&s.push(...i)}),new n(s,this.context)}filter(e){let s=[];return this.each(t=>{(t===e||typeof e=="string"&&t.matches&&t.matches(e)||typeof e=="function"&&e(t))&&s.push(t)}),new n(s,this.context)}next(){let e=[];return this.each(s=>{let t=s.nextElementSibling;t&&e.push(t)}),new n(e,this.context)}prev(){let e=[];return this.each(s=>{let t=s.previousElementSibling;t&&e.push(t)}),new n(e,this.context)}shadow(e){let s=[];this.each(i=>{i.shadowRoot&&s.push(i.shadowRoot)});let t=new n(s,this.context);return e?t.find(e):t}closest(e){let s=[];return this.each(t=>{let i=t.closest(e);i&&s.push(i)}),new n(s,this.context)}host(e){let s=[],t=o=>o.parentNode?t(o.parentNode):o,i=o=>{let l=t(o);s.push(l.host?l.host:l),l.host&&e&&i(l.host)};return this.each(o=>{i(o)}),new n(s,this.context)}parent(e){return this.parents(e,!0)}parents(e,s){let t=[],i=l=>{if(t.indexOf(l)==-1&&t.push(l),!s&&l.parentNode)return i(l.parentNode)};this.each(l=>{l.parentNode&&i(l.parentNode)});let o=new n(t,this.context);return e?o.filter(e):o}add(e){let s=e instanceof n?e.nodes:Array.isArray(e)?e:[e];return new n(this.nodes.concat(s),this.context)}each(e){return this.nodes.forEach((s,t)=>{e(s,t,this)}),this}append(e){return this._insert("append",e)}prepend(e){return this._insert("prepend",e)}after(e){return this._insert("after",e)}before(e){return this._insert("before",e)}replace(e){return this._insert("replaceWith",e)}remove(){return this.each(e=>{e.remove()}),this}css(e,s){let t=typeof e=="object"?e:{},i=arguments.length;if(i===0||i===1&&typeof e=="string")if(this[0]){let o=this[0].style;if(typeof e=="string"){let l=o.getPropertyPriority(e);return o.getPropertyValue(e)+(l?"!"+l:"")}else return Object.fromEntries(this[0].style.cssText.split(";").filter(l=>!!l).map(l=>l.split(":").map(a=>a.trim())))}else return;else return typeof e!="object"&&(t={},t[e]=s),this.each(o=>{Object.keys(t).forEach(l=>{let a=String(t[l]).toLowerCase().includes("!important")?"important":"";o.style.setProperty(l,String(t[l]).replace(/\!important/i,""),a)})}),this}addClass(e){return this.toggleClass(e,!0),this}removeClass(e){return this.toggleClass(e,!1),this}toggleClass(e,s){return typeof e=="string"&&(e=e.split(/[,\s]+/)),this.each(t=>{let i=e;i==null&&s===!1&&(i=Array.from(t.classList)),i&&i.forEach(o=>{if(o!==""){let l="toggle";s!=null&&(l=s?"add":"remove"),t.classList[l](o)}})}),this}hasClass(e){if(typeof e=="string"&&(e=e.split(/[,\s]+/)),e==null&&this.length>0)return Array.from(this[0].classList);let s=!1;return this.each(t=>{s=s||e.every(i=>Array.from(t.classList??[]).includes(i))}),s}on(e,s,t){let i;typeof s=="function"?(t=s,i=void 0):i=s;let o;return i?.delegate&&(o=i.delegate,delete i.delegate),e.split(/[,\s]+/).forEach(a=>{let r=String(a).toLowerCase().split("."),c=r[0]??"",d=r[1],u=t;if(o){let h=u;u=f=>{let m=j(f.target).parents(o);m.length>0?f.delegate=m[0]:f.delegate=f.target,(f.target.matches(o)||m.length>0)&&h(f)}}this.each(h=>{this._save(h,"events",[{event:c,scope:d,callback:u,options:i}]),h.addEventListener(c,u,i)})}),this}off(e,s,t){return typeof s=="function"&&(t=s,s=void 0),(e??"").split(/[,\s]+/).forEach(o=>{let l=String(o).toLowerCase().split("."),a=l[0]??"",r=l[1];this.each(c=>{if(Array.isArray(c._mQuery?.events))for(let d=c._mQuery.events.length-1;d>=0;d--){let u=c._mQuery.events[d];u&&(r==null||r===""?(u.event==a||a==="")&&(u.callback==t||t==null)&&(c.removeEventListener(u.event,u.callback,u.options),c._mQuery.events.splice(d,1)):(u.event==a||a==="")&&u.scope==r&&(c.removeEventListener(u.event,u.callback,u.options),c._mQuery.events.splice(d,1)))}})}),this}trigger(e,s){let t,i=["click","dblclick","mousedown","mouseup","mousemove"],o=["keydown","keyup","keypress"];return e instanceof Event?t=e:i.includes(e)?t=new MouseEvent(e,s):o.includes(e)?t=new KeyboardEvent(e,s):t=new Event(e,s),this.each(l=>{l.dispatchEvent(t)}),this}attr(e,s){if(s===void 0&&typeof e=="string")return this[0]?this[0].getAttribute(e)??void 0:void 0;{let t={};return typeof e=="object"?t=e:t[e]=s,this.each(i=>{Object.entries(t).forEach(([o,l])=>{i.setAttribute(o,l)})}),this}}removeAttr(...e){return this.each(s=>{e.forEach(t=>{s.removeAttribute(t)})}),this}prop(e,s){if(s===void 0&&typeof e=="string")return this[0]?this[0][e]:void 0;{let t={};return typeof e=="object"?t=e:t[e]=s,this.each(i=>{Object.entries(t).forEach(([o,l])=>{let a=n._fixProp(o);i[a]=l,a=="innerHTML"&&n._scriptConvert(i)})}),this}}removeProp(...e){return this.each(s=>{e.forEach(t=>{delete s[n._fixProp(t)]})}),this}data(e,s){if(e instanceof Object&&typeof e!="string"){Object.entries(e).forEach(t=>{this.data(t[0],t[1])});return}if(e&&typeof e=="string"&&e.indexOf("-")!=-1&&console.error(`Key "${e}" contains "-" (dash). Dashes are not allowed in property names. Use camelCase instead.`),arguments.length<2)if(this[0]){let t=Object.assign({},this[0].dataset);return Object.keys(t).forEach(i=>{let o=t[i];if(o.startsWith("[")||o.startsWith("{"))try{t[i]=JSON.parse(o)}catch{}}),e?t[e]:t}else return;else return this.each(t=>{s!=null?t.dataset[e]=s instanceof Object?JSON.stringify(s):s:delete t.dataset[e]}),this}removeData(e){return typeof e=="string"&&(e=e.split(/[,\s]+/)),this.each(s=>{e.forEach(t=>{delete s.dataset[t]})}),this}show(){return this.toggle(!0)}hide(){return this.toggle(!1)}toggle(e){return this.each(s=>{let t=s.style.display,i=getComputedStyle(s).display,o=t=="none"||i=="none";if(o&&(e==null||e===!0)){let l=s instanceof HTMLTableRowElement?"table-row":s instanceof HTMLTableCellElement?"table-cell":"block";s.style.display=s._mQuery?.prevDisplay??(t==i&&i!="none"?"":l),this._save(s,"prevDisplay",null)}!o&&(e==null||e===!1)&&(i!="none"&&this._save(s,"prevDisplay",i),s.style.setProperty("display","none"))})}empty(){return this.html("")}html(e){return e instanceof HTMLElement?this.empty().append(e):this.prop("innerHTML",e)}text(e){return this.prop("textContent",e)}val(e){return this.prop("value",e)}change(){return this.trigger("change")}click(){return this.trigger("click")}},j=function(n,e){if(typeof n=="function"){let s=n;document.readyState=="complete"?s():window.addEventListener("load",s)}else return new Ie(n,e)};j.html=n=>{let e=Ie._fragment(n);return j(e.children,e)};j.version=Ie.version;function pt(n){return/^[0-1]+$/.test(String(n))}function re(n){return/^[-+]?[0-9]+$/.test(String(n))}function tt(n,e){return typeof n=="string"&&(n=n.replace(new RegExp(e.groupSymbol,"g"),"").replace(e.decimalSymbol,".")),(typeof n=="number"||typeof n=="string"&&n!=="")&&!isNaN(Number(n))}function mt(n,e){if(typeof n=="object"||n==="")return!1;if(tt(n,e))return!0;let s=e,t=new RegExp("^"+(s.currencyPrefix?"\\"+s.currencyPrefix+"?":"")+"[-+]?"+(s.currencyPrefix?"\\"+s.currencyPrefix+"?":"")+"[0-9]*[\\"+s.decimalSymbol+"]?[0-9]+"+(s.currencySuffix?"\\"+s.currencySuffix+"?":"")+"$","i");return typeof n=="string"&&(n=n.replace(new RegExp(s.groupSymbol,"g"),"")),t.test(String(n))}function gt(n){return/^(0x)?[0-9a-fA-F]+$/.test(String(n))}function Ae(n){return/^[a-zA-Z0-9_-]+$/.test(String(n))}function yt(n){return/^[a-zA-Z0-9._%\-+]+@[а-яА-Яa-zA-Z0-9.-]+\.[а-яА-Яa-zA-Z]+$/.test(String(n))}function bt(n){return new RegExp("^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$").test(String(n))}function ke(n){if(n==null||Object.prototype.toString.call(n)!=="[object Object]")return!1;if(n.constructor===void 0)return!0;let e=Object.getPrototypeOf(n);return e===null||e===Object.prototype}function st(n){if(typeof n!="string")return null;n=n.trim().toUpperCase(),n[0]==="#"&&(n=n.substr(1));let e={r:0,g:0,b:0,a:1};if(n.length===3){let s=n[0]??"0",t=n[1]??"0",i=n[2]??"0";e={r:parseInt(s+s,16),g:parseInt(t+t,16),b:parseInt(i+i,16),a:1}}else if(n.length===6)e={r:parseInt(n.substr(0,2),16),g:parseInt(n.substr(2,2),16),b:parseInt(n.substr(4,2),16),a:1};else if(n.length===8)e={r:parseInt(n.substr(0,2),16),g:parseInt(n.substr(2,2),16),b:parseInt(n.substr(4,2),16),a:Math.round(parseInt(n.substr(6,2),16)/255*100)/100};else if(n.length>4&&n.substr(0,4)==="RGB("){let s=n.replace("RGB","").replace(/\(/g,"").replace(/\)/g,"").split(",");e={r:parseInt(s[0]??"0",10),g:parseInt(s[1]??"0",10),b:parseInt(s[2]??"0",10),a:1}}else if(n.length>5&&n.substr(0,5)==="RGBA("){let s=n.replace("RGBA","").replace(/\(/g,"").replace(/\)/g,"").split(",");e={r:parseInt(s[0]??"0",10),g:parseInt(s[1]??"0",10),b:parseInt(s[2]??"0",10),a:parseFloat(s[3]??"1")}}else return null;return e}function nt(n,e){let s=i(n),t=i(e);return(Math.max(s,t)+.05)/(Math.min(s,t)+.05);function i(o){let{r:l,g:a,b:r}=st(o)??{r:0,g:0,b:0,a:1},c=2.2,d=l/255,u=a/255,h=r/255,f=d<=.03928?d/12.92:Math.pow((d+.055)/1.055,c),m=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,c),y=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,c);return .2126*f+.7152*m+.0722*y}}function xt(n,e){return nt(n,e).toFixed(2)}function vt(n,e,s,t){let i,o,l;typeof n=="object"&&n!==null&&(e=n.s,s=n.v,t=n.a,n=n.h),n=n/360,e=e/100,s=s/100;let a=Math.floor(n*6),r=n*6-a,c=s*(1-e),d=s*(1-r*e),u=s*(1-(1-r)*e);switch(a%6){case 0:i=s,o=u,l=c;break;case 1:i=d,o=s,l=c;break;case 2:i=c,o=s,l=u;break;case 3:i=c,o=d,l=s;break;case 4:i=u,o=c,l=s;break;case 5:i=s,o=c,l=d;break}return{r:Math.round((i??0)*255),g:Math.round((o??0)*255),b:Math.round((l??0)*255),a:t??1}}function Tt(n,e,s,t){typeof n=="object"&&n!==null&&(e=n.g,s=n.b,t=n.a,n=n.r);let i=Math.max(n,e,s),o=Math.min(n,e,s),l=i-o,a,r=i===0?0:l/i,c=i/255;switch(i){case o:a=0;break;case n:a=e-s+l*(e<s?6:0),a/=6*l;break;case e:a=s-n+l*2,a/=6*l;break;case s:a=n-e+l*4,a/=6*l;break}return{h:Math.round((a??0)*360),s:Math.round(r*100),v:Math.round(c*100),a:t??1}}function Ce(n,e){let s=Object.assign({functions:!0,elements:!0,events:!0,exclude:[],parent:""},e??{});if(Array.isArray(n)){let t=Array.from(n);return t.forEach((i,o)=>{t[o]=Ce(i,{functions:s.functions,elements:s.elements,events:s.events,exclude:s.exclude,parent:s.parent+"[]"})}),t}else if(ke(n)){let t={};return Object.assign(t,n),Array.isArray(s.exclude)&&s.exclude.forEach(i=>{delete t[i]}),Object.keys(t).forEach(i=>{typeof s.exclude=="function"&&s.exclude(i,{obj:n,parent:s.parent})?t[i]=void 0:t[i]=Ce(t[i],{functions:s.functions,elements:s.elements,events:s.events,exclude:s.exclude,parent:s.parent+(s.parent?".":"")+i}),t[i]===void 0&&delete t[i]}),t}else return n instanceof Function&&!s.functions||n instanceof Node&&!s.elements||n instanceof Event&&!s.events?void 0:n}function te(n,e,...s){if(Array.isArray(n))if(Array.isArray(e))n.splice(0,n.length),e.forEach(t=>{n.push(Ce(t))});else throw new Error("Arrays can be extended with arrays only");else{if(n instanceof Node||n instanceof Event)throw new Error("HTML elmenents and events cannot be extended");if(n&&typeof n=="object"&&e!=null){if(typeof e!="object")throw new Error("Object can be extended with other objects only.");Object.keys(e).forEach(t=>{if(n[t]!=null&&typeof n[t]=="object"&&e[t]!=null&&typeof e[t]=="object"){let i=Ce(e[t]);n[t]instanceof Node||n[t]instanceof Event?n[t]=i:(Array.isArray(n[t])&&ke(i)&&(n[t]={}),te(n[t],i))}else n[t]=Ce(e[t])})}else if(e!=null)throw new Error("Object is not extendable, only {} or [] can be extended.")}if(s.length>0)for(let t=0;t<s.length;t++)te(n,s[t]);return n}function wt(n,e){let s=0,t=0,i=1,o=0,l=0,a=String.alphabet;function r(u,h,f){if(f){for(s=h;f=r(u,s),f<76&&f>65;)++s;return+u.slice(h-1,s)}let m=a?a.indexOf(u.charAt(h)):-1;return m>-1?m+76:(m=u.charCodeAt(h)||0,m<45||m>127?m:m<46?65:m<48?m-1:m<58?m+18:m<65?m-11:m<91?m+11:m<97?m-37:m<123?m+5:m-63)}let c=""+n,d=""+e;if(c!=d){for(;i;)if(t=r(c,o++),i=r(d,l++),t<76&&i<76&&t>66&&i>66&&(t=r(c,o,o),i=r(d,l,o=s),l=s),t!=i)return t<i?-1:1}return 0}function Fe(n,e){let s;try{s=n;let t=String(e).split(".");for(let i=0;i<t.length;i++)s=s[t[i]??""]}catch{s=void 0}return s}function it(n,e={}){if(Array.isArray(n))return n.forEach((s,t)=>{if(typeof s=="string"||typeof s=="number")n[t]={id:s,text:String(s)};else if(s!=null){if(e.itemMap!=null){let i=Fe(s,e.itemMap.id);e.itemMap.id!=null&&i!=null&&(s.id=i),i=Fe(s,e.itemMap.text),e.itemMap.text!=null&&i&&(s.text=i)}s.caption!=null&&s.text==null&&(s.text=s.caption),s.text!=null&&s.id==null&&(s.id=s.text),s.text==null&&s.id!=null&&(s.text=s.id)}else n[t]={id:null,text:"null"}}),n;if(typeof n=="function"){let s=n(n,e);return it(s,e)}else if(typeof n=="object"&&n!==null){let s=n;return Object.keys(s).map(t=>({id:t,text:String(s[t]??"")}))}}function ot(n,e=""){let s="";return Object.keys(n).forEach(t=>{s!=""&&(s+="&"),typeof n[t]=="object"?s+=ot(n[t],e+t+(e?"]":"")+"["):s+=`${e}${t}${e?"]":""}=${n[t]}`}),s}function _t(n,e,s,t){let i=s?.dataType??t,o=e.body;switch(e.method=String(e.method).toUpperCase(),i){case"RESTFULL":case"RESTFULJSON":{["POST","PUT","DELETE"].includes(String(e.method))&&(e.headers["Content-Type"]="application/json"),String(e.method)=="GET"&&(i=="RESTFULLJSON"&&(o={request:o}),l());break}case"HTTP":case"HTTPJSON":case"JSON":{String(e.method)=="GET"?((i=="JSON"||i==="HTTPJSON")&&(o={request:o}),l()):(e.headers["Content-Type"]="application/json",e.method="POST");break}default:typeof i=="function"?e=i(n,e,s):console.log(`ERROR: Unsupported dataType "${i}". Supported types are JSON (default), HTTP, RESTFULL. For backward compatibility HTTPJSON is same as JSON. RESTULFLJSON will encode GET request as JSON.`)}return e.body!=null&&(e.body=typeof e.body=="string"?e.body:JSON.stringify(e.body)),e;function l(){let a=o;Object.keys(a).forEach(r=>{let c=a[r];typeof c=="object"&&(c=JSON.stringify(c)),n.searchParams.append(r,String(c??""))}),delete e.body}}function kt(n){let e=[],s=n.replace(/\/\(/g,"(?:/").replace(/\+/g,"__plus__").replace(/(\/)?(\.)?:(\w+)(?:(\(.*?\)))?(\?)?/g,(t,i,o,l,a,r)=>(e.push({name:l,optional:!!r}),i=i||"",""+(r?"":i)+"(?:"+(r?i:"")+(o||"")+(a||o&&"([^/.]+?)"||"([^/]+?)")+")"+(r||""))).replace(/([\/.])/g,"\\$1").replace(/__plus__/g,"(.+)").replace(/\*/g,"(.*)");return{path:new RegExp("^"+s+"$","i"),keys:e}}function Ct(n,e=250){let s;return(...t)=>{clearTimeout(s),s=setTimeout(()=>{n(...t)},e)}}async function Et(n=0){return new Promise(e=>{setTimeout(()=>e(),n)})}function He(n){if(n==null)return n;switch(typeof n){case"number":break;case"string":n=String(n).replace(/(?:\r\n|\r|\n)/g," ").replace(/\s\s+/g," ").trim();break;case"object":if(Array.isArray(n)){let e=te([],n);return e.forEach((s,t)=>{e[t]=He(s)}),e}else{let e=te({},n);return Object.keys(e).forEach(s=>{e[s]=He(e[s])}),e}}return n}function Ne(n){if(n==null)return n;switch(typeof n){case"number":break;case"string":n=String(n).replace(/<(?:[^>=]|='[^']*'|="[^"]*"|=[^'"][^\s>]*)*>/ig,"");break;case"object":if(Array.isArray(n)){let e=te([],n);return e.forEach((s,t)=>{e[t]=Ne(s)}),e}else{let e=te({},n);return Object.keys(e).forEach(s=>{e[s]=Ne(e[s])}),e}}return n}function Re(n){if(n==null)return n;switch(typeof n){case"number":break;case"string":n=String(n).replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/"/g,""");break;case"object":if(Array.isArray(n)){let e=te([],n);return e.forEach((s,t)=>{e[t]=Re(s)}),e}else{let e=te({},n);return Object.keys(e).forEach(s=>{e[s]=Re(e[s])}),e}}return n}function Pe(n){if(n==null)return n;switch(typeof n){case"number":break;case"string":n=String(n).replace(/>/g,">").replace(/</g,"<").replace(/"/g,'"').replace(/&/g,"&");break;case"object":if(Array.isArray(n)){let e=te([],n);return e.forEach((s,t)=>{e[t]=Pe(s)}),e}else{let e=te({},n);return Object.keys(e).forEach(s=>{e[s]=Pe(e[s])}),e}}return n}function St(n){if(n===""||n==null)return"";let e=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\w-]/g;return(n+"").replace(e,(s,t)=>t?s==="\0"?"\uFFFD":s.slice(0,-1)+"\\"+s.charCodeAt(s.length-1).toString(16)+" ":"\\"+s)}function Rt(n){if(n===""||n==null)return"";let e=/\\[\da-fA-F]{1,6}[\x20\t\r\n\f]?|\\([^\r\n\f])/g;return n.replace(e,(s,t)=>{let i=parseInt("0x"+s.slice(1),16)-65536;return t||(i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,i&1023|56320))})}function $t(n){let e=new TextEncoder().encode(n),s="";for(let t of e)s+=String.fromCharCode(t);return btoa(s)}function Mt(n){let e=atob(n),s=new Uint8Array(e.length);for(let t=0;t<e.length;t++)s[t]=e.charCodeAt(t);return new TextDecoder().decode(s)}async function Dt(n){let e=new TextEncoder().encode(n);return crypto.subtle.digest("SHA-256",e).then(s=>Array.from(new Uint8Array(s)).map(i=>i.toString(16).padStart(2,"0")).join(""))}function It(n,e){return typeof n!="string"||!e||typeof e!="object"?n:n.replace(/\${([^}]+)?}/g,function(s,t){return e[t]||t})}var $i=j;function Ot(n,e){let s=new RegExp(`<${e.tag}[^>]*class=["']${e.class.replace(/-/g,"\\-")}["'][^>]*>([\\s\\S]*?)<\\/${e.tag}>`,"ig");if(typeof n=="string")for(;n.indexOf(`<${e.tag} class="${e.class}"`)!==-1;)n=n.replace(s,"$1");else for(;n.innerHTML.indexOf(`<${e.tag} class="${e.class}"`)!==-1;)n.innerHTML=n.innerHTML.replace(s,"$1")}function je(n,e,s,t){let i=t.wholeWord;typeof e!="string"&&(e=String(e)),e=e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&").replace(/&/g,"&").replace(/</g,">").replace(/>/g,"<");let o=new RegExp((i?"\\b":"")+e+(i?"\\b":"")+"(?![^<]*>)","i"+(t.onlyFirst?"":"g"));return n=n.replace(o,s)}function zt(n,e,s={onlyFirst:!1,wholeWord:!1,isRegex:!1}){s.tag??="span",s.class??="tsg-marker",s.raplace=i=>`<${s.tag} class="${s.class}">${i}</${s.tag}>`;let t=s.isRegex||!1;return Array.isArray(e)||(e!=null&&e!==""?e=[e]:e=[]),typeof n=="string"?(Ot(n,s),e.forEach(i=>{if(t)try{let o="i"+(s.onlyFirst?"":"g"),l=new RegExp(i,o);n=n.replace(l,s.raplace)}catch(o){console.error("Invalid regular expression:",o),n=je(n,i,s.raplace,s)}else n=je(n,i,s.raplace,s)})):$i(n).each(i=>{Ot(i,s),t?e.forEach(o=>{try{let d=function(u){if(u.nodeType===3)c.push(u);else if(u.nodeType===1&&u.tagName!=="SCRIPT"&&u.tagName!=="STYLE")for(let h=0;h<u.childNodes.length;h++)d(u.childNodes[h])};var l=d;let a="i";s.onlyFirst||(a+="g"),s.wholeWord&&(o="\b"+o+"\b");let r=new RegExp(o,a),c=[];d(i),c.forEach(u=>{let h=u.nodeValue,f=[],m;if(s.onlyFirst)m=r.exec(h),m&&f.push({index:m.index,text:m[0]});else for(;(m=r.exec(h))!==null;)f.push({index:m.index,text:m[0]});if(f.length>0){let y=u.parentNode,x=document.createDocumentFragment(),b=0;f.forEach(g=>{g.index>b&&x.appendChild(document.createTextNode(h.substring(b,g.index)));let v=document.createElement(s.tag);v.className=s.class,v.appendChild(document.createTextNode(g.text)),x.appendChild(v),b=g.index+g.text.length}),b<h.length&&x.appendChild(document.createTextNode(h.substring(b))),y.replaceChild(x,u)}})}catch(a){console.error("Invalid regular expression:",a),i.innerHTML=je(i.innerHTML,o,s.raplace,s)}}):e.forEach(o=>{i.innerHTML=je(i.innerHTML,o,s.raplace,s)})}),n}var se={};function Ue(n){return n==null?(console.log('ERROR: Property "name" is required but not supplied.'),!1):se[n]!=null?(console.log(`ERROR: Object named "${n}" is already registered as TsUi.${n}.`),!1):Ae(n)?!0:(console.log('ERROR: Property "name" has to be alpha-numeric (a-z, 0-9, dash and underscore).'),!1)}var ve=j;function Lt(n,e,s){return new Promise(t=>{let i=e??{},o="";typeof n=="object"?(i=n,o=String(i.text??"")):o=String(n??""),i.where??=document.body,i.timeout??=15e3,typeof s.tmpSlot.notify_resolve=="function"&&(s.tmpSlot.notify_resolve(),ve(s.tmpSlot.notify_where).find("#tsg-notify").remove()),s.tmpSlot.notify_resolve=t,s.tmpSlot.notify_where=i.where,clearTimeout(s.tmpSlot.notify_timer);let l=i.where;if(o){if(typeof i.actions=="object"){let r={};Object.keys(i.actions).forEach(c=>{r[c]=`<a class="tsg-notify-link" value="${c}">${c}</a>`}),o=s.execTemplate(o,r)}let a=`
|
|
3
3
|
<div id="tsg-notify" style="${l==document.body?"position: fixed":""}">
|
|
4
4
|
<div class="${i.class??""} ${i.error?"tsg-notify-error":""} ${i.success?"tsg-notify-success":""}">
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { TsBase } from './base.js';
|
|
2
|
+
import './query-CKGg5Ugv.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* TsUtils message cluster (message/alert/confirm/prompt/normButtons + types)
|
|
6
|
+
* — Phase 2-4 of v2.3 SDD (message-cluster-extraction).
|
|
7
|
+
*
|
|
8
|
+
* IMPORTANT: This module imports TsBase from tsbase.ts — the only carve-out
|
|
9
|
+
* to INV-4. Rationale: message() does `new TsBase()` to mix events into msgBase.
|
|
10
|
+
* This exception is documented here and whitelisted in the INV-4 grep policy.
|
|
11
|
+
*
|
|
12
|
+
* Exports (Phase 2):
|
|
13
|
+
* normButtons — standalone pure helper; no DOM, no timers
|
|
14
|
+
*
|
|
15
|
+
* Exports (Phase 3a):
|
|
16
|
+
* TsMessageProm, TsMessageWhere, TsMessageOptions (types)
|
|
17
|
+
* MessageDeps (deps interface for _message — scaffold for Phase 3b)
|
|
18
|
+
* _message (stub — body lands in Phase 3b)
|
|
19
|
+
*
|
|
20
|
+
* Exports (Phase 3b+):
|
|
21
|
+
* _message (full body), _alert, _confirm, _prompt (Phase 4)
|
|
22
|
+
*
|
|
23
|
+
* Imports: TsBase from tsbase.ts (INV-4 carve-out, see above)
|
|
24
|
+
* TsUISettings type from tsutils.ts (type-only, no runtime dep)
|
|
25
|
+
* query from query.js (DOM helper)
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/** Promise-chain handle returned by message() / confirm() / prompt() */
|
|
29
|
+
interface TsMessageProm {
|
|
30
|
+
self: TsBase;
|
|
31
|
+
action(callBack: (event: unknown) => void): TsMessageProm;
|
|
32
|
+
close(callBack: (event: unknown) => void): TsMessageProm;
|
|
33
|
+
open(callBack: (event: unknown) => void): TsMessageProm;
|
|
34
|
+
then(callBack: (event: unknown) => void): TsMessageProm;
|
|
35
|
+
change?: (callBack: (event: unknown) => void) => TsMessageProm;
|
|
36
|
+
[key: string]: unknown;
|
|
37
|
+
}
|
|
38
|
+
/** Where-descriptor for message() */
|
|
39
|
+
interface TsMessageWhere {
|
|
40
|
+
box: string | Element | null;
|
|
41
|
+
after?: string | Element | null;
|
|
42
|
+
owner?: {
|
|
43
|
+
name?: string;
|
|
44
|
+
lock?: (...args: unknown[]) => void;
|
|
45
|
+
unlock?: (...args: unknown[]) => void;
|
|
46
|
+
focus?: () => void;
|
|
47
|
+
};
|
|
48
|
+
param?: unknown;
|
|
49
|
+
}
|
|
50
|
+
/** Options for message() */
|
|
51
|
+
interface TsMessageOptions {
|
|
52
|
+
width?: number;
|
|
53
|
+
height?: number;
|
|
54
|
+
text?: string | null;
|
|
55
|
+
body?: string;
|
|
56
|
+
buttons?: string;
|
|
57
|
+
html?: string;
|
|
58
|
+
focus?: number | string | null;
|
|
59
|
+
hideOn?: string[];
|
|
60
|
+
actions?: Record<string, unknown>;
|
|
61
|
+
cancelAction?: string;
|
|
62
|
+
on?: unknown;
|
|
63
|
+
onOpen?: unknown;
|
|
64
|
+
onClose?: unknown;
|
|
65
|
+
onAction?: unknown;
|
|
66
|
+
originalWidth?: number;
|
|
67
|
+
originalHeight?: number;
|
|
68
|
+
msgIndex?: number;
|
|
69
|
+
tmp?: {
|
|
70
|
+
zIndex: string;
|
|
71
|
+
overflow: string;
|
|
72
|
+
};
|
|
73
|
+
input?: Element | null;
|
|
74
|
+
box?: Element | null;
|
|
75
|
+
trigger?: (event: string, data: Record<string, unknown>) => unknown;
|
|
76
|
+
close?: () => void;
|
|
77
|
+
setFocus?: (focus: number | string | null | undefined) => void;
|
|
78
|
+
action?: (action: string, event: unknown) => void;
|
|
79
|
+
[key: string]: unknown;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export type { TsMessageOptions as T, TsMessageProm as a, TsMessageWhere as b };
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Q as Query } from './query-CKGg5Ugv.js';
|
|
2
|
-
import { b as TsMessageWhere,
|
|
2
|
+
import { b as TsMessageWhere, T as TsMessageOptions, a as TsMessageProm } from './tsutils-message-BC0wOHZs.js';
|
|
3
3
|
import './base.js';
|
|
4
4
|
|
|
5
5
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tsgrid-ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.0",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"./dist/tsgrid-ui.css",
|
|
6
6
|
"./dist/tsgrid-ui.min.css",
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
"./field": { "types": "./dist/field.d.ts", "import": "./dist/field.es6.js" },
|
|
56
56
|
"./layout": { "types": "./dist/layout.d.ts", "import": "./dist/layout.es6.js" },
|
|
57
57
|
"./form": { "types": "./dist/form.d.ts", "import": "./dist/form.es6.js" },
|
|
58
|
+
"./grid": { "types": "./dist/grid.d.ts", "import": "./dist/grid.es6.js" },
|
|
58
59
|
"./css": "./dist/tsgrid-ui.css",
|
|
59
60
|
"./package.json": "./package.json"
|
|
60
61
|
},
|