@merkaly/nuxt 0.7.4 → 0.7.5

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/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.14.0"
6
6
  },
7
- "version": "0.7.4",
7
+ "version": "0.7.5",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
@@ -81,8 +81,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
81
81
  }>, {
82
82
  mode: PlaceTypes;
83
83
  disabled: boolean;
84
- placeholder: string;
85
84
  countries: string[];
85
+ placeholder: string;
86
86
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
87
87
  declare const _default: typeof __VLS_export;
88
88
  export default _default;
@@ -81,8 +81,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
81
81
  }>, {
82
82
  mode: PlaceTypes;
83
83
  disabled: boolean;
84
- placeholder: string;
85
84
  countries: string[];
85
+ placeholder: string;
86
86
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
87
87
  declare const _default: typeof __VLS_export;
88
88
  export default _default;
@@ -83,6 +83,8 @@ declare const __VLS_export: <T extends Record<string, any>>(__VLS_props: NonNull
83
83
  text: string;
84
84
  selectedOption: boolean;
85
85
  }) => any;
86
+ } & {
87
+ 'no-options'?: (props: any) => any;
86
88
  };
87
89
  emit: ((e: "request:selected" | "search", v: string) => unknown) & ((event: "update:modelValue", value: any) => void);
88
90
  }>) => import("vue").VNode & {
@@ -120,10 +120,12 @@ const isRequired = computed(() => {
120
120
  <BSpinner v-if="isLoading" class="spinner" variant="primary" />
121
121
  </template>
122
122
 
123
- <template #no-options="{ search, searching, loading: isLoading }">
124
- <span v-if="isLoading">Searching for "{{ search }}"</span>
125
- <span v-else-if="searching">No results for "{{ search }}"</span>
126
- <span v-else>Type to search</span>
123
+ <template #no-options="scope">
124
+ <slot name="no-options" v-bind="scope">
125
+ <span v-if="scope.loading">Searching for "{{ scope.search }}"</span>
126
+ <span v-else-if="scope.searching">No results for "{{ scope.search }}"</span>
127
+ <span v-else>Type to search</span>
128
+ </slot>
127
129
  </template>
128
130
 
129
131
  <template #open-indicator="{ attributes }">
@@ -83,6 +83,8 @@ declare const __VLS_export: <T extends Record<string, any>>(__VLS_props: NonNull
83
83
  text: string;
84
84
  selectedOption: boolean;
85
85
  }) => any;
86
+ } & {
87
+ 'no-options'?: (props: any) => any;
86
88
  };
87
89
  emit: ((e: "request:selected" | "search", v: string) => unknown) & ((event: "update:modelValue", value: any) => void);
88
90
  }>) => import("vue").VNode & {
@@ -5,7 +5,7 @@ declare const __VLS_export: <G>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
5
5
  } & import("vue").ExtractPublicPropTypes<{
6
6
  emptyText: {
7
7
  type: StringConstructor;
8
- default: () => string;
8
+ default: undefined;
9
9
  };
10
10
  hideHeader: {
11
11
  type: BooleanConstructor;
@@ -1,6 +1,7 @@
1
1
  <script setup>
2
2
  import { sentenceCase } from "change-case";
3
3
  import { computed, getCurrentInstance, useSlots } from "vue";
4
+ import { useI18n } from "vue-i18n";
4
5
  import DropdownIcon from "../dropdown/DropdownIcon.vue";
5
6
  import FormatIcon from "../format/FormatIcon.vue";
6
7
  import FormatText from "../format/FormatText.vue";
@@ -8,13 +9,14 @@ import InputSearch from "../input/InputSearch.vue";
8
9
  const emit = defineEmits(["fetch", "toggle:item"]);
9
10
  const slots = useSlots();
10
11
  const props = defineProps({
11
- emptyText: { type: String, default: () => "No items found" },
12
+ emptyText: { type: String, default: void 0 },
12
13
  hideHeader: { type: Boolean, default: false },
13
14
  hideFooter: { type: Boolean, default: false },
14
15
  hidePagination: { type: Boolean, default: false },
15
16
  hideSelect: { type: Boolean, default: false }
16
17
  });
17
18
  const $datagrid = defineModel({ type: Object, ...{ type: Object, required: true } });
19
+ const { t } = useI18n({ useScope: "local" });
18
20
  const instance = getCurrentInstance();
19
21
  const canFetch = Boolean(instance?.vnode?.props?.onFetch);
20
22
  const canFilter = Boolean(slots.filters);
@@ -39,7 +41,7 @@ const paginationText = computed(() => {
39
41
  }
40
42
  const end = Math.min(page * limit, total);
41
43
  return {
42
- template: "Showing :current: to :final: of :total: items",
44
+ template: t("pagination"),
43
45
  values: {
44
46
  current: start,
45
47
  final: end,
@@ -216,7 +218,7 @@ function getRowAttrs(item, idx) {
216
218
  <BTbody v-if="!visibleItems.length">
217
219
  <BTd :colspan="tableColspan">
218
220
  <slot name="empty">
219
- <div class="text-center text-muted" v-text="props.emptyText" />
221
+ <div class="text-center text-muted" v-text="props.emptyText ?? t('empty')" />
220
222
  </slot>
221
223
  </BTd>
222
224
  </BTbody>
@@ -249,7 +251,7 @@ function getRowAttrs(item, idx) {
249
251
  </template>
250
252
 
251
253
  <BTd v-if="hasActionsSlot" class="text-end px-3">
252
- <DropdownIcon icon="caret-down" text="Actions" toggle-class="py-1 px-3" variant="light-dark">
254
+ <DropdownIcon icon="caret-down" :text="t('actions')" toggle-class="py-1 px-3" variant="light-dark">
253
255
  <slot :index="idx" :item="item" name="actions" />
254
256
  </DropdownIcon>
255
257
  </BTd>
@@ -327,3 +329,18 @@ thead:before {
327
329
  background: rgb(var(--bs-primary-rgb), 0.05);
328
330
  }
329
331
  </style>
332
+
333
+ <i18n lang="json">
334
+ {
335
+ "en": {
336
+ "empty": "No items found",
337
+ "actions": "Actions",
338
+ "pagination": "Showing :current: to :final: of :total: items"
339
+ },
340
+ "pt": {
341
+ "empty": "Nenhum item encontrado",
342
+ "actions": "Ações",
343
+ "pagination": "Mostrando :current: a :final: de :total: itens"
344
+ }
345
+ }
346
+ </i18n>
@@ -5,7 +5,7 @@ declare const __VLS_export: <G>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
5
5
  } & import("vue").ExtractPublicPropTypes<{
6
6
  emptyText: {
7
7
  type: StringConstructor;
8
- default: () => string;
8
+ default: undefined;
9
9
  };
10
10
  hideHeader: {
11
11
  type: BooleanConstructor;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@merkaly/nuxt",
3
- "version": "0.7.4",
3
+ "version": "0.7.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/merkaly-io/nuxt.git"