@orbe-agro/client-core 3.3.9 → 3.3.10

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 (110) hide show
  1. package/dist/lib/@ecme/components/shared/Container.js.map +1 -1
  2. package/dist/lib/base/@types/forms/commodities/index.js +2 -0
  3. package/dist/lib/base/@types/forms/commodities/index.js.map +1 -0
  4. package/dist/lib/base/@types/forms/index.js +2 -0
  5. package/dist/lib/base/@types/forms/index.js.map +1 -0
  6. package/dist/lib/base/@types/index.js +1 -0
  7. package/dist/lib/base/@types/index.js.map +1 -1
  8. package/dist/lib/base/@types/models/commodities/contratoBiodiesel.js +2 -0
  9. package/dist/lib/base/@types/models/commodities/contratoBiodiesel.js.map +1 -0
  10. package/dist/lib/base/@types/models/commodities/pedidoVenda.js +2 -0
  11. package/dist/lib/base/@types/models/commodities/pedidoVenda.js.map +1 -0
  12. package/dist/lib/base/@types/models/flux/categoria.js +2 -0
  13. package/dist/lib/base/@types/models/flux/categoria.js.map +1 -0
  14. package/dist/lib/base/@types/models/flux/formularioBase.js +2 -0
  15. package/dist/lib/base/@types/models/flux/formularioBase.js.map +1 -0
  16. package/dist/lib/base/@types/models/flux/grupoAtendimento.js +2 -0
  17. package/dist/lib/base/@types/models/flux/grupoAtendimento.js.map +1 -0
  18. package/dist/lib/base/@types/models/flux/processo.js +2 -0
  19. package/dist/lib/base/@types/models/flux/processo.js.map +1 -0
  20. package/dist/lib/base/@types/models/flux/subcategoria.js +2 -0
  21. package/dist/lib/base/@types/models/flux/subcategoria.js.map +1 -0
  22. package/dist/lib/base/@types/models/flux/tipoProcesso.js +2 -0
  23. package/dist/lib/base/@types/models/flux/tipoProcesso.js.map +1 -0
  24. package/dist/lib/base/components/forms/ArraysForms/GenericArrayNumberFormSection.js +51 -0
  25. package/dist/lib/base/components/forms/ArraysForms/GenericArrayNumberFormSection.js.map +1 -0
  26. package/dist/lib/base/components/forms/ArraysForms/GenericArrayStringFormSection.js +46 -0
  27. package/dist/lib/base/components/forms/ArraysForms/GenericArrayStringFormSection.js.map +1 -0
  28. package/dist/lib/base/components/forms/GenericArrayFormSection.js +75 -0
  29. package/dist/lib/base/components/forms/GenericArrayFormSection.js.map +1 -0
  30. package/dist/lib/base/components/forms/GenericNumberFormSection.js +49 -0
  31. package/dist/lib/base/components/forms/GenericNumberFormSection.js.map +1 -0
  32. package/dist/lib/base/components/forms/GenericStringFormSection.js +44 -0
  33. package/dist/lib/base/components/forms/GenericStringFormSection.js.map +1 -0
  34. package/dist/lib/base/components/forms/GenericUploadFormSection.js +48 -0
  35. package/dist/lib/base/components/forms/GenericUploadFormSection.js.map +1 -0
  36. package/dist/lib/base/components/forms/NumberFormVariant/GenericNumberFormSectionPercentage.js +55 -0
  37. package/dist/lib/base/components/forms/NumberFormVariant/GenericNumberFormSectionPercentage.js.map +1 -0
  38. package/dist/lib/base/components/forms/NumberFormVariant/GenericNumberFormSectionPrice.js +51 -0
  39. package/dist/lib/base/components/forms/NumberFormVariant/GenericNumberFormSectionPrice.js.map +1 -0
  40. package/dist/lib/base/components/forms/NumberFormVariant/GenericNumberFormSectionWeight.js +51 -0
  41. package/dist/lib/base/components/forms/NumberFormVariant/GenericNumberFormSectionWeight.js.map +1 -0
  42. package/dist/lib/base/configs/endpoints.config/adm/config/users.js +9 -9
  43. package/dist/lib/base/configs/endpoints.config/adm/config/users.js.map +1 -1
  44. package/dist/lib/base/configs/endpoints.config/commodities/commodities.js +10 -0
  45. package/dist/lib/base/configs/endpoints.config/commodities/commodities.js.map +1 -0
  46. package/dist/lib/base/configs/endpoints.config/commodities/config/contratoBiodiesel.js +11 -0
  47. package/dist/lib/base/configs/endpoints.config/commodities/config/contratoBiodiesel.js.map +1 -0
  48. package/dist/lib/base/configs/endpoints.config/commodities/config/pedidoVenda.js +12 -0
  49. package/dist/lib/base/configs/endpoints.config/commodities/config/pedidoVenda.js.map +1 -0
  50. package/dist/lib/base/configs/endpoints.config/endpoints.navigation.js +15 -9
  51. package/dist/lib/base/configs/endpoints.config/endpoints.navigation.js.map +1 -1
  52. package/dist/lib/base/configs/navigation.config/submenu/commodities/commodities.submenu.js +1 -1
  53. package/dist/lib/base/configs/navigation.config/submenu/commodities/commodities.submenu.js.map +1 -1
  54. package/dist/lib/base/configs/navigation.config/submenu/commodities/config/{pedidoDeVendas.submenu.js → pedidoVenda.submenu.js} +3 -3
  55. package/dist/lib/base/configs/navigation.config/submenu/commodities/config/pedidoVenda.submenu.js.map +1 -0
  56. package/dist/lib/base/configs/navigation.config/submenu/flux/config/subcategoria.submenu.js +5 -5
  57. package/dist/lib/base/configs/navigation.config/submenu/flux/config/subcategoria.submenu.js.map +1 -1
  58. package/dist/lib/base/index.js +50 -38
  59. package/dist/lib/base/index.js.map +1 -1
  60. package/dist/lib/base/services/index.js +18 -6
  61. package/dist/lib/base/services/index.js.map +1 -1
  62. package/dist/lib/base/services/modules/FluxService.js +304 -0
  63. package/dist/lib/base/services/modules/FluxService.js.map +1 -0
  64. package/dist/lib/base/services/modules/ObjectStorageService.js +14 -0
  65. package/dist/lib/base/services/modules/ObjectStorageService.js.map +1 -0
  66. package/dist/lib/base/services/modules/commodities/contratoBiodiesel/ContratoBiodieselService.js +44 -0
  67. package/dist/lib/base/services/modules/commodities/contratoBiodiesel/ContratoBiodieselService.js.map +1 -0
  68. package/dist/lib/base/services/modules/commodities/contratoBiodiesel/config/FilterParams.js +2 -0
  69. package/dist/lib/base/services/modules/commodities/contratoBiodiesel/config/FilterParams.js.map +1 -0
  70. package/dist/lib/base/services/modules/commodities/index.js +15 -0
  71. package/dist/lib/base/services/modules/commodities/index.js.map +1 -0
  72. package/dist/lib/base/services/modules/commodities/pedidoVenda/PedidoVendaService.js +44 -0
  73. package/dist/lib/base/services/modules/commodities/pedidoVenda/PedidoVendaService.js.map +1 -0
  74. package/dist/lib/base/services/modules/index.js +16 -3
  75. package/dist/lib/base/services/modules/index.js.map +1 -1
  76. package/dist/lib/types/base/@types/forms/commodities/index.d.ts +18 -0
  77. package/dist/lib/types/base/@types/forms/index.d.ts +12 -0
  78. package/dist/lib/types/base/@types/index.d.ts +1 -0
  79. package/dist/lib/types/base/@types/models/commodities/contratoBiodiesel.d.ts +28 -0
  80. package/dist/lib/types/base/@types/models/commodities/pedidoVenda.d.ts +21 -0
  81. package/dist/lib/types/base/@types/models/flux/categoria.d.ts +5 -0
  82. package/dist/lib/types/base/@types/models/flux/formularioBase.d.ts +19 -0
  83. package/dist/lib/types/base/@types/models/flux/grupoAtendimento.d.ts +5 -0
  84. package/dist/lib/types/base/@types/models/flux/processo.d.ts +44 -0
  85. package/dist/lib/types/base/@types/models/flux/subcategoria.d.ts +6 -0
  86. package/dist/lib/types/base/@types/models/flux/tipoProcesso.d.ts +4 -0
  87. package/dist/lib/types/base/components/forms/ArraysForms/GenericArrayNumberFormSection.d.ts +10 -0
  88. package/dist/lib/types/base/components/forms/ArraysForms/GenericArrayStringFormSection.d.ts +10 -0
  89. package/dist/lib/types/base/components/forms/GenericArrayFormSection.d.ts +21 -0
  90. package/dist/lib/types/base/components/forms/GenericNumberFormSection.d.ts +9 -0
  91. package/dist/lib/types/base/components/forms/GenericStringFormSection.d.ts +9 -0
  92. package/dist/lib/types/base/components/forms/GenericUploadFormSection.d.ts +8 -0
  93. package/dist/lib/types/base/components/forms/NumberFormVariant/GenericNumberFormSectionPercentage.d.ts +9 -0
  94. package/dist/lib/types/base/components/forms/NumberFormVariant/GenericNumberFormSectionPrice.d.ts +9 -0
  95. package/dist/lib/types/base/components/forms/NumberFormVariant/GenericNumberFormSectionWeight.d.ts +9 -0
  96. package/dist/lib/types/base/configs/endpoints.config/commodities/commodities.d.ts +51 -0
  97. package/dist/lib/types/base/configs/endpoints.config/commodities/config/contratoBiodiesel.d.ts +23 -0
  98. package/dist/lib/types/base/configs/endpoints.config/commodities/config/pedidoVenda.d.ts +27 -0
  99. package/dist/lib/types/base/configs/endpoints.config/endpoints.navigation.d.ts +108 -0
  100. package/dist/lib/types/base/configs/navigation.config/submenu/commodities/config/pedidoVenda.submenu.d.ts +3 -0
  101. package/dist/lib/types/base/services/modules/FluxService.d.ts +46 -0
  102. package/dist/lib/types/base/services/modules/ObjectStorageService.d.ts +1 -0
  103. package/dist/lib/types/base/services/modules/commodities/contratoBiodiesel/ContratoBiodieselService.d.ts +7 -0
  104. package/dist/lib/types/base/services/modules/commodities/contratoBiodiesel/config/FilterParams.d.ts +7 -0
  105. package/dist/lib/types/base/services/modules/commodities/index.d.ts +2 -0
  106. package/dist/lib/types/base/services/modules/commodities/pedidoVenda/PedidoVendaService.d.ts +7 -0
  107. package/dist/lib/types/base/services/modules/index.d.ts +1 -0
  108. package/package.json +1 -1
  109. package/dist/lib/base/configs/navigation.config/submenu/commodities/config/pedidoDeVendas.submenu.js.map +0 -1
  110. package/dist/lib/types/base/configs/navigation.config/submenu/commodities/config/pedidoDeVendas.submenu.d.ts +0 -3
@@ -1 +1 @@
1
- {"version":3,"file":"Container.js","sources":["../../../../../lib/@ecme/components/shared/Container.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport { CommonProps } from '@/@types/common'\nimport type { ElementType, Ref } from 'react'\n\ninterface ContainerProps extends CommonProps {\n asElement?: ElementType\n ref?: Ref<HTMLElement>\n}\n\nconst Container = (props: ContainerProps) => {\n const {\n className,\n children,\n asElement: Component = 'div',\n ref,\n ...rest\n } = props\n\n return (\n <Component\n ref={ref}\n className={classNames('container mx-auto', className)}\n {...rest}\n >\n {children}\n </Component>\n )\n}\n\nexport default Container\n"],"names":["Container","props","className","children","Component","ref","rest","jsx","classNames"],"mappings":";;AASM,MAAAA,IAAY,CAACC,MAA0B;AACnC,QAAA;AAAA,IACF,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAWC,IAAY;AAAA,IACvB,KAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHL;AAGA,SAAA,gBAAAM;AAAA,IAACH;AAAA,IAAA;AAAA,MACG,KAAAC;AAAA,MACA,WAAWG,EAAW,qBAAqBN,CAAS;AAAA,MACnD,GAAGI;AAAA,MAEH,UAAAH;AAAA,IAAA;AAAA,EACL;AAER;"}
1
+ {"version":3,"file":"Container.js","sources":["../../../../../lib/@ecme/components/shared/Container.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport { CommonProps } from '@/@types/common'\nimport type { ElementType, Ref } from 'react'\n\ninterface ContainerProps extends CommonProps {\n asElement?: ElementType\n ref?: Ref<HTMLElement>\n}\n\nconst Container = (props: ContainerProps) => {\n const {\n className,\n children,\n asElement: Component = 'div',\n ref,\n ...rest\n } = props\n\n return (\n <Component\n ref={ref}\n className={classNames('container mx-auto', className)}\n {...rest}\n >\n {children}\n </Component>\n )\n}\n\nexport default Container"],"names":["Container","props","className","children","Component","ref","rest","jsx","classNames"],"mappings":";;AASM,MAAAA,IAAY,CAACC,MAA0B;AACnC,QAAA;AAAA,IACF,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAWC,IAAY;AAAA,IACvB,KAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHL;AAGA,SAAA,gBAAAM;AAAA,IAACH;AAAA,IAAA;AAAA,MACG,KAAAC;AAAA,MACA,WAAWG,EAAW,qBAAqBN,CAAS;AAAA,MACnD,GAAGI;AAAA,MAEH,UAAAH;AAAA,IAAA;AAAA,EACL;AAER;"}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,4 +1,5 @@
1
1
  import "./api.js";
2
+ import "./forms/index.js";
2
3
  import "./models/index.js";
3
4
  import "./store/index.js";
4
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=contratoBiodiesel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contratoBiodiesel.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=pedidoVenda.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pedidoVenda.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=categoria.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"categoria.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=formularioBase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formularioBase.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=grupoAtendimento.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grupoAtendimento.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=processo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"processo.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=subcategoria.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subcategoria.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=tipoProcesso.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tipoProcesso.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,51 @@
1
+ import { jsx as e, Fragment as c } from "react/jsx-runtime";
2
+ import "../../../../@ecme/components/shared/index.js";
3
+ import "../../../../@ecme/components/ui/index.js";
4
+ import { Controller as f } from "react-hook-form";
5
+ import s from "../../../../@ecme/components/ui/Form/FormItem.js";
6
+ import h from "../../../../@ecme/components/shared/NumericInput.js";
7
+ function S({
8
+ control: n,
9
+ errors: i,
10
+ isView: l,
11
+ index: m,
12
+ label: p,
13
+ placeholder: u,
14
+ nameNumberArray: r
15
+ }) {
16
+ var t;
17
+ const o = (t = i[r]) == null ? void 0 : t[m];
18
+ return /* @__PURE__ */ e(c, { children: /* @__PURE__ */ e(
19
+ s,
20
+ {
21
+ label: p,
22
+ invalid: !!o,
23
+ errorMessage: o,
24
+ children: /* @__PURE__ */ e(
25
+ f,
26
+ {
27
+ name: r,
28
+ control: n,
29
+ render: ({ field: a }) => /* @__PURE__ */ e(
30
+ h,
31
+ {
32
+ thousandSeparator: !0,
33
+ type: "text",
34
+ autoComplete: "off",
35
+ placeholder: u,
36
+ displayType: "input",
37
+ value: a.value,
38
+ disabled: l,
39
+ decimalScale: 2,
40
+ onValueChange: (d) => a.onChange(d.floatValue ?? 0)
41
+ }
42
+ )
43
+ }
44
+ )
45
+ }
46
+ ) });
47
+ }
48
+ export {
49
+ S as default
50
+ };
51
+ //# sourceMappingURL=GenericArrayNumberFormSection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenericArrayNumberFormSection.js","sources":["../../../../../../lib/base/components/forms/ArraysForms/GenericArrayNumberFormSection.tsx"],"sourcesContent":["import { NumericInput } from '@/components/shared'\nimport { FormItem } from '@/components/ui'\nimport { IFormSectionBaseProps } from '@base/@types/forms'\nimport { Controller, FieldErrors, FieldValues, Path } from 'react-hook-form'\n\ntype GeneralFormSectionProps<T extends FieldValues> =\n IFormSectionBaseProps<T> & {\n index: number\n label: string\n placeholder: string\n nameNumberArray: Path<T>\n }\n\nfunction GenericArrayNumberFormSection<T extends FieldValues>({\n control,\n errors,\n isView,\n index,\n label,\n placeholder,\n nameNumberArray\n}: GeneralFormSectionProps<T>) {\n const fieldError = (\n (errors as FieldErrors<T>)[nameNumberArray] as unknown as Record<\n number,\n string\n >\n )?.[index]\n\n return (\n <>\n <FormItem\n label={label}\n invalid={Boolean(fieldError)}\n errorMessage={fieldError}\n >\n <Controller\n name={nameNumberArray}\n control={control}\n render={({ field }) => (\n <NumericInput\n thousandSeparator\n type=\"text\"\n autoComplete=\"off\"\n placeholder={placeholder}\n displayType=\"input\"\n value={field.value}\n disabled={isView}\n decimalScale={2}\n onValueChange={(e) =>\n field.onChange(e.floatValue ?? 0)\n }\n />\n )}\n />\n </FormItem>\n </>\n )\n}\n\nexport default GenericArrayNumberFormSection\n"],"names":["GenericArrayNumberFormSection","control","errors","isView","index","label","placeholder","nameNumberArray","fieldError","_a","jsx","Fragment","FormItem","Controller","field","NumericInput","e"],"mappings":";;;;;;AAaA,SAASA,EAAqD;AAAA,EAC1D,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,iBAAAC;AACJ,GAA+B;;AAC3B,QAAMC,KACDC,IAAAP,EAA0BK,CAAe,MAAzC,gBAAAE,EAIDL;AAEJ,SAEQ,gBAAAM,EAAAC,GAAA,EAAA,UAAA,gBAAAD;AAAA,IAACE;AAAA,IAAA;AAAA,MACG,OAAAP;AAAA,MACA,SAAS,EAAQG;AAAA,MACjB,cAAcA;AAAA,MAEd,UAAA,gBAAAE;AAAA,QAACG;AAAA,QAAA;AAAA,UACG,MAAMN;AAAA,UACN,SAAAN;AAAA,UACA,QAAQ,CAAC,EAAE,OAAAa,EAAA,MACP,gBAAAJ;AAAA,YAACK;AAAA,YAAA;AAAA,cACG,mBAAiB;AAAA,cACjB,MAAK;AAAA,cACL,cAAa;AAAA,cACb,aAAAT;AAAA,cACA,aAAY;AAAA,cACZ,OAAOQ,EAAM;AAAA,cACb,UAAUX;AAAA,cACV,cAAc;AAAA,cACd,eAAe,CAACa,MACZF,EAAM,SAASE,EAAE,cAAc,CAAC;AAAA,YAAA;AAAA,UAAA;AAAA,QAExC;AAAA,MAAA;AAAA,IAER;AAAA,EAAA,GAER;AAER;"}
@@ -0,0 +1,46 @@
1
+ import { jsx as r, Fragment as f } from "react/jsx-runtime";
2
+ import "../../../../@ecme/components/ui/index.js";
3
+ import { Controller as c } from "react-hook-form";
4
+ import s from "../../../../@ecme/components/ui/Form/FormItem.js";
5
+ import u from "../../../../@ecme/components/ui/Input/Input.js";
6
+ function b({
7
+ control: i,
8
+ errors: n,
9
+ isView: m,
10
+ index: d,
11
+ label: l,
12
+ placeholder: p,
13
+ nameStringArray: e
14
+ }) {
15
+ var t;
16
+ const o = (t = n[e]) == null ? void 0 : t[d];
17
+ return /* @__PURE__ */ r(f, { children: /* @__PURE__ */ r(
18
+ s,
19
+ {
20
+ label: l,
21
+ invalid: !!o,
22
+ errorMessage: o,
23
+ children: /* @__PURE__ */ r(
24
+ c,
25
+ {
26
+ name: e,
27
+ control: i,
28
+ render: ({ field: a }) => /* @__PURE__ */ r(
29
+ u,
30
+ {
31
+ required: !0,
32
+ disabled: m,
33
+ type: "text",
34
+ placeholder: p,
35
+ ...a
36
+ }
37
+ )
38
+ }
39
+ )
40
+ }
41
+ ) });
42
+ }
43
+ export {
44
+ b as default
45
+ };
46
+ //# sourceMappingURL=GenericArrayStringFormSection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenericArrayStringFormSection.js","sources":["../../../../../../lib/base/components/forms/ArraysForms/GenericArrayStringFormSection.tsx"],"sourcesContent":["import { FormItem, Input } from '@/components/ui'\nimport { IFormSectionBaseProps } from '@base/@types/forms'\nimport { Controller, FieldErrors, FieldValues, Path } from 'react-hook-form'\n\ntype GeneralFormSectionProps<T extends FieldValues> =\n IFormSectionBaseProps<T> & {\n index: number\n label: string\n placeholder: string\n nameStringArray: Path<T>\n }\n\nfunction GenericArrayStringFormSection<T extends FieldValues>({\n control,\n errors,\n isView,\n index,\n label,\n placeholder,\n nameStringArray,\n}: GeneralFormSectionProps<T>) {\n const fieldError = ((errors as FieldErrors<T>)[nameStringArray] as unknown as Record<number, string>)?.[index]\n\n return (\n <>\n <FormItem\n label={label}\n invalid={Boolean(fieldError)}\n errorMessage={fieldError}\n >\n <Controller\n name={nameStringArray}\n control={control}\n render={({ field }) => (\n <Input\n required\n disabled={isView}\n type=\"text\"\n placeholder={placeholder}\n {...field}\n />\n )}\n />\n </FormItem>\n </>\n )\n}\n\nexport default GenericArrayStringFormSection\n"],"names":["GenericArrayStringFormSection","control","errors","isView","index","label","placeholder","nameStringArray","fieldError","_a","jsx","Fragment","FormItem","Controller","field","Input"],"mappings":";;;;;AAYA,SAASA,EAAqD;AAAA,EAC1D,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,iBAAAC;AACJ,GAA+B;;AAC3B,QAAMC,KAAeC,IAAAP,EAA0BK,CAAe,MAAzC,gBAAAE,EAAmFL;AAExG,SAEQ,gBAAAM,EAAAC,GAAA,EAAA,UAAA,gBAAAD;AAAA,IAACE;AAAA,IAAA;AAAA,MACG,OAAAP;AAAA,MACA,SAAS,EAAQG;AAAA,MACjB,cAAcA;AAAA,MAEd,UAAA,gBAAAE;AAAA,QAACG;AAAA,QAAA;AAAA,UACG,MAAMN;AAAA,UACN,SAAAN;AAAA,UACA,QAAQ,CAAC,EAAE,OAAAa,EAAA,MACP,gBAAAJ;AAAA,YAACK;AAAA,YAAA;AAAA,cACG,UAAQ;AAAA,cACR,UAAUZ;AAAA,cACV,MAAK;AAAA,cACL,aAAAG;AAAA,cACC,GAAGQ;AAAA,YAAA;AAAA,UAAA;AAAA,QACR;AAAA,MAAA;AAAA,IAER;AAAA,EAAA,GAER;AAER;"}
@@ -0,0 +1,75 @@
1
+ import { jsxs as f, jsx as a } from "react/jsx-runtime";
2
+ import { useFieldArray as x } from "react-hook-form";
3
+ import { useTranslation as v } from "react-i18next";
4
+ import { FaTrash as S } from "react-icons/fa";
5
+ import F from "./ArraysForms/GenericArrayNumberFormSection.js";
6
+ import r from "./ArraysForms/GenericArrayStringFormSection.js";
7
+ function w({
8
+ control: n,
9
+ errors: e,
10
+ isView: p,
11
+ nameArray: t,
12
+ nameCampoStringArray: b,
13
+ nameCampoNumberArray: g,
14
+ defaultAppendItem: s
15
+ }) {
16
+ var c, o, d;
17
+ const { t: m } = v(), { fields: h, append: u, remove: $ } = x({
18
+ control: n,
19
+ name: t
20
+ });
21
+ return /* @__PURE__ */ f("div", { className: "flex flex-col gap-4", children: [
22
+ h.map((N, i) => /* @__PURE__ */ f("div", { className: "flex gap-2 items-center", children: [
23
+ b.map((l) => /* @__PURE__ */ a(
24
+ r,
25
+ {
26
+ control: n,
27
+ errors: e,
28
+ isView: p,
29
+ index: i,
30
+ label: m(`page.form.${l}.label`),
31
+ placeholder: m(`page.form.${l}.placeholder`),
32
+ nameStringArray: `${t}.${i}.${l}`
33
+ },
34
+ l
35
+ )),
36
+ g.map((l) => /* @__PURE__ */ a(
37
+ F,
38
+ {
39
+ control: n,
40
+ errors: e,
41
+ isView: p,
42
+ index: i,
43
+ label: m(`page.form.${l}.label`),
44
+ placeholder: m(`page.form.${l}.placeholder`),
45
+ nameNumberArray: `${t}.${i}.${l}`
46
+ },
47
+ l
48
+ )),
49
+ /* @__PURE__ */ a(
50
+ "button",
51
+ {
52
+ type: "button",
53
+ className: "text-red-500 hover:text-red-700 ml-4",
54
+ onClick: () => $(i),
55
+ children: /* @__PURE__ */ a(S, { className: "w-5 h-5" })
56
+ }
57
+ )
58
+ ] }, N.id)),
59
+ ((c = e == null ? void 0 : e[t]) == null ? void 0 : c.message) && typeof ((o = e == null ? void 0 : e[t]) == null ? void 0 : o.message) == "string" && /* @__PURE__ */ a("p", { className: "text-red-500 text-sm mt-2", children: String(((d = e == null ? void 0 : e[t]) == null ? void 0 : d.message) || "") }),
60
+ /* @__PURE__ */ a("label", { className: "form-label mb-2", children: m(`page.form.${t}.label`) }),
61
+ /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
62
+ "button",
63
+ {
64
+ type: "button",
65
+ className: "px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600",
66
+ onClick: () => u(s),
67
+ children: m(`page.form.${t}.nameButton`)
68
+ }
69
+ ) })
70
+ ] });
71
+ }
72
+ export {
73
+ w as default
74
+ };
75
+ //# sourceMappingURL=GenericArrayFormSection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenericArrayFormSection.js","sources":["../../../../../lib/base/components/forms/GenericArrayFormSection.tsx"],"sourcesContent":["import { IFormSectionBaseProps } from '@base/@types/forms'\nimport {\n ArrayPath,\n FieldArray,\n FieldValues,\n Path,\n useFieldArray,\n} from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { FaTrash } from 'react-icons/fa'\nimport GenericArrayNumberFormSection from './ArraysForms/GenericArrayNumberFormSection'\nimport GenericArrayStringFormSection from './ArraysForms/GenericArrayStringFormSection'\n\ntype OptionType<L = string, V = unknown> = {\n label: L\n value: V\n}\n\ntype SelectConfig<L = string, V = unknown> = {\n campo: string\n valueMapper: (item: unknown) => V\n getOptionLabel: (option: OptionType<L, V>) => string\n}\n\ntype GeneralFormSectionProps<\n T extends FieldValues,\n K extends ArrayPath<T>,\n> = IFormSectionBaseProps<T> & {\n nameArray: K\n defaultAppendItem: FieldArray<T, K>\n nameCampoStringArray: string[]\n nameCampoNumberArray: string[]\n nameCampoSelectArray?: string[]\n selectConfigs?: SelectConfig[]\n}\n\nfunction GenericArrayFormSection<\n T extends FieldValues,\n K extends ArrayPath<T>,\n>({\n control,\n errors,\n isView,\n nameArray,\n nameCampoStringArray,\n nameCampoNumberArray,\n defaultAppendItem,\n}: GeneralFormSectionProps<T, K>) {\n const { t } = useTranslation()\n const { fields, append, remove } = useFieldArray({\n control,\n name: nameArray,\n })\n\n return (\n <div className=\"flex flex-col gap-4\">\n {/* Lista de margens */}\n {fields.map((field, index) => (\n <div key={field.id} className=\"flex gap-2 items-center\">\n {nameCampoStringArray.map((campo) => (\n <GenericArrayStringFormSection\n key={campo}\n control={control}\n errors={errors}\n isView={isView}\n index={index}\n label={t(`page.form.${campo}.label`)}\n placeholder={t(`page.form.${campo}.placeholder`)}\n nameStringArray={\n `${nameArray}.${index}.${campo}` as Path<T>\n }\n />\n ))}\n\n {nameCampoNumberArray.map((campo) => (\n <GenericArrayNumberFormSection\n key={campo}\n control={control}\n errors={errors}\n isView={isView}\n index={index}\n label={t(`page.form.${campo}.label`)}\n placeholder={t(`page.form.${campo}.placeholder`)}\n nameNumberArray={\n `${nameArray}.${index}.${campo}` as Path<T>\n }\n />\n ))}\n\n <button\n type=\"button\"\n className=\"text-red-500 hover:text-red-700 ml-4\"\n onClick={() => remove(index)}\n >\n <FaTrash className=\"w-5 h-5\" />\n </button>\n </div>\n ))}\n\n {errors?.[nameArray as string]?.message &&\n typeof errors?.[nameArray as string]?.message === 'string' && (\n <p className=\"text-red-500 text-sm mt-2\">\n {String(errors?.[nameArray as string]?.message || '')}\n </p>\n )}\n\n {/* Botão separado */}\n <label className=\"form-label mb-2\">\n {t(`page.form.${nameArray}.label`)}\n </label>\n <div>\n <button\n type=\"button\"\n className=\"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600\"\n onClick={() => append(defaultAppendItem)}\n >\n {t(`page.form.${nameArray}.nameButton`)}\n </button>\n </div>\n </div>\n )\n}\n\nexport default GenericArrayFormSection\n"],"names":["GenericArrayFormSection","control","errors","isView","nameArray","nameCampoStringArray","nameCampoNumberArray","defaultAppendItem","t","useTranslation","fields","append","remove","useFieldArray","jsxs","field","index","campo","jsx","GenericArrayStringFormSection","GenericArrayNumberFormSection","FaTrash","_a","_b","_c"],"mappings":";;;;;;AAoCA,SAASA,EAGP;AAAA,EACE,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,mBAAAC;AACJ,GAAkC;;AACxB,QAAA,EAAE,GAAAC,EAAE,IAAIC,EAAe,GACvB,EAAE,QAAAC,GAAQ,QAAAC,GAAQ,QAAAC,EAAA,IAAWC,EAAc;AAAA,IAC7C,SAAAZ;AAAA,IACA,MAAMG;AAAA,EAAA,CACT;AAGG,SAAA,gBAAAU,EAAC,OAAI,EAAA,WAAU,uBAEV,UAAA;AAAA,IAAAJ,EAAO,IAAI,CAACK,GAAOC,MACf,gBAAAF,EAAA,OAAA,EAAmB,WAAU,2BACzB,UAAA;AAAA,MAAqBT,EAAA,IAAI,CAACY,MACvB,gBAAAC;AAAA,QAACC;AAAA,QAAA;AAAA,UAEG,SAAAlB;AAAA,UACA,QAAAC;AAAA,UACA,QAAAC;AAAA,UACA,OAAAa;AAAA,UACA,OAAOR,EAAE,aAAaS,CAAK,QAAQ;AAAA,UACnC,aAAaT,EAAE,aAAaS,CAAK,cAAc;AAAA,UAC/C,iBACI,GAAGb,CAAS,IAAIY,CAAK,IAAIC,CAAK;AAAA,QAAA;AAAA,QAR7BA;AAAA,MAAA,CAWZ;AAAA,MAEAX,EAAqB,IAAI,CAACW,MACvB,gBAAAC;AAAA,QAACE;AAAA,QAAA;AAAA,UAEG,SAAAnB;AAAA,UACA,QAAAC;AAAA,UACA,QAAAC;AAAA,UACA,OAAAa;AAAA,UACA,OAAOR,EAAE,aAAaS,CAAK,QAAQ;AAAA,UACnC,aAAaT,EAAE,aAAaS,CAAK,cAAc;AAAA,UAC/C,iBACI,GAAGb,CAAS,IAAIY,CAAK,IAAIC,CAAK;AAAA,QAAA;AAAA,QAR7BA;AAAA,MAAA,CAWZ;AAAA,MAED,gBAAAC;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,MAAK;AAAA,UACL,WAAU;AAAA,UACV,SAAS,MAAMN,EAAOI,CAAK;AAAA,UAE3B,UAAA,gBAAAE,EAACG,GAAQ,EAAA,WAAU,UAAU,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACjC,KArCMN,EAAM,EAsChB,CACH;AAAA,MAEAO,IAAApB,KAAA,gBAAAA,EAASE,OAAT,gBAAAkB,EAA+B,YAC5B,SAAOC,IAAArB,KAAA,gBAAAA,EAASE,OAAT,gBAAAmB,EAA+B,YAAY,8BAC7C,KAAE,EAAA,WAAU,6BACR,UAAO,SAAAC,IAAAtB,KAAA,gBAAAA,EAASE,OAAT,gBAAAoB,EAA+B,YAAW,EAAE,GACxD;AAAA,IAIR,gBAAAN,EAAC,WAAM,WAAU,mBACZ,YAAE,aAAad,CAAS,QAAQ,EACrC,CAAA;AAAA,sBACC,OACG,EAAA,UAAA,gBAAAc;AAAA,MAAC;AAAA,MAAA;AAAA,QACG,MAAK;AAAA,QACL,WAAU;AAAA,QACV,SAAS,MAAMP,EAAOJ,CAAiB;AAAA,QAEtC,UAAAC,EAAE,aAAaJ,CAAS,aAAa;AAAA,MAAA;AAAA,IAAA,EAE9C,CAAA;AAAA,EAAA,GACJ;AAER;"}
@@ -0,0 +1,49 @@
1
+ import { jsx as t, Fragment as d } from "react/jsx-runtime";
2
+ import "../../../@ecme/components/ui/index.js";
3
+ import "../../../@ecme/components/shared/index.js";
4
+ import { Controller as c } from "react-hook-form";
5
+ import f from "../../../@ecme/components/ui/Form/FormItem.js";
6
+ import g from "../../../@ecme/components/shared/NumericInput.js";
7
+ function F({
8
+ control: m,
9
+ errors: e,
10
+ isView: n,
11
+ name: a,
12
+ label: l,
13
+ placeholder: p
14
+ }) {
15
+ var o;
16
+ return /* @__PURE__ */ t(d, { children: /* @__PURE__ */ t(
17
+ f,
18
+ {
19
+ label: l,
20
+ invalid: !!(e != null && e[a]),
21
+ errorMessage: (o = e == null ? void 0 : e[a]) == null ? void 0 : o.message,
22
+ children: /* @__PURE__ */ t(
23
+ c,
24
+ {
25
+ name: a,
26
+ control: m,
27
+ render: ({ field: i }) => /* @__PURE__ */ t(
28
+ g,
29
+ {
30
+ thousandSeparator: !0,
31
+ type: "text",
32
+ autoComplete: "off",
33
+ placeholder: p,
34
+ displayType: "input",
35
+ value: i.value,
36
+ disabled: n,
37
+ decimalScale: 2,
38
+ onValueChange: (u) => i.onChange(u.floatValue ?? 0)
39
+ }
40
+ )
41
+ }
42
+ )
43
+ }
44
+ ) });
45
+ }
46
+ export {
47
+ F as default
48
+ };
49
+ //# sourceMappingURL=GenericNumberFormSection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenericNumberFormSection.js","sources":["../../../../../lib/base/components/forms/GenericNumberFormSection.tsx"],"sourcesContent":["import { FormItem } from '@/components/ui'\nimport { IFormSectionBaseProps } from '@base/@types/forms'\nimport { NumericInput } from '@/components/shared'\nimport { Controller, FieldValues, Path } from 'react-hook-form'\n\ntype GeneralFormSectionProps<T extends FieldValues> =\n IFormSectionBaseProps<T> & {\n name: Path<T>\n label: string\n placeholder: string\n }\n\nfunction GenericNumberFormSection<T extends FieldValues>({\n control,\n errors,\n isView,\n name,\n label,\n placeholder,\n}: GeneralFormSectionProps<T>) {\n return (\n <>\n <FormItem\n label={label}\n invalid={Boolean(errors?.[name])}\n errorMessage={errors?.[name]?.message as string}\n >\n <Controller\n name={name}\n control={control}\n render={({ field }) => (\n <NumericInput\n thousandSeparator\n type=\"text\"\n autoComplete=\"off\"\n placeholder={placeholder}\n displayType=\"input\"\n value={field.value}\n disabled={isView}\n decimalScale={2}\n onValueChange={(e) => field.onChange(e.floatValue ?? 0)}\n />\n )}\n />\n </FormItem>\n </>\n )\n}\n\nexport default GenericNumberFormSection\n"],"names":["GenericNumberFormSection","control","errors","isView","name","label","placeholder","jsx","Fragment","FormItem","_a","Controller","field","NumericInput","e"],"mappings":";;;;;;AAYA,SAASA,EAAgD;AAAA,EACrD,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AACJ,GAA+B;;AAC3B,SAEQ,gBAAAC,EAAAC,GAAA,EAAA,UAAA,gBAAAD;AAAA,IAACE;AAAA,IAAA;AAAA,MACG,OAAAJ;AAAA,MACA,SAAS,GAAQH,KAAA,QAAAA,EAASE;AAAA,MAC1B,eAAcM,IAAAR,KAAA,gBAAAA,EAASE,OAAT,gBAAAM,EAAgB;AAAA,MAE9B,UAAA,gBAAAH;AAAA,QAACI;AAAA,QAAA;AAAA,UACG,MAAAP;AAAA,UACA,SAAAH;AAAA,UACA,QAAQ,CAAC,EAAE,OAAAW,EAAA,MACP,gBAAAL;AAAA,YAACM;AAAA,YAAA;AAAA,cACG,mBAAiB;AAAA,cACjB,MAAK;AAAA,cACL,cAAa;AAAA,cACb,aAAAP;AAAA,cACA,aAAY;AAAA,cACZ,OAAOM,EAAM;AAAA,cACb,UAAUT;AAAA,cACV,cAAc;AAAA,cACd,eAAe,CAACW,MAAMF,EAAM,SAASE,EAAE,cAAc,CAAC;AAAA,YAAA;AAAA,UAAA;AAAA,QAC1D;AAAA,MAAA;AAAA,IAER;AAAA,EAAA,GAER;AAER;"}
@@ -0,0 +1,44 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import "../../../@ecme/components/ui/index.js";
3
+ import { Controller as f } from "react-hook-form";
4
+ import u from "../../../@ecme/components/ui/Form/FormItem.js";
5
+ import a from "../../../@ecme/components/ui/Input/Input.js";
6
+ function S({
7
+ control: n,
8
+ errors: t,
9
+ isView: o,
10
+ name: i,
11
+ label: p,
12
+ placeholder: d
13
+ }) {
14
+ var m;
15
+ return /* @__PURE__ */ e(
16
+ u,
17
+ {
18
+ label: p,
19
+ invalid: !!(t != null && t[i]),
20
+ errorMessage: (m = t == null ? void 0 : t[i]) == null ? void 0 : m.message,
21
+ children: /* @__PURE__ */ e(
22
+ f,
23
+ {
24
+ name: i,
25
+ control: n,
26
+ render: ({ field: l }) => /* @__PURE__ */ e(
27
+ a,
28
+ {
29
+ required: !0,
30
+ disabled: o,
31
+ type: "text",
32
+ placeholder: d,
33
+ ...l
34
+ }
35
+ )
36
+ }
37
+ )
38
+ }
39
+ );
40
+ }
41
+ export {
42
+ S as default
43
+ };
44
+ //# sourceMappingURL=GenericStringFormSection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenericStringFormSection.js","sources":["../../../../../lib/base/components/forms/GenericStringFormSection.tsx"],"sourcesContent":["import { FormItem, Input } from '@/components/ui'\nimport { IFormSectionBaseProps } from '@base/@types/forms'\nimport { Controller, FieldValues, Path } from 'react-hook-form'\n\ntype GeneralFormSectionProps<T extends FieldValues> =\n IFormSectionBaseProps<T> & {\n name: Path<T>\n label: string\n placeholder: string\n }\n\nfunction GenericStringFormSection<T extends FieldValues>({\n control,\n errors,\n isView,\n name,\n label,\n placeholder,\n}: GeneralFormSectionProps<T>) {\n return (\n <FormItem\n label={label}\n invalid={Boolean(errors?.[name])}\n errorMessage={errors?.[name]?.message as string}\n >\n <Controller\n name={name}\n control={control}\n render={({ field }) => (\n <Input\n required\n disabled={isView}\n type=\"text\"\n placeholder={placeholder}\n {...field}\n />\n )}\n />\n </FormItem>\n )\n}\n\nexport default GenericStringFormSection"],"names":["GenericStringFormSection","control","errors","isView","name","label","placeholder","jsx","FormItem","_a","Controller","field","Input"],"mappings":";;;;;AAWA,SAASA,EAAgD;AAAA,EACrD,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AACJ,GAA+B;;AAEvB,SAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,OAAAH;AAAA,MACA,SAAS,GAAQH,KAAA,QAAAA,EAASE;AAAA,MAC1B,eAAcK,IAAAP,KAAA,gBAAAA,EAASE,OAAT,gBAAAK,EAAgB;AAAA,MAE9B,UAAA,gBAAAF;AAAA,QAACG;AAAA,QAAA;AAAA,UACG,MAAAN;AAAA,UACA,SAAAH;AAAA,UACA,QAAQ,CAAC,EAAE,OAAAU,EAAA,MACP,gBAAAJ;AAAA,YAACK;AAAA,YAAA;AAAA,cACG,UAAQ;AAAA,cACR,UAAUT;AAAA,cACV,MAAK;AAAA,cACL,aAAAG;AAAA,cACC,GAAGK;AAAA,YAAA;AAAA,UAAA;AAAA,QACR;AAAA,MAAA;AAAA,IAER;AAAA,EACJ;AAER;"}
@@ -0,0 +1,48 @@
1
+ import { jsx as t, Fragment as l } from "react/jsx-runtime";
2
+ import "../../../@ecme/components/ui/index.js";
3
+ import { Controller as c } from "react-hook-form";
4
+ import d from "../../../@ecme/components/ui/Form/FormItem.js";
5
+ import u from "../../../@ecme/components/ui/Upload/Upload.js";
6
+ function C({
7
+ control: a,
8
+ errors: o,
9
+ name: e,
10
+ label: m
11
+ }) {
12
+ var i;
13
+ return /* @__PURE__ */ t(l, { children: /* @__PURE__ */ t(
14
+ d,
15
+ {
16
+ label: m,
17
+ invalid: !!(o != null && o[e]),
18
+ errorMessage: (i = o == null ? void 0 : o[e]) == null ? void 0 : i.message,
19
+ children: /* @__PURE__ */ t(
20
+ c,
21
+ {
22
+ name: e,
23
+ control: a,
24
+ render: ({ field: n }) => /* @__PURE__ */ t(
25
+ u,
26
+ {
27
+ accept: "application/pdf",
28
+ fileList: n.value,
29
+ beforeUpload: (p) => {
30
+ if (p) {
31
+ for (const f of p)
32
+ if (f.type !== "application/pdf")
33
+ return "Somente arquivos PDF são permitidos.";
34
+ }
35
+ return !0;
36
+ },
37
+ onChange: n.onChange
38
+ }
39
+ )
40
+ }
41
+ )
42
+ }
43
+ ) });
44
+ }
45
+ export {
46
+ C as default
47
+ };
48
+ //# sourceMappingURL=GenericUploadFormSection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenericUploadFormSection.js","sources":["../../../../../lib/base/components/forms/GenericUploadFormSection.tsx"],"sourcesContent":["import { FormItem, Upload } from '@/components/ui'\nimport { IFormSectionBaseProps } from '@base/@types/forms'\nimport { Controller, FieldValues, Path } from 'react-hook-form'\n\ntype GeneralFormSectionProps<T extends FieldValues> =\n IFormSectionBaseProps<T> & {\n name: Path<T>\n label: string\n }\n\nfunction GenericUploadFormSection<T extends FieldValues>({\n control,\n errors,\n name,\n label,\n}: GeneralFormSectionProps<T>) {\n return (\n <>\n <FormItem\n label={label}\n invalid={Boolean(errors?.[name])}\n errorMessage={errors?.[name]?.message as string}\n >\n <Controller\n name={name}\n control={control}\n render={({ field }) => (\n <Upload\n accept={'application/pdf'}\n fileList={field.value}\n beforeUpload={(fileList) => {\n if (fileList) {\n for (const file of fileList) {\n if (file.type !== 'application/pdf') {\n return 'Somente arquivos PDF são permitidos.'\n }\n }\n }\n return true\n }}\n onChange={field.onChange}\n />\n )}\n />\n </FormItem>\n </>\n )\n}\n\nexport default GenericUploadFormSection\n"],"names":["GenericUploadFormSection","control","errors","name","label","jsx","Fragment","FormItem","_a","Controller","field","Upload","fileList","file"],"mappings":";;;;;AAUA,SAASA,EAAgD;AAAA,EACrD,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC;AACJ,GAA+B;;AAC3B,SAEQ,gBAAAC,EAAAC,GAAA,EAAA,UAAA,gBAAAD;AAAA,IAACE;AAAA,IAAA;AAAA,MACG,OAAAH;AAAA,MACA,SAAS,GAAQF,KAAA,QAAAA,EAASC;AAAA,MAC1B,eAAcK,IAAAN,KAAA,gBAAAA,EAASC,OAAT,gBAAAK,EAAgB;AAAA,MAE9B,UAAA,gBAAAH;AAAA,QAACI;AAAA,QAAA;AAAA,UACG,MAAAN;AAAA,UACA,SAAAF;AAAA,UACA,QAAQ,CAAC,EAAE,OAAAS,EAAA,MACP,gBAAAL;AAAA,YAACM;AAAA,YAAA;AAAA,cACG,QAAQ;AAAA,cACR,UAAUD,EAAM;AAAA,cAChB,cAAc,CAACE,MAAa;AACxB,oBAAIA;AACA,6BAAWC,KAAQD;AACX,wBAAAC,EAAK,SAAS;AACP,6BAAA;AAAA;AAIZ,uBAAA;AAAA,cACX;AAAA,cACA,UAAUH,EAAM;AAAA,YAAA;AAAA,UAAA;AAAA,QACpB;AAAA,MAAA;AAAA,IAER;AAAA,EAAA,GAER;AAER;"}
@@ -0,0 +1,55 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import "../../../../@ecme/components/shared/index.js";
3
+ import "../../../../@ecme/components/ui/index.js";
4
+ import { Controller as u } from "react-hook-form";
5
+ import c from "../../../../@ecme/components/ui/Form/FormItem.js";
6
+ import f from "../../../../@ecme/components/shared/NumericInput.js";
7
+ function C({
8
+ control: l,
9
+ errors: e,
10
+ isView: n,
11
+ name: i,
12
+ label: p,
13
+ placeholder: d
14
+ }) {
15
+ var o;
16
+ return /* @__PURE__ */ a(
17
+ c,
18
+ {
19
+ label: p,
20
+ invalid: !!(e != null && e[i]),
21
+ errorMessage: ((o = e == null ? void 0 : e[i]) == null ? void 0 : o.message) ?? "",
22
+ children: /* @__PURE__ */ a(
23
+ u,
24
+ {
25
+ name: i,
26
+ control: l,
27
+ render: ({ field: m }) => /* @__PURE__ */ a(
28
+ f,
29
+ {
30
+ fixedDecimalScale: !0,
31
+ thousandSeparator: ".",
32
+ decimalSeparator: ",",
33
+ prefix: "% ",
34
+ type: "text",
35
+ autoComplete: "off",
36
+ placeholder: d,
37
+ displayType: "input",
38
+ value: m.value,
39
+ disabled: n,
40
+ decimalScale: 2,
41
+ isAllowed: ({ floatValue: t }) => t !== void 0 && t > 0 && t <= 100,
42
+ onValueChange: (t) => {
43
+ m.onChange(t.floatValue ?? 0);
44
+ }
45
+ }
46
+ )
47
+ }
48
+ )
49
+ }
50
+ );
51
+ }
52
+ export {
53
+ C as default
54
+ };
55
+ //# sourceMappingURL=GenericNumberFormSectionPercentage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenericNumberFormSectionPercentage.js","sources":["../../../../../../lib/base/components/forms/NumberFormVariant/GenericNumberFormSectionPercentage.tsx"],"sourcesContent":["import { NumericInput } from '@/components/shared'\nimport { FormItem } from '@/components/ui'\nimport type { IFormSectionBaseProps } from '@base/@types/forms'\nimport { Controller, FieldValues, Path } from 'react-hook-form'\n\ntype GeneralFormSectionProps<T extends FieldValues> =\n IFormSectionBaseProps<T> & {\n name: Path<T>\n label?: string\n placeholder?: string\n }\n\nfunction GenericNumberFormSectionPercentage<T extends FieldValues>({\n control,\n errors,\n isView,\n name,\n label,\n placeholder,\n}: GeneralFormSectionProps<T>) {\n return (\n <FormItem\n label={label}\n invalid={Boolean(errors?.[name])}\n errorMessage={(errors?.[name]?.message as string) ?? ''}\n >\n <Controller\n name={name}\n control={control}\n render={({ field }) => (\n <NumericInput\n fixedDecimalScale\n thousandSeparator=\".\"\n decimalSeparator=\",\"\n prefix=\"% \"\n type=\"text\"\n autoComplete=\"off\"\n placeholder={placeholder}\n displayType=\"input\"\n value={field.value}\n disabled={isView}\n decimalScale={2}\n isAllowed={({ floatValue }) =>\n floatValue !== undefined &&\n floatValue > 0.0 &&\n floatValue <= 100.0\n }\n onValueChange={(e) => {\n field.onChange(e.floatValue ?? 0)\n }}\n />\n )}\n />\n </FormItem>\n )\n}\n\nexport default GenericNumberFormSectionPercentage\n"],"names":["GenericNumberFormSectionPercentage","control","errors","isView","name","label","placeholder","jsx","FormItem","_a","Controller","field","NumericInput","floatValue","e"],"mappings":";;;;;;AAYA,SAASA,EAA0D;AAAA,EAC/D,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AACJ,GAA+B;;AAEvB,SAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,OAAAH;AAAA,MACA,SAAS,GAAQH,KAAA,QAAAA,EAASE;AAAA,MAC1B,gBAAeK,IAAAP,KAAA,gBAAAA,EAASE,OAAT,gBAAAK,EAAgB,YAAsB;AAAA,MAErD,UAAA,gBAAAF;AAAA,QAACG;AAAA,QAAA;AAAA,UACG,MAAAN;AAAA,UACA,SAAAH;AAAA,UACA,QAAQ,CAAC,EAAE,OAAAU,EAAA,MACP,gBAAAJ;AAAA,YAACK;AAAA,YAAA;AAAA,cACG,mBAAiB;AAAA,cACjB,mBAAkB;AAAA,cAClB,kBAAiB;AAAA,cACjB,QAAO;AAAA,cACP,MAAK;AAAA,cACL,cAAa;AAAA,cACb,aAAAN;AAAA,cACA,aAAY;AAAA,cACZ,OAAOK,EAAM;AAAA,cACb,UAAUR;AAAA,cACV,cAAc;AAAA,cACd,WAAW,CAAC,EAAE,YAAAU,EAAA,MACVA,MAAe,UACfA,IAAa,KACbA,KAAc;AAAA,cAElB,eAAe,CAACC,MAAM;AACZ,gBAAAH,EAAA,SAASG,EAAE,cAAc,CAAC;AAAA,cAAA;AAAA,YACpC;AAAA,UAAA;AAAA,QACJ;AAAA,MAAA;AAAA,IAER;AAAA,EACJ;AAER;"}
@@ -0,0 +1,51 @@
1
+ import { jsx as t, Fragment as c } from "react/jsx-runtime";
2
+ import "../../../../@ecme/components/shared/index.js";
3
+ import "../../../../@ecme/components/ui/index.js";
4
+ import { Controller as d } from "react-hook-form";
5
+ import f from "../../../../@ecme/components/ui/Form/FormItem.js";
6
+ import r from "../../../../@ecme/components/shared/NumericInput.js";
7
+ function y({
8
+ control: m,
9
+ errors: e,
10
+ isView: l,
11
+ name: a,
12
+ label: n,
13
+ placeholder: p
14
+ }) {
15
+ var i;
16
+ return /* @__PURE__ */ t(c, { children: /* @__PURE__ */ t(
17
+ f,
18
+ {
19
+ label: n,
20
+ invalid: !!(e != null && e[a]),
21
+ errorMessage: (i = e == null ? void 0 : e[a]) == null ? void 0 : i.message,
22
+ children: /* @__PURE__ */ t(
23
+ d,
24
+ {
25
+ name: a,
26
+ control: m,
27
+ render: ({ field: o }) => /* @__PURE__ */ t(
28
+ r,
29
+ {
30
+ thousandSeparator: ".",
31
+ decimalSeparator: ",",
32
+ prefix: "R$ ",
33
+ type: "text",
34
+ autoComplete: "off",
35
+ placeholder: p,
36
+ displayType: "input",
37
+ value: o.value,
38
+ disabled: l,
39
+ decimalScale: 2,
40
+ onValueChange: (u) => o.onChange(u.floatValue ?? 0)
41
+ }
42
+ )
43
+ }
44
+ )
45
+ }
46
+ ) });
47
+ }
48
+ export {
49
+ y as default
50
+ };
51
+ //# sourceMappingURL=GenericNumberFormSectionPrice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenericNumberFormSectionPrice.js","sources":["../../../../../../lib/base/components/forms/NumberFormVariant/GenericNumberFormSectionPrice.tsx"],"sourcesContent":["import { NumericInput } from '@/components/shared'\nimport { FormItem } from '@/components/ui'\nimport { IFormSectionBaseProps } from '@base/@types/forms'\nimport { Controller, FieldValues, Path } from 'react-hook-form'\n\ntype GeneralFormSectionProps<T extends FieldValues> =\n IFormSectionBaseProps<T> & {\n name: Path<T>\n label: string\n placeholder: string\n }\n\nfunction GenericNumberFormSectionPrice<T extends FieldValues>({\n control,\n errors,\n isView,\n name,\n label,\n placeholder,\n}: GeneralFormSectionProps<T>) {\n return (\n <>\n <FormItem\n label={label}\n invalid={Boolean(errors?.[name])}\n errorMessage={errors?.[name]?.message as string}\n >\n <Controller\n name={name}\n control={control}\n render={({ field }) => (\n <NumericInput\n thousandSeparator=\".\"\n decimalSeparator=\",\"\n prefix=\"R$ \"\n type=\"text\"\n autoComplete=\"off\"\n placeholder={placeholder}\n displayType=\"input\"\n value={field.value}\n disabled={isView}\n decimalScale={2}\n onValueChange={(e) =>\n field.onChange(e.floatValue ?? 0)\n }\n />\n )}\n />\n </FormItem>\n </>\n )\n}\n\nexport default GenericNumberFormSectionPrice\n"],"names":["GenericNumberFormSectionPrice","control","errors","isView","name","label","placeholder","jsx","Fragment","FormItem","_a","Controller","field","NumericInput","e"],"mappings":";;;;;;AAYA,SAASA,EAAqD;AAAA,EAC1D,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AACJ,GAA+B;;AAC3B,SAEQ,gBAAAC,EAAAC,GAAA,EAAA,UAAA,gBAAAD;AAAA,IAACE;AAAA,IAAA;AAAA,MACG,OAAAJ;AAAA,MACA,SAAS,GAAQH,KAAA,QAAAA,EAASE;AAAA,MAC1B,eAAcM,IAAAR,KAAA,gBAAAA,EAASE,OAAT,gBAAAM,EAAgB;AAAA,MAE9B,UAAA,gBAAAH;AAAA,QAACI;AAAA,QAAA;AAAA,UACG,MAAAP;AAAA,UACA,SAAAH;AAAA,UACA,QAAQ,CAAC,EAAE,OAAAW,EAAA,MACP,gBAAAL;AAAA,YAACM;AAAA,YAAA;AAAA,cACG,mBAAkB;AAAA,cAClB,kBAAiB;AAAA,cACjB,QAAO;AAAA,cACP,MAAK;AAAA,cACL,cAAa;AAAA,cACb,aAAAP;AAAA,cACA,aAAY;AAAA,cACZ,OAAOM,EAAM;AAAA,cACb,UAAUT;AAAA,cACV,cAAc;AAAA,cACd,eAAe,CAACW,MACZF,EAAM,SAASE,EAAE,cAAc,CAAC;AAAA,YAAA;AAAA,UAAA;AAAA,QAExC;AAAA,MAAA;AAAA,IAER;AAAA,EAAA,GAER;AAER;"}