mgv-backoffice 1.34.0 → 1.35.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/README.md +41 -1
- package/dist/components/BasePillPickerModal.vue.d.ts +43 -0
- package/dist/components/BaseToolbarButton.vue.d.ts +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/types/pillPicker.d.ts +14 -0
- package/dist/ui-lib.css +1 -1
- package/dist/ui-lib.js +159 -58
- package/dist/ui-lib.umd.cjs +1 -1
- package/package.json +1 -1
- package/src/components/BasePillPickerModal.test.ts +95 -0
- package/src/components/BasePillPickerModal.vue +0 -0
- package/src/components/BaseToolbarButton.test.ts +48 -0
- package/src/components/BaseToolbarButton.vue +21 -6
- package/src/index.ts +2 -0
- package/src/types/pillPicker.ts +14 -0
package/dist/ui-lib.js
CHANGED
|
@@ -2001,7 +2001,11 @@ var fn = ["aria-label", "aria-expanded"], pn = { class: "flex flex-col h-full" }
|
|
|
2001
2001
|
},
|
|
2002
2002
|
emits: ["click"],
|
|
2003
2003
|
setup(e) {
|
|
2004
|
-
let t = e, { isDark: n } = V(), i =
|
|
2004
|
+
let t = e, { isDark: n } = V(), i = {
|
|
2005
|
+
neutral: "px-3 py-2 rounded-lg font-medium disabled:opacity-50",
|
|
2006
|
+
danger: "px-3 py-2 rounded-lg font-medium disabled:opacity-50",
|
|
2007
|
+
ghost: "h-9 px-4 rounded-md font-semibold disabled:opacity-40 disabled:hover:bg-slate-50 dark:disabled:hover:bg-slate-900"
|
|
2008
|
+
}, s = r(() => {
|
|
2005
2009
|
let e = {
|
|
2006
2010
|
neutral: {
|
|
2007
2011
|
dark: "bg-gray-800 text-gray-100 border-gray-700 hover:bg-gray-700",
|
|
@@ -2010,15 +2014,19 @@ var fn = ["aria-label", "aria-expanded"], pn = { class: "flex flex-col h-full" }
|
|
|
2010
2014
|
danger: {
|
|
2011
2015
|
dark: "bg-red-600 text-white border-red-600 hover:bg-red-500",
|
|
2012
2016
|
light: "bg-red-600 text-white border-red-600 hover:bg-red-700"
|
|
2017
|
+
},
|
|
2018
|
+
ghost: {
|
|
2019
|
+
dark: "border-slate-300 dark:border-slate-600 bg-slate-50 dark:bg-slate-900 text-slate-600 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-slate-800",
|
|
2020
|
+
light: "border-slate-300 dark:border-slate-600 bg-slate-50 dark:bg-slate-900 text-slate-600 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-slate-800"
|
|
2013
2021
|
}
|
|
2014
2022
|
}[t.variant];
|
|
2015
|
-
return n.value ? e.dark : e.light;
|
|
2023
|
+
return [i[t.variant], n.value ? e.dark : e.light];
|
|
2016
2024
|
});
|
|
2017
2025
|
return (t, n) => (b(), o("button", {
|
|
2018
2026
|
type: e.type,
|
|
2019
2027
|
disabled: e.disabled,
|
|
2020
2028
|
title: e.title,
|
|
2021
|
-
class: h(["inline-flex shrink-0 items-center gap-2
|
|
2029
|
+
class: h(["inline-flex shrink-0 items-center gap-2 text-sm border transition-colors cursor-pointer disabled:cursor-not-allowed whitespace-nowrap focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500", s.value]),
|
|
2022
2030
|
onClick: n[0] ||= (e) => t.$emit("click", e)
|
|
2023
2031
|
}, [T(t.$slots, "icon", { iconClass: "w-4 h-4" }), e.label ? (b(), o("span", Wn, O(e.label), 1)) : a("", !0)], 10, Un));
|
|
2024
2032
|
}
|
|
@@ -3071,10 +3079,103 @@ var fn = ["aria-label", "aria-expanded"], pn = { class: "flex flex-col h-full" }
|
|
|
3071
3079
|
_: 3
|
|
3072
3080
|
}));
|
|
3073
3081
|
}
|
|
3082
|
+
}), wi = {
|
|
3083
|
+
key: 0,
|
|
3084
|
+
class: "text-sm text-slate-500 dark:text-slate-400"
|
|
3085
|
+
}, Ti = { class: "mb-3 flex flex-wrap items-center gap-2" }, Ei = { class: "relative min-w-[200px] flex-1" }, Di = ["placeholder"], Oi = {
|
|
3086
|
+
key: 0,
|
|
3087
|
+
class: "text-sm text-slate-500 dark:text-slate-400"
|
|
3088
|
+
}, ki = {
|
|
3089
|
+
key: 1,
|
|
3090
|
+
class: "flex flex-wrap gap-2"
|
|
3091
|
+
}, Ai = ["title", "onClick"], ji = "h-9 rounded-md border border-slate-300 dark:border-slate-600 bg-slate-50 dark:bg-slate-900 text-slate-900 dark:text-slate-100 text-sm focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500", Mi = "\0all", Ni = /* @__PURE__ */ f({
|
|
3092
|
+
__name: "BasePillPickerModal",
|
|
3093
|
+
props: {
|
|
3094
|
+
title: {},
|
|
3095
|
+
items: {},
|
|
3096
|
+
groups: {},
|
|
3097
|
+
icon: {},
|
|
3098
|
+
subtitle: {},
|
|
3099
|
+
searchPlaceholder: { default: "Filter…" },
|
|
3100
|
+
emptyMessage: { default: "Nothing to pick from." },
|
|
3101
|
+
noMatchMessage: { default: "No items match the current filter." },
|
|
3102
|
+
mono: {
|
|
3103
|
+
type: Boolean,
|
|
3104
|
+
default: !1
|
|
3105
|
+
},
|
|
3106
|
+
maxWidthClass: { default: "max-w-2xl" },
|
|
3107
|
+
closeText: { default: "Close" },
|
|
3108
|
+
groupAriaLabel: { default: "Group" },
|
|
3109
|
+
allLabel: { default: "All" }
|
|
3110
|
+
},
|
|
3111
|
+
emits: ["pick", "close"],
|
|
3112
|
+
setup(t, { emit: n }) {
|
|
3113
|
+
let c = t, l = n, u = r(() => c.icon ?? ve), f = C(""), p = C(Mi), m = r(() => c.groups && c.groups.length > 0 ? [{
|
|
3114
|
+
value: Mi,
|
|
3115
|
+
label: c.allLabel
|
|
3116
|
+
}, ...c.groups] : []), g = r(() => c.items.filter((e) => (p.value === Mi || e.group === p.value) && e.label.toLowerCase().includes(f.value.trim().toLowerCase())));
|
|
3117
|
+
return (n, r) => (b(), i(Vt, {
|
|
3118
|
+
title: t.title,
|
|
3119
|
+
icon: u.value,
|
|
3120
|
+
subtitle: t.subtitle,
|
|
3121
|
+
scrollable: "",
|
|
3122
|
+
"max-width-class": t.maxWidthClass,
|
|
3123
|
+
onCancel: r[4] ||= (e) => l("close")
|
|
3124
|
+
}, {
|
|
3125
|
+
footer: F(() => [d(Gn, {
|
|
3126
|
+
variant: "ghost",
|
|
3127
|
+
label: t.closeText,
|
|
3128
|
+
onClick: r[3] ||= (e) => l("close")
|
|
3129
|
+
}, null, 8, ["label"])]),
|
|
3130
|
+
default: F(() => [t.items.length === 0 ? (b(), o("p", wi, O(t.emptyMessage), 1)) : (b(), o(e, { key: 1 }, [s("div", Ti, [s("div", Ei, [
|
|
3131
|
+
d(k(ve), { class: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-slate-400" }),
|
|
3132
|
+
I(s("input", {
|
|
3133
|
+
"onUpdate:modelValue": r[0] ||= (e) => f.value = e,
|
|
3134
|
+
type: "text",
|
|
3135
|
+
placeholder: t.searchPlaceholder,
|
|
3136
|
+
autocomplete: "off",
|
|
3137
|
+
class: h([
|
|
3138
|
+
ji,
|
|
3139
|
+
"w-full pl-9 pr-8 placeholder:text-slate-400 dark:placeholder:text-slate-500",
|
|
3140
|
+
t.mono ? "font-mono" : ""
|
|
3141
|
+
])
|
|
3142
|
+
}, null, 10, Di), [[M, f.value]]),
|
|
3143
|
+
f.value ? (b(), o("button", {
|
|
3144
|
+
key: 0,
|
|
3145
|
+
type: "button",
|
|
3146
|
+
"aria-label": "Clear the filter",
|
|
3147
|
+
class: "absolute right-2 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600 dark:hover:text-slate-200",
|
|
3148
|
+
onClick: r[1] ||= (e) => f.value = ""
|
|
3149
|
+
}, " ✕ ")) : a("", !0)
|
|
3150
|
+
]), m.value.length > 0 ? (b(), i(Vr, {
|
|
3151
|
+
key: 0,
|
|
3152
|
+
modelValue: p.value,
|
|
3153
|
+
"onUpdate:modelValue": r[2] ||= (e) => p.value = e,
|
|
3154
|
+
options: m.value,
|
|
3155
|
+
"aria-label": t.groupAriaLabel
|
|
3156
|
+
}, null, 8, [
|
|
3157
|
+
"modelValue",
|
|
3158
|
+
"options",
|
|
3159
|
+
"aria-label"
|
|
3160
|
+
])) : a("", !0)]), g.value.length === 0 ? (b(), o("p", Oi, O(t.noMatchMessage), 1)) : (b(), o("div", ki, [(b(!0), o(e, null, w(g.value, (e) => (b(), o("button", {
|
|
3161
|
+
key: e.id,
|
|
3162
|
+
type: "button",
|
|
3163
|
+
title: e.title,
|
|
3164
|
+
class: h(["h-8 shrink-0 rounded-md border border-slate-300 dark:border-slate-600 bg-slate-50 dark:bg-slate-900 px-3 text-sm text-slate-700 dark:text-slate-200 transition-colors hover:border-emerald-500 hover:bg-emerald-50 hover:text-emerald-700 dark:hover:bg-emerald-500/10 dark:hover:text-emerald-400 focus:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500", t.mono ? "font-mono" : ""]),
|
|
3165
|
+
onClick: (t) => l("pick", e)
|
|
3166
|
+
}, O(e.label), 11, Ai))), 128))]))], 64))]),
|
|
3167
|
+
_: 1
|
|
3168
|
+
}, 8, [
|
|
3169
|
+
"title",
|
|
3170
|
+
"icon",
|
|
3171
|
+
"subtitle",
|
|
3172
|
+
"max-width-class"
|
|
3173
|
+
]));
|
|
3174
|
+
}
|
|
3074
3175
|
});
|
|
3075
3176
|
//#endregion
|
|
3076
3177
|
//#region src/composables/useDebounce.ts
|
|
3077
|
-
function
|
|
3178
|
+
function Pi(e, t = 300) {
|
|
3078
3179
|
let n = C(e.value), r = null;
|
|
3079
3180
|
return P(e, (e) => {
|
|
3080
3181
|
r && clearTimeout(r), r = setTimeout(() => {
|
|
@@ -3086,7 +3187,7 @@ function wi(e, t = 300) {
|
|
|
3086
3187
|
}
|
|
3087
3188
|
//#endregion
|
|
3088
3189
|
//#region src/composables/useToast.ts
|
|
3089
|
-
function
|
|
3190
|
+
function Fi(e = 3e3) {
|
|
3090
3191
|
let t = C(!1), n = C(""), r = C(q.SUCCESS), i = null;
|
|
3091
3192
|
function a() {
|
|
3092
3193
|
i &&= (clearTimeout(i), null);
|
|
@@ -3107,7 +3208,7 @@ function Ti(e = 3e3) {
|
|
|
3107
3208
|
}
|
|
3108
3209
|
//#endregion
|
|
3109
3210
|
//#region src/composables/useQueryParamSync.ts
|
|
3110
|
-
function
|
|
3211
|
+
function Ii() {
|
|
3111
3212
|
let e = we(), t = Te();
|
|
3112
3213
|
function n(t) {
|
|
3113
3214
|
let n = e.query[t];
|
|
@@ -3129,7 +3230,7 @@ function Ei() {
|
|
|
3129
3230
|
}
|
|
3130
3231
|
//#endregion
|
|
3131
3232
|
//#region src/composables/useFieldClasses.ts
|
|
3132
|
-
function
|
|
3233
|
+
function Li() {
|
|
3133
3234
|
let { isDark: e } = V(), t = r(() => e.value ? "text-gray-300" : "text-gray-600"), n = r(() => e.value ? "bg-gray-800 border-gray-600 text-gray-100 placeholder-gray-500 focus:ring-emerald-500 focus:border-emerald-500" : "bg-white border-gray-300 text-gray-800 focus:ring-emerald-500 focus:border-emerald-500");
|
|
3134
3235
|
function i(t) {
|
|
3135
3236
|
return t == null || String(t).trim() === "" ? e.value ? "bg-gray-800 border-red-500 text-gray-100 placeholder-gray-500 focus:ring-red-500 focus:border-red-500 ring-1 ring-red-500/30" : "bg-white border-red-400 text-gray-800 focus:ring-red-500 focus:border-red-500 ring-1 ring-red-400/30" : n.value;
|
|
@@ -3142,7 +3243,7 @@ function Di() {
|
|
|
3142
3243
|
}
|
|
3143
3244
|
//#endregion
|
|
3144
3245
|
//#region src/composables/usePolling.ts
|
|
3145
|
-
function
|
|
3246
|
+
function Ri(e, t, n = {}) {
|
|
3146
3247
|
let { immediate: r = !0, pauseWhenHidden: i = !0 } = n, a = null, o = C(!1);
|
|
3147
3248
|
function s() {
|
|
3148
3249
|
a !== null || t === null || (a = setInterval(() => void e(), t));
|
|
@@ -3171,12 +3272,12 @@ function Oi(e, t, n = {}) {
|
|
|
3171
3272
|
}
|
|
3172
3273
|
//#endregion
|
|
3173
3274
|
//#region src/enums/BaseBadgeEnum.ts
|
|
3174
|
-
var
|
|
3275
|
+
var zi = /* @__PURE__ */ function(e) {
|
|
3175
3276
|
return e.WIN = "WIN", e.LOSE = "LOSE", e;
|
|
3176
3277
|
}({});
|
|
3177
3278
|
//#endregion
|
|
3178
3279
|
//#region src/utils/util.ts
|
|
3179
|
-
function
|
|
3280
|
+
function Bi(e) {
|
|
3180
3281
|
let t = "red";
|
|
3181
3282
|
switch (e) {
|
|
3182
3283
|
case R.ERROR:
|
|
@@ -3194,7 +3295,7 @@ function Ai(e) {
|
|
|
3194
3295
|
}
|
|
3195
3296
|
return t;
|
|
3196
3297
|
}
|
|
3197
|
-
function
|
|
3298
|
+
function Vi(e) {
|
|
3198
3299
|
let t = "red";
|
|
3199
3300
|
switch (e) {
|
|
3200
3301
|
case H.GREEN:
|
|
@@ -3223,14 +3324,14 @@ function ji(e) {
|
|
|
3223
3324
|
}
|
|
3224
3325
|
//#endregion
|
|
3225
3326
|
//#region src/utils/httpColors.ts
|
|
3226
|
-
var
|
|
3327
|
+
var Hi = {
|
|
3227
3328
|
GET: "bg-blue-600",
|
|
3228
3329
|
POST: "bg-emerald-600",
|
|
3229
3330
|
PUT: "bg-amber-600",
|
|
3230
3331
|
DELETE: "bg-red-600",
|
|
3231
3332
|
PATCH: "bg-purple-600",
|
|
3232
3333
|
HEAD: "bg-gray-600"
|
|
3233
|
-
},
|
|
3334
|
+
}, Ui = {
|
|
3234
3335
|
GET: "bg-blue-500",
|
|
3235
3336
|
POST: "bg-green-500",
|
|
3236
3337
|
PUT: "bg-yellow-500",
|
|
@@ -3238,39 +3339,39 @@ var Mi = {
|
|
|
3238
3339
|
PATCH: "bg-purple-500",
|
|
3239
3340
|
HEAD: "bg-gray-500"
|
|
3240
3341
|
};
|
|
3241
|
-
function
|
|
3242
|
-
return e ?
|
|
3342
|
+
function Wi(e) {
|
|
3343
|
+
return e ? Hi[e.toUpperCase()] ?? "bg-gray-600" : "bg-gray-600";
|
|
3243
3344
|
}
|
|
3244
|
-
function
|
|
3245
|
-
return e ?
|
|
3345
|
+
function Gi(e) {
|
|
3346
|
+
return e ? Ui[e.toUpperCase()] ?? "bg-gray-500" : "bg-gray-500";
|
|
3246
3347
|
}
|
|
3247
|
-
function
|
|
3348
|
+
function Ki(e) {
|
|
3248
3349
|
let t = e ?? 0;
|
|
3249
3350
|
return t >= 200 && t < 300 ? "bg-emerald-600" : t >= 300 && t < 400 ? "bg-blue-600" : t >= 400 && t < 500 ? "bg-amber-600" : t >= 500 ? "bg-red-600" : "bg-gray-600";
|
|
3250
3351
|
}
|
|
3251
|
-
function
|
|
3352
|
+
function qi(e, t) {
|
|
3252
3353
|
let n = (e || "ANY").toUpperCase();
|
|
3253
3354
|
return n === "GET" ? t ? "bg-blue-500/15 text-blue-400" : "bg-blue-100 text-blue-700" : n === "POST" ? t ? "bg-emerald-500/15 text-emerald-400" : "bg-emerald-100 text-emerald-700" : n === "PUT" ? t ? "bg-amber-500/15 text-amber-400" : "bg-amber-100 text-amber-700" : n === "DELETE" ? t ? "bg-red-500/15 text-red-400" : "bg-red-100 text-red-700" : n === "PATCH" ? t ? "bg-purple-500/15 text-purple-400" : "bg-purple-100 text-purple-700" : n === "HEAD" ? t ? "bg-sky-500/15 text-sky-400" : "bg-sky-100 text-sky-700" : t ? "bg-gray-500/15 text-gray-400" : "bg-gray-100 text-gray-600";
|
|
3254
3355
|
}
|
|
3255
|
-
function
|
|
3356
|
+
function Ji(e, t) {
|
|
3256
3357
|
let n = e ?? 200;
|
|
3257
3358
|
return n >= 200 && n < 300 ? t ? "bg-emerald-500/15 text-emerald-300" : "bg-emerald-100 text-emerald-700" : n >= 300 && n < 400 ? t ? "bg-sky-500/15 text-sky-300" : "bg-sky-100 text-sky-700" : n >= 400 && n < 500 ? t ? "bg-amber-500/15 text-amber-300" : "bg-amber-100 text-amber-700" : n >= 500 && n < 600 ? t ? "bg-red-500/15 text-red-300" : "bg-red-100 text-red-700" : t ? "bg-gray-800 text-gray-400" : "bg-gray-100 text-gray-600";
|
|
3258
3359
|
}
|
|
3259
|
-
function
|
|
3360
|
+
function Yi(e, t) {
|
|
3260
3361
|
let n = e ?? 200;
|
|
3261
3362
|
return t ? n >= 200 && n < 300 ? "bg-green-500/15 text-green-400" : n >= 300 && n < 400 ? "bg-blue-500/15 text-blue-400" : n >= 400 && n < 500 ? "bg-yellow-500/15 text-yellow-400" : "bg-red-500/15 text-red-400" : n >= 200 && n < 300 ? "bg-green-100 text-green-800" : n >= 300 && n < 400 ? "bg-blue-100 text-blue-800" : n >= 400 && n < 500 ? "bg-yellow-100 text-yellow-800" : "bg-red-100 text-red-800";
|
|
3262
3363
|
}
|
|
3263
3364
|
//#endregion
|
|
3264
3365
|
//#region src/utils/kvRows.ts
|
|
3265
|
-
function
|
|
3366
|
+
function Xi(e) {
|
|
3266
3367
|
return !(e.key ?? "").trim() || e.matcherType === "absent" ? !1 : !(e.value ?? "").trim();
|
|
3267
3368
|
}
|
|
3268
|
-
function
|
|
3369
|
+
function Zi(e) {
|
|
3269
3370
|
return e.matcherType === "absent" || !(e.value ?? "").trim() ? !1 : !(e.key ?? "").trim();
|
|
3270
3371
|
}
|
|
3271
3372
|
//#endregion
|
|
3272
3373
|
//#region src/utils/sanitizeHtml.ts
|
|
3273
|
-
var
|
|
3374
|
+
var Qi = /* @__PURE__ */ new Set([
|
|
3274
3375
|
"A",
|
|
3275
3376
|
"B",
|
|
3276
3377
|
"STRONG",
|
|
@@ -3285,7 +3386,7 @@ var Hi = /* @__PURE__ */ new Set([
|
|
|
3285
3386
|
"LI",
|
|
3286
3387
|
"SPAN",
|
|
3287
3388
|
"DIV"
|
|
3288
|
-
]),
|
|
3389
|
+
]), $i = /* @__PURE__ */ new Set([
|
|
3289
3390
|
"SCRIPT",
|
|
3290
3391
|
"STYLE",
|
|
3291
3392
|
"IFRAME",
|
|
@@ -3293,40 +3394,40 @@ var Hi = /* @__PURE__ */ new Set([
|
|
|
3293
3394
|
"EMBED",
|
|
3294
3395
|
"NOSCRIPT",
|
|
3295
3396
|
"TEMPLATE"
|
|
3296
|
-
]),
|
|
3297
|
-
function
|
|
3397
|
+
]), ea = { A: /* @__PURE__ */ new Set(["href", "title"]) };
|
|
3398
|
+
function ta(e) {
|
|
3298
3399
|
let t = e.trim().toLowerCase();
|
|
3299
3400
|
return t.startsWith("http://") || t.startsWith("https://") || t.startsWith("mailto:") || t.startsWith("tel:") || t.startsWith("/") || t.startsWith("#") || t === "";
|
|
3300
3401
|
}
|
|
3301
|
-
function
|
|
3402
|
+
function na(e) {
|
|
3302
3403
|
if (e.nodeType !== Node.ELEMENT_NODE) return;
|
|
3303
3404
|
let t = e, n = t.tagName.toUpperCase();
|
|
3304
|
-
if (!
|
|
3305
|
-
|
|
3405
|
+
if (!Qi.has(n)) {
|
|
3406
|
+
$i.has(n) ? t.remove() : t.replaceWith(document.createTextNode(t.textContent ?? ""));
|
|
3306
3407
|
return;
|
|
3307
3408
|
}
|
|
3308
|
-
let r =
|
|
3409
|
+
let r = ea[n] ?? /* @__PURE__ */ new Set();
|
|
3309
3410
|
for (let e of Array.from(t.attributes)) {
|
|
3310
3411
|
if (!r.has(e.name.toLowerCase())) {
|
|
3311
3412
|
t.removeAttribute(e.name);
|
|
3312
3413
|
continue;
|
|
3313
3414
|
}
|
|
3314
|
-
n === "A" && e.name.toLowerCase() === "href" && !
|
|
3415
|
+
n === "A" && e.name.toLowerCase() === "href" && !ta(e.value) && t.removeAttribute(e.name);
|
|
3315
3416
|
}
|
|
3316
3417
|
n === "A" && t.hasAttribute("href") && (t.setAttribute("rel", "noopener noreferrer"), t.setAttribute("target", "_blank"));
|
|
3317
|
-
for (let e of Array.from(t.childNodes))
|
|
3418
|
+
for (let e of Array.from(t.childNodes)) na(e);
|
|
3318
3419
|
}
|
|
3319
|
-
function
|
|
3420
|
+
function ra(e) {
|
|
3320
3421
|
if (!e) return "";
|
|
3321
3422
|
let t = new DOMParser().parseFromString(`<div>${e}</div>`, "text/html").body.firstElementChild;
|
|
3322
3423
|
if (!t) return "";
|
|
3323
|
-
for (let e of Array.from(t.childNodes))
|
|
3424
|
+
for (let e of Array.from(t.childNodes)) na(e);
|
|
3324
3425
|
return t.innerHTML;
|
|
3325
3426
|
}
|
|
3326
3427
|
//#endregion
|
|
3327
3428
|
//#region src/utils/format.ts
|
|
3328
3429
|
var $ = "—";
|
|
3329
|
-
function
|
|
3430
|
+
function ia(e, t = 4) {
|
|
3330
3431
|
if (e == null || typeof e == "string" && e.trim() === "") return $;
|
|
3331
3432
|
let n = typeof e == "string" ? Number(e) : e;
|
|
3332
3433
|
return isFinite(n) ? n.toLocaleString(void 0, {
|
|
@@ -3334,12 +3435,12 @@ function Ji(e, t = 4) {
|
|
|
3334
3435
|
maximumFractionDigits: t
|
|
3335
3436
|
}) : $;
|
|
3336
3437
|
}
|
|
3337
|
-
function
|
|
3438
|
+
function aa(e) {
|
|
3338
3439
|
if (e == null || e === "") return $;
|
|
3339
3440
|
let t = new Date(e);
|
|
3340
3441
|
return isNaN(t.getTime()) ? String(e) : t.toLocaleString();
|
|
3341
3442
|
}
|
|
3342
|
-
function
|
|
3443
|
+
function oa(e) {
|
|
3343
3444
|
return new Date(e).toLocaleString(void 0, {
|
|
3344
3445
|
month: "short",
|
|
3345
3446
|
day: "numeric",
|
|
@@ -3347,13 +3448,13 @@ function Xi(e) {
|
|
|
3347
3448
|
minute: "2-digit"
|
|
3348
3449
|
});
|
|
3349
3450
|
}
|
|
3350
|
-
function
|
|
3451
|
+
function sa(e) {
|
|
3351
3452
|
return new Date(e).toLocaleDateString(void 0, {
|
|
3352
3453
|
month: "short",
|
|
3353
3454
|
day: "numeric"
|
|
3354
3455
|
});
|
|
3355
3456
|
}
|
|
3356
|
-
function
|
|
3457
|
+
function ca(e) {
|
|
3357
3458
|
try {
|
|
3358
3459
|
return new Date(e).toLocaleString(void 0, {
|
|
3359
3460
|
year: "numeric",
|
|
@@ -3369,7 +3470,7 @@ function Qi(e) {
|
|
|
3369
3470
|
return String(e);
|
|
3370
3471
|
}
|
|
3371
3472
|
}
|
|
3372
|
-
function
|
|
3473
|
+
function la(e) {
|
|
3373
3474
|
if (!isFinite(e) || e === 0) return e.toFixed(2);
|
|
3374
3475
|
let t = Math.abs(e), n = 2;
|
|
3375
3476
|
return t < 1e-4 ? n = 8 : t < .01 ? n = 6 : t < 1 ? n = 4 : t < 100 && (n = 3), e.toLocaleString(void 0, {
|
|
@@ -3377,13 +3478,13 @@ function $i(e) {
|
|
|
3377
3478
|
maximumFractionDigits: n
|
|
3378
3479
|
});
|
|
3379
3480
|
}
|
|
3380
|
-
function
|
|
3481
|
+
function ua(e, t = 2) {
|
|
3381
3482
|
return `${e >= 0 ? "+" : ""}${e.toFixed(t)}%`;
|
|
3382
3483
|
}
|
|
3383
|
-
function
|
|
3484
|
+
function da(e) {
|
|
3384
3485
|
return `${e < 0 ? "-" : "+"}$${Math.abs(e).toFixed(2)}`;
|
|
3385
3486
|
}
|
|
3386
|
-
function
|
|
3487
|
+
function fa(e) {
|
|
3387
3488
|
if (e == null || e === "") return $;
|
|
3388
3489
|
let t = new Date(e);
|
|
3389
3490
|
return isNaN(t.getTime()) ? String(e) : t.toLocaleDateString("en-US", {
|
|
@@ -3392,7 +3493,7 @@ function na(e) {
|
|
|
3392
3493
|
day: "numeric"
|
|
3393
3494
|
});
|
|
3394
3495
|
}
|
|
3395
|
-
function
|
|
3496
|
+
function pa(e) {
|
|
3396
3497
|
if (e == null || e === "") return $;
|
|
3397
3498
|
let t = new Date(e);
|
|
3398
3499
|
return isNaN(t.getTime()) ? String(e) : t.toLocaleDateString("en-US", {
|
|
@@ -3403,22 +3504,22 @@ function ra(e) {
|
|
|
3403
3504
|
minute: "2-digit"
|
|
3404
3505
|
});
|
|
3405
3506
|
}
|
|
3406
|
-
function
|
|
3507
|
+
function ma(e) {
|
|
3407
3508
|
if (typeof e != "number" || !isFinite(e) || e <= 0) return "";
|
|
3408
3509
|
let t = e / 1e3, n = t < 1 ? 3 : 2;
|
|
3409
3510
|
return `= ${t.toFixed(n)} s`;
|
|
3410
3511
|
}
|
|
3411
|
-
function
|
|
3512
|
+
function ha(e) {
|
|
3412
3513
|
return e ? e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB` : "";
|
|
3413
3514
|
}
|
|
3414
|
-
function
|
|
3515
|
+
function ga(e) {
|
|
3415
3516
|
try {
|
|
3416
3517
|
return JSON.stringify(JSON.parse(e), null, 2);
|
|
3417
3518
|
} catch {
|
|
3418
3519
|
return e;
|
|
3419
3520
|
}
|
|
3420
3521
|
}
|
|
3421
|
-
function
|
|
3522
|
+
function _a(e) {
|
|
3422
3523
|
if (e == null) return "";
|
|
3423
3524
|
if (typeof e == "string") return e;
|
|
3424
3525
|
try {
|
|
@@ -3427,14 +3528,14 @@ function sa(e) {
|
|
|
3427
3528
|
return String(e);
|
|
3428
3529
|
}
|
|
3429
3530
|
}
|
|
3430
|
-
function
|
|
3531
|
+
function va(e, t = 2) {
|
|
3431
3532
|
if (e == null || !isFinite(e)) return $;
|
|
3432
3533
|
let n = Math.floor(Math.max(0, e) / 6e4), r = Math.floor(n / 1440), i = Math.floor(n % 1440 / 60), a = n % 60, o = [];
|
|
3433
3534
|
return r > 0 && o.push(`${r}d`), (r > 0 || i > 0) && o.push(`${i}h`), o.push(`${a}m`), o.slice(0, t).join(" ");
|
|
3434
3535
|
}
|
|
3435
3536
|
//#endregion
|
|
3436
3537
|
//#region src/utils/validate.ts
|
|
3437
|
-
function
|
|
3538
|
+
function ya(e) {
|
|
3438
3539
|
let t = (e ?? "").trim();
|
|
3439
3540
|
if (!t) return !1;
|
|
3440
3541
|
try {
|
|
@@ -3444,7 +3545,7 @@ function la(e) {
|
|
|
3444
3545
|
return !1;
|
|
3445
3546
|
}
|
|
3446
3547
|
}
|
|
3447
|
-
function
|
|
3548
|
+
function ba(e) {
|
|
3448
3549
|
if (!e.trim()) return !0;
|
|
3449
3550
|
try {
|
|
3450
3551
|
return JSON.parse(e), !0;
|
|
@@ -3452,7 +3553,7 @@ function ua(e) {
|
|
|
3452
3553
|
return !1;
|
|
3453
3554
|
}
|
|
3454
3555
|
}
|
|
3455
|
-
function
|
|
3556
|
+
function xa(e) {
|
|
3456
3557
|
if (!e.trim()) return !0;
|
|
3457
3558
|
try {
|
|
3458
3559
|
return !new DOMParser().parseFromString(e, "application/xml").getElementsByTagName("parsererror").length;
|
|
@@ -3460,7 +3561,7 @@ function da(e) {
|
|
|
3460
3561
|
return !1;
|
|
3461
3562
|
}
|
|
3462
3563
|
}
|
|
3463
|
-
function
|
|
3564
|
+
function Sa(e) {
|
|
3464
3565
|
if (!e.trim()) return !0;
|
|
3465
3566
|
let t = e.replace(/\s+/g, "");
|
|
3466
3567
|
if (!t) return !0;
|
|
@@ -3473,7 +3574,7 @@ function fa(e) {
|
|
|
3473
3574
|
}
|
|
3474
3575
|
//#endregion
|
|
3475
3576
|
//#region src/utils/specForm.ts
|
|
3476
|
-
function
|
|
3577
|
+
function Ca(e, t) {
|
|
3477
3578
|
let n = {};
|
|
3478
3579
|
if (!e) return n;
|
|
3479
3580
|
for (let r of e) {
|
|
@@ -3482,7 +3583,7 @@ function pa(e, t) {
|
|
|
3482
3583
|
}
|
|
3483
3584
|
return n;
|
|
3484
3585
|
}
|
|
3485
|
-
function
|
|
3586
|
+
function wa(e, t) {
|
|
3486
3587
|
if (!e) return null;
|
|
3487
3588
|
for (let n of e) if (n.type === "decimal" || n.type === "integer") {
|
|
3488
3589
|
let e = t[n.key], r = e === "" || e == null;
|
|
@@ -3493,7 +3594,7 @@ function ma(e, t) {
|
|
|
3493
3594
|
}
|
|
3494
3595
|
//#endregion
|
|
3495
3596
|
//#region src/utils/pnl.ts
|
|
3496
|
-
function
|
|
3597
|
+
function Ta(e) {
|
|
3497
3598
|
if (e.buyPrice == null || e.lastPrice == null || e.filledQty == null) return {
|
|
3498
3599
|
pnlUsd: null,
|
|
3499
3600
|
pnlPct: null
|
|
@@ -3508,4 +3609,4 @@ function ha(e) {
|
|
|
3508
3609
|
};
|
|
3509
3610
|
}
|
|
3510
3611
|
//#endregion
|
|
3511
|
-
export { R as AlertEnum, Jn as BaseActionButton, je as BaseAlert, Rn as BaseAppLayout, Ne as BaseBadge,
|
|
3612
|
+
export { R as AlertEnum, Jn as BaseActionButton, je as BaseAlert, Rn as BaseAppLayout, Ne as BaseBadge, zi as BaseBadgeEnum, Le as BaseBreadcrumb, G as BaseButton, U as BaseButtonEnum, W as BaseButtonSizeEnum, xr as BaseChipButton, kr as BaseCodeBlock, Wt as BaseCollapsibleSection, Jt as BaseConfirmModal, Xn as BaseCopyButton, Ci as BaseCredentialsForm, Lr as BaseDropdown, Fn as BaseEntityPickerModal, Or as BaseFileDropzone, oi as BaseFilterChip, er as BaseGoogleSignInButton, Q as BaseInput, Xe as BaseLine, Ze as BaseLoginEnum, fr as BaseLoginForm, $e as BaseLogo, K as BaseLogoEnum, ot as BaseModal, et as BaseModalEnum, Vt as BaseModalShell, tn as BaseNotFoundPage, yr as BaseNotificationPanel, Hn as BasePageHeader, Ni as BasePillPickerModal, Sr as BaseRemoveButton, st as BaseRow, Vr as BaseSegmentedControl, Mr as BaseSelect, Sn as BaseSidebar, ti as BaseSpecFields, ct as BaseSpinner, ii as BaseStatBreakdown, Tr as BaseStatusPill, qr as BaseTable, Qt as BaseTextInputModal, dt as BaseToast, q as BaseToastEnum, Gn as BaseToolbarButton, pt as ColoredSquares, H as ColorsEnums, gt as EarningsCard, xt as EuroAmount, Ke as LineEnum, Et as Pagination, J as PositioningEnum, jt as TrendArrow, Ca as buildSpecParams, Ta as computePnL, wa as firstInvalidNumericSpec, ha as fmtBytes, fa as fmtCalendarDate, pa as fmtCalendarDateTime, aa as fmtDate, sa as fmtDateShort, oa as fmtDateTime, ca as fmtDateTimeMs, va as fmtDuration, ma as fmtMsAsSeconds, ia as fmtNumber, ua as fmtPct, la as fmtPrice, da as fmtUsd, ga as formatJson, Bi as getBaseColor, Vi as getBaseColorOf, Oe as initTheme, ta as isSafeHref, ya as isValidAbsoluteUrl, Sa as isValidBase64, ba as isValidJson, xa as isValidXml, Gi as methodBadgeBright, Wi as methodBadgeSolid, qi as methodBadgeTinted, Zi as rowKeyMissing, Xi as rowValueMissing, ra as sanitizeHtml, Ji as statusBadgeSoft, Ki as statusBadgeSolid, Yi as statusBadgeTinted, _a as stringifyValue, Pi as useDebouncedRef, Mt as useEscapeKey, Li as useFieldClasses, rn as useMobileSidebar, dn as useNotifications, Ri as usePolling, Ii as useQueryParamSync, cn as useSidebarCollapse, V as useTheme, Y as useThemeClasses, Fi as useToast };
|