erp-blocks 1.1.0 → 1.1.2

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "erp-blocks",
3
3
  "configKey": "erp",
4
- "version": "1.1.0",
4
+ "version": "1.1.2",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -1,9 +1,7 @@
1
- import type { TableColumn } from '@nuxt/ui';
1
+ import type { TableProps } from '@nuxt/ui';
2
2
  declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
3
  props: __VLS_PrettifyLocal<({
4
- data: T[] | undefined;
5
- columns: TableColumn<T>[];
6
- loading?: boolean;
4
+ tableProps: TableProps;
7
5
  totalRows?: number | undefined;
8
6
  itemsPerPage?: number;
9
7
  } & {
@@ -1,8 +1,6 @@
1
1
  <script setup>
2
2
  defineProps({
3
- data: { type: null, required: true },
4
- columns: { type: Array, required: true },
5
- loading: { type: Boolean, required: false },
3
+ tableProps: { type: Object, required: true },
6
4
  totalRows: { type: null, required: false },
7
5
  itemsPerPage: { type: Number, required: false, default: 5 }
8
6
  });
@@ -12,9 +10,7 @@ const page = defineModel("page", { type: Number });
12
10
  <template>
13
11
  <div class="flex flex-col size-full space-y-4 py-4">
14
12
  <UTable
15
- :loading="loading"
16
- :data="data"
17
- :columns="columns"
13
+ v-bind="tableProps"
18
14
  class="flex-1 border border-default rounded-lg grow"
19
15
  >
20
16
  <template
@@ -28,18 +24,18 @@ const page = defineModel("page", { type: Number });
28
24
  </template>
29
25
  </UTable>
30
26
  <div
31
- v-if="data && totalRows"
27
+ v-if="tableProps.data && totalRows"
32
28
  class="flex items-center justify-between"
33
29
  >
34
30
  <span
35
31
  class="text-base text-dimmed"
36
32
  >
37
- {{ data?.length }} of {{ totalRows }} rows
33
+ {{ tableProps.data?.length || itemsPerPage }} of {{ totalRows || itemsPerPage }} rows
38
34
  </span>
39
35
  <UPagination
40
36
  v-model:page="page"
41
37
  active-color="neutral"
42
- :total="totalRows"
38
+ :total="totalRows || itemsPerPage"
43
39
  :items-per-page="itemsPerPage"
44
40
  />
45
41
  </div>
@@ -1,9 +1,7 @@
1
- import type { TableColumn } from '@nuxt/ui';
1
+ import type { TableProps } from '@nuxt/ui';
2
2
  declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
3
  props: __VLS_PrettifyLocal<({
4
- data: T[] | undefined;
5
- columns: TableColumn<T>[];
6
- loading?: boolean;
4
+ tableProps: TableProps;
7
5
  totalRows?: number | undefined;
8
6
  itemsPerPage?: number;
9
7
  } & {
@@ -1,14 +1,17 @@
1
- import type { ModalProps } from '@nuxt/ui';
1
+ import type { FormProps, FormSchema, ModalProps } from '@nuxt/ui';
2
2
  type __VLS_Props = {
3
+ formProps?: FormProps<FormSchema>;
3
4
  modalProps?: ModalProps;
5
+ buttonLabel?: string;
6
+ resetLabel?: string;
7
+ applyButton?: boolean;
8
+ applyLabel?: string;
4
9
  };
5
- declare var __VLS_7: {}, __VLS_15: {}, __VLS_18: {};
10
+ declare var __VLS_12: {}, __VLS_20: {};
6
11
  type __VLS_Slots = {} & {
7
- trigger?: (props: typeof __VLS_7) => any;
12
+ trigger?: (props: typeof __VLS_12) => any;
8
13
  } & {
9
- body?: (props: typeof __VLS_15) => any;
10
- } & {
11
- footer?: (props: typeof __VLS_18) => any;
14
+ fields?: (props: typeof __VLS_20) => any;
12
15
  };
13
16
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
14
17
  reset: (...args: any[]) => void;
@@ -16,6 +19,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
16
19
  onReset?: ((...args: any[]) => any) | undefined;
17
20
  }>, {
18
21
  modalProps: ModalProps;
22
+ buttonLabel: string;
23
+ resetLabel: string;
24
+ applyButton: boolean;
25
+ applyLabel: string;
19
26
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
27
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
21
28
  declare const _default: typeof __VLS_export;
@@ -1,48 +1,54 @@
1
1
  <template>
2
- <UModal v-bind="modalProps">
3
- <slot name="trigger">
4
- <UButton
5
- icon="i-lucide:filter"
6
- label="Filters"
7
- color="neutral"
8
- variant="solid"
9
- class="cursor-pointer"
10
- />
11
- </slot>
2
+ <UForm v-bind="formProps">
3
+ <UModal v-bind="modalProps">
4
+ <slot name="trigger">
5
+ <UButton
6
+ icon="i-lucide:filter"
7
+ :label="buttonLabel"
8
+ color="neutral"
9
+ variant="solid"
10
+ class="cursor-pointer"
11
+ />
12
+ </slot>
12
13
 
13
- <template #body>
14
- <slot name="body" />
15
- </template>
14
+ <template #body>
15
+ <div class="space-y-4">
16
+ <slot name="fields" />
17
+ </div>
18
+ </template>
16
19
 
17
- <template #footer>
18
- <slot
19
- name="footer"
20
- >
20
+ <template #footer>
21
21
  <UButton
22
- label="Reset"
22
+ :label="resetLabel"
23
23
  color="neutral"
24
24
  variant="outline"
25
25
  @click="emit('reset')"
26
26
  />
27
27
  <UButton
28
+ v-if="applyButton"
28
29
  type="submit"
29
- label="Apply"
30
+ :label="applyLabel"
30
31
  color="neutral"
31
32
  />
32
- </slot>
33
- </template>
34
- </UModal>
33
+ </template>
34
+ </UModal>
35
+ </UForm>
35
36
  </template>
36
37
 
37
38
  <script setup>
38
39
  defineProps({
40
+ formProps: { type: Object, required: false },
39
41
  modalProps: { type: Object, required: false, default: () => ({
40
42
  title: "Filters",
41
43
  scrollable: true,
42
44
  ui: {
43
45
  footer: "justify-end"
44
46
  }
45
- }) }
47
+ }) },
48
+ buttonLabel: { type: String, required: false, default: "Filters" },
49
+ resetLabel: { type: String, required: false, default: "Reset" },
50
+ applyButton: { type: Boolean, required: false, default: true },
51
+ applyLabel: { type: String, required: false, default: "Apply" }
46
52
  });
47
53
  const emit = defineEmits(["reset"]);
48
54
  </script>
@@ -1,14 +1,17 @@
1
- import type { ModalProps } from '@nuxt/ui';
1
+ import type { FormProps, FormSchema, ModalProps } from '@nuxt/ui';
2
2
  type __VLS_Props = {
3
+ formProps?: FormProps<FormSchema>;
3
4
  modalProps?: ModalProps;
5
+ buttonLabel?: string;
6
+ resetLabel?: string;
7
+ applyButton?: boolean;
8
+ applyLabel?: string;
4
9
  };
5
- declare var __VLS_7: {}, __VLS_15: {}, __VLS_18: {};
10
+ declare var __VLS_12: {}, __VLS_20: {};
6
11
  type __VLS_Slots = {} & {
7
- trigger?: (props: typeof __VLS_7) => any;
12
+ trigger?: (props: typeof __VLS_12) => any;
8
13
  } & {
9
- body?: (props: typeof __VLS_15) => any;
10
- } & {
11
- footer?: (props: typeof __VLS_18) => any;
14
+ fields?: (props: typeof __VLS_20) => any;
12
15
  };
13
16
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
14
17
  reset: (...args: any[]) => void;
@@ -16,6 +19,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
16
19
  onReset?: ((...args: any[]) => any) | undefined;
17
20
  }>, {
18
21
  modalProps: ModalProps;
22
+ buttonLabel: string;
23
+ resetLabel: string;
24
+ applyButton: boolean;
25
+ applyLabel: string;
19
26
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
27
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
21
28
  declare const _default: typeof __VLS_export;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "erp-blocks",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Ready-to-use UI layouts and components designed as ERP system elements ",
5
5
  "repository": {
6
6
  "type": "git",