v-nuxt-ui 0.1.27 → 0.1.28

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.
Files changed (40) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/date-picker/index.d.vue.ts +1 -2
  3. package/dist/runtime/components/date-picker/index.vue +1 -1
  4. package/dist/runtime/components/date-picker/index.vue.d.ts +1 -2
  5. package/dist/runtime/components/sys/calendar/board.vue +4 -3
  6. package/dist/runtime/components/sys/company/CreateModal.d.vue.ts +1 -1
  7. package/dist/runtime/components/sys/company/CreateModal.vue +1 -1
  8. package/dist/runtime/components/sys/company/CreateModal.vue.d.ts +1 -1
  9. package/dist/runtime/components/sys/department/CreateModal.d.vue.ts +1 -1
  10. package/dist/runtime/components/sys/department/CreateModal.vue +1 -1
  11. package/dist/runtime/components/sys/department/CreateModal.vue.d.ts +1 -1
  12. package/dist/runtime/components/sys/issue-record/CreateModal.d.vue.ts +13 -0
  13. package/dist/runtime/components/sys/issue-record/CreateModal.vue +23 -0
  14. package/dist/runtime/components/sys/issue-record/CreateModal.vue.d.ts +13 -0
  15. package/dist/runtime/components/sys/issue-record/Table.d.vue.ts +3 -0
  16. package/dist/runtime/components/sys/issue-record/Table.vue +32 -0
  17. package/dist/runtime/components/sys/issue-record/Table.vue.d.ts +3 -0
  18. package/dist/runtime/components/sys/job-title/CreateModal.d.vue.ts +1 -1
  19. package/dist/runtime/components/sys/job-title/CreateModal.vue +1 -1
  20. package/dist/runtime/components/sys/job-title/CreateModal.vue.d.ts +1 -1
  21. package/dist/runtime/components/sys/menu/CreateModal.d.vue.ts +1 -1
  22. package/dist/runtime/components/sys/menu/CreateModal.vue +1 -1
  23. package/dist/runtime/components/sys/menu/CreateModal.vue.d.ts +1 -1
  24. package/dist/runtime/components/sys/role/CreateModal.d.vue.ts +1 -1
  25. package/dist/runtime/components/sys/role/CreateModal.vue +1 -1
  26. package/dist/runtime/components/sys/role/CreateModal.vue.d.ts +1 -1
  27. package/dist/runtime/components/sys/user/CreateModal.d.vue.ts +1 -1
  28. package/dist/runtime/components/sys/user/CreateModal.vue +1 -1
  29. package/dist/runtime/components/sys/user/CreateModal.vue.d.ts +1 -1
  30. package/dist/runtime/composables/api/sys/index.d.ts +2 -0
  31. package/dist/runtime/composables/api/sys/index.js +2 -0
  32. package/dist/runtime/composables/api/sys/useCalendarApi.d.ts +10 -0
  33. package/dist/runtime/composables/api/sys/useIssueRecordApi.d.ts +2 -0
  34. package/dist/runtime/composables/api/sys/useIssueRecordApi.js +3 -0
  35. package/dist/runtime/constants/calendar.d.ts +3 -7
  36. package/dist/runtime/constants/calendar.js +9 -15
  37. package/dist/runtime/types/models/sys.d.ts +3 -0
  38. package/dist/runtime/types/time.d.ts +6 -0
  39. package/dist/runtime/types/time.js +7 -0
  40. package/package.json +1 -1
package/dist/module.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "dependencies": [
8
8
  "@nuxt/ui"
9
9
  ],
10
- "version": "0.1.27",
10
+ "version": "0.1.28",
11
11
  "builder": {
12
12
  "@nuxt/module-builder": "1.0.2",
13
13
  "unbuild": "3.6.1"
@@ -1,7 +1,6 @@
1
1
  import type { ButtonProps } from '@nuxt/ui';
2
2
  import type { DateRange, DateValue } from 'reka-ui';
3
- import type { TimeUnit } from '#v/constants';
4
- import type { DateShortcut } from '#v/types';
3
+ import type { DateShortcut, TimeUnit } from '#v/types';
5
4
  type __VLS_Props = {
6
5
  size?: ButtonProps['size'];
7
6
  loading?: ButtonProps['loading'];
@@ -12,7 +12,7 @@ const props = defineProps({
12
12
  loading: { type: Boolean, required: false },
13
13
  range: { type: Boolean, required: false },
14
14
  placeholder: { type: String, required: false },
15
- timeUnit: { type: null, required: false },
15
+ timeUnit: { type: String, required: false },
16
16
  leadingIcon: { type: null, required: false },
17
17
  shortcuts: { type: Array, required: false },
18
18
  peerButtons: { type: Array, required: false }
@@ -1,7 +1,6 @@
1
1
  import type { ButtonProps } from '@nuxt/ui';
2
2
  import type { DateRange, DateValue } from 'reka-ui';
3
- import type { TimeUnit } from '#v/constants';
4
- import type { DateShortcut } from '#v/types';
3
+ import type { DateShortcut, TimeUnit } from '#v/types';
5
4
  type __VLS_Props = {
6
5
  size?: ButtonProps['size'];
7
6
  loading?: ButtonProps['loading'];
@@ -1,7 +1,8 @@
1
1
  <script setup>
2
2
  import { useDate, useFetching, useSubmitting } from "#v/composables";
3
3
  import { useCalendarApi } from "#v/composables/api/sys/useCalendarApi";
4
- import { TIME_ZONE, CalendarEventType, dateFormat, calendarEventTypeOptions } from "#v/constants";
4
+ import { TIME_ZONE, dateFormat, calendarEventTypeOptions } from "#v/constants";
5
+ import { CalendarEventType } from "#v/types";
5
6
  import { endOfMonth, now, startOfMonth } from "@internationalized/date";
6
7
  import { useToast } from "@nuxt/ui/runtime/composables/useToast.js";
7
8
  import { ref, computed, watch } from "vue";
@@ -193,8 +194,8 @@ watch(
193
194
  class="inline-block size-2 rounded-full"
194
195
  :class="`bg-(--color-light) dark:bg-(--color-dark)`"
195
196
  :style="{
196
- '--color-light': `var(--ui-${item.color})`,
197
- '--color-dark': `var(--ui-${item.color})`
197
+ '--color-light': `var(--ui-${String(item.color)})`,
198
+ '--color-dark': `var(--ui-${String(item.color)})`
198
199
  }"
199
200
  />
200
201
  </div>
@@ -1,4 +1,4 @@
1
- import type { Company } from 'v-nuxt-ui/types';
1
+ import type { Company } from '#v/types';
2
2
  type __VLS_Props = {
3
3
  model: Company;
4
4
  };
@@ -3,7 +3,7 @@ import * as z from "zod";
3
3
  import FormCreateModalTemplateWithApi from "#v/components/form/create-modal-template/WithApi.vue";
4
4
  import { useCompanyApi } from "#v/composables";
5
5
  defineProps({
6
- model: { type: null, required: true }
6
+ model: { type: Object, required: true }
7
7
  });
8
8
  const emit = defineEmits(["close", "save"]);
9
9
  </script>
@@ -1,4 +1,4 @@
1
- import type { Company } from 'v-nuxt-ui/types';
1
+ import type { Company } from '#v/types';
2
2
  type __VLS_Props = {
3
3
  model: Company;
4
4
  };
@@ -1,4 +1,4 @@
1
- import type { Department } from 'v-nuxt-ui/types';
1
+ import type { Department } from '#v/types';
2
2
  type __VLS_Props = {
3
3
  model: Department;
4
4
  };
@@ -4,7 +4,7 @@ import FormCreateModalTemplate from "#v/components/form/create-modal-template/in
4
4
  import { useCompanyApi, useDepartmentApi, useFormSubmission, useFormValues, useUserApi } from "#v/composables";
5
5
  import { toRef, watch } from "vue";
6
6
  const props = defineProps({
7
- model: { type: null, required: true }
7
+ model: { type: Object, required: true }
8
8
  });
9
9
  const emit = defineEmits(["close", "save"]);
10
10
  const { oldValues, newValues } = useFormValues(toRef(props.model), { id: 0 });
@@ -1,4 +1,4 @@
1
- import type { Department } from 'v-nuxt-ui/types';
1
+ import type { Department } from '#v/types';
2
2
  type __VLS_Props = {
3
3
  model: Department;
4
4
  };
@@ -0,0 +1,13 @@
1
+ import type { IssueRecord } from '#v/types';
2
+ type __VLS_Props = {
3
+ model: IssueRecord;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ close: (args_0: boolean) => any;
7
+ save: (args_0: IssueRecord) => any;
8
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
9
+ onClose?: ((args_0: boolean) => any) | undefined;
10
+ onSave?: ((args_0: IssueRecord) => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
@@ -0,0 +1,23 @@
1
+ <script setup>
2
+ import * as z from "zod";
3
+ import FormCreateModalTemplateWithApi from "#v/components/form/create-modal-template/WithApi.vue";
4
+ import { useIssueRecordApi } from "#v/composables";
5
+ defineProps({
6
+ model: { type: Object, required: true }
7
+ });
8
+ const emit = defineEmits(["close", "save"]);
9
+ </script>
10
+
11
+ <template>
12
+ <FormCreateModalTemplateWithApi
13
+ title="改进建议"
14
+ description="您可以针对该网页提出任何改进建议或直接联系chenrn@mail.veken.com"
15
+ :on-close="(ok) => emit('close', ok)"
16
+ :on-save="(model) => emit('save', model)"
17
+ :fields="[
18
+ { name: 'description', type: 'textarea', label: '\u63CF\u8FF0', colSpan: '24', zodType: z.string() }
19
+ ]"
20
+ :model-value="model"
21
+ :api-group="useIssueRecordApi"
22
+ />
23
+ </template>
@@ -0,0 +1,13 @@
1
+ import type { IssueRecord } from '#v/types';
2
+ type __VLS_Props = {
3
+ model: IssueRecord;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ close: (args_0: boolean) => any;
7
+ save: (args_0: IssueRecord) => any;
8
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
9
+ onClose?: ((args_0: boolean) => any) | undefined;
10
+ onSave?: ((args_0: IssueRecord) => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,32 @@
1
+ <script setup>
2
+ import { getOprColumns } from "#v/constants";
3
+ import { useOverlay } from "@nuxt/ui/composables";
4
+ import { useIssueRecordApi } from "#v/composables";
5
+ import SysIssueRecordsCreateModal from "./CreateModal.vue";
6
+ import TablePage from "#v/components/table/Page.vue";
7
+ const overlay = useOverlay();
8
+ const createModal = overlay.create(SysIssueRecordsCreateModal);
9
+ const columns = [
10
+ {
11
+ accessorKey: "description",
12
+ header: "\u63CF\u8FF0",
13
+ filterOption: {
14
+ type: "input"
15
+ }
16
+ },
17
+ ...getOprColumns()
18
+ ];
19
+ </script>
20
+
21
+ <template>
22
+ <TablePage
23
+ name="sys-issue-record"
24
+ cn-name="改进建议"
25
+ :use-api-group="useIssueRecordApi"
26
+ :biz-columns="columns"
27
+ :extra-order-query-options="[
28
+ { field: 'createdAt', label: '\u521B\u5EFA\u65F6\u95F4', defaultOpr: 'desc' }
29
+ ]"
30
+ @edit-row-from-modal="async (row) => await createModal.open({ model: row }).result"
31
+ />
32
+ </template>
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -1,4 +1,4 @@
1
- import type { JobTitle } from 'v-nuxt-ui/types';
1
+ import type { JobTitle } from '#v/types';
2
2
  type __VLS_Props = {
3
3
  model: JobTitle;
4
4
  };
@@ -3,7 +3,7 @@ import * as z from "zod";
3
3
  import FormCreateModalTemplateWithApi from "#v/components/form/create-modal-template/WithApi.vue";
4
4
  import { useJobTitleApi } from "#v/composables";
5
5
  defineProps({
6
- model: { type: null, required: true }
6
+ model: { type: Object, required: true }
7
7
  });
8
8
  const emit = defineEmits(["close", "save"]);
9
9
  </script>
@@ -1,4 +1,4 @@
1
- import type { JobTitle } from 'v-nuxt-ui/types';
1
+ import type { JobTitle } from '#v/types';
2
2
  type __VLS_Props = {
3
3
  model: JobTitle;
4
4
  };
@@ -1,4 +1,4 @@
1
- import type { Menu } from 'v-nuxt-ui/types';
1
+ import type { Menu } from '#v/types';
2
2
  type __VLS_Props = {
3
3
  model: Menu;
4
4
  };
@@ -5,7 +5,7 @@ import { useMenuApi, useFormSubmission, useFormValues } from "#v/composables";
5
5
  import { toRef } from "vue";
6
6
  import { menuTypeOptions } from "#v/constants";
7
7
  const props = defineProps({
8
- model: { type: null, required: true }
8
+ model: { type: Object, required: true }
9
9
  });
10
10
  const emit = defineEmits(["close", "save"]);
11
11
  const { oldValues, newValues } = useFormValues(toRef(props.model), { id: 0, disabled: false, isAdmin: false });
@@ -1,4 +1,4 @@
1
- import type { Menu } from 'v-nuxt-ui/types';
1
+ import type { Menu } from '#v/types';
2
2
  type __VLS_Props = {
3
3
  model: Menu;
4
4
  };
@@ -1,4 +1,4 @@
1
- import type { Role } from 'v-nuxt-ui/types';
1
+ import type { Role } from '#v/types';
2
2
  type __VLS_Props = {
3
3
  model: Role;
4
4
  };
@@ -5,7 +5,7 @@ import { useFormSubmission, useFormValues, useMenuApi, useRoleApi } from "#v/com
5
5
  import { computed, onMounted, ref, toRef } from "vue";
6
6
  import { treeifyOptions } from "#v/utils";
7
7
  const props = defineProps({
8
- model: { type: null, required: true }
8
+ model: { type: Object, required: true }
9
9
  });
10
10
  const emit = defineEmits(["close", "save"]);
11
11
  const { oldValues, newValues } = useFormValues(toRef(props.model), { id: 0, disabled: false, isAdmin: false });
@@ -1,4 +1,4 @@
1
- import type { Role } from 'v-nuxt-ui/types';
1
+ import type { Role } from '#v/types';
2
2
  type __VLS_Props = {
3
3
  model: Role;
4
4
  };
@@ -1,4 +1,4 @@
1
- import type { User } from 'v-nuxt-ui/types';
1
+ import type { User } from '#v/types';
2
2
  type __VLS_Props = {
3
3
  model: User;
4
4
  };
@@ -6,7 +6,7 @@ import FormCreateModalTemplate from "#v/components/form/create-modal-template/in
6
6
  import { loginTypeOptions, genderOptions, Gender } from "#v/constants";
7
7
  import * as z from "zod";
8
8
  const props = defineProps({
9
- model: { type: null, required: true }
9
+ model: { type: Object, required: true }
10
10
  });
11
11
  const emit = defineEmits(["close", "save"]);
12
12
  const { oldValues, newValues } = useFormValues(toRef(props.model), { id: 0, needFillWh: false, isAdmin: false });
@@ -1,4 +1,4 @@
1
- import type { User } from 'v-nuxt-ui/types';
1
+ import type { User } from '#v/types';
2
2
  type __VLS_Props = {
3
3
  model: User;
4
4
  };
@@ -1,3 +1,5 @@
1
+ export * from './useIssueRecordApi.js';
2
+ export * from './useCalendarApi.js';
1
3
  export * from './useAuthApi.js';
2
4
  export * from './useCompanyApi.js';
3
5
  export * from './useDepartmentApi.js';
@@ -1,3 +1,5 @@
1
+ export * from "./useIssueRecordApi.js";
2
+ export * from "./useCalendarApi.js";
1
3
  export * from "./useAuthApi.js";
2
4
  export * from "./useCompanyApi.js";
3
5
  export * from "./useDepartmentApi.js";
@@ -0,0 +1,10 @@
1
+ import type { PageResult, Calendar, CalendarsSavePayload, ApiGroup, RequestResult } from '#v/types';
2
+ import type { UseFetchOptions } from 'nuxt/app';
3
+ import type { Ref } from 'vue';
4
+ type CalendarApi = {
5
+ batchSave: (payload: CalendarsSavePayload, customOptions?: UseFetchOptions<PageResult<Calendar>>) => Promise<{
6
+ data: Ref<RequestResult<PageResult<Calendar>>>;
7
+ }>;
8
+ } & ApiGroup<Calendar>;
9
+ export declare const useCalendarApi: () => CalendarApi;
10
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { IssueRecord } from '#v/types';
2
+ export declare const useIssueRecordApi: () => import("#v/types").ApiGroup<IssueRecord>;
@@ -0,0 +1,3 @@
1
+ import { createSharedComposable } from "@vueuse/core";
2
+ import { useApi } from "../useApi.js";
3
+ export const useIssueRecordApi = createSharedComposable(() => useApi("/sys/issues"));
@@ -1,12 +1,8 @@
1
- export declare enum CalendarEventType {
2
- NONE = 0,
3
- HOLIDAY = 1,
4
- ADJUSTRED = 2,
5
- WEEKEND = 3
6
- }
1
+ import { CalendarEventType } from '#v/types';
2
+ import type { ChipProps } from '@nuxt/ui';
7
3
  export declare const calendarEventTypeOptions: {
8
4
  label: string;
9
5
  value: CalendarEventType;
10
- color: string;
6
+ color: ChipProps['color'];
11
7
  }[];
12
8
  export declare const calendarEventTypeShortNameMap: Map<CalendarEventType, string>;
@@ -1,19 +1,13 @@
1
- export var CalendarEventType = /* @__PURE__ */ ((CalendarEventType2) => {
2
- CalendarEventType2[CalendarEventType2["NONE"] = 0] = "NONE";
3
- CalendarEventType2[CalendarEventType2["HOLIDAY"] = 1] = "HOLIDAY";
4
- CalendarEventType2[CalendarEventType2["ADJUSTRED"] = 2] = "ADJUSTRED";
5
- CalendarEventType2[CalendarEventType2["WEEKEND"] = 3] = "WEEKEND";
6
- return CalendarEventType2;
7
- })(CalendarEventType || {});
1
+ import { CalendarEventType } from "#v/types";
8
2
  export const calendarEventTypeOptions = [
9
- { label: "\u56FD\u5BB6\u6CD5\u5B9A\u5047", value: 1 /* HOLIDAY */, color: "primary" },
10
- { label: "\u516C\u53F8\u8C03\u6574\u5047", value: 2 /* ADJUSTRED */, color: "warning" },
11
- { label: "\u5468\u672B\u4F11\u606F\u65E5", value: 3 /* WEEKEND */, color: "success" },
12
- { label: "\u65E0", value: 0 /* NONE */, color: "neutral" }
3
+ { label: "\u56FD\u5BB6\u6CD5\u5B9A\u5047", value: CalendarEventType.HOLIDAY, color: "primary" },
4
+ { label: "\u516C\u53F8\u8C03\u6574\u5047", value: CalendarEventType.ADJUSTRED, color: "warning" },
5
+ { label: "\u5468\u672B\u4F11\u606F\u65E5", value: CalendarEventType.WEEKEND, color: "success" },
6
+ { label: "\u65E0", value: CalendarEventType.NONE, color: "neutral" }
13
7
  ];
14
8
  export const calendarEventTypeShortNameMap = /* @__PURE__ */ new Map([
15
- [0 /* NONE */, "\u73ED"],
16
- [1 /* HOLIDAY */, "\u5047"],
17
- [2 /* ADJUSTRED */, "\u8C03"],
18
- [3 /* WEEKEND */, "\u4F11"]
9
+ [CalendarEventType.NONE, "\u73ED"],
10
+ [CalendarEventType.HOLIDAY, "\u5047"],
11
+ [CalendarEventType.ADJUSTRED, "\u8C03"],
12
+ [CalendarEventType.WEEKEND, "\u4F11"]
19
13
  ]);
@@ -86,3 +86,6 @@ export type Calendar = {
86
86
  date?: string;
87
87
  type?: number;
88
88
  } & BaseModel;
89
+ export type IssueRecord = {
90
+ description?: string;
91
+ } & BaseModel;
@@ -1 +1,7 @@
1
1
  export type TimeUnit = 'day' | 'week' | 'month' | 'quarter' | 'year';
2
+ export declare enum CalendarEventType {
3
+ NONE = 0,
4
+ HOLIDAY = 1,
5
+ ADJUSTRED = 2,
6
+ WEEKEND = 3
7
+ }
@@ -0,0 +1,7 @@
1
+ export var CalendarEventType = /* @__PURE__ */ ((CalendarEventType2) => {
2
+ CalendarEventType2[CalendarEventType2["NONE"] = 0] = "NONE";
3
+ CalendarEventType2[CalendarEventType2["HOLIDAY"] = 1] = "HOLIDAY";
4
+ CalendarEventType2[CalendarEventType2["ADJUSTRED"] = 2] = "ADJUSTRED";
5
+ CalendarEventType2[CalendarEventType2["WEEKEND"] = 3] = "WEEKEND";
6
+ return CalendarEventType2;
7
+ })(CalendarEventType || {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "v-nuxt-ui",
3
- "version": "0.1.27",
3
+ "version": "0.1.28",
4
4
  "description": "Veken UI Component Library - Reusable Nuxt UI components, composables, and utilities for enterprise applications",
5
5
  "type": "module",
6
6
  "style": "./dist/runtime/index.css",