dynamic-html-helpers 1.5.8 → 1.6.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/Bundle/htmlhelpers.min.js +8 -8
- package/Bundle/htmlhelpers.min.js.map +3 -3
- package/Bundle/htmlhelpers.script.js +39 -95
- package/Bundle/htmlhelpers.script.js.map +3 -3
- package/Resource/Externals/jqx.min.js +3 -3
- package/Resource/Externals/jqx.min.js.map +3 -3
- package/Resource/Externals/splat.min.js +1 -1
- package/index.js +11 -11
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var O=f(),h=f({defaultReplacer:""});function f(i={}){let{defaultReplacer:n,useSymbolicExtensions:a}=i;return n=l(n)?String(n):void 0,typeof a=="boolean"&&a&&v(),function(e,...t){return j(e,m(t))};function p(e,t){return t&&typeof n=="string"?String(n):`{${e}}`}function s(e,t){let r=Object.hasOwn(t,e);return r&&l(t[e])?String(t[e]):p(e,r)}function y(e){return(...t)=>{let r=t.find(o=>o.key);return s(r?r.key:"_",e)}}function b(e,t){return e.replace(/\{(?<key>[a-z_\d]+)}/gim,y(t))}function d(e){let t=[];return Object.entries(e).forEach(([r,o])=>{o.forEach((c,u)=>(t[u]??={},t[u][r]=c))}),t}function g(e){return e.length===1&&Object.values(e[0]).every(Array.isArray)}function m(e){return g(e)?d(e[0]):e}function l(e){return typeof e=="string"||typeof e=="number"}function S(e){return Object.prototype.toString.call(e)==="[object Object]"}function j(e,t){let r=t?.length?t.filter(o=>S(o)).map((o,c)=>b(e,{...o,index:c+1})).join(""):e;return typeof n!="string"?r:r.replace(/\{
|
|
1
|
+
var O=f(),h=f({defaultReplacer:""});function f(i={}){let{defaultReplacer:n,useSymbolicExtensions:a}=i;return n=l(n)?String(n):void 0,typeof a=="boolean"&&a&&v(),function(e,...t){return j(e,m(t))};function p(e,t){return t&&typeof n=="string"?String(n):`{${e}}`}function s(e,t){let r=Object.hasOwn(t,e);return r&&l(t[e])?String(t[e]):p(e,r)}function y(e){return(...t)=>{let r=t.find(o=>o.key);return s(r?r.key:"_",e)}}function b(e,t){return e.replace(/\{(?<key>[a-z_\d]+)}/gim,y(t))}function d(e){let t=[];return Object.entries(e).forEach(([r,o])=>{o.forEach((c,u)=>(t[u]??={},t[u][r]=c))}),t}function g(e){return e.length===1&&Object.values(e[0]).every(Array.isArray)}function m(e){return g(e)?d(e[0]):e}function l(e){return typeof e=="string"||typeof e=="number"}function S(e){return Object.prototype.toString.call(e)==="[object Object]"}function j(e,t){let r=t?.length?t.filter(o=>S(o)).map((o,c)=>b(e,{...o,index:c+1})).join(""):e;return typeof n!="string"?r:r.replace(/\{.+}/gmi,n??"")}}function v(){return String.prototype[Symbol.for("interpolate")]||Object.defineProperties(String.prototype,{[Symbol.for("interpolate")]:{value(...i){return O(this,...i)}},[Symbol.for("interpolate$")]:{value(...i){return h(this,...i)}}}),[Symbol.for("interpolate"),Symbol.for("interpolate$")]}export{v as addSymbolicStringExtensions,O as default,h as interpolateClear,f as interpolateFactory};
|
package/index.js
CHANGED
|
@@ -28,29 +28,29 @@ function fixSBLinks2TopProblem() {
|
|
|
28
28
|
|
|
29
29
|
function logFactory(formatJSON = true) {
|
|
30
30
|
const logContainer = $(`<ul id="log2screen">`).first();
|
|
31
|
+
const [logLamda, logTopLambda] = [logItem(), logItem(true)];
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
log: (...txt) => txt.forEach( logLamda ),
|
|
35
|
+
logTop: (...txt) => txt.forEach( logTopLambda ),
|
|
36
|
+
};
|
|
31
37
|
|
|
32
38
|
function logItem(top = false) {
|
|
33
39
|
const where2PutIt = top ? $.at.start : $.at.end;
|
|
40
|
+
|
|
34
41
|
return content => {
|
|
35
42
|
if (content?.isJQx) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
).renderTo(logContainer, where2PutIt);
|
|
43
|
+
const item = $.li().append(content).addClass(!!content.data.get(`header`) ? `head` : ``);
|
|
44
|
+
return item.renderTo(logContainer, where2PutIt);
|
|
39
45
|
}
|
|
40
46
|
|
|
41
47
|
content = !$.IS(content, String, Number, Symbol) ? tryJSON(content, formatJSON) : String(content);
|
|
42
48
|
const isHead = content.startsWith(`!!`);
|
|
43
49
|
content = isHead ? content.slice(2) : content;
|
|
44
|
-
$.li(isHead ?
|
|
45
|
-
|
|
50
|
+
const item = $.li(content).addClass(isHead ? `head` : ``);
|
|
51
|
+
item.renderTo(logContainer, where2PutIt);
|
|
46
52
|
};
|
|
47
53
|
}
|
|
48
|
-
const [logLamda, logTopLambda] = [logItem(), logItem(true)];
|
|
49
|
-
|
|
50
|
-
return {
|
|
51
|
-
log: (...txt) => txt.forEach( logLamda ),
|
|
52
|
-
logTop: (...txt) => txt.forEach( logTopLambda ),
|
|
53
|
-
};
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
function tryJSON(content, formatted) {
|