@g1cloud/bluesea 5.0.0-alpha.3 → 5.0.0-alpha.5
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/css/component.scss +1 -0
- package/css/variable.scss +23 -17
- package/dist/bluesea.js +234 -133
- package/dist/bluesea.umd.cjs +233 -132
- package/dist/component/basic/BSButton.vue.d.ts +39 -0
- package/dist/component/input/BSPriceInput.vue.d.ts +55 -0
- package/dist/component/input/BSRadioButton.vue.d.ts +3 -3
- package/dist/component/input/BSTextInput.vue.d.ts +5 -0
- package/dist/frame/FrameModel.d.ts +4 -3
- package/dist/frame/default/SidebarMenuLink.vue.d.ts +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/model/CommonTypes.d.ts +5 -0
- package/dist/style.css +308 -68
- package/dist/util/formatUtil.d.ts +8 -0
- package/package.json +1 -1
- package/dist/component/BSButton.vue.d.ts +0 -15
package/css/component.scss
CHANGED
package/css/variable.scss
CHANGED
|
@@ -16,29 +16,35 @@ textarea {
|
|
|
16
16
|
font-size: var(--font-size-input);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
$color-text: #555;
|
|
20
|
-
$color-text-light: #B0B1BA;
|
|
19
|
+
$color-text: #555 !default;
|
|
20
|
+
$color-text-light: #B0B1BA !default;
|
|
21
21
|
|
|
22
|
-
$color-gray: #8993A4;
|
|
23
|
-
$color-gray-border: #BCC6D3;
|
|
22
|
+
$color-gray: #8993A4 !default;
|
|
23
|
+
$color-gray-border: #BCC6D3 !default;
|
|
24
24
|
|
|
25
|
-
$color-blue: #
|
|
26
|
-
$color-blue-border: #C1CBE4;
|
|
27
|
-
$color-blue-bg: #
|
|
25
|
+
$color-blue: #5672EF !default;
|
|
26
|
+
$color-blue-border: #C1CBE4 !default;
|
|
27
|
+
$color-blue-bg: #DDEEFF !default;
|
|
28
28
|
|
|
29
|
-
$color-darkblue: #00234D;
|
|
29
|
+
$color-darkblue: #00234D !default;
|
|
30
30
|
|
|
31
|
-
$color-red: #E72F34;
|
|
32
|
-
$color-red-border: #FA9A9E;
|
|
33
|
-
$color-red-bg: #FFE8E8;
|
|
31
|
+
$color-red: #E72F34 !default;
|
|
32
|
+
$color-red-border: #FA9A9E !default;
|
|
33
|
+
$color-red-bg: #FFE8E8 !default;
|
|
34
34
|
|
|
35
|
-
$color-
|
|
36
|
-
$color-
|
|
37
|
-
$color-
|
|
35
|
+
$color-orange: #F99341 !default;
|
|
36
|
+
$color-orange-border: #F99341 !default;
|
|
37
|
+
$color-orange-bg: #F99341 !default;
|
|
38
38
|
|
|
39
|
-
$color-
|
|
40
|
-
$color-border
|
|
41
|
-
$color-
|
|
39
|
+
$color-green: #4FA348 !default;
|
|
40
|
+
$color-green-border: #7ECE78 !default;
|
|
41
|
+
$color-green-bg: #E9FEE7 !default;
|
|
42
|
+
|
|
43
|
+
$color-icon-light: #D5D5D5 !default;
|
|
44
|
+
$color-border: #E5E5E5 !default;
|
|
45
|
+
$color-border-light: #DBE0EF !default;
|
|
46
|
+
$color-border-dark: #444 !default;
|
|
47
|
+
$color-hover: #E8EEFC !default;
|
|
42
48
|
|
|
43
49
|
$border-input: 0.8px solid $color-border-light;
|
|
44
50
|
|
package/dist/bluesea.js
CHANGED
|
@@ -4,7 +4,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4
4
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
|
-
import { defineComponent, openBlock, createElementBlock, toDisplayString,
|
|
7
|
+
import { defineComponent, openBlock, createElementBlock, normalizeClass, toDisplayString, createCommentVNode, withDirectives, createElementVNode, unref, ref, watch, normalizeStyle, mergeProps, isRef, toHandlers, vModelDynamic, Fragment, renderList, vModelText, computed, createVNode, useSlots, renderSlot, createBlock, Transition, withCtx, onMounted, onBeforeUnmount, withModifiers, withKeys, createTextVNode, reactive, nextTick, vShow, inject, resolveComponent, markRaw, provide, resolveDynamicComponent, shallowReactive } from "vue";
|
|
8
8
|
import dayjs from "dayjs";
|
|
9
9
|
import { useRouter, useRoute } from "vue-router";
|
|
10
10
|
class BlueseaConfig {
|
|
@@ -25,18 +25,136 @@ const blueseaConfig = new BlueseaConfig();
|
|
|
25
25
|
const configureBluesea = (options) => {
|
|
26
26
|
blueseaConfig.configure(options);
|
|
27
27
|
};
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
class I18NTexts {
|
|
29
|
+
constructor() {
|
|
30
|
+
__publicField(this, "localeTexts", {});
|
|
31
|
+
__publicField(this, "defaultLocale");
|
|
32
|
+
}
|
|
33
|
+
setDefaultLocale(locale) {
|
|
34
|
+
this.defaultLocale = locale;
|
|
35
|
+
}
|
|
36
|
+
addTexts(locale, textList) {
|
|
37
|
+
const text = this.ensureAddLocale(locale);
|
|
38
|
+
textList.forEach((t) => text[t.key] = t);
|
|
39
|
+
}
|
|
40
|
+
text(locale, key, args) {
|
|
41
|
+
var _a, _b, _c;
|
|
42
|
+
let text = (_a = this.localeTexts[locale]) == null ? void 0 : _a[key];
|
|
43
|
+
let parentLocale = locale;
|
|
44
|
+
while (parentLocale && !text) {
|
|
45
|
+
parentLocale = parentLocale.substring(0, parentLocale.lastIndexOf("-"));
|
|
46
|
+
text = (_b = this.localeTexts[parentLocale]) == null ? void 0 : _b[key];
|
|
47
|
+
}
|
|
48
|
+
const defLocale = this.ensureGetDefaultLocale();
|
|
49
|
+
if (!text && defLocale && defLocale !== locale) {
|
|
50
|
+
text = (_c = this.localeTexts[defLocale]) == null ? void 0 : _c[key];
|
|
51
|
+
}
|
|
52
|
+
const resolved = text ? this.resolveText(text, args) : key;
|
|
53
|
+
const html = text ? !!text.html : false;
|
|
54
|
+
return { key, text: resolved, html };
|
|
55
|
+
}
|
|
56
|
+
// {0} {1} 등의 변수를 args 로 대치한다.
|
|
57
|
+
resolveText(text, args) {
|
|
58
|
+
let result = text.text;
|
|
59
|
+
const re = /\{\s*(\d+)\s*}/g;
|
|
60
|
+
const slots = [];
|
|
61
|
+
let exec;
|
|
62
|
+
while (exec = re.exec(result)) {
|
|
63
|
+
slots.push(exec);
|
|
64
|
+
}
|
|
65
|
+
slots.reverse();
|
|
66
|
+
for (const slot of slots) {
|
|
67
|
+
if (result.charAt(slot.index - 1) === "\\") {
|
|
68
|
+
result = result.substring(0, slot.index - 1) + result.substring(slot.index);
|
|
69
|
+
} else {
|
|
70
|
+
const index = Number(slot[1]);
|
|
71
|
+
if ((args == null ? void 0 : args[index]) !== void 0) {
|
|
72
|
+
result = result.substring(0, slot.index) + args[index] + result.substring(slot.index + slot[0].length);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return result;
|
|
77
|
+
}
|
|
78
|
+
ensureAddLocale(locale) {
|
|
79
|
+
return this.localeTexts[locale] = this.localeTexts[locale] || {};
|
|
80
|
+
}
|
|
81
|
+
ensureGetDefaultLocale() {
|
|
82
|
+
if (!this.defaultLocale) {
|
|
83
|
+
this.defaultLocale = blueseaConfig.defaultLocale;
|
|
84
|
+
}
|
|
85
|
+
return this.defaultLocale;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
const getCurrentLocale = () => {
|
|
89
|
+
return document.documentElement.lang || navigator.language;
|
|
90
|
+
};
|
|
91
|
+
const i18n = new I18NTexts();
|
|
92
|
+
const parseBinding = (binding) => {
|
|
93
|
+
const type = binding.modifiers.html ? "HTML" : "TEXT";
|
|
94
|
+
if (typeof binding.value === "string") {
|
|
95
|
+
return { key: binding.value, type, multiLang: false };
|
|
96
|
+
} else if (Array.isArray(binding.value)) {
|
|
97
|
+
const key = String(binding.value[0]);
|
|
98
|
+
const args = binding.value.toSpliced(0, 1);
|
|
99
|
+
return { key, args, type, multiLang: true };
|
|
100
|
+
} else if (typeof binding.value === "object") {
|
|
101
|
+
const key = binding.value.key || "";
|
|
102
|
+
const args = Array.isArray(binding.value.args) ? binding.value.args : void 0;
|
|
103
|
+
return { key, args, type, multiLang: true };
|
|
104
|
+
} else {
|
|
105
|
+
return { multiLang: false };
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
const vT = {
|
|
109
|
+
mounted: (el, binding) => {
|
|
110
|
+
const { multiLang, key, args, type } = parseBinding(binding);
|
|
111
|
+
if (key) {
|
|
112
|
+
if (multiLang) {
|
|
113
|
+
const locale = getCurrentLocale();
|
|
114
|
+
const text = i18n.text(locale, key, args);
|
|
115
|
+
el[type === "HTML" ? "innerHTML" : "innerText"] = text.text;
|
|
116
|
+
el.setAttribute("data-bs-text-key", key);
|
|
117
|
+
} else {
|
|
118
|
+
el[type === "HTML" ? "innerHTML" : "innerText"] = key;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
const _hoisted_1$G = ["disabled"];
|
|
124
|
+
const _hoisted_2$v = {
|
|
125
|
+
key: 0,
|
|
126
|
+
class: "font-icon"
|
|
127
|
+
};
|
|
128
|
+
const _sfc_main$K = /* @__PURE__ */ defineComponent({
|
|
30
129
|
__name: "BSButton",
|
|
31
130
|
props: {
|
|
32
|
-
caption: {}
|
|
131
|
+
caption: {},
|
|
132
|
+
buttonColor: { default: "default" },
|
|
133
|
+
leftIcon: {},
|
|
134
|
+
disabled: { type: Boolean, default: false }
|
|
33
135
|
},
|
|
34
136
|
setup(__props) {
|
|
35
137
|
return (_ctx, _cache) => {
|
|
36
|
-
return openBlock(), createElementBlock("button",
|
|
138
|
+
return openBlock(), createElementBlock("button", {
|
|
139
|
+
class: normalizeClass([[_ctx.buttonColor], "bs-button inline-flex items-center justify-center"]),
|
|
140
|
+
disabled: _ctx.disabled
|
|
141
|
+
}, [
|
|
142
|
+
_ctx.leftIcon ? (openBlock(), createElementBlock("span", _hoisted_2$v, toDisplayString(_ctx.leftIcon), 1)) : createCommentVNode("", true),
|
|
143
|
+
withDirectives(createElementVNode("span", null, null, 512), [
|
|
144
|
+
[unref(vT), _ctx.caption]
|
|
145
|
+
])
|
|
146
|
+
], 10, _hoisted_1$G);
|
|
37
147
|
};
|
|
38
148
|
}
|
|
39
149
|
});
|
|
150
|
+
const _export_sfc = (sfc, props) => {
|
|
151
|
+
const target = sfc.__vccOpts || sfc;
|
|
152
|
+
for (const [key, val] of props) {
|
|
153
|
+
target[key] = val;
|
|
154
|
+
}
|
|
155
|
+
return target;
|
|
156
|
+
};
|
|
157
|
+
const BSButton = /* @__PURE__ */ _export_sfc(_sfc_main$K, [["__scopeId", "data-v-6d6c76d8"]]);
|
|
40
158
|
const fieldValidator = (option) => {
|
|
41
159
|
const value = ref(option.initialValue);
|
|
42
160
|
const valid = ref(false);
|
|
@@ -111,11 +229,11 @@ const componentUtil = {
|
|
|
111
229
|
}
|
|
112
230
|
}
|
|
113
231
|
};
|
|
114
|
-
const _hoisted_1$
|
|
115
|
-
const _hoisted_2$
|
|
116
|
-
const _hoisted_3$
|
|
232
|
+
const _hoisted_1$F = { class: "input-area" };
|
|
233
|
+
const _hoisted_2$u = ["id", "autocomplete", "disabled", "maxlength", "name", "placeholder", "tabindex", "type"];
|
|
234
|
+
const _hoisted_3$j = { key: 0 };
|
|
117
235
|
const _hoisted_4$c = ["textContent"];
|
|
118
|
-
const _sfc_main$
|
|
236
|
+
const _sfc_main$J = /* @__PURE__ */ defineComponent({
|
|
119
237
|
__name: "BSTextInput",
|
|
120
238
|
props: {
|
|
121
239
|
id: {},
|
|
@@ -127,7 +245,8 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
127
245
|
required: { type: Boolean },
|
|
128
246
|
width: { default: "200px" },
|
|
129
247
|
autocomplete: {},
|
|
130
|
-
tabindex: { default: 0 }
|
|
248
|
+
tabindex: { default: 0 },
|
|
249
|
+
inputType: { default: "text" }
|
|
131
250
|
},
|
|
132
251
|
emits: ["update:modelValue"],
|
|
133
252
|
setup(__props, { emit: __emit }) {
|
|
@@ -165,7 +284,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
165
284
|
class: normalizeClass([{ required: _ctx.required }, "bs-text-input"]),
|
|
166
285
|
style: normalizeStyle({ width: _ctx.width })
|
|
167
286
|
}, [
|
|
168
|
-
createElementVNode("div", _hoisted_1$
|
|
287
|
+
createElementVNode("div", _hoisted_1$F, [
|
|
169
288
|
withDirectives(createElementVNode("input", mergeProps({
|
|
170
289
|
id: _ctx.id,
|
|
171
290
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(value) ? value.value = $event : null),
|
|
@@ -175,12 +294,12 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
175
294
|
name: _ctx.name,
|
|
176
295
|
placeholder: _ctx.placeholder,
|
|
177
296
|
tabindex: _ctx.tabindex,
|
|
178
|
-
type:
|
|
179
|
-
}, toHandlers(handlers, true)), null, 16, _hoisted_2$
|
|
180
|
-
[
|
|
297
|
+
type: _ctx.inputType
|
|
298
|
+
}, toHandlers(handlers, true)), null, 16, _hoisted_2$u), [
|
|
299
|
+
[vModelDynamic, unref(value)]
|
|
181
300
|
])
|
|
182
301
|
]),
|
|
183
|
-
unref(errors).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
302
|
+
unref(errors).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_3$j, [
|
|
184
303
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(errors), (error) => {
|
|
185
304
|
return openBlock(), createElementBlock("div", {
|
|
186
305
|
key: error.code,
|
|
@@ -193,10 +312,10 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
193
312
|
};
|
|
194
313
|
}
|
|
195
314
|
});
|
|
196
|
-
const _hoisted_1$
|
|
197
|
-
const _hoisted_2$
|
|
198
|
-
const _hoisted_3$
|
|
199
|
-
const _sfc_main$
|
|
315
|
+
const _hoisted_1$E = { class: "input-area" };
|
|
316
|
+
const _hoisted_2$t = ["id", "autocomplete", "disabled", "maxlength", "name", "placeholder", "tabindex"];
|
|
317
|
+
const _hoisted_3$i = /* @__PURE__ */ createElementVNode("div", { class: "message-area" }, null, -1);
|
|
318
|
+
const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
200
319
|
__name: "BSNumberInput",
|
|
201
320
|
props: {
|
|
202
321
|
id: {},
|
|
@@ -223,7 +342,7 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
|
223
342
|
style: normalizeStyle({ width: _ctx.width }),
|
|
224
343
|
class: "bs-number-input"
|
|
225
344
|
}, [
|
|
226
|
-
createElementVNode("div", _hoisted_1$
|
|
345
|
+
createElementVNode("div", _hoisted_1$E, [
|
|
227
346
|
withDirectives(createElementVNode("input", mergeProps({
|
|
228
347
|
id: _ctx.id,
|
|
229
348
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
|
|
@@ -235,10 +354,64 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
|
235
354
|
tabindex: _ctx.tabindex,
|
|
236
355
|
pattern: "\\d*",
|
|
237
356
|
type: "text"
|
|
238
|
-
}, toHandlers(handlers, true)), null, 16, _hoisted_2$
|
|
357
|
+
}, toHandlers(handlers, true)), null, 16, _hoisted_2$t), [
|
|
239
358
|
[vModelText, value.value]
|
|
240
359
|
])
|
|
241
360
|
]),
|
|
361
|
+
_hoisted_3$i
|
|
362
|
+
], 4);
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
const _hoisted_1$D = { class: "input-area" };
|
|
367
|
+
const _hoisted_2$s = ["id", "name", "value"];
|
|
368
|
+
const _hoisted_3$h = /* @__PURE__ */ createElementVNode("div", { class: "message-area" }, null, -1);
|
|
369
|
+
const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
370
|
+
__name: "BSPriceInput",
|
|
371
|
+
props: {
|
|
372
|
+
id: {},
|
|
373
|
+
name: {},
|
|
374
|
+
modelValue: {},
|
|
375
|
+
prefix: { type: Boolean },
|
|
376
|
+
maxlength: {},
|
|
377
|
+
disabled: { type: Boolean },
|
|
378
|
+
required: { type: Boolean },
|
|
379
|
+
width: { default: "200px" },
|
|
380
|
+
autocomplete: {},
|
|
381
|
+
tabindex: { default: 0 }
|
|
382
|
+
},
|
|
383
|
+
emits: ["update:modelValue"],
|
|
384
|
+
setup(__props, { emit: __emit }) {
|
|
385
|
+
const props = __props;
|
|
386
|
+
const locale = window.navigator.language;
|
|
387
|
+
console.log("locale ", locale);
|
|
388
|
+
const moneyRef = ref(props.modelValue);
|
|
389
|
+
const formattedValue = computed(() => moneyRef.value.value ? Number(moneyRef.value.value).toLocaleString(locale) : "");
|
|
390
|
+
const emitValue = (event) => {
|
|
391
|
+
const inputValue = event.target.value;
|
|
392
|
+
moneyRef.value.displayValue = Number(inputValue).toLocaleString(locale, {
|
|
393
|
+
style: "currency",
|
|
394
|
+
currency: moneyRef.value.currenyCode
|
|
395
|
+
});
|
|
396
|
+
moneyRef.value.value = Number(inputValue);
|
|
397
|
+
emit("update:modelValue", moneyRef.value);
|
|
398
|
+
};
|
|
399
|
+
const emit = __emit;
|
|
400
|
+
return (_ctx, _cache) => {
|
|
401
|
+
return openBlock(), createElementBlock("div", {
|
|
402
|
+
style: normalizeStyle({ width: _ctx.width }),
|
|
403
|
+
class: "bs-number-input"
|
|
404
|
+
}, [
|
|
405
|
+
createElementVNode("div", _hoisted_1$D, [
|
|
406
|
+
createElementVNode("input", {
|
|
407
|
+
id: _ctx.id,
|
|
408
|
+
name: _ctx.name,
|
|
409
|
+
value: formattedValue.value,
|
|
410
|
+
pattern: "\\d*",
|
|
411
|
+
type: "text",
|
|
412
|
+
onChange: emitValue
|
|
413
|
+
}, null, 40, _hoisted_2$s)
|
|
414
|
+
]),
|
|
242
415
|
_hoisted_3$h
|
|
243
416
|
], 4);
|
|
244
417
|
};
|
|
@@ -578,13 +751,6 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
578
751
|
};
|
|
579
752
|
}
|
|
580
753
|
});
|
|
581
|
-
const _export_sfc = (sfc, props) => {
|
|
582
|
-
const target = sfc.__vccOpts || sfc;
|
|
583
|
-
for (const [key, val] of props) {
|
|
584
|
-
target[key] = val;
|
|
585
|
-
}
|
|
586
|
-
return target;
|
|
587
|
-
};
|
|
588
754
|
const _sfc_main$A = {};
|
|
589
755
|
const _hoisted_1$w = { class: "bs-popup" };
|
|
590
756
|
function _sfc_render(_ctx, _cache) {
|
|
@@ -1134,9 +1300,32 @@ const formatUtil = {
|
|
|
1134
1300
|
* @return
|
|
1135
1301
|
*/
|
|
1136
1302
|
formatNumber(value) {
|
|
1303
|
+
const regexp = /\B(?=(\d{3})+(?!\d))/g;
|
|
1304
|
+
if (value || typeof value === "number") {
|
|
1305
|
+
const splitValue = value.toString().split(".");
|
|
1306
|
+
return splitValue[0].replace(regexp, ",").concat(".", splitValue[1]);
|
|
1307
|
+
}
|
|
1308
|
+
return null;
|
|
1309
|
+
},
|
|
1310
|
+
formatNumberByCode(value, locale) {
|
|
1311
|
+
if (typeof value === "undefined") {
|
|
1312
|
+
return null;
|
|
1313
|
+
}
|
|
1137
1314
|
if (value || typeof value === "number") {
|
|
1138
|
-
|
|
1139
|
-
|
|
1315
|
+
return value.toLocaleString(locale);
|
|
1316
|
+
}
|
|
1317
|
+
return null;
|
|
1318
|
+
},
|
|
1319
|
+
/**
|
|
1320
|
+
* 통화단위와 표시위치를 받아 출력한다
|
|
1321
|
+
* @param value 값
|
|
1322
|
+
* @param withUnit 통화단위
|
|
1323
|
+
* @param prefix true 이면 withUnit을 앞에 붙이고, false 이면 뒤에 붙인다.
|
|
1324
|
+
*/
|
|
1325
|
+
formatPrice(value, withUnit, prefix = false) {
|
|
1326
|
+
if (value || typeof value === "number") {
|
|
1327
|
+
const formattedValue = this.formatNumber(value);
|
|
1328
|
+
return prefix ? `${withUnit}${formattedValue}` : `${formattedValue}${withUnit}`;
|
|
1140
1329
|
}
|
|
1141
1330
|
return null;
|
|
1142
1331
|
},
|
|
@@ -1933,7 +2122,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
|
1933
2122
|
"date-filter": _ctx.config.dateFilter
|
|
1934
2123
|
}, null, 8, ["modelValue", "date-filter"])) : createCommentVNode("", true),
|
|
1935
2124
|
createElementVNode("div", null, [
|
|
1936
|
-
createVNode(
|
|
2125
|
+
createVNode(BSButton, {
|
|
1937
2126
|
caption: "Search",
|
|
1938
2127
|
onClick: emitSearch
|
|
1939
2128
|
})
|
|
@@ -2373,7 +2562,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
2373
2562
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.locales, (locale) => {
|
|
2374
2563
|
return openBlock(), createElementBlock(Fragment, { key: locale }, [
|
|
2375
2564
|
_ctx.expandLocale || locale === unref(blueseaConfig).defaultLocale ? (openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
2376
|
-
createVNode(_sfc_main$
|
|
2565
|
+
createVNode(_sfc_main$J, {
|
|
2377
2566
|
id: _ctx.id ? `${_ctx.id}_${locale}` : void 0,
|
|
2378
2567
|
autocomplete: _ctx.autocomplete,
|
|
2379
2568
|
disabled: _ctx.disabled,
|
|
@@ -2624,101 +2813,6 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
2624
2813
|
};
|
|
2625
2814
|
}
|
|
2626
2815
|
});
|
|
2627
|
-
class I18NTexts {
|
|
2628
|
-
constructor() {
|
|
2629
|
-
__publicField(this, "localeTexts", {});
|
|
2630
|
-
__publicField(this, "defaultLocale");
|
|
2631
|
-
}
|
|
2632
|
-
setDefaultLocale(locale) {
|
|
2633
|
-
this.defaultLocale = locale;
|
|
2634
|
-
}
|
|
2635
|
-
addTexts(locale, textList) {
|
|
2636
|
-
const text = this.ensureAddLocale(locale);
|
|
2637
|
-
textList.forEach((t) => text[t.key] = t);
|
|
2638
|
-
}
|
|
2639
|
-
text(locale, key, args) {
|
|
2640
|
-
var _a, _b, _c;
|
|
2641
|
-
let text = (_a = this.localeTexts[locale]) == null ? void 0 : _a[key];
|
|
2642
|
-
let parentLocale = locale;
|
|
2643
|
-
while (parentLocale && !text) {
|
|
2644
|
-
parentLocale = parentLocale.substring(0, parentLocale.lastIndexOf("-"));
|
|
2645
|
-
text = (_b = this.localeTexts[parentLocale]) == null ? void 0 : _b[key];
|
|
2646
|
-
}
|
|
2647
|
-
const defLocale = this.ensureGetDefaultLocale();
|
|
2648
|
-
if (!text && defLocale && defLocale !== locale) {
|
|
2649
|
-
text = (_c = this.localeTexts[defLocale]) == null ? void 0 : _c[key];
|
|
2650
|
-
}
|
|
2651
|
-
const resolved = text ? this.resolveText(text, args) : key;
|
|
2652
|
-
const html = text ? !!text.html : false;
|
|
2653
|
-
return { key, text: resolved, html };
|
|
2654
|
-
}
|
|
2655
|
-
// {0} {1} 등의 변수를 args 로 대치한다.
|
|
2656
|
-
resolveText(text, args) {
|
|
2657
|
-
let result = text.text;
|
|
2658
|
-
const re = /\{\s*(\d+)\s*}/g;
|
|
2659
|
-
const slots = [];
|
|
2660
|
-
let exec;
|
|
2661
|
-
while (exec = re.exec(result)) {
|
|
2662
|
-
slots.push(exec);
|
|
2663
|
-
}
|
|
2664
|
-
slots.reverse();
|
|
2665
|
-
for (const slot of slots) {
|
|
2666
|
-
if (result.charAt(slot.index - 1) === "\\") {
|
|
2667
|
-
result = result.substring(0, slot.index - 1) + result.substring(slot.index);
|
|
2668
|
-
} else {
|
|
2669
|
-
const index = Number(slot[1]);
|
|
2670
|
-
if ((args == null ? void 0 : args[index]) !== void 0) {
|
|
2671
|
-
result = result.substring(0, slot.index) + args[index] + result.substring(slot.index + slot[0].length);
|
|
2672
|
-
}
|
|
2673
|
-
}
|
|
2674
|
-
}
|
|
2675
|
-
return result;
|
|
2676
|
-
}
|
|
2677
|
-
ensureAddLocale(locale) {
|
|
2678
|
-
return this.localeTexts[locale] = this.localeTexts[locale] || {};
|
|
2679
|
-
}
|
|
2680
|
-
ensureGetDefaultLocale() {
|
|
2681
|
-
if (!this.defaultLocale) {
|
|
2682
|
-
this.defaultLocale = blueseaConfig.defaultLocale;
|
|
2683
|
-
}
|
|
2684
|
-
return this.defaultLocale;
|
|
2685
|
-
}
|
|
2686
|
-
}
|
|
2687
|
-
const getCurrentLocale = () => {
|
|
2688
|
-
return document.documentElement.lang || navigator.language;
|
|
2689
|
-
};
|
|
2690
|
-
const i18n = new I18NTexts();
|
|
2691
|
-
const parseBinding = (binding) => {
|
|
2692
|
-
const type = binding.modifiers.html ? "HTML" : "TEXT";
|
|
2693
|
-
if (typeof binding.value === "string") {
|
|
2694
|
-
return { key: binding.value, type, multiLang: false };
|
|
2695
|
-
} else if (Array.isArray(binding.value)) {
|
|
2696
|
-
const key = String(binding.value[0]);
|
|
2697
|
-
const args = binding.value.toSpliced(0, 1);
|
|
2698
|
-
return { key, args, type, multiLang: true };
|
|
2699
|
-
} else if (typeof binding.value === "object") {
|
|
2700
|
-
const key = binding.value.key || "";
|
|
2701
|
-
const args = Array.isArray(binding.value.args) ? binding.value.args : void 0;
|
|
2702
|
-
return { key, args, type, multiLang: true };
|
|
2703
|
-
} else {
|
|
2704
|
-
return { multiLang: false };
|
|
2705
|
-
}
|
|
2706
|
-
};
|
|
2707
|
-
const vT = {
|
|
2708
|
-
mounted: (el, binding) => {
|
|
2709
|
-
const { multiLang, key, args, type } = parseBinding(binding);
|
|
2710
|
-
if (key) {
|
|
2711
|
-
if (multiLang) {
|
|
2712
|
-
const locale = getCurrentLocale();
|
|
2713
|
-
const text = i18n.text(locale, key, args);
|
|
2714
|
-
el[type === "HTML" ? "innerHTML" : "innerText"] = text.text;
|
|
2715
|
-
el.setAttribute("data-bs-text-key", key);
|
|
2716
|
-
} else {
|
|
2717
|
-
el[type === "HTML" ? "innerHTML" : "innerText"] = key;
|
|
2718
|
-
}
|
|
2719
|
-
}
|
|
2720
|
-
}
|
|
2721
|
-
};
|
|
2722
2816
|
const _hoisted_1$7 = {
|
|
2723
2817
|
key: 0,
|
|
2724
2818
|
class: "menu separator"
|
|
@@ -2893,7 +2987,7 @@ class PageManager {
|
|
|
2893
2987
|
pageId: page.pageId,
|
|
2894
2988
|
path: pagePath,
|
|
2895
2989
|
active: false,
|
|
2896
|
-
component: markRaw(page.component),
|
|
2990
|
+
component: page.component ? markRaw(page.component) : void 0,
|
|
2897
2991
|
// component 는 reactive 하지 않아야 한다.
|
|
2898
2992
|
hideTab: page === this.firstPage
|
|
2899
2993
|
});
|
|
@@ -2941,7 +3035,9 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
2941
3035
|
onClick: _cache[0] || (_cache[0] = ($event) => emit("click"))
|
|
2942
3036
|
}, {
|
|
2943
3037
|
default: withCtx(() => [
|
|
2944
|
-
|
|
3038
|
+
withDirectives(createElementVNode("span", null, null, 512), [
|
|
3039
|
+
[unref(vT), { key: `menu.${_ctx.menu.menuId}` }]
|
|
3040
|
+
])
|
|
2945
3041
|
]),
|
|
2946
3042
|
_: 1
|
|
2947
3043
|
}, 8, ["to"])) : (openBlock(), createElementBlock("div", {
|
|
@@ -2950,7 +3046,11 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
2950
3046
|
tabindex: "0",
|
|
2951
3047
|
onClick: _cache[1] || (_cache[1] = ($event) => emit("click")),
|
|
2952
3048
|
onKeyup: _cache[2] || (_cache[2] = withKeys(withModifiers(($event) => emit("click"), ["prevent"]), ["enter"]))
|
|
2953
|
-
},
|
|
3049
|
+
}, [
|
|
3050
|
+
withDirectives(createElementVNode("span", null, null, 512), [
|
|
3051
|
+
[unref(vT), { key: `menu.${_ctx.menu.menuId}` }]
|
|
3052
|
+
])
|
|
3053
|
+
], 32));
|
|
2954
3054
|
};
|
|
2955
3055
|
}
|
|
2956
3056
|
});
|
|
@@ -3170,7 +3270,7 @@ const parsePathParam = (route) => {
|
|
|
3170
3270
|
const BLUESEA_VERSION = "5.0.0";
|
|
3171
3271
|
export {
|
|
3172
3272
|
BLUESEA_VERSION,
|
|
3173
|
-
|
|
3273
|
+
BSButton,
|
|
3174
3274
|
_sfc_main$E as BSCheckbox,
|
|
3175
3275
|
_sfc_main$D as BSCheckboxGroup,
|
|
3176
3276
|
_sfc_main$8 as BSContextMenuContainer,
|
|
@@ -3187,14 +3287,15 @@ export {
|
|
|
3187
3287
|
_sfc_main$d as BSMultiLangTextArea,
|
|
3188
3288
|
_sfc_main$e as BSMultiLangTextInput,
|
|
3189
3289
|
_sfc_main$x as BSMultiSelect,
|
|
3190
|
-
_sfc_main$
|
|
3290
|
+
_sfc_main$I as BSNumberInput,
|
|
3291
|
+
_sfc_main$H as BSPriceInput,
|
|
3191
3292
|
_sfc_main$C as BSRadioButton,
|
|
3192
3293
|
_sfc_main$B as BSRadioButtonGroup,
|
|
3193
3294
|
_sfc_main$y as BSSelect,
|
|
3194
3295
|
_sfc_main$j as BSTabSheet,
|
|
3195
3296
|
_sfc_main$v as BSTextArea,
|
|
3196
3297
|
_sfc_main$o as BSTextFilter,
|
|
3197
|
-
_sfc_main$
|
|
3298
|
+
_sfc_main$J as BSTextInput,
|
|
3198
3299
|
_sfc_main$f as BSTree,
|
|
3199
3300
|
_sfc_main$w as BSTreeSelect,
|
|
3200
3301
|
_sfc_main as DefaultBody,
|