aq-fe-framework 0.1.597 → 0.1.599

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.
@@ -23,7 +23,6 @@ import {
23
23
  MyTextInput,
24
24
  MyWeeklySessionSchedulerPicker
25
25
  } from "../chunk-S4K4K3X3.mjs";
26
- import "../chunk-GFEMKKFH.mjs";
27
26
  import {
28
27
  MyModalDelete
29
28
  } from "../chunk-GFW64WZ2.mjs";
@@ -31,6 +30,7 @@ import "../chunk-BCTZIPA2.mjs";
31
30
  import "../chunk-PW6WTEVB.mjs";
32
31
  import "../chunk-5COIJ2CE.mjs";
33
32
  import "../chunk-EWDS5IOF.mjs";
33
+ import "../chunk-GFEMKKFH.mjs";
34
34
  import "../chunk-OMJJAHOC.mjs";
35
35
  import "../chunk-K6S7R6LU.mjs";
36
36
  import "../chunk-AR64BQSX.mjs";
@@ -456,8 +456,9 @@ declare function F_documentCategories_Create({ documentType }: {
456
456
  documentType: number;
457
457
  }): react_jsx_runtime.JSX.Element;
458
458
 
459
- declare function F_documentCategories_Delete({ id }: {
459
+ declare function F_documentCategories_Delete({ id, context }: {
460
460
  id: number;
461
+ context?: string;
461
462
  }): react_jsx_runtime.JSX.Element;
462
463
 
463
464
  declare function F_documentCategories_Read({ documentType }: {
@@ -8,9 +8,6 @@ import {
8
8
  MySelect as MySelect2,
9
9
  MyTextInput as MyTextInput2
10
10
  } from "../chunk-S4K4K3X3.mjs";
11
- import {
12
- const_object_documentTypes
13
- } from "../chunk-GFEMKKFH.mjs";
14
11
  import "../chunk-GFW64WZ2.mjs";
15
12
  import {
16
13
  F_authenticate_Logout,
@@ -51,6 +48,9 @@ import {
51
48
  import {
52
49
  U0DateToDDMMYYYString
53
50
  } from "../chunk-EWDS5IOF.mjs";
51
+ import {
52
+ const_object_documentTypes
53
+ } from "../chunk-GFEMKKFH.mjs";
54
54
  import {
55
55
  const_object_colors
56
56
  } from "../chunk-OMJJAHOC.mjs";
@@ -187,6 +187,13 @@ var service_role = __spreadProps(__spreadValues({}, createBaseApi(CONTROLLER2, b
187
187
  },
188
188
  addUser: (params, roleIds) => {
189
189
  return baseAxios_default.post(CONTROLLER2 + "/AddUser", { params, body: roleIds });
190
+ },
191
+ addUsers: (params, userIds) => {
192
+ return baseAxios_default.post(
193
+ CONTROLLER2 + "/AddUsers",
194
+ userIds,
195
+ { params }
196
+ );
190
197
  }
191
198
  });
192
199
 
@@ -3031,6 +3038,7 @@ function F_documentCategories_Create({ documentType }) {
3031
3038
  documentType
3032
3039
  },
3033
3040
  validate: {
3041
+ code: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
3034
3042
  name: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng"
3035
3043
  }
3036
3044
  });
@@ -3042,10 +3050,11 @@ function F_documentCategories_Create({ documentType }) {
3042
3050
 
3043
3051
  // src/modules-features/admin/core/documentCategories/F_documentCategories_Delete.tsx
3044
3052
  import { jsx as jsx64 } from "react/jsx-runtime";
3045
- function F_documentCategories_Delete({ id }) {
3053
+ function F_documentCategories_Delete({ id, context }) {
3046
3054
  return /* @__PURE__ */ jsx64(
3047
3055
  MyActionIconDelete,
3048
3056
  {
3057
+ contextData: context,
3049
3058
  onSubmit: () => service_documentAttribute.delete(id)
3050
3059
  }
3051
3060
  );
@@ -3056,7 +3065,11 @@ import { useForm as useForm20 } from "@mantine/form";
3056
3065
  import { jsx as jsx65, jsxs as jsxs39 } from "react/jsx-runtime";
3057
3066
  function F_documentCategories_Update({ values }) {
3058
3067
  const form = useForm20({
3059
- initialValues: values
3068
+ initialValues: values,
3069
+ validate: {
3070
+ code: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng",
3071
+ name: (value) => value ? null : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng"
3072
+ }
3060
3073
  });
3061
3074
  return /* @__PURE__ */ jsxs39(MyActionIconUpdate, { form, onSubmit: async (values2) => service_documentAttribute.update(values2), children: [
3062
3075
  /* @__PURE__ */ jsx65(MyTextInput, __spreadValues({ label: "M\xE3 lo\u1EA1i v\u0103n b\u1EA3n" }, form.getInputProps("code"))),
@@ -3096,7 +3109,7 @@ function F_documentCategories_Read({ documentType }) {
3096
3109
  renderRowActions: ({ row }) => {
3097
3110
  return /* @__PURE__ */ jsxs40(MyCenterFull, { children: [
3098
3111
  /* @__PURE__ */ jsx66(F_documentCategories_Update, { values: row.original }),
3099
- /* @__PURE__ */ jsx66(F_documentCategories_Delete, { id: row.original.id })
3112
+ /* @__PURE__ */ jsx66(F_documentCategories_Delete, { id: row.original.id, context: row.original.code })
3100
3113
  ] });
3101
3114
  }
3102
3115
  }
@@ -4808,6 +4821,7 @@ function Adapter_UserTable(_a) {
4808
4821
  return /* @__PURE__ */ jsx104(
4809
4822
  UseCase_UserTable,
4810
4823
  __spreadValues({
4824
+ getRowId: (row) => row.id,
4811
4825
  data: ((_a2 = adminAccountQuery.data) == null ? void 0 : _a2.map(mapper_user.mapToDomain)) || []
4812
4826
  }, rest)
4813
4827
  );
@@ -4823,15 +4837,8 @@ function Adapter_UserAddToRole({
4823
4837
  const disc = useDisclosure2();
4824
4838
  const userSelectedId = useState7({});
4825
4839
  const mutation = useMyReactMutation({
4826
- axiosFn: async ({ userId: roleId2 }) => {
4827
- return {
4828
- data: {
4829
- isSuccess: 1,
4830
- message: "Gi\u1EA3 l\u1EADp",
4831
- data: []
4832
- // <-- `void` hợp lệ
4833
- }
4834
- };
4840
+ axiosFn: async ({ userIds, roleId: roleId2 }) => {
4841
+ return service_role.addUsers({ roleId: roleId2 }, userIds);
4835
4842
  },
4836
4843
  successNotification: "Th\xEAm ng\u01B0\u1EDDi d\xF9ng v\xE0o nh\xF3m quy\u1EC1n th\xE0nh c\xF4ng! (Gi\u1EA3 l\u1EADp)",
4837
4844
  options: {
@@ -4860,7 +4867,7 @@ function Adapter_UserAddToRole({
4860
4867
  actionType: "select",
4861
4868
  onClick: () => mutation.mutate({
4862
4869
  roleId,
4863
- userId: Object.keys(userSelectedId[0]).map(Number)
4870
+ userIds: Object.keys(userSelectedId[0]).map(Number)
4864
4871
  })
4865
4872
  }
4866
4873
  )
@@ -4882,6 +4889,7 @@ import { Tabs as Tabs3 } from "@mantine/core";
4882
4889
  import { useDisclosure as useDisclosure3 } from "@mantine/hooks";
4883
4890
  import { jsx as jsx107, jsxs as jsxs59 } from "react/jsx-runtime";
4884
4891
  function Feat_CreateUpdateRole({ values }) {
4892
+ const isUpdate = values != void 0;
4885
4893
  const disc = useDisclosure3();
4886
4894
  return /* @__PURE__ */ jsx107(
4887
4895
  MyButtonModal2,
@@ -4890,18 +4898,23 @@ function Feat_CreateUpdateRole({ values }) {
4890
4898
  buttonProps: { actionType: "create" },
4891
4899
  actionIconProps: { actionType: "update" },
4892
4900
  modalProps: { size: "80%", title: "Chi ti\u1EBFt nh\xF3m t\xE0i kho\u1EA3n" },
4893
- isActionIcon: !!values,
4901
+ isActionIcon: isUpdate,
4894
4902
  children: /* @__PURE__ */ jsxs59(Tabs3, { defaultValue: "gallery", children: [
4895
4903
  /* @__PURE__ */ jsxs59(Tabs3.List, { children: [
4896
4904
  /* @__PURE__ */ jsx107(Tabs3.Tab, { value: "gallery", children: "Th\xF4ng tin chung" }),
4897
- /* @__PURE__ */ jsx107(Tabs3.Tab, { value: "messages", children: "Danh s\xE1ch th\xE0nh vi\xEAn" })
4905
+ /* @__PURE__ */ jsx107(Tabs3.Tab, { value: "messages", hidden: !isUpdate, children: "Danh s\xE1ch th\xE0nh vi\xEAn" })
4898
4906
  ] }),
4899
4907
  /* @__PURE__ */ jsx107(Tabs3.Panel, { value: "gallery", pt: "md", children: /* @__PURE__ */ jsx107(Adapter_RoleForm, { onSuccess: disc[1].close, values }) }),
4900
4908
  /* @__PURE__ */ jsx107(Tabs3.Panel, { value: "messages", pt: "md", children: /* @__PURE__ */ jsx107(MyFieldset, { title: "Danh s\xE1ch t\xE0i kho\u1EA3n ng\u01B0\u1EDDi d\xF9ng thu\u1ED9c nh\xF3m", children: /* @__PURE__ */ jsx107(
4901
4909
  Adapter_UserTable,
4902
4910
  {
4903
4911
  visibleFields: ["code", "userFullName", "unit"],
4904
- renderTopToolbarCustomActions: () => /* @__PURE__ */ jsx107(Adapter_UserAddToRole, { roleId: 2 }),
4912
+ renderTopToolbarCustomActions: () => /* @__PURE__ */ jsx107(
4913
+ Adapter_UserAddToRole,
4914
+ {
4915
+ roleId: Number(values == null ? void 0 : values.id)
4916
+ }
4917
+ ),
4905
4918
  renderRowActions: () => /* @__PURE__ */ jsx107(MyCenterFull, { children: /* @__PURE__ */ jsx107(Adapter_UserDelete, {}) })
4906
4919
  }
4907
4920
  ) }) })
package/package.json CHANGED
@@ -50,7 +50,7 @@
50
50
  "types": "./dist/types/index.d.mts"
51
51
  }
52
52
  },
53
- "version": "0.1.597",
53
+ "version": "0.1.599",
54
54
  "private": false,
55
55
  "files": [
56
56
  "dist"