@v1nt1248/3nclient-lib 0.4.1 → 0.4.2
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/chunks/{plugins-keys-CjKqZeyH.js → plugins-keys-DY2USp8H.js} +550 -536
- package/dist/chunks/{ui3n-tooltip-BbbM2459.js → ui3n-tooltip-6Z-sRX7U.js} +1 -1
- package/dist/src/utils/ui/has-slot-content.d.ts +8 -2
- package/dist/src/utils/ui/mark-search.d.ts +8 -0
- package/dist/ui3n-components.js +2 -2
- package/dist/ui3n-plugins.js +3 -3
- package/dist/ui3n-utils.js +1 -1
- package/package.json +1 -1
- package/src/components/ui3n-autocomplete/ui3n-autocomplete.vue +24 -8
- package/src/components/ui3n-breadcrumbs/ui3n-breadcrumb.vue +3 -1
- package/src/components/ui3n-editable/useContentEditable.ts +5 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as e, x as t } from "./plugins-keys-
|
|
1
|
+
import { D as e, x as t } from "./plugins-keys-DY2USp8H.js";
|
|
2
2
|
import { Fragment as n, Teleport as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createVNode as l, defineComponent as u, mergeProps as d, normalizeClass as f, normalizeStyle as p, onBeforeUnmount as m, onMounted as h, openBlock as g, ref as _, renderSlot as v, toDisplayString as y, unref as b, useCssModule as x, useSlots as S, watch as C, withDirectives as w, withKeys as T } from "vue";
|
|
3
3
|
import { arrow as E, autoUpdate as D, offset as O, useFloating as k } from "@floating-ui/vue";
|
|
4
4
|
//#region src/directives/ui3n-ripple.ts
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { VNode } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* A slot is typed as returning a single VNode (e.g. via defineSlots) or an
|
|
4
|
+
* array of them (Vue's own Slot type); both shapes are accepted here.
|
|
5
|
+
*/
|
|
6
|
+
type ContentSlot = (...args: unknown[]) => VNode | VNode[];
|
|
7
|
+
export declare function hasSlotContent(slot?: ContentSlot, slotProps?: Record<string, unknown>): boolean;
|
|
8
|
+
export {};
|
|
@@ -1 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {string} str - source text
|
|
3
|
+
* @param {string} search - user query; its whitespace-separated words are highlighted
|
|
4
|
+
* @return {string} - safe HTML: every match is wrapped in `span.match-search`, the rest is escaped
|
|
5
|
+
*
|
|
6
|
+
* The query is treated literally (regex metacharacters are escaped) and the source is
|
|
7
|
+
* HTML-escaped, because the result is rendered through raw `innerHTML` by v-ui3n-html.
|
|
8
|
+
*/
|
|
1
9
|
export declare function markSearch(str: string, search: string): string;
|
package/dist/ui3n-components.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as e, H as t, O as n, U as r, V as i, W as a, _t as o, at as s, b as c, c as l, ct as u, dt as d, et as f, ft as p, gt as m, ht as h, it as g, lt as _, mt as v, nt as y, ot as b, pt as x, rt as S, st as C, t as w, tt as T, ut as E, vt as D, x as O } from "./chunks/plugins-keys-
|
|
2
|
-
import { a as k, i as A, n as ee, o as j, r as M, t as te } from "./chunks/ui3n-tooltip-
|
|
1
|
+
import { $ as e, H as t, O as n, U as r, V as i, W as a, _t as o, at as s, b as c, c as l, ct as u, dt as d, et as f, ft as p, gt as m, ht as h, it as g, lt as _, mt as v, nt as y, ot as b, pt as x, rt as S, st as C, t as w, tt as T, ut as E, vt as D, x as O } from "./chunks/plugins-keys-DY2USp8H.js";
|
|
2
|
+
import { a as k, i as A, n as ee, o as j, r as M, t as te } from "./chunks/ui3n-tooltip-6Z-sRX7U.js";
|
|
3
3
|
import { t as ne } from "./chunks/emoticons-DMgiBINj.js";
|
|
4
4
|
import re from "sanitize-html";
|
|
5
5
|
import { autoUpdate as ie, computePosition as ae, offset as oe } from "@floating-ui/dom";
|
package/dist/ui3n-plugins.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { U as e, a as t, i as n, n as r, r as i, t as a } from "./chunks/plugins-keys-
|
|
2
|
-
import { a as o, n as s, t as c } from "./chunks/ui3n-tooltip-
|
|
1
|
+
import { U as e, a as t, i as n, n as r, r as i, t as a } from "./chunks/plugins-keys-DY2USp8H.js";
|
|
2
|
+
import { a as o, n as s, t as c } from "./chunks/ui3n-tooltip-6Z-sRX7U.js";
|
|
3
3
|
import { Fragment as l, createApp as u, createBlock as d, createElementBlock as f, defineComponent as p, markRaw as m, mergeProps as h, normalizeClass as g, openBlock as _, ref as v, renderList as y } from "vue";
|
|
4
4
|
import "pinia";
|
|
5
5
|
import b from "mitt";
|
|
@@ -50,7 +50,7 @@ var x = /* @__PURE__ */ o(/* @__PURE__ */ p({
|
|
|
50
50
|
},
|
|
51
51
|
off: C.off.bind(C),
|
|
52
52
|
emit: C.emit.bind(C),
|
|
53
|
-
clear: C.all.clear.bind(C)
|
|
53
|
+
clear: C.all.clear.bind(C.all)
|
|
54
54
|
}, T = { install: (e) => {
|
|
55
55
|
e.config.globalProperties.$emitter = w, e.provide(t, { $emitter: w });
|
|
56
56
|
} }, E = { install(t) {
|
package/dist/ui3n-utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as e, B as t, C as n, D as r, E as i, F as a, G as o, H as s, I as c, J as l, K as u, L as d, M as f, N as p, O as m, P as h, Q as g, R as _, S as v, T as y, U as b, W as x, X as S, Y as C, Z as w, _ as T, a as E, b as D, c as O, d as k, f as A, g as j, h as M, i as N, j as P, k as F, l as I, m as L, n as R, o as z, p as B, q as V, r as H, s as U, t as W, u as G, v as K, w as q, x as J, y as Y, z as X } from "./chunks/plugins-keys-
|
|
1
|
+
import { A as e, B as t, C as n, D as r, E as i, F as a, G as o, H as s, I as c, J as l, K as u, L as d, M as f, N as p, O as m, P as h, Q as g, R as _, S as v, T as y, U as b, W as x, X as S, Y as C, Z as w, _ as T, a as E, b as D, c as O, d as k, f as A, g as j, h as M, i as N, j as P, k as F, l as I, m as L, n as R, o as z, p as B, q as V, r as H, s as U, t as W, u as G, v as K, w as q, x as J, y as Y, z as X } from "./chunks/plugins-keys-DY2USp8H.js";
|
|
2
2
|
import { t as Z } from "./chunks/emoticons-DMgiBINj.js";
|
|
3
3
|
//#region src/constants/general.ts
|
|
4
4
|
var Q = /[^@]+@[^@]+\.[^@]+/iu;
|
package/package.json
CHANGED
|
@@ -48,7 +48,9 @@
|
|
|
48
48
|
);
|
|
49
49
|
|
|
50
50
|
const displayValue = computed(() => {
|
|
51
|
-
if (props.chips)
|
|
51
|
+
if (props.chips) {
|
|
52
|
+
return '';
|
|
53
|
+
}
|
|
52
54
|
|
|
53
55
|
if (props.returnObject) {
|
|
54
56
|
return (props.modelValue as T[]).map(v => v[props.itemTitle] || '?').join(', ');
|
|
@@ -62,7 +64,9 @@
|
|
|
62
64
|
return props.items
|
|
63
65
|
.filter(item => props.customFilter!(item, query.value))
|
|
64
66
|
.filter(item => {
|
|
65
|
-
if (!props.hideSelected)
|
|
67
|
+
if (!props.hideSelected) {
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
66
70
|
|
|
67
71
|
return props.returnObject
|
|
68
72
|
? !(ids.value as string[]).includes(item.id as string)
|
|
@@ -73,7 +77,9 @@
|
|
|
73
77
|
return props.items
|
|
74
78
|
.filter(item => (item[props.itemTitle] as string).toLowerCase().includes(query.value.toLowerCase()))
|
|
75
79
|
.filter(item => {
|
|
76
|
-
if (!props.hideSelected)
|
|
80
|
+
if (!props.hideSelected) {
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
77
83
|
|
|
78
84
|
return props.returnObject
|
|
79
85
|
? !(ids.value as string[]).includes(item.id as string)
|
|
@@ -130,14 +136,20 @@
|
|
|
130
136
|
}
|
|
131
137
|
|
|
132
138
|
function tryAddNewValue(): boolean {
|
|
133
|
-
if (!props.addNewValue || props.disabled)
|
|
139
|
+
if (!props.addNewValue || props.disabled) {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
134
142
|
|
|
135
143
|
const text = query.value.trim();
|
|
136
|
-
if (!text)
|
|
144
|
+
if (!text) {
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
137
147
|
|
|
138
148
|
isNewValueValid.value = !props.newValueValidator ? true : props.newValueValidator(text);
|
|
139
149
|
emits('valid:new-value', isNewValueValid.value);
|
|
140
|
-
if (!isNewValueValid.value)
|
|
150
|
+
if (!isNewValueValid.value) {
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
141
153
|
|
|
142
154
|
const item = {
|
|
143
155
|
id: getRandomId(6),
|
|
@@ -173,7 +185,9 @@
|
|
|
173
185
|
}
|
|
174
186
|
|
|
175
187
|
function onItemClick(item: T) {
|
|
176
|
-
if (props.disabled || isItemDisabled(item))
|
|
188
|
+
if (props.disabled || isItemDisabled(item)) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
177
191
|
|
|
178
192
|
if (!props.multiple) {
|
|
179
193
|
const newValue = props.returnObject ? [item] : [item[props.itemValue]];
|
|
@@ -198,7 +212,9 @@
|
|
|
198
212
|
}
|
|
199
213
|
|
|
200
214
|
function onChipClose(item: T | T[keyof T]) {
|
|
201
|
-
if (props.disabled)
|
|
215
|
+
if (props.disabled) {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
202
218
|
|
|
203
219
|
const index = props.returnObject
|
|
204
220
|
? (props.modelValue as T[]).findIndex(v => v.id === (item as T).id)
|
|
@@ -18,7 +18,9 @@
|
|
|
18
18
|
const parentContext = inject<any>('ui3n-breadcrumbs-context', null);
|
|
19
19
|
|
|
20
20
|
const separatorValue = computed(() => {
|
|
21
|
-
if (props.separator)
|
|
21
|
+
if (props.separator) {
|
|
22
|
+
return props.separator;
|
|
23
|
+
}
|
|
22
24
|
return parentContext ? parentContext.separator() : '/';
|
|
23
25
|
});
|
|
24
26
|
|
|
@@ -24,8 +24,12 @@ export function useContentEditable(props: Ui3nContentEditableProps, emits: Ui3nC
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
function setHtmlFromValue(value: string): void {
|
|
27
|
+
if (!el.value) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
27
31
|
const sanitizedValue = value ? sanitizeHtml(value) : value;
|
|
28
|
-
el.value
|
|
32
|
+
el.value.innerText = convertValueToHtml(sanitizedValue);
|
|
29
33
|
}
|
|
30
34
|
|
|
31
35
|
function getContent(ev: Event): Nullable<string> {
|