erp-blocks 1.0.10 → 1.1.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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "erp-blocks",
3
3
  "configKey": "erp",
4
- "version": "1.0.10",
4
+ "version": "1.1.1",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -20,11 +20,9 @@
20
20
  </template>
21
21
 
22
22
  <script setup>
23
- import { useCookie } from "#app";
23
+ import { useState } from "#app";
24
24
  import MainMenu from "./MainMenu.vue";
25
- const sidebarOpen = useCookie("sidebarOpen", {
26
- default: () => true
27
- });
25
+ const sidebarOpen = useState("sidebarOpen", () => true);
28
26
  function closeSidebar() {
29
27
  sidebarOpen.value = false;
30
28
  }
@@ -13,7 +13,10 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
13
13
  }> & import("vue").PublicProps;
14
14
  expose: (exposed: {}) => void;
15
15
  attrs: any;
16
- slots: {};
16
+ slots: {
17
+ [x: string]: ((props: any) => any) | undefined;
18
+ [x: number]: ((props: any) => any) | undefined;
19
+ };
17
20
  emit: (evt: "update:page", value: number | undefined) => void;
18
21
  }>) => import("vue").VNode & {
19
22
  __ctx?: Awaited<typeof __VLS_setup>;
@@ -16,18 +16,30 @@ const page = defineModel("page", { type: Number });
16
16
  :data="data"
17
17
  :columns="columns"
18
18
  class="flex-1 border border-default rounded-lg grow"
19
- />
20
- <div class="flex items-center justify-between">
19
+ >
20
+ <template
21
+ v-for="(_, name) in $slots"
22
+ #[name]="slotProps"
23
+ >
24
+ <slot
25
+ :name="name"
26
+ v-bind="slotProps"
27
+ />
28
+ </template>
29
+ </UTable>
30
+ <div
31
+ v-if="data && totalRows"
32
+ class="flex items-center justify-between"
33
+ >
21
34
  <span
22
- v-if="data && totalRows"
23
35
  class="text-base text-dimmed"
24
36
  >
25
- {{ data.length }} of {{ totalRows }} rows
37
+ {{ data?.length || itemsPerPage }} of {{ totalRows || itemsPerPage }} rows
26
38
  </span>
27
39
  <UPagination
28
40
  v-model:page="page"
29
41
  active-color="neutral"
30
- :total="totalRows"
42
+ :total="totalRows || itemsPerPage"
31
43
  :items-per-page="itemsPerPage"
32
44
  />
33
45
  </div>
@@ -13,7 +13,10 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
13
13
  }> & import("vue").PublicProps;
14
14
  expose: (exposed: {}) => void;
15
15
  attrs: any;
16
- slots: {};
16
+ slots: {
17
+ [x: string]: ((props: any) => any) | undefined;
18
+ [x: number]: ((props: any) => any) | undefined;
19
+ };
17
20
  emit: (evt: "update:page", value: number | undefined) => void;
18
21
  }>) => import("vue").VNode & {
19
22
  __ctx?: Awaited<typeof __VLS_setup>;
@@ -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;
@@ -13,8 +13,6 @@
13
13
  </template>
14
14
 
15
15
  <script setup>
16
- import { useCookie } from "#app";
17
- const sidebarOpen = useCookie("sidebarOpen", {
18
- default: () => true
19
- });
16
+ import { useState } from "#app";
17
+ const sidebarOpen = useState("sidebarOpen", () => true);
20
18
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "erp-blocks",
3
- "version": "1.0.10",
3
+ "version": "1.1.1",
4
4
  "description": "Ready-to-use UI layouts and components designed as ERP system elements ",
5
5
  "repository": {
6
6
  "type": "git",