@v1nt1248/3nclient-lib 0.3.30 → 0.3.32

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 (75) hide show
  1. package/dist/chunks/{ui3n-notification-Dr_3Td9N.js → ui3n-notification-DPC5Ke4b.js} +96 -97
  2. package/dist/components/index.d.ts +3 -3
  3. package/dist/components/ui3n-breadcrumbs/types.d.ts +2 -0
  4. package/dist/components/ui3n-dialog/types.d.ts +1 -1
  5. package/dist/components/ui3n-editable/types.d.ts +1 -1
  6. package/dist/components/ui3n-editable/ui3n-editable.d.ts +1 -1
  7. package/dist/components/ui3n-editable/useContentEditable.d.ts +1 -1
  8. package/dist/components/ui3n-input/types.d.ts +2 -2
  9. package/dist/components/ui3n-menu/types.d.ts +16 -1
  10. package/dist/components/ui3n-menu/ui3n-menu.d.ts +2 -0
  11. package/dist/components/ui3n-mobile-menu/ui3n-mobile-menu.d.ts +2 -2
  12. package/dist/components/ui3n-notification/types.d.ts +0 -4
  13. package/dist/components/ui3n-notification/ui3n-notification-container.d.ts +11 -0
  14. package/dist/components/ui3n-notification/ui3n-notification.d.ts +1 -1
  15. package/dist/components/ui3n-progress/ui3n-progress-circular.d.ts +3 -3
  16. package/dist/components/ui3n-progress/ui3n-progress-linear.d.ts +2 -0
  17. package/dist/components/ui3n-selector/types.d.ts +1 -11
  18. package/dist/components/ui3n-step-line-bar/ui3n-step-line-bar.d.ts +1 -0
  19. package/dist/components/ui3n-switch/ui3n-switch.d.ts +2 -6
  20. package/dist/components/ui3n-table/composables/useTable.d.ts +4 -3
  21. package/dist/components/ui3n-text/ui3n-text.d.ts +1 -0
  22. package/dist/components/ui3n-tooltip/ui3n-tooltip.d.ts +1 -0
  23. package/dist/index.d.ts +1 -1
  24. package/dist/plugins/dialogs/dialogs.d.ts +2 -2
  25. package/dist/plugins/dialogs/store-dialog.d.ts +2 -2
  26. package/dist/plugins/dialogs/types.d.ts +1 -1
  27. package/dist/plugins/notifications/store-notifications.d.ts +1 -1
  28. package/dist/plugins/notifications/types.d.ts +1 -1
  29. package/dist/style.css +1 -1
  30. package/dist/ui3n-components.d.ts +1 -1
  31. package/dist/ui3n-components.js +1402 -1392
  32. package/dist/ui3n-plugins.d.ts +5 -5
  33. package/dist/ui3n-plugins.js +56 -43
  34. package/dist/utils/files/create-video-thumbnail.d.ts +1 -1
  35. package/dist/utils/for-vue/try-on-scope-dispose.d.ts +1 -1
  36. package/dist/utils/for-vue/unref-element.d.ts +1 -1
  37. package/dist/utils/processes/scheduler-yield.d.ts +1 -1
  38. package/dist/utils/processes/task-runner.d.ts +1 -1
  39. package/package.json +2 -2
  40. package/src/components/index.ts +9 -2
  41. package/src/components/ui3n-autocomplete/ui3n-autocomplete.vue +2 -1
  42. package/src/components/ui3n-breadcrumbs/types.ts +2 -0
  43. package/src/components/ui3n-breadcrumbs/ui3n-breadcrumb.vue +45 -35
  44. package/src/components/ui3n-breadcrumbs/ui3n-breadcrumbs.vue +12 -1
  45. package/src/components/ui3n-checkbox/ui3n-checkbox.vue +33 -67
  46. package/src/components/ui3n-editable/ui3n-editable.vue +68 -46
  47. package/src/components/ui3n-emoji/ui3n-emoji.vue +21 -27
  48. package/src/components/ui3n-icon/ui3n-icon.vue +13 -5
  49. package/src/components/ui3n-input/types.ts +2 -2
  50. package/src/components/ui3n-input/ui3n-input.vue +15 -9
  51. package/src/components/ui3n-menu/types.ts +19 -1
  52. package/src/components/ui3n-menu/ui3n-menu.vue +60 -57
  53. package/src/components/ui3n-mobile-menu/ui3n-mobile-menu.vue +87 -38
  54. package/src/components/ui3n-notification/types.ts +0 -4
  55. package/src/components/ui3n-notification/ui3n-notification-container.vue +62 -0
  56. package/src/components/ui3n-notification/ui3n-notification.vue +74 -70
  57. package/src/components/ui3n-progress/ui3n-progress-circular.vue +80 -120
  58. package/src/components/ui3n-progress/ui3n-progress-linear.vue +32 -15
  59. package/src/components/ui3n-radio-group/ui3n-radio-group.vue +2 -1
  60. package/src/components/ui3n-radio-group/ui3n-radio.vue +38 -47
  61. package/src/components/ui3n-scrollbar-horizontal/{ui3n-scroolbar-horizontal.vue → ui3n-scrollbar-horizontal.vue} +6 -8
  62. package/src/components/ui3n-scrollbar-vertical/ui3n-scrollbar-vertical.vue +10 -6
  63. package/src/components/ui3n-selector/types.ts +1 -10
  64. package/src/components/ui3n-selector/ui3n-selector.vue +49 -47
  65. package/src/components/ui3n-slider/ui3n-slider.vue +6 -9
  66. package/src/components/ui3n-step-line-bar/ui3n-step-line-bar.vue +5 -1
  67. package/src/components/ui3n-switch/ui3n-switch.vue +24 -19
  68. package/src/components/ui3n-table/composables/useTable.ts +37 -22
  69. package/src/components/ui3n-table/ui3n-table-sort-icon.vue +6 -1
  70. package/src/components/ui3n-table/ui3n-table.vue +3 -1
  71. package/src/components/ui3n-tabs/ui3n-tabs.vue +0 -23
  72. package/src/components/ui3n-text/ui3n-text.vue +36 -8
  73. package/src/components/ui3n-tooltip/ui3n-tooltip.vue +39 -18
  74. package/src/components/ui3n-virtual-scroll/ui3n-virtual-scroll.vue +2 -2
  75. /package/dist/components/ui3n-scrollbar-horizontal/{ui3n-scroolbar-horizontal.d.ts → ui3n-scrollbar-horizontal.d.ts} +0 -0
@@ -11,6 +11,7 @@
11
11
  label: '',
12
12
  placeholder: '',
13
13
  disabled: false,
14
+ validateAtStartup: false,
14
15
  });
15
16
  const emits = defineEmits<Ui3nTextEmits>();
16
17
 
@@ -20,7 +21,7 @@
20
21
  const isFocused = ref(false);
21
22
  const errorMessage = ref('');
22
23
 
23
- function validate(text: string) {
24
+ function validate(text: string, force = false) {
24
25
  errorMessage.value = '';
25
26
  if (props.rules && props.rules.length) {
26
27
  for (const validateFunction of props.rules) {
@@ -33,7 +34,7 @@
33
34
  }
34
35
  }
35
36
 
36
- if (isDirty.value) {
37
+ if (isDirty.value || force || props.validateAtStartup) {
37
38
  emits('update:valid', !errorMessage.value);
38
39
  }
39
40
  }
@@ -46,13 +47,14 @@
46
47
  function onBlur(event: Event) {
47
48
  const value = (event.target as HTMLInputElement).value;
48
49
 
50
+ validate(value);
51
+ emits('update:modelValue', value);
52
+ emits('change', value);
53
+
49
54
  setTimeout(() => {
50
55
  isFocused.value = false;
51
- validate(value);
52
56
  emits('blur', event);
53
- emits('change', value);
54
- emits('update:modelValue', value);
55
- }, 100);
57
+ }, 50);
56
58
  }
57
59
 
58
60
  function onInput(event: Event) {
@@ -129,7 +131,7 @@
129
131
  (val, oldVal) => {
130
132
  if ((val ?? '') !== (oldVal ?? '')) {
131
133
  text.value = val ?? '';
132
- validate(text.value);
134
+ validate(text.value, isDirty.value || props.validateAtStartup);
133
135
  }
134
136
  },
135
137
  { immediate: true },
@@ -139,7 +141,12 @@
139
141
  <template>
140
142
  <div
141
143
  :id="id"
142
- :class="[$style.ui3nText, disabled && $style.disabled, isFocused && $style.focused]"
144
+ :class="[
145
+ $style.ui3nText,
146
+ disabled && $style.disabled,
147
+ isFocused && $style.focused,
148
+ errorMessage && $style.hasError,
149
+ ]"
143
150
  >
144
151
  <label
145
152
  v-if="label"
@@ -168,6 +175,13 @@
168
175
  @focusout="onBlur"
169
176
  />
170
177
  </div>
178
+
179
+ <div
180
+ v-if="errorMessage"
181
+ :class="$style.errorBlock"
182
+ >
183
+ {{ errorMessage }}
184
+ </div>
171
185
  </div>
172
186
  </template>
173
187
 
@@ -272,4 +286,18 @@
272
286
  background-color: var(--color-bg-control-secondary-focused);
273
287
  }
274
288
  }
289
+
290
+ .hasError {
291
+ .body {
292
+ border-color: var(--error-fill-default);
293
+ }
294
+ }
295
+
296
+ .errorBlock {
297
+ margin-top: 4px;
298
+ font-size: 11px;
299
+ line-height: 13px;
300
+ color: var(--error-content-default);
301
+ font-weight: 400;
302
+ }
275
303
  </style>
@@ -15,6 +15,7 @@
15
15
  offsetX: 0,
16
16
  offsetY: 0,
17
17
  trigger: 'hover',
18
+ disabled: false,
18
19
  });
19
20
  const emits = defineEmits<Ui3nTooltipEmits>();
20
21
  defineSlots<Ui3nTooltipSlots>();
@@ -24,6 +25,8 @@
24
25
  const floatingEl = ref<Nullable<HTMLElement>>(null);
25
26
  const floatingArrowEl = ref<Nullable<HTMLElement>>(null);
26
27
 
28
+ const isClient = ref(false);
29
+
27
30
  const mainPlacement = computed(() => {
28
31
  const [part1] = props.placement.split('-');
29
32
  return part1;
@@ -65,14 +68,21 @@
65
68
  whileElementsMounted: props.positionStrategy === 'fixed' ? autoUpdate : undefined,
66
69
  });
67
70
 
68
- const tooltipStylesComputed = computed(() => ({
69
- ...floatingStyles.value,
70
- '--ui3n-tooltip-bg-color': props.color,
71
- '--ui3n-tooltip-text-color': props.textColor,
72
- '--ui3n-tooltip-max-width': `${props.maxContentWidth}px`,
73
- '--ui3n-tooltip-arrow-size': `${baseOffset}px`,
74
- '--ui3n-tooltip-base-offset': `${-baseOffset}px`,
75
- }));
71
+ const tooltipStylesComputed = computed(() => {
72
+ const maxWidth =
73
+ typeof props.maxContentWidth === 'number' || !isNaN(Number(props.maxContentWidth))
74
+ ? `${props.maxContentWidth}px`
75
+ : String(props.maxContentWidth);
76
+
77
+ return {
78
+ ...floatingStyles.value,
79
+ '--ui3n-tooltip-bg-color': props.color,
80
+ '--ui3n-tooltip-text-color': props.textColor,
81
+ '--ui3n-tooltip-max-width': maxWidth,
82
+ '--ui3n-tooltip-arrow-size': `${baseOffset}px`,
83
+ '--ui3n-tooltip-base-offset': `${-baseOffset}px`,
84
+ };
85
+ });
76
86
 
77
87
  function onMouseenter() {
78
88
  if (props.disabled) {
@@ -106,30 +116,41 @@
106
116
  }
107
117
  }
108
118
 
109
- onMounted(() => {
119
+ function removeEventListeners() {
110
120
  if (!referenceContainer.value) {
111
121
  return;
112
122
  }
113
123
 
124
+ referenceContainer.value.removeEventListener('mouseenter', onMouseenter);
125
+ referenceContainer.value.removeEventListener('mouseleave', onMouseleave);
126
+ referenceContainer.value.removeEventListener('click', onClick);
127
+ }
128
+
129
+ function setupEventListeners() {
130
+ removeEventListeners();
131
+ if (!referenceContainer.value || props.disabled) {
132
+ return;
133
+ }
134
+
114
135
  if (props.trigger === 'hover') {
115
136
  referenceContainer.value.addEventListener('mouseenter', onMouseenter);
116
137
  referenceContainer.value.addEventListener('mouseleave', onMouseleave);
117
138
  } else if (props.trigger === 'click') {
118
139
  referenceContainer.value.addEventListener('click', onClick);
119
140
  }
141
+ }
142
+
143
+ onMounted(() => {
144
+ isClient.value = true;
145
+ setupEventListeners();
120
146
  });
121
147
 
122
148
  onBeforeUnmount(() => {
123
- if (!referenceContainer.value) {
124
- return;
125
- }
149
+ removeEventListeners();
150
+ });
126
151
 
127
- if (props.trigger === 'hover') {
128
- referenceContainer.value.removeEventListener('mouseenter', onMouseenter);
129
- referenceContainer.value.removeEventListener('mouseleave', onMouseleave);
130
- } else if (props.trigger === 'click') {
131
- referenceContainer.value.removeEventListener('click', onClick);
132
- }
152
+ watch([() => props.trigger, () => props.disabled], () => {
153
+ setupEventListeners();
133
154
  });
134
155
 
135
156
  watch(
@@ -235,10 +235,11 @@
235
235
  >
236
236
  <div
237
237
  v-for="(item, index) in visibleChildren"
238
- :key="item.id"
238
+ :key="item.id ?? `v-node-${startNode + index}`"
239
239
  :ref="el => setItemRef(el, item.id ?? startNode + index)"
240
240
  v-bind="{ 'data-sid': item.id ?? startNode + index }"
241
241
  :class="$style.item"
242
+ :style="{ minHeight: `${props.minChildHeight}px` }"
242
243
  >
243
244
  <slot
244
245
  name="item"
@@ -271,7 +272,6 @@
271
272
 
272
273
  .item {
273
274
  position: relative;
274
- min-height: v-bind('props.minChildHeight + "px"');
275
275
  box-sizing: border-box;
276
276
  }
277
277
  </style>