@v1nt1248/3nclient-lib 0.2.33 → 0.2.35

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 +5 -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/composables/index.d.ts +1 -0
  7. package/dist/composables/useDblClickHandler.d.ts +3 -0
  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 +4 -1
  15. package/dist/ui3n-components.js +4879 -4810
  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 +18 -13
  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,21 +1,27 @@
1
1
  <script lang="ts" setup generic="T extends { id?: string }">
2
- import type { Ui3nListEmits, Ui3nListProps, Ui3nListSlots } from './types';
2
+ import type { Ui3nListEmits, Ui3nListProps, Ui3nListSlots } from './types';
3
3
 
4
- withDefaults(defineProps<Ui3nListProps<T>>(), {
5
- title: '',
6
- sticky: true,
7
- disabled: false,
8
- });
4
+ withDefaults(defineProps<Ui3nListProps<T>>(), {
5
+ title: '',
6
+ sticky: true,
7
+ disabled: false,
8
+ });
9
9
 
10
- const emits = defineEmits<Ui3nListEmits<T>>();
11
- defineSlots<Ui3nListSlots<T>>();
10
+ const emits = defineEmits<Ui3nListEmits<T>>();
11
+ defineSlots<Ui3nListSlots<T>>();
12
12
  </script>
13
13
 
14
14
  <template>
15
- <div ref="listElement" :class="$style.ui3nList">
15
+ <div
16
+ ref="listElement"
17
+ :class="$style.ui3nList"
18
+ >
16
19
  <div :class="[$style.ui3nListTitle, sticky && $style.ui3nListTitleSticky]">
17
20
  <slot name="title">
18
- <div v-if="title" :class="$style.ui3nListTitleContent">
21
+ <div
22
+ v-if="title"
23
+ :class="$style.ui3nListTitleContent"
24
+ >
19
25
  {{ title }}
20
26
  </div>
21
27
  </slot>
@@ -27,7 +33,11 @@ defineSlots<Ui3nListSlots<T>>();
27
33
  :key="item.id ?? index"
28
34
  :class="$style.item"
29
35
  >
30
- <slot name="item" :item="item" :index="index">
36
+ <slot
37
+ name="item"
38
+ :item="item"
39
+ :index="index"
40
+ >
31
41
  <div
32
42
  :class="[$style.ui3nListItemContent, disabled && $style.ui3nListItemContentDisabled]"
33
43
  @click.stop="emits('select', { value: item, index })"
@@ -41,61 +51,61 @@ defineSlots<Ui3nListSlots<T>>();
41
51
  </template>
42
52
 
43
53
  <style lang="scss" module>
44
- .ui3nList {
45
- --ui3n-list-item-height: 28px;
46
- --ui3n-list-bg-color: var(--color-bg-block-primary-default);
54
+ .ui3nList {
55
+ --ui3n-list-item-height: 28px;
56
+ --ui3n-list-bg-color: var(--color-bg-block-primary-default);
47
57
 
48
- position: relative;
49
- width: 100%;
50
- height: 100%;
51
- background-color: var(--ui3n-list-bg-color);
52
- display: flex;
53
- flex-direction: column;
54
- justify-content: flex-start;
55
- align-items: stretch;
56
- }
58
+ position: relative;
59
+ width: 100%;
60
+ height: 100%;
61
+ background-color: var(--ui3n-list-bg-color);
62
+ display: flex;
63
+ flex-direction: column;
64
+ justify-content: flex-start;
65
+ align-items: stretch;
66
+ }
57
67
 
58
- .ui3nListTitle {
59
- position: relative;
60
- top: 0;
61
- z-index: 1;
62
- }
68
+ .ui3nListTitle {
69
+ position: relative;
70
+ top: 0;
71
+ z-index: 1;
72
+ }
63
73
 
64
- .ui3nListTitleSticky {
65
- position: sticky;
66
- }
74
+ .ui3nListTitleSticky {
75
+ position: sticky;
76
+ }
67
77
 
68
- .ui3nListContent {
69
- position: relative;
70
- flex-grow: 1;
71
- }
78
+ .ui3nListContent {
79
+ position: relative;
80
+ flex-grow: 1;
81
+ }
72
82
 
73
- .ui3nListTitleContent,
74
- .ui3nListItem {
75
- position: relative;
76
- width: 100%;
77
- min-height: var(--ui3n-list-item-height);
78
- padding: 4px 0;
79
- display: flex;
80
- justify-content: flex-start;
81
- align-items: center;
82
- }
83
+ .ui3nListTitleContent,
84
+ .ui3nListItem {
85
+ position: relative;
86
+ width: 100%;
87
+ min-height: var(--ui3n-list-item-height);
88
+ padding: 4px 0;
89
+ display: flex;
90
+ justify-content: flex-start;
91
+ align-items: center;
92
+ }
83
93
 
84
- .ui3nListTitleContent {
85
- z-index: 1;
86
- font-size: 16px;
87
- font-weight: 600;
88
- background-color: var(--ui3n-list-bg-color);
89
- }
94
+ .ui3nListTitleContent {
95
+ z-index: 1;
96
+ font-size: 16px;
97
+ font-weight: 600;
98
+ background-color: var(--ui3n-list-bg-color);
99
+ }
90
100
 
91
- .ui3nListItemContent {
92
- font-size: 14px;
93
- font-weight: 400;
94
- cursor: pointer;
95
- }
101
+ .ui3nListItemContent {
102
+ font-size: 14px;
103
+ font-weight: 400;
104
+ cursor: pointer;
105
+ }
96
106
 
97
- .ui3nListItemContentDisabled {
98
- pointer-events: none;
99
- cursor: default;
100
- }
107
+ .ui3nListItemContentDisabled {
108
+ pointer-events: none;
109
+ cursor: default;
110
+ }
101
111
  </style>
@@ -3,7 +3,7 @@
3
3
  import { autoUpdate, flip, useFloating, offset, shift } from '@floating-ui/vue';
4
4
  import { default as vClickOutside } from '../../directives/ui3n-click-outside';
5
5
  import type { Ui3nMenuEmits, Ui3nMenuProps, Ui3nMenuSlots } from './types';
6
- import { Nullable } from '@/components/types';
6
+ import { Nullable } from '@/types';
7
7
 
8
8
  const props = withDefaults(defineProps<Ui3nMenuProps>(), {
9
9
  positionStrategy: 'absolute',
@@ -70,7 +70,10 @@ onMounted(() => {
70
70
  :id="id"
71
71
  :class="mainCssClasses"
72
72
  >
73
- <div v-if="withIcon" :class="$style.ui3nNotificationIcon">
73
+ <div
74
+ v-if="withIcon"
75
+ :class="$style.ui3nNotificationIcon"
76
+ >
74
77
  <ui3n-icon
75
78
  :icon="stylesByTypes[type!].icon"
76
79
  width="16"
@@ -1,89 +1,109 @@
1
1
  <script lang="ts" setup>
2
- import { computed, onBeforeMount, onBeforeUnmount, ref, useCssModule } from 'vue';
3
- import { toNumber } from 'lodash';
4
- import type { Ui3nProgressCircularProps } from './types';
5
-
6
- const thresholdSize = 64;
7
- const indeterminateModeValues = [1, 5, 10, 15, 20, 30, 40, 50, 60, 70, 80, 85, 90, 95, 99];
8
-
9
- const props = withDefaults(
10
- defineProps<Ui3nProgressCircularProps>(),
11
- {
12
- value: 0,
13
- size: 64,
14
- bgColor: 'var(--color-bg-control-primary-default)',
15
- color: 'var(--color-bg-control-accent-default)',
16
- },
17
- );
18
-
19
- const $style = useCssModule();
20
-
21
- const element = ref<HTMLDivElement>();
22
- const isValueShown = computed(() => props.withText && !props.indeterminate);
23
-
24
- const innerSize = computed(() => toNumber(props.size));
25
- const cssSize = computed(() => `${innerSize.value}px`);
26
- const innerWidth = computed(() => {
27
- if (props.width) {
28
- return toNumber(props.width);
29
- }
30
-
31
- const diff = innerSize.value - thresholdSize;
32
- if (diff <= 0) {
33
- return Math.round(innerSize.value / 10);
34
- }
2
+ import { computed, onBeforeMount, onBeforeUnmount, ref, useCssModule } from 'vue';
3
+ import { toNumber } from 'lodash';
4
+ import type { Ui3nProgressCircularProps } from './types';
5
+
6
+ const thresholdSize = 64;
7
+ const indeterminateModeValues = [1, 5, 10, 15, 20, 30, 40, 50, 60, 70, 80, 85, 90, 95, 99];
8
+
9
+ const props = withDefaults(
10
+ defineProps<Ui3nProgressCircularProps>(),
11
+ {
12
+ value: 0,
13
+ size: 64,
14
+ bgColor: 'var(--color-bg-control-primary-default)',
15
+ color: 'var(--color-bg-control-accent-default)',
16
+ },
17
+ );
18
+
19
+ const $style = useCssModule();
20
+
21
+ const element = ref<HTMLDivElement>();
22
+ const isValueShown = computed(() => props.withText && !props.indeterminate);
23
+
24
+ const innerSize = computed(() => toNumber(props.size));
25
+ const cssSize = computed(() => `${innerSize.value}px`);
26
+ const innerWidth = computed(() => {
27
+ if (props.width) {
28
+ return toNumber(props.width);
29
+ }
35
30
 
36
- return 6 + Math.round(diff / 20);
37
- });
38
- const cssWidth = computed(() => `${innerWidth.value}px`);
39
- const innerValue = computed(() => toNumber(props.value));
40
- const fontSize = computed(() => `${Math.floor((innerSize.value - 2 * innerWidth.value) / 3.2)}px`);
41
-
42
- const circleRadius = computed(() => Math.round(innerSize.value / 2) - Math.round(innerWidth.value / 2));
43
- const circumference = computed(() => Math.round(Math.PI * 2 * circleRadius.value));
44
-
45
- const timerId = ref();
46
- const indeterminateModeValue = ref(0);
47
-
48
- const strokeDasharray = computed(() => {
49
- const value = props.indeterminate ? indeterminateModeValue.value : innerValue.value;
50
- const dash = Math.round(circumference.value * value! / 100);
51
- const gap = circumference.value - dash;
52
- return `${dash} ${gap}`;
53
- });
54
-
55
- function changeValueForIndeterminateMode() {
56
- const indeterminateModeValuesLength = indeterminateModeValues.length;
57
- let index = 0;
58
- timerId.value = setInterval(() => {
59
- indeterminateModeValue.value = indeterminateModeValues[index % indeterminateModeValuesLength];
60
- index += 1;
61
- if ((index % indeterminateModeValuesLength) === 1) {
62
- if (element.value?.classList.contains($style.inverse)) {
63
- element.value?.classList.remove($style.inverse);
64
- } else {
65
- element.value?.classList.add($style.inverse);
66
- }
31
+ const diff = innerSize.value - thresholdSize;
32
+ if (diff <= 0) {
33
+ return Math.round(innerSize.value / 10);
67
34
  }
68
- }, 200);
69
- }
70
35
 
71
- onBeforeMount(() => {
72
- if (props.indeterminate) {
73
- changeValueForIndeterminateMode();
36
+ return 6 + Math.round(diff / 20);
37
+ });
38
+ const cssWidth = computed(() => `${innerWidth.value}px`);
39
+ const innerValue = computed(() => toNumber(props.value));
40
+ const fontSize = computed(() => `${Math.floor((innerSize.value - 2 * innerWidth.value) / 3.2)}px`);
41
+
42
+ const circleRadius = computed(() => Math.round(innerSize.value / 2) - Math.round(innerWidth.value / 2));
43
+ const circumference = computed(() => Math.round(Math.PI * 2 * circleRadius.value));
44
+
45
+ const timerId = ref();
46
+ const indeterminateModeValue = ref(0);
47
+
48
+ const strokeDasharray = computed(() => {
49
+ const value = props.indeterminate ? indeterminateModeValue.value : innerValue.value;
50
+ const dash = Math.round(circumference.value * value! / 100);
51
+ const gap = circumference.value - dash;
52
+ return `${dash} ${gap}`;
53
+ });
54
+
55
+ function changeValueForIndeterminateMode() {
56
+ const indeterminateModeValuesLength = indeterminateModeValues.length;
57
+ let index = 0;
58
+ timerId.value = setInterval(() => {
59
+ indeterminateModeValue.value = indeterminateModeValues[index % indeterminateModeValuesLength];
60
+ index += 1;
61
+ if ((index % indeterminateModeValuesLength) === 1) {
62
+ if (element.value?.classList.contains($style.inverse)) {
63
+ element.value?.classList.remove($style.inverse);
64
+ } else {
65
+ element.value?.classList.add($style.inverse);
66
+ }
67
+ }
68
+ }, 200);
74
69
  }
75
- });
76
70
 
77
- onBeforeUnmount(() => {
78
- clearInterval(timerId.value);
79
- });
71
+ onBeforeMount(() => {
72
+ if (props.indeterminate) {
73
+ changeValueForIndeterminateMode();
74
+ }
75
+ });
76
+
77
+ onBeforeUnmount(() => {
78
+ clearInterval(timerId.value);
79
+ });
80
80
  </script>
81
81
 
82
82
  <template>
83
- <div ref="element" :class="[$style.ui3nProgressCircular, indeterminate && $style.indeterminate]">
84
- <svg :height="innerSize" :width="innerSize" :class="$style.pie" xmlns="http://www.w3.org/2000/svg">
85
- <circle :class="$style.background" :r="circleRadius" cx="50%" cy="50%" />
86
- <circle :class="$style.chart" :r="circleRadius" cx="50%" cy="50%" :stroke-dasharray="strokeDasharray" />
83
+ <div
84
+ ref="element"
85
+ :class="[$style.ui3nProgressCircular, indeterminate && $style.indeterminate]"
86
+ >
87
+ <svg
88
+ :height="innerSize"
89
+ :width="innerSize"
90
+ :class="$style.pie"
91
+ xmlns="http://www.w3.org/2000/svg"
92
+ >
93
+ <circle
94
+ :class="$style.background"
95
+ :r="circleRadius"
96
+ cx="50%"
97
+ cy="50%"
98
+ />
99
+
100
+ <circle
101
+ :class="$style.chart"
102
+ :r="circleRadius"
103
+ cx="50%"
104
+ cy="50%"
105
+ :stroke-dasharray="strokeDasharray"
106
+ />
87
107
  </svg>
88
108
 
89
109
  <div
@@ -96,84 +116,85 @@ onBeforeUnmount(() => {
96
116
  </template>
97
117
 
98
118
  <style lang="scss" module>
99
- .ui3nProgressCircular {
100
- --ui3n-progress-circular-size: v-bind(cssSize);
101
- --ui3n-progress-circular-width: v-bind(cssWidth);
102
- --ui3n-progress-circular-font-size: v-bind(fontSize);
103
- --ui3n-progress-circular-bg: v-bind(bgColor);
104
- --ui3n-progress-circular-color: v-bind(color);
105
-
106
- position: relative;
107
- min-width: var(--ui3n-progress-circular-size);
108
- width: var(--ui3n-progress-circular-size);
109
- min-height: var(--ui3n-progress-circular-size);
110
- height: var(--ui3n-progress-circular-size);
111
- border-radius: 50%;
112
-
113
- &.inverse {
114
- .background {
115
- stroke: var(--ui3n-progress-circular-color) !important;
116
- }
119
+ .ui3nProgressCircular {
120
+ --ui3n-progress-circular-size: v-bind(cssSize);
121
+ --ui3n-progress-circular-width: v-bind(cssWidth);
122
+ --ui3n-progress-circular-font-size: v-bind(fontSize);
123
+ --ui3n-progress-circular-bg: v-bind(bgColor);
124
+ --ui3n-progress-circular-color: v-bind(color);
125
+
126
+ position: relative;
127
+ min-width: var(--ui3n-progress-circular-size);
128
+ width: var(--ui3n-progress-circular-size);
129
+ min-height: var(--ui3n-progress-circular-size);
130
+ height: var(--ui3n-progress-circular-size);
131
+ border-radius: 50%;
132
+
133
+ &.inverse {
134
+ .background {
135
+ stroke: var(--ui3n-progress-circular-color) !important;
136
+ }
117
137
 
118
- .chart {
119
- stroke: var(--ui3n-progress-circular-bg) !important;
138
+ .chart {
139
+ stroke: var(--ui3n-progress-circular-bg) !important;
140
+ }
120
141
  }
121
- }
122
142
 
123
- &:not(.indeterminate) {
124
- .chart {
125
- transition: 0.2s ease-in-out all;
143
+ &:not(.indeterminate) {
144
+ .chart {
145
+ transition: 0.2s ease-in-out all;
146
+ }
126
147
  }
127
148
  }
128
- }
129
-
130
- .pie {
131
- min-width: var(--ui3n-progress-circular-size);
132
- width: var(--ui3n-progress-circular-size);
133
- min-height: var(--ui3n-progress-circular-size);
134
- height: var(--ui3n-progress-circular-size);
135
- border-radius: 50%;
136
- transform: rotate(-90deg);
137
- }
138
-
139
- .background {
140
- fill: none;
141
- stroke: var(--ui3n-progress-circular-bg);
142
- stroke-width: var(--ui3n-progress-circular-width);
143
- }
144
-
145
- .chart {
146
- fill: none;
147
- stroke: var(--ui3n-progress-circular-color);
148
- stroke-width: var(--ui3n-progress-circular-width);
149
- }
150
-
151
- .text {
152
- position: absolute;
153
- top: 0;
154
- left: 0;
155
- width: 100%;
156
- height: 100%;
157
- display: flex;
158
- justify-content: center;
159
- align-items: center;
160
- font-size: var(--ui3n-progress-circular-font-size);
161
- font-weight: 500;
162
- color: var(--ui3n-progress-circular-color);
163
- }
164
-
165
- .indeterminate {
149
+
166
150
  .pie {
167
- animation: 0.75s linear 0s infinite normal spin;
151
+ min-width: var(--ui3n-progress-circular-size);
152
+ width: var(--ui3n-progress-circular-size);
153
+ min-height: var(--ui3n-progress-circular-size);
154
+ height: var(--ui3n-progress-circular-size);
155
+ border-radius: 50%;
156
+ transform: rotate(-90deg);
168
157
  }
169
- }
170
158
 
171
- @keyframes spin {
172
- 0% {
173
- transform: rotate(-90deg);
159
+ .background {
160
+ fill: none;
161
+ stroke: var(--ui3n-progress-circular-bg);
162
+ stroke-width: var(--ui3n-progress-circular-width);
163
+ }
164
+
165
+ .chart {
166
+ fill: none;
167
+ stroke: var(--ui3n-progress-circular-color);
168
+ stroke-width: var(--ui3n-progress-circular-width);
169
+ }
170
+
171
+ .text {
172
+ position: absolute;
173
+ top: 0;
174
+ left: 0;
175
+ width: 100%;
176
+ height: 100%;
177
+ display: flex;
178
+ justify-content: center;
179
+ align-items: center;
180
+ font-size: var(--ui3n-progress-circular-font-size);
181
+ font-weight: 500;
182
+ color: var(--ui3n-progress-circular-color);
174
183
  }
175
- 100% {
176
- transform: rotate(270deg);
184
+
185
+ .indeterminate {
186
+ .pie {
187
+ animation: 0.75s linear 0s infinite normal spin;
188
+ }
189
+ }
190
+
191
+ @keyframes spin {
192
+ 0% {
193
+ transform: rotate(-90deg);
194
+ }
195
+
196
+ 100% {
197
+ transform: rotate(270deg);
198
+ }
177
199
  }
178
- }
179
200
  </style>