@merkaly/nuxt 0.6.0 → 0.6.1

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.6.0",
7
+ "version": "0.6.1",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
@@ -1,6 +1,14 @@
1
- import type { ColorVariant } from 'bootstrap-vue-next';
1
+ import type { ColorVariant, AlignmentVertical, AlignmentHorizontal } from 'bootstrap-vue-next';
2
2
  import type { PropType } from 'vue';
3
3
  declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ alignV: {
5
+ type: PropType<AlignmentVertical>;
6
+ default: () => string;
7
+ };
8
+ alignH: {
9
+ type: PropType<AlignmentHorizontal>;
10
+ default: () => string;
11
+ };
4
12
  mode: {
5
13
  type: StringConstructor;
6
14
  default: string;
@@ -42,6 +50,14 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
42
50
  default: () => string;
43
51
  };
44
52
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
53
+ alignV: {
54
+ type: PropType<AlignmentVertical>;
55
+ default: () => string;
56
+ };
57
+ alignH: {
58
+ type: PropType<AlignmentHorizontal>;
59
+ default: () => string;
60
+ };
45
61
  mode: {
46
62
  type: StringConstructor;
47
63
  default: string;
@@ -88,6 +104,8 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
88
104
  size: string;
89
105
  tag: string;
90
106
  variant: string;
107
+ alignV: AlignmentVertical;
108
+ alignH: AlignmentHorizontal;
91
109
  opacity: string | number;
92
110
  provider: string;
93
111
  reversed: boolean;
@@ -1,6 +1,8 @@
1
1
  <script setup>
2
2
  import { computed } from "vue";
3
3
  const props = defineProps({
4
+ alignV: { type: String, default: () => "center" },
5
+ alignH: { type: String, default: () => "start" },
4
6
  mode: { type: String, default: "duotone" },
5
7
  name: { type: String, required: true },
6
8
  opacity: { type: [String, Number], default: () => "" },
@@ -28,17 +30,27 @@ const classList = computed(() => [
28
30
  fontSize.value,
29
31
  fontColor.value
30
32
  ].filter(Boolean));
33
+ const wrapperClass = computed(() => [
34
+ "d-flex",
35
+ `justify-content-${props.alignH}`,
36
+ `align-items-${props.alignV}`,
37
+ { "flex-row-reverse": props.reversed }
38
+ ]);
39
+ defineOptions({
40
+ inheritAttrs: false
41
+ });
31
42
  </script>
32
43
 
33
44
  <template>
34
45
  <template v-if="hasContent">
35
- <span :class="{ 'flex-row-reverse': props.reversed }" class="d-flex align-items-center">
36
- <component :is="props.tag" :class="classList" />
46
+ <span :class="wrapperClass">
47
+ <component :is="props.tag" :class="classList" v-bind="$attrs" />
48
+
37
49
  <slot>
38
50
  <span :class="fontColor" class="ps-1" v-text="props.text" />
39
51
  </slot>
40
52
  </span>
41
53
  </template>
42
54
 
43
- <component :is="props.tag" v-else :class="classList" />
55
+ <component :is="props.tag" v-else :class="classList" v-bind="$attrs" />
44
56
  </template>
@@ -1,6 +1,14 @@
1
- import type { ColorVariant } from 'bootstrap-vue-next';
1
+ import type { ColorVariant, AlignmentVertical, AlignmentHorizontal } from 'bootstrap-vue-next';
2
2
  import type { PropType } from 'vue';
3
3
  declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ alignV: {
5
+ type: PropType<AlignmentVertical>;
6
+ default: () => string;
7
+ };
8
+ alignH: {
9
+ type: PropType<AlignmentHorizontal>;
10
+ default: () => string;
11
+ };
4
12
  mode: {
5
13
  type: StringConstructor;
6
14
  default: string;
@@ -42,6 +50,14 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
42
50
  default: () => string;
43
51
  };
44
52
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
53
+ alignV: {
54
+ type: PropType<AlignmentVertical>;
55
+ default: () => string;
56
+ };
57
+ alignH: {
58
+ type: PropType<AlignmentHorizontal>;
59
+ default: () => string;
60
+ };
45
61
  mode: {
46
62
  type: StringConstructor;
47
63
  default: string;
@@ -88,6 +104,8 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
88
104
  size: string;
89
105
  tag: string;
90
106
  variant: string;
107
+ alignV: AlignmentVertical;
108
+ alignH: AlignmentHorizontal;
91
109
  opacity: string | number;
92
110
  provider: string;
93
111
  reversed: boolean;
@@ -4,7 +4,7 @@ import { Money3Component } from "v-money3";
4
4
  const money = defineModel({ type: null, ...{
5
5
  default: () => 0,
6
6
  get: (v) => v / 100,
7
- set: (v) => v * 100,
7
+ set: (v) => Math.trunc(v * 100),
8
8
  type: [String, Number]
9
9
  } });
10
10
  const props = defineProps({
@@ -21,7 +21,9 @@ const canFilter = Boolean(slots.filters);
21
21
  const hasDetailsSlot = computed(() => Boolean(slots["details"]));
22
22
  const hasActionsSlot = computed(() => Boolean(slots["actions"]));
23
23
  const hasBulkSlot = computed(() => Boolean(slots["bulk"]));
24
- const visibleColumns = computed(() => Object.entries($datagrid.value.columns));
24
+ const visibleColumns = computed(() => Object.entries($datagrid.value.columns).filter(({ 1: column }) => {
25
+ return column.visible !== false;
26
+ }));
25
27
  const tableColspan = computed(() => {
26
28
  const baseColumns = 2;
27
29
  const selectColumn = props.hideSelect ? 0 : 1;
@@ -172,8 +174,8 @@ function getRowAttrs(item, idx) {
172
174
  v-if="$datagrid.loading"
173
175
  :value="100"
174
176
  animated
175
- height="5px"
176
177
  class="rounded-0 position-absolute w-100 start-0"
178
+ height="5px"
177
179
  style="bottom: -6px; z-index: 10" />
178
180
  </BCardHeader>
179
181
 
@@ -200,7 +202,7 @@ function getRowAttrs(item, idx) {
200
202
  </BTh>
201
203
 
202
204
  <template v-for="[key, column] in visibleColumns" :key="key">
203
- <BTh :class="[column.class, column.thClass]">
205
+ <BTh :class="[column.class, column.thClass, 'text-nowrap']">
204
206
  <slot :name="`head[${key}]`" v-bind="{ column, key }">
205
207
  <span v-text="column.title ?? sentenceCase(key)" />
206
208
  </slot>
@@ -219,7 +221,7 @@ function getRowAttrs(item, idx) {
219
221
  </BTd>
220
222
  </BTbody>
221
223
 
222
- <BTbody v-else class="fw-semibold text-gray-600">
224
+ <BTbody v-else class="fw-semibold text-gray-600 text-nowrap">
223
225
  <template v-for="(item, idx) in visibleItems" :key="getRowKey(item, idx)">
224
226
  <BTr v-bind="getRowAttrs(item, idx)">
225
227
  <BTd v-if="hasDetailsSlot" class="p-0 w-25px">
@@ -247,7 +249,7 @@ function getRowAttrs(item, idx) {
247
249
  </template>
248
250
 
249
251
  <BTd v-if="hasActionsSlot" class="text-end px-3">
250
- <DropdownIcon toggle-class="border border-secondary-subtle border-dashed text-body py-1 px-3">
252
+ <DropdownIcon icon="caret-down" text="Actions" toggle-class="py-1 px-3" variant="light-dark">
251
253
  <slot :index="idx" :item="item" name="actions" />
252
254
  </DropdownIcon>
253
255
  </BTd>
@@ -5,20 +5,25 @@ export interface ColumnDefinition<C = unknown> {
5
5
  thClass?: string;
6
6
  title?: string;
7
7
  type?: unknown;
8
+ visible?: boolean;
8
9
  }
9
10
  export type DataGridItem<C> = C;
11
+ export type DataGridAddItemMode = 'append' | 'prepend';
12
+ export interface DataGridAddItemOptions {
13
+ mode?: DataGridAddItemMode;
14
+ }
10
15
  export type DataGridRowAttrs = Record<string, unknown>;
11
16
  export type DataGridRowKey = string | number;
12
17
  export interface DataGridRowDefinition {
13
18
  attrs?: DataGridRowAttrs;
14
- class?: string;
19
+ class?: string | Record<string, unknown>;
15
20
  key?: DataGridRowKey;
16
21
  }
17
22
  export interface DataGrid<C = unknown> {
18
23
  columns: Record<string, ColumnDefinition<C>>;
19
24
  error: unknown;
20
25
  fn: {
21
- addItem: (item: C) => DataGridItem<C>[];
26
+ addItem: (item: C, options?: DataGridAddItemOptions) => DataGridItem<C>[];
22
27
  removeItem: (predicate: (item: DataGridItem<C>, index: number) => boolean) => number;
23
28
  };
24
29
  items: DataGridItem<C>[];
@@ -4,8 +4,13 @@ export function useDatagrid(params) {
4
4
  columns: params.columns,
5
5
  error: params.error ?? null,
6
6
  fn: {
7
- addItem(item) {
8
- state.items.push(item);
7
+ addItem(item, options = {}) {
8
+ const mode = options.mode ?? "append";
9
+ if (mode === "prepend") {
10
+ state.items.unshift(item);
11
+ } else if (mode === "append") {
12
+ state.items.push(item);
13
+ }
9
14
  return state.items;
10
15
  },
11
16
  removeItem(predicate) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@merkaly/nuxt",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/merkaly-io/nuxt.git"
@@ -27,22 +27,8 @@
27
27
  "files": [
28
28
  "dist"
29
29
  ],
30
- "scripts": {
31
- "build": "nuxt-module-build build",
32
- "build:stub": "nuxt-module-build build --stub",
33
- "dev": "pnpm dev:prepare && cd playground && pnpm storybook",
34
- "dev:build": "nuxi build playground",
35
- "dev:prepare": "pnpm build:stub && nuxi prepare playground",
36
- "lint": "eslint .",
37
- "prepack": "pnpm build",
38
- "prepare": "nuxt-module-build prepare",
39
- "release": "pnpm lint && pnpm test && pnpm build && changelogen --release && npm publish --access public && git push --follow-tags",
40
- "test": "vitest run",
41
- "test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit",
42
- "test:watch": "vitest watch"
43
- },
44
30
  "dependencies": {
45
- "@auth0/auth0-spa-js": "^2.17.0",
31
+ "@auth0/auth0-spa-js": "^2.19.0",
46
32
  "@bootstrap-vue-next/nuxt": "^0.44.1",
47
33
  "@nuxt/devtools": "^3.2.1",
48
34
  "@nuxt/eslint": "1.15.1",
@@ -51,13 +37,13 @@
51
37
  "@nuxt/image": "^2.0.0",
52
38
  "@nuxt/kit": "^4.4.2",
53
39
  "@nuxtjs/plausible": "^3.0.1",
54
- "@sentry/nuxt": "^10.47.0",
40
+ "@sentry/nuxt": "^10.51.0",
55
41
  "@types/node": "latest",
56
42
  "@types/vue-select": "^3.16.8",
57
- "@vueuse/components": "^14.2.0",
58
- "@vueuse/core": "^14.2.0",
59
- "@vueuse/integrations": "^14.2.0",
60
- "@vueuse/nuxt": "^14.2.0",
43
+ "@vueuse/components": "^14.3.0",
44
+ "@vueuse/core": "^14.3.0",
45
+ "@vueuse/integrations": "^14.3.0",
46
+ "@vueuse/nuxt": "^14.3.0",
61
47
  "bootstrap": "^5.3.8",
62
48
  "bootstrap-vue-next": "^0.44.1",
63
49
  "change-case": "^5",
@@ -67,7 +53,7 @@
67
53
  "filesize": "^11.0.2",
68
54
  "nuxt": "^4.4.2",
69
55
  "reflect-metadata": "^0.2.2",
70
- "sass": "^1.98.0",
56
+ "sass": "^1.99.0",
71
57
  "typescript": "~5.9.3",
72
58
  "v-money3": "^3.24.1",
73
59
  "vite-svg-loader": "^5.1.0",
@@ -85,9 +71,20 @@
85
71
  "vue-tsc": "^3.2.1"
86
72
  },
87
73
  "optionalDependencies": {
88
- "defu": "^6.1.4"
74
+ "defu": "^6.1.5"
89
75
  },
90
76
  "engines": {
91
- "node": ">=20.0.0"
77
+ "node": ">=24"
78
+ },
79
+ "scripts": {
80
+ "build": "nuxt-module-build build",
81
+ "build:stub": "nuxt-module-build build --stub",
82
+ "dev": "pnpm dev:prepare && cd playground && pnpm storybook",
83
+ "dev:build": "nuxi build playground",
84
+ "dev:prepare": "pnpm build:stub && nuxi prepare playground",
85
+ "lint": "eslint .",
86
+ "test": "vitest run",
87
+ "test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit",
88
+ "test:watch": "vitest watch"
92
89
  }
93
- }
90
+ }