@hedhog/blog 0.0.1 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. package/frontend/author/components/author.screen.ts +105 -0
  2. package/frontend/author/components/create-panel.tsx +10 -3
  3. package/frontend/author/components/update-panel.tsx +7 -2
  4. package/frontend/author/react-query/requests.ts +7 -6
  5. package/frontend/category/components/category.screen.ts +105 -0
  6. package/frontend/category/components/create-panel.tsx +10 -3
  7. package/frontend/category/components/update-panel.tsx +7 -2
  8. package/frontend/category/react-query/requests.ts +7 -6
  9. package/frontend/post/components/create-panel.tsx +10 -3
  10. package/frontend/post/components/post.screen.ts +105 -0
  11. package/frontend/post/components/update-panel.tsx +7 -2
  12. package/frontend/post/react-query/requests.ts +7 -6
  13. package/package.json +1 -1
  14. package/frontend/author/components/create-panel.d.ts +0 -9
  15. package/frontend/author/components/create-panel.d.ts.map +0 -1
  16. package/frontend/author/components/create-panel.js +0 -42
  17. package/frontend/author/components/create-panel.js.map +0 -1
  18. package/frontend/author/components/update-panel.d.ts +0 -7
  19. package/frontend/author/components/update-panel.d.ts.map +0 -1
  20. package/frontend/author/components/update-panel.js +0 -52
  21. package/frontend/author/components/update-panel.js.map +0 -1
  22. package/frontend/author/react-query/handlers.d.ts +0 -5
  23. package/frontend/author/react-query/handlers.d.ts.map +0 -1
  24. package/frontend/author/react-query/handlers.js +0 -30
  25. package/frontend/author/react-query/handlers.js.map +0 -1
  26. package/frontend/author/react-query/requests.d.ts +0 -10
  27. package/frontend/author/react-query/requests.d.ts.map +0 -1
  28. package/frontend/author/react-query/requests.js +0 -48
  29. package/frontend/author/react-query/requests.js.map +0 -1
  30. package/frontend/category/components/create-panel.d.ts +0 -9
  31. package/frontend/category/components/create-panel.d.ts.map +0 -1
  32. package/frontend/category/components/create-panel.js +0 -48
  33. package/frontend/category/components/create-panel.js.map +0 -1
  34. package/frontend/category/components/update-panel.d.ts +0 -7
  35. package/frontend/category/components/update-panel.d.ts.map +0 -1
  36. package/frontend/category/components/update-panel.js +0 -61
  37. package/frontend/category/components/update-panel.js.map +0 -1
  38. package/frontend/category/react-query/handlers.d.ts +0 -5
  39. package/frontend/category/react-query/handlers.d.ts.map +0 -1
  40. package/frontend/category/react-query/handlers.js +0 -30
  41. package/frontend/category/react-query/handlers.js.map +0 -1
  42. package/frontend/category/react-query/requests.d.ts +0 -10
  43. package/frontend/category/react-query/requests.d.ts.map +0 -1
  44. package/frontend/category/react-query/requests.js +0 -49
  45. package/frontend/category/react-query/requests.js.map +0 -1
  46. package/frontend/post/components/create-panel.d.ts +0 -9
  47. package/frontend/post/components/create-panel.d.ts.map +0 -1
  48. package/frontend/post/components/create-panel.js +0 -54
  49. package/frontend/post/components/create-panel.js.map +0 -1
  50. package/frontend/post/components/update-panel.d.ts +0 -7
  51. package/frontend/post/components/update-panel.d.ts.map +0 -1
  52. package/frontend/post/components/update-panel.js +0 -64
  53. package/frontend/post/components/update-panel.js.map +0 -1
  54. package/frontend/post/react-query/handlers.d.ts +0 -5
  55. package/frontend/post/react-query/handlers.d.ts.map +0 -1
  56. package/frontend/post/react-query/handlers.js +0 -30
  57. package/frontend/post/react-query/handlers.js.map +0 -1
  58. package/frontend/post/react-query/requests.d.ts +0 -10
  59. package/frontend/post/react-query/requests.d.ts.map +0 -1
  60. package/frontend/post/react-query/requests.js +0 -48
  61. package/frontend/post/react-query/requests.js.map +0 -1
@@ -1,42 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.AuthorCreatePanel = void 0;
7
- const form_panel_1 = __importDefault(require("@/components/custom/form-panel"));
8
- const EnumFieldType_1 = require("@/enums/EnumFieldType");
9
- const person_type_1 = require("@/features/person-type");
10
- const react_1 = require("react");
11
- const react_i18next_1 = require("react-i18next");
12
- exports.AuthorCreatePanel = (0, react_1.forwardRef)(({ onCreated }, ref) => {
13
- const formRef = (0, react_1.useRef)(null);
14
- const { t } = (0, react_i18next_1.useTranslation)(["author", "actions"]);
15
- const { mutateAsync: createAuthor } = (0, person_type_1.useAuthorCreate)();
16
- (0, react_1.useImperativeHandle)(ref, () => ({
17
- submit: () => {
18
- var _a;
19
- (_a = formRef.current) === null || _a === void 0 ? void 0 : _a.submit();
20
- },
21
- }), [formRef]);
22
- return (<form_panel_1.default ref={formRef} fields={[
23
- {
24
- name: "name",
25
- label: { text: t("name", { ns: "translation" }) },
26
- type: EnumFieldType_1.EnumFieldType.TEXT,
27
- required: true,
28
- },
29
- {
30
- name: "email",
31
- label: { text: t("email", { ns: "translation" }) },
32
- type: EnumFieldType_1.EnumFieldType.TEXT,
33
- required: true,
34
- },
35
- ]} button={{ text: t("create", { ns: "actions" }) }} onSubmit={async (data) => {
36
- const createdData = await createAuthor(data);
37
- if (typeof onCreated === "function") {
38
- onCreated(createdData);
39
- }
40
- }}/>);
41
- });
42
- //# sourceMappingURL=create-panel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-panel.js","sourceRoot":"","sources":["create-panel.tsx"],"names":[],"mappings":";;;;;;AAAA,gFAAyE;AACzE,yDAAsD;AACtD,wDAAyD;AAEzD,iCAAgE;AAChE,iDAA+C;AAUlC,QAAA,iBAAiB,GAAG,IAAA,kBAAU,EACzC,CAAC,EAAE,SAAS,EAA0B,EAAE,GAAG,EAAE,EAAE;IAC7C,MAAM,OAAO,GAAG,IAAA,cAAM,EAAe,IAAI,CAAC,CAAC;IAC3C,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,8BAAc,EAAC,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;IACpD,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,IAAA,6BAAe,GAAE,CAAC;IAExD,IAAA,2BAAmB,EACjB,GAAG,EACH,GAAG,EAAE,CAAC,CAAC;QACL,MAAM,EAAE,GAAG,EAAE;;YACX,MAAA,OAAO,CAAC,OAAO,0CAAE,MAAM,EAAE,CAAC;QAC5B,CAAC;KACF,CAAC,EACF,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,OAAO,CACL,CAAC,oBAAS,CACR,GAAG,CAAC,CAAC,OAAO,CAAC,CACb,MAAM,CAAC,CAAC;YACN;gBACE,IAAI,EAAE,MAAM;gBACZ,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE;gBACjD,IAAI,EAAE,6BAAa,CAAC,IAAI;gBACxB,QAAQ,EAAE,IAAI;aACf;YAED;gBACE,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE;gBAClD,IAAI,EAAE,6BAAa,CAAC,IAAI;gBACxB,QAAQ,EAAE,IAAI;aACf;SACF,CAAC,CACF,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CACjD,QAAQ,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;YACvB,MAAM,WAAW,GAAG,MAAM,YAAY,CAAC,IAAI,CAAC,CAAC;YAC7C,IAAI,OAAO,SAAS,KAAK,UAAU,EAAE,CAAC;gBACpC,SAAS,CAAC,WAAW,CAAC,CAAC;YACzB,CAAC;QACH,CAAC,CAAC,EACF,CACH,CAAC;AACJ,CAAC,CACF,CAAC"}
@@ -1,7 +0,0 @@
1
- import { Author } from "@/types/models";
2
- export type AuthorUpdatePanelProps = {
3
- data: Author;
4
- onUpdated?: (data: Author) => void;
5
- };
6
- export declare const AuthorUpdatePanel: any;
7
- //# sourceMappingURL=update-panel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-panel.d.ts","sourceRoot":"","sources":["update-panel.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAIxC,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,iBAAiB,KAsD7B,CAAC"}
@@ -1,52 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.AuthorUpdatePanel = void 0;
7
- const form_panel_1 = __importDefault(require("@/components/custom/form-panel"));
8
- const overlay_1 = require("@/components/custom/overlay");
9
- const tab_panel_1 = require("@/components/custom/tab-panel");
10
- const EnumFieldType_1 = require("@/enums/EnumFieldType");
11
- const author_1 = require("@/features/author");
12
- const use_effect_after_first_update_1 = __importDefault(require("@/hooks/use-effect-after-first-update"));
13
- const i18next_1 = require("i18next");
14
- const react_1 = require("react");
15
- exports.AuthorUpdatePanel = (0, react_1.forwardRef)(({ data, onUpdated }, ref) => {
16
- const { data: item, isLoading } = (0, author_1.useAuthorGet)(data.id);
17
- const { mutate: authorUpdate } = (0, author_1.useAuthorUpdate)();
18
- const formRef = (0, react_1.useRef)(null);
19
- (0, use_effect_after_first_update_1.default)(() => {
20
- if (item && formRef.current) {
21
- formRef.current.setValuesFromItem(item);
22
- }
23
- }, [item]);
24
- (0, react_1.useImperativeHandle)(ref, () => ({}));
25
- return (<tab_panel_1.TabPanel activeTabIndex={0} tabs={[
26
- {
27
- title: (0, i18next_1.t)("details", { ns: "actions" }),
28
- children: (<overlay_1.Overlay loading={isLoading}>
29
- <form_panel_1.default ref={formRef} fields={[
30
- {
31
- name: "name",
32
- label: { text: (0, i18next_1.t)("name", { ns: "translation" }) },
33
- type: EnumFieldType_1.EnumFieldType.TEXT,
34
- required: true,
35
- },
36
- {
37
- name: "email",
38
- label: { text: (0, i18next_1.t)("email", { ns: "translation" }) },
39
- type: EnumFieldType_1.EnumFieldType.TEXT,
40
- required: true,
41
- },
42
- ]} button={{ text: (0, i18next_1.t)("save", { ns: "actions" }) }} onSubmit={(data) => {
43
- authorUpdate({ id: data.id, data });
44
- if (typeof onUpdated === "function") {
45
- onUpdated(data);
46
- }
47
- }}/>
48
- </overlay_1.Overlay>),
49
- },
50
- ]}/>);
51
- });
52
- //# sourceMappingURL=update-panel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-panel.js","sourceRoot":"","sources":["update-panel.tsx"],"names":[],"mappings":";;;;;;AAAA,gFAAyE;AACzE,yDAAsD;AACtD,6DAAyD;AACzD,yDAAsD;AACtD,8CAAkE;AAClE,0GAA8E;AAE9E,qCAA4B;AAC5B,iCAAgE;AAOnD,QAAA,iBAAiB,GAAG,IAAA,kBAAU,EACzC,CAAC,EAAE,IAAI,EAAE,SAAS,EAA0B,EAAE,GAAG,EAAE,EAAE;IACnD,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,IAAA,qBAAY,EAAC,IAAI,CAAC,EAAY,CAAC,CAAC;IAClE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,IAAA,wBAAe,GAAE,CAAC;IACnD,MAAM,OAAO,GAAG,IAAA,cAAM,EAAe,IAAI,CAAC,CAAC;IAE3C,IAAA,uCAAyB,EAAC,GAAG,EAAE;QAC7B,IAAI,IAAI,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YAC5B,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAC1C,CAAC;IACH,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,IAAA,2BAAmB,EAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAErC,OAAO,CACL,CAAC,oBAAQ,CACP,cAAc,CAAC,CAAC,CAAC,CAAC,CAClB,IAAI,CAAC,CAAC;YACJ;gBACE,KAAK,EAAE,IAAA,WAAC,EAAC,SAAS,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC;gBACtC,QAAQ,EAAE,CACR,CAAC,iBAAO,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAC1B;gBAAA,CAAC,oBAAS,CACR,GAAG,CAAC,CAAC,OAAO,CAAC,CACb,MAAM,CAAC,CAAC;wBACN;4BACE,IAAI,EAAE,MAAM;4BACZ,KAAK,EAAE,EAAE,IAAI,EAAE,IAAA,WAAC,EAAC,MAAM,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE;4BACjD,IAAI,EAAE,6BAAa,CAAC,IAAI;4BACxB,QAAQ,EAAE,IAAI;yBACf;wBAED;4BACE,IAAI,EAAE,OAAO;4BACb,KAAK,EAAE,EAAE,IAAI,EAAE,IAAA,WAAC,EAAC,OAAO,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE;4BAClD,IAAI,EAAE,6BAAa,CAAC,IAAI;4BACxB,QAAQ,EAAE,IAAI;yBACf;qBACF,CAAC,CACF,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,IAAA,WAAC,EAAC,MAAM,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAC/C,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE;wBACjB,YAAY,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;wBACpC,IAAI,OAAO,SAAS,KAAK,UAAU,EAAE,CAAC;4BACpC,SAAS,CAAC,IAAI,CAAC,CAAC;wBAClB,CAAC;oBACH,CAAC,CAAC,EAEN;cAAA,EAAE,iBAAO,CAAC,CACX;aACF;SACF,CAAC,EACF,CACH,CAAC;AACJ,CAAC,CACF,CAAC"}
@@ -1,5 +0,0 @@
1
- export declare function useAuthorCreate(): any;
2
- export declare function useAuthorDelete(): any;
3
- export declare function useAuthorUpdate(): any;
4
- export declare function useAuthorGet(id: number): any;
5
- //# sourceMappingURL=handlers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["handlers.ts"],"names":[],"mappings":"AAMA,wBAAgB,eAAe,QAG9B;AAED,wBAAgB,eAAe,QAG9B;AAED,wBAAgB,eAAe,QAG9B;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,OAMtC"}
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useAuthorCreate = useAuthorCreate;
4
- exports.useAuthorDelete = useAuthorDelete;
5
- exports.useAuthorUpdate = useAuthorUpdate;
6
- exports.useAuthorGet = useAuthorGet;
7
- const use_default_mutation_1 = require("@/hooks/use-default-mutation");
8
- const react_query_1 = require("@tanstack/react-query");
9
- const requests_1 = require("./requests");
10
- const scope = "author";
11
- function useAuthorCreate() {
12
- const { authorCreate } = (0, requests_1.requests)();
13
- return (0, use_default_mutation_1.useDefaultMutation)(scope, "create", authorCreate);
14
- }
15
- function useAuthorDelete() {
16
- const { authorDelete } = (0, requests_1.requests)();
17
- return (0, use_default_mutation_1.useDefaultMutation)(scope, "delete", authorDelete);
18
- }
19
- function useAuthorUpdate() {
20
- const { authorUpdate } = (0, requests_1.requests)();
21
- return (0, use_default_mutation_1.useDefaultMutation)(scope, "update", authorUpdate);
22
- }
23
- function useAuthorGet(id) {
24
- const { authorGet } = (0, requests_1.requests)();
25
- return (0, react_query_1.useQuery)({
26
- queryKey: [scope, "get"],
27
- queryFn: () => authorGet(id),
28
- });
29
- }
30
- //# sourceMappingURL=handlers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"handlers.js","sourceRoot":"","sources":["handlers.ts"],"names":[],"mappings":";;AAMA,0CAGC;AAED,0CAGC;AAED,0CAGC;AAED,oCAMC;AA3BD,uEAAkE;AAClE,uDAAiD;AACjD,yCAAsC;AAEtC,MAAM,KAAK,GAAG,QAAQ,CAAC;AAEvB,SAAgB,eAAe;IAC7B,MAAM,EAAE,YAAY,EAAE,GAAG,IAAA,mBAAQ,GAAE,CAAC;IACpC,OAAO,IAAA,yCAAkB,EAAC,KAAK,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;AAC3D,CAAC;AAED,SAAgB,eAAe;IAC7B,MAAM,EAAE,YAAY,EAAE,GAAG,IAAA,mBAAQ,GAAE,CAAC;IACpC,OAAO,IAAA,yCAAkB,EAAC,KAAK,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;AAC3D,CAAC;AAED,SAAgB,eAAe;IAC7B,MAAM,EAAE,YAAY,EAAE,GAAG,IAAA,mBAAQ,GAAE,CAAC;IACpC,OAAO,IAAA,yCAAkB,EAAC,KAAK,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;AAC3D,CAAC;AAED,SAAgB,YAAY,CAAC,EAAU;IACrC,MAAM,EAAE,SAAS,EAAE,GAAG,IAAA,mBAAQ,GAAE,CAAC;IACjC,OAAO,IAAA,sBAAQ,EAAC;QACd,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;QACxB,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC;KAC7B,CAAC,CAAC;AACL,CAAC"}
@@ -1,10 +0,0 @@
1
- import { PaginationParams } from "@/types";
2
- import { Author } from "@/types/models";
3
- export declare function requests(): {
4
- authorCreate: (data: Author) => Promise<any>;
5
- authorUpdate: (id: number, data: Author) => Promise<any>;
6
- authorDelete: (ids: number[]) => Promise<any>;
7
- authorList: (params: PaginationParams) => Promise<any>;
8
- authorGet: (id: number) => Promise<any>;
9
- };
10
- //# sourceMappingURL=requests.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["requests.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,gBAAgB,EAAoB,MAAM,SAAS,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAGxC,wBAAgB,QAAQ;yBAgBY,MAAM;uBAgBR,MAAM,QAAQ,MAAM;wBARnB,MAAM,EAAE;yBArBP,gBAAgB;oBAOrB,MAAM;EAqCpC"}
@@ -1,48 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.requests = requests;
4
- const use_app_1 = require("@/hooks/use-app");
5
- const http_method_1 = require("@/types/http-method");
6
- function requests() {
7
- const { request } = (0, use_app_1.useApp)();
8
- const authorList = async (params) => {
9
- return request({
10
- url: "/author",
11
- params,
12
- });
13
- };
14
- const authorGet = async (id) => {
15
- return request({
16
- url: `/author/${id}`,
17
- });
18
- };
19
- const authorCreate = async (data) => {
20
- return request({
21
- url: "/author",
22
- method: http_method_1.HttpMethod.POST,
23
- data: data,
24
- });
25
- };
26
- const authorDelete = async (ids) => {
27
- return request({
28
- url: "/author",
29
- data: { ids },
30
- method: http_method_1.HttpMethod.DELETE,
31
- });
32
- };
33
- const authorUpdate = async (id, data) => {
34
- return request({
35
- url: `/author/${id}`,
36
- method: http_method_1.HttpMethod.PATCH,
37
- data: data,
38
- });
39
- };
40
- return {
41
- authorCreate,
42
- authorUpdate,
43
- authorDelete,
44
- authorList,
45
- authorGet,
46
- };
47
- }
48
- //# sourceMappingURL=requests.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"requests.js","sourceRoot":"","sources":["requests.ts"],"names":[],"mappings":";;AAKA,4BA+CC;AApDD,6CAAyC;AAGzC,qDAAiD;AAEjD,SAAgB,QAAQ;IACtB,MAAM,EAAE,OAAO,EAAE,GAAG,IAAA,gBAAM,GAAE,CAAC;IAE7B,MAAM,UAAU,GAAG,KAAK,EAAE,MAAwB,EAAE,EAAE;QACpD,OAAO,OAAO,CAA2B;YACvC,GAAG,EAAE,SAAS;YACd,MAAM;SACP,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,SAAS,GAAG,KAAK,EAAE,EAAU,EAAE,EAAE;QACrC,OAAO,OAAO,CAAS;YACrB,GAAG,EAAE,WAAW,EAAE,EAAE;SACrB,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,YAAY,GAAG,KAAK,EAAE,IAAY,EAAE,EAAE;QAC1C,OAAO,OAAO,CAAS;YACrB,GAAG,EAAE,SAAS;YACd,MAAM,EAAE,wBAAU,CAAC,IAAI;YACvB,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,YAAY,GAAG,KAAK,EAAE,GAAa,EAAE,EAAE;QAC3C,OAAO,OAAO,CAAS;YACrB,GAAG,EAAE,SAAS;YACd,IAAI,EAAE,EAAE,GAAG,EAAE;YACb,MAAM,EAAE,wBAAU,CAAC,MAAM;SAC1B,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,YAAY,GAAG,KAAK,EAAE,EAAU,EAAE,IAAY,EAAE,EAAE;QACtD,OAAO,OAAO,CAAS;YACrB,GAAG,EAAE,WAAW,EAAE,EAAE;YACpB,MAAM,EAAE,wBAAU,CAAC,KAAK;YACxB,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO;QACL,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,UAAU;QACV,SAAS;KACV,CAAC;AACJ,CAAC"}
@@ -1,9 +0,0 @@
1
- import { Category } from "@/types/models";
2
- export type CategoryCreatePanelRef = {
3
- submit: () => void;
4
- };
5
- export type CategoryCreatePanelProps = {
6
- onCreated?: (data: Category) => void;
7
- };
8
- export declare const CategoryCreatePanel: any;
9
- //# sourceMappingURL=create-panel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-panel.d.ts","sourceRoot":"","sources":["create-panel.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI1C,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;CACtC,CAAC;AAEF,eAAO,MAAM,mBAAmB,KA8B/B,CAAC"}
@@ -1,48 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.CategoryCreatePanel = void 0;
27
- const form_panel_1 = __importStar(require("@/components/custom/form-panel"));
28
- const person_type_1 = require("@/features/person-type");
29
- const react_1 = require("react");
30
- const react_i18next_1 = require("react-i18next");
31
- exports.CategoryCreatePanel = (0, react_1.forwardRef)(({ onCreated }, ref) => {
32
- const formRef = (0, react_1.useRef)(null);
33
- const { t } = (0, react_i18next_1.useTranslation)(["category", "actions"]);
34
- const { mutateAsync: createCategory } = (0, person_type_1.useCategoryCreate)();
35
- (0, react_1.useImperativeHandle)(ref, () => ({
36
- submit: () => {
37
- var _a;
38
- (_a = formRef.current) === null || _a === void 0 ? void 0 : _a.submit();
39
- },
40
- }), [formRef]);
41
- return (<form_panel_1.default ref={formRef} fields={[...(0, form_panel_1.getFieldsLocale)([{ name: "name" }])]} button={{ text: t("create", { ns: "actions" }) }} onSubmit={async (data) => {
42
- const createdData = await createCategory(data);
43
- if (typeof onCreated === "function") {
44
- onCreated(createdData);
45
- }
46
- }}/>);
47
- });
48
- //# sourceMappingURL=create-panel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-panel.js","sourceRoot":"","sources":["create-panel.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6EAGwC;AAExC,wDAA2D;AAE3D,iCAAgE;AAChE,iDAA+C;AAUlC,QAAA,mBAAmB,GAAG,IAAA,kBAAU,EAC3C,CAAC,EAAE,SAAS,EAA4B,EAAE,GAAG,EAAE,EAAE;IAC/C,MAAM,OAAO,GAAG,IAAA,cAAM,EAAe,IAAI,CAAC,CAAC;IAC3C,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,8BAAc,EAAC,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC;IACtD,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,IAAA,+BAAiB,GAAE,CAAC;IAE5D,IAAA,2BAAmB,EACjB,GAAG,EACH,GAAG,EAAE,CAAC,CAAC;QACL,MAAM,EAAE,GAAG,EAAE;;YACX,MAAA,OAAO,CAAC,OAAO,0CAAE,MAAM,EAAE,CAAC;QAC5B,CAAC;KACF,CAAC,EACF,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,OAAO,CACL,CAAC,oBAAS,CACR,GAAG,CAAC,CAAC,OAAO,CAAC,CACb,MAAM,CAAC,CAAC,CAAC,GAAG,IAAA,4BAAe,EAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CACjD,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CACjD,QAAQ,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;YACvB,MAAM,WAAW,GAAG,MAAM,cAAc,CAAC,IAAI,CAAC,CAAC;YAC/C,IAAI,OAAO,SAAS,KAAK,UAAU,EAAE,CAAC;gBACpC,SAAS,CAAC,WAAW,CAAC,CAAC;YACzB,CAAC;QACH,CAAC,CAAC,EACF,CACH,CAAC;AACJ,CAAC,CACF,CAAC"}
@@ -1,7 +0,0 @@
1
- import { Category } from "@/types/models";
2
- export type CategoryUpdatePanelProps = {
3
- data: Category;
4
- onUpdated?: (data: Category) => void;
5
- };
6
- export declare const CategoryUpdatePanel: any;
7
- //# sourceMappingURL=update-panel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-panel.d.ts","sourceRoot":"","sources":["update-panel.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI1C,MAAM,MAAM,wBAAwB,GAAG;IACrC,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;CACtC,CAAC;AAEF,eAAO,MAAM,mBAAmB,KAwC/B,CAAC"}
@@ -1,61 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.CategoryUpdatePanel = void 0;
30
- const form_panel_1 = __importStar(require("@/components/custom/form-panel"));
31
- const overlay_1 = require("@/components/custom/overlay");
32
- const tab_panel_1 = require("@/components/custom/tab-panel");
33
- const category_1 = require("@/features/category");
34
- const use_effect_after_first_update_1 = __importDefault(require("@/hooks/use-effect-after-first-update"));
35
- const i18next_1 = require("i18next");
36
- const react_1 = require("react");
37
- exports.CategoryUpdatePanel = (0, react_1.forwardRef)(({ data, onUpdated }, ref) => {
38
- const { data: item, isLoading } = (0, category_1.useCategoryGet)(data.id);
39
- const { mutate: categoryUpdate } = (0, category_1.useCategoryUpdate)();
40
- const formRef = (0, react_1.useRef)(null);
41
- (0, use_effect_after_first_update_1.default)(() => {
42
- if (item && formRef.current) {
43
- formRef.current.setValuesFromItem(item);
44
- }
45
- }, [item]);
46
- (0, react_1.useImperativeHandle)(ref, () => ({}));
47
- return (<tab_panel_1.TabPanel activeTabIndex={0} tabs={[
48
- {
49
- title: (0, i18next_1.t)("details", { ns: "actions" }),
50
- children: (<overlay_1.Overlay loading={isLoading}>
51
- <form_panel_1.default ref={formRef} fields={[...(0, form_panel_1.getFieldsLocale)([{ name: "name" }])]} button={{ text: (0, i18next_1.t)("save", { ns: "actions" }) }} onSubmit={(data) => {
52
- categoryUpdate({ id: data.id, data });
53
- if (typeof onUpdated === "function") {
54
- onUpdated(data);
55
- }
56
- }}/>
57
- </overlay_1.Overlay>),
58
- },
59
- ]}/>);
60
- });
61
- //# sourceMappingURL=update-panel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-panel.js","sourceRoot":"","sources":["update-panel.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6EAGwC;AACxC,yDAAsD;AACtD,6DAAyD;AAEzD,kDAAwE;AACxE,0GAA8E;AAE9E,qCAA4B;AAC5B,iCAAgE;AAOnD,QAAA,mBAAmB,GAAG,IAAA,kBAAU,EAC3C,CAAC,EAAE,IAAI,EAAE,SAAS,EAA4B,EAAE,GAAG,EAAE,EAAE;IACrD,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,IAAA,yBAAc,EAAC,IAAI,CAAC,EAAY,CAAC,CAAC;IACpE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,IAAA,4BAAiB,GAAE,CAAC;IACvD,MAAM,OAAO,GAAG,IAAA,cAAM,EAAe,IAAI,CAAC,CAAC;IAE3C,IAAA,uCAAyB,EAAC,GAAG,EAAE;QAC7B,IAAI,IAAI,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YAC5B,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAC1C,CAAC;IACH,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,IAAA,2BAAmB,EAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAErC,OAAO,CACL,CAAC,oBAAQ,CACP,cAAc,CAAC,CAAC,CAAC,CAAC,CAClB,IAAI,CAAC,CAAC;YACJ;gBACE,KAAK,EAAE,IAAA,WAAC,EAAC,SAAS,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC;gBACtC,QAAQ,EAAE,CACR,CAAC,iBAAO,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAC1B;gBAAA,CAAC,oBAAS,CACR,GAAG,CAAC,CAAC,OAAO,CAAC,CACb,MAAM,CAAC,CAAC,CAAC,GAAG,IAAA,4BAAe,EAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CACjD,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,IAAA,WAAC,EAAC,MAAM,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAC/C,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE;wBACjB,cAAc,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;wBACtC,IAAI,OAAO,SAAS,KAAK,UAAU,EAAE,CAAC;4BACpC,SAAS,CAAC,IAAI,CAAC,CAAC;wBAClB,CAAC;oBACH,CAAC,CAAC,EAEN;cAAA,EAAE,iBAAO,CAAC,CACX;aACF;SACF,CAAC,EACF,CACH,CAAC;AACJ,CAAC,CACF,CAAC"}
@@ -1,5 +0,0 @@
1
- export declare function useCategoryCreate(): any;
2
- export declare function useCategoryDelete(): any;
3
- export declare function useCategoryUpdate(): any;
4
- export declare function useCategoryGet(id: number): any;
5
- //# sourceMappingURL=handlers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["handlers.ts"],"names":[],"mappings":"AAMA,wBAAgB,iBAAiB,QAGhC;AAED,wBAAgB,iBAAiB,QAGhC;AAED,wBAAgB,iBAAiB,QAGhC;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,OAMxC"}
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useCategoryCreate = useCategoryCreate;
4
- exports.useCategoryDelete = useCategoryDelete;
5
- exports.useCategoryUpdate = useCategoryUpdate;
6
- exports.useCategoryGet = useCategoryGet;
7
- const use_default_mutation_1 = require("@/hooks/use-default-mutation");
8
- const react_query_1 = require("@tanstack/react-query");
9
- const requests_1 = require("./requests");
10
- const scope = "category";
11
- function useCategoryCreate() {
12
- const { categoryCreate } = (0, requests_1.requests)();
13
- return (0, use_default_mutation_1.useDefaultMutation)(scope, "create", categoryCreate);
14
- }
15
- function useCategoryDelete() {
16
- const { categoryDelete } = (0, requests_1.requests)();
17
- return (0, use_default_mutation_1.useDefaultMutation)(scope, "delete", categoryDelete);
18
- }
19
- function useCategoryUpdate() {
20
- const { categoryUpdate } = (0, requests_1.requests)();
21
- return (0, use_default_mutation_1.useDefaultMutation)(scope, "update", categoryUpdate);
22
- }
23
- function useCategoryGet(id) {
24
- const { categoryGet } = (0, requests_1.requests)();
25
- return (0, react_query_1.useQuery)({
26
- queryKey: [scope, "get"],
27
- queryFn: () => categoryGet(id),
28
- });
29
- }
30
- //# sourceMappingURL=handlers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"handlers.js","sourceRoot":"","sources":["handlers.ts"],"names":[],"mappings":";;AAMA,8CAGC;AAED,8CAGC;AAED,8CAGC;AAED,wCAMC;AA3BD,uEAAkE;AAClE,uDAAiD;AACjD,yCAAsC;AAEtC,MAAM,KAAK,GAAG,UAAU,CAAC;AAEzB,SAAgB,iBAAiB;IAC/B,MAAM,EAAE,cAAc,EAAE,GAAG,IAAA,mBAAQ,GAAE,CAAC;IACtC,OAAO,IAAA,yCAAkB,EAAC,KAAK,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC;AAC7D,CAAC;AAED,SAAgB,iBAAiB;IAC/B,MAAM,EAAE,cAAc,EAAE,GAAG,IAAA,mBAAQ,GAAE,CAAC;IACtC,OAAO,IAAA,yCAAkB,EAAC,KAAK,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC;AAC7D,CAAC;AAED,SAAgB,iBAAiB;IAC/B,MAAM,EAAE,cAAc,EAAE,GAAG,IAAA,mBAAQ,GAAE,CAAC;IACtC,OAAO,IAAA,yCAAkB,EAAC,KAAK,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC;AAC7D,CAAC;AAED,SAAgB,cAAc,CAAC,EAAU;IACvC,MAAM,EAAE,WAAW,EAAE,GAAG,IAAA,mBAAQ,GAAE,CAAC;IACnC,OAAO,IAAA,sBAAQ,EAAC;QACd,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;QACxB,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC;KAC/B,CAAC,CAAC;AACL,CAAC"}
@@ -1,10 +0,0 @@
1
- import { PaginationParams } from "@/types";
2
- import { Category } from "@/types/models";
3
- export declare function requests(): {
4
- categoryCreate: (data: Category) => Promise<any>;
5
- categoryUpdate: (id: number, data: Category) => Promise<any>;
6
- categoryDelete: (ids: number[]) => Promise<any>;
7
- categoryList: (params: PaginationParams) => Promise<any>;
8
- categoryGet: (id: number) => Promise<any>;
9
- };
10
- //# sourceMappingURL=requests.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["requests.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,gBAAgB,EAAoB,MAAM,SAAS,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI1C,wBAAgB,QAAQ;2BAgBc,QAAQ;yBAgBV,MAAM,QAAQ,QAAQ;0BARrB,MAAM,EAAE;2BArBP,gBAAgB;sBAOrB,MAAM;EAqCtC"}
@@ -1,49 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.requests = requests;
4
- const use_app_1 = require("@/hooks/use-app");
5
- const http_method_1 = require("@/types/http-method");
6
- const utils_1 = require("@hedhog/utils");
7
- function requests() {
8
- const { request } = (0, use_app_1.useApp)();
9
- const categoryList = async (params) => {
10
- return request({
11
- url: "/category",
12
- params,
13
- });
14
- };
15
- const categoryGet = async (id) => {
16
- return request({
17
- url: `/category/${id}`,
18
- });
19
- };
20
- const categoryCreate = async (data) => {
21
- return request({
22
- url: "/category",
23
- method: http_method_1.HttpMethod.POST,
24
- data: (0, utils_1.formatDataWithLocale)(data),
25
- });
26
- };
27
- const categoryDelete = async (ids) => {
28
- return request({
29
- url: "/category",
30
- data: { ids },
31
- method: http_method_1.HttpMethod.DELETE,
32
- });
33
- };
34
- const categoryUpdate = async (id, data) => {
35
- return request({
36
- url: `/category/${id}`,
37
- method: http_method_1.HttpMethod.PATCH,
38
- data: (0, utils_1.formatDataWithLocale)(data),
39
- });
40
- };
41
- return {
42
- categoryCreate,
43
- categoryUpdate,
44
- categoryDelete,
45
- categoryList,
46
- categoryGet,
47
- };
48
- }
49
- //# sourceMappingURL=requests.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"requests.js","sourceRoot":"","sources":["requests.ts"],"names":[],"mappings":";;AAMA,4BA+CC;AArDD,6CAAyC;AAGzC,qDAAiD;AACjD,yCAAqD;AAErD,SAAgB,QAAQ;IACtB,MAAM,EAAE,OAAO,EAAE,GAAG,IAAA,gBAAM,GAAE,CAAC;IAE7B,MAAM,YAAY,GAAG,KAAK,EAAE,MAAwB,EAAE,EAAE;QACtD,OAAO,OAAO,CAA6B;YACzC,GAAG,EAAE,WAAW;YAChB,MAAM;SACP,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,KAAK,EAAE,EAAU,EAAE,EAAE;QACvC,OAAO,OAAO,CAAW;YACvB,GAAG,EAAE,aAAa,EAAE,EAAE;SACvB,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,cAAc,GAAG,KAAK,EAAE,IAAc,EAAE,EAAE;QAC9C,OAAO,OAAO,CAAW;YACvB,GAAG,EAAE,WAAW;YAChB,MAAM,EAAE,wBAAU,CAAC,IAAI;YACvB,IAAI,EAAE,IAAA,4BAAoB,EAAC,IAAI,CAAC;SACjC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,cAAc,GAAG,KAAK,EAAE,GAAa,EAAE,EAAE;QAC7C,OAAO,OAAO,CAAS;YACrB,GAAG,EAAE,WAAW;YAChB,IAAI,EAAE,EAAE,GAAG,EAAE;YACb,MAAM,EAAE,wBAAU,CAAC,MAAM;SAC1B,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,cAAc,GAAG,KAAK,EAAE,EAAU,EAAE,IAAc,EAAE,EAAE;QAC1D,OAAO,OAAO,CAAW;YACvB,GAAG,EAAE,aAAa,EAAE,EAAE;YACtB,MAAM,EAAE,wBAAU,CAAC,KAAK;YACxB,IAAI,EAAE,IAAA,4BAAoB,EAAC,IAAI,CAAC;SACjC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,OAAO;QACL,cAAc;QACd,cAAc;QACd,cAAc;QACd,YAAY;QACZ,WAAW;KACZ,CAAC;AACJ,CAAC"}
@@ -1,9 +0,0 @@
1
- import { Post } from "@/types/models";
2
- export type PostCreatePanelRef = {
3
- submit: () => void;
4
- };
5
- export type PostCreatePanelProps = {
6
- onCreated?: (data: Post) => void;
7
- };
8
- export declare const PostCreatePanel: any;
9
- //# sourceMappingURL=create-panel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-panel.d.ts","sourceRoot":"","sources":["create-panel.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAItC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,eAAe,KA0D3B,CAAC"}
@@ -1,54 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.PostCreatePanel = void 0;
7
- const form_panel_1 = __importDefault(require("@/components/custom/form-panel"));
8
- const EnumFieldType_1 = require("@/enums/EnumFieldType");
9
- const person_type_1 = require("@/features/person-type");
10
- const react_1 = require("react");
11
- const react_i18next_1 = require("react-i18next");
12
- exports.PostCreatePanel = (0, react_1.forwardRef)(({ onCreated }, ref) => {
13
- const formRef = (0, react_1.useRef)(null);
14
- const { t } = (0, react_i18next_1.useTranslation)(["post", "actions"]);
15
- const { mutateAsync: createPost } = (0, person_type_1.usePostCreate)();
16
- (0, react_1.useImperativeHandle)(ref, () => ({
17
- submit: () => {
18
- var _a;
19
- (_a = formRef.current) === null || _a === void 0 ? void 0 : _a.submit();
20
- },
21
- }), [formRef]);
22
- return (<form_panel_1.default ref={formRef} fields={[
23
- {
24
- name: "title",
25
- label: { text: t("title", { ns: "translation" }) },
26
- type: EnumFieldType_1.EnumFieldType.TEXT,
27
- required: true,
28
- },
29
- {
30
- name: "content",
31
- label: { text: t("content", { ns: "translation" }) },
32
- type: EnumFieldType_1.EnumFieldType.TEXT,
33
- required: true,
34
- },
35
- {
36
- name: "author_id",
37
- label: { text: t("author_id", { ns: "translation" }) },
38
- type: EnumFieldType_1.EnumFieldType.TEXT,
39
- required: true,
40
- },
41
- {
42
- name: "category_id",
43
- label: { text: t("category_id", { ns: "translation" }) },
44
- type: EnumFieldType_1.EnumFieldType.TEXT,
45
- required: true,
46
- },
47
- ]} button={{ text: t("create", { ns: "actions" }) }} onSubmit={async (data) => {
48
- const createdData = await createPost(data);
49
- if (typeof onCreated === "function") {
50
- onCreated(createdData);
51
- }
52
- }}/>);
53
- });
54
- //# sourceMappingURL=create-panel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-panel.js","sourceRoot":"","sources":["create-panel.tsx"],"names":[],"mappings":";;;;;;AAAA,gFAAyE;AACzE,yDAAsD;AACtD,wDAAuD;AAEvD,iCAAgE;AAChE,iDAA+C;AAUlC,QAAA,eAAe,GAAG,IAAA,kBAAU,EACvC,CAAC,EAAE,SAAS,EAAwB,EAAE,GAAG,EAAE,EAAE;IAC3C,MAAM,OAAO,GAAG,IAAA,cAAM,EAAe,IAAI,CAAC,CAAC;IAC3C,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,8BAAc,EAAC,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;IAClD,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,IAAA,2BAAa,GAAE,CAAC;IAEpD,IAAA,2BAAmB,EACjB,GAAG,EACH,GAAG,EAAE,CAAC,CAAC;QACL,MAAM,EAAE,GAAG,EAAE;;YACX,MAAA,OAAO,CAAC,OAAO,0CAAE,MAAM,EAAE,CAAC;QAC5B,CAAC;KACF,CAAC,EACF,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,OAAO,CACL,CAAC,oBAAS,CACR,GAAG,CAAC,CAAC,OAAO,CAAC,CACb,MAAM,CAAC,CAAC;YACN;gBACE,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE;gBAClD,IAAI,EAAE,6BAAa,CAAC,IAAI;gBACxB,QAAQ,EAAE,IAAI;aACf;YAED;gBACE,IAAI,EAAE,SAAS;gBACf,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,SAAS,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE;gBACpD,IAAI,EAAE,6BAAa,CAAC,IAAI;gBACxB,QAAQ,EAAE,IAAI;aACf;YAED;gBACE,IAAI,EAAE,WAAW;gBACjB,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE;gBACtD,IAAI,EAAE,6BAAa,CAAC,IAAI;gBACxB,QAAQ,EAAE,IAAI;aACf;YAED;gBACE,IAAI,EAAE,aAAa;gBACnB,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,aAAa,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE;gBACxD,IAAI,EAAE,6BAAa,CAAC,IAAI;gBACxB,QAAQ,EAAE,IAAI;aACf;SACF,CAAC,CACF,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CACjD,QAAQ,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;YACvB,MAAM,WAAW,GAAG,MAAM,UAAU,CAAC,IAAI,CAAC,CAAC;YAC3C,IAAI,OAAO,SAAS,KAAK,UAAU,EAAE,CAAC;gBACpC,SAAS,CAAC,WAAW,CAAC,CAAC;YACzB,CAAC;QACH,CAAC,CAAC,EACF,CACH,CAAC;AACJ,CAAC,CACF,CAAC"}
@@ -1,7 +0,0 @@
1
- import { Post } from "@/types/models";
2
- export type PostUpdatePanelProps = {
3
- data: Post;
4
- onUpdated?: (data: Post) => void;
5
- };
6
- export declare const PostUpdatePanel: any;
7
- //# sourceMappingURL=update-panel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-panel.d.ts","sourceRoot":"","sources":["update-panel.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAItC,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,IAAI,CAAC;IACX,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,eAAe,KAoE3B,CAAC"}