@merkaly/nuxt 0.7.5 → 0.7.8

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.5",
7
+ "version": "0.7.8",
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
- countries: string[];
85
84
  placeholder: string;
85
+ countries: 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
- countries: string[];
85
84
  placeholder: string;
85
+ countries: string[];
86
86
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
87
87
  declare const _default: typeof __VLS_export;
88
88
  export default _default;
@@ -1,11 +1,27 @@
1
- declare const search: import("vue").ModelRef<string, string, string, string>;
2
- type __VLS_ModelProps = {
3
- modelValue?: typeof search['value'];
4
- };
5
- declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
1
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ debounce: {
3
+ type: NumberConstructor;
4
+ default: () => number;
5
+ };
6
+ modelValue: {
7
+ type: import("vue").PropType<string>;
8
+ };
9
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
+ change: () => any;
6
11
  "update:modelValue": (value: string) => any;
7
- }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
12
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
13
+ debounce: {
14
+ type: NumberConstructor;
15
+ default: () => number;
16
+ };
17
+ modelValue: {
18
+ type: import("vue").PropType<string>;
19
+ };
20
+ }>> & Readonly<{
21
+ onChange?: (() => any) | undefined;
8
22
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
9
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
23
+ }>, {
24
+ debounce: number;
25
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
10
26
  declare const _default: typeof __VLS_export;
11
27
  export default _default;
@@ -1,6 +1,14 @@
1
1
  <script setup>
2
+ import { watch } from "vue";
3
+ import { useDebounceFn } from "@vueuse/core";
2
4
  import FormatIcon from "../format/FormatIcon.vue";
5
+ const props = defineProps({
6
+ debounce: { type: Number, default: () => 300 }
7
+ });
3
8
  const search = defineModel({ type: String, default: () => String() });
9
+ const emit = defineEmits(["change"]);
10
+ const emitChange = useDebounceFn(() => emit("change"), props.debounce);
11
+ watch(search, () => emitChange());
4
12
  </script>
5
13
 
6
14
  <template>
@@ -1,11 +1,27 @@
1
- declare const search: import("vue").ModelRef<string, string, string, string>;
2
- type __VLS_ModelProps = {
3
- modelValue?: typeof search['value'];
4
- };
5
- declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
1
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ debounce: {
3
+ type: NumberConstructor;
4
+ default: () => number;
5
+ };
6
+ modelValue: {
7
+ type: import("vue").PropType<string>;
8
+ };
9
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
+ change: () => any;
6
11
  "update:modelValue": (value: string) => any;
7
- }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
12
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
13
+ debounce: {
14
+ type: NumberConstructor;
15
+ default: () => number;
16
+ };
17
+ modelValue: {
18
+ type: import("vue").PropType<string>;
19
+ };
20
+ }>> & Readonly<{
21
+ onChange?: (() => any) | undefined;
8
22
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
9
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
23
+ }>, {
24
+ debounce: number;
25
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
10
26
  declare const _default: typeof __VLS_export;
11
27
  export default _default;
@@ -22,7 +22,7 @@ const props = defineProps({
22
22
  selectedItem: { type: Object, default: void 0 },
23
23
  size: { type: String, default: () => void 0 }
24
24
  });
25
- const model = defineModel({ type: [String, Object, Number, Boolean, Array], default: null });
25
+ const model = defineModel({ type: [String, Object, Number, Boolean, Array], default: void 0 });
26
26
  onBeforeMount(() => {
27
27
  if (props.selectedItem) return;
28
28
  if (model.value) {
@@ -107,10 +107,10 @@ function getRowAttrs(item, idx) {
107
107
 
108
108
  <template>
109
109
  <BCard no-body>
110
- <BCardHeader v-if="!props.hideHeader" class="align-items-center p-4 position-relative">
110
+ <BCardHeader v-if="!props.hideHeader" class="align-items-center position-relative">
111
111
  <BCardTitle>
112
112
  <div v-if="hasBulkSlot && !props.hideSelect && selectionState.selectedCount" class="w-35px">
113
- <DropdownIcon icon="caret-down" size="sm" toggle-class="p-2">
113
+ <DropdownIcon icon="caret-down" toggle-class="p-2">
114
114
  <slot name="bulk" v-bind="{ items: selectionState.selectedItems, count: selectionState.selectedCount }" />
115
115
  </DropdownIcon>
116
116
  </div>
@@ -187,10 +187,10 @@ function getRowAttrs(item, idx) {
187
187
  hover
188
188
  responsive="lg"
189
189
  small
190
- table-class="align-middle table-row-dashed gy-3 h-100">
191
- <BThead class="sticky-top z-index-1">
192
- <BTr class="text-start text-body-secondary fw-bold fs-7 text-uppercase gs-0">
193
- <BTh v-if="hasDetailsSlot" class="p-0 w-25px" />
190
+ table-class="align-middle table-row-dashed h-100">
191
+ <BThead class="sticky-top z-index-1 align-middle">
192
+ <BTr class="text-start text-body-secondary fw-bold text-uppercase">
193
+ <BTh v-if="hasDetailsSlot" class="w-25px" style="padding: unset !important;" />
194
194
 
195
195
  <BTh v-if="!props.hideSelect" class="w-40px px-0">
196
196
  <div class="form-check form-check-sm form-check-custom cell-checkbox">
@@ -226,13 +226,14 @@ function getRowAttrs(item, idx) {
226
226
  <BTbody v-else class="fw-semibold text-nowrap">
227
227
  <template v-for="(item, idx) in visibleItems" :key="getRowKey(item, idx)">
228
228
  <BTr v-bind="getRowAttrs(item, idx)">
229
- <BTd v-if="hasDetailsSlot" class="p-0 w-25px">
229
+ <BTd v-if="hasDetailsSlot" class="w-25px" style="padding: unset !important;">
230
230
  <BButton
231
231
  class="w-25px h-100 rounded-0 p-0 border-end border-dashed"
232
232
  size="sm"
233
233
  variant="none"
234
234
  @click="toggleDetails(item)">
235
- <FormatIcon :name="item._showDetails ? 'chevron-down' : 'chevron-right'" size="sm" variant="primary" />
235
+ <FormatIcon :name="item._showDetails ? 'chevron-down' : 'chevron-right'" class="p-0" size="sm"
236
+ variant="primary" />
236
237
  </BButton>
237
238
  </BTd>
238
239
 
@@ -251,7 +252,7 @@ function getRowAttrs(item, idx) {
251
252
  </template>
252
253
 
253
254
  <BTd v-if="hasActionsSlot" class="text-end px-3">
254
- <DropdownIcon icon="caret-down" :text="t('actions')" toggle-class="py-1 px-3" variant="light-dark">
255
+ <DropdownIcon :text="t('actions')" icon="caret-down" toggle-class="py-1 px-3" variant="light-dark">
255
256
  <slot :index="idx" :item="item" name="actions" />
256
257
  </DropdownIcon>
257
258
  </BTd>
@@ -275,7 +276,7 @@ function getRowAttrs(item, idx) {
275
276
 
276
277
  </BTableSimple>
277
278
 
278
- <BCardFooter v-if="!props.hideFooter" class="p-4">
279
+ <BCardFooter v-if="!props.hideFooter">
279
280
  <slot name="footer" />
280
281
 
281
282
  <template v-if="!props.hidePagination">
@@ -297,7 +298,7 @@ function getRowAttrs(item, idx) {
297
298
  @update:model-value="emit('fetch', 'paginate')" />
298
299
  </BCol>
299
300
 
300
- <BCol class="fs-7 text-muted" cols="auto">
301
+ <BCol class="text-muted" cols="auto">
301
302
  <span v-if="$datagrid.loading">Loading...</span>
302
303
  <FormatText v-else :template="paginationText.template" :values="paginationText.values" />
303
304
  </BCol>
@@ -318,16 +319,23 @@ function getRowAttrs(item, idx) {
318
319
  cursor: pointer;
319
320
  }
320
321
 
321
- thead {
322
+ table thead {
323
+ font-size: 0.8rem;
322
324
  background: var(--bs-body-bg);
323
325
  }
324
- thead:before {
326
+ table thead:before {
325
327
  content: "";
326
328
  position: absolute;
327
329
  inset: 0;
328
330
  z-index: -1;
329
331
  background: rgb(var(--bs-primary-rgb), 0.05);
330
332
  }
333
+ table thead tr th:is(:first-child, :last-child) {
334
+ padding: 0 0.75rem !important;
335
+ }
336
+ table tbody tr td:is(:first-child, :last-child) {
337
+ padding: 0 0.75rem !important;
338
+ }
331
339
  </style>
332
340
 
333
341
  <i18n lang="json">
@@ -11,12 +11,14 @@ export function useDatagrid(params) {
11
11
  } else if (mode === "append") {
12
12
  state.items.push(item);
13
13
  }
14
+ state.total += 1;
14
15
  return state.items;
15
16
  },
16
17
  removeItem(predicate) {
17
18
  const index = state.items.findIndex(predicate);
18
19
  if (index !== -1) {
19
20
  state.items.splice(index, 1);
21
+ state.total = Math.max(0, state.total - 1);
20
22
  }
21
23
  return index;
22
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@merkaly/nuxt",
3
- "version": "0.7.5",
3
+ "version": "0.7.8",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/merkaly-io/nuxt.git"
@@ -38,7 +38,7 @@
38
38
  "@nuxt/kit": "^4.4.8",
39
39
  "@nuxtjs/i18n": "^10.4.0",
40
40
  "@nuxtjs/plausible": "^3.0.2",
41
- "@sentry/nuxt": "^10.57.0",
41
+ "@sentry/nuxt": "^10.59.0",
42
42
  "@types/node": "latest",
43
43
  "@types/vue-select": "^3.16.8",
44
44
  "@vueuse/components": "^14.3.0",
@@ -50,7 +50,7 @@
50
50
  "change-case": "^5.4.4",
51
51
  "class-transformer": "^0.5.1",
52
52
  "class-validator": "^0.15.1",
53
- "eslint": "^10.4.1",
53
+ "eslint": "^10.5.0",
54
54
  "filesize": "^11.0.17",
55
55
  "gsap": "^3.15.0",
56
56
  "notivue": "^2.4.5",