@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
@@ -7,8 +7,16 @@
7
7
  const emits = defineEmits<Ui3nMobileMenuEmits>();
8
8
  defineSlots<Ui3nMobileMenuSlots>();
9
9
 
10
- const widthCss = computed(() => props.width || '240px');
11
- const blurValue = computed(() => (props.withBlur ? '2px' : '0'));
10
+ const inlineStyles = computed(() => {
11
+ const numericWidth = !isNaN(Number(props.width));
12
+ const widthStr = numericWidth ? `${props.width}px` : props.width || '240px';
13
+ const blurStr = props.withBlur ? '2px' : '0';
14
+
15
+ return {
16
+ '--ui3n-menu-width-custom': widthStr,
17
+ '--ui3n-menu-blur-custom': blurStr,
18
+ };
19
+ });
12
20
 
13
21
  function toggleMenu() {
14
22
  emits('update:modelValue', !props.modelValue);
@@ -16,7 +24,10 @@
16
24
  </script>
17
25
 
18
26
  <template>
19
- <div :class="$style.ui3nMobileMenu">
27
+ <div
28
+ :class="$style.ui3nMobileMenu"
29
+ :style="inlineStyles"
30
+ >
20
31
  <ui3n-button
21
32
  v-if="!modelValue"
22
33
  type="icon"
@@ -31,46 +42,72 @@
31
42
  <transition name="slide-fade">
32
43
  <div
33
44
  v-if="modelValue"
34
- :class="$style.appMenu"
45
+ :class="$style.menuWrapper"
35
46
  >
36
- <div :class="$style.appMenuHeader">
37
- <slot name="header" />
38
- </div>
39
- <div :class="$style.appMenuBody">
40
- <slot name="menuBody" />
41
- </div>
42
- <div :class="$style.appMenuFooter">
43
- <slot name="footer" />
44
- </div>
45
-
46
- <ui3n-button
47
- type="icon"
48
- icon="round-close"
49
- color="transparent"
50
- icon-color="var(--color-icon-block-secondary-default)"
51
- icon-size="32"
52
- :class="$style.closeBtn"
53
- @click.stop.prevent="toggleMenu"
47
+ <div
48
+ :class="$style.overlay"
49
+ @click="toggleMenu"
54
50
  />
51
+
52
+ <div :class="$style.menuPanel">
53
+ <div :class="$style.appMenu">
54
+ <div :class="$style.appMenuHeader">
55
+ <slot name="header" />
56
+ </div>
57
+ <div :class="$style.appMenuBody">
58
+ <slot name="menuBody" />
59
+ </div>
60
+ <div :class="$style.appMenuFooter">
61
+ <slot name="footer" />
62
+ </div>
63
+ </div>
64
+
65
+ <ui3n-button
66
+ type="icon"
67
+ icon="round-close"
68
+ color="transparent"
69
+ icon-color="var(--color-icon-block-secondary-default)"
70
+ icon-size="32"
71
+ :class="$style.closeBtn"
72
+ @click.stop.prevent="toggleMenu"
73
+ />
74
+ </div>
55
75
  </div>
56
76
  </transition>
57
77
  </div>
58
- <div
59
- v-if="modelValue"
60
- :class="$style.overlay"
61
- />
62
78
  </template>
63
79
 
64
80
  <style lang="scss" module>
65
81
  @use '../../assets/styles/mixins' as mixins;
82
+
66
83
  .ui3nMobileMenu {
67
- --ui3n-menu-width-custom: v-bind(widthCss);
84
+ --ui3n-menu-width-custom: 240px;
68
85
 
86
+ display: inline-block;
69
87
  width: max-content;
70
88
  }
71
89
 
72
- .appMenu {
90
+ .menuWrapper {
73
91
  position: fixed;
92
+ inset: 0;
93
+ width: 100vw;
94
+ height: 100dvh;
95
+ z-index: 1050;
96
+ pointer-events: auto;
97
+ }
98
+
99
+ .menuPanel {
100
+ position: absolute;
101
+ top: 0;
102
+ left: 0;
103
+ display: flex;
104
+ align-items: flex-start;
105
+ height: 100dvh;
106
+ z-index: 2;
107
+ }
108
+
109
+ .appMenu {
110
+ position: relative;
74
111
  top: 0;
75
112
  left: 0;
76
113
  width: var(--ui3n-menu-width-custom);
@@ -79,13 +116,13 @@
79
116
  flex-direction: column;
80
117
  justify-content: flex-start;
81
118
  align-items: stretch;
82
- min-height: 100dvh;
83
- max-height: 100dvh;
119
+ height: 100%;
84
120
  color: var(--color-text-block-primary-default);
85
121
  background-color: var(--color-bg-block-primary-default);
86
122
  overflow-x: hidden;
87
123
  overflow-y: auto;
88
- z-index: 1050;
124
+ box-shadow: 4px 0 16px var(--shadow-close);
125
+ flex-shrink: 0;
89
126
  }
90
127
 
91
128
  .appMenuHeader {
@@ -112,20 +149,20 @@
112
149
  }
113
150
 
114
151
  .closeBtn {
115
- position: fixed;
152
+ margin-top: 8px;
153
+ margin-left: 8px;
116
154
  min-width: 48px !important;
117
155
  height: 48px;
118
- top: 8px;
119
- left: calc(var(--ui3n-menu-width-custom) + 8px);
120
- z-index: 1005;
156
+ flex-shrink: 0;
121
157
  }
122
158
 
123
159
  .overlay {
124
- position: fixed;
160
+ position: absolute;
125
161
  inset: 0;
126
162
  background-color: oklch(from var(--color-bg-block-primary-default) calc(l * 0.1) c h / 0.5);
127
- backdrop-filter: blur(v-bind(blurValue));
128
- z-index: 1000;
163
+ backdrop-filter: blur(var(--ui3n-menu-blur-custom, 0px));
164
+ z-index: 1;
165
+ cursor: pointer;
129
166
  }
130
167
  </style>
131
168
 
@@ -135,17 +172,29 @@
135
172
  transition:
136
173
  transform 0.2s ease-in-out,
137
174
  opacity 0.2s ease-in-out;
175
+
176
+ div[class*='menuPanel'] {
177
+ transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
178
+ }
138
179
  }
139
180
 
140
181
  .slide-fade-enter-from,
141
182
  .slide-fade-leave-to {
142
183
  transform: translateX(calc(var(--ui3n-menu-width-custom) * -1));
143
184
  opacity: 0;
185
+
186
+ div[class*='menuPanel'] {
187
+ transform: translateX(-100%);
188
+ }
144
189
  }
145
190
 
146
191
  .slide-fade-enter-to,
147
192
  .slide-fade-leave-from {
148
193
  transform: translateX(0);
149
194
  opacity: 1;
195
+
196
+ div[class*='menuPanel'] {
197
+ transform: translateX(0);
198
+ }
150
199
  }
151
200
  </style>
@@ -24,10 +24,6 @@ export interface Ui3nNotificationProps {
24
24
  * @default false
25
25
  */
26
26
  withIcon?: boolean;
27
- /**
28
- * Teleport target
29
- */
30
- teleport?: string;
31
27
  /**
32
28
  * Called when notification opens
33
29
  */
@@ -0,0 +1,62 @@
1
+ <script lang="ts" setup>
2
+ import { ref } from 'vue';
3
+ import Ui3nNotification from './ui3n-notification.vue';
4
+ import type { Ui3nNotificationProps } from './types';
5
+
6
+ interface IdentifiableNotice extends Ui3nNotificationProps {
7
+ id: string;
8
+ }
9
+
10
+ const notices = ref<IdentifiableNotice[]>([]);
11
+
12
+ function add(notice: IdentifiableNotice) {
13
+ notices.value.push(notice);
14
+ }
15
+
16
+ function remove(id: string) {
17
+ notices.value = notices.value.filter(n => n.id !== id);
18
+ }
19
+
20
+ function onClose(notice: IdentifiableNotice) {
21
+ if (notice.onClose) {
22
+ notice.onClose();
23
+ }
24
+
25
+ remove(notice.id);
26
+ }
27
+
28
+ defineExpose({ add, remove });
29
+ </script>
30
+
31
+ <template>
32
+ <div
33
+ id="ui3n-notifications-container"
34
+ :class="$style.ui3nNotificationsWrapper"
35
+ >
36
+ <ui3n-notification
37
+ v-for="notice in notices"
38
+ :key="notice.id"
39
+ v-bind="notice"
40
+ :on-close="() => onClose(notice)"
41
+ />
42
+ </div>
43
+ </template>
44
+
45
+ <style lang="scss" module>
46
+ .ui3nNotificationsWrapper {
47
+ position: fixed;
48
+ top: 24px;
49
+ right: 24px;
50
+ z-index: 9999;
51
+ display: flex;
52
+ flex-direction: column;
53
+ gap: 8px;
54
+ max-width: 380px;
55
+ width: 100%;
56
+ pointer-events: none;
57
+ }
58
+
59
+ .ui3nNotificationsWrapper :global([class*='ui3nNotification']) {
60
+ pointer-events: auto;
61
+ }
62
+ </style>
@@ -1,5 +1,5 @@
1
1
  <script lang="ts" setup>
2
- import { computed, onMounted, onBeforeUnmount, useCssModule } from 'vue';
2
+ import { computed, onMounted, onBeforeUnmount, ref, useCssModule } from 'vue';
3
3
  import Ui3nIcon from '../ui3n-icon/ui3n-icon.vue';
4
4
  import Ui3nButton from '../ui3n-button/ui3n-button.vue';
5
5
  import type { Ui3nNotificationProps } from './types';
@@ -9,58 +9,64 @@
9
9
  position: 'center',
10
10
  duration: 0,
11
11
  withIcon: true,
12
- onOpen: () => void 0,
13
- onClose: () => void 0,
12
+ onOpen: () => {},
13
+ onClose: () => {},
14
14
  });
15
15
 
16
- const $style = useCssModule();
16
+ let timerId: ReturnType<typeof setTimeout> | null = null;
17
17
 
18
- const stylesByTypes = {
19
- success: {
20
- color: 'var(--success-content-default)',
21
- icon: 'round-check-circle',
22
- iconColor: 'var(--success-fill-default)',
23
- iconRotate: 0,
24
- },
25
- warning: {
26
- color: 'var(--warning-content-default)',
27
- icon: 'round-warning',
28
- iconColor: 'var(--warning-fill-default)',
29
- iconRotate: 0,
30
- },
31
- info: {
32
- color: 'var(--info-content-default)',
33
- icon: 'round-info',
34
- iconColor: 'var(--info-fill-default)',
35
- iconRotate: 180,
36
- },
37
- error: {
38
- color: 'var(--error-content-default)',
39
- icon: 'round-info',
40
- iconColor: 'var(--error-fill-default)',
41
- iconRotate: 180,
42
- },
43
- };
18
+ const $style = useCssModule();
44
19
 
45
- let timerId: ReturnType<typeof setTimeout> | null = null;
20
+ const currentTypeConfig = computed(() => {
21
+ const stylesByTypes = {
22
+ success: {
23
+ color: 'var(--success-content-default)',
24
+ icon: 'round-check-circle',
25
+ iconColor: 'var(--success-fill-default)',
26
+ iconRotate: 0,
27
+ },
28
+ warning: {
29
+ color: 'var(--warning-content-default)',
30
+ icon: 'round-warning',
31
+ iconColor: 'var(--warning-fill-default)',
32
+ iconRotate: 0,
33
+ },
34
+ info: {
35
+ color: 'var(--info-content-default)',
36
+ icon: 'round-info',
37
+ iconColor: 'var(--info-fill-default)',
38
+ iconRotate: 180,
39
+ },
40
+ error: {
41
+ color: 'var(--error-content-default)',
42
+ icon: 'round-info',
43
+ iconColor: 'var(--error-fill-default)',
44
+ iconRotate: 180,
45
+ },
46
+ };
47
+ return stylesByTypes[props.type || 'info'];
48
+ });
46
49
 
47
50
  const mainCssClasses = computed(() => {
48
51
  const val = [$style.ui3nNotification, $style[`${props.type}Type`], $style[`${props.position}Position`]];
49
52
  props.withIcon && val.push($style.withIcon);
50
-
51
53
  return val;
52
54
  });
53
55
 
54
56
  function closeNotification() {
55
- props.onClose && props.onClose();
57
+ if (props.onClose) {
58
+ props.onClose();
59
+ }
56
60
  }
57
61
 
58
62
  onMounted(() => {
59
- props.onOpen && props.onOpen();
63
+ if (props.onOpen) {
64
+ props.onOpen();
65
+ }
60
66
 
61
67
  if (props.duration > 0) {
62
68
  timerId = setTimeout(() => {
63
- props.onClose();
69
+ closeNotification();
64
70
  }, props.duration);
65
71
  }
66
72
  });
@@ -73,43 +79,38 @@
73
79
  </script>
74
80
 
75
81
  <template>
76
- <component
77
- :is="teleport ? 'Teleport' : 'div'"
78
- :to="teleport"
82
+ <div
83
+ :id="id"
84
+ :class="mainCssClasses"
79
85
  >
80
86
  <div
81
- :id="id"
82
- :class="mainCssClasses"
87
+ v-if="withIcon"
88
+ :class="$style.ui3nNotificationIcon"
83
89
  >
84
- <div
85
- v-if="withIcon"
86
- :class="$style.ui3nNotificationIcon"
87
- >
88
- <ui3n-icon
89
- :icon="stylesByTypes[type!].icon"
90
- size="16"
91
- :rotate="stylesByTypes[type!].iconRotate"
92
- :color="stylesByTypes[type!].iconColor"
93
- />
94
- </div>
95
-
96
- <div :class="$style.ui3nNotificationContent">
97
- {{ content }}
98
- </div>
99
-
100
- <ui3n-button
101
- v-if="!duration"
102
- type="icon"
103
- size="small"
104
- color="transparent"
105
- icon="round-close"
106
- :icon-color="stylesByTypes[type!].color"
107
- icon-size="16"
108
- :class="$style.closeBtn"
109
- @click="closeNotification"
90
+ <ui3n-icon
91
+ :icon="currentTypeConfig.icon"
92
+ size="16"
93
+ :rotate="currentTypeConfig.iconRotate"
94
+ :color="currentTypeConfig.iconColor"
110
95
  />
111
96
  </div>
112
- </component>
97
+
98
+ <div :class="$style.ui3nNotificationContent">
99
+ {{ content }}
100
+ </div>
101
+
102
+ <ui3n-button
103
+ v-if="!duration"
104
+ type="icon"
105
+ size="small"
106
+ color="transparent"
107
+ icon="round-close"
108
+ :icon-color="currentTypeConfig.color"
109
+ icon-size="16"
110
+ :class="$style.closeBtn"
111
+ @click="closeNotification"
112
+ />
113
+ </div>
113
114
  </template>
114
115
 
115
116
  <style lang="scss" module>
@@ -122,6 +123,7 @@
122
123
 
123
124
  display: flex;
124
125
  position: relative;
126
+ box-sizing: border-box;
125
127
  z-index: 5000;
126
128
  border-radius: var(--ui3n-notification-border-radius);
127
129
  outline: 1px solid var(--color-border-control-tritery-default);
@@ -130,7 +132,7 @@
130
132
  margin-bottom: var(--ui3n-notification-margin-bottom);
131
133
  justify-content: center;
132
134
  align-items: center;
133
- gap: 4px;
135
+ gap: 8px;
134
136
  }
135
137
 
136
138
  .withIcon {
@@ -147,6 +149,7 @@
147
149
  display: flex;
148
150
  justify-content: center;
149
151
  align-items: center;
152
+ flex-shrink: 0;
150
153
  }
151
154
 
152
155
  .ui3nNotificationContent {
@@ -155,13 +158,14 @@
155
158
  font-size: var(--ui3n-notification-font-size);
156
159
  font-weight: 500;
157
160
  line-height: 1.33;
161
+ padding-right: 20px;
158
162
  }
159
163
 
160
164
  .closeBtn {
161
165
  position: absolute;
162
166
  z-index: 1;
163
- top: 0;
164
- right: 0;
167
+ top: 6px;
168
+ right: 6px;
165
169
  }
166
170
 
167
171
  .infoType {