@v1nt1248/3nclient-lib 0.3.51 → 0.4.1

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.
Files changed (68) hide show
  1. package/README.md +4 -0
  2. package/dist/chunks/{plugins-keys-DdadrIAg.js → plugins-keys-CjKqZeyH.js} +2 -2
  3. package/dist/chunks/ui3n-tooltip-BbbM2459.js +409 -0
  4. package/dist/src/components/ui3n-chip/ui3n-chip.d.ts +0 -5
  5. package/dist/src/components/ui3n-icon/ui3n-icon.d.ts +0 -1
  6. package/dist/src/components/ui3n-progress/ui3n-progress-circular.d.ts +0 -2
  7. package/dist/src/components/ui3n-progress/ui3n-progress-linear.d.ts +0 -2
  8. package/dist/src/components/ui3n-scrollbar-horizontal/ui3n-scrollbar-horizontal.d.ts +0 -7
  9. package/dist/src/components/ui3n-scrollbar-vertical/ui3n-scrollbar-vertical.d.ts +0 -7
  10. package/dist/src/components/ui3n-slider/ui3n-slider.d.ts +0 -5
  11. package/dist/src/components/ui3n-tabs/ui3n-tabs.d.ts +0 -4
  12. package/dist/src/components/ui3n-tooltip/types.d.ts +8 -2
  13. package/dist/src/components/ui3n-tooltip/ui3n-tooltip-container.d.ts +16 -0
  14. package/dist/src/components/ui3n-tooltip/ui3n-tooltip.d.ts +1 -5
  15. package/dist/src/constants/plugins-keys.d.ts +2 -0
  16. package/dist/src/index.d.ts +3 -0
  17. package/dist/src/plugins/index.d.ts +4 -1
  18. package/dist/src/plugins/tooltips/store-tooltips.d.ts +4 -0
  19. package/dist/src/plugins/tooltips/tooltips.d.ts +8 -0
  20. package/dist/src/plugins/tooltips/types.d.ts +34 -0
  21. package/dist/src/ui3n-plugins.d.ts +5 -3
  22. package/dist/style.css +1 -1
  23. package/dist/ui3n-components.js +1011 -1183
  24. package/dist/ui3n-plugins.js +169 -50
  25. package/dist/ui3n-utils.js +4 -4
  26. package/package.json +11 -4
  27. package/src/components/ui3n-autocomplete/ui3n-autocomplete.vue +28 -25
  28. package/src/components/ui3n-badge/ui3n-badge-simple.vue +18 -17
  29. package/src/components/ui3n-badge/ui3n-badge.vue +3 -2
  30. package/src/components/ui3n-breadcrumbs/ui3n-breadcrumb.vue +11 -10
  31. package/src/components/ui3n-breadcrumbs/ui3n-breadcrumbs.vue +4 -1
  32. package/src/components/ui3n-button/ui3n-button.vue +244 -158
  33. package/src/components/ui3n-checkbox/ui3n-checkbox.vue +22 -21
  34. package/src/components/ui3n-chip/ui3n-chip.vue +56 -40
  35. package/src/components/ui3n-dialog/ui3n-dialog-provider.vue +1 -0
  36. package/src/components/ui3n-dialog/ui3n-dialog.vue +19 -18
  37. package/src/components/ui3n-drop-files/ui3n-drop-files.vue +8 -7
  38. package/src/components/ui3n-editable/ui3n-content-editable.vue +11 -10
  39. package/src/components/ui3n-editable/ui3n-editable.vue +26 -25
  40. package/src/components/ui3n-emoji/ui3n-emoji.vue +7 -6
  41. package/src/components/ui3n-icon/ui3n-icon.vue +26 -16
  42. package/src/components/ui3n-input/ui3n-input.vue +36 -32
  43. package/src/components/ui3n-input-file/ui3n-input-file.vue +8 -5
  44. package/src/components/ui3n-list/ui3n-list.vue +8 -7
  45. package/src/components/ui3n-menu/ui3n-menu.vue +6 -5
  46. package/src/components/ui3n-mobile-menu/ui3n-mobile-menu.vue +4 -3
  47. package/src/components/ui3n-mobile-menu-item/ui3n-mobile-menu-item.vue +7 -6
  48. package/src/components/ui3n-notification/ui3n-notification-container.vue +1 -0
  49. package/src/components/ui3n-notification/ui3n-notification.vue +28 -26
  50. package/src/components/ui3n-progress/ui3n-progress-circular.vue +32 -19
  51. package/src/components/ui3n-progress/ui3n-progress-linear.vue +31 -18
  52. package/src/components/ui3n-radio-group/ui3n-radio-group.vue +4 -1
  53. package/src/components/ui3n-radio-group/ui3n-radio.vue +6 -5
  54. package/src/components/ui3n-scrollbar/ui3n-scrollbar.vue +94 -83
  55. package/src/components/ui3n-scrollbar-horizontal/ui3n-scrollbar-horizontal.vue +51 -39
  56. package/src/components/ui3n-scrollbar-vertical/ui3n-scrollbar-vertical.vue +51 -39
  57. package/src/components/ui3n-selector/ui3n-selector.vue +33 -28
  58. package/src/components/ui3n-slider/ui3n-slider.vue +53 -34
  59. package/src/components/ui3n-step-line-bar/ui3n-step-line-bar.vue +10 -6
  60. package/src/components/ui3n-switch/ui3n-switch.vue +23 -22
  61. package/src/components/ui3n-table/ui3n-table.vue +50 -48
  62. package/src/components/ui3n-tabs/ui3n-tabs.vue +38 -20
  63. package/src/components/ui3n-text/ui3n-text.vue +15 -14
  64. package/src/components/ui3n-tooltip/types.ts +8 -2
  65. package/src/components/ui3n-tooltip/ui3n-tooltip-container.vue +79 -0
  66. package/src/components/ui3n-tooltip/ui3n-tooltip.vue +140 -79
  67. package/dist/chunks/ui3n-notification-o0tuhTpO.js +0 -272
  68. package/src/components/ui3n-tooltip/ui3n-tooltip-old.vue +0 -198
@@ -1,12 +1,12 @@
1
- import { H as e, i as t, n, r, t as i } from "./chunks/plugins-keys-DdadrIAg.js";
2
- import { i as a, t as o } from "./chunks/ui3n-notification-o0tuhTpO.js";
3
- import { Fragment as s, createApp as c, createBlock as l, createElementBlock as u, defineComponent as d, markRaw as f, mergeProps as p, normalizeClass as m, openBlock as h, ref as g, renderList as _ } from "vue";
1
+ import { U as e, a as t, i as n, n as r, r as i, t as a } from "./chunks/plugins-keys-CjKqZeyH.js";
2
+ import { a as o, n as s, t as c } from "./chunks/ui3n-tooltip-BbbM2459.js";
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
- import v from "mitt";
6
- var y = /* @__PURE__ */ a(/* @__PURE__ */ d({
5
+ import b from "mitt";
6
+ var x = /* @__PURE__ */ o(/* @__PURE__ */ p({
7
7
  __name: "ui3n-notification-container",
8
8
  setup(e, { expose: t }) {
9
- let n = g([]);
9
+ let n = v([]);
10
10
  function r(e) {
11
11
  n.value.push(e);
12
12
  }
@@ -19,18 +19,19 @@ var y = /* @__PURE__ */ a(/* @__PURE__ */ d({
19
19
  return t({
20
20
  add: r,
21
21
  remove: i
22
- }), (e, t) => (h(), u("div", {
22
+ }), (e, t) => (_(), f("div", {
23
23
  id: "ui3n-notifications-container",
24
- class: m(e.$style.ui3nNotificationsWrapper)
25
- }, [(h(!0), u(s, null, _(n.value, (e) => (h(), l(o, p({ key: e.id }, { ref_for: !0 }, e, { "on-close": () => a(e) }), null, 16, ["on-close"]))), 128))], 2));
24
+ "data-ui3n": "notification-container",
25
+ class: g(e.$style.ui3nNotificationsWrapper)
26
+ }, [(_(!0), f(l, null, y(n.value, (e) => (_(), d(s, h({ key: e.id }, { ref_for: !0 }, e, { "on-close": () => a(e) }), null, 16, ["on-close"]))), 128))], 2));
26
27
  }
27
- }), [["__cssModules", { $style: { ui3nNotificationsWrapper: "_ui3nNotificationsWrapper_n58wk_1" } }]]), b = { install: (t) => {
28
+ }), [["__cssModules", { $style: { ui3nNotificationsWrapper: "_ui3nNotificationsWrapper_n58wk_1" } }]]), S = { install: (t) => {
28
29
  if (typeof window > "u") return;
29
- let r = document.createElement("div");
30
- document.body.appendChild(r);
31
- let i = c(y);
30
+ let n = document.createElement("div");
31
+ document.body.appendChild(n);
32
+ let i = u(x);
32
33
  i._context.provides = t._context.provides;
33
- let a = i.mount(r), o = (t) => {
34
+ let a = i.mount(n), o = (t) => {
34
35
  let n = t.id || e(6), r = t.duration === void 0 ? 1500 : t.duration;
35
36
  a.add({
36
37
  ...t,
@@ -38,33 +39,33 @@ var y = /* @__PURE__ */ a(/* @__PURE__ */ d({
38
39
  duration: r
39
40
  });
40
41
  };
41
- t.config.globalProperties.$createNotice = o, t.provide(n, { $createNotice: o });
42
- } }, x = v(), S = {
43
- on: x.on.bind(x),
42
+ t.config.globalProperties.$createNotice = o, t.provide(r, { $createNotice: o });
43
+ } }, C = b(), w = {
44
+ on: C.on.bind(C),
44
45
  once: (e, t) => {
45
46
  function n() {
46
- x.off(e, n), t.apply(null, arguments);
47
+ C.off(e, n), t.apply(null, arguments);
47
48
  }
48
- x.on(e, n);
49
+ C.on(e, n);
49
50
  },
50
- off: x.off.bind(x),
51
- emit: x.emit.bind(x),
52
- clear: x.all.clear.bind(x)
53
- }, C = { install: (e) => {
54
- e.config.globalProperties.$emitter = S, e.provide(t, { $emitter: S });
55
- } }, w = { install(t) {
56
- let n = g([]);
51
+ off: C.off.bind(C),
52
+ emit: C.emit.bind(C),
53
+ clear: C.all.clear.bind(C)
54
+ }, T = { install: (e) => {
55
+ e.config.globalProperties.$emitter = w, e.provide(t, { $emitter: w });
56
+ } }, E = { install(t) {
57
+ let n = v([]);
57
58
  function r(t, r) {
58
59
  return new Promise((i) => {
59
60
  n.value.push({
60
61
  id: e(5),
61
- component: f(t),
62
+ component: m(t),
62
63
  props: r,
63
64
  resolve: i
64
65
  });
65
66
  });
66
67
  }
67
- function a(e, t) {
68
+ function i(e, t) {
68
69
  let r = n.value.findIndex((t) => t.id === e);
69
70
  r !== -1 && (n.value[r].resolve(t), n.value.splice(r, 1));
70
71
  }
@@ -74,30 +75,30 @@ var y = /* @__PURE__ */ a(/* @__PURE__ */ d({
74
75
  t.config.globalProperties.$dialog = {
75
76
  dialogStack: n,
76
77
  $openDialog: r,
77
- $closeDialog: a,
78
+ $closeDialog: i,
78
79
  $closeDialogs: o
79
- }, t.provide(i, {
80
+ }, t.provide(a, {
80
81
  dialogStack: n,
81
82
  $openDialog: r,
82
- $closeDialog: a,
83
+ $closeDialog: i,
83
84
  $closeDialogs: o
84
85
  });
85
86
  } };
86
87
  //#endregion
87
88
  //#region src/plugins/notifications/store-notifications.ts
88
- function T(e) {
89
+ function D(e) {
89
90
  let { app: t = {} } = e, { config: n = {} } = t, { globalProperties: r = {} } = n, { $createNotice: i } = r;
90
91
  return { $createNotice: i };
91
92
  }
92
93
  //#endregion
93
94
  //#region src/plugins/vue-bus/store-vue-bus.ts
94
- function E(e) {
95
+ function O(e) {
95
96
  let { app: t = {} } = e, { config: n = {} } = t, { globalProperties: r = {} } = n, { $emitter: i } = r;
96
97
  return { $emitter: i };
97
98
  }
98
99
  //#endregion
99
100
  //#region src/plugins/dialogs/store-dialog.ts
100
- function D(e) {
101
+ function k(e) {
101
102
  let { app: t = {} } = e, { config: n = {} } = t, { globalProperties: r = {} } = n, { $dialog: i } = r;
102
103
  return { $dialogs: {
103
104
  open: i.$openDialog,
@@ -108,38 +109,38 @@ function D(e) {
108
109
  }
109
110
  //#endregion
110
111
  //#region src/plugins/theme/theme.ts
111
- var O = [
112
+ var A = [
112
113
  "light",
113
114
  "dark",
114
115
  "midnight"
115
- ], k = [
116
+ ], j = [
116
117
  "light-theme",
117
118
  "dark-theme",
118
119
  "midnight-theme"
119
120
  ];
120
- function A(e) {
121
- return typeof e == "string" && O.includes(e);
121
+ function M(e) {
122
+ return typeof e == "string" && A.includes(e);
122
123
  }
123
- function j(e, t) {
124
+ function N(e, t) {
124
125
  e.classList.add("colors");
125
- for (let t of k) e.classList.remove(t);
126
+ for (let t of j) e.classList.remove(t);
126
127
  e.classList.add(`${t}-theme`);
127
128
  }
128
- function M(e) {
129
+ function P(e) {
129
130
  if (e.persist) {
130
131
  let t = e.storageKey ?? "ui3n-theme";
131
132
  try {
132
133
  let e = localStorage.getItem(t);
133
- if (A(e)) return e;
134
+ if (M(e)) return e;
134
135
  } catch {}
135
136
  }
136
- return A(e.theme) ? e.theme : "light";
137
+ return M(e.theme) ? e.theme : "light";
137
138
  }
138
- var N = { install(e, t = {}) {
139
- let n = t.persist ?? !1, i = t.storageKey ?? "ui3n-theme", a = g(typeof document > "u" ? t.theme ?? "light" : M(t));
139
+ var F = { install(e, t = {}) {
140
+ let n = t.persist ?? !1, r = t.storageKey ?? "ui3n-theme", a = v(typeof document > "u" ? t.theme ?? "light" : P(t));
140
141
  function o(e) {
141
- if (A(e) && (a.value = e, !(typeof document > "u") && (j(t.target ?? document.documentElement, e), n))) try {
142
- localStorage.setItem(i, e);
142
+ if (M(e) && (a.value = e, !(typeof document > "u") && (N(t.target ?? document.documentElement, e), n))) try {
143
+ localStorage.setItem(r, e);
143
144
  } catch {}
144
145
  }
145
146
  typeof document < "u" && o(a.value);
@@ -147,13 +148,131 @@ var N = { install(e, t = {}) {
147
148
  theme: a,
148
149
  setTheme: o
149
150
  };
150
- e.provide(r, s), e.config.globalProperties.$theme = s;
151
+ e.provide(i, s), e.config.globalProperties.$theme = s;
151
152
  } };
152
153
  //#endregion
153
154
  //#region src/plugins/theme/store-theme.ts
154
- function P(e) {
155
+ function I(e) {
155
156
  let { app: t = {} } = e, { config: n = {} } = t, { globalProperties: r = {} } = n, { $theme: i } = r;
156
157
  return { $theme: i };
157
158
  }
159
+ var L = /* @__PURE__ */ o(/* @__PURE__ */ p({
160
+ __name: "ui3n-tooltip-container",
161
+ setup(e, { expose: t }) {
162
+ let n = v([]);
163
+ function r(e) {
164
+ n.value.push(e);
165
+ }
166
+ function i(e) {
167
+ n.value = n.value.filter((t) => t.id !== e);
168
+ }
169
+ function a(e) {
170
+ n.value = n.value.filter((t) => t.kind !== e);
171
+ }
172
+ function o(e) {
173
+ n.value = n.value.filter((t) => !(t.kind === "attach" && t.target === e));
174
+ }
175
+ function s(e, t) {
176
+ let r = n.value.find((t) => t.id === e);
177
+ r && Object.assign(r, t);
178
+ }
179
+ function u() {
180
+ n.value = [];
181
+ }
182
+ function p(e) {
183
+ return {
184
+ id: e.id,
185
+ content: e.content,
186
+ maxContentWidth: e.maxContentWidth,
187
+ color: e.color,
188
+ textColor: e.textColor,
189
+ placement: e.placement,
190
+ positionStrategy: e.positionStrategy ?? "fixed",
191
+ offsetX: e.offsetX,
192
+ offsetY: e.offsetY,
193
+ trigger: e.trigger,
194
+ modelValue: e.modelValue,
195
+ disabled: e.disabled,
196
+ triggerElement: e.target
197
+ };
198
+ }
199
+ return t({
200
+ add: r,
201
+ remove: i,
202
+ removeByKind: a,
203
+ removeByTarget: o,
204
+ update: s,
205
+ clearAll: u
206
+ }), (e, t) => (_(), f("div", {
207
+ id: "ui3n-tooltips-container",
208
+ "data-ui3n": "tooltip-container",
209
+ class: g(e.$style.container)
210
+ }, [(_(!0), f(l, null, y(n.value, (e) => (_(), d(c, h({ key: e.id }, { ref_for: !0 }, p(e)), null, 16))), 128))], 2));
211
+ }
212
+ }), [["__cssModules", { $style: { container: "_container_zxf3h_1" } }]]), R = { install: (t) => {
213
+ if (typeof window > "u") return;
214
+ let r = document.createElement("div");
215
+ document.body.appendChild(r);
216
+ let i = u(L);
217
+ i._context.provides = t._context.provides;
218
+ let a = i.mount(r);
219
+ function o(e, t) {
220
+ return {
221
+ id: e,
222
+ close: () => {
223
+ t === "show" ? l() : d(e);
224
+ },
225
+ update: (t) => a.update(e, t)
226
+ };
227
+ }
228
+ function s(t, n) {
229
+ a.removeByKind("show");
230
+ let r = e(6);
231
+ return a.add({
232
+ ...n,
233
+ id: r,
234
+ kind: "show",
235
+ target: m(t),
236
+ trigger: "manual",
237
+ modelValue: !0,
238
+ positionStrategy: n.positionStrategy ?? "fixed"
239
+ }), o(r, "show");
240
+ }
241
+ function c(t, n) {
242
+ t instanceof HTMLElement && a.removeByTarget(t);
243
+ let r = e(6);
244
+ return a.add({
245
+ ...n,
246
+ id: r,
247
+ kind: "attach",
248
+ target: m(t),
249
+ trigger: n.trigger ?? "hover",
250
+ positionStrategy: n.positionStrategy ?? "fixed"
251
+ }), o(r, "attach");
252
+ }
253
+ function l() {
254
+ a.removeByKind("show");
255
+ }
256
+ function d(e) {
257
+ typeof e == "string" ? a.remove(e) : a.removeByTarget(e);
258
+ }
259
+ function f() {
260
+ a.clearAll();
261
+ }
262
+ let p = {
263
+ show: s,
264
+ attach: c,
265
+ hide: l,
266
+ detach: d,
267
+ detachAll: f
268
+ };
269
+ t.config.globalProperties.$tooltip = p, t.provide(n, p);
270
+ } };
271
+ //#endregion
272
+ //#region src/plugins/tooltips/store-tooltips.ts
273
+ function z(e) {
274
+ let { app: t = {} } = e, { config: n = {} } = t, { globalProperties: r = {} } = n, { $tooltip: i } = r;
275
+ return { $tooltip: i };
276
+ }
158
277
  //#endregion
159
- export { i as DIALOGS_KEY, n as NOTIFICATIONS_KEY, r as THEME_KEY, t as VUEBUS_KEY, w as dialogs, b as notifications, D as storeDialogs, T as storeNotifications, P as storeTheme, E as storeVueBus, N as theme, C as vueBus };
278
+ export { a as DIALOGS_KEY, r as NOTIFICATIONS_KEY, i as THEME_KEY, n as TOOLTIPS_KEY, t as VUEBUS_KEY, E as dialogs, S as notifications, k as storeDialogs, D as storeNotifications, I as storeTheme, z as storeTooltips, O as storeVueBus, F as theme, R as tooltips, T as vueBus };
@@ -1,6 +1,6 @@
1
- import { A as e, C as t, D as n, E as r, F as i, G as a, H as o, I as s, J as c, K as l, L as u, M as d, N as f, O as p, P as m, R as h, S as g, T as _, U as v, V as y, W as b, X as x, Y as S, Z as C, _ as w, a as T, b as E, c as D, d as O, f as k, g as A, h as j, i as M, j as N, k as P, l as F, m as I, n as L, o as R, p as z, q as B, r as V, s as H, t as U, u as W, v as G, w as K, x as q, y as J, z as Y } from "./chunks/plugins-keys-DdadrIAg.js";
2
- import { t as X } from "./chunks/emoticons-DMgiBINj.js";
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-CjKqZeyH.js";
2
+ import { t as Z } from "./chunks/emoticons-DMgiBINj.js";
3
3
  //#region src/constants/general.ts
4
- var Z = /[^@]+@[^@]+\.[^@]+/iu;
4
+ var Q = /[^@]+@[^@]+\.[^@]+/iu;
5
5
  //#endregion
6
- export { U as DIALOGS_KEY, L as NOTIFICATIONS_KEY, l as NamedProcs, T as SQLiteOn3NStorage, B as SingleCyclicProc, c as SingleProc, V as THEME_KEY, b as TaskRunner, M as VUEBUS_KEY, z as b64ToBlob, k as blobFromDataURL, I as blobToB64, q as capitalize, m as copyToClipboard, D as createVideoThumbnail, N as debounce, C as defer, X as emoticons, f as executeFunc, F as fileToUint8Array, J as formatFileSize, _ as generateColor, i as getDeliveryErrors, Y as getFileExtension, o as getRandomId, r as hasSlotContent, t as html2text, K as invertColor, j as isFileArchive, A as isFileAudio, G as isFileImage, w as isFileVideo, Z as mailReg, S as makeSyncedFunc, n as markSearch, h as mimeTypes, y as patchTextareaMaxRowsSupport, g as prepareDateAsSting, d as removeWhitespaceInString, W as resizeImage, v as round, a as schedulerYield, p as selectAll, P as selectEnd, e as selectStart, x as sleep, E as toCssLength, s as transformFileToWeb3NFile, u as transformWeb3nFileToFile, R as tryOnScopeDispose, O as uint8ToDataURL, H as unrefElement };
6
+ export { W as DIALOGS_KEY, R as NOTIFICATIONS_KEY, V as NamedProcs, z as SQLiteOn3NStorage, l as SingleCyclicProc, C as SingleProc, H as THEME_KEY, N as TOOLTIPS_KEY, o as TaskRunner, E as VUEBUS_KEY, L as b64ToBlob, B as blobFromDataURL, M as blobToB64, v as capitalize, a as copyToClipboard, I as createVideoThumbnail, f as debounce, g as defer, Z as emoticons, h as executeFunc, G as fileToUint8Array, D as formatFileSize, i as generateColor, c as getDeliveryErrors, t as getFileExtension, b as getRandomId, r as hasSlotContent, q as html2text, y as invertColor, j as isFileArchive, T as isFileAudio, Y as isFileImage, K as isFileVideo, Q as mailReg, S as makeSyncedFunc, m as markSearch, X as mimeTypes, s as patchTextareaMaxRowsSupport, n as prepareDateAsSting, p as removeWhitespaceInString, k as resizeImage, x as round, u as schedulerYield, F as selectAll, e as selectEnd, P as selectStart, w as sleep, J as toCssLength, d as transformFileToWeb3NFile, _ as transformWeb3nFileToFile, U as tryOnScopeDispose, A as uint8ToDataURL, O as unrefElement };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@v1nt1248/3nclient-lib",
3
3
  "license": "AGPL-3.0-or-later",
4
4
  "author": "v1nt1248",
5
- "version": "0.3.51",
5
+ "version": "0.4.1",
6
6
  "description": "Library for 3NWeb clients",
7
7
  "type": "module",
8
8
  "files": [
@@ -34,13 +34,17 @@
34
34
  "build": "pnpm clean:dist && vite build",
35
35
  "pack": "pnpm build && npm pack && cp *.tgz ./dist && rm *.tgz",
36
36
  "preview": "vite preview",
37
+ "test": "vitest run",
38
+ "test:watch": "vitest",
37
39
  "stylelint": "stylelint --config .stylelint.config.cjs 'src/**/*.{vue,scss,css}'",
38
40
  "stylelint:fix": "stylelint --config .stylelint.config.cjs --fix 'src/**/*.{vue,scss,css}'",
39
- "lint": "pnpm linter && pnpm stylelint",
40
- "lint:fix": "pnpm linter:fix && pnpm stylelint:fix",
41
+ "lint": "pnpm eslint && pnpm stylelint",
42
+ "lint:fix": "pnpm eslint:fix && pnpm stylelint:fix",
41
43
  "docs:dev": "vitepress dev docs",
42
44
  "docs:build": "vitepress build docs",
43
- "docs:preview": "vitepress preview docs"
45
+ "docs:preview": "vitepress preview docs",
46
+ "eslint": "eslint src",
47
+ "eslint:fix": "eslint --fix src"
44
48
  },
45
49
  "dependencies": {
46
50
  "@floating-ui/dom": "1.7.6",
@@ -67,6 +71,7 @@
67
71
  "@vue/compiler-core": "3.5.35",
68
72
  "@vue/eslint-config-typescript": "14.7.0",
69
73
  "@vue/runtime-core": "3.5.35",
74
+ "@vue/test-utils": "2.5.0",
70
75
  "@vuedx/typescript-plugin-vue": "0.7.6",
71
76
  "eslint": "10.4.0",
72
77
  "eslint-config-prettier": "10.1.8",
@@ -77,6 +82,7 @@
77
82
  "eslint-plugin-vue": "10.9.1",
78
83
  "globals": "17.6.0",
79
84
  "jackspeak": "4.2.3",
85
+ "jsdom": "30.0.1",
80
86
  "path": "0.12.7",
81
87
  "pinia": "3.0.4",
82
88
  "postcss-html": "1.8.1",
@@ -98,6 +104,7 @@
98
104
  "vite-plugin-static-copy": "^4.1.1",
99
105
  "vite-plugin-vue-devtools": "8.1.2",
100
106
  "vitepress": "1.6.4",
107
+ "vitest": "4.1.11",
101
108
  "vue": "3.5.35",
102
109
  "vue-component-meta": "3.3.2",
103
110
  "vue-docgen-api": "4.79.2",
@@ -380,7 +380,10 @@
380
380
  </script>
381
381
 
382
382
  <template>
383
- <div :class="$style.ui3nAutocomplete">
383
+ <div
384
+ data-ui3n="autocomplete"
385
+ :class="$style.ui3nAutocomplete"
386
+ >
384
387
  <!-- 'hidden inputs' block for setting of 'name' attr when used in a form -->
385
388
  <fieldset
386
389
  v-if="name && !isEmpty(modelValue)"
@@ -545,17 +548,17 @@
545
548
 
546
549
  <style lang="scss" module>
547
550
  .ui3nAutocomplete {
548
- --ui3n-autocomplete-min-height: 32px;
549
- --ui3n-autocomplete-font-size: 12px;
550
- --ui3n-autocomplete-item-font-size: 13px;
551
- --ui3n-autocomplete-padding-inline: 8px;
552
- --ui3n-autocomplete-padding-block: 4px;
553
- --ui3n-autocomplete-border-radius: 4px;
551
+ --_autocomplete-min-height: var(--ui3n-autocomplete-min-height, 32px);
552
+ --_autocomplete-font-size: var(--ui3n-autocomplete-font-size, 12px);
553
+ --_autocomplete-item-font-size: var(--ui3n-autocomplete-item-font-size, 13px);
554
+ --_autocomplete-padding-inline: var(--ui3n-autocomplete-padding-inline, 8px);
555
+ --_autocomplete-padding-block: var(--ui3n-autocomplete-padding-block, 4px);
556
+ --_autocomplete-border-radius: var(--ui3n-autocomplete-border-radius, 4px);
554
557
 
555
558
  position: relative;
556
559
  display: flex;
557
560
  width: 100%;
558
- min-height: var(--ui3n-autocomplete-min-height);
561
+ min-height: var(--_autocomplete-min-height);
559
562
 
560
563
  :global(.match-search) {
561
564
  font-weight: 600;
@@ -580,20 +583,20 @@
580
583
  }
581
584
 
582
585
  .displayValue {
583
- font-size: var(--ui3n-autocomplete-font-size);
584
- line-height: var(--ui3n-autocomplete-min-height);
586
+ font-size: var(--_autocomplete-font-size);
587
+ line-height: var(--_autocomplete-min-height);
585
588
  font-weight: 400;
586
589
  color: var(--color-text-control-primary-default);
587
590
  }
588
591
 
589
592
  .input {
590
- border-radius: var(--ui3n-autocomplete-border-radius);
591
- padding: 0 var(--ui3n-autocomplete-padding-inline);
593
+ border-radius: var(--_autocomplete-border-radius);
594
+ padding: 0 var(--_autocomplete-padding-inline);
592
595
  flex: 1 1 60px;
593
596
  min-width: 60px;
594
- height: var(--ui3n-autocomplete-min-height);
595
- font-size: var(--ui3n-autocomplete-font-size);
596
- line-height: var(--ui3n-autocomplete-min-height);
597
+ height: var(--_autocomplete-min-height);
598
+ font-size: var(--_autocomplete-font-size);
599
+ line-height: var(--_autocomplete-min-height);
597
600
  font-weight: 400;
598
601
  color: var(--color-text-control-primary-default);
599
602
  background-color: transparent;
@@ -610,8 +613,8 @@
610
613
  }
611
614
 
612
615
  &.inputWithError {
613
- height: calc(var(--ui3n-autocomplete-min-height) - 2px);
614
- padding: 0 calc(var(--ui3n-autocomplete-padding-inline) - 1px);
616
+ height: calc(var(--_autocomplete-min-height) - 2px);
617
+ padding: 0 calc(var(--_autocomplete-padding-inline) - 1px);
615
618
  border: 1px solid var(--error-content-default);
616
619
  }
617
620
  }
@@ -624,15 +627,15 @@
624
627
 
625
628
  .item {
626
629
  display: flex;
627
- min-height: var(--ui3n-autocomplete-min-height);
630
+ min-height: var(--_autocomplete-min-height);
628
631
  justify-content: flex-start;
629
632
  align-items: center;
630
- padding: var(--ui3n-autocomplete-padding-block) var(--ui3n-autocomplete-padding-inline);
631
- font-size: var(--ui3n-autocomplete-item-font-size);
633
+ padding: var(--_autocomplete-padding-block) var(--_autocomplete-padding-inline);
634
+ font-size: var(--_autocomplete-item-font-size);
632
635
  line-height: 1.23;
633
636
  font-weight: 500;
634
637
  color: var(--color-text-control-primary-default);
635
- border-radius: var(--ui3n-autocomplete-border-radius);
638
+ border-radius: var(--_autocomplete-border-radius);
636
639
  user-select: none;
637
640
  cursor: pointer;
638
641
 
@@ -655,15 +658,15 @@
655
658
 
656
659
  .noData {
657
660
  display: flex;
658
- min-height: var(--ui3n-autocomplete-min-height);
661
+ min-height: var(--_autocomplete-min-height);
659
662
  justify-content: flex-start;
660
663
  align-items: center;
661
- padding: var(--ui3n-autocomplete-padding-block) var(--ui3n-autocomplete-padding-inline);
662
- font-size: var(--ui3n-autocomplete-item-font-size);
664
+ padding: var(--_autocomplete-padding-block) var(--_autocomplete-padding-inline);
665
+ font-size: var(--_autocomplete-item-font-size);
663
666
  line-height: 1.23;
664
667
  font-weight: 500;
665
668
  color: var(--color-text-control-primary-default);
666
- border-radius: var(--ui3n-autocomplete-border-radius);
669
+ border-radius: var(--_autocomplete-border-radius);
667
670
  }
668
671
 
669
672
  .chipsContainer {
@@ -35,6 +35,7 @@
35
35
  <div
36
36
  ref="element"
37
37
  :id="id"
38
+ data-ui3n="badge-simple"
38
39
  :class="[$style.ui3nBadgeSimple, dot && $style.ui3nBadgeDot]"
39
40
  >
40
41
  <span
@@ -48,11 +49,11 @@
48
49
 
49
50
  <style lang="scss" module>
50
51
  .ui3nBadgeSimple {
51
- --ui3n-badge-size: 20px;
52
- --ui3n-badge-dot-size: 8px;
53
- --ui3n-badge-padding-inline: 6px;
54
- --ui3n-badge-nodot-border-radius: 10px;
55
- --ui3n-badge-font-size: 12px;
52
+ --_badge-size: var(--ui3n-badge-size, 20px);
53
+ --_badge-dot-size: var(--ui3n-badge-dot-size, 8px);
54
+ --_badge-padding-inline: var(--ui3n-badge-padding-inline, 6px);
55
+ --_badge-nodot-border-radius: var(--ui3n-badge-nodot-border-radius, 10px);
56
+ --_badge-font-size: var(--ui3n-badge-font-size, 12px);
56
57
 
57
58
  position: relative;
58
59
  box-sizing: border-box;
@@ -60,29 +61,29 @@
60
61
  outline: 1px var(--color-bg-block-primary-default) solid;
61
62
 
62
63
  &:not(.ui3nBadgeDot) {
63
- min-height: var(--ui3n-badge-size);
64
- height: var(--ui3n-badge-size);
64
+ min-height: var(--_badge-size);
65
+ height: var(--_badge-size);
65
66
  width: max-content;
66
- padding: 0 var(--ui3n-badge-padding-inline);
67
- border-radius: var(--ui3n-badge-nodot-border-radius);
67
+ padding: 0 var(--_badge-padding-inline);
68
+ border-radius: var(--_badge-nodot-border-radius);
68
69
  }
69
70
  }
70
71
 
71
72
  .ui3nBadgeDot {
72
- min-width: var(--ui3n-badge-dot-size);
73
- width: var(--ui3n-badge-dot-size);
74
- max-width: var(--ui3n-badge-dot-size);
75
- min-height: var(--ui3n-badge-dot-size);
76
- height: var(--ui3n-badge-dot-size);
77
- max-height: var(--ui3n-badge-dot-size);
73
+ min-width: var(--_badge-dot-size);
74
+ width: var(--_badge-dot-size);
75
+ max-width: var(--_badge-dot-size);
76
+ min-height: var(--_badge-dot-size);
77
+ height: var(--_badge-dot-size);
78
+ max-height: var(--_badge-dot-size);
78
79
  border-radius: 50%;
79
80
  }
80
81
 
81
82
  .ui3nBadgeText {
82
83
  display: block;
83
84
  color: v-bind(textColor);
84
- font-size: var(--ui3n-badge-font-size);
85
- line-height: var(--ui3n-badge-size);
85
+ font-size: var(--_badge-font-size);
86
+ line-height: var(--_badge-size);
86
87
  text-align: center;
87
88
  }
88
89
  </style>
@@ -39,6 +39,7 @@
39
39
  <!-- eslint-disable vue/no-multiple-template-root -->
40
40
  <div
41
41
  v-if="hasDefaultSlot"
42
+ data-ui3n="badge"
42
43
  :class="$style.ui3nBadge"
43
44
  >
44
45
  <div :class="$style.ui3nBadgeWrapper">
@@ -69,7 +70,7 @@
69
70
 
70
71
  <style lang="scss" module>
71
72
  .ui3nBadge {
72
- --ui3n-badge-size: 20px;
73
+ --_badge-size: var(--ui3n-badge-size, 20px);
73
74
 
74
75
  position: relative;
75
76
  }
@@ -77,7 +78,7 @@
77
78
  .ui3nBadgeWrapper {
78
79
  position: relative;
79
80
  width: max-content;
80
- min-width: var(--ui3n-badge-size);
81
+ min-width: var(--_badge-size);
81
82
  }
82
83
 
83
84
  .ui3nBadgeContent {
@@ -40,6 +40,7 @@
40
40
 
41
41
  <template>
42
42
  <div
43
+ data-ui3n="breadcrumb"
43
44
  :class="cssClasses"
44
45
  v-on="isActive && !(disabled || parentDisabled) ? { click: onClick } : {}"
45
46
  >
@@ -65,11 +66,11 @@
65
66
 
66
67
  <style lang="scss" module>
67
68
  .ui3nBreadcrumb {
68
- --ui3n-breadcrumb-font-size: 16px;
69
- --ui3n-breadcrumb-padding-inline: 4px;
70
- --ui3n-breadcrumb-separator-distance: 8px;
71
- --ui3n-breadcrumb-color-default: var(--color-text-block-primary-default);
72
- --ui3n-breadcrumb-color-selected: var(--color-text-block-accent-default);
69
+ --_breadcrumb-font-size: var(--ui3n-breadcrumb-font-size, 16px);
70
+ --_breadcrumb-padding-inline: var(--ui3n-breadcrumb-padding-inline, 4px);
71
+ --_breadcrumb-separator-distance: var(--ui3n-breadcrumb-separator-distance, 8px);
72
+ --_breadcrumb-color-default: var(--ui3n-breadcrumb-color-default, var(--color-text-block-primary-default));
73
+ --_breadcrumb-color-selected: var(--ui3n-breadcrumb-color-selected, var(--color-text-block-accent-default));
73
74
 
74
75
  display: flex;
75
76
  align-items: center;
@@ -82,16 +83,16 @@
82
83
  }
83
84
 
84
85
  .content {
85
- font-size: var(--ui3n-breadcrumb-font-size);
86
+ font-size: var(--_breadcrumb-font-size);
86
87
  line-height: 1.25;
87
- color: var(--ui3n-breadcrumb-color-default);
88
+ color: var(--_breadcrumb-color-default);
88
89
  }
89
90
 
90
91
  .ui3nBreadcrumbSeparator {
91
92
  display: flex;
92
93
  align-items: center;
93
- margin: 0 var(--ui3n-breadcrumb-separator-distance);
94
- padding-left: var(--ui3n-breadcrumb-padding-inline);
94
+ margin: 0 var(--_breadcrumb-separator-distance);
95
+ padding-left: var(--_breadcrumb-padding-inline);
95
96
  color: var(--color-text-block-tertiary-default);
96
97
  }
97
98
 
@@ -99,7 +100,7 @@
99
100
  .content {
100
101
  &:hover {
101
102
  cursor: pointer;
102
- color: var(--ui3n-breadcrumb-color-selected);
103
+ color: var(--_breadcrumb-color-selected);
103
104
  }
104
105
  }
105
106
  }
@@ -18,7 +18,10 @@
18
18
  </script>
19
19
 
20
20
  <template>
21
- <div :class="$style.ui3nBreadcrumbs">
21
+ <div
22
+ data-ui3n="breadcrumbs"
23
+ :class="$style.ui3nBreadcrumbs"
24
+ >
22
25
  <slot />
23
26
  </div>
24
27
  </template>