@webitel/ui-sdk 26.8.102 → 26.8.103

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": "26.8.102",
3
+ "version": "26.8.103",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "npm run docs:dev",
@@ -2,6 +2,7 @@
2
2
  <wt-popup
3
3
  v-bind="$attrs"
4
4
  :shown="file"
5
+ size="md"
5
6
  class="wt-upload-csv-popup"
6
7
  @close="close"
7
8
  >
@@ -62,14 +63,10 @@
62
63
  <!-- FIELDS MAPPING -->
63
64
  <div class="wt-upload-csv-popup-mapping">
64
65
  <div class="wt-upload-csv-popup-mapping-item">
65
- <p
66
- class="wt-upload-csv-popup-mapping-item__field typo-subtitle-1"
67
- >
66
+ <p class="wt-upload-csv-popup-mapping-item__field typo-subtitle-1">
68
67
  {{ t('objects.CSV.fieldName') }}
69
68
  </p>
70
- <p
71
- class="wt-upload-csv-popup-mapping-item__field typo-subtitle-1"
72
- >
69
+ <p class="wt-upload-csv-popup-mapping-item__field typo-subtitle-1">
73
70
  {{ t('objects.CSV.CSVColumn') }}
74
71
  </p>
75
72
  </div>
@@ -134,77 +131,76 @@
134
131
  </wt-popup>
135
132
  </template>
136
133
 
137
- <script setup lang="ts">
134
+ <script
135
+ setup
136
+ lang="ts"
137
+ >
138
138
  import { ref, toRefs } from 'vue';
139
139
  import { useI18n } from 'vue-i18n';
140
140
 
141
141
  import useUploadCsv, {
142
- type UseUploadCsvProps,
142
+ type UseUploadCsvProps,
143
143
  } from '../composable/useUploadCsv';
144
144
  import type { CsvMappingField } from '../scripts/normalizeCSVData';
145
145
  import HandlingCSVMode from '../types/WtUploadCSVHandlingMode.enum';
146
146
 
147
147
  interface CharsetOption {
148
- name: string;
149
- value: string;
148
+ name: string;
149
+ value: string;
150
150
  }
151
151
 
152
152
  interface Props extends UseUploadCsvProps {
153
- file: File | null;
154
- mappingFields: CsvMappingField[];
153
+ file: File | null;
154
+ mappingFields: CsvMappingField[];
155
155
  }
156
156
 
157
157
  const props = withDefaults(defineProps<Props>(), {
158
- file: null,
159
- mappingFields: () => [],
160
- handlingMode: HandlingCSVMode.PROCESS,
158
+ file: null,
159
+ mappingFields: () => [],
160
+ handlingMode: HandlingCSVMode.PROCESS,
161
161
  });
162
162
 
163
163
  const emit = defineEmits<{
164
- (e: 'changeMappingFields', value: unknown[]): void;
165
- (e: 'save'): void;
166
- (e: 'close'): void;
164
+ (e: 'changeMappingFields', value: unknown[]): void;
165
+ (e: 'save'): void;
166
+ (e: 'close'): void;
167
167
  }>();
168
168
 
169
169
  const { t } = useI18n();
170
170
 
171
171
  const getFieldLabel = (field: CsvMappingField) =>
172
- field.locale ? t(field.locale) : field.name;
172
+ field.locale ? t(field.locale) : field.name;
173
173
 
174
174
  const skipHeaders = ref(true);
175
175
  const separator = ref(',');
176
176
  const charsetOptions = ref<CharsetOption[]>([]);
177
177
  const charset = ref<CharsetOption>({
178
- name: 'UTF-8',
179
- value: 'utf-8',
178
+ name: 'UTF-8',
179
+ value: 'utf-8',
180
180
  });
181
181
 
182
182
  const { file, mappingFields } = toRefs(props);
183
183
 
184
184
  const {
185
- isReadingFile,
186
- isParsingCSV,
187
- isParsingPreview,
188
- csvPreviewTableData,
189
- csvPreviewTableHeaders,
190
- csvColumns,
191
- allowSaveAction,
192
- processCSV,
193
- close,
185
+ isReadingFile,
186
+ isParsingCSV,
187
+ isParsingPreview,
188
+ csvPreviewTableData,
189
+ csvPreviewTableHeaders,
190
+ csvColumns,
191
+ allowSaveAction,
192
+ processCSV,
193
+ close,
194
194
  } = useUploadCsv({
195
- props,
196
- emit,
197
- skipHeaders,
198
- separator,
195
+ props,
196
+ emit,
197
+ skipHeaders,
198
+ separator,
199
199
  });
200
200
  </script>
201
201
 
202
- <style lang="scss">
202
+ <style scoped>
203
203
  .wt-upload-csv-popup {
204
- :deep(.wt-popup__popup) {
205
- min-height: 40vh;
206
- }
207
-
208
204
  .wt-upload-csv-popup__reading-file-loader {
209
205
  position: absolute;
210
206
  top: 50%;
@@ -228,7 +224,6 @@ const {
228
224
 
229
225
  .wt-upload-csv-popup-form__file-preview .wt-table {
230
226
  overflow: auto;
231
- max-width: 60vw;
232
227
  }
233
228
 
234
229
  .wt-upload-csv-popup-mapping {
@@ -240,15 +235,15 @@ const {
240
235
  grid-column-gap: 20px;
241
236
  grid-row-gap: 10px;
242
237
  margin-bottom: var(--spacing-sm);
238
+ }
243
239
 
244
- &__field {
245
- align-self: center;
246
- }
240
+ .wt-upload-csv-popup-mapping-item__field {
241
+ align-self: center;
242
+ }
247
243
 
248
- &__select :deep(.wt-label),
249
- &__select :deep(.wt-input-info) {
250
- display: none;
251
- }
244
+ .wt-upload-csv-popup-mapping-item__select :deep(.wt-label),
245
+ .wt-upload-csv-popup-mapping-item__select :deep(.wt-input-info) {
246
+ display: none;
252
247
  }
253
248
  }
254
249
  }
@@ -226,6 +226,7 @@ const useUploadCsv = ({
226
226
  (file) => {
227
227
  if (file) initUploadPopup();
228
228
  },
229
+ { immediate: true }, // if popup has v-if=file
229
230
  );
230
231
 
231
232
  return {