@v1nt1248/3nclient-lib 0.2.32 → 0.2.34

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 (53) hide show
  1. package/README.md +2 -0
  2. package/dist/components/ui3n-dialog/types.d.ts +1 -1
  3. package/dist/components/ui3n-editable/types.d.ts +1 -1
  4. package/dist/components/ui3n-editable/ui3n-editable.vue.d.ts +1 -1
  5. package/dist/components/ui3n-editable/useContentEditable.d.ts +1 -1
  6. package/dist/components/ui3n-input/ui3n-input.vue.d.ts +33 -5
  7. package/dist/components/ui3n-text/ui3n-text.vue.d.ts +31 -5
  8. package/dist/directives/index.d.ts +2 -1
  9. package/dist/directives/ui3n-long-press.d.ts +27 -0
  10. package/dist/index.d.ts +3 -2
  11. package/dist/style.css +1 -1
  12. package/dist/types/directives.types.d.ts +7 -0
  13. package/dist/types/index.d.ts +3 -0
  14. package/dist/ui3n-components.d.ts +3 -1
  15. package/dist/ui3n-components.js +5640 -5563
  16. package/dist/ui3n-plugins.d.ts +1 -2
  17. package/dist/ui3n-plugins.js +2 -2
  18. package/dist/ui3n-utils.js +154 -144
  19. package/dist/utils/files/create-video-thumbnail.d.ts +1 -1
  20. package/dist/utils/for-vue/try-on-scope-dispose.d.ts +2 -0
  21. package/dist/utils/for-vue/unref-element.d.ts +2 -0
  22. package/dist/utils/index.d.ts +3 -1
  23. package/package.json +52 -46
  24. package/src/components/ui3n-autocomplete/ui3n-autocomplete.vue +32 -9
  25. package/src/components/ui3n-breadcrumbs/ui3n-breadcrumbs.vue +14 -14
  26. package/src/components/ui3n-button/ui3n-button.vue +229 -226
  27. package/src/components/ui3n-checkbox/ui3n-checkbox.vue +30 -7
  28. package/src/components/ui3n-chip/ui3n-chip.vue +113 -109
  29. package/src/components/ui3n-dialog/types.ts +1 -1
  30. package/src/components/ui3n-dialog/ui3n-dialog.vue +7 -8
  31. package/src/components/ui3n-editable/types.ts +1 -1
  32. package/src/components/ui3n-editable/ui3n-editable.vue +34 -12
  33. package/src/components/ui3n-editable/useContentEditable.ts +6 -3
  34. package/src/components/ui3n-icon/ui3n-icon.vue +1 -1
  35. package/src/components/ui3n-input/ui3n-input.vue +272 -273
  36. package/src/components/ui3n-input-file/ui3n-input-file.vue +2 -2
  37. package/src/components/ui3n-list/ui3n-list.vue +70 -60
  38. package/src/components/ui3n-menu/ui3n-menu.vue +1 -1
  39. package/src/components/ui3n-notification/ui3n-notification.vue +4 -1
  40. package/src/components/ui3n-progress/ui3n-progress-circular.vue +168 -147
  41. package/src/components/ui3n-progress/ui3n-progress-linear.vue +77 -73
  42. package/src/components/ui3n-radio-group/ui3n-radio.vue +178 -177
  43. package/src/components/ui3n-step-line-bar/ui3n-step-line-bar.vue +50 -46
  44. package/src/components/ui3n-switch/ui3n-switch.vue +114 -116
  45. package/src/components/ui3n-table/composables/useTable.ts +17 -9
  46. package/src/components/ui3n-table/ui3n-table-sort-icon.vue +9 -6
  47. package/src/components/ui3n-table/ui3n-table.vue +7 -5
  48. package/src/components/ui3n-text/ui3n-text.vue +157 -215
  49. package/src/components/ui3n-tooltip/ui3n-tooltip.vue +4 -5
  50. package/src/components/types/index.ts +0 -15
  51. /package/dist/{components/types/index.d.ts → types/components.types.d.ts} +0 -0
  52. /package/dist/{plugins/types.d.ts → types/plugins.types.d.ts} +0 -0
  53. /package/dist/utils/{for-we3n.d.ts → for-web3n.d.ts} +0 -0
@@ -1,83 +1,83 @@
1
1
  <script lang="ts" setup>
2
- import { computed, onMounted, ref, watch, useCssModule } from 'vue';
3
- import Ui3nIcon from '../ui3n-icon/ui3n-icon.vue';
4
- import Ui3nRipple from '../../directives/ui3n-ripple';
5
- import type { Ui3nButtonEmits, Ui3nButtonProps, Ui3nButtonEventName } from './types';
6
-
7
- const vUi3nRipple = Ui3nRipple;
8
-
9
- const props = withDefaults(
10
- defineProps<Ui3nButtonProps>(),
11
- {
12
- type: 'primary',
13
- size: 'regular',
14
- iconPosition: 'right',
15
- disabled: false,
16
- },
17
- );
18
- const emits = defineEmits<Ui3nButtonEmits>();
19
-
20
- const $css = useCssModule();
21
-
22
- const buttonEl = ref<HTMLButtonElement | null>(null);
23
-
24
- const mainCssClasses = computed(() => {
25
- const val = [$css.ui3nButton, $css[props.size], $css[props.type]];
26
-
27
- props.block && props.type !== 'icon' && val.push($css.block);
28
- props.icon && val.push($css[`withIcon-${props.iconPosition}`]);
29
- props.elevation && val.push($css.elevation);
30
-
31
- return val;
32
- });
33
-
34
- async function handleButtonEvent(eventName: Ui3nButtonEventName, value?: Event) {
35
- if (['init', 'enter'].includes(eventName)) {
36
- // @ts-ignore
37
- emits(eventName, buttonEl.value);
38
- } else {
39
- // @ts-ignore
40
- emits(eventName, value!);
2
+ import { computed, onMounted, ref, watch, useCssModule } from 'vue';
3
+ import Ui3nIcon from '../ui3n-icon/ui3n-icon.vue';
4
+ import Ui3nRipple from '../../directives/ui3n-ripple';
5
+ import type { Ui3nButtonEmits, Ui3nButtonProps, Ui3nButtonEventName } from './types';
6
+
7
+ const vUi3nRipple = Ui3nRipple;
8
+
9
+ const props = withDefaults(
10
+ defineProps<Ui3nButtonProps>(),
11
+ {
12
+ type: 'primary',
13
+ size: 'regular',
14
+ iconPosition: 'right',
15
+ disabled: false,
16
+ },
17
+ );
18
+ const emits = defineEmits<Ui3nButtonEmits>();
19
+
20
+ const $css = useCssModule();
21
+
22
+ const buttonEl = ref<HTMLButtonElement | null>(null);
23
+
24
+ const mainCssClasses = computed(() => {
25
+ const val = [$css.ui3nButton, $css[props.size], $css[props.type]];
26
+
27
+ props.block && props.type !== 'icon' && val.push($css.block);
28
+ props.icon && val.push($css[`withIcon-${props.iconPosition}`]);
29
+ props.elevation && val.push($css.elevation);
30
+
31
+ return val;
32
+ });
33
+
34
+ async function handleButtonEvent(eventName: Ui3nButtonEventName, value?: Event) {
35
+ if (['init', 'enter'].includes(eventName)) {
36
+ // @ts-ignore
37
+ emits(eventName, buttonEl.value);
38
+ } else {
39
+ // @ts-ignore
40
+ emits(eventName, value!);
41
+ }
41
42
  }
42
- }
43
43
 
44
- watch(
45
- [() => props.color, () => props.textColor],
46
- (newValue: [string | undefined, string | undefined], prevValue: [string | undefined, string | undefined]) => {
44
+ watch(
45
+ [() => props.color, () => props.textColor],
46
+ (newValue: [string | undefined, string | undefined], prevValue: [string | undefined, string | undefined]) => {
47
+ if (!buttonEl.value) return;
48
+
49
+ const [prevColor, prevTextColor] = prevValue;
50
+ const [color, textColor] = newValue;
51
+
52
+ (props.type === 'custom' || props.type === 'icon')
53
+ && color !== prevColor
54
+ && buttonEl.value.style.setProperty(
55
+ '--ui3n-button-bg-color-custom',
56
+ color ?? 'var(--color-bg-button-primary-default)',
57
+ );
58
+
59
+ props.type === 'custom'
60
+ && textColor !== prevTextColor
61
+ && buttonEl.value.style.setProperty(
62
+ '--ui3n-button-text-color-custom',
63
+ textColor ?? 'var(--color-text-button-primary-default',
64
+ );
65
+ },
66
+ );
67
+
68
+ onMounted(() => {
47
69
  if (!buttonEl.value) return;
48
70
 
49
- const [prevColor, prevTextColor] = prevValue;
50
- const [color, textColor] = newValue;
51
-
52
71
  (props.type === 'custom' || props.type === 'icon')
53
- && color !== prevColor
54
- && buttonEl.value.style.setProperty(
55
- '--ui3n-button-bg-color-custom',
56
- color ?? 'var(--color-bg-button-primary-default)',
57
- );
72
+ && props.color
73
+ && buttonEl.value.style.setProperty('--ui3n-button-bg-color-custom', props.color);
58
74
 
59
75
  props.type === 'custom'
60
- && textColor !== prevTextColor
61
- && buttonEl.value.style.setProperty(
62
- '--ui3n-button-text-color-custom',
63
- textColor ?? 'var(--color-text-button-primary-default',
64
- );
65
- },
66
- );
67
-
68
- onMounted(() => {
69
- if (!buttonEl.value) return;
70
-
71
- (props.type === 'custom' || props.type === 'icon')
72
- && props.color
73
- && buttonEl.value.style.setProperty('--ui3n-button-bg-color-custom', props.color);
74
-
75
- props.type === 'custom'
76
- && props.textColor
77
- && buttonEl.value.style.setProperty('--ui3n-button-text-color-custom', props.textColor);
78
-
79
- handleButtonEvent('init');
80
- });
76
+ && props.textColor
77
+ && buttonEl.value.style.setProperty('--ui3n-button-text-color-custom', props.textColor);
78
+
79
+ handleButtonEvent('init');
80
+ });
81
81
  </script>
82
82
 
83
83
  <template>
@@ -101,206 +101,209 @@ onMounted(() => {
101
101
  :color="iconColor || 'var(--color-text-button-primary-default)'"
102
102
  />
103
103
 
104
- <span v-if="type !== 'icon'" :class="$style.text">
104
+ <span
105
+ v-if="type !== 'icon'"
106
+ :class="$style.text"
107
+ >
105
108
  <slot />
106
109
  </span>
107
110
  </button>
108
111
  </template>
109
112
 
110
113
  <style lang="scss" module>
111
- @use '../../assets/styles/mixins' as mixins;
112
-
113
- .ui3nButton {
114
- --ui3n-button-padding: var(--spacing-m);
115
- --ui3n-button-text-size: var(--font-12);
116
- --ui3n-button-text-color-custom: var(--color-text-button-primary-default);
117
- --ui3n-button-bg-color-custom: var(--color-bg-button-primary-default);
118
-
119
- position: relative;
120
- width: max-content;
121
- display: flex;
122
- justify-content: center;
123
- align-items: center;
124
- column-gap: var(--spacing-xs);
125
- border: none;
126
- outline: none;
127
- border-radius: var(--spacing-xs);
128
- font-size: var(--ui3n-button-text-size);
129
- font-weight: 600;
130
- user-select: none;
131
- overflow: hidden;
132
-
133
- &:not([disabled]) {
134
- cursor: pointer;
114
+ @use '../../assets/styles/mixins' as mixins;
115
+
116
+ .ui3nButton {
117
+ --ui3n-button-padding: var(--spacing-m);
118
+ --ui3n-button-text-size: var(--font-12);
119
+ --ui3n-button-text-color-custom: var(--color-text-button-primary-default);
120
+ --ui3n-button-bg-color-custom: var(--color-bg-button-primary-default);
121
+
122
+ position: relative;
123
+ width: max-content;
124
+ display: flex;
125
+ justify-content: center;
126
+ align-items: center;
127
+ column-gap: var(--spacing-xs);
128
+ border: none;
129
+ outline: none;
130
+ border-radius: var(--spacing-xs);
131
+ font-size: var(--ui3n-button-text-size);
132
+ font-weight: 600;
133
+ user-select: none;
134
+ overflow: hidden;
135
+
136
+ &:not([disabled]) {
137
+ cursor: pointer;
138
+ }
135
139
  }
136
- }
137
140
 
138
- .regular {
139
- height: var(--spacing-l);
140
- padding: 0 var(--spacing-m);
141
+ .regular {
142
+ height: var(--spacing-l);
143
+ padding: 0 var(--spacing-m);
141
144
 
142
- &.withIcon-left {
143
- padding-left: var(--spacing-s);
144
- }
145
+ &.withIcon-left {
146
+ padding-left: var(--spacing-s);
147
+ }
145
148
 
146
- &.withIcon-right {
147
- padding-right: var(--spacing-s);
149
+ &.withIcon-right {
150
+ padding-right: var(--spacing-s);
151
+ }
148
152
  }
149
- }
150
153
 
151
- .small {
152
- height: var(--spacing-ml);
153
- padding: 0 var(--spacing-s);
154
+ .small {
155
+ height: var(--spacing-ml);
156
+ padding: 0 var(--spacing-s);
154
157
 
155
- &.withIcon-left {
156
- padding-left: var(--spacing-xs);
157
- }
158
+ &.withIcon-left {
159
+ padding-left: var(--spacing-xs);
160
+ }
158
161
 
159
- &.withIcon-right {
160
- padding-right: var(--spacing-xs);
162
+ &.withIcon-right {
163
+ padding-right: var(--spacing-xs);
164
+ }
161
165
  }
162
- }
163
166
 
164
- .block {
165
- width: 100%;
166
- }
167
+ .block {
168
+ width: 100%;
169
+ }
167
170
 
168
- .primary {
169
- background: var(--color-bg-button-primary-default);
170
- color: var(--color-text-button-primary-default);
171
+ .primary {
172
+ background: var(--color-bg-button-primary-default);
173
+ color: var(--color-text-button-primary-default);
171
174
 
172
- &:hover {
173
- background: var(--color-bg-button-primary-hover);
174
- color: var(--color-text-button-primary-hover);
175
- }
175
+ &:hover {
176
+ background: var(--color-bg-button-primary-hover);
177
+ color: var(--color-text-button-primary-hover);
178
+ }
176
179
 
177
- &:focus {
178
- outline: 1px solid var(--color-border-button-primary-focused);
179
- }
180
+ &:focus {
181
+ outline: 1px solid var(--color-border-button-primary-focused);
182
+ }
180
183
 
181
- &[disabled] {
182
- background: var(--color-bg-button-primary-disabled);
183
- color: var(--color-text-button-primary-disabled);
184
- pointer-events: none;
184
+ &[disabled] {
185
+ background: var(--color-bg-button-primary-disabled);
186
+ color: var(--color-text-button-primary-disabled);
187
+ pointer-events: none;
188
+ }
185
189
  }
186
- }
187
190
 
188
- .secondary {
189
- background: var(--color-bg-button-secondary-default);
190
- color: var(--color-text-button-secondary-default);
191
+ .secondary {
192
+ background: var(--color-bg-button-secondary-default);
193
+ color: var(--color-text-button-secondary-default);
191
194
 
192
- &:hover {
193
- background: var(--color-bg-button-secondary-hover);
194
- color: var(--color-text-button-secondary-hover);
195
- }
195
+ &:hover {
196
+ background: var(--color-bg-button-secondary-hover);
197
+ color: var(--color-text-button-secondary-hover);
198
+ }
196
199
 
197
- &:focus {
198
- outline: 1px solid var(--color-border-button-secondary-focused);
199
- }
200
+ &:focus {
201
+ outline: 1px solid var(--color-border-button-secondary-focused);
202
+ }
200
203
 
201
- &[disabled] {
202
- background: var(--color-bg-button-secondary-disabled);
203
- color: var(--color-text-button-secondary-disabled);
204
- pointer-events: none;
204
+ &[disabled] {
205
+ background: var(--color-bg-button-secondary-disabled);
206
+ color: var(--color-text-button-secondary-disabled);
207
+ pointer-events: none;
208
+ }
205
209
  }
206
- }
207
-
208
- .tertiary {
209
- background: transparent;
210
- color: var(--color-text-button-secondary-default);
211
- line-height: calc(var(--ui3n-button-text-size) * 1.25);
212
- padding: 0;
213
210
 
214
- &:hover {
211
+ .tertiary {
215
212
  background: transparent;
216
- color: var(--color-text-button-secondary-hover);
217
- text-decoration: underline;
218
- cursor: pointer;
219
- }
213
+ color: var(--color-text-button-secondary-default);
214
+ line-height: calc(var(--ui3n-button-text-size) * 1.25);
215
+ padding: 0;
220
216
 
221
- &:focus {
222
- outline: 1px solid var(--color-border-button-secondary-focused);
217
+ &:hover {
218
+ background: transparent;
219
+ color: var(--color-text-button-secondary-hover);
220
+ text-decoration: underline;
221
+ cursor: pointer;
222
+ }
223
+
224
+ &:focus {
225
+ outline: 1px solid var(--color-border-button-secondary-focused);
226
+ }
227
+
228
+ &[disabled] {
229
+ background: transparent;
230
+ color: var(--color-text-button-secondary-disabled);
231
+ pointer-events: none;
232
+ }
223
233
  }
224
234
 
225
- &[disabled] {
226
- background: transparent;
227
- color: var(--color-text-button-secondary-disabled);
228
- pointer-events: none;
235
+ .icon {
236
+ --ui3n-button-icon-bg-color: hsl(from var(--ui3n-button-bg-color-custom) h s calc(l - 10));
237
+
238
+ background: var(--ui3n-button-bg-color-custom);
239
+ color: var(--ui3n-button-text-color-custom);
240
+ border-radius: 50%;
241
+
242
+ &.regular {
243
+ min-width: var(--spacing-l);
244
+ width: var(--spacing-l);
245
+ padding: 0;
246
+ }
247
+
248
+ &.small {
249
+ min-width: var(--spacing-ml);
250
+ width: var(--spacing-ml);
251
+ padding: 0;
252
+ }
253
+
254
+ &:hover {
255
+ background: var(--ui3n-button-icon-bg-color);
256
+ }
257
+
258
+ &:focus {
259
+ outline: 1px solid hsl(from var(--ui3n-button-icon-bg-color) h s calc(l - 10));
260
+ }
261
+
262
+ &[disabled] {
263
+ opacity: 0.7;
264
+ pointer-events: none;
265
+ }
229
266
  }
230
- }
231
267
 
232
- .icon {
233
- --ui3n-button-icon-bg-color: hsl(from var(--ui3n-button-bg-color-custom) h s calc(l - 10));
268
+ .custom {
269
+ --ui3n-button-custom-bg-color: hsl(from var(--ui3n-button-bg-color-custom) h s calc(l - 10));
234
270
 
235
- background: var(--ui3n-button-bg-color-custom);
236
- color: var(--ui3n-button-text-color-custom);
237
- border-radius: 50%;
271
+ background: var(--ui3n-button-bg-color-custom);
272
+ color: var(--ui3n-button-text-color-custom);
238
273
 
239
- &.regular {
240
- min-width: var(--spacing-l);
241
- width: var(--spacing-l);
242
- padding: 0;
243
- }
274
+ &:hover {
275
+ background: var(--ui3n-button-custom-bg-color);
276
+ }
244
277
 
245
- &.small {
246
- min-width: var(--spacing-ml);
247
- width: var(--spacing-ml);
248
- padding: 0;
249
- }
278
+ &:focus {
279
+ outline: 1px solid hsl(from var(--ui3n-button-custom-bg-color) h s calc(l - 10));
280
+ }
250
281
 
251
- &:hover {
252
- background: var(--ui3n-button-icon-bg-color);
282
+ &[disabled] {
283
+ opacity: 0.7;
284
+ pointer-events: none;
285
+ }
253
286
  }
254
287
 
255
- &:focus {
256
- outline: 1px solid hsl(from var(--ui3n-button-icon-bg-color) h s calc(l - 10));
288
+ .withIcon-left {
289
+ flex-direction: row;
257
290
  }
258
291
 
259
- &[disabled] {
260
- opacity: 0.7;
261
- pointer-events: none;
292
+ .withIcon-right {
293
+ flex-direction: row-reverse;
262
294
  }
263
- }
264
-
265
- .custom {
266
- --ui3n-button-custom-bg-color: hsl(from var(--ui3n-button-bg-color-custom) h s calc(l - 10));
267
295
 
268
- background: var(--ui3n-button-bg-color-custom);
269
- color: var(--ui3n-button-text-color-custom);
270
-
271
- &:hover {
272
- background: var(--ui3n-button-custom-bg-color);
273
- }
274
-
275
- &:focus {
276
- outline: 1px solid hsl(from var(--ui3n-button-custom-bg-color) h s calc(l - 10));
296
+ .buttonIcon {
297
+ pointer-events: none;
277
298
  }
278
299
 
279
- &[disabled] {
280
- opacity: 0.7;
300
+ .text {
301
+ display: inline-block;
302
+ max-width: 100%;
281
303
  pointer-events: none;
282
304
  }
283
- }
284
-
285
- .withIcon-left {
286
- flex-direction: row;
287
- }
288
-
289
- .withIcon-right {
290
- flex-direction: row-reverse;
291
- }
292
305
 
293
- .buttonIcon {
294
- pointer-events: none;
295
- }
296
-
297
- .text {
298
- display: inline-block;
299
- max-width: 100%;
300
- pointer-events: none;
301
- }
302
-
303
- .elevation {
304
- @include mixins.elevation();
305
- }
306
+ .elevation {
307
+ @include mixins.elevation();
308
+ }
306
309
  </style>
@@ -138,12 +138,22 @@
138
138
  xmlns="http://www.w3.org/2000/svg"
139
139
  :class="$style.ui3nCheckboxIcon"
140
140
  >
141
- <g id="SVGRepo_bgCarrier" stroke-width="0" />
142
- <g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round" />
141
+ <g
142
+ id="SVGRepo_bgCarrier"
143
+ stroke-width="0"
144
+ />
145
+ <g
146
+ id="SVGRepo_tracerCarrier"
147
+ stroke-linecap="round"
148
+ stroke-linejoin="round"
149
+ />
143
150
  <g id="SVGRepo_iconCarrier">
144
151
  <path
145
- d="M20.0001 7L9.0001 18L4 13" stroke="#fff" stroke-width="3" stroke-linecap="round"
146
- stroke-linejoin="round"
152
+ d="M20.0001 7L9.0001 18L4 13"
153
+ stroke="#fff"
154
+ stroke-width="3"
155
+ stroke-linecap="round"
156
+ stroke-linejoin="round"
147
157
  />
148
158
  </g>
149
159
  </svg>
@@ -157,10 +167,23 @@ d="M20.0001 7L9.0001 18L4 13" stroke="#fff" stroke-width="3" stroke-linecap="rou
157
167
  xmlns="http://www.w3.org/2000/svg"
158
168
  :class="$style.ui3nCheckboxIcon"
159
169
  >
160
- <g id="SVGRepo_bgCarrier" stroke-width="0"></g>
161
- <g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
170
+ <g
171
+ id="SVGRepo_bgCarrier"
172
+ stroke-width="0"
173
+ />
174
+ <g
175
+ id="SVGRepo_tracerCarrier"
176
+ stroke-linecap="round"
177
+ stroke-linejoin="round"
178
+ />
162
179
  <g id="SVGRepo_iconCarrier">
163
- <path d="M7 12L17 12" stroke="#fff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" />
180
+ <path
181
+ d="M7 12L17 12"
182
+ stroke="#fff"
183
+ stroke-width="3"
184
+ stroke-linecap="round"
185
+ stroke-linejoin="round"
186
+ />
164
187
  </g>
165
188
  </svg>
166
189
  </div>