@webitel/ui-sdk 25.8.53 → 25.8.55

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/ui-sdk",
3
- "version": "25.8.53",
3
+ "version": "25.8.55",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "make-all": "npm version patch --git-tag-version false && npm run build && (npm run build:types || true) && (npm run lint:fix || true) && npm run publish-lib",
@@ -1,57 +1,42 @@
1
1
  <template>
2
- <i
2
+ <svg
3
3
  :class="[
4
+ 'wt-icon',
4
5
  `wt-icon--size-${size}`,
5
6
  `wt-icon--color-${color}`,
6
7
  { 'wt-icon--disabled': disabled },
7
8
  ]"
8
- class="wt-icon"
9
9
  >
10
- <svg class="wt-icon__icon">
11
- <use :xlink:href="iconName" />
12
- </svg>
13
- </i>
10
+ <use :href="iconName" />
11
+ </svg>
14
12
  </template>
15
13
 
16
- <script setup>
14
+ <script setup lang="ts">
17
15
  import { computed } from 'vue';
18
16
 
19
- const props = defineProps({
17
+ import { ComponentSize, IconColor } from '../../enums';
18
+
19
+ interface Props {
20
20
  /**
21
21
  * Icon name
22
22
  * @example '<wt-icon icon="close"></wt-icon>'
23
23
  */
24
- icon: {
25
- type: String,
26
- required: true,
27
- },
28
- /**
29
- * @values xs, sm (16px), md (24px), lg (32px), xl (40px), 2xl, 3xl
30
- * @example '<wt-icon icon="close" size="sm"></wt-icon>'
31
- */
32
- size: {
33
- type: String,
34
- default: 'md',
35
- },
36
- /**
37
- * @values 'default', 'active', 'disabled', 'primary', 'error', 'success', 'warning', 'on-dark', 'on-light', 'on-primary', 'info', 'chat', 'transfer', 'job'
38
- */
39
- color: {
40
- type: String,
41
- default: 'default',
42
- },
24
+ icon: string;
25
+ size?: ComponentSize;
26
+ color?: IconColor;
43
27
  /**
44
28
  * inserts icon name prefix between "icon" and actual icon name ("icon" prop).
45
29
  * Useful for library icons extension with project-level icons with this prefix in name
46
30
  */
47
- iconPrefix: {
48
- type: String,
49
- default: '',
50
- },
51
- disabled: {
52
- type: Boolean,
53
- default: false,
54
- },
31
+ iconPrefix?: string;
32
+ disabled?: boolean;
33
+ }
34
+
35
+ const props = withDefaults(defineProps<Props>(), {
36
+ size: ComponentSize.MD,
37
+ color: IconColor.DEFAULT,
38
+ iconPrefix: '',
39
+ disabled: false,
55
40
  });
56
41
 
57
42
  const iconName = computed(() => {
@@ -63,122 +48,40 @@ const iconName = computed(() => {
63
48
 
64
49
  <style lang="scss">
65
50
  @use './variables.scss';
66
- </style>
67
51
 
68
- <style lang="scss" scoped>
69
52
  .wt-icon {
70
53
  display: inline-flex;
71
54
  justify-content: center;
72
55
  align-items: center;
73
56
  transition: var(--transition);
74
- }
75
-
76
- /*svg instead of .icon to override styles by .icon-icon-name-size without any other seelectors*/
77
- svg {
78
- display: block;
79
- transition: var(--transition);
80
- width: 100%;
81
- height: 100%;
82
57
  stroke-width: 0;
83
58
  fill: var(--icon-color);
84
- }
85
-
86
- .wt-icon--color {
87
- &-default .wt-icon__icon {
88
- fill: var(--icon-color);
89
- }
90
-
91
- &-active .wt-icon__icon {
92
- fill: var(--icon-active-color);
93
- }
94
-
95
- &-primary .wt-icon__icon {
96
- fill: var(--icon-primary-color);
97
- }
98
-
99
- &-error .wt-icon__icon {
100
- fill: var(--icon-error-color);
101
- }
102
-
103
- &-success .wt-icon__icon {
104
- fill: var(--icon-success-color);
105
- }
106
-
107
- &-warning .wt-icon__icon {
108
- fill: var(--icon-warning-color);
109
- }
110
-
111
- &-on-dark .wt-icon__icon {
112
- fill: var(--icon-on-dark-color);
113
- }
114
-
115
- &-on-light .wt-icon__icon {
116
- fill: var(--icon-on-light-color);
117
- }
118
59
 
119
- &-on-primary .wt-icon__icon {
120
- fill: var(--icon-on-primary-color);
121
- }
122
-
123
- &-info .wt-icon__icon {
124
- fill: var(--icon-info-color);
125
- }
126
-
127
- &-chat .wt-icon__icon {
128
- fill: var(--icon-chat-color);
129
- }
130
-
131
- &-transfer .wt-icon__icon {
132
- fill: var(--icon-transfer-color);
133
- }
134
-
135
- &-job .wt-icon__icon {
136
- fill: var(--icon-job-color);
137
- }
138
-
139
- &-disabled .wt-icon__icon {
60
+ &--size-xs { width: var(--icon-xs-size); height: var(--icon-xs-size); }
61
+ &--size-sm { width: var(--icon-sm-size); height: var(--icon-sm-size); }
62
+ &--size-md { width: var(--icon-md-size); height: var(--icon-md-size); }
63
+ &--size-lg { width: var(--icon-lg-size); height: var(--icon-lg-size); }
64
+ &--size-xl { width: var(--icon-xl-size); height: var(--icon-xl-size); }
65
+ &--size-2xl { width: var(--icon-2xl-size); height: var(--icon-2xl-size); }
66
+ &--size-3xl { width: var(--icon-3xl-size); height: var(--icon-3xl-size); }
67
+
68
+ &--color-default { fill: var(--icon-color); }
69
+ &--color-active { fill: var(--icon-active-color); }
70
+ &--color-primary { fill: var(--icon-primary-color); }
71
+ &--color-error { fill: var(--icon-error-color); }
72
+ &--color-success { fill: var(--icon-success-color); }
73
+ &--color-warning { fill: var(--icon-warning-color); }
74
+ &--color-on-dark { fill: var(--icon-on-dark-color); }
75
+ &--color-on-light { fill: var(--icon-on-light-color); }
76
+ &--color-on-primary { fill: var(--icon-on-primary-color); }
77
+ &--color-info { fill: var(--icon-info-color); }
78
+ &--color-chat { fill: var(--icon-chat-color); }
79
+ &--color-transfer { fill: var(--icon-transfer-color); }
80
+ &--color-job { fill: var(--icon-job-color); }
81
+ &--color-disabled { fill: var(--icon-disabled-color); }
82
+
83
+ &--disabled {
140
84
  fill: var(--icon-disabled-color);
141
85
  }
142
86
  }
143
-
144
- .wt-icon--disabled .wt-icon__icon {
145
- fill: var(--icon-disabled-color);
146
- }
147
-
148
- .wt-icon--size {
149
- &-3xl {
150
- width: var(--icon-3xl-size);
151
- height: var(--icon-3xl-size);
152
- }
153
-
154
- &-2xl {
155
- width: var(--icon-2xl-size);
156
- height: var(--icon-2xl-size);
157
- }
158
-
159
- &-xl {
160
- width: var(--icon-xl-size);
161
- height: var(--icon-xl-size);
162
- }
163
-
164
- &-lg {
165
- width: var(--icon-lg-size);
166
- height: var(--icon-lg-size);
167
- }
168
-
169
- &-md {
170
- width: var(--icon-md-size);
171
- height: var(--icon-md-size);
172
- }
173
-
174
- &-sm {
175
- width: var(--icon-sm-size);
176
- height: var(--icon-sm-size);
177
- }
178
-
179
- &-xs {
180
- width: var(--icon-xs-size);
181
- height: var(--icon-xs-size);
182
- }
183
- }
184
- </style>
87
+ </style>
@@ -38,7 +38,7 @@ const emit = defineEmits<{
38
38
  width: fit-content;
39
39
  line-height: 0;
40
40
 
41
- &:hover .wt-icon--color-default :deep(.wt-icon__icon) {
41
+ &:hover .wt-icon--color-default {
42
42
  fill: var(--icon-btn-hover-color);
43
43
  }
44
44
 
@@ -130,13 +130,13 @@ export default {
130
130
  }
131
131
 
132
132
  .wt-radio:hover {
133
- :deep(.wt-icon__icon) {
133
+ :deep(.wt-icon) {
134
134
  fill: var(--icon-btn-hover-color);
135
135
  }
136
136
  }
137
137
 
138
138
  .wt-radio--active {
139
- :deep(.wt-icon__icon) {
139
+ :deep(.wt-icon) {
140
140
  fill: var(--icon-active-color);
141
141
  }
142
142
  }
@@ -144,7 +144,7 @@ export default {
144
144
  .wt-radio--disabled {
145
145
  pointer-events: none;
146
146
 
147
- :deep(.wt-icon__icon) {
147
+ :deep(.wt-icon) {
148
148
  fill: var(--icon-disabled-color);
149
149
  }
150
150
  }
@@ -103,7 +103,7 @@
103
103
  }
104
104
 
105
105
  :deep(.multiselect--active) {
106
- .multiselect__select.multiselect__arrow .wt-icon__icon {
106
+ .multiselect__select.multiselect__arrow .wt-icon {
107
107
  fill: var(--icon-active-color);
108
108
  }
109
109
 
@@ -395,7 +395,7 @@ export default {
395
395
  &--sortable {
396
396
  cursor: pointer;
397
397
 
398
- &:hover :deep(.wt-icon__icon) {
398
+ &:hover :deep(.wt-icon) {
399
399
  fill: var(--icon-active-color);
400
400
  }
401
401
  }
@@ -326,7 +326,7 @@ const handleSelection = (row, select) => {
326
326
  &--sortable {
327
327
  cursor: pointer;
328
328
 
329
- &:hover :deep .wt-icon__icon {
329
+ &:hover :deep .wt-icon {
330
330
  fill: var(--icon-active-color);
331
331
  }
332
332
  }
@@ -0,0 +1,18 @@
1
+ export const IconColor = {
2
+ DEFAULT: 'default',
3
+ ACTIVE: 'active',
4
+ DISABLED: 'disabled',
5
+ PRIMARY: 'primary',
6
+ ERROR: 'error',
7
+ SUCCESS: 'success',
8
+ WARNING: 'warning',
9
+ ON_DARK: 'on-dark',
10
+ ON_LIGHT: 'on-light',
11
+ ON_PRIMARY: 'on-primary',
12
+ INFO: 'info',
13
+ CHAT: 'chat',
14
+ TRANSFER: 'transfer',
15
+ JOB: 'job',
16
+ } as const;
17
+
18
+ export type IconColor = (typeof IconColor)[keyof typeof IconColor];
@@ -6,6 +6,7 @@ import { ChipColor } from './ChipColor/ChipColor';
6
6
  import { ComponentSize } from './ComponentSize/ComponentSize';
7
7
  import { CrudAction } from './CrudAction/CrudAction';
8
8
  import IconAction from './IconAction/IconAction.enum.js';
9
+ import { IconColor } from './IconColor/IconColor';
9
10
  import QueueType from './QueueType/QueueType.enum.js';
10
11
  import { RelativeDatetimeValue } from './RelativeDatetimeValue/RelativeDatetimeValue';
11
12
  import TypesExportedSettings from './TypesExportedSettings/TypesExportedSettings.enum.js';
@@ -30,6 +31,7 @@ export {
30
31
  CrmSections,
31
32
  CrudAction,
32
33
  IconAction,
34
+ IconColor,
33
35
  QueueType,
34
36
  RelativeDatetimeValue,
35
37
  SupervisorSections,
@@ -68,7 +68,7 @@ export const createUserAccessStore = ({
68
68
  };
69
69
 
70
70
  const hasApplicationVisibility = (app: WtApplication) => {
71
- return hasReadAccess() || appVisibilityAccess.get(app);
71
+ return appVisibilityAccess.get(app);
72
72
  };
73
73
 
74
74
  const hasSectionVisibility = (section: UiSection, object: WtObject) => {
@@ -78,9 +78,6 @@ export const createUserAccessStore = ({
78
78
  return sectionVisibilityAccess.get(section);
79
79
  };
80
80
 
81
- const allowGlobalAccess = hasReadAccess();
82
- if (allowGlobalAccess) return true;
83
-
84
81
  const allowAppVisibility = hasApplicationVisibility(appOfSection);
85
82
  const allowObjectAccess = hasReadAccess(objectOfSection);
86
83
  const allowSectionVisibility = hasSectionVisibilityAccess(section);
@@ -12,25 +12,25 @@ const checkbox = {
12
12
  justify-content: center;
13
13
  }
14
14
 
15
- .p-checkbox-box .wt-icon__icon {
15
+ .p-checkbox-box .wt-icon {
16
16
  color: ${dt('checkbox.icon.color')};
17
17
  width: ${dt('checkbox.icon.size')};
18
18
  height: ${dt('checkbox.icon.size')};
19
19
  }
20
20
 
21
- .p-checkbox-box .wt-icon--color-active .wt-icon__icon {
21
+ .p-checkbox-box .wt-icon--color-active {
22
22
  color: ${dt('checkbox.icon.checkedColor')};
23
23
  }
24
24
 
25
- .p-checkbox-box .wt-icon--color-disabled .wt-icon__icon {
25
+ .p-checkbox-box .wt-icon--color-disabled {
26
26
  color: ${dt('checkbox.icon.disabledColor')};
27
27
  }
28
28
 
29
- .p-checkbox:hover .wt-icon--color-active .wt-icon__icon {
29
+ .p-checkbox:hover .wt-icon--color-active {
30
30
  color: ${dt('checkbox.icon.checkedHoverColor')};
31
31
  }
32
32
 
33
- .wt-checkbox:has(.wt-label:hover) .wt-icon--color-active .wt-icon__icon {
33
+ .wt-checkbox:has(.wt-label:hover) .wt-icon--color-active {
34
34
  color: ${dt('checkbox.icon.checkedHoverColor')};
35
35
  }
36
36
  `,
@@ -6,11 +6,11 @@ const generateCustomColorCss = ({ colorName, dt }) => `
6
6
  color: ${dt(`chip.${colorName}.color`)};
7
7
  }
8
8
 
9
- .p-chip-${colorName} .wt-icon .wt-icon__icon {
9
+ .p-chip-${colorName} .wt-icon {
10
10
  fill: ${dt(`chip.${colorName}.iconColor`)};
11
11
  }
12
12
 
13
- .p-chip-${colorName} .wt-icon:hover .wt-icon__icon {
13
+ .p-chip-${colorName} .wt-icon:hover {
14
14
  fill: ${dt(`chip.${colorName}.iconHoverColor`)};
15
15
  }
16
16
  `;
@@ -1,15 +1,23 @@
1
- declare const _default: import("vue").DefineComponent<{}, {
2
- color: string;
1
+ import { ComponentSize, IconColor } from '../../enums';
2
+ interface Props {
3
+ /**
4
+ * Icon name
5
+ * @example '<wt-icon icon="close"></wt-icon>'
6
+ */
3
7
  icon: string;
4
- size: string;
8
+ size?: ComponentSize;
9
+ color?: IconColor;
10
+ /**
11
+ * inserts icon name prefix between "icon" and actual icon name ("icon" prop).
12
+ * Useful for library icons extension with project-level icons with this prefix in name
13
+ */
14
+ iconPrefix?: string;
15
+ disabled?: boolean;
16
+ }
17
+ declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
18
+ color: IconColor;
19
+ size: ComponentSize;
5
20
  disabled: boolean;
6
21
  iconPrefix: string;
7
- $props: {
8
- readonly color?: string;
9
- readonly icon?: string;
10
- readonly size?: string;
11
- readonly disabled?: boolean;
12
- readonly iconPrefix?: string;
13
- };
14
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
22
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
23
  export default _default;
@@ -0,0 +1,17 @@
1
+ export declare const IconColor: {
2
+ readonly DEFAULT: "default";
3
+ readonly ACTIVE: "active";
4
+ readonly DISABLED: "disabled";
5
+ readonly PRIMARY: "primary";
6
+ readonly ERROR: "error";
7
+ readonly SUCCESS: "success";
8
+ readonly WARNING: "warning";
9
+ readonly ON_DARK: "on-dark";
10
+ readonly ON_LIGHT: "on-light";
11
+ readonly ON_PRIMARY: "on-primary";
12
+ readonly INFO: "info";
13
+ readonly CHAT: "chat";
14
+ readonly TRANSFER: "transfer";
15
+ readonly JOB: "job";
16
+ };
17
+ export type IconColor = (typeof IconColor)[keyof typeof IconColor];
@@ -6,6 +6,7 @@ import { ChipColor } from './ChipColor/ChipColor';
6
6
  import { ComponentSize } from './ComponentSize/ComponentSize';
7
7
  import { CrudAction } from './CrudAction/CrudAction';
8
8
  import IconAction from './IconAction/IconAction.enum.js';
9
+ import { IconColor } from './IconColor/IconColor';
9
10
  import QueueType from './QueueType/QueueType.enum.js';
10
11
  import { RelativeDatetimeValue } from './RelativeDatetimeValue/RelativeDatetimeValue';
11
12
  import TypesExportedSettings from './TypesExportedSettings/TypesExportedSettings.enum.js';
@@ -17,4 +18,4 @@ import WebitelApplications from './WebitelApplications/WebitelApplications.enum.
17
18
  import { WtApplication } from './WebitelApplications/WtApplication';
18
19
  import { WtObject } from './WtObject/WtObject';
19
20
  import { WtTypeExtensionFieldKind } from './WtTypeExtensionFieldKind/WtTypeExtensionFieldKind';
20
- export { AbstractUserStatus, AdminSections, AgentStatus, AuditorSections, ButtonColor, ChatGatewayProvider, ChipColor, ComponentSize, CrmSections, CrudAction, IconAction, QueueType, RelativeDatetimeValue, SupervisorSections, TypesExportedSettings, WebitelApplications, WtApplication, WtObject, WtTypeExtensionFieldKind, };
21
+ export { AbstractUserStatus, AdminSections, AgentStatus, AuditorSections, ButtonColor, ChatGatewayProvider, ChipColor, ComponentSize, CrmSections, CrudAction, IconAction, IconColor, QueueType, RelativeDatetimeValue, SupervisorSections, TypesExportedSettings, WebitelApplications, WtApplication, WtObject, WtTypeExtensionFieldKind, };