@winchsa/ui 0.1.39 → 0.1.41

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,12 +15,12 @@ type __VLS_Slots = {} & {
15
15
  default?: (props: typeof __VLS_76) => any;
16
16
  };
17
17
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
18
- refresh: (hideOverlay: () => void) => any;
19
18
  collapsed: (isContentCollapsed: boolean) => any;
19
+ refresh: (hideOverlay: () => void) => any;
20
20
  trash: () => any;
21
21
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
22
- onRefresh?: ((hideOverlay: () => void) => any) | undefined;
23
22
  onCollapsed?: ((isContentCollapsed: boolean) => any) | undefined;
23
+ onRefresh?: ((hideOverlay: () => void) => any) | undefined;
24
24
  onTrash?: (() => any) | undefined;
25
25
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
26
26
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -15,12 +15,12 @@ type __VLS_Slots = {} & {
15
15
  default?: (props: typeof __VLS_76) => any;
16
16
  };
17
17
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
18
- refresh: (hideOverlay: () => void) => any;
19
18
  collapsed: (isContentCollapsed: boolean) => any;
19
+ refresh: (hideOverlay: () => void) => any;
20
20
  trash: () => any;
21
21
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
22
- onRefresh?: ((hideOverlay: () => void) => any) | undefined;
23
22
  onCollapsed?: ((isContentCollapsed: boolean) => any) | undefined;
23
+ onRefresh?: ((hideOverlay: () => void) => any) | undefined;
24
24
  onTrash?: (() => any) | undefined;
25
25
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
26
26
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -6,9 +6,11 @@ type __VLS_Props = {
6
6
  disabled?: boolean;
7
7
  info?: string;
8
8
  };
9
- declare var __VLS_12: {};
9
+ declare var __VLS_1: {}, __VLS_14: {};
10
10
  type __VLS_Slots = {} & {
11
- default?: (props: typeof __VLS_12) => any;
11
+ title?: (props: typeof __VLS_1) => any;
12
+ } & {
13
+ default?: (props: typeof __VLS_14) => any;
12
14
  };
13
15
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
16
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -16,9 +16,11 @@ const colorStyle = computed(() => props.color ? `text-${props.color}` : "");
16
16
 
17
17
  <template>
18
18
  <div>
19
- <VLabel v-if="title" class="text-subtitle-2 text-capitalize">
20
- {{ title }}
21
- </VLabel>
19
+ <slot name="title">
20
+ <VLabel v-if="title" class="text-subtitle-2 text-capitalize">
21
+ {{ title }}
22
+ </VLabel>
23
+ </slot>
22
24
 
23
25
  <AppCard
24
26
  class="border px-4 py-0 mt-2 text-subtitle-2 d-flex align-center app-input-card"
@@ -6,9 +6,11 @@ type __VLS_Props = {
6
6
  disabled?: boolean;
7
7
  info?: string;
8
8
  };
9
- declare var __VLS_12: {};
9
+ declare var __VLS_1: {}, __VLS_14: {};
10
10
  type __VLS_Slots = {} & {
11
- default?: (props: typeof __VLS_12) => any;
11
+ title?: (props: typeof __VLS_1) => any;
12
+ } & {
13
+ default?: (props: typeof __VLS_14) => any;
12
14
  };
13
15
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
16
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -1,3 +1,7 @@
1
+ type __VLS_Props = {
2
+ to?: string | object;
3
+ withoutDefaultClass?: boolean;
4
+ };
1
5
  declare var __VLS_1: {}, __VLS_10: {}, __VLS_12: {};
2
6
  type __VLS_Slots = {} & {
3
7
  default?: (props: typeof __VLS_1) => any;
@@ -6,9 +10,7 @@ type __VLS_Slots = {} & {
6
10
  } & {
7
11
  default?: (props: typeof __VLS_12) => any;
8
12
  };
9
- declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {} | {
10
- [x: string]: any;
11
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
13
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
14
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
13
15
  declare const _default: typeof __VLS_export;
14
16
  export default _default;
@@ -1,49 +1,48 @@
1
1
  <script setup>
2
2
  import { RouterLink } from "vue-router";
3
- import { computed } from "vue";
4
- defineOptions({
5
- inheritAttrs: false
6
- });
3
+ import { computed, useAttrs } from "vue";
4
+ const attrs = useAttrs();
7
5
  const props = defineProps({
8
- // @ts-ignore
9
- ...RouterLink.props,
10
- to: {
11
- type: [String, Object],
12
- default: void 0
13
- },
14
- withoutDefaultClass: {
15
- type: Boolean,
16
- default: false
17
- }
6
+ to: { type: [String, Object], required: false, default: void 0 },
7
+ withoutDefaultClass: { type: Boolean, required: false, default: false }
18
8
  });
19
9
  const isExternalLink = computed(() => {
20
- return typeof props.to === "string" && (props.to.startsWith("http") || props.to.startsWith("https"));
10
+ return typeof props.to === "string" && (props.to.startsWith("http://") || props.to.startsWith("https://"));
11
+ });
12
+ const hrefValue = computed(() => {
13
+ return typeof props.to === "string" ? props.to : "";
21
14
  });
22
15
  </script>
23
16
 
24
17
  <template>
25
18
  <a
26
19
  v-if="isExternalLink"
27
- v-bind="$attrs"
28
- :href="to"
29
- target="_blank"
30
- :class="[{ 'hover-underline': !withoutDefaultClass }, ...($attrs?.class || [])]"
20
+ v-bind="{
21
+ target: '_blank',
22
+ ...attrs,
23
+ }"
24
+ :href="hrefValue"
25
+ :class="[{
26
+ 'hover-underline': !withoutDefaultClass
27
+ }, attrs?.class]"
31
28
  >
32
29
  <slot />
33
30
  </a>
34
31
 
35
32
  <RouterLink
36
33
  v-else-if="to"
37
- v-bind="$attrs"
34
+ v-bind="attrs"
38
35
  :to="to"
39
- :class="[{ 'hover-underline': !withoutDefaultClass }, ...($attrs?.class || [])]"
36
+ :class="[{
37
+ 'hover-underline': !withoutDefaultClass
38
+ }, attrs?.class]"
40
39
  >
41
40
  <slot />
42
41
  </RouterLink>
43
42
 
44
43
  <span
45
44
  v-else
46
- v-bind="$attrs"
45
+ v-bind="attrs"
47
46
  >
48
47
  <slot />
49
48
  </span>
@@ -1,3 +1,7 @@
1
+ type __VLS_Props = {
2
+ to?: string | object;
3
+ withoutDefaultClass?: boolean;
4
+ };
1
5
  declare var __VLS_1: {}, __VLS_10: {}, __VLS_12: {};
2
6
  type __VLS_Slots = {} & {
3
7
  default?: (props: typeof __VLS_1) => any;
@@ -6,9 +10,7 @@ type __VLS_Slots = {} & {
6
10
  } & {
7
11
  default?: (props: typeof __VLS_12) => any;
8
12
  };
9
- declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {} | {
10
- [x: string]: any;
11
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
13
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
14
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
13
15
  declare const _default: typeof __VLS_export;
14
16
  export default _default;
@@ -17,6 +17,7 @@ type __VLS_Props = {
17
17
  showToday?: boolean;
18
18
  hideErrorMessage?: boolean;
19
19
  inTable?: boolean;
20
+ showIcon?: boolean;
20
21
  };
21
22
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
22
23
  "update:modelValue": (value: string | Date) => any;
@@ -26,7 +26,8 @@ const props = defineProps({
26
26
  rules: { type: Array, required: false },
27
27
  showToday: { type: Boolean, required: false, default: true },
28
28
  hideErrorMessage: { type: Boolean, required: false, default: false },
29
- inTable: { type: Boolean, required: false }
29
+ inTable: { type: Boolean, required: false },
30
+ showIcon: { type: Boolean, required: false, default: true }
30
31
  });
31
32
  const emit = defineEmits(["update:modelValue", "resetSelectedDate"]);
32
33
  const popover = ref({
@@ -197,7 +198,7 @@ onBeforeUnmount(() => {
197
198
  :id="elementId"
198
199
  :model-value="inputValue"
199
200
  :placeholder="placeholder"
200
- :append-inner-icon="$attrs['append-inner-icon'] || 'tabler-calendar-event'"
201
+ :append-inner-icon="!showIcon ? void 0 : $attrs['append-inner-icon'] ?? 'tabler-calendar-event'"
201
202
  :disabled="disabled"
202
203
  :clearable="clearable"
203
204
  :clear-icon="clearIcon"
@@ -17,6 +17,7 @@ type __VLS_Props = {
17
17
  showToday?: boolean;
18
18
  hideErrorMessage?: boolean;
19
19
  inTable?: boolean;
20
+ showIcon?: boolean;
20
21
  };
21
22
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
22
23
  "update:modelValue": (value: string | Date) => any;
@@ -7,7 +7,6 @@ type __VLS_Props = {
7
7
  valueIn24?: boolean;
8
8
  fillInFocus?: boolean;
9
9
  hideErrorMessage?: boolean;
10
- isAppRtl?: boolean;
11
10
  };
12
11
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
13
12
  "update:model-value": (value: string | null) => any;
@@ -14,8 +14,7 @@ const props = defineProps({
14
14
  placeholder: { type: String, required: false },
15
15
  valueIn24: { type: Boolean, required: false, default: true },
16
16
  fillInFocus: { type: Boolean, required: false, default: true },
17
- hideErrorMessage: { type: Boolean, required: false },
18
- isAppRtl: { type: Boolean, required: false }
17
+ hideErrorMessage: { type: Boolean, required: false }
19
18
  });
20
19
  const errors = ref([]);
21
20
  const hasError = computed(() => errors.value.length > 0);
@@ -108,19 +107,16 @@ onBeforeUnmount(() => {
108
107
  </script>
109
108
 
110
109
  <template>
111
- <div class="d-flex flex-column">
112
- <div dir="ltr" class="h-100">
113
- <div dir="ltr" class="d-flex justify-center align-center gap-2 h-100" :class="{
114
- 'rtl-input': isAppRtl
115
- }">
110
+ <div class="d-flex flex-column app-time-picker">
111
+ <div class="h-100">
112
+ <div class="d-flex justify-center align-center gap-2 h-100">
116
113
  <VTextField
117
114
  v-bind="{ ...$attrs }"
118
115
  :id="elementId"
119
116
  v-model="inputValue"
120
117
  :placeholder="placeholder || t('inputs.time')"
121
- :append-inner-icon="$attrs['append-inner-icon'] || 'tabler-clock'"
118
+ :append-inner-icon="!showIcon ? void 0 : $attrs['append-inner-icon'] ?? 'tabler-clock'"
122
119
  style="padding-block: 0.125rem;"
123
- dir="ltr"
124
120
  hide-details
125
121
  maxlength="5"
126
122
  :error-messages="errorMessages"
@@ -134,6 +130,7 @@ onBeforeUnmount(() => {
134
130
  </template>
135
131
  </VTextField>
136
132
  </div>
133
+
137
134
  <Teleport to="body">
138
135
  <div
139
136
  v-if="isFocus"
@@ -254,7 +251,7 @@ onBeforeUnmount(() => {
254
251
  v-if="!hideErrorMessage"
255
252
  :messages="typeof errors === 'object' ? errors.join(', ') : errors"
256
253
  :active="hasError"
257
- :class="isAppRtl ? 'text-right mr-2' : 'text-left ml-2'"
254
+ class="time-picker-messages"
258
255
  />
259
256
  </div>
260
257
  </template>
@@ -264,25 +261,27 @@ onBeforeUnmount(() => {
264
261
  color: rgba(var(--v-theme-on-surface), var(--v-medium-emphasis-opacity));
265
262
  }
266
263
 
267
- :deep(.v-field__input input) {
268
- text-align: start !important;
269
- }
270
-
271
- /* Apply text-align: end when RTL using the :deep modifier */
272
- .rtl-input :deep(.v-field__input input) {
273
- text-align: end !important;
274
- }
275
-
276
264
  :deep(.v-input__control .v-field .v-field__clearable) {
277
265
  inset-inline-start: -5px !important;
278
266
  }
279
267
 
280
- .icon {
281
- background-color: transparent !important;
268
+ .time-picker-messages {
269
+ text-align: start;
270
+ margin-inline-start: 8px;
282
271
  }
283
272
  </style>
284
273
 
285
274
  <style>
275
+ [dir=rtl] .app-time-picker input {
276
+ text-align: end;
277
+ padding-inline: var(--v-field-padding-end) var(--v-field-padding-start);
278
+ }
279
+
280
+ [dir=ltr] .app-time-picker input {
281
+ text-align: start;
282
+ padding-inline: var(--v-field-padding-start) var(--v-field-padding-end);
283
+ }
284
+
286
285
  .dp-custom-arrow {
287
286
  width: 15px;
288
287
  height: 15px;
@@ -335,7 +334,6 @@ onBeforeUnmount(() => {
335
334
  border-width: 1px;
336
335
  border-style: solid;
337
336
  border-color: rgba(var(--v-border-color), 0.35);
338
- text-align: end !important;
339
337
  }
340
338
 
341
339
  .dp__input_focus {
@@ -7,7 +7,6 @@ type __VLS_Props = {
7
7
  valueIn24?: boolean;
8
8
  fillInFocus?: boolean;
9
9
  hideErrorMessage?: boolean;
10
- isAppRtl?: boolean;
11
10
  };
12
11
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
13
12
  "update:model-value": (value: string | null) => any;
@@ -20,21 +20,21 @@ type __VLS_ModelProps = {
20
20
  modelValue?: string[];
21
21
  };
22
22
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
23
- declare var __VLS_19: {}, __VLS_27: {}, __VLS_59: {}, __VLS_101: string | number, __VLS_102: any, __VLS_115: {
23
+ declare var __VLS_8: {}, __VLS_16: {}, __VLS_48: {}, __VLS_99: {
24
24
  totals: {
25
25
  [key: string]: number;
26
26
  } | undefined;
27
- };
27
+ }, __VLS_108: string | number, __VLS_109: any;
28
28
  type __VLS_Slots = {} & {
29
- [K in NonNullable<typeof __VLS_101>]?: (props: typeof __VLS_102) => any;
29
+ [K in NonNullable<typeof __VLS_108>]?: (props: typeof __VLS_109) => any;
30
30
  } & {
31
- buttons?: (props: typeof __VLS_19) => any;
31
+ buttons?: (props: typeof __VLS_8) => any;
32
32
  } & {
33
- filters?: (props: typeof __VLS_27) => any;
33
+ filters?: (props: typeof __VLS_16) => any;
34
34
  } & {
35
- 'action-buttons'?: (props: typeof __VLS_59) => any;
35
+ 'action-buttons'?: (props: typeof __VLS_48) => any;
36
36
  } & {
37
- 'inside-bottom'?: (props: typeof __VLS_115) => any;
37
+ 'inside-bottom'?: (props: typeof __VLS_99) => any;
38
38
  };
39
39
  declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
40
40
  filterQueryString: import("vue").ComputedRef<string>;
@@ -1,5 +1,5 @@
1
1
  <script setup>
2
- import { VCol, VRow, VCardText, VDivider, VProgressCircular, VIcon, VSpacer, VDataTableServer } from "vuetify/components";
2
+ import { VCardText, VDivider, VProgressCircular, VIcon, VSpacer, VDataTableServer } from "vuetify/components";
3
3
  import { useQuery } from "@tanstack/vue-query";
4
4
  import { useRoute, useRouter } from "vue-router";
5
5
  import { computed, reactive, ref, watch } from "vue";
@@ -134,158 +134,142 @@ defineExpose({
134
134
  </script>
135
135
 
136
136
  <template>
137
- <section>
138
- <VRow>
139
- <VCol cols="12">
140
- <AppCard
141
- :style="{
142
- overflow: useIsMobile().value ? 'auto !important' : 'inherit !important'
143
- }"
144
- style="z-index: unset !important;"
145
- :is-loading="isLoading && secondaryStyle"
146
- >
147
- <template v-if="enableButtons" #append>
148
- <slot name="buttons" />
149
- </template>
150
- <!-- filters -->
151
- <VCardText v-if="hasFilters" class="pt-0">
152
- <slot name="filters">
153
- <FilterGenerator
154
- v-model="filters"
155
- :forms="processedFormFilters"
156
- :errors="errors.data"
157
- />
158
- </slot>
159
- </VCardText>
137
+ <AppCard
138
+ style="z-index: unset !important; overflow: visible !important;"
139
+ :is-loading="isLoading && secondaryStyle"
140
+ >
141
+ <template v-if="enableButtons" #append>
142
+ <slot name="buttons" />
143
+ </template>
144
+ <!-- filters -->
145
+ <VCardText v-if="hasFilters">
146
+ <slot name="filters">
147
+ <FilterGenerator
148
+ v-model="filters"
149
+ :forms="processedFormFilters"
150
+ :errors="errors.data"
151
+ />
152
+ </slot>
153
+ </VCardText>
160
154
 
161
- <VDivider v-if="hasFilters" />
155
+ <VDivider v-if="hasFilters" />
162
156
 
163
- <!-- options and buttons -->
164
- <VCardText
165
- v-if="enablePageSizeOptions || enableActionButtons"
166
- :class="['d-flex flex-wrap py-4 gap-4', {
157
+ <!-- options and buttons -->
158
+ <VCardText
159
+ v-if="enablePageSizeOptions || enableActionButtons"
160
+ :class="['d-flex flex-wrap py-4 gap-4', {
167
161
  'sticky-actions': stickyActions
168
162
  }]"
169
- >
170
- <!-- Page Size options -->
171
- <div v-if="enablePageSizeOptions" class="me-3 d-flex gap-3">
172
- <AppSelect
173
- hide-details
174
- :model-value="itemsPerPage"
175
- :items="pageSizeOptions"
176
- style="width: 6.25rem"
177
- @update:model-value="val => itemsPerPage = Number(val)"
178
- />
179
- </div>
163
+ >
164
+ <!-- Page Size options -->
165
+ <div v-if="enablePageSizeOptions" class="me-3 d-flex gap-3">
166
+ <AppSelect
167
+ hide-details
168
+ :model-value="itemsPerPage"
169
+ :items="pageSizeOptions"
170
+ style="width: 6.25rem"
171
+ @update:model-value="val => itemsPerPage = Number(val)"
172
+ />
173
+ </div>
180
174
 
181
- <VSpacer />
175
+ <VSpacer />
182
176
 
183
- <!-- buttons -->
184
- <div v-if="enableActionButtons" class="d-flex align-center table-buttons">
185
- <slot name="action-buttons" />
177
+ <!-- buttons -->
178
+ <div v-if="enableActionButtons" class="d-flex align-center table-buttons">
179
+ <slot name="action-buttons" />
186
180
 
187
- <template v-if="enableBaseButtons">
188
- <BaseButton
189
- size="38"
190
- color="secondary"
191
- class="ms-2"
192
- @click="reset"
193
- >
194
- <VIcon
195
- icon="tabler-filter-x"
196
- size="22"
197
- />
198
- </BaseButton>
181
+ <template v-if="enableBaseButtons">
182
+ <BaseButton
183
+ size="38"
184
+ color="secondary"
185
+ class="ms-2"
186
+ @click="reset"
187
+ >
188
+ <VIcon
189
+ icon="tabler-filter-x"
190
+ size="22"
191
+ />
192
+ </BaseButton>
199
193
 
200
- <BaseButton
201
- size="38"
202
- color="secondary"
203
- class="ms-2"
204
- @click="refresh"
205
- >
206
- <VIcon
207
- icon="tabler-refresh"
208
- size="22"
209
- />
210
- </BaseButton>
211
- </template>
212
- </div>
213
- </VCardText>
194
+ <BaseButton
195
+ size="38"
196
+ color="secondary"
197
+ class="ms-2"
198
+ @click="refresh"
199
+ >
200
+ <VIcon
201
+ icon="tabler-refresh"
202
+ size="22"
203
+ />
204
+ </BaseButton>
205
+ </template>
206
+ </div>
207
+ </VCardText>
214
208
 
215
- <VDivider v-if="enableButtonsFilter" :class="{
216
- 'sticky-divider': stickyActions
217
- }" />
209
+ <VDivider
210
+ v-if="enableButtonsFilter"
211
+ :class="{
212
+ 'sticky-divider-action': stickyActions,
213
+ 'sticky-divider': !stickyActions
214
+ }"
215
+ />
218
216
 
219
- <div :class="[!useIsMobile().value || 'overflow-auto app-h-fit', {
217
+ <div :class="[!useIsMobile().value || 'overflow-auto app-h-fit', {
220
218
  'secondary-table': secondaryStyle,
221
219
  'responsive-table': useIsMobile().value
222
- }]">
223
- <!-- table -->
224
- <VDataTableServer
225
- v-model="modelValue"
226
- :class="{
220
+ }]" style="position: relative;">
221
+ <!-- table -->
222
+ <VDataTableServer
223
+ v-model="modelValue"
224
+ :class="{
227
225
  'mt-5 px-5': secondaryStyle
228
226
  }"
229
- :items="data?.rows"
230
- :items-length="data?.pagination.total ?? 0"
231
- :headers="headers"
232
- :loading="isLoading"
233
- :no-data-text="t('no_data')"
234
- :fixed-header="useIsMobile().value"
235
- :show-select="showSelect"
236
- :return-object="returnObject"
237
- >
238
- <!-- columns -->
239
- <template v-for="(_, name) in $slots" #[name]="slotProps">
240
- <slot :name="name" v-bind="slotProps || {}" />
241
- </template>
227
+ :items="data?.rows"
228
+ :items-length="data?.pagination.total ?? 0"
229
+ :headers="headers"
230
+ :loading="isLoading"
231
+ :no-data-text="t('no_data')"
232
+ :fixed-header="!useIsMobile().value"
233
+ :show-select="showSelect"
234
+ :return-object="returnObject"
235
+ >
236
+ <template #item.index="{ index }">
237
+ {{ (data?.pagination.total ?? 0) - index - (data?.pagination.from ?? 0) + 1 }}
238
+ </template>
242
239
 
243
- <template #item.index="{ index }">
244
- {{ (data?.pagination.total ?? 0) - index - (data?.pagination.from ?? 0) + 1 }}
245
- </template>
240
+ <template #item.created_at="{ item }">
241
+ <div class="d-flex text-pre-line">
242
+ {{ item?.created_at != "-" || item?.created_at ? formatDate(item?.created_at) : "-" }}
243
+ </div>
244
+ </template>
246
245
 
247
- <template #item.created_at="{ item }">
248
- <div class="d-flex text-pre-line">
249
- {{ item?.created_at != "-" || item?.created_at ? formatDate(item?.created_at) : "-" }}
250
- </div>
251
- </template>
246
+ <template #loader />
252
247
 
253
- <template #loader />
248
+ <!-- loading -->
249
+ <template #loading>
250
+ <div class="text-center">
251
+ <VProgressCircular indeterminate />
252
+ </div>
253
+ </template>
254
254
 
255
- <!-- loading -->
256
- <template #loading>
257
- <div class="text-center">
258
- <VProgressCircular indeterminate />
259
- </div>
260
- </template>
255
+ <!-- pagination -->
256
+ <template #bottom>
257
+ <slot name="inside-bottom" :totals="data?.totals" />
258
+ <TablePagination v-model="currentPage" :pagination="pagination" />
259
+ </template>
261
260
 
262
- <!-- pagination -->
263
- <template #bottom>
264
- <slot name="inside-bottom" :totals="data?.totals" />
265
- <TablePagination v-model="currentPage" :pagination="pagination" />
266
- </template>
267
- </VDataTableServer>
268
- </div>
269
- </AppCard>
270
- </VCol>
271
- </VRow>
272
- </section>
261
+ <!-- columns -->
262
+ <template v-for="(_, name) in $slots" #[name]="slotProps">
263
+ <slot :name="name" v-bind="slotProps || {}" />
264
+ </template>
265
+ </VDataTableServer>
266
+ </div>
267
+ </AppCard>
273
268
  </template>
274
269
 
275
270
  <style scoped>
276
- .sticky-actions {
277
- position: sticky !important;
278
- position: -webkit-sticky;
279
- top: 75px;
280
- z-index: 11 !important;
281
- background-color: rgb(var(--v-theme-surface)) !important;
282
- }
283
-
284
- .sticky-divider {
285
- position: sticky !important;
286
- position: -webkit-sticky;
287
- top: 146px;
288
- z-index: 11 !important;
271
+ :deep(.v-card) {
272
+ overflow: visible !important;
289
273
  }
290
274
 
291
275
  :deep(.v-table) .v-table__wrapper > table > tbody > tr > td,
@@ -294,20 +278,40 @@ defineExpose({
294
278
  }
295
279
 
296
280
  :deep(.v-table__wrapper) {
297
- overflow: inherit !important;
281
+ overflow: visible !important;
298
282
  }
299
283
 
284
+ :deep(.v-data-table__wrapper) {
285
+ overflow: visible !important;
286
+ }
287
+
288
+ :deep(table) {
289
+ position: relative;
290
+ }
300
291
  :deep(table) tr th {
301
292
  position: sticky !important;
302
293
  position: -webkit-sticky;
303
- top: 70px;
304
- z-index: 10;
294
+ top: 86px !important;
295
+ z-index: 10 !important;
305
296
  padding-bottom: 0.75rem;
306
297
  background-color: rgb(var(--v-theme-surface)) !important;
307
298
  }
308
299
 
300
+ .sticky-actions {
301
+ position: sticky;
302
+ top: 76px;
303
+ z-index: 12;
304
+ background-color: rgb(var(--v-theme-surface));
305
+ }
306
+
307
+ .sticky-divider-action {
308
+ position: sticky;
309
+ top: 140px;
310
+ z-index: 12;
311
+ }
312
+
309
313
  .sticky-actions ~ div :deep(table) tr th {
310
- top: 146px !important;
314
+ top: 141px !important;
311
315
  }
312
316
 
313
317
  .table-buttons .v-btn .v-btn__overlay {
@@ -329,7 +333,6 @@ defineExpose({
329
333
  .secondary-table :deep(table) th {
330
334
  padding: 14px 16px !important;
331
335
  height: fit-content !important;
332
- top: 80px !important;
333
336
  border: 1px solid rgb(var(--v-theme-silver)) !important;
334
337
  background-color: rgb(var(--v-theme-gray-200)) !important;
335
338
  color: rgb(var(--v-theme-on-surface)) !important;
@@ -346,7 +349,7 @@ defineExpose({
346
349
  }
347
350
 
348
351
  .sticky-actions ~ div .secondary-table :deep(table) th {
349
- top: 156px !important;
352
+ top: 141px !important;
350
353
  }
351
354
 
352
355
  :deep(.v-overlay) {
@@ -20,21 +20,21 @@ type __VLS_ModelProps = {
20
20
  modelValue?: string[];
21
21
  };
22
22
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
23
- declare var __VLS_19: {}, __VLS_27: {}, __VLS_59: {}, __VLS_101: string | number, __VLS_102: any, __VLS_115: {
23
+ declare var __VLS_8: {}, __VLS_16: {}, __VLS_48: {}, __VLS_99: {
24
24
  totals: {
25
25
  [key: string]: number;
26
26
  } | undefined;
27
- };
27
+ }, __VLS_108: string | number, __VLS_109: any;
28
28
  type __VLS_Slots = {} & {
29
- [K in NonNullable<typeof __VLS_101>]?: (props: typeof __VLS_102) => any;
29
+ [K in NonNullable<typeof __VLS_108>]?: (props: typeof __VLS_109) => any;
30
30
  } & {
31
- buttons?: (props: typeof __VLS_19) => any;
31
+ buttons?: (props: typeof __VLS_8) => any;
32
32
  } & {
33
- filters?: (props: typeof __VLS_27) => any;
33
+ filters?: (props: typeof __VLS_16) => any;
34
34
  } & {
35
- 'action-buttons'?: (props: typeof __VLS_59) => any;
35
+ 'action-buttons'?: (props: typeof __VLS_48) => any;
36
36
  } & {
37
- 'inside-bottom'?: (props: typeof __VLS_115) => any;
37
+ 'inside-bottom'?: (props: typeof __VLS_99) => any;
38
38
  };
39
39
  declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
40
40
  filterQueryString: import("vue").ComputedRef<string>;
@@ -203,7 +203,7 @@ const placeholder = (header) => {
203
203
  :error-messages="errorMessages"
204
204
  :error="error"
205
205
  clear-icon="tabler-x"
206
- append-inner-icon="none"
206
+ :show-icon="false"
207
207
  in-table
208
208
  hide-error-message
209
209
  />
@@ -212,14 +212,12 @@ const placeholder = (header) => {
212
212
  v-if="header.type === 'timepicker'"
213
213
  v-model="item[header.key]"
214
214
  :validate-on="header.validateOn"
215
- class="pa-0 h-100 app-flex-1 app-max-w-150px app-input-outline"
215
+ class="pa-0 h-100 app-input-outline"
216
216
  :rules="header.rules"
217
217
  :show-icon="false"
218
218
  :disabled="isDisabled"
219
- :is-app-rtl="header.isAppRtl"
220
219
  :error-messages="errorMessages"
221
220
  :error="error"
222
- append-inner-icon="none"
223
221
  hide-error-message
224
222
  />
225
223
 
@@ -235,6 +235,10 @@ h6,
235
235
  font-size: 13px;
236
236
  }
237
237
 
238
+ .v-pagination__prev .v-btn.v-btn--density-default, .v-pagination__next .v-btn.v-btn--density-default {
239
+ width: calc(var(--v-btn-height) + 40px) !important;
240
+ }
241
+
238
242
  .v-data-table-footer {
239
243
  margin-block-start: 1rem;
240
244
  }
@@ -619,6 +619,10 @@ h6,
619
619
  font-size: 13px;
620
620
  }
621
621
 
622
+ .v-pagination__prev .v-btn.v-btn--density-default, .v-pagination__next .v-btn.v-btn--density-default {
623
+ width: calc(var(--v-btn-height) + 40px) !important;
624
+ }
625
+
622
626
  .v-data-table-footer {
623
627
  margin-block-start: 1rem;
624
628
  }
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.formatTime = exports.formatNumberColor = exports.formatNumber = exports.formatDateWithoutTime = exports.formatDateWithTime = exports.formatDateWithDay = exports.formatDate = exports.extractDate = void 0;
7
7
  var _core = require("@vueuse/core");
8
- var _vueI18n = require("vue-i18n");
9
8
  const formatDate = date => {
10
9
  return (0, _core.useDateFormat)(date, "DD/MM/YYYY \n hh:mm A").value;
11
10
  };
@@ -23,13 +22,9 @@ const formatDateWithTime = date => {
23
22
  };
24
23
  exports.formatDateWithTime = formatDateWithTime;
25
24
  const formatDateWithDay = date => {
26
- const {
27
- locale
28
- } = (0, _vueI18n.useI18n)({
29
- useScope: "global"
30
- });
25
+ const locale = localStorage.getItem("winch-lang") ?? "ar";
31
26
  return (0, _core.useDateFormat)(date, "HH:mm A dddd - DD/MM/YYYY", {
32
- locales: locale?.value === "ar" ? "ar-SA" : "en-US"
27
+ locales: locale === "ar" ? "ar-SA" : "en-US"
33
28
  }).value;
34
29
  };
35
30
  exports.formatDateWithDay = formatDateWithDay;
@@ -53,14 +48,10 @@ const extractDate = (dateString, format = "DD/MM/YYYY", hasTime = true) => {
53
48
  };
54
49
  exports.extractDate = extractDate;
55
50
  const formatNumber = (number, withCurrency = false) => {
56
- const {
57
- locale
58
- } = (0, _vueI18n.useI18n)({
59
- useScope: "global"
60
- });
51
+ const locale = localStorage.getItem("winch-lang") ?? "ar";
61
52
  const currency = withCurrency ? String.fromCharCode(59392) : "";
62
53
  if (number === void 0 || number === null || number === "" || number === 0) {
63
- return locale?.value !== "ar" ? `${currency} 0` : `0 ${currency}`;
54
+ return locale !== "ar" ? `${currency} 0` : `0 ${currency}`;
64
55
  }
65
56
  if (typeof number === "string") {
66
57
  number = parseFloat(number);
@@ -71,7 +62,7 @@ const formatNumber = (number, withCurrency = false) => {
71
62
  maximumFractionDigits: needsTwoDecimalPlaces ? 2 : 0
72
63
  };
73
64
  const formatted = Math.abs(number).toLocaleString("en-US", options);
74
- return locale?.value !== "ar" ? `${currency} ${number < 0 ? `${formatted}-` : formatted}` : `${number < 0 ? `-${formatted}` : formatted} ${currency}`;
65
+ return locale !== "ar" ? `${currency} ${number < 0 ? `${formatted}-` : formatted}` : `${number < 0 ? `-${formatted}` : formatted} ${currency}`;
75
66
  };
76
67
  exports.formatNumber = formatNumber;
77
68
  const formatNumberColor = number => {
@@ -1,5 +1,4 @@
1
1
  import { useDateFormat } from "@vueuse/core";
2
- import { useI18n } from "vue-i18n";
3
2
  export const formatDate = (date) => {
4
3
  return useDateFormat(date, "DD/MM/YYYY \n hh:mm A").value;
5
4
  };
@@ -13,8 +12,8 @@ export const formatDateWithTime = (date) => {
13
12
  return useDateFormat(date, "DD/MM/YYYY - hh:mm A").value;
14
13
  };
15
14
  export const formatDateWithDay = (date) => {
16
- const { locale } = useI18n({ useScope: "global" });
17
- return useDateFormat(date, "HH:mm A dddd - DD/MM/YYYY", { locales: locale?.value === "ar" ? "ar-SA" : "en-US" }).value;
15
+ const locale = localStorage.getItem("winch-lang") ?? "ar";
16
+ return useDateFormat(date, "HH:mm A dddd - DD/MM/YYYY", { locales: locale === "ar" ? "ar-SA" : "en-US" }).value;
18
17
  };
19
18
  export const extractDate = (dateString, format = "DD/MM/YYYY", hasTime = true) => {
20
19
  if (!dateString) {
@@ -31,10 +30,10 @@ export const extractDate = (dateString, format = "DD/MM/YYYY", hasTime = true) =
31
30
  return { day, month, year };
32
31
  };
33
32
  export const formatNumber = (number, withCurrency = false) => {
34
- const { locale } = useI18n({ useScope: "global" });
33
+ const locale = localStorage.getItem("winch-lang") ?? "ar";
35
34
  const currency = withCurrency ? String.fromCharCode(59392) : "";
36
35
  if (number === void 0 || number === null || number === "" || number === 0) {
37
- return locale?.value !== "ar" ? `${currency} 0` : `0 ${currency}`;
36
+ return locale !== "ar" ? `${currency} 0` : `0 ${currency}`;
38
37
  }
39
38
  if (typeof number === "string") {
40
39
  number = parseFloat(number);
@@ -45,7 +44,7 @@ export const formatNumber = (number, withCurrency = false) => {
45
44
  maximumFractionDigits: needsTwoDecimalPlaces ? 2 : 0
46
45
  };
47
46
  const formatted = Math.abs(number).toLocaleString("en-US", options);
48
- return locale?.value !== "ar" ? `${currency} ${number < 0 ? `${formatted}-` : formatted}` : `${number < 0 ? `-${formatted}` : formatted} ${currency}`;
47
+ return locale !== "ar" ? `${currency} ${number < 0 ? `${formatted}-` : formatted}` : `${number < 0 ? `-${formatted}` : formatted} ${currency}`;
49
48
  };
50
49
  export const formatNumberColor = (number) => {
51
50
  const parsedNumber = typeof number === "string" ? parseFloat(number) : number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@winchsa/ui",
3
- "version": "0.1.39",
3
+ "version": "0.1.41",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "publishConfig": {