halox-utils-kit-ts 0.0.1-beta.13 → 0.0.1-beta.14
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/halox-modal-ts.ssr.js +697 -0
- package/package.json +18 -2
- package/vite.config copy.ts +16 -0
- package/vite.config.ts +23 -2
|
@@ -0,0 +1,697 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
function CopyJson(data) {
|
|
3
|
+
if (!data) return null;
|
|
4
|
+
return JSON.parse(JSON.stringify(data));
|
|
5
|
+
}
|
|
6
|
+
function FillToZero(str, len = 2) {
|
|
7
|
+
return String(str).padStart(len, "0");
|
|
8
|
+
}
|
|
9
|
+
function FormatCurrentDate(time = false, split = "-") {
|
|
10
|
+
const now = /* @__PURE__ */ new Date();
|
|
11
|
+
const year = now.getFullYear();
|
|
12
|
+
const month = String(now.getMonth() + 1).padStart(2, "0");
|
|
13
|
+
const day = String(now.getDate()).padStart(2, "0");
|
|
14
|
+
const minutes = String(now.getMinutes()).padStart(2, "0");
|
|
15
|
+
const seconds = String(now.getSeconds()).padStart(2, "0");
|
|
16
|
+
let hours = now.getHours();
|
|
17
|
+
hours = hours % 12;
|
|
18
|
+
if (hours === 0) hours = 12;
|
|
19
|
+
const hh = String(hours).padStart(2, "0");
|
|
20
|
+
if (time)
|
|
21
|
+
return `${year}${split}${month}${split}${day} ${hh}:${minutes}:${seconds}`;
|
|
22
|
+
return `${year}${split}${month}${split}${day}`;
|
|
23
|
+
}
|
|
24
|
+
function FormatDateString(dateStr, type = "full") {
|
|
25
|
+
if (!dateStr) return "";
|
|
26
|
+
const date = new Date(dateStr);
|
|
27
|
+
const year = date.getFullYear();
|
|
28
|
+
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
29
|
+
const day = String(date.getDate()).padStart(2, "0");
|
|
30
|
+
let hours = date.getHours();
|
|
31
|
+
const minutes = String(date.getMinutes()).padStart(2, "0");
|
|
32
|
+
const seconds = String(date.getSeconds()).padStart(2, "0");
|
|
33
|
+
const ampm = hours >= 12 ? "오후" : "오전";
|
|
34
|
+
hours = hours % 12;
|
|
35
|
+
if (hours === 0) hours = 12;
|
|
36
|
+
const hh = String(hours).padStart(2, "0");
|
|
37
|
+
switch (type) {
|
|
38
|
+
case "date":
|
|
39
|
+
return `${year}-${month}-${day}`;
|
|
40
|
+
case "full":
|
|
41
|
+
return `${year}-${month}-${day} ${ampm} ${hh}:${minutes}`;
|
|
42
|
+
case "shot":
|
|
43
|
+
return `${month}-${day} ${hh}:${minutes}`;
|
|
44
|
+
case "fullEn":
|
|
45
|
+
return `${year}-${month}-${day} ${hh}:${minutes}:${seconds}`;
|
|
46
|
+
case "list":
|
|
47
|
+
return [year, month, day, hh, minutes, seconds];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function Comma(value) {
|
|
51
|
+
if (value === null || value === void 0) return "";
|
|
52
|
+
const num = typeof value === "number" ? value : Number(value);
|
|
53
|
+
if (isNaN(num)) return "";
|
|
54
|
+
const parts = num.toString().split(".");
|
|
55
|
+
const integerPart = parts[0] ?? "0";
|
|
56
|
+
const decimalPart = parts[1];
|
|
57
|
+
const integerWithComma = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
58
|
+
return decimalPart ? `${integerWithComma}.${decimalPart}` : integerWithComma;
|
|
59
|
+
}
|
|
60
|
+
function FormatPhoneKr(number, separator = "-") {
|
|
61
|
+
if (!number) return "";
|
|
62
|
+
const num = number.replace(/\D/g, "");
|
|
63
|
+
if (num.startsWith("02")) {
|
|
64
|
+
return num.replace(
|
|
65
|
+
/^(02)(\d{3,4})(\d{4})$/,
|
|
66
|
+
`$1${separator}$2${separator}$3`
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
if (/^(01[016789]|070)/.test(num)) {
|
|
70
|
+
return num.replace(
|
|
71
|
+
/^(01[016789]|070)(\d{3,4})(\d{4})$/,
|
|
72
|
+
`$1${separator}$2${separator}$3`
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
return num.replace(
|
|
76
|
+
/^(\d{3})(\d{3,4})(\d{4})$/,
|
|
77
|
+
`$1${separator}$2${separator}$3`
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
function CreateSerialNumber(split = false) {
|
|
81
|
+
const date = /* @__PURE__ */ new Date();
|
|
82
|
+
const year = date.getFullYear();
|
|
83
|
+
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
84
|
+
const day = String(date.getDate()).padStart(2, "0");
|
|
85
|
+
const hours = String(date.getHours()).padStart(2, "0");
|
|
86
|
+
const minutes = String(date.getMinutes()).padStart(2, "0");
|
|
87
|
+
const seconds = String(date.getSeconds()).padStart(2, "0");
|
|
88
|
+
const randomDigits = String(Math.floor(Math.random() * 1e5)).padStart(
|
|
89
|
+
3,
|
|
90
|
+
"0"
|
|
91
|
+
);
|
|
92
|
+
if (split) {
|
|
93
|
+
return `${hours}${minutes}${seconds}-${randomDigits}`;
|
|
94
|
+
}
|
|
95
|
+
const defaultSN = `${year}${month}${day}${hours}${minutes}${seconds}${randomDigits}`;
|
|
96
|
+
return String(defaultSN);
|
|
97
|
+
}
|
|
98
|
+
function CurrencyConvert(number, lang = "KO", type = "TEXT") {
|
|
99
|
+
const units = {
|
|
100
|
+
KO: ["", "십", "백", "천"],
|
|
101
|
+
CN: ["", "拾", "佰", "仟"],
|
|
102
|
+
CNF: ["", "拾", "佰", "仟"]
|
|
103
|
+
};
|
|
104
|
+
const bigUnits = {
|
|
105
|
+
KO: ["", "만", "억", "조", "경"],
|
|
106
|
+
CN: ["", "万", "亿", "兆", "京"],
|
|
107
|
+
CNF: ["", "萬", "億", "兆", "京"]
|
|
108
|
+
};
|
|
109
|
+
const numToKor = {
|
|
110
|
+
KO: ["영", "일", "이", "삼", "사", "오", "육", "칠", "팔", "구"],
|
|
111
|
+
CN: ["零", "一", "二", "三", "四", "五", "六", "七", "八", "九"],
|
|
112
|
+
CNF: ["零", "壹", "貳", "叁", "肆", "伍", "陸", "柒", "捌", "玖"]
|
|
113
|
+
};
|
|
114
|
+
const order = {
|
|
115
|
+
KO: { zero: "영", wonJeong: "원정", unit: "₩" },
|
|
116
|
+
CN: { zero: "零", wonJeong: "元整", unit: "¥" },
|
|
117
|
+
CNF: { zero: "零", wonJeong: "圓整", unit: "¥" }
|
|
118
|
+
};
|
|
119
|
+
if (number === 0)
|
|
120
|
+
return `<span style="font-weight:bold;">${order[lang].zero}</span>${order[lang].wonJeong}
|
|
121
|
+
<span style="display:inline-block; width:30px;"></span>
|
|
122
|
+
(<span style="display:inline-block; width:10px;"></span>₩
|
|
123
|
+
<span style="display:inline-block; width:20px;"></span>
|
|
124
|
+
<span style="font-weight:bold;">0</span>
|
|
125
|
+
<span style="display:inline-block; width:10px;"></span>)`;
|
|
126
|
+
let result = "";
|
|
127
|
+
const strNumber = String(number).split("").reverse().join("");
|
|
128
|
+
for (let i = 0; i < strNumber.length; i += 4) {
|
|
129
|
+
const part = strNumber.slice(i, i + 4).split("").reverse().join("");
|
|
130
|
+
let partResult = "";
|
|
131
|
+
for (let j = 0; j < part.length; j++) {
|
|
132
|
+
const n = parseInt(part[part.length - 1 - j]);
|
|
133
|
+
if (n !== 0) {
|
|
134
|
+
partResult = numToKor[lang][n] + units[lang][j] + partResult;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
if (partResult) {
|
|
138
|
+
result = partResult + bigUnits[lang][i / 4] + result;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return type == "HTML" ? `
|
|
142
|
+
<span style="font-weight:bold;">${result}</span>
|
|
143
|
+
<span style="display:inline-block; width:20px;"></span>
|
|
144
|
+
${order[lang].wonJeong}
|
|
145
|
+
<span style="display:inline-block; width:20px;"></span>
|
|
146
|
+
(<span style="display:inline-block; width:20px;"></span>${order[lang].unit}
|
|
147
|
+
<span style="display:inline-block; width:50px;"></span>
|
|
148
|
+
<span style="font-weight:bold;">${number.toLocaleString()}</span>
|
|
149
|
+
<span style="display:inline-block; width:20px;"></span>)
|
|
150
|
+
` : `${result}`;
|
|
151
|
+
}
|
|
152
|
+
function ToNumber(value, precision = 0) {
|
|
153
|
+
if (value === null || value === void 0 || value === "") return 0;
|
|
154
|
+
try {
|
|
155
|
+
if (typeof value === "number") {
|
|
156
|
+
const factor = Math.pow(10, precision);
|
|
157
|
+
return precision <= 0 ? Math.trunc(value) : Math.trunc(value * factor) / factor;
|
|
158
|
+
}
|
|
159
|
+
let str = value.toString();
|
|
160
|
+
const isNegative = str.includes("-");
|
|
161
|
+
const filtered = str.replace(/[^0-9.]/g, "");
|
|
162
|
+
const parts = filtered.split(".");
|
|
163
|
+
const cleanNumber = parts[0] + (parts.length > 1 ? "." + parts[1] : "");
|
|
164
|
+
if (!cleanNumber) return 0;
|
|
165
|
+
let num = parseFloat(cleanNumber);
|
|
166
|
+
if (isNegative) num = -num;
|
|
167
|
+
if (precision <= 0) {
|
|
168
|
+
return Math.trunc(num);
|
|
169
|
+
} else {
|
|
170
|
+
const factor = Math.pow(10, precision);
|
|
171
|
+
return Math.trunc(num * factor) / factor;
|
|
172
|
+
}
|
|
173
|
+
} catch (e) {
|
|
174
|
+
console.error(e);
|
|
175
|
+
return 0;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
function ToBr(str) {
|
|
179
|
+
return str.replace(/\n/g, "<br>");
|
|
180
|
+
}
|
|
181
|
+
function GetRemainingDays(dateString) {
|
|
182
|
+
if (!dateString) {
|
|
183
|
+
return 0;
|
|
184
|
+
}
|
|
185
|
+
const target = new Date(dateString);
|
|
186
|
+
const today = /* @__PURE__ */ new Date();
|
|
187
|
+
target.setHours(0, 0, 0, 0);
|
|
188
|
+
today.setHours(0, 0, 0, 0);
|
|
189
|
+
const diffTime = target.getTime() - today.getTime();
|
|
190
|
+
const remaDays = Math.ceil(diffTime / (1e3 * 60 * 60 * 24));
|
|
191
|
+
if (remaDays > 0) {
|
|
192
|
+
return remaDays;
|
|
193
|
+
} else {
|
|
194
|
+
return 0;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
function toHtml({
|
|
198
|
+
input,
|
|
199
|
+
useParagraphs = false,
|
|
200
|
+
tabSize = 4,
|
|
201
|
+
title = ""
|
|
202
|
+
}) {
|
|
203
|
+
if (!input) return "";
|
|
204
|
+
let html = input;
|
|
205
|
+
const tabReplacement = " ".repeat(tabSize);
|
|
206
|
+
html = html.replace(/\t/g, tabReplacement);
|
|
207
|
+
html = html.replace(/ {2,}/g, (m) => " ".repeat(m.length - 1) + " ");
|
|
208
|
+
html = html.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
|
209
|
+
const lines = html.split("\n").map((line) => {
|
|
210
|
+
if (title && line.startsWith(title)) {
|
|
211
|
+
return `<div style="font-size:1.2em;font-weight:bold;margin:20px 0px 0px;">${line.slice(
|
|
212
|
+
title.length
|
|
213
|
+
)}</div>`;
|
|
214
|
+
}
|
|
215
|
+
return line;
|
|
216
|
+
});
|
|
217
|
+
if (useParagraphs) {
|
|
218
|
+
const paragraphs = lines.join("\n").split(/\n{2,}/).map((p) => `<p>${p.replace(/\n/g, "<br>")}</p>`);
|
|
219
|
+
return paragraphs.join("\n");
|
|
220
|
+
} else {
|
|
221
|
+
return lines.join("<br>");
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
function ExtractMatchedKeywords(str, keywordList = []) {
|
|
225
|
+
return keywordList.filter((k) => str.includes(k)).join(",");
|
|
226
|
+
}
|
|
227
|
+
let _apiKey = "";
|
|
228
|
+
const initPostCodeKey = (key) => {
|
|
229
|
+
if (!key) console.warn("주소 API 키가 없습니다.");
|
|
230
|
+
_apiKey = key;
|
|
231
|
+
};
|
|
232
|
+
async function OpenPostCode({
|
|
233
|
+
keyword,
|
|
234
|
+
page = 1,
|
|
235
|
+
size = 50,
|
|
236
|
+
// apiKey = "",
|
|
237
|
+
resultType = "json"
|
|
238
|
+
}) {
|
|
239
|
+
if (!_apiKey || !_apiKey.trim()) {
|
|
240
|
+
return {
|
|
241
|
+
code: 1,
|
|
242
|
+
message: "apiKey는 필수항목입니다.",
|
|
243
|
+
results: null,
|
|
244
|
+
page,
|
|
245
|
+
size,
|
|
246
|
+
totalCount: 0
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
const url = "https://business.juso.go.kr/addrlink/addrLinkApi.do";
|
|
250
|
+
try {
|
|
251
|
+
const res = await axios.get(url, {
|
|
252
|
+
params: {
|
|
253
|
+
confmKey: _apiKey,
|
|
254
|
+
keyword,
|
|
255
|
+
resultType,
|
|
256
|
+
currentPage: page,
|
|
257
|
+
countPerPage: size
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
const results = res.data.results;
|
|
261
|
+
return {
|
|
262
|
+
code: 1,
|
|
263
|
+
message: results.common?.errorMessage,
|
|
264
|
+
results: results.juso,
|
|
265
|
+
page: ToNumber(results.common.currentPage),
|
|
266
|
+
size: ToNumber(results.common.countPerPage),
|
|
267
|
+
totalCount: ToNumber(results.common.totalCount)
|
|
268
|
+
};
|
|
269
|
+
} catch (e) {
|
|
270
|
+
console.error("주소 검색 실패:", e);
|
|
271
|
+
return { code: 500, message: "주소 검색 실패" };
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
function stringifyQuery(data) {
|
|
275
|
+
const query = Object.entries(data).filter(([_, value]) => value !== void 0 && value !== null && value !== "").map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`).join("&");
|
|
276
|
+
return query ? `?${query}` : "";
|
|
277
|
+
}
|
|
278
|
+
function parseQuery(queryString) {
|
|
279
|
+
if (!queryString) return {};
|
|
280
|
+
const search = queryString.startsWith("?") ? queryString.slice(1) : queryString;
|
|
281
|
+
const params = new URLSearchParams(search);
|
|
282
|
+
return Object.fromEntries(params.entries());
|
|
283
|
+
}
|
|
284
|
+
const SYMBOL_MAP = {
|
|
285
|
+
1: "~",
|
|
286
|
+
2: "!",
|
|
287
|
+
3: "@",
|
|
288
|
+
4: "#",
|
|
289
|
+
5: "$",
|
|
290
|
+
6: "%",
|
|
291
|
+
7: "^",
|
|
292
|
+
8: "&",
|
|
293
|
+
9: "*",
|
|
294
|
+
10: "\\",
|
|
295
|
+
11: '"',
|
|
296
|
+
12: "'",
|
|
297
|
+
13: "+",
|
|
298
|
+
14: "=",
|
|
299
|
+
15: "`",
|
|
300
|
+
16: "|",
|
|
301
|
+
17: "(",
|
|
302
|
+
18: ")",
|
|
303
|
+
19: "[",
|
|
304
|
+
20: "]",
|
|
305
|
+
21: "{",
|
|
306
|
+
22: "}",
|
|
307
|
+
23: ":",
|
|
308
|
+
24: ";",
|
|
309
|
+
25: "-",
|
|
310
|
+
26: "_",
|
|
311
|
+
27: "#",
|
|
312
|
+
28: "&",
|
|
313
|
+
29: "@",
|
|
314
|
+
30: "§"
|
|
315
|
+
};
|
|
316
|
+
const OFFICIAL_SYMBOLS = {
|
|
317
|
+
1: "※",
|
|
318
|
+
2: "☆",
|
|
319
|
+
3: "★",
|
|
320
|
+
4: "○",
|
|
321
|
+
5: "●",
|
|
322
|
+
6: "◎",
|
|
323
|
+
7: "◇",
|
|
324
|
+
8: "◆",
|
|
325
|
+
9: "□",
|
|
326
|
+
10: "■",
|
|
327
|
+
11: "△",
|
|
328
|
+
12: "▲",
|
|
329
|
+
13: "▽",
|
|
330
|
+
14: "▼",
|
|
331
|
+
15: "→",
|
|
332
|
+
16: "←",
|
|
333
|
+
17: "↑",
|
|
334
|
+
18: "↓",
|
|
335
|
+
19: "↔",
|
|
336
|
+
20: "〓",
|
|
337
|
+
21: "◁",
|
|
338
|
+
22: "◀",
|
|
339
|
+
23: "▷",
|
|
340
|
+
24: "▶",
|
|
341
|
+
25: "♤",
|
|
342
|
+
26: "♠",
|
|
343
|
+
27: "♡",
|
|
344
|
+
28: "♥",
|
|
345
|
+
29: "♧",
|
|
346
|
+
30: "♣",
|
|
347
|
+
31: "⊙",
|
|
348
|
+
32: "◈",
|
|
349
|
+
33: "▣",
|
|
350
|
+
34: "◐",
|
|
351
|
+
35: "◑",
|
|
352
|
+
36: "▒",
|
|
353
|
+
37: "▤",
|
|
354
|
+
38: "▥",
|
|
355
|
+
39: "▨",
|
|
356
|
+
40: "▧",
|
|
357
|
+
41: "▦",
|
|
358
|
+
42: "▩",
|
|
359
|
+
43: "♨",
|
|
360
|
+
44: "☏",
|
|
361
|
+
45: "☎",
|
|
362
|
+
46: "☜",
|
|
363
|
+
47: "☞",
|
|
364
|
+
48: "¶",
|
|
365
|
+
49: "†",
|
|
366
|
+
50: "‡",
|
|
367
|
+
51: "↕",
|
|
368
|
+
52: "↗",
|
|
369
|
+
53: "↙",
|
|
370
|
+
54: "↖",
|
|
371
|
+
55: "↘",
|
|
372
|
+
56: "♭",
|
|
373
|
+
57: "♩",
|
|
374
|
+
58: "♪",
|
|
375
|
+
59: "♬",
|
|
376
|
+
60: "㉿",
|
|
377
|
+
61: "㈜"
|
|
378
|
+
};
|
|
379
|
+
const HANGUL_SYMBOLS = {
|
|
380
|
+
1: "㉠",
|
|
381
|
+
2: "㉡",
|
|
382
|
+
3: "㉢",
|
|
383
|
+
4: "㉣",
|
|
384
|
+
5: "㉤",
|
|
385
|
+
6: "㉥",
|
|
386
|
+
7: "㉦",
|
|
387
|
+
8: "㉧",
|
|
388
|
+
9: "㉨",
|
|
389
|
+
10: "㉩",
|
|
390
|
+
11: "㉪",
|
|
391
|
+
12: "㉫",
|
|
392
|
+
13: "㉬",
|
|
393
|
+
14: "㉭",
|
|
394
|
+
15: "㉮",
|
|
395
|
+
16: "㉯",
|
|
396
|
+
17: "㉰",
|
|
397
|
+
18: "㉱",
|
|
398
|
+
19: "㉲",
|
|
399
|
+
20: "㉳",
|
|
400
|
+
21: "㉴",
|
|
401
|
+
22: "㉵",
|
|
402
|
+
23: "㉶",
|
|
403
|
+
24: "㉷",
|
|
404
|
+
25: "㉸",
|
|
405
|
+
26: "㉹",
|
|
406
|
+
27: "㉺",
|
|
407
|
+
28: "㉻",
|
|
408
|
+
29: "㈀",
|
|
409
|
+
30: "㈁",
|
|
410
|
+
31: "㈂",
|
|
411
|
+
32: "㈃",
|
|
412
|
+
33: "㈄",
|
|
413
|
+
34: "㈅",
|
|
414
|
+
35: "㈆",
|
|
415
|
+
36: "㈇",
|
|
416
|
+
37: "㈈",
|
|
417
|
+
38: "㈉",
|
|
418
|
+
39: "㈊",
|
|
419
|
+
40: "㈋",
|
|
420
|
+
41: "㈌",
|
|
421
|
+
42: "㈍",
|
|
422
|
+
43: "㈎",
|
|
423
|
+
44: "㈏",
|
|
424
|
+
45: "㈐",
|
|
425
|
+
46: "㈑",
|
|
426
|
+
47: "㈒",
|
|
427
|
+
48: "㈓",
|
|
428
|
+
49: "㈔",
|
|
429
|
+
50: "㈕",
|
|
430
|
+
51: "㈖",
|
|
431
|
+
52: "㈗",
|
|
432
|
+
53: "㈘",
|
|
433
|
+
54: "㈙",
|
|
434
|
+
55: "㈚",
|
|
435
|
+
56: "㈛"
|
|
436
|
+
};
|
|
437
|
+
const ALPHABET_NUMBER_SYMBOLS = {
|
|
438
|
+
1: "ⓐ",
|
|
439
|
+
2: "ⓑ",
|
|
440
|
+
3: "ⓒ",
|
|
441
|
+
4: "ⓓ",
|
|
442
|
+
5: "ⓔ",
|
|
443
|
+
6: "ⓕ",
|
|
444
|
+
7: "ⓖ",
|
|
445
|
+
8: "ⓗ",
|
|
446
|
+
9: "ⓘ",
|
|
447
|
+
10: "ⓙ",
|
|
448
|
+
11: "ⓚ",
|
|
449
|
+
12: "ⓛ",
|
|
450
|
+
13: "ⓜ",
|
|
451
|
+
14: "ⓝ",
|
|
452
|
+
15: "ⓞ",
|
|
453
|
+
16: "ⓟ",
|
|
454
|
+
17: "ⓠ",
|
|
455
|
+
18: "ⓡ",
|
|
456
|
+
19: "ⓢ",
|
|
457
|
+
20: "ⓣ",
|
|
458
|
+
21: "ⓤ",
|
|
459
|
+
22: "ⓥ",
|
|
460
|
+
23: "ⓦ",
|
|
461
|
+
24: "ⓧ",
|
|
462
|
+
25: "ⓨ",
|
|
463
|
+
26: "ⓩ",
|
|
464
|
+
27: "⒜",
|
|
465
|
+
28: "⒝",
|
|
466
|
+
29: "⒞",
|
|
467
|
+
30: "⒟",
|
|
468
|
+
31: "⒠",
|
|
469
|
+
32: "⒡",
|
|
470
|
+
33: "⒢",
|
|
471
|
+
34: "⒣",
|
|
472
|
+
35: "⒤",
|
|
473
|
+
36: "⒥",
|
|
474
|
+
37: "⒦",
|
|
475
|
+
38: "⒧",
|
|
476
|
+
39: "⒨",
|
|
477
|
+
40: "⒩",
|
|
478
|
+
41: "⒪",
|
|
479
|
+
42: "⒫",
|
|
480
|
+
43: "⒬",
|
|
481
|
+
44: "⒭",
|
|
482
|
+
45: "⒮",
|
|
483
|
+
46: "⒯",
|
|
484
|
+
47: "⒰",
|
|
485
|
+
48: "⒱",
|
|
486
|
+
49: "⒲",
|
|
487
|
+
50: "⒳",
|
|
488
|
+
51: "⒴",
|
|
489
|
+
52: "⒵",
|
|
490
|
+
53: "①",
|
|
491
|
+
54: "②",
|
|
492
|
+
55: "③",
|
|
493
|
+
56: "④",
|
|
494
|
+
57: "⑤",
|
|
495
|
+
58: "⑥",
|
|
496
|
+
59: "⑦",
|
|
497
|
+
60: "⑧",
|
|
498
|
+
61: "⑨",
|
|
499
|
+
62: "⑩",
|
|
500
|
+
63: "⑪",
|
|
501
|
+
64: "⑫",
|
|
502
|
+
65: "⑬",
|
|
503
|
+
66: "⑭",
|
|
504
|
+
67: "⑮",
|
|
505
|
+
68: "⑴",
|
|
506
|
+
69: "⑵",
|
|
507
|
+
70: "⑶",
|
|
508
|
+
71: "⑷",
|
|
509
|
+
72: "⑸",
|
|
510
|
+
73: "⑹",
|
|
511
|
+
74: "⑺",
|
|
512
|
+
75: "⑻",
|
|
513
|
+
76: "⑼",
|
|
514
|
+
77: "⑽",
|
|
515
|
+
78: "⑾",
|
|
516
|
+
79: "⑿",
|
|
517
|
+
80: "⒀",
|
|
518
|
+
81: "⒁",
|
|
519
|
+
82: "⒂"
|
|
520
|
+
};
|
|
521
|
+
const UNIT_SYMBOLS = {
|
|
522
|
+
1: "$",
|
|
523
|
+
2: "%",
|
|
524
|
+
3: "₩",
|
|
525
|
+
4: "₩",
|
|
526
|
+
5: "F",
|
|
527
|
+
6: "′",
|
|
528
|
+
7: "″",
|
|
529
|
+
8: "℃",
|
|
530
|
+
9: "Å",
|
|
531
|
+
10: "¢",
|
|
532
|
+
11: "£",
|
|
533
|
+
12: "¥",
|
|
534
|
+
13: "¤",
|
|
535
|
+
14: "℉",
|
|
536
|
+
15: "‰",
|
|
537
|
+
16: "€",
|
|
538
|
+
17: "㎕",
|
|
539
|
+
18: "㎖",
|
|
540
|
+
19: "㎗",
|
|
541
|
+
20: "ℓ",
|
|
542
|
+
21: "㎘",
|
|
543
|
+
22: "㏄",
|
|
544
|
+
23: "㎣",
|
|
545
|
+
24: "㎤",
|
|
546
|
+
25: "㎥",
|
|
547
|
+
26: "㎦",
|
|
548
|
+
27: "㎙",
|
|
549
|
+
28: "㎚",
|
|
550
|
+
29: "㎛",
|
|
551
|
+
30: "㎜",
|
|
552
|
+
31: "㎝",
|
|
553
|
+
32: "㎟",
|
|
554
|
+
33: "㎠",
|
|
555
|
+
34: "㎡",
|
|
556
|
+
35: "㎢",
|
|
557
|
+
36: "㏊",
|
|
558
|
+
37: "㎍",
|
|
559
|
+
38: "㎎",
|
|
560
|
+
39: "㎏",
|
|
561
|
+
40: "㏏",
|
|
562
|
+
41: "㎈",
|
|
563
|
+
42: "㎉",
|
|
564
|
+
43: "㏈",
|
|
565
|
+
44: "㎧",
|
|
566
|
+
45: "㎨",
|
|
567
|
+
46: "㎰",
|
|
568
|
+
47: "㎱",
|
|
569
|
+
48: "㎲",
|
|
570
|
+
49: "㎳",
|
|
571
|
+
50: "㎴",
|
|
572
|
+
51: "㎵",
|
|
573
|
+
52: "㎶",
|
|
574
|
+
53: "㎷",
|
|
575
|
+
54: "㎸",
|
|
576
|
+
55: "㎹",
|
|
577
|
+
56: "㎀",
|
|
578
|
+
57: "㎁",
|
|
579
|
+
58: "㎂",
|
|
580
|
+
59: "㎃",
|
|
581
|
+
60: "㎄",
|
|
582
|
+
61: "㎺",
|
|
583
|
+
62: "㎻",
|
|
584
|
+
63: "㎼",
|
|
585
|
+
64: "㎽",
|
|
586
|
+
65: "㎾",
|
|
587
|
+
66: "㎿",
|
|
588
|
+
67: "㎐",
|
|
589
|
+
68: "㎑",
|
|
590
|
+
69: "㎒",
|
|
591
|
+
70: "㎓",
|
|
592
|
+
71: "㎔",
|
|
593
|
+
72: "Ω",
|
|
594
|
+
73: "㏀",
|
|
595
|
+
74: "㏁",
|
|
596
|
+
75: "㎊",
|
|
597
|
+
76: "㎋",
|
|
598
|
+
77: "㎌",
|
|
599
|
+
78: "㏖",
|
|
600
|
+
79: "㏅",
|
|
601
|
+
80: "㎭",
|
|
602
|
+
81: "㎮",
|
|
603
|
+
82: "㎯",
|
|
604
|
+
83: "㏛",
|
|
605
|
+
84: "㎩",
|
|
606
|
+
85: "㎪",
|
|
607
|
+
86: "㎫",
|
|
608
|
+
87: "㎬",
|
|
609
|
+
88: "㏝",
|
|
610
|
+
89: "㏐",
|
|
611
|
+
90: "㏓",
|
|
612
|
+
91: "㏃",
|
|
613
|
+
92: "㏉",
|
|
614
|
+
93: "㏜",
|
|
615
|
+
94: "㏆"
|
|
616
|
+
};
|
|
617
|
+
const RARE_SYMBOLS = {
|
|
618
|
+
1: "ꁇ",
|
|
619
|
+
2: "܀",
|
|
620
|
+
3: "܊",
|
|
621
|
+
4: "܋",
|
|
622
|
+
5: "܌",
|
|
623
|
+
6: "܍",
|
|
624
|
+
7: "¤",
|
|
625
|
+
8: "፨",
|
|
626
|
+
9: "₪",
|
|
627
|
+
10: "ꂇ",
|
|
628
|
+
11: "◘",
|
|
629
|
+
12: "◙",
|
|
630
|
+
13: "⌂",
|
|
631
|
+
14: "☺",
|
|
632
|
+
15: "☻",
|
|
633
|
+
16: "♀",
|
|
634
|
+
17: "♂",
|
|
635
|
+
18: "ꋭ",
|
|
636
|
+
19: "ꋯ",
|
|
637
|
+
20: "ާ",
|
|
638
|
+
21: "ި",
|
|
639
|
+
22: "ީ",
|
|
640
|
+
23: "ު",
|
|
641
|
+
24: "ޫ",
|
|
642
|
+
25: "ެ",
|
|
643
|
+
26: "ޭ",
|
|
644
|
+
27: "ޮ",
|
|
645
|
+
28: "ᚗ",
|
|
646
|
+
29: "ᚘ",
|
|
647
|
+
30: "፡",
|
|
648
|
+
31: "።",
|
|
649
|
+
32: "፣",
|
|
650
|
+
33: "፤",
|
|
651
|
+
34: "፥",
|
|
652
|
+
35: "፦",
|
|
653
|
+
36: "፧",
|
|
654
|
+
37: "‘",
|
|
655
|
+
38: "’",
|
|
656
|
+
39: "‚",
|
|
657
|
+
40: "‛",
|
|
658
|
+
41: "“",
|
|
659
|
+
42: "”",
|
|
660
|
+
43: "„",
|
|
661
|
+
44: "‥",
|
|
662
|
+
45: "…",
|
|
663
|
+
46: "‧",
|
|
664
|
+
47: "′",
|
|
665
|
+
48: "″",
|
|
666
|
+
49: "〝",
|
|
667
|
+
50: "〞",
|
|
668
|
+
51: "〟"
|
|
669
|
+
};
|
|
670
|
+
const functions = {
|
|
671
|
+
CopyJson,
|
|
672
|
+
FillToZero,
|
|
673
|
+
FormatCurrentDate,
|
|
674
|
+
FormatDateString,
|
|
675
|
+
Comma,
|
|
676
|
+
FormatPhoneKr,
|
|
677
|
+
CreateSerialNumber,
|
|
678
|
+
CurrencyConvert,
|
|
679
|
+
ToNumber,
|
|
680
|
+
ToBr,
|
|
681
|
+
GetRemainingDays,
|
|
682
|
+
toHtml,
|
|
683
|
+
ExtractMatchedKeywords,
|
|
684
|
+
OpenPostCode,
|
|
685
|
+
initJuso: initPostCodeKey,
|
|
686
|
+
stringifyQuery,
|
|
687
|
+
parseQuery
|
|
688
|
+
};
|
|
689
|
+
export {
|
|
690
|
+
ALPHABET_NUMBER_SYMBOLS,
|
|
691
|
+
HANGUL_SYMBOLS,
|
|
692
|
+
OFFICIAL_SYMBOLS,
|
|
693
|
+
RARE_SYMBOLS,
|
|
694
|
+
SYMBOL_MAP,
|
|
695
|
+
UNIT_SYMBOLS,
|
|
696
|
+
functions as halox
|
|
697
|
+
};
|
package/package.json
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "halox-utils-kit-ts",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.14",
|
|
4
4
|
"main": "dist/halox-utils-kit-ts.umd.js",
|
|
5
5
|
"module": "dist/halox-utils-kit-ts.es.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"node": "./dist/halox-utils-kit-ts.ssr.js",
|
|
10
|
+
"import": "./dist/halox-utils-kit-ts.es.js",
|
|
11
|
+
"require": "./dist/halox-utils-kit-ts.umd.js"
|
|
12
|
+
},
|
|
13
|
+
"./dist/halox-utils-kit-ts.css": "./dist/halox-utils-kit-ts.css"
|
|
14
|
+
},
|
|
7
15
|
"repository": {
|
|
8
16
|
"type": "git",
|
|
9
17
|
"url": "git+https://github.com/shenyunv2021/halox-utils-kit-ts.git"
|
|
@@ -18,7 +26,9 @@
|
|
|
18
26
|
"license": "MIT",
|
|
19
27
|
"scripts": {
|
|
20
28
|
"dev": "vite",
|
|
21
|
-
"build": "vite build",
|
|
29
|
+
"build:client": "vite build",
|
|
30
|
+
"build:ssr": "cross-env VITE_SSR=true vite build --emptyOutDir false && ren dist\\index.mjs halox-modal-ts.ssr.js",
|
|
31
|
+
"build": "npm run build:client && npm run build:ssr",
|
|
22
32
|
"build:watch": "if exist dist rd /s /q dist && vite build --watch",
|
|
23
33
|
"lint": "eslint . --ext .ts",
|
|
24
34
|
"test": "echo \"No test yet\""
|
|
@@ -36,6 +46,12 @@
|
|
|
36
46
|
"axios": "^1.11.0"
|
|
37
47
|
},
|
|
38
48
|
"devDependencies": {
|
|
49
|
+
"@vitejs/plugin-vue": "^6.0.2",
|
|
50
|
+
"cross-env": "^10.1.0",
|
|
51
|
+
"rollup": "^4.53.3",
|
|
52
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
53
|
+
"rollup-plugin-typescript2": "^0.36.0",
|
|
54
|
+
"rollup-plugin-vue": "^6.0.0",
|
|
39
55
|
"typescript": "^5.9.3",
|
|
40
56
|
"vite": "^7.2.4",
|
|
41
57
|
"vite-plugin-dts": "^4.5.4"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defineConfig } from 'vite';
|
|
2
|
+
import dts from 'vite-plugin-dts';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
plugins: [
|
|
7
|
+
dts({ insertTypesEntry: true }),
|
|
8
|
+
],
|
|
9
|
+
build: {
|
|
10
|
+
lib: {
|
|
11
|
+
entry: path.resolve(__dirname, 'src/index.ts'),
|
|
12
|
+
name: 'HaloxUtilsKit',
|
|
13
|
+
fileName: (format) => `halox-utils-kit-ts.${format}.js`,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
});
|
package/vite.config.ts
CHANGED
|
@@ -1,16 +1,37 @@
|
|
|
1
1
|
import { defineConfig } from 'vite';
|
|
2
|
+
import vue from '@vitejs/plugin-vue';
|
|
2
3
|
import dts from 'vite-plugin-dts';
|
|
3
|
-
import path from 'path';
|
|
4
|
+
import path from 'path'; // rollup-plugin-postcss는 제거합니다.
|
|
5
|
+
|
|
6
|
+
const isSSR = process.env.VITE_SSR === 'true' || process.argv.includes('--ssr');
|
|
4
7
|
|
|
5
8
|
export default defineConfig({
|
|
6
9
|
plugins: [
|
|
10
|
+
vue(),
|
|
7
11
|
dts({ insertTypesEntry: true }),
|
|
8
12
|
],
|
|
9
13
|
build: {
|
|
14
|
+
ssr: isSSR,
|
|
10
15
|
lib: {
|
|
11
16
|
entry: path.resolve(__dirname, 'src/index.ts'),
|
|
12
17
|
name: 'HaloxUtilsKit',
|
|
13
|
-
fileName: (format) => `halox-utils-kit-ts.${format}.js`,
|
|
18
|
+
fileName: (format) => isSSR ? `halox-utils-kit-ts.${format}.ssr.js` : `halox-utils-kit-ts.${format}.js`,
|
|
19
|
+
formats: isSSR ? ['es'] : ['es', 'umd'],
|
|
20
|
+
},
|
|
21
|
+
rollupOptions: {
|
|
22
|
+
external: ['vue'],
|
|
23
|
+
output: {
|
|
24
|
+
globals: { vue: 'Vue' },
|
|
25
|
+
// cssFileName을 강제하거나 Vite 기본 CSS 추출 기능을 사용합니다.
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
// cssCodeSplit을 false로 두면 라이브러리 빌드 시 하나의 style.css로 합쳐서 추출해줍니다.
|
|
29
|
+
cssCodeSplit: false,
|
|
30
|
+
},
|
|
31
|
+
// CSS 전처리기가 필요하다면 루트 레벨에서 선언합니다.
|
|
32
|
+
css: {
|
|
33
|
+
preprocessorOptions: {
|
|
34
|
+
scss: {},
|
|
14
35
|
},
|
|
15
36
|
},
|
|
16
37
|
});
|