@winchsa/ui 0.1.19 → 0.1.23

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.
@@ -15,6 +15,7 @@ defineProps({
15
15
 
16
16
  <VMenu
17
17
  activator="parent"
18
+ scroll-strategy="close"
18
19
  >
19
20
  <slot>
20
21
  <VList
@@ -39,12 +39,12 @@ declare const __VLS_self: import("vue").DefineComponent<__VLS_Props, {
39
39
  triggerRefresh: typeof triggerRefresh;
40
40
  triggeredRemove: typeof triggeredRemove;
41
41
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
42
- collapsed: (isContentCollapsed: boolean) => any;
43
42
  refresh: (hideOverlay: () => void) => any;
43
+ collapsed: (isContentCollapsed: boolean) => any;
44
44
  trash: () => any;
45
45
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
46
- onCollapsed?: ((isContentCollapsed: boolean) => any) | undefined;
47
46
  onRefresh?: ((hideOverlay: () => void) => any) | undefined;
47
+ onCollapsed?: ((isContentCollapsed: boolean) => any) | undefined;
48
48
  onTrash?: (() => any) | undefined;
49
49
  }>, {
50
50
  title: string;
@@ -55,12 +55,12 @@ declare const __VLS_self: import("vue").DefineComponent<__VLS_Props, {
55
55
  actionRemove: boolean;
56
56
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
57
57
  declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
58
- collapsed: (isContentCollapsed: boolean) => any;
59
58
  refresh: (hideOverlay: () => void) => any;
59
+ collapsed: (isContentCollapsed: boolean) => any;
60
60
  trash: () => any;
61
61
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
62
- onCollapsed?: ((isContentCollapsed: boolean) => any) | undefined;
63
62
  onRefresh?: ((hideOverlay: () => void) => any) | undefined;
63
+ onCollapsed?: ((isContentCollapsed: boolean) => any) | undefined;
64
64
  onTrash?: (() => any) | undefined;
65
65
  }>, {
66
66
  title: string;
@@ -39,12 +39,12 @@ declare const __VLS_self: import("vue").DefineComponent<__VLS_Props, {
39
39
  triggerRefresh: typeof triggerRefresh;
40
40
  triggeredRemove: typeof triggeredRemove;
41
41
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
42
- collapsed: (isContentCollapsed: boolean) => any;
43
42
  refresh: (hideOverlay: () => void) => any;
43
+ collapsed: (isContentCollapsed: boolean) => any;
44
44
  trash: () => any;
45
45
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
46
- onCollapsed?: ((isContentCollapsed: boolean) => any) | undefined;
47
46
  onRefresh?: ((hideOverlay: () => void) => any) | undefined;
47
+ onCollapsed?: ((isContentCollapsed: boolean) => any) | undefined;
48
48
  onTrash?: (() => any) | undefined;
49
49
  }>, {
50
50
  title: string;
@@ -55,12 +55,12 @@ declare const __VLS_self: import("vue").DefineComponent<__VLS_Props, {
55
55
  actionRemove: boolean;
56
56
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
57
57
  declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
58
- collapsed: (isContentCollapsed: boolean) => any;
59
58
  refresh: (hideOverlay: () => void) => any;
59
+ collapsed: (isContentCollapsed: boolean) => any;
60
60
  trash: () => any;
61
61
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
62
- onCollapsed?: ((isContentCollapsed: boolean) => any) | undefined;
63
62
  onRefresh?: ((hideOverlay: () => void) => any) | undefined;
63
+ onCollapsed?: ((isContentCollapsed: boolean) => any) | undefined;
64
64
  onTrash?: (() => any) | undefined;
65
65
  }>, {
66
66
  title: string;
@@ -550,7 +550,7 @@ declare const refSearchList: import("vue").Ref<({
550
550
  } & {
551
551
  item: unknown;
552
552
  }) => import("vue").VNodeChild) | undefined;
553
- append?: ((arg: {
553
+ prepend?: ((arg: {
554
554
  isActive: boolean;
555
555
  isSelected: boolean;
556
556
  isIndeterminate: boolean;
@@ -558,7 +558,7 @@ declare const refSearchList: import("vue").Ref<({
558
558
  } & {
559
559
  item: unknown;
560
560
  }) => import("vue").VNodeChild) | undefined;
561
- prepend?: ((arg: {
561
+ append?: ((arg: {
562
562
  isActive: boolean;
563
563
  isSelected: boolean;
564
564
  isIndeterminate: boolean;
@@ -607,7 +607,7 @@ declare const refSearchList: import("vue").Ref<({
607
607
  } & {
608
608
  item: unknown;
609
609
  }) => import("vue").VNodeChild) | undefined;
610
- append?: false | ((arg: {
610
+ prepend?: false | ((arg: {
611
611
  isActive: boolean;
612
612
  isSelected: boolean;
613
613
  isIndeterminate: boolean;
@@ -615,7 +615,7 @@ declare const refSearchList: import("vue").Ref<({
615
615
  } & {
616
616
  item: unknown;
617
617
  }) => import("vue").VNodeChild) | undefined;
618
- prepend?: false | ((arg: {
618
+ append?: false | ((arg: {
619
619
  isActive: boolean;
620
620
  isSelected: boolean;
621
621
  isIndeterminate: boolean;
@@ -664,7 +664,7 @@ declare const refSearchList: import("vue").Ref<({
664
664
  } & {
665
665
  item: unknown;
666
666
  }) => import("vue").VNodeChild) | undefined;
667
- "v-slot:append"?: false | ((arg: {
667
+ "v-slot:prepend"?: false | ((arg: {
668
668
  isActive: boolean;
669
669
  isSelected: boolean;
670
670
  isIndeterminate: boolean;
@@ -672,7 +672,7 @@ declare const refSearchList: import("vue").Ref<({
672
672
  } & {
673
673
  item: unknown;
674
674
  }) => import("vue").VNodeChild) | undefined;
675
- "v-slot:prepend"?: false | ((arg: {
675
+ "v-slot:append"?: false | ((arg: {
676
676
  isActive: boolean;
677
677
  isSelected: boolean;
678
678
  isIndeterminate: boolean;
@@ -721,7 +721,7 @@ declare const refSearchList: import("vue").Ref<({
721
721
  } & {
722
722
  item: unknown;
723
723
  }) => import("vue").VNode[];
724
- append: (arg: {
724
+ prepend: (arg: {
725
725
  isActive: boolean;
726
726
  isSelected: boolean;
727
727
  isIndeterminate: boolean;
@@ -729,7 +729,7 @@ declare const refSearchList: import("vue").Ref<({
729
729
  } & {
730
730
  item: unknown;
731
731
  }) => import("vue").VNode[];
732
- prepend: (arg: {
732
+ append: (arg: {
733
733
  isActive: boolean;
734
734
  isSelected: boolean;
735
735
  isIndeterminate: boolean;
@@ -1299,7 +1299,7 @@ declare const refSearchList: import("vue").Ref<({
1299
1299
  } & {
1300
1300
  item: unknown;
1301
1301
  }) => import("vue").VNodeChild) | undefined;
1302
- append?: ((arg: {
1302
+ prepend?: ((arg: {
1303
1303
  isActive: boolean;
1304
1304
  isSelected: boolean;
1305
1305
  isIndeterminate: boolean;
@@ -1307,7 +1307,7 @@ declare const refSearchList: import("vue").Ref<({
1307
1307
  } & {
1308
1308
  item: unknown;
1309
1309
  }) => import("vue").VNodeChild) | undefined;
1310
- prepend?: ((arg: {
1310
+ append?: ((arg: {
1311
1311
  isActive: boolean;
1312
1312
  isSelected: boolean;
1313
1313
  isIndeterminate: boolean;
@@ -1356,7 +1356,7 @@ declare const refSearchList: import("vue").Ref<({
1356
1356
  } & {
1357
1357
  item: unknown;
1358
1358
  }) => import("vue").VNodeChild) | undefined;
1359
- append?: false | ((arg: {
1359
+ prepend?: false | ((arg: {
1360
1360
  isActive: boolean;
1361
1361
  isSelected: boolean;
1362
1362
  isIndeterminate: boolean;
@@ -1364,7 +1364,7 @@ declare const refSearchList: import("vue").Ref<({
1364
1364
  } & {
1365
1365
  item: unknown;
1366
1366
  }) => import("vue").VNodeChild) | undefined;
1367
- prepend?: false | ((arg: {
1367
+ append?: false | ((arg: {
1368
1368
  isActive: boolean;
1369
1369
  isSelected: boolean;
1370
1370
  isIndeterminate: boolean;
@@ -1413,7 +1413,7 @@ declare const refSearchList: import("vue").Ref<({
1413
1413
  } & {
1414
1414
  item: unknown;
1415
1415
  }) => import("vue").VNodeChild) | undefined;
1416
- "v-slot:append"?: false | ((arg: {
1416
+ "v-slot:prepend"?: false | ((arg: {
1417
1417
  isActive: boolean;
1418
1418
  isSelected: boolean;
1419
1419
  isIndeterminate: boolean;
@@ -1421,7 +1421,7 @@ declare const refSearchList: import("vue").Ref<({
1421
1421
  } & {
1422
1422
  item: unknown;
1423
1423
  }) => import("vue").VNodeChild) | undefined;
1424
- "v-slot:prepend"?: false | ((arg: {
1424
+ "v-slot:append"?: false | ((arg: {
1425
1425
  isActive: boolean;
1426
1426
  isSelected: boolean;
1427
1427
  isIndeterminate: boolean;
@@ -1470,7 +1470,7 @@ declare const refSearchList: import("vue").Ref<({
1470
1470
  } & {
1471
1471
  item: unknown;
1472
1472
  }) => import("vue").VNode[];
1473
- append: (arg: {
1473
+ prepend: (arg: {
1474
1474
  isActive: boolean;
1475
1475
  isSelected: boolean;
1476
1476
  isIndeterminate: boolean;
@@ -1478,7 +1478,7 @@ declare const refSearchList: import("vue").Ref<({
1478
1478
  } & {
1479
1479
  item: unknown;
1480
1480
  }) => import("vue").VNode[];
1481
- prepend: (arg: {
1481
+ append: (arg: {
1482
1482
  isActive: boolean;
1483
1483
  isSelected: boolean;
1484
1484
  isIndeterminate: boolean;
@@ -550,7 +550,7 @@ declare const refSearchList: import("vue").Ref<({
550
550
  } & {
551
551
  item: unknown;
552
552
  }) => import("vue").VNodeChild) | undefined;
553
- append?: ((arg: {
553
+ prepend?: ((arg: {
554
554
  isActive: boolean;
555
555
  isSelected: boolean;
556
556
  isIndeterminate: boolean;
@@ -558,7 +558,7 @@ declare const refSearchList: import("vue").Ref<({
558
558
  } & {
559
559
  item: unknown;
560
560
  }) => import("vue").VNodeChild) | undefined;
561
- prepend?: ((arg: {
561
+ append?: ((arg: {
562
562
  isActive: boolean;
563
563
  isSelected: boolean;
564
564
  isIndeterminate: boolean;
@@ -607,7 +607,7 @@ declare const refSearchList: import("vue").Ref<({
607
607
  } & {
608
608
  item: unknown;
609
609
  }) => import("vue").VNodeChild) | undefined;
610
- append?: false | ((arg: {
610
+ prepend?: false | ((arg: {
611
611
  isActive: boolean;
612
612
  isSelected: boolean;
613
613
  isIndeterminate: boolean;
@@ -615,7 +615,7 @@ declare const refSearchList: import("vue").Ref<({
615
615
  } & {
616
616
  item: unknown;
617
617
  }) => import("vue").VNodeChild) | undefined;
618
- prepend?: false | ((arg: {
618
+ append?: false | ((arg: {
619
619
  isActive: boolean;
620
620
  isSelected: boolean;
621
621
  isIndeterminate: boolean;
@@ -664,7 +664,7 @@ declare const refSearchList: import("vue").Ref<({
664
664
  } & {
665
665
  item: unknown;
666
666
  }) => import("vue").VNodeChild) | undefined;
667
- "v-slot:append"?: false | ((arg: {
667
+ "v-slot:prepend"?: false | ((arg: {
668
668
  isActive: boolean;
669
669
  isSelected: boolean;
670
670
  isIndeterminate: boolean;
@@ -672,7 +672,7 @@ declare const refSearchList: import("vue").Ref<({
672
672
  } & {
673
673
  item: unknown;
674
674
  }) => import("vue").VNodeChild) | undefined;
675
- "v-slot:prepend"?: false | ((arg: {
675
+ "v-slot:append"?: false | ((arg: {
676
676
  isActive: boolean;
677
677
  isSelected: boolean;
678
678
  isIndeterminate: boolean;
@@ -721,7 +721,7 @@ declare const refSearchList: import("vue").Ref<({
721
721
  } & {
722
722
  item: unknown;
723
723
  }) => import("vue").VNode[];
724
- append: (arg: {
724
+ prepend: (arg: {
725
725
  isActive: boolean;
726
726
  isSelected: boolean;
727
727
  isIndeterminate: boolean;
@@ -729,7 +729,7 @@ declare const refSearchList: import("vue").Ref<({
729
729
  } & {
730
730
  item: unknown;
731
731
  }) => import("vue").VNode[];
732
- prepend: (arg: {
732
+ append: (arg: {
733
733
  isActive: boolean;
734
734
  isSelected: boolean;
735
735
  isIndeterminate: boolean;
@@ -1299,7 +1299,7 @@ declare const refSearchList: import("vue").Ref<({
1299
1299
  } & {
1300
1300
  item: unknown;
1301
1301
  }) => import("vue").VNodeChild) | undefined;
1302
- append?: ((arg: {
1302
+ prepend?: ((arg: {
1303
1303
  isActive: boolean;
1304
1304
  isSelected: boolean;
1305
1305
  isIndeterminate: boolean;
@@ -1307,7 +1307,7 @@ declare const refSearchList: import("vue").Ref<({
1307
1307
  } & {
1308
1308
  item: unknown;
1309
1309
  }) => import("vue").VNodeChild) | undefined;
1310
- prepend?: ((arg: {
1310
+ append?: ((arg: {
1311
1311
  isActive: boolean;
1312
1312
  isSelected: boolean;
1313
1313
  isIndeterminate: boolean;
@@ -1356,7 +1356,7 @@ declare const refSearchList: import("vue").Ref<({
1356
1356
  } & {
1357
1357
  item: unknown;
1358
1358
  }) => import("vue").VNodeChild) | undefined;
1359
- append?: false | ((arg: {
1359
+ prepend?: false | ((arg: {
1360
1360
  isActive: boolean;
1361
1361
  isSelected: boolean;
1362
1362
  isIndeterminate: boolean;
@@ -1364,7 +1364,7 @@ declare const refSearchList: import("vue").Ref<({
1364
1364
  } & {
1365
1365
  item: unknown;
1366
1366
  }) => import("vue").VNodeChild) | undefined;
1367
- prepend?: false | ((arg: {
1367
+ append?: false | ((arg: {
1368
1368
  isActive: boolean;
1369
1369
  isSelected: boolean;
1370
1370
  isIndeterminate: boolean;
@@ -1413,7 +1413,7 @@ declare const refSearchList: import("vue").Ref<({
1413
1413
  } & {
1414
1414
  item: unknown;
1415
1415
  }) => import("vue").VNodeChild) | undefined;
1416
- "v-slot:append"?: false | ((arg: {
1416
+ "v-slot:prepend"?: false | ((arg: {
1417
1417
  isActive: boolean;
1418
1418
  isSelected: boolean;
1419
1419
  isIndeterminate: boolean;
@@ -1421,7 +1421,7 @@ declare const refSearchList: import("vue").Ref<({
1421
1421
  } & {
1422
1422
  item: unknown;
1423
1423
  }) => import("vue").VNodeChild) | undefined;
1424
- "v-slot:prepend"?: false | ((arg: {
1424
+ "v-slot:append"?: false | ((arg: {
1425
1425
  isActive: boolean;
1426
1426
  isSelected: boolean;
1427
1427
  isIndeterminate: boolean;
@@ -1470,7 +1470,7 @@ declare const refSearchList: import("vue").Ref<({
1470
1470
  } & {
1471
1471
  item: unknown;
1472
1472
  }) => import("vue").VNode[];
1473
- append: (arg: {
1473
+ prepend: (arg: {
1474
1474
  isActive: boolean;
1475
1475
  isSelected: boolean;
1476
1476
  isIndeterminate: boolean;
@@ -1478,7 +1478,7 @@ declare const refSearchList: import("vue").Ref<({
1478
1478
  } & {
1479
1479
  item: unknown;
1480
1480
  }) => import("vue").VNode[];
1481
- prepend: (arg: {
1481
+ append: (arg: {
1482
1482
  isActive: boolean;
1483
1483
  isSelected: boolean;
1484
1484
  isIndeterminate: boolean;
@@ -18,6 +18,8 @@ import FilterGenerator from "./FilterGenerator.vue";
18
18
  import TablePagination from "./TablePagination.vue";
19
19
  const { t } = useI18n();
20
20
  const { showValidationAlert } = responseAlert();
21
+ const route = useRoute();
22
+ const router = useRouter();
21
23
  const pageSizeOptions = [
22
24
  { value: 30, title: "30" },
23
25
  { value: 60, title: "60" },
@@ -31,12 +33,17 @@ const props = defineProps({
31
33
  queryParams: { type: Object, required: false, default: () => ({}) },
32
34
  enableButtons: { type: Boolean, required: false, default: false },
33
35
  enableButtonsFilter: { type: Boolean, required: false, default: true },
36
+ enablePageSizeOptions: { type: Boolean, required: false, default: true },
37
+ enableActionButtons: { type: Boolean, required: false, default: true },
38
+ enableBaseButtons: { type: Boolean, required: false, default: true },
34
39
  secondaryStyle: { type: Boolean, required: false },
35
40
  replaceNullWithDash: { type: Boolean, required: false, default: true },
36
- withoutQueryParams: { type: Boolean, required: false, default: false }
41
+ withoutQueryParams: { type: Boolean, required: false, default: false },
42
+ showSelect: { type: Boolean, required: false },
43
+ returnObject: { type: Boolean, required: false, default: false },
44
+ stickyActions: { type: Boolean, required: false, default: false }
37
45
  });
38
- const route = useRoute();
39
- const router = useRouter();
46
+ const modelValue = defineModel({ type: Array, ...{ default: [] } });
40
47
  const { processedFormFilters, filters, urlQueryParams } = useTableFilters({
41
48
  formFilters: computed(() => props.formFilters),
42
49
  syncFiltersWithUrl: !props.withoutQueryParams
@@ -155,9 +162,14 @@ defineExpose({
155
162
  <VDivider v-if="hasFilters" />
156
163
 
157
164
  <!-- options and buttons -->
158
- <VCardText v-if="enableButtonsFilter" class="d-flex flex-wrap py-4 gap-4">
165
+ <VCardText
166
+ v-if="enablePageSizeOptions || enableActionButtons"
167
+ :class="['d-flex flex-wrap py-4 gap-4', {
168
+ 'sticky-actions': stickyActions
169
+ }]"
170
+ >
159
171
  <!-- Page Size options -->
160
- <div class="me-3 d-flex gap-3">
172
+ <div v-if="enablePageSizeOptions" class="me-3 d-flex gap-3">
161
173
  <AppSelect
162
174
  hide-details
163
175
  :model-value="itemsPerPage"
@@ -170,36 +182,40 @@ defineExpose({
170
182
  <VSpacer />
171
183
 
172
184
  <!-- buttons -->
173
- <div class="d-flex align-center table-buttons">
174
- <slot name="buttons-action" />
185
+ <div v-if="enableActionButtons" class="d-flex align-center table-buttons">
186
+ <slot name="action-buttons" />
175
187
 
176
- <BaseButton
177
- size="38"
178
- color="secondary"
179
- class="ms-2"
180
- @click="reset"
181
- >
182
- <VIcon
183
- icon="tabler-filter-x"
184
- size="22"
185
- />
186
- </BaseButton>
188
+ <template v-if="enableBaseButtons">
189
+ <BaseButton
190
+ size="38"
191
+ color="secondary"
192
+ class="ms-2"
193
+ @click="reset"
194
+ >
195
+ <VIcon
196
+ icon="tabler-filter-x"
197
+ size="22"
198
+ />
199
+ </BaseButton>
187
200
 
188
- <BaseButton
189
- size="38"
190
- color="secondary"
191
- class="ms-2"
192
- @click="refresh"
193
- >
194
- <VIcon
195
- icon="tabler-refresh"
196
- size="22"
197
- />
198
- </BaseButton>
201
+ <BaseButton
202
+ size="38"
203
+ color="secondary"
204
+ class="ms-2"
205
+ @click="refresh"
206
+ >
207
+ <VIcon
208
+ icon="tabler-refresh"
209
+ size="22"
210
+ />
211
+ </BaseButton>
212
+ </template>
199
213
  </div>
200
214
  </VCardText>
201
215
 
202
- <VDivider v-if="enableButtonsFilter" />
216
+ <VDivider v-if="enableButtonsFilter" :class="{
217
+ 'sticky-divider': stickyActions
218
+ }" />
203
219
 
204
220
  <div :class="[!useIsMobile().value || 'overflow-auto app-h-fit', {
205
221
  'secondary-table': secondaryStyle,
@@ -207,6 +223,7 @@ defineExpose({
207
223
  }]">
208
224
  <!-- table -->
209
225
  <VDataTableServer
226
+ v-model="modelValue"
210
227
  :class="{
211
228
  'mt-5 px-5': secondaryStyle
212
229
  }"
@@ -216,6 +233,8 @@ defineExpose({
216
233
  :loading="isLoading"
217
234
  :no-data-text="t('no_data')"
218
235
  :fixed-header="useIsMobile().value"
236
+ :show-select="showSelect"
237
+ :return-object="returnObject"
219
238
  >
220
239
  <!-- columns -->
221
240
  <template v-for="(_, name) in $slots" #[name]="slotProps">
@@ -255,6 +274,21 @@ defineExpose({
255
274
  </template>
256
275
 
257
276
  <style scoped>
277
+ .sticky-actions {
278
+ position: sticky !important;
279
+ position: -webkit-sticky;
280
+ top: 90px;
281
+ z-index: 11 !important;
282
+ background-color: rgb(var(--v-theme-surface)) !important;
283
+ }
284
+
285
+ .sticky-divider {
286
+ position: sticky !important;
287
+ position: -webkit-sticky;
288
+ top: 146px;
289
+ z-index: 11 !important;
290
+ }
291
+
258
292
  :deep(.v-table) .v-table__wrapper > table > tbody > tr > td,
259
293
  :deep(.v-table) .v-table__wrapper > table > tbody > tr > th {
260
294
  border-bottom: 8px solid rgba(var(--v-table-divider)) !important;
@@ -272,6 +306,10 @@ defineExpose({
272
306
  padding-bottom: 0.75rem;
273
307
  }
274
308
 
309
+ .sticky-actions ~ div :deep(table) tr th {
310
+ top: 146px !important;
311
+ }
312
+
275
313
  .table-buttons .v-btn .v-btn__overlay {
276
314
  display: none !important;
277
315
  }
@@ -307,6 +345,10 @@ defineExpose({
307
345
  border-bottom: 1px solid rgba(var(--v-theme-silver)) !important;
308
346
  }
309
347
 
348
+ .sticky-actions ~ div .secondary-table :deep(table) th {
349
+ top: 156px !important;
350
+ }
351
+
310
352
  :deep(.v-overlay) {
311
353
  z-index: 500 !important;
312
354
  }
@@ -13,12 +13,12 @@ const clientInstance = _ofetch.ofetch.create({
13
13
  async function apiRequest(method, path, options) {
14
14
  const baseUrl = process.env.VITE_BASE_API;
15
15
  const prefix = process.env.VITE_APP_TYPE;
16
+ const token = localStorage.getItem("token");
16
17
  const {
17
18
  ignoreUrlPrefix,
18
19
  headers,
19
20
  ...restOptions
20
21
  } = options || {};
21
- const token = localStorage.getItem("token");
22
22
  return clientInstance(path, {
23
23
  method,
24
24
  baseURL: ignoreUrlPrefix ? baseUrl : `${baseUrl}/${prefix}`,
@@ -26,7 +26,7 @@ async function apiRequest(method, path, options) {
26
26
  headers: {
27
27
  "Accept": "application/json",
28
28
  "X-Requested-With": "XMLHttpRequest",
29
- "Accept-Language": localStorage.getItem("token"),
29
+ "Accept-Language": localStorage.getItem("winch-lang"),
30
30
  "User-Platform": "web",
31
31
  ...(token && {
32
32
  Authorization: `Bearer ${token}`
@@ -5,8 +5,8 @@ const clientInstance = ofetch.create({ credentials: "include" });
5
5
  async function apiRequest(method, path, options) {
6
6
  const baseUrl = import.meta.env.VITE_BASE_API;
7
7
  const prefix = import.meta.env.VITE_APP_TYPE;
8
- const { ignoreUrlPrefix, headers, ...restOptions } = options || {};
9
8
  const token = localStorage.getItem("token");
9
+ const { ignoreUrlPrefix, headers, ...restOptions } = options || {};
10
10
  return clientInstance(path, {
11
11
  method,
12
12
  baseURL: ignoreUrlPrefix ? baseUrl : `${baseUrl}/${prefix}`,
@@ -14,7 +14,7 @@ async function apiRequest(method, path, options) {
14
14
  headers: {
15
15
  "Accept": "application/json",
16
16
  "X-Requested-With": "XMLHttpRequest",
17
- "Accept-Language": localStorage.getItem("token"),
17
+ "Accept-Language": localStorage.getItem("winch-lang"),
18
18
  "User-Platform": "web",
19
19
  ...token && { Authorization: `Bearer ${token}` },
20
20
  ...headers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@winchsa/ui",
3
- "version": "0.1.19",
3
+ "version": "0.1.23",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "publishConfig": {