@ninebone/util 1.0.42 โ 1.0.43
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/dist/nine-util.js +19 -1
- package/dist/nine-util.js.map +1 -1
- package/dist/nine-util.umd.js +1 -1
- package/dist/nine-util.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/nine-util.js
CHANGED
|
@@ -1313,7 +1313,7 @@ class NineSplitter extends HTMLElement {
|
|
|
1313
1313
|
const htmlTmpl = document.createElement("template");
|
|
1314
1314
|
htmlTmpl.innerHTML = `
|
|
1315
1315
|
<style>
|
|
1316
|
-
@import "https://cdn.jsdelivr.net/npm/@ninebone/util@${"1.0.
|
|
1316
|
+
@import "https://cdn.jsdelivr.net/npm/@ninebone/util@${"1.0.43"}/dist/css/nine-util.css";
|
|
1317
1317
|
${customImport}
|
|
1318
1318
|
</style>
|
|
1319
1319
|
${gripTmpl}
|
|
@@ -1850,6 +1850,24 @@ class NineUtil {
|
|
|
1850
1850
|
__publicField(this, "formatDate", (v, fmt) => {
|
|
1851
1851
|
return dayjs(v).format(fmt);
|
|
1852
1852
|
});
|
|
1853
|
+
__publicField(this, "lpad", (v, n, str) => {
|
|
1854
|
+
return Array(n - String(v).length + 1).join(str || "0") + v;
|
|
1855
|
+
});
|
|
1856
|
+
__publicField(this, "rpad", (v, n, str) => {
|
|
1857
|
+
return v + Array(n - String(v).length + 1).join(str || "0");
|
|
1858
|
+
});
|
|
1859
|
+
__publicField(this, "cut", (v, len) => {
|
|
1860
|
+
var str = v;
|
|
1861
|
+
var s = 0;
|
|
1862
|
+
for (var i = 0; i < str.length; i++) {
|
|
1863
|
+
s += str.charCodeAt(i) > 128 ? 2 : 1;
|
|
1864
|
+
if (s > len) return str.substring(0, i);
|
|
1865
|
+
}
|
|
1866
|
+
return str;
|
|
1867
|
+
});
|
|
1868
|
+
__publicField(this, "getByteLength", (v) => {
|
|
1869
|
+
return v.replace(/[\0-\x7f]|([0-\u07ff]|(.))/g, "$&$1$2").length;
|
|
1870
|
+
});
|
|
1853
1871
|
/**
|
|
1854
1872
|
* ๐ฎ ์ด๊ฐ๋จ ๋ง๋ฅ ๋๋๊ทธ ํ์
์์ง (Promise/Then ๊ท๊ฒฉ)
|
|
1855
1873
|
* @param {React.Component} ContentComponent - ํ์
๋ด๋ถ์ ๋์ธ ๋ฆฌ์กํธ ์ปดํฌ๋ํธ
|