@orangesix/react 1.0.9 → 1.0.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.
- package/api/index.cjs.js +1 -1
- package/api/index.cjs.js.map +1 -1
- package/api/index.d.ts +140 -2
- package/api/index.esm.js +1 -1
- package/api/index.esm.js.map +1 -1
- package/api/theme.css +1 -378
- package/box/index.cjs.js +1 -1
- package/box/index.cjs.js.map +1 -1
- package/box/index.d.ts +6 -3
- package/box/index.esm.js +1 -1
- package/box/index.esm.js.map +1 -1
- package/editor/index.cjs.js +1 -19
- package/editor/index.cjs.js.map +1 -1
- package/editor/index.d.ts +10 -15
- package/editor/index.esm.js +1 -19
- package/editor/index.esm.js.map +1 -1
- package/inputfilter/_inputfilter.scss +64 -0
- package/inputfilter/index.cjs.js +2 -0
- package/inputfilter/index.cjs.js.map +1 -0
- package/inputfilter/index.d.ts +161 -0
- package/inputfilter/index.esm.js +2 -0
- package/inputfilter/index.esm.js.map +1 -0
- package/inputfilter/package.json +5 -0
- package/package.json +13 -12
- package/table/index.cjs.js +1 -1
- package/table/index.cjs.js.map +1 -1
- package/table/index.d.ts +56 -52
- package/table/index.esm.js +1 -1
- package/table/index.esm.js.map +1 -1
- package/tablepivot/_tablepivot.scss +101 -0
- package/tablepivot/index.cjs.js +2 -0
- package/tablepivot/index.cjs.js.map +1 -0
- package/tablepivot/index.d.ts +256 -0
- package/tablepivot/index.esm.js +2 -0
- package/tablepivot/index.esm.js.map +1 -0
- package/tablepivot/package.json +5 -0
- package/utils/index.cjs.js +1 -1
- package/utils/index.cjs.js.map +1 -1
- package/utils/index.d.ts +25 -1
- package/utils/index.esm.js +1 -1
- package/utils/index.esm.js.map +1 -1
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--input-filter-border-color: var(--gray-400, #ccc);
|
|
3
|
+
--input-filter-border-radius: var(--input-border-radius, 5px);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.input-filter-container {
|
|
7
|
+
border-radius: var(--input-filter-border-radius);
|
|
8
|
+
border: 1px dashed var(--input-filter-border-color);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.input-filter-content {
|
|
12
|
+
width: 100%;
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: flex-start;
|
|
15
|
+
gap: .5rem;
|
|
16
|
+
|
|
17
|
+
.p-autocomplete-multiple {
|
|
18
|
+
padding: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.p-autocomplete-multiple-container {
|
|
22
|
+
width: 100%;
|
|
23
|
+
padding: .2rem .5rem;
|
|
24
|
+
|
|
25
|
+
.form-control {
|
|
26
|
+
border: none;
|
|
27
|
+
padding: .2rem;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.p-autocomplete-token {
|
|
31
|
+
padding: .2rem .5rem;
|
|
32
|
+
margin: 0;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.p-autocomplete-multiple-container.p-focus {
|
|
37
|
+
box-shadow: none;
|
|
38
|
+
border-color: var(--input-filter-border-color);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.input-filter-select {
|
|
43
|
+
width: 40%;
|
|
44
|
+
max-width: 200px;
|
|
45
|
+
min-width: 130px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.input-filter-field {
|
|
49
|
+
width: 100% !important;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.input-filter-field-date {
|
|
53
|
+
flex: 1;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.input-filter-field-date.year {
|
|
57
|
+
flex: 2;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.input-filter-autocomplete-panel {
|
|
61
|
+
.p-autocomplete-items {
|
|
62
|
+
padding-left: 0 !important;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";require("jquery"),require("axios"),require("node-snackbar"),require("sweetalert2");var e=require("react"),t=require("primereact/utils"),l=require("primereact/autocomplete");function n(e){let t=document.getElementById(e),l=null===t?null:t.content.replace(".br/",".br");return null===l?null:"/"===l.substr(-1)?l.slice(0,l.length-1):l}n("auth"),n("react-base"),n("csrf-token");const a=[{id:1,name:"Janeiro"},{id:2,name:"Fevereiro"},{id:3,name:"Março"},{id:4,name:"Abril"},{id:5,name:"Maio"},{id:6,name:"Junho"},{id:7,name:"Julho"},{id:8,name:"Agosto"},{id:9,name:"Setembro"},{id:10,name:"Outubro"},{id:11,name:"Novembro"},{id:12,name:"Dezembro"}];function i(e,t="decimal"){let l=e.replace(/[^0-9.,]/g,"");return"decimal"===t?l.replace(",",".").replace(/(\..*)\./g,"$1"):parseFloat(l.replace(",",".")).toLocaleString("pt-BR",{style:"currency",currency:"BRL"}).replace("."," ")}const r=["=","!=","%","!%"],o=[{options:"=",label:"Igual a"},{options:"!=",label:"Diferente de"},{options:"<",label:"Menor do que"},{options:">",label:"Maior do que"},{options:"<=",label:"Menor ou igual a"},{options:">=",label:"Maior ou igual a"},{options:"{}",label:"Intervalo"},{options:"%",label:"Contém o que"},{options:"!%",label:"Não contém o que"}];function s(e){if(!e)return null;let t=e?.match(/(=|!=|<|>|<=|>=|%|!%|\{\})/),l=e.charAt(e.length-1),n=t?.[0];return t?.[0]!==l&&isNaN(parseInt(l))&&n?.slice(-1)!==l&&(n=t?.[0]+l),o.filter((e=>e.options===n))[0]?.label??null}const u=({children:l,...n})=>{const a={size:`box-size-${n.size??"100"}`,direction:`box-direction-${n.direction??"row"}`,justify:void 0===n.justify?"":Array.isArray(n.justify)?n.justify?.join(" "):n.justify,align:void 0===n.align?"":Array.isArray(n.align)?n.align?.join(" "):n.align},i={className:t.classNames(["box",n.className??"",a.size,a.direction,a.justify,a.align]),style:n.css,id:n.id};return e.createElement("div",{...i},l)};function c(e){const[t,l,n]=e,a=l>=1&&l<=12,i=n>0&&n<99999,r=t>=1&&t<=31;if(i&&!a&&!r)return[0,0,n];if(i&&a&&!r)return[0,l,n];if(i&&a&&r){let a=new Date(n,l,0);return a.getDate()<t?[a.getDate(),l,n]:e}return i||!a||r?!i&&a&&r?[t,l,0]:i||a||!r?i&&!a&&r?[t,0,n]:[0,0,0]:[t,0,0]:[0,l,0]}function d(e,t){let l=e,n=t.slice().reverse().find((e=>l?.endsWith(e)));return n&&void 0!==l?l.slice(0,-n.length):l??null}function p(e,t,l=null){let n=e,a=/(=|!=|<|>|<=|>=|\{\})/,i=e?.match(a),r=i?i[0].trim():t[0],o=[];return(n?.split("{}")??[]).forEach(((e,t)=>{let l=e.replace(a,"").trim();if(l.includes("/"))o[t]=l.split("/").map((e=>parseInt(e)));else{let e=parseInt(l);o[t]=[isNaN(e)?0:e]}for(;o[t].length<3;)o[t].unshift(0)})),o[1]&&"{}"===r?[...c(o[0]),l??r].concat(...c(o[1])):0===o.length?[0,0,0,r]:[...c(o[0]),l??r]}function m(e,t,l){null!==t&&(l[t]=parseInt(e));let n=l[3],a=l.slice(0,3);if(a=c(a),"{}"!==n)return`${a[0]}/${a[1]}/${a[2]}${n}`;let i=isNaN(parseInt(l[l.length-1]))&&null===t?[0,0,0]:l.slice(-3);return i=c(i),`${a[0]}/${a[1]}/${a[2]}${n}${i[0]}/${i[1]}/${i[2]}`}function f(e,t,l){let n=e?.split(";").map((e=>parseInt(e)))??[];return l.filter((e=>n.includes(e.id)))}function g(e,t){let l=e.map((e=>e.id));return 0===l.length?null:l.join(";")+t}function h(e,t){let l=e,n=t.slice().reverse().find((e=>l?.endsWith(e)));return i(n&&void 0!==l?l.slice(0,-n.length):l??"","decimal")}function b(t){return e.createElement("input",{className:"form-control input-filter-field",disabled:t.disabled,id:(t.id??"input-filter")+"-text",name:(t.name??"input-filter")+"-text",placeholder:t.placeholder,value:d(t.value,t.options)??"",onChange:e=>t.onChange(e.target.value+t.select)})}function N(t){let l=p(t.value,t.options,t.select);function n(e){"{}"===t.select&&"0/0/0{}0/0/0"===e?t.onChange(null):0!=l[0]&&!isNaN(l[0])||0!=l[1]&&!isNaN(l[1])||0!=l[2]&&!isNaN(l[2])?t.onChange(e):t.onChange(null)}return e.createElement("div",{className:"d-flex w-100 flex-column"},e.createElement("div",{className:"w-100 d-flex gap-2"},l.map(((a,i)=>{if(i<=2)return e.createElement("input",{className:"form-control input-filter-field-date"+(2==i?" year":""),disabled:t.disabled,id:(t.id??"input-filter")+"-"+i,key:i,name:(t.name??"input-filter")+"-"+i,placeholder:t.placeholder,value:0===a?"":a,onChange:e=>n(m(e.target.value,i,l))})}))),"{}"===t.select&&l.length>4&&e.createElement("div",{className:"w-100 d-flex gap-2 mt-2"},l.map(((a,i)=>{if(i>=4)return e.createElement("input",{className:"form-control input-filter-field-date"+(6==i?" year":""),disabled:t.disabled,id:(t.id??"input-filter")+"-"+i,key:i,name:(t.name??"input-filter")+"-"+i,placeholder:t.placeholder,value:0===a?"":a,onChange:e=>n(m(e.target.value,i,l))})}))))}const v=({iconPrefix:t="bi bi-",...l})=>l.label&&e.createElement("p",{className:"form-label"},l.icon&&e.createElement("i",{className:t+l.icon+" me-1"}),l.label,l.required&&e.createElement("span",{className:"text-danger"},"*"));function y(t){return e.createElement("input",{className:"form-control input-filter-field",disabled:t.disabled,id:(t.id??"input-filter")+"-number",name:(t.name??"input-filter")+"-number",placeholder:t.placeholder,value:h(t.value,t.options??""),onChange:e=>t.onChange(i(e.target.value,"decimal")+t.select)})}function E(t){const n=f(t.value,t.options,t.data);return e.createElement(l.AutoComplete,{multiple:!0,completeMethod:e=>{let l=n.map((e=>e.id));t.onSearch(e.query,l)},appendTo:"self",className:"w-100",disabled:t.disabled,emptyMessage:"Não encontramos dados.",field:"label",id:(t.id??"input-filter")+"-autocomplete",inputClassName:"form-control",name:(t.name??"input-filter")+"-autocomplete",panelClassName:"input-filter-autocomplete-panel",placeholder:t.placeholder,required:t.required,scrollHeight:t.autocompleteScrollHeight,selectionLimit:t.autocompleteSelectLimit,suggestions:t.data,value:n,onChange:e=>t.onChange(g(e.value,t.select))})}exports.InputFilter=function({...l}){const n=(l.options??r).sort(((e,t)=>e.length-t.length)),a=o.filter((e=>n?.includes(e.options))),[i,s]=e.useState(function(e,t){let l=t.filter((t=>e?.includes(t)));return l[l.length-1]??t[0]}(l.value,n));return e.useEffect((()=>{if(l.type&&"text"!==l.type){if("date"===l.type){let e=p(l.value,n,i),t=m("0",null,e);"{}"===i&&"0/0/0{}0/0/0"===t||0==e[0]&&0==e[1]&&0==e[2]?l.onChange(null):l.onChange(t)}else if("autocomplete"===l.type){let e=f(l.value,0,l.data);l.onChange(g(e,i))}else if("number"===l.type){let e=h(l.value,n);""!==e?l.onChange(e+i):l.onChange(null)}}else{let e=d(l.value,n);null!==e?l.onChange(e+i):l.onChange(null)}}),[i]),e.createElement(u,{...l,className:t.classNames([l.className,"input-filter-container"])},e.createElement(v,{...l}),e.createElement("div",{className:"input-filter-content",id:l.id??"input-filter"},e.createElement("select",{className:"form-select input-filter-select",disabled:l.disabled,id:(l.id??"input-filter")+"-select",name:(l.name??"input-filter")+"-select",value:i,onChange:e=>s(e.target.value)},a?.map((t=>e.createElement("option",{key:t.options,value:t.options},t.label)))),(!l.type||"text"===l.type)&&e.createElement(b,{...l,options:n,select:i}),"date"===l.type&&e.createElement(N,{...l,options:n,select:i}),"autocomplete"===l.type&&e.createElement(E,{...l,options:n,select:i}),"number"===l.type&&e.createElement(y,{...l,options:n,select:i})))},exports.filterLegend=s,exports.filterLegendAutocomplete=function(e,t=[],l=30){let n=s(e);if(null===n||0===t.length)return"Não encontramos legenda definida.";let a=e?.split(";").map((e=>parseInt(e)))??[],i=t.filter((e=>a.includes(e.id))).map((e=>e.label)).join(", "),r=i.substring(0,l);return n+": "+r+(r.length!==i.length?"...":"")},exports.filterLegendData=function(e){let t=s(e);if(null===t)return"Não encontramos legenda definida.";let l=e?.split("{}"),n=e?.split("/");const i=e=>{let t=parseInt(e[0]),l=parseInt(e[1],10),n=parseInt(e[2]);return`\n ${t>0?`${0==l?"dia":""} ${t}`:""} \n ${l>0?`${t>0?"de":""} ${a[l-1]?.name}`:""} \n ${n>0?`${t>0||l>0?"de":""} ${n}`:""}\n `.replace(/\s+/g," ").trim()};return t+": "+(void 0===l?.[1]?i(n):i(l[0].split("/"))+" à "+i(l[1].split("/")))},exports.filterLegendText=function(e){let t=s(e);return null===t?"Não encontramos legenda definida.":t+": "+(e?.replace(/(=|!=|<|>|<=|>=|%|!%|\{\})/g,"")??"")};
|
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../src/utils/helper.ts","../../src/utils/const.ts","../../src/utils/handle.ts","../../src/inputfilter/const.ts","../../src/inputfilter/legend.ts","../../src/box/box.tsx","../../src/inputfilter/function/validate.ts","../../src/inputfilter/function/handle.ts","../../src/inputfilter/core/text.tsx","../../src/inputfilter/core/date.tsx","../../src/api/input.tsx","../../src/inputfilter/core/number.tsx","../../src/inputfilter/core/autocomplete.tsx","../../src/inputfilter/inputfilter.tsx"],"sourcesContent":["import $ from \"jquery\";\r\nimport axios from \"axios\";\r\nimport { message } from \"./message\";\r\nimport { IUtilsHelperResponse } from \"./types\";\r\n\r\n/**\r\n * Realiza a pesquisa do elemento html na DOM<br>\r\n * <meta id=\"???\" name=\"???\" content=\"your-url\">\r\n */\r\nexport function getMetaContent(id: string): string | null {\r\n let element: any = document.getElementById(id);\r\n let url: null | string = element === null ? null : (element.content).replace(\".br/\", \".br\");\r\n return url === null ? null : url.substr(-1) === \"/\" ? url.slice(0, url.length - 1) : url;\r\n}\r\n\r\n/**\r\n * Realiza a pesquisa do CEP na API pública \"https://viacep.com.br/ws/\"\r\n */\r\nexport async function getCep(value: string): Promise<IUtilsHelperResponse[\"gep_cep\"]> {\r\n let cep = value.length === 0 ? \"00000000\" : value.replace(\"-\", \"\");\r\n return await axios.get<IUtilsHelperResponse[\"gep_cep\"]>(\"https://viacep.com.br/ws/\" + cep + \"/json/\")\r\n .then(data => data.data);\r\n}\r\n\r\n/**\r\n * Realiza a pesquisa do elemento na árvore DOM\r\n */\r\nexport function getElementDOM(element?: string, preloadTimeOut?: number): Promise<null | JQuery<HTMLElement>> {\r\n return new Promise((resolve) => {\r\n // @ts-ignore\r\n let body = window.self === window.top ? $(\"body\") : $(window.frameElement).parents(\"body\");\r\n if (!element || element.length === 0) {\r\n resolve(body);\r\n }\r\n\r\n if (element === \"#\" || element === \".\") {\r\n resolve(null);\r\n }\r\n\r\n let elementFound = body.find(element);\r\n if (elementFound.length > 0) {\r\n resolve(elementFound);\r\n } else {\r\n setTimeout(() => {\r\n let iframe = body.find(\"iframe\").contents();\r\n if (iframe.length === 0) {\r\n resolve(null);\r\n }\r\n elementFound = iframe.find(element);\r\n if (elementFound.length > 0) {\r\n resolve(elementFound);\r\n }\r\n resolve(null);\r\n }, preloadTimeOut ?? 300);\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Permite à comunicação de origem cruzada entre objetos do Windows.<br>\r\n * Exemplo: Comunicação entre iframe e corpo principal\r\n */\r\nexport function windowMessageEvent(): void {\r\n window.addEventListener(\"message\", function (event: MessageEvent) {\r\n if (event.data?.type === \"message\") {\r\n let data = event.data;\r\n message<any>({ ...data.params });\r\n }\r\n });\r\n}","import { getMetaContent } from \"./helper\";\r\n\r\nexport const USER: string | null = getMetaContent(\"auth\");\r\nexport const BASE: string | null = getMetaContent(\"react-base\");\r\nexport const TOKEN: string | null = getMetaContent(\"csrf-token\");\r\n\r\nexport const MES: Array<{ id: number, name: string }> = [\r\n { id: 1, name: \"Janeiro\" },\r\n { id: 2, name: \"Fevereiro\" },\r\n { id: 3, name: \"Março\" },\r\n { id: 4, name: \"Abril\" },\r\n { id: 5, name: \"Maio\" },\r\n { id: 6, name: \"Junho\" },\r\n { id: 7, name: \"Julho\" },\r\n { id: 8, name: \"Agosto\" },\r\n { id: 9, name: \"Setembro\" },\r\n { id: 10, name: \"Outubro\" },\r\n { id: 11, name: \"Novembro\" },\r\n { id: 12, name: \"Dezembro\" },\r\n];\r\n\r\nexport const ESTADOS: Array<{ id: string, name: string }> = [\r\n { name: \"Acre\", id: \"AC\" },\r\n { name: \"Alagoas\", id: \"AL\" },\r\n { name: \"Amapá\", id: \"AP\" },\r\n { name: \"Amazonas\", id: \"AM\" },\r\n { name: \"Bahia\", id: \"BA\" },\r\n { name: \"Ceará\", id: \"CE\" },\r\n { name: \"Distrito Federal\", id: \"DF\" },\r\n { name: \"Espírito Santo\", id: \"ES\" },\r\n { name: \"Goiás\", id: \"GO\" },\r\n { name: \"Maranhão\", id: \"MA\" },\r\n { name: \"Mato Grosso\", id: \"MT\" },\r\n { name: \"Mato Grosso do Sul\", id: \"MS\" },\r\n { name: \"Minas Gerais\", id: \"MG\" },\r\n { name: \"Pará\", id: \"PA\" },\r\n { name: \"Paraíba\", id: \"PB\" },\r\n { name: \"Paraná\", id: \"PR\" },\r\n { name: \"Pernambuco\", id: \"PE\" },\r\n { name: \"Piauí\", id: \"PI\" },\r\n { name: \"Rio de Janeiro\", id: \"RJ\" },\r\n { name: \"Rio Grande do Norte\", id: \"RN\" },\r\n { name: \"Rio Grande do Sul\", id: \"RS\" },\r\n { name: \"Rondônia\", id: \"RO\" },\r\n { name: \"Roraima\", id: \"RR\" },\r\n { name: \"Santa Catarina\", id: \"SC\" },\r\n { name: \"São Paulo\", id: \"SP\" },\r\n { name: \"Sergipe\", id: \"SE\" },\r\n { name: \"Tocantins\", id: \"TO\" }\r\n];","/**\r\n * Formata um valor numérico para o formato decimal ou monetário.\r\n *\r\n * @param valor - O valor a ser formatado.\r\n * @param format - O formato desejado: \"money\" para monetário ou \"decimal\" para decimal.\r\n * @returns O valor formatado como string.\r\n */\r\nexport function handleNumber(\r\n valor: string,\r\n format: \"money\" | \"decimal\" = \"decimal\"\r\n): string {\r\n let value = valor.replace(/[^0-9.,]/g, \"\");\r\n if (format === \"decimal\") {\r\n return value.replace(\",\", \".\").replace(/(\\..*)\\./g, \"$1\");\r\n }\r\n return parseFloat(value.replace(\",\", \".\")).toLocaleString(\"pt-BR\", {\r\n style: \"currency\",\r\n currency: \"BRL\"\r\n }).replace(\".\", \" \");\r\n}\r\n\r\n/**\r\n * Formata um valor de string para o formato de horas (HH:MM).\r\n *\r\n * @param valor - O valor a ser formatado.\r\n * @returns O valor formatado como string no formato de horas.\r\n */\r\nexport function handleHours(valor: string): string {\r\n let value = valor.replace(/[^\\d.]/g, \"\");\r\n const parts = value.split(\".\");\r\n\r\n if (parts.length > 1) {\r\n parts[1] = parts[1].substring(0, 2);\r\n }\r\n\r\n value = parts.join(\".\");\r\n if (value.length > 2) {\r\n value = value.substring(0, value.length - 2) + \":\" + value.substring(value.length - 2);\r\n }\r\n return value;\r\n}","import { InputFilterOptionsMap, InputFilterOptionsProps } from \"./types\";\r\n\r\nexport const optionsDefault: Array<InputFilterOptionsMap[\"text\"]> = [\"=\", \"!=\", \"%\", \"!%\"];\r\n\r\nexport const optionsLabel: Array<{\r\n options: InputFilterOptionsProps,\r\n label: string\r\n}> = [\r\n { options: \"=\", label: \"Igual a\" },\r\n { options: \"!=\", label: \"Diferente de\" },\r\n { options: \"<\", label: \"Menor do que\" },\r\n { options: \">\", label: \"Maior do que\" },\r\n { options: \"<=\", label: \"Menor ou igual a\" },\r\n { options: \">=\", label: \"Maior ou igual a\" },\r\n { options: \"{}\", label: \"Intervalo\" },\r\n { options: \"%\", label: \"Contém o que\" },\r\n { options: \"!%\", label: \"Não contém o que\" },\r\n];","import { MES } from \"../utils\";\r\nimport { optionsLabel } from \"./const\";\r\n\r\n/**\r\n * Retorna a legenda de acordo com operador na string\r\n * @param value - Valor a ser tratado\r\n */\r\nexport function filterLegend(value: string | undefined): string | null {\r\n if (!value) {\r\n return null;\r\n }\r\n let optsRegex = /(=|!=|<|>|<=|>=|%|!%|\\{\\})/;\r\n let optsMatch = value?.match(optsRegex);\r\n let opts = value.charAt(value.length - 1);\r\n let option = optsMatch?.[0];\r\n\r\n if (optsMatch?.[0] !== opts && isNaN(parseInt(opts)) && option?.slice(-1) !== opts) {\r\n option = optsMatch?.[0] + opts;\r\n }\r\n return optionsLabel.filter(item => item.options === option)[0]?.label ?? null;\r\n}\r\n\r\n/**\r\n * Realiza o tratamento das informações para retorna a legenda do tipo `Date`\r\n * @param value - Valor a ser tratado\r\n */\r\nexport function filterLegendData(value: string | undefined): string {\r\n let legend = filterLegend(value);\r\n if (legend === null) {\r\n return \"Não encontramos legenda definida.\";\r\n }\r\n\r\n let interval = value?.split(\"{}\");\r\n let date = value?.split(\"/\");\r\n\r\n const handleLegend = (date: any): string => {\r\n let dia = parseInt(date[0]);\r\n let mes = parseInt(date[1], 10);\r\n let ano = parseInt(date[2]);\r\n\r\n return `\r\n ${(dia > 0 ? `${mes == 0 ? \"dia\" : \"\"} ${dia}` : \"\")} \r\n ${mes > 0 ? `${dia > 0 ? \"de\" : \"\"} ${MES[mes - 1]?.name}` : \"\"} \r\n ${ano > 0 ? `${dia > 0 || mes > 0 ? \"de\" : \"\"} ${ano}` : \"\"}\r\n `.replace(/\\s+/g, \" \").trim();\r\n };\r\n let result = interval?.[1] === undefined\r\n ? handleLegend(date)\r\n : handleLegend(interval[0].split(\"/\")) + \" à \" + handleLegend(interval[1].split(\"/\"));\r\n return legend + \": \" + result;\r\n}\r\n\r\n/**\r\n * Realiza o tratamento das informações para retorna a legenda do tipo `Text`\r\n * @param value - Valor a ser tratado\r\n */\r\nexport function filterLegendText(value: string | undefined): string {\r\n let legend = filterLegend(value);\r\n if (legend === null) {\r\n return \"Não encontramos legenda definida.\";\r\n }\r\n return legend + \": \" + (value?.replace(/(=|!=|<|>|<=|>=|%|!%|\\{\\})/g, \"\") ?? \"\");\r\n}\r\n\r\n/**\r\n * Realiza o tratamento das informações para retorna a legando do tipo `autocomplete`\r\n * @param value - Valor a ser tratado\r\n * @param dto - Array de objeto para ser pesquisado a legenda\r\n * @param word - Limite de palavras para a legenda\r\n */\r\nexport function filterLegendAutocomplete(value: string | undefined, dto: any[] = [], word: number = 30): string {\r\n let legend = filterLegend(value);\r\n if (legend === null || dto.length === 0) {\r\n return \"Não encontramos legenda definida.\";\r\n }\r\n let ids: any[] = value?.split(\";\").map(item => parseInt(item)) ?? [];\r\n let values = dto\r\n .filter(obj => ids.includes(obj.id))\r\n .map(item => item.label).join(\", \");\r\n let text = values.substring(0, word);\r\n return legend + \": \" + text + (text.length !== values.length ? \"...\" : \"\");\r\n}","import { BoxProps } from \"./types\";\r\nimport React, { HTMLAttributes } from \"react\";\r\nimport { classNames } from \"primereact/utils\";\r\n\r\n/**\r\n * Componente - `Box`\r\n *\r\n * Um componente versátil que pode ser utilizado para criar seções ou caixas em uma página.\r\n * Permite personalizar o estilo e o conteúdo através de propriedades.\r\n *\r\n * Exemplo de uso:\r\n * ```tsx\r\n * <Box align=\"align-items-center\"\r\n * justify=\"justify-content-end\"\r\n * size=\"25\">\r\n * ...conteúdo HTML\r\n * </Box>\r\n * ```\r\n */\r\nexport const Box = ({ children, ...props }: BoxProps) => {\r\n const css = {\r\n size: `box-size-${(props.size ?? \"100\")}`,\r\n direction: `box-direction-${props.direction ?? \"row\"}`,\r\n justify: props.justify === undefined ? \"\" : Array.isArray(props.justify) ? props.justify?.join(\" \") : props.justify,\r\n align: props.align === undefined ? \"\" : Array.isArray(props.align) ? props.align?.join(\" \") : props.align\r\n };\r\n\r\n const attr: HTMLAttributes<\"div\"> & Omit<BoxProps, \"children\"> = {\r\n className: classNames([\r\n \"box\",\r\n props.className ?? \"\",\r\n css.size,\r\n css.direction,\r\n css.justify,\r\n css.align\r\n ]),\r\n style: props.css,\r\n id: props.id\r\n };\r\n\r\n return (\r\n <div {...attr as any}>{children}</div>\r\n );\r\n};","/**\r\n * Valida e ajusta uma data fornecida como um array de números.\r\n *\r\n * @param date - Um array de números representando [dia, mês, ano].\r\n * @returns Um array de números representando a data validada e ajustada.\r\n */\r\nexport function validateDate(date: number[]): number[] {\r\n const [day, month, year] = date;\r\n\r\n const isMonthValid = month >= 1 && month <= 12;\r\n const isYearValid = year > 0 && year < 99999;\r\n const isDayValid = day >= 1 && day <= 31;\r\n\r\n if (isYearValid && !isMonthValid && !isDayValid) {\r\n return [0, 0, year];\r\n }\r\n\r\n if (isYearValid && isMonthValid && !isDayValid) {\r\n return [0, month, year];\r\n }\r\n\r\n if (isYearValid && isMonthValid && isDayValid) {\r\n let currentDate = new Date(year, month, 0);\r\n if (currentDate.getDate() < day) {\r\n return [currentDate.getDate(), month, year];\r\n }\r\n return date;\r\n }\r\n\r\n if (!isYearValid && isMonthValid && !isDayValid) {\r\n return [0, month, 0];\r\n }\r\n\r\n if (!isYearValid && isMonthValid && isDayValid) {\r\n return [day, month, 0];\r\n }\r\n\r\n if (!isYearValid && !isMonthValid && isDayValid) {\r\n return [day, 0, 0];\r\n }\r\n\r\n if (isYearValid && !isMonthValid && isDayValid) {\r\n return [day, 0, year];\r\n }\r\n\r\n return [0, 0, 0];\r\n}","import { validateDate } from \"./validate\";\r\nimport { handleNumber } from \"../../utils\";\r\nimport { InputFilterOptionsMap } from \"../types\";\r\n\r\n/**\r\n * Obtém a opção de filtro correspondente ao valor fornecido.\r\n *\r\n * @param value - O valor para buscar uma opção correspondente.\r\n * @param options - Um array de opções de filtro disponíveis.\r\n * @returns A opção de filtro correspondente ou a primeira opção se nenhuma correspondência for encontrada.\r\n */\r\nexport function handleGetOption<T extends keyof InputFilterOptionsMap>(\r\n value: string | undefined,\r\n options: Array<InputFilterOptionsMap[T]>\r\n): string {\r\n let exists = options.filter(option => value?.includes(option));\r\n return exists[exists.length - 1] ?? options[0];\r\n}\r\n\r\n/**\r\n * Retorna apenas o valor sem os operadores filtro tipo `Text`.\r\n *\r\n * @param value - O valor completo, incluindo a opção de filtro.\r\n * @param options - Um array de opções de filtro disponíveis.\r\n * @returns O valor sem as opções de filtro.\r\n */\r\nexport function handleGetValueText(\r\n value: string | undefined,\r\n options: Array<InputFilterOptionsMap[\"text\"]>\r\n): string | null {\r\n let str = value;\r\n let exists = options\r\n .slice()\r\n .reverse()\r\n .find(item => str?.endsWith(item));\r\n if (exists && str !== undefined) {\r\n return str.slice(0, -exists.length);\r\n }\r\n return str ?? null;\r\n}\r\n\r\n/**\r\n * Retorna apenas o valor sem os operadores filtro tipo `Date`.\r\n *\r\n * @param value - O valor completo, incluindo a opção de filtro.\r\n * @param options - Um array de opções de filtro disponíveis.\r\n * @param select - Seletor do tipo de filtro\r\n * @returns O valor sem as opções de filtro.\r\n */\r\nexport function handleGetValueDate(\r\n value: string | undefined,\r\n options: Array<InputFilterOptionsMap[\"date\"]>,\r\n select: null | string = null\r\n): Array<number | string> {\r\n let str = value;\r\n let optsRegex = /(=|!=|<|>|<=|>=|\\{\\})/;\r\n let optsMatch = value?.match(optsRegex);\r\n let opts = optsMatch ? optsMatch[0].trim() : options[0];\r\n\r\n let parts: any[] = [];\r\n let interval = str?.split(\"{}\") ?? [];\r\n\r\n interval.forEach((value, index) => {\r\n let clean = value.replace(optsRegex, \"\").trim();\r\n\r\n if (clean.includes(\"/\")) {\r\n parts[index] = clean.split(\"/\").map(item => parseInt(item));\r\n } else {\r\n let number = parseInt(clean);\r\n parts[index] = [isNaN(number) ? 0 : number];\r\n }\r\n\r\n while (parts[index].length < 3) {\r\n parts[index].unshift(0);\r\n }\r\n });\r\n\r\n if (parts[1] && opts === \"{}\") {\r\n return [...validateDate(parts[0]), select ?? opts].concat(...validateDate(parts[1]));\r\n }\r\n return parts.length === 0\r\n ? [0, 0, 0, opts]\r\n : [...validateDate(parts[0]), select ?? opts];\r\n}\r\n\r\n/**\r\n * Atualiza um valor de data em uma posição específica e retorna a data formatada.\r\n *\r\n * @param value - O novo valor a ser inserido na data\r\n * @param position - A posição do valor a ser atualizado (0 para dia, 1 para mês, 2 para ano)\r\n * @param date - O array da data atual, incluindo as opções\r\n * @returns A data atualizada e formatada como string\r\n */\r\nexport function handleSetValueDate(\r\n value: string,\r\n position: number | null,\r\n date: (number | string)[]\r\n): string {\r\n if (position !== null) {\r\n date[position] = parseInt(value);\r\n }\r\n\r\n let opts = date[3];\r\n let firstDate = date.slice(0, 3);\r\n firstDate = validateDate(firstDate as number[]);\r\n\r\n if (opts !== \"{}\") {\r\n return `${firstDate[0]}/${firstDate[1]}/${firstDate[2]}${opts}`;\r\n }\r\n\r\n let lastDate = isNaN(parseInt(date[date.length - 1] as string)) && position === null\r\n ? [0, 0, 0]\r\n : date.slice(-3);\r\n lastDate = validateDate(lastDate as number[]);\r\n return `${firstDate[0]}/${firstDate[1]}/${firstDate[2]}${opts}${lastDate[0]}/${lastDate[1]}/${lastDate[2]}`;\r\n}\r\n\r\n/**\r\n * Obtém os valores selecionados do autocomplete a partir da string de valor e dos dados disponíveis.\r\n *\r\n * @param value - String contendo os IDs dos itens selecionados, separados por ponto e vírgula.\r\n * @param options - Array de opções de filtro disponíveis para o autocomplete.\r\n * @param data - Array de objetos contendo os dados disponíveis para seleção.\r\n * @returns Array de objetos correspondentes aos IDs selecionados.\r\n */\r\nexport function handleGetValueAutocomplete(\r\n value: string | undefined,\r\n options: Array<InputFilterOptionsMap[\"autocomplete\"]>,\r\n data: Array<{ id: number, label: string }>\r\n) {\r\n let values: any[] = value?.split(\";\").map(item => parseInt(item)) ?? [];\r\n return data.filter(item => values.includes(item.id));\r\n}\r\n\r\n/**\r\n * Converte os valores selecionados do autocomplete em uma string formatada para o filtro.\r\n *\r\n * @param value - Array de objetos selecionados no autocomplete.\r\n * @param select - String representando a opção de filtro selecionada.\r\n * @returns String formatada com os IDs dos itens selecionados e a opção de filtro.\r\n */\r\nexport function handleSetValueAutocomplete(\r\n value: Array<{ id: number, label: string }>,\r\n select: string,\r\n): string | null {\r\n let ids = value.map(item => item.id);\r\n return ids.length === 0 ? null : ids.join(\";\") + select;\r\n}\r\n\r\n/**\r\n * Retorna apenas o valor sem os operadores filtro tipo `Number`.\r\n *\r\n * @param value - O valor completo, incluindo a opção de filtro.\r\n * @param options - Um array de opções de filtro disponíveis.\r\n * @returns O valor sem as opções de filtro.\r\n */\r\nexport function handleGetValueNumber(\r\n value: string | undefined,\r\n options: Array<InputFilterOptionsMap[\"text\"]>\r\n): string {\r\n let str = value;\r\n let exists = options\r\n .slice()\r\n .reverse()\r\n .find(item => str?.endsWith(item));\r\n if (exists && str !== undefined) {\r\n return handleNumber(str.slice(0, -exists.length), \"decimal\");\r\n }\r\n return handleNumber(str ?? \"\", \"decimal\");\r\n}","import React from \"react\";\r\nimport { handleGetValueText } from \"../function/handle\";\r\nimport { InputFilterCoreProps, InputFilterOptionsMap } from \"../types\";\r\n\r\n/**\r\n * Core - `Text`\r\n * Campo do filtro tipo texto\r\n */\r\nexport function Text<T extends keyof InputFilterOptionsMap>(props: InputFilterCoreProps<T>) {\r\n return (\r\n <input className=\"form-control input-filter-field\"\r\n disabled={props.disabled}\r\n id={(props.id ?? \"input-filter\") + \"-text\"}\r\n name={(props.name ?? \"input-filter\") + \"-text\"}\r\n placeholder={props.placeholder}\r\n value={handleGetValueText(props.value, props.options) ?? \"\"}\r\n onChange={event => props.onChange(event.target.value + props.select)}/>\r\n );\r\n}","import React from \"react\";\r\nimport { InputFilterCoreProps, InputFilterOptionsMap } from \"../types\";\r\nimport { handleGetValueDate, handleSetValueDate } from \"../function/handle\";\r\n\r\n/**\r\n * Core - `Date`\r\n * Campo do filtro tipo data\r\n */\r\nexport function Date<T extends keyof InputFilterOptionsMap>(props: InputFilterCoreProps<T>) {\r\n let date = handleGetValueDate(props.value, props.options, props.select);\r\n\r\n function handleChangeValue(value: string) {\r\n if (props.select === \"{}\" && value === \"0/0/0{}0/0/0\") {\r\n props.onChange(null);\r\n } else {\r\n if ((date[0] == 0 || isNaN(date[0] as number)) &&\r\n (date[1] == 0 || isNaN(date[1] as number)) &&\r\n (date[2] == 0 || isNaN(date[2] as number))) {\r\n props.onChange(null);\r\n } else {\r\n props.onChange(value);\r\n }\r\n }\r\n }\r\n\r\n return (\r\n <div className=\"d-flex w-100 flex-column\">\r\n <div className=\"w-100 d-flex gap-2\">\r\n {date.map((item, index) => {\r\n if (index <= 2) {\r\n return (\r\n <input className={\"form-control input-filter-field-date\" + (index == 2 ? \" year\" : \"\")}\r\n disabled={props.disabled}\r\n id={(props.id ?? \"input-filter\") + \"-\" + index}\r\n key={index}\r\n name={(props.name ?? \"input-filter\") + \"-\" + index}\r\n placeholder={props.placeholder}\r\n value={item === 0 ? \"\" : item}\r\n onChange={event => handleChangeValue(handleSetValueDate(event.target.value, index, date))}/>\r\n );\r\n }\r\n })}\r\n </div>\r\n {props.select === \"{}\" && date.length > 4\r\n && <div className=\"w-100 d-flex gap-2 mt-2\">\r\n {date.map((item, index) => {\r\n if (index >= 4) {\r\n return (\r\n <input className={\"form-control input-filter-field-date\" + (index == 6 ? \" year\" : \"\")}\r\n disabled={props.disabled}\r\n id={(props.id ?? \"input-filter\") + \"-\" + index}\r\n key={index}\r\n name={(props.name ?? \"input-filter\") + \"-\" + index}\r\n placeholder={props.placeholder}\r\n value={item === 0 ? \"\" : item}\r\n onChange={event => handleChangeValue(handleSetValueDate(event.target.value, index, date))}/>\r\n );\r\n }\r\n })}\r\n </div>}\r\n </div>\r\n );\r\n}","import React from \"react\";\r\nimport { ApiFieldComponentProps } from \"./types\";\r\n\r\n/**\r\n * API - `InputLabel`\r\n *\r\n * Um componente utilizado como label em todos os componente de campo do pacote.\r\n * Permite personalizar o estilo e o conteúdo através de propriedades.\r\n */\r\nexport const InputLabel = ({ iconPrefix = \"bi bi-\", ...props }: ApiFieldComponentProps) => {\r\n /*\r\n |------------------------------------------\r\n | render() - Renderização do componente\r\n |------------------------------------------\r\n */\r\n return props.label\r\n && <p className='form-label'>\r\n {props.icon && <i className={iconPrefix + props.icon + \" me-1\"}/>}\r\n {props.label}\r\n {props.required && <span className=\"text-danger\">*</span>}\r\n </p>;\r\n};","import React from \"react\";\r\nimport { handleNumber } from \"../../utils\";\r\nimport { handleGetValueNumber } from \"../function/handle\";\r\nimport { InputFilterCoreProps, InputFilterOptionsMap } from \"../types\";\r\n\r\n/**\r\n * Core - `Number`\r\n * Campo do filtro tipo numero\r\n */\r\nexport function Number<T extends keyof InputFilterOptionsMap>(props: InputFilterCoreProps<T>) {\r\n return (\r\n <input className=\"form-control input-filter-field\"\r\n disabled={props.disabled}\r\n id={(props.id ?? \"input-filter\") + \"-number\"}\r\n name={(props.name ?? \"input-filter\") + \"-number\"}\r\n placeholder={props.placeholder}\r\n value={handleGetValueNumber(props.value, props.options ?? \"\")}\r\n onChange={event => props.onChange(handleNumber(event.target.value, \"decimal\") + props.select)}/>\r\n );\r\n}","import React from \"react\";\r\nimport { InputFilterCoreProps, InputFilterOptionsMap } from \"../types\";\r\nimport { AutoComplete as AutocompletePrimeReact } from \"primereact/autocomplete\";\r\nimport { handleGetValueAutocomplete, handleSetValueAutocomplete } from \"../function/handle\";\r\n\r\n/**\r\n * Core - `Autocomplete`\r\n * Campo do filtro tipo autocomplete\r\n */\r\nexport function Autocomplete<T extends keyof InputFilterOptionsMap>(props: InputFilterCoreProps<\"autocomplete\">) {\r\n const value = handleGetValueAutocomplete(props.value, props.options, props.data);\r\n\r\n return (\r\n <AutocompletePrimeReact multiple\r\n completeMethod={event => {\r\n let ids = value.map(item => item.id);\r\n props.onSearch(event.query, ids);\r\n }}\r\n appendTo=\"self\"\r\n className=\"w-100\"\r\n disabled={props.disabled}\r\n emptyMessage=\"Não encontramos dados.\"\r\n field=\"label\"\r\n id={(props.id ?? \"input-filter\") + \"-\" + \"autocomplete\"}\r\n inputClassName=\"form-control\"\r\n name={(props.name ?? \"input-filter\") + \"-\" + \"autocomplete\"}\r\n panelClassName=\"input-filter-autocomplete-panel\"\r\n placeholder={props.placeholder}\r\n required={props.required}\r\n scrollHeight={props.autocompleteScrollHeight}\r\n selectionLimit={props.autocompleteSelectLimit}\r\n suggestions={props.data}\r\n value={value}\r\n onChange={event => props.onChange(handleSetValueAutocomplete(event.value, props.select))}/>\r\n );\r\n}","import { Box } from \"../box\";\r\nimport { Text } from \"./core/text\";\r\nimport { Date } from \"./core/date\";\r\nimport { InputLabel } from \"../api\";\r\nimport { Number } from \"./core/number\";\r\nimport * as handle from \"./function/handle\";\r\nimport { classNames } from \"primereact/utils\";\r\nimport { Autocomplete } from \"./core/autocomplete\";\r\nimport React, { useState, useEffect } from \"react\";\r\nimport { optionsDefault, optionsLabel } from \"./const\";\r\nimport { InputFilterOptionsMap, InputFilterProps } from \"./types\";\r\n\r\n/**\r\n * Componente - `InputFilter`\r\n *\r\n * Um componente utilizado para montar o objeto de pesquisa de dados.\r\n * Permite alterar o seu tipo através do type: `text`, `date`, `autocomplete`.\r\n */\r\nexport function InputFilter<T extends keyof InputFilterOptionsMap = \"text\">({ ...props }: InputFilterProps<T>) {\r\n\r\n const options: any[] = (props.options ?? optionsDefault).sort((a, b) => a.length - b.length);\r\n const selectOptions = optionsLabel.filter(item => options?.includes(item.options as any));\r\n const [select, setSelect] = useState<string>(handle.handleGetOption<T>(props.value, options));\r\n\r\n useEffect(() => {\r\n if (!props.type || props.type === \"text\") {\r\n let value = handle.handleGetValueText(props.value, options);\r\n if (value !== null) {\r\n props.onChange(value + select);\r\n } else {\r\n props.onChange(null);\r\n }\r\n } else if (props.type === \"date\") {\r\n let date = handle.handleGetValueDate(props.value, options, select);\r\n let setDate = handle.handleSetValueDate(\"0\", null, date);\r\n\r\n if (select === \"{}\" && setDate === \"0/0/0{}0/0/0\") {\r\n props.onChange(null);\r\n } else {\r\n if (date[0] == 0 && date[1] == 0 && date[2] == 0) {\r\n props.onChange(null);\r\n } else {\r\n props.onChange(setDate);\r\n }\r\n }\r\n } else if (props.type === \"autocomplete\") {\r\n let value = handle.handleGetValueAutocomplete(props.value, options, props.data);\r\n props.onChange(handle.handleSetValueAutocomplete(value, select));\r\n } else if (props.type === \"number\") {\r\n let value = handle.handleGetValueNumber(props.value, options);\r\n if (value !== \"\") {\r\n props.onChange(value + select);\r\n } else {\r\n props.onChange(null);\r\n }\r\n }\r\n }, [select]);\r\n\r\n /*\r\n |------------------------------------------\r\n | render() - Renderização do componente\r\n |------------------------------------------\r\n */\r\n return (\r\n <Box {...props}\r\n className={classNames([props.className, \"input-filter-container\"])}>\r\n <InputLabel {...props}/>\r\n <div className=\"input-filter-content\"\r\n id={props.id ?? \"input-filter\"}>\r\n <select className=\"form-select input-filter-select\"\r\n disabled={props.disabled}\r\n id={(props.id ?? \"input-filter\") + \"-select\"}\r\n name={(props.name ?? \"input-filter\") + \"-select\"}\r\n value={select}\r\n onChange={event => setSelect(event.target.value)}>\r\n {selectOptions?.map(item => (\r\n <option key={item.options}\r\n value={item.options}>{item.label}</option>\r\n ))}\r\n </select>\r\n {(!props.type || props.type === \"text\")\r\n && <Text<\"text\"> {...props as InputFilterProps<\"text\">}\r\n options={options}\r\n select={select}/>}\r\n {props.type === \"date\"\r\n && <Date<\"date\"> {...props as InputFilterProps<\"date\">}\r\n options={options}\r\n select={select}/>}\r\n {props.type === \"autocomplete\"\r\n && <Autocomplete<\"autocomplete\"> {...props as InputFilterProps<\"autocomplete\">}\r\n options={options}\r\n select={select}/>}\r\n {props.type === \"number\"\r\n && <Number<\"number\"> {...props}\r\n options={options}\r\n select={select}/>}\r\n </div>\r\n </Box>\r\n );\r\n}"],"names":["getMetaContent","id","element","document","getElementById","url","replace","substr","slice","length","MES","name","handleNumber","valor","format","value","parseFloat","toLocaleString","style","currency","optionsDefault","optionsLabel","options","label","filterLegend","optsMatch","match","opts","charAt","option","isNaN","parseInt","filter","item","Box","children","props","css","size","direction","justify","undefined","Array","isArray","join","align","attr","className","classNames","React","createElement","validateDate","date","day","month","year","isMonthValid","isYearValid","isDayValid","currentDate","Date","getDate","handleGetValueText","str","exists","reverse","find","endsWith","handleGetValueDate","select","optsRegex","trim","parts","split","forEach","index","clean","includes","map","number","unshift","concat","handleSetValueDate","position","firstDate","lastDate","handleGetValueAutocomplete","data","values","handleSetValueAutocomplete","ids","handleGetValueNumber","Text","disabled","placeholder","onChange","event","target","handleChangeValue","key","InputLabel","iconPrefix","icon","required","Number","Autocomplete","AutocompletePrimeReact","AutoComplete","multiple","completeMethod","onSearch","query","appendTo","emptyMessage","field","inputClassName","panelClassName","scrollHeight","autocompleteScrollHeight","selectionLimit","autocompleteSelectLimit","suggestions","sort","a","b","selectOptions","setSelect","useState","handle.handleGetOption","useEffect","type","handle.handleGetValueDate","setDate","handle.handleSetValueDate","handle.handleGetValueAutocomplete","handle.handleSetValueAutocomplete","handle.handleGetValueNumber","handle.handleGetValueText","dto","word","legend","obj","text","substring","interval","handleLegend","dia","mes","ano"],"mappings":"0LASM,SAAUA,EAAeC,GAC3B,IAAIC,EAAeC,SAASC,eAAeH,GACvCI,EAAiC,OAAZH,EAAmB,KAAQA,EAAe,QAAEI,QAAQ,OAAQ,OACrF,OAAe,OAARD,EAAe,KAA0B,MAAnBA,EAAIE,QAAQ,GAAaF,EAAIG,MAAM,EAAGH,EAAII,OAAS,GAAKJ,CACzF,CCXmCL,EAAe,QACfA,EAAe,cACdA,EAAe,cAE5C,MAAMU,EAA2C,CACpD,CAAET,GAAI,EAAGU,KAAM,WACf,CAAEV,GAAI,EAAGU,KAAM,aACf,CAAEV,GAAI,EAAGU,KAAM,SACf,CAAEV,GAAI,EAAGU,KAAM,SACf,CAAEV,GAAI,EAAGU,KAAM,QACf,CAAEV,GAAI,EAAGU,KAAM,SACf,CAAEV,GAAI,EAAGU,KAAM,SACf,CAAEV,GAAI,EAAGU,KAAM,UACf,CAAEV,GAAI,EAAGU,KAAM,YACf,CAAEV,GAAI,GAAIU,KAAM,WAChB,CAAEV,GAAI,GAAIU,KAAM,YAChB,CAAEV,GAAI,GAAIU,KAAM,sBCXJC,EACZC,EACAC,EAA8B,WAE9B,IAAIC,EAAQF,EAAMP,QAAQ,YAAa,IACvC,MAAe,YAAXQ,EACOC,EAAMT,QAAQ,IAAK,KAAKA,QAAQ,YAAa,MAEjDU,WAAWD,EAAMT,QAAQ,IAAK,MAAMW,eAAe,QAAS,CAC/DC,MAAO,WACPC,SAAU,QACXb,QAAQ,IAAK,IACpB,CCjBO,MAAMc,EAAuD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AAO,MAAMC,IAAQ,eAC3D9I,QAAQ,OAAQ,KAAKiE,MAAM,EAKjC,OAAOqE,EAAS,WAHenG,IAAlBuG,IAAW,GAClBC,EAAa7F,GACb6F,EAAaD,EAAS,GAAGvE,MAAM,MAAQ,MAAQwE,EAAaD,EAAS,GAAGvE,MAAM,MAExF,2BAMM,SAA2B1D,GAC7B,IAAI6H,EAASpH,EAAaT,GAC1B,OAAe,OAAX6H,EACO,oCAEJA,EAAS,MAAQ7H,GAAOT,QAAQ,8BAA+B,KAAO,GACjF"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import React, { CSSProperties } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Retorna a legenda de acordo com operador na string
|
|
5
|
+
* @param value - Valor a ser tratado
|
|
6
|
+
*/
|
|
7
|
+
declare function filterLegend(value: string | undefined): string | null;
|
|
8
|
+
/**
|
|
9
|
+
* Realiza o tratamento das informações para retorna a legenda do tipo `Date`
|
|
10
|
+
* @param value - Valor a ser tratado
|
|
11
|
+
*/
|
|
12
|
+
declare function filterLegendData(value: string | undefined): string;
|
|
13
|
+
/**
|
|
14
|
+
* Realiza o tratamento das informações para retorna a legenda do tipo `Text`
|
|
15
|
+
* @param value - Valor a ser tratado
|
|
16
|
+
*/
|
|
17
|
+
declare function filterLegendText(value: string | undefined): string;
|
|
18
|
+
/**
|
|
19
|
+
* Realiza o tratamento das informações para retorna a legando do tipo `autocomplete`
|
|
20
|
+
* @param value - Valor a ser tratado
|
|
21
|
+
* @param dto - Array de objeto para ser pesquisado a legenda
|
|
22
|
+
* @param word - Limite de palavras para a legenda
|
|
23
|
+
*/
|
|
24
|
+
declare function filterLegendAutocomplete(value: string | undefined, dto?: any[], word?: number): string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Define as tipagens `default` de todos os componentes do pacote
|
|
28
|
+
*/
|
|
29
|
+
interface ApiComponentProps {
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Propriedade para identificar o id do elemento
|
|
33
|
+
*/
|
|
34
|
+
id?: string
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Adiciona no atributo `class` do componente o valor atribuido nessa propriedade
|
|
38
|
+
*/
|
|
39
|
+
className?: string
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Define o tamanho da box do componente de acordo com o valores abaixo
|
|
43
|
+
*/
|
|
44
|
+
size?: "5" | "10" | "12-5" | "15" | "17-5" | "20" | "22-5" | "25" | "30" | "33" | "35" | "40" | "45" | "50" | "55" | "60" | "65" | "70" | "75" | "80" | "85" | "90" | "95" | "100"
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Define as propriedades css do component `style`
|
|
48
|
+
*/
|
|
49
|
+
css?: CSSProperties
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Define as tipagens ´default´ de tidos os componente de entrada de dados do pacote
|
|
54
|
+
*/
|
|
55
|
+
interface ApiFieldComponentProps {
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Define o id do campo
|
|
59
|
+
*/
|
|
60
|
+
id?: string
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Define o nome do campo
|
|
64
|
+
*/
|
|
65
|
+
name?: string
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Define o rótulo do campo
|
|
69
|
+
*/
|
|
70
|
+
label?: string
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Define o espaço reservador do campo
|
|
74
|
+
*/
|
|
75
|
+
placeholder?: string
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Define o icone do campo
|
|
79
|
+
*/
|
|
80
|
+
icon?: string
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Define o prefixo dos icones do pacote
|
|
84
|
+
*/
|
|
85
|
+
iconPrefix?: "bi bi-" | "pi pi-"
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Define se campo é obrigatório
|
|
89
|
+
*/
|
|
90
|
+
required?: boolean
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Desabilita a entrada de dados no campo
|
|
94
|
+
*/
|
|
95
|
+
disabled?: boolean
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
interface InputFilterBaseProps<T extends keyof InputFilterOptionsMap> extends ApiComponentProps, ApiFieldComponentProps {
|
|
99
|
+
/**
|
|
100
|
+
* Valor inicial do componente
|
|
101
|
+
*/
|
|
102
|
+
value?: string
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Retorna o valor modificado pelo componente
|
|
106
|
+
*/
|
|
107
|
+
onChange(value: string | null): void
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Define o tipo do filtro
|
|
111
|
+
*/
|
|
112
|
+
type?: T;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Define as opções do filtro
|
|
116
|
+
*/
|
|
117
|
+
options?: Array<InputFilterOptionsMap[T]>;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
interface InputFilterAutocompleteProps {
|
|
121
|
+
/**
|
|
122
|
+
* Sugestões do autocomplete
|
|
123
|
+
*/
|
|
124
|
+
data: Array<{ id: number, label: string }>
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Realiza a pesquisa do autocomplete de acordo com query
|
|
128
|
+
*/
|
|
129
|
+
onSearch(query: string, selected?: number[]): void
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Define o número de elementos que poser ser selecionado no autocomplete
|
|
133
|
+
*/
|
|
134
|
+
autocompleteSelectLimit?: number
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Define a altura da caixa de seleção dos dados
|
|
138
|
+
*/
|
|
139
|
+
autocompleteScrollHeight?: string
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
type InputFilterProps<T extends keyof InputFilterOptionsMap> = T extends "autocomplete"
|
|
143
|
+
? InputFilterBaseProps<"autocomplete"> & InputFilterAutocompleteProps
|
|
144
|
+
: InputFilterBaseProps<T>;
|
|
145
|
+
|
|
146
|
+
type InputFilterOptionsMap = {
|
|
147
|
+
text: "=" | "!=" | "%" | "!%"
|
|
148
|
+
date: "=" | "!=" | "<" | ">" | "<=" | ">=" | "{}"
|
|
149
|
+
autocomplete: "=" | "!=" | "%" | "!%"
|
|
150
|
+
number: "=" | "!=" | "<" | ">" | "<=" | ">="
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Componente - `InputFilter`
|
|
155
|
+
*
|
|
156
|
+
* Um componente utilizado para montar o objeto de pesquisa de dados.
|
|
157
|
+
* Permite alterar o seu tipo através do type: `text`, `date`, `autocomplete`.
|
|
158
|
+
*/
|
|
159
|
+
declare function InputFilter<T extends keyof InputFilterOptionsMap = "text">({ ...props }: InputFilterProps<T>): React.JSX.Element;
|
|
160
|
+
|
|
161
|
+
export { InputFilter, filterLegend, filterLegendAutocomplete, filterLegendData, filterLegendText };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"jquery";import"axios";import"node-snackbar";import"sweetalert2";import e,{useState as t,useEffect as n}from"react";import{classNames as l}from"primereact/utils";import{AutoComplete as a}from"primereact/autocomplete";function i(e){let t=document.getElementById(e),n=null===t?null:t.content.replace(".br/",".br");return null===n?null:"/"===n.substr(-1)?n.slice(0,n.length-1):n}i("auth"),i("react-base"),i("csrf-token");const r=[{id:1,name:"Janeiro"},{id:2,name:"Fevereiro"},{id:3,name:"Março"},{id:4,name:"Abril"},{id:5,name:"Maio"},{id:6,name:"Junho"},{id:7,name:"Julho"},{id:8,name:"Agosto"},{id:9,name:"Setembro"},{id:10,name:"Outubro"},{id:11,name:"Novembro"},{id:12,name:"Dezembro"}];function o(e,t="decimal"){let n=e.replace(/[^0-9.,]/g,"");return"decimal"===t?n.replace(",",".").replace(/(\..*)\./g,"$1"):parseFloat(n.replace(",",".")).toLocaleString("pt-BR",{style:"currency",currency:"BRL"}).replace("."," ")}const s=["=","!=","%","!%"],c=[{options:"=",label:"Igual a"},{options:"!=",label:"Diferente de"},{options:"<",label:"Menor do que"},{options:">",label:"Maior do que"},{options:"<=",label:"Menor ou igual a"},{options:">=",label:"Maior ou igual a"},{options:"{}",label:"Intervalo"},{options:"%",label:"Contém o que"},{options:"!%",label:"Não contém o que"}];function u(e){if(!e)return null;let t=e?.match(/(=|!=|<|>|<=|>=|%|!%|\{\})/),n=e.charAt(e.length-1),l=t?.[0];return t?.[0]!==n&&isNaN(parseInt(n))&&l?.slice(-1)!==n&&(l=t?.[0]+n),c.filter((e=>e.options===l))[0]?.label??null}function p(e){let t=u(e);if(null===t)return"Não encontramos legenda definida.";let n=e?.split("{}"),l=e?.split("/");const a=e=>{let t=parseInt(e[0]),n=parseInt(e[1],10),l=parseInt(e[2]);return`\n ${t>0?`${0==n?"dia":""} ${t}`:""} \n ${n>0?`${t>0?"de":""} ${r[n-1]?.name}`:""} \n ${l>0?`${t>0||n>0?"de":""} ${l}`:""}\n `.replace(/\s+/g," ").trim()};return t+": "+(void 0===n?.[1]?a(l):a(n[0].split("/"))+" à "+a(n[1].split("/")))}function d(e){let t=u(e);return null===t?"Não encontramos legenda definida.":t+": "+(e?.replace(/(=|!=|<|>|<=|>=|%|!%|\{\})/g,"")??"")}function m(e,t=[],n=30){let l=u(e);if(null===l||0===t.length)return"Não encontramos legenda definida.";let a=e?.split(";").map((e=>parseInt(e)))??[],i=t.filter((e=>a.includes(e.id))).map((e=>e.label)).join(", "),r=i.substring(0,n);return l+": "+r+(r.length!==i.length?"...":"")}const f=({children:t,...n})=>{const a={size:`box-size-${n.size??"100"}`,direction:`box-direction-${n.direction??"row"}`,justify:void 0===n.justify?"":Array.isArray(n.justify)?n.justify?.join(" "):n.justify,align:void 0===n.align?"":Array.isArray(n.align)?n.align?.join(" "):n.align},i={className:l(["box",n.className??"",a.size,a.direction,a.justify,a.align]),style:n.css,id:n.id};return e.createElement("div",{...i},t)};function g(e){const[t,n,l]=e,a=n>=1&&n<=12,i=l>0&&l<99999,r=t>=1&&t<=31;if(i&&!a&&!r)return[0,0,l];if(i&&a&&!r)return[0,n,l];if(i&&a&&r){let a=new Date(l,n,0);return a.getDate()<t?[a.getDate(),n,l]:e}return i||!a||r?!i&&a&&r?[t,n,0]:i||a||!r?i&&!a&&r?[t,0,l]:[0,0,0]:[t,0,0]:[0,n,0]}function h(e,t){let n=e,l=t.slice().reverse().find((e=>n?.endsWith(e)));return l&&void 0!==n?n.slice(0,-l.length):n??null}function b(e,t,n=null){let l=e,a=/(=|!=|<|>|<=|>=|\{\})/,i=e?.match(a),r=i?i[0].trim():t[0],o=[];return(l?.split("{}")??[]).forEach(((e,t)=>{let n=e.replace(a,"").trim();if(n.includes("/"))o[t]=n.split("/").map((e=>parseInt(e)));else{let e=parseInt(n);o[t]=[isNaN(e)?0:e]}for(;o[t].length<3;)o[t].unshift(0)})),o[1]&&"{}"===r?[...g(o[0]),n??r].concat(...g(o[1])):0===o.length?[0,0,0,r]:[...g(o[0]),n??r]}function v(e,t,n){null!==t&&(n[t]=parseInt(e));let l=n[3],a=n.slice(0,3);if(a=g(a),"{}"!==l)return`${a[0]}/${a[1]}/${a[2]}${l}`;let i=isNaN(parseInt(n[n.length-1]))&&null===t?[0,0,0]:n.slice(-3);return i=g(i),`${a[0]}/${a[1]}/${a[2]}${l}${i[0]}/${i[1]}/${i[2]}`}function N(e,t,n){let l=e?.split(";").map((e=>parseInt(e)))??[];return n.filter((e=>l.includes(e.id)))}function y(e,t){let n=e.map((e=>e.id));return 0===n.length?null:n.join(";")+t}function E(e,t){let n=e,l=t.slice().reverse().find((e=>n?.endsWith(e)));return o(l&&void 0!==n?n.slice(0,-l.length):n??"","decimal")}function $(t){return e.createElement("input",{className:"form-control input-filter-field",disabled:t.disabled,id:(t.id??"input-filter")+"-text",name:(t.name??"input-filter")+"-text",placeholder:t.placeholder,value:h(t.value,t.options)??"",onChange:e=>t.onChange(e.target.value+t.select)})}function C(t){let n=b(t.value,t.options,t.select);function l(e){"{}"===t.select&&"0/0/0{}0/0/0"===e?t.onChange(null):0!=n[0]&&!isNaN(n[0])||0!=n[1]&&!isNaN(n[1])||0!=n[2]&&!isNaN(n[2])?t.onChange(e):t.onChange(null)}return e.createElement("div",{className:"d-flex w-100 flex-column"},e.createElement("div",{className:"w-100 d-flex gap-2"},n.map(((a,i)=>{if(i<=2)return e.createElement("input",{className:"form-control input-filter-field-date"+(2==i?" year":""),disabled:t.disabled,id:(t.id??"input-filter")+"-"+i,key:i,name:(t.name??"input-filter")+"-"+i,placeholder:t.placeholder,value:0===a?"":a,onChange:e=>l(v(e.target.value,i,n))})}))),"{}"===t.select&&n.length>4&&e.createElement("div",{className:"w-100 d-flex gap-2 mt-2"},n.map(((a,i)=>{if(i>=4)return e.createElement("input",{className:"form-control input-filter-field-date"+(6==i?" year":""),disabled:t.disabled,id:(t.id??"input-filter")+"-"+i,key:i,name:(t.name??"input-filter")+"-"+i,placeholder:t.placeholder,value:0===a?"":a,onChange:e=>l(v(e.target.value,i,n))})}))))}const x=({iconPrefix:t="bi bi-",...n})=>n.label&&e.createElement("p",{className:"form-label"},n.icon&&e.createElement("i",{className:t+n.icon+" me-1"}),n.label,n.required&&e.createElement("span",{className:"text-danger"},"*"));function I(t){return e.createElement("input",{className:"form-control input-filter-field",disabled:t.disabled,id:(t.id??"input-filter")+"-number",name:(t.name??"input-filter")+"-number",placeholder:t.placeholder,value:E(t.value,t.options??""),onChange:e=>t.onChange(o(e.target.value,"decimal")+t.select)})}function j(t){const n=N(t.value,t.options,t.data);return e.createElement(a,{multiple:!0,completeMethod:e=>{let l=n.map((e=>e.id));t.onSearch(e.query,l)},appendTo:"self",className:"w-100",disabled:t.disabled,emptyMessage:"Não encontramos dados.",field:"label",id:(t.id??"input-filter")+"-autocomplete",inputClassName:"form-control",name:(t.name??"input-filter")+"-autocomplete",panelClassName:"input-filter-autocomplete-panel",placeholder:t.placeholder,required:t.required,scrollHeight:t.autocompleteScrollHeight,selectionLimit:t.autocompleteSelectLimit,suggestions:t.data,value:n,onChange:e=>t.onChange(y(e.value,t.select))})}function q({...a}){const i=(a.options??s).sort(((e,t)=>e.length-t.length)),r=c.filter((e=>i?.includes(e.options))),[o,u]=t(function(e,t){let n=t.filter((t=>e?.includes(t)));return n[n.length-1]??t[0]}(a.value,i));return n((()=>{if(a.type&&"text"!==a.type){if("date"===a.type){let e=b(a.value,i,o),t=v("0",null,e);"{}"===o&&"0/0/0{}0/0/0"===t||0==e[0]&&0==e[1]&&0==e[2]?a.onChange(null):a.onChange(t)}else if("autocomplete"===a.type){let e=N(a.value,0,a.data);a.onChange(y(e,o))}else if("number"===a.type){let e=E(a.value,i);""!==e?a.onChange(e+o):a.onChange(null)}}else{let e=h(a.value,i);null!==e?a.onChange(e+o):a.onChange(null)}}),[o]),e.createElement(f,{...a,className:l([a.className,"input-filter-container"])},e.createElement(x,{...a}),e.createElement("div",{className:"input-filter-content",id:a.id??"input-filter"},e.createElement("select",{className:"form-select input-filter-select",disabled:a.disabled,id:(a.id??"input-filter")+"-select",name:(a.name??"input-filter")+"-select",value:o,onChange:e=>u(e.target.value)},r?.map((t=>e.createElement("option",{key:t.options,value:t.options},t.label)))),(!a.type||"text"===a.type)&&e.createElement($,{...a,options:i,select:o}),"date"===a.type&&e.createElement(C,{...a,options:i,select:o}),"autocomplete"===a.type&&e.createElement(j,{...a,options:i,select:o}),"number"===a.type&&e.createElement(I,{...a,options:i,select:o})))}export{q as InputFilter,u as filterLegend,m as filterLegendAutocomplete,p as filterLegendData,d as filterLegendText};
|
|
2
|
+
//# sourceMappingURL=index.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../src/utils/helper.ts","../../src/utils/const.ts","../../src/utils/handle.ts","../../src/inputfilter/const.ts","../../src/inputfilter/legend.ts","../../src/box/box.tsx","../../src/inputfilter/function/validate.ts","../../src/inputfilter/function/handle.ts","../../src/inputfilter/core/text.tsx","../../src/inputfilter/core/date.tsx","../../src/api/input.tsx","../../src/inputfilter/core/number.tsx","../../src/inputfilter/core/autocomplete.tsx","../../src/inputfilter/inputfilter.tsx"],"sourcesContent":["import $ from \"jquery\";\r\nimport axios from \"axios\";\r\nimport { message } from \"./message\";\r\nimport { IUtilsHelperResponse } from \"./types\";\r\n\r\n/**\r\n * Realiza a pesquisa do elemento html na DOM<br>\r\n * <meta id=\"???\" name=\"???\" content=\"your-url\">\r\n */\r\nexport function getMetaContent(id: string): string | null {\r\n let element: any = document.getElementById(id);\r\n let url: null | string = element === null ? null : (element.content).replace(\".br/\", \".br\");\r\n return url === null ? null : url.substr(-1) === \"/\" ? url.slice(0, url.length - 1) : url;\r\n}\r\n\r\n/**\r\n * Realiza a pesquisa do CEP na API pública \"https://viacep.com.br/ws/\"\r\n */\r\nexport async function getCep(value: string): Promise<IUtilsHelperResponse[\"gep_cep\"]> {\r\n let cep = value.length === 0 ? \"00000000\" : value.replace(\"-\", \"\");\r\n return await axios.get<IUtilsHelperResponse[\"gep_cep\"]>(\"https://viacep.com.br/ws/\" + cep + \"/json/\")\r\n .then(data => data.data);\r\n}\r\n\r\n/**\r\n * Realiza a pesquisa do elemento na árvore DOM\r\n */\r\nexport function getElementDOM(element?: string, preloadTimeOut?: number): Promise<null | JQuery<HTMLElement>> {\r\n return new Promise((resolve) => {\r\n // @ts-ignore\r\n let body = window.self === window.top ? $(\"body\") : $(window.frameElement).parents(\"body\");\r\n if (!element || element.length === 0) {\r\n resolve(body);\r\n }\r\n\r\n if (element === \"#\" || element === \".\") {\r\n resolve(null);\r\n }\r\n\r\n let elementFound = body.find(element);\r\n if (elementFound.length > 0) {\r\n resolve(elementFound);\r\n } else {\r\n setTimeout(() => {\r\n let iframe = body.find(\"iframe\").contents();\r\n if (iframe.length === 0) {\r\n resolve(null);\r\n }\r\n elementFound = iframe.find(element);\r\n if (elementFound.length > 0) {\r\n resolve(elementFound);\r\n }\r\n resolve(null);\r\n }, preloadTimeOut ?? 300);\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Permite à comunicação de origem cruzada entre objetos do Windows.<br>\r\n * Exemplo: Comunicação entre iframe e corpo principal\r\n */\r\nexport function windowMessageEvent(): void {\r\n window.addEventListener(\"message\", function (event: MessageEvent) {\r\n if (event.data?.type === \"message\") {\r\n let data = event.data;\r\n message<any>({ ...data.params });\r\n }\r\n });\r\n}","import { getMetaContent } from \"./helper\";\r\n\r\nexport const USER: string | null = getMetaContent(\"auth\");\r\nexport const BASE: string | null = getMetaContent(\"react-base\");\r\nexport const TOKEN: string | null = getMetaContent(\"csrf-token\");\r\n\r\nexport const MES: Array<{ id: number, name: string }> = [\r\n { id: 1, name: \"Janeiro\" },\r\n { id: 2, name: \"Fevereiro\" },\r\n { id: 3, name: \"Março\" },\r\n { id: 4, name: \"Abril\" },\r\n { id: 5, name: \"Maio\" },\r\n { id: 6, name: \"Junho\" },\r\n { id: 7, name: \"Julho\" },\r\n { id: 8, name: \"Agosto\" },\r\n { id: 9, name: \"Setembro\" },\r\n { id: 10, name: \"Outubro\" },\r\n { id: 11, name: \"Novembro\" },\r\n { id: 12, name: \"Dezembro\" },\r\n];\r\n\r\nexport const ESTADOS: Array<{ id: string, name: string }> = [\r\n { name: \"Acre\", id: \"AC\" },\r\n { name: \"Alagoas\", id: \"AL\" },\r\n { name: \"Amapá\", id: \"AP\" },\r\n { name: \"Amazonas\", id: \"AM\" },\r\n { name: \"Bahia\", id: \"BA\" },\r\n { name: \"Ceará\", id: \"CE\" },\r\n { name: \"Distrito Federal\", id: \"DF\" },\r\n { name: \"Espírito Santo\", id: \"ES\" },\r\n { name: \"Goiás\", id: \"GO\" },\r\n { name: \"Maranhão\", id: \"MA\" },\r\n { name: \"Mato Grosso\", id: \"MT\" },\r\n { name: \"Mato Grosso do Sul\", id: \"MS\" },\r\n { name: \"Minas Gerais\", id: \"MG\" },\r\n { name: \"Pará\", id: \"PA\" },\r\n { name: \"Paraíba\", id: \"PB\" },\r\n { name: \"Paraná\", id: \"PR\" },\r\n { name: \"Pernambuco\", id: \"PE\" },\r\n { name: \"Piauí\", id: \"PI\" },\r\n { name: \"Rio de Janeiro\", id: \"RJ\" },\r\n { name: \"Rio Grande do Norte\", id: \"RN\" },\r\n { name: \"Rio Grande do Sul\", id: \"RS\" },\r\n { name: \"Rondônia\", id: \"RO\" },\r\n { name: \"Roraima\", id: \"RR\" },\r\n { name: \"Santa Catarina\", id: \"SC\" },\r\n { name: \"São Paulo\", id: \"SP\" },\r\n { name: \"Sergipe\", id: \"SE\" },\r\n { name: \"Tocantins\", id: \"TO\" }\r\n];","/**\r\n * Formata um valor numérico para o formato decimal ou monetário.\r\n *\r\n * @param valor - O valor a ser formatado.\r\n * @param format - O formato desejado: \"money\" para monetário ou \"decimal\" para decimal.\r\n * @returns O valor formatado como string.\r\n */\r\nexport function handleNumber(\r\n valor: string,\r\n format: \"money\" | \"decimal\" = \"decimal\"\r\n): string {\r\n let value = valor.replace(/[^0-9.,]/g, \"\");\r\n if (format === \"decimal\") {\r\n return value.replace(\",\", \".\").replace(/(\\..*)\\./g, \"$1\");\r\n }\r\n return parseFloat(value.replace(\",\", \".\")).toLocaleString(\"pt-BR\", {\r\n style: \"currency\",\r\n currency: \"BRL\"\r\n }).replace(\".\", \" \");\r\n}\r\n\r\n/**\r\n * Formata um valor de string para o formato de horas (HH:MM).\r\n *\r\n * @param valor - O valor a ser formatado.\r\n * @returns O valor formatado como string no formato de horas.\r\n */\r\nexport function handleHours(valor: string): string {\r\n let value = valor.replace(/[^\\d.]/g, \"\");\r\n const parts = value.split(\".\");\r\n\r\n if (parts.length > 1) {\r\n parts[1] = parts[1].substring(0, 2);\r\n }\r\n\r\n value = parts.join(\".\");\r\n if (value.length > 2) {\r\n value = value.substring(0, value.length - 2) + \":\" + value.substring(value.length - 2);\r\n }\r\n return value;\r\n}","import { InputFilterOptionsMap, InputFilterOptionsProps } from \"./types\";\r\n\r\nexport const optionsDefault: Array<InputFilterOptionsMap[\"text\"]> = [\"=\", \"!=\", \"%\", \"!%\"];\r\n\r\nexport const optionsLabel: Array<{\r\n options: InputFilterOptionsProps,\r\n label: string\r\n}> = [\r\n { options: \"=\", label: \"Igual a\" },\r\n { options: \"!=\", label: \"Diferente de\" },\r\n { options: \"<\", label: \"Menor do que\" },\r\n { options: \">\", label: \"Maior do que\" },\r\n { options: \"<=\", label: \"Menor ou igual a\" },\r\n { options: \">=\", label: \"Maior ou igual a\" },\r\n { options: \"{}\", label: \"Intervalo\" },\r\n { options: \"%\", label: \"Contém o que\" },\r\n { options: \"!%\", label: \"Não contém o que\" },\r\n];","import { MES } from \"../utils\";\r\nimport { optionsLabel } from \"./const\";\r\n\r\n/**\r\n * Retorna a legenda de acordo com operador na string\r\n * @param value - Valor a ser tratado\r\n */\r\nexport function filterLegend(value: string | undefined): string | null {\r\n if (!value) {\r\n return null;\r\n }\r\n let optsRegex = /(=|!=|<|>|<=|>=|%|!%|\\{\\})/;\r\n let optsMatch = value?.match(optsRegex);\r\n let opts = value.charAt(value.length - 1);\r\n let option = optsMatch?.[0];\r\n\r\n if (optsMatch?.[0] !== opts && isNaN(parseInt(opts)) && option?.slice(-1) !== opts) {\r\n option = optsMatch?.[0] + opts;\r\n }\r\n return optionsLabel.filter(item => item.options === option)[0]?.label ?? null;\r\n}\r\n\r\n/**\r\n * Realiza o tratamento das informações para retorna a legenda do tipo `Date`\r\n * @param value - Valor a ser tratado\r\n */\r\nexport function filterLegendData(value: string | undefined): string {\r\n let legend = filterLegend(value);\r\n if (legend === null) {\r\n return \"Não encontramos legenda definida.\";\r\n }\r\n\r\n let interval = value?.split(\"{}\");\r\n let date = value?.split(\"/\");\r\n\r\n const handleLegend = (date: any): string => {\r\n let dia = parseInt(date[0]);\r\n let mes = parseInt(date[1], 10);\r\n let ano = parseInt(date[2]);\r\n\r\n return `\r\n ${(dia > 0 ? `${mes == 0 ? \"dia\" : \"\"} ${dia}` : \"\")} \r\n ${mes > 0 ? `${dia > 0 ? \"de\" : \"\"} ${MES[mes - 1]?.name}` : \"\"} \r\n ${ano > 0 ? `${dia > 0 || mes > 0 ? \"de\" : \"\"} ${ano}` : \"\"}\r\n `.replace(/\\s+/g, \" \").trim();\r\n };\r\n let result = interval?.[1] === undefined\r\n ? handleLegend(date)\r\n : handleLegend(interval[0].split(\"/\")) + \" à \" + handleLegend(interval[1].split(\"/\"));\r\n return legend + \": \" + result;\r\n}\r\n\r\n/**\r\n * Realiza o tratamento das informações para retorna a legenda do tipo `Text`\r\n * @param value - Valor a ser tratado\r\n */\r\nexport function filterLegendText(value: string | undefined): string {\r\n let legend = filterLegend(value);\r\n if (legend === null) {\r\n return \"Não encontramos legenda definida.\";\r\n }\r\n return legend + \": \" + (value?.replace(/(=|!=|<|>|<=|>=|%|!%|\\{\\})/g, \"\") ?? \"\");\r\n}\r\n\r\n/**\r\n * Realiza o tratamento das informações para retorna a legando do tipo `autocomplete`\r\n * @param value - Valor a ser tratado\r\n * @param dto - Array de objeto para ser pesquisado a legenda\r\n * @param word - Limite de palavras para a legenda\r\n */\r\nexport function filterLegendAutocomplete(value: string | undefined, dto: any[] = [], word: number = 30): string {\r\n let legend = filterLegend(value);\r\n if (legend === null || dto.length === 0) {\r\n return \"Não encontramos legenda definida.\";\r\n }\r\n let ids: any[] = value?.split(\";\").map(item => parseInt(item)) ?? [];\r\n let values = dto\r\n .filter(obj => ids.includes(obj.id))\r\n .map(item => item.label).join(\", \");\r\n let text = values.substring(0, word);\r\n return legend + \": \" + text + (text.length !== values.length ? \"...\" : \"\");\r\n}","import { BoxProps } from \"./types\";\r\nimport React, { HTMLAttributes } from \"react\";\r\nimport { classNames } from \"primereact/utils\";\r\n\r\n/**\r\n * Componente - `Box`\r\n *\r\n * Um componente versátil que pode ser utilizado para criar seções ou caixas em uma página.\r\n * Permite personalizar o estilo e o conteúdo através de propriedades.\r\n *\r\n * Exemplo de uso:\r\n * ```tsx\r\n * <Box align=\"align-items-center\"\r\n * justify=\"justify-content-end\"\r\n * size=\"25\">\r\n * ...conteúdo HTML\r\n * </Box>\r\n * ```\r\n */\r\nexport const Box = ({ children, ...props }: BoxProps) => {\r\n const css = {\r\n size: `box-size-${(props.size ?? \"100\")}`,\r\n direction: `box-direction-${props.direction ?? \"row\"}`,\r\n justify: props.justify === undefined ? \"\" : Array.isArray(props.justify) ? props.justify?.join(\" \") : props.justify,\r\n align: props.align === undefined ? \"\" : Array.isArray(props.align) ? props.align?.join(\" \") : props.align\r\n };\r\n\r\n const attr: HTMLAttributes<\"div\"> & Omit<BoxProps, \"children\"> = {\r\n className: classNames([\r\n \"box\",\r\n props.className ?? \"\",\r\n css.size,\r\n css.direction,\r\n css.justify,\r\n css.align\r\n ]),\r\n style: props.css,\r\n id: props.id\r\n };\r\n\r\n return (\r\n <div {...attr as any}>{children}</div>\r\n );\r\n};","/**\r\n * Valida e ajusta uma data fornecida como um array de números.\r\n *\r\n * @param date - Um array de números representando [dia, mês, ano].\r\n * @returns Um array de números representando a data validada e ajustada.\r\n */\r\nexport function validateDate(date: number[]): number[] {\r\n const [day, month, year] = date;\r\n\r\n const isMonthValid = month >= 1 && month <= 12;\r\n const isYearValid = year > 0 && year < 99999;\r\n const isDayValid = day >= 1 && day <= 31;\r\n\r\n if (isYearValid && !isMonthValid && !isDayValid) {\r\n return [0, 0, year];\r\n }\r\n\r\n if (isYearValid && isMonthValid && !isDayValid) {\r\n return [0, month, year];\r\n }\r\n\r\n if (isYearValid && isMonthValid && isDayValid) {\r\n let currentDate = new Date(year, month, 0);\r\n if (currentDate.getDate() < day) {\r\n return [currentDate.getDate(), month, year];\r\n }\r\n return date;\r\n }\r\n\r\n if (!isYearValid && isMonthValid && !isDayValid) {\r\n return [0, month, 0];\r\n }\r\n\r\n if (!isYearValid && isMonthValid && isDayValid) {\r\n return [day, month, 0];\r\n }\r\n\r\n if (!isYearValid && !isMonthValid && isDayValid) {\r\n return [day, 0, 0];\r\n }\r\n\r\n if (isYearValid && !isMonthValid && isDayValid) {\r\n return [day, 0, year];\r\n }\r\n\r\n return [0, 0, 0];\r\n}","import { validateDate } from \"./validate\";\r\nimport { handleNumber } from \"../../utils\";\r\nimport { InputFilterOptionsMap } from \"../types\";\r\n\r\n/**\r\n * Obtém a opção de filtro correspondente ao valor fornecido.\r\n *\r\n * @param value - O valor para buscar uma opção correspondente.\r\n * @param options - Um array de opções de filtro disponíveis.\r\n * @returns A opção de filtro correspondente ou a primeira opção se nenhuma correspondência for encontrada.\r\n */\r\nexport function handleGetOption<T extends keyof InputFilterOptionsMap>(\r\n value: string | undefined,\r\n options: Array<InputFilterOptionsMap[T]>\r\n): string {\r\n let exists = options.filter(option => value?.includes(option));\r\n return exists[exists.length - 1] ?? options[0];\r\n}\r\n\r\n/**\r\n * Retorna apenas o valor sem os operadores filtro tipo `Text`.\r\n *\r\n * @param value - O valor completo, incluindo a opção de filtro.\r\n * @param options - Um array de opções de filtro disponíveis.\r\n * @returns O valor sem as opções de filtro.\r\n */\r\nexport function handleGetValueText(\r\n value: string | undefined,\r\n options: Array<InputFilterOptionsMap[\"text\"]>\r\n): string | null {\r\n let str = value;\r\n let exists = options\r\n .slice()\r\n .reverse()\r\n .find(item => str?.endsWith(item));\r\n if (exists && str !== undefined) {\r\n return str.slice(0, -exists.length);\r\n }\r\n return str ?? null;\r\n}\r\n\r\n/**\r\n * Retorna apenas o valor sem os operadores filtro tipo `Date`.\r\n *\r\n * @param value - O valor completo, incluindo a opção de filtro.\r\n * @param options - Um array de opções de filtro disponíveis.\r\n * @param select - Seletor do tipo de filtro\r\n * @returns O valor sem as opções de filtro.\r\n */\r\nexport function handleGetValueDate(\r\n value: string | undefined,\r\n options: Array<InputFilterOptionsMap[\"date\"]>,\r\n select: null | string = null\r\n): Array<number | string> {\r\n let str = value;\r\n let optsRegex = /(=|!=|<|>|<=|>=|\\{\\})/;\r\n let optsMatch = value?.match(optsRegex);\r\n let opts = optsMatch ? optsMatch[0].trim() : options[0];\r\n\r\n let parts: any[] = [];\r\n let interval = str?.split(\"{}\") ?? [];\r\n\r\n interval.forEach((value, index) => {\r\n let clean = value.replace(optsRegex, \"\").trim();\r\n\r\n if (clean.includes(\"/\")) {\r\n parts[index] = clean.split(\"/\").map(item => parseInt(item));\r\n } else {\r\n let number = parseInt(clean);\r\n parts[index] = [isNaN(number) ? 0 : number];\r\n }\r\n\r\n while (parts[index].length < 3) {\r\n parts[index].unshift(0);\r\n }\r\n });\r\n\r\n if (parts[1] && opts === \"{}\") {\r\n return [...validateDate(parts[0]), select ?? opts].concat(...validateDate(parts[1]));\r\n }\r\n return parts.length === 0\r\n ? [0, 0, 0, opts]\r\n : [...validateDate(parts[0]), select ?? opts];\r\n}\r\n\r\n/**\r\n * Atualiza um valor de data em uma posição específica e retorna a data formatada.\r\n *\r\n * @param value - O novo valor a ser inserido na data\r\n * @param position - A posição do valor a ser atualizado (0 para dia, 1 para mês, 2 para ano)\r\n * @param date - O array da data atual, incluindo as opções\r\n * @returns A data atualizada e formatada como string\r\n */\r\nexport function handleSetValueDate(\r\n value: string,\r\n position: number | null,\r\n date: (number | string)[]\r\n): string {\r\n if (position !== null) {\r\n date[position] = parseInt(value);\r\n }\r\n\r\n let opts = date[3];\r\n let firstDate = date.slice(0, 3);\r\n firstDate = validateDate(firstDate as number[]);\r\n\r\n if (opts !== \"{}\") {\r\n return `${firstDate[0]}/${firstDate[1]}/${firstDate[2]}${opts}`;\r\n }\r\n\r\n let lastDate = isNaN(parseInt(date[date.length - 1] as string)) && position === null\r\n ? [0, 0, 0]\r\n : date.slice(-3);\r\n lastDate = validateDate(lastDate as number[]);\r\n return `${firstDate[0]}/${firstDate[1]}/${firstDate[2]}${opts}${lastDate[0]}/${lastDate[1]}/${lastDate[2]}`;\r\n}\r\n\r\n/**\r\n * Obtém os valores selecionados do autocomplete a partir da string de valor e dos dados disponíveis.\r\n *\r\n * @param value - String contendo os IDs dos itens selecionados, separados por ponto e vírgula.\r\n * @param options - Array de opções de filtro disponíveis para o autocomplete.\r\n * @param data - Array de objetos contendo os dados disponíveis para seleção.\r\n * @returns Array de objetos correspondentes aos IDs selecionados.\r\n */\r\nexport function handleGetValueAutocomplete(\r\n value: string | undefined,\r\n options: Array<InputFilterOptionsMap[\"autocomplete\"]>,\r\n data: Array<{ id: number, label: string }>\r\n) {\r\n let values: any[] = value?.split(\";\").map(item => parseInt(item)) ?? [];\r\n return data.filter(item => values.includes(item.id));\r\n}\r\n\r\n/**\r\n * Converte os valores selecionados do autocomplete em uma string formatada para o filtro.\r\n *\r\n * @param value - Array de objetos selecionados no autocomplete.\r\n * @param select - String representando a opção de filtro selecionada.\r\n * @returns String formatada com os IDs dos itens selecionados e a opção de filtro.\r\n */\r\nexport function handleSetValueAutocomplete(\r\n value: Array<{ id: number, label: string }>,\r\n select: string,\r\n): string | null {\r\n let ids = value.map(item => item.id);\r\n return ids.length === 0 ? null : ids.join(\";\") + select;\r\n}\r\n\r\n/**\r\n * Retorna apenas o valor sem os operadores filtro tipo `Number`.\r\n *\r\n * @param value - O valor completo, incluindo a opção de filtro.\r\n * @param options - Um array de opções de filtro disponíveis.\r\n * @returns O valor sem as opções de filtro.\r\n */\r\nexport function handleGetValueNumber(\r\n value: string | undefined,\r\n options: Array<InputFilterOptionsMap[\"text\"]>\r\n): string {\r\n let str = value;\r\n let exists = options\r\n .slice()\r\n .reverse()\r\n .find(item => str?.endsWith(item));\r\n if (exists && str !== undefined) {\r\n return handleNumber(str.slice(0, -exists.length), \"decimal\");\r\n }\r\n return handleNumber(str ?? \"\", \"decimal\");\r\n}","import React from \"react\";\r\nimport { handleGetValueText } from \"../function/handle\";\r\nimport { InputFilterCoreProps, InputFilterOptionsMap } from \"../types\";\r\n\r\n/**\r\n * Core - `Text`\r\n * Campo do filtro tipo texto\r\n */\r\nexport function Text<T extends keyof InputFilterOptionsMap>(props: InputFilterCoreProps<T>) {\r\n return (\r\n <input className=\"form-control input-filter-field\"\r\n disabled={props.disabled}\r\n id={(props.id ?? \"input-filter\") + \"-text\"}\r\n name={(props.name ?? \"input-filter\") + \"-text\"}\r\n placeholder={props.placeholder}\r\n value={handleGetValueText(props.value, props.options) ?? \"\"}\r\n onChange={event => props.onChange(event.target.value + props.select)}/>\r\n );\r\n}","import React from \"react\";\r\nimport { InputFilterCoreProps, InputFilterOptionsMap } from \"../types\";\r\nimport { handleGetValueDate, handleSetValueDate } from \"../function/handle\";\r\n\r\n/**\r\n * Core - `Date`\r\n * Campo do filtro tipo data\r\n */\r\nexport function Date<T extends keyof InputFilterOptionsMap>(props: InputFilterCoreProps<T>) {\r\n let date = handleGetValueDate(props.value, props.options, props.select);\r\n\r\n function handleChangeValue(value: string) {\r\n if (props.select === \"{}\" && value === \"0/0/0{}0/0/0\") {\r\n props.onChange(null);\r\n } else {\r\n if ((date[0] == 0 || isNaN(date[0] as number)) &&\r\n (date[1] == 0 || isNaN(date[1] as number)) &&\r\n (date[2] == 0 || isNaN(date[2] as number))) {\r\n props.onChange(null);\r\n } else {\r\n props.onChange(value);\r\n }\r\n }\r\n }\r\n\r\n return (\r\n <div className=\"d-flex w-100 flex-column\">\r\n <div className=\"w-100 d-flex gap-2\">\r\n {date.map((item, index) => {\r\n if (index <= 2) {\r\n return (\r\n <input className={\"form-control input-filter-field-date\" + (index == 2 ? \" year\" : \"\")}\r\n disabled={props.disabled}\r\n id={(props.id ?? \"input-filter\") + \"-\" + index}\r\n key={index}\r\n name={(props.name ?? \"input-filter\") + \"-\" + index}\r\n placeholder={props.placeholder}\r\n value={item === 0 ? \"\" : item}\r\n onChange={event => handleChangeValue(handleSetValueDate(event.target.value, index, date))}/>\r\n );\r\n }\r\n })}\r\n </div>\r\n {props.select === \"{}\" && date.length > 4\r\n && <div className=\"w-100 d-flex gap-2 mt-2\">\r\n {date.map((item, index) => {\r\n if (index >= 4) {\r\n return (\r\n <input className={\"form-control input-filter-field-date\" + (index == 6 ? \" year\" : \"\")}\r\n disabled={props.disabled}\r\n id={(props.id ?? \"input-filter\") + \"-\" + index}\r\n key={index}\r\n name={(props.name ?? \"input-filter\") + \"-\" + index}\r\n placeholder={props.placeholder}\r\n value={item === 0 ? \"\" : item}\r\n onChange={event => handleChangeValue(handleSetValueDate(event.target.value, index, date))}/>\r\n );\r\n }\r\n })}\r\n </div>}\r\n </div>\r\n );\r\n}","import React from \"react\";\r\nimport { ApiFieldComponentProps } from \"./types\";\r\n\r\n/**\r\n * API - `InputLabel`\r\n *\r\n * Um componente utilizado como label em todos os componente de campo do pacote.\r\n * Permite personalizar o estilo e o conteúdo através de propriedades.\r\n */\r\nexport const InputLabel = ({ iconPrefix = \"bi bi-\", ...props }: ApiFieldComponentProps) => {\r\n /*\r\n |------------------------------------------\r\n | render() - Renderização do componente\r\n |------------------------------------------\r\n */\r\n return props.label\r\n && <p className='form-label'>\r\n {props.icon && <i className={iconPrefix + props.icon + \" me-1\"}/>}\r\n {props.label}\r\n {props.required && <span className=\"text-danger\">*</span>}\r\n </p>;\r\n};","import React from \"react\";\r\nimport { handleNumber } from \"../../utils\";\r\nimport { handleGetValueNumber } from \"../function/handle\";\r\nimport { InputFilterCoreProps, InputFilterOptionsMap } from \"../types\";\r\n\r\n/**\r\n * Core - `Number`\r\n * Campo do filtro tipo numero\r\n */\r\nexport function Number<T extends keyof InputFilterOptionsMap>(props: InputFilterCoreProps<T>) {\r\n return (\r\n <input className=\"form-control input-filter-field\"\r\n disabled={props.disabled}\r\n id={(props.id ?? \"input-filter\") + \"-number\"}\r\n name={(props.name ?? \"input-filter\") + \"-number\"}\r\n placeholder={props.placeholder}\r\n value={handleGetValueNumber(props.value, props.options ?? \"\")}\r\n onChange={event => props.onChange(handleNumber(event.target.value, \"decimal\") + props.select)}/>\r\n );\r\n}","import React from \"react\";\r\nimport { InputFilterCoreProps, InputFilterOptionsMap } from \"../types\";\r\nimport { AutoComplete as AutocompletePrimeReact } from \"primereact/autocomplete\";\r\nimport { handleGetValueAutocomplete, handleSetValueAutocomplete } from \"../function/handle\";\r\n\r\n/**\r\n * Core - `Autocomplete`\r\n * Campo do filtro tipo autocomplete\r\n */\r\nexport function Autocomplete<T extends keyof InputFilterOptionsMap>(props: InputFilterCoreProps<\"autocomplete\">) {\r\n const value = handleGetValueAutocomplete(props.value, props.options, props.data);\r\n\r\n return (\r\n <AutocompletePrimeReact multiple\r\n completeMethod={event => {\r\n let ids = value.map(item => item.id);\r\n props.onSearch(event.query, ids);\r\n }}\r\n appendTo=\"self\"\r\n className=\"w-100\"\r\n disabled={props.disabled}\r\n emptyMessage=\"Não encontramos dados.\"\r\n field=\"label\"\r\n id={(props.id ?? \"input-filter\") + \"-\" + \"autocomplete\"}\r\n inputClassName=\"form-control\"\r\n name={(props.name ?? \"input-filter\") + \"-\" + \"autocomplete\"}\r\n panelClassName=\"input-filter-autocomplete-panel\"\r\n placeholder={props.placeholder}\r\n required={props.required}\r\n scrollHeight={props.autocompleteScrollHeight}\r\n selectionLimit={props.autocompleteSelectLimit}\r\n suggestions={props.data}\r\n value={value}\r\n onChange={event => props.onChange(handleSetValueAutocomplete(event.value, props.select))}/>\r\n );\r\n}","import { Box } from \"../box\";\r\nimport { Text } from \"./core/text\";\r\nimport { Date } from \"./core/date\";\r\nimport { InputLabel } from \"../api\";\r\nimport { Number } from \"./core/number\";\r\nimport * as handle from \"./function/handle\";\r\nimport { classNames } from \"primereact/utils\";\r\nimport { Autocomplete } from \"./core/autocomplete\";\r\nimport React, { useState, useEffect } from \"react\";\r\nimport { optionsDefault, optionsLabel } from \"./const\";\r\nimport { InputFilterOptionsMap, InputFilterProps } from \"./types\";\r\n\r\n/**\r\n * Componente - `InputFilter`\r\n *\r\n * Um componente utilizado para montar o objeto de pesquisa de dados.\r\n * Permite alterar o seu tipo através do type: `text`, `date`, `autocomplete`.\r\n */\r\nexport function InputFilter<T extends keyof InputFilterOptionsMap = \"text\">({ ...props }: InputFilterProps<T>) {\r\n\r\n const options: any[] = (props.options ?? optionsDefault).sort((a, b) => a.length - b.length);\r\n const selectOptions = optionsLabel.filter(item => options?.includes(item.options as any));\r\n const [select, setSelect] = useState<string>(handle.handleGetOption<T>(props.value, options));\r\n\r\n useEffect(() => {\r\n if (!props.type || props.type === \"text\") {\r\n let value = handle.handleGetValueText(props.value, options);\r\n if (value !== null) {\r\n props.onChange(value + select);\r\n } else {\r\n props.onChange(null);\r\n }\r\n } else if (props.type === \"date\") {\r\n let date = handle.handleGetValueDate(props.value, options, select);\r\n let setDate = handle.handleSetValueDate(\"0\", null, date);\r\n\r\n if (select === \"{}\" && setDate === \"0/0/0{}0/0/0\") {\r\n props.onChange(null);\r\n } else {\r\n if (date[0] == 0 && date[1] == 0 && date[2] == 0) {\r\n props.onChange(null);\r\n } else {\r\n props.onChange(setDate);\r\n }\r\n }\r\n } else if (props.type === \"autocomplete\") {\r\n let value = handle.handleGetValueAutocomplete(props.value, options, props.data);\r\n props.onChange(handle.handleSetValueAutocomplete(value, select));\r\n } else if (props.type === \"number\") {\r\n let value = handle.handleGetValueNumber(props.value, options);\r\n if (value !== \"\") {\r\n props.onChange(value + select);\r\n } else {\r\n props.onChange(null);\r\n }\r\n }\r\n }, [select]);\r\n\r\n /*\r\n |------------------------------------------\r\n | render() - Renderização do componente\r\n |------------------------------------------\r\n */\r\n return (\r\n <Box {...props}\r\n className={classNames([props.className, \"input-filter-container\"])}>\r\n <InputLabel {...props}/>\r\n <div className=\"input-filter-content\"\r\n id={props.id ?? \"input-filter\"}>\r\n <select className=\"form-select input-filter-select\"\r\n disabled={props.disabled}\r\n id={(props.id ?? \"input-filter\") + \"-select\"}\r\n name={(props.name ?? \"input-filter\") + \"-select\"}\r\n value={select}\r\n onChange={event => setSelect(event.target.value)}>\r\n {selectOptions?.map(item => (\r\n <option key={item.options}\r\n value={item.options}>{item.label}</option>\r\n ))}\r\n </select>\r\n {(!props.type || props.type === \"text\")\r\n && <Text<\"text\"> {...props as InputFilterProps<\"text\">}\r\n options={options}\r\n select={select}/>}\r\n {props.type === \"date\"\r\n && <Date<\"date\"> {...props as InputFilterProps<\"date\">}\r\n options={options}\r\n select={select}/>}\r\n {props.type === \"autocomplete\"\r\n && <Autocomplete<\"autocomplete\"> {...props as InputFilterProps<\"autocomplete\">}\r\n options={options}\r\n select={select}/>}\r\n {props.type === \"number\"\r\n && <Number<\"number\"> {...props}\r\n options={options}\r\n select={select}/>}\r\n </div>\r\n </Box>\r\n );\r\n}"],"names":["getMetaContent","id","element","document","getElementById","url","replace","substr","slice","length","MES","name","handleNumber","valor","format","value","parseFloat","toLocaleString","style","currency","optionsDefault","optionsLabel","options","label","filterLegend","optsMatch","match","opts","charAt","option","isNaN","parseInt","filter","item","filterLegendData","legend","interval","split","date","handleLegend","dia","mes","ano","trim","undefined","filterLegendText","filterLegendAutocomplete","dto","word","ids","map","values","obj","includes","join","text","substring","Box","children","props","css","size","direction","justify","Array","isArray","align","attr","className","classNames","React","createElement","validateDate","day","month","year","isMonthValid","isYearValid","isDayValid","currentDate","Date","getDate","handleGetValueText","str","exists","reverse","find","endsWith","handleGetValueDate","select","optsRegex","parts","forEach","index","clean","number","unshift","concat","handleSetValueDate","position","firstDate","lastDate","handleGetValueAutocomplete","data","handleSetValueAutocomplete","handleGetValueNumber","Text","disabled","placeholder","onChange","event","target","handleChangeValue","key","InputLabel","iconPrefix","icon","required","Number","Autocomplete","AutocompletePrimeReact","multiple","completeMethod","onSearch","query","appendTo","emptyMessage","field","inputClassName","panelClassName","scrollHeight","autocompleteScrollHeight","selectionLimit","autocompleteSelectLimit","suggestions","InputFilter","sort","a","b","selectOptions","setSelect","useState","handle.handleGetOption","useEffect","type","handle.handleGetValueDate","setDate","handle.handleSetValueDate","handle.handleGetValueAutocomplete","handle.handleSetValueAutocomplete","handle.handleGetValueNumber","handle.handleGetValueText"],"mappings":"+NASM,SAAUA,EAAeC,GAC3B,IAAIC,EAAeC,SAASC,eAAeH,GACvCI,EAAiC,OAAZH,EAAmB,KAAQA,EAAe,QAAEI,QAAQ,OAAQ,OACrF,OAAe,OAARD,EAAe,KAA0B,MAAnBA,EAAIE,QAAQ,GAAaF,EAAIG,MAAM,EAAGH,EAAII,OAAS,GAAKJ,CACzF,CCXmCL,EAAe,Q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M5C,MAAOO,GACrC,OAAVP,EACA4C,EAAMkD,SAAS9F,EAAQ0E,GAEvB9B,EAAMkD,SAAS,KAEtB,CAuBA,GACF,CAACpB,IAQAnB,EAACC,cAAAd,EAAQ,IAAAE,EACJS,UAAWC,EAAW,CAACV,EAAMS,UAAW,4BACzCE,EAACC,cAAA2C,EAAe,IAAAvD,IAChBW,EAAKC,cAAA,MAAA,CAAAH,UAAU,uBACVnE,GAAI0D,EAAM1D,IAAM,gBACjBqE,EAAAC,cAAA,SAAA,CAAQH,UAAU,kCACVuC,SAAUhD,EAAMgD,SAChB1G,IAAK0D,EAAM1D,IAAM,gBAAkB,UACnCU,MAAOgD,EAAMhD,MAAQ,gBAAkB,UACvCI,MAAO0E,EACPoB,SAAUC,GAAS8B,EAAU9B,EAAMC,OAAOhG,QAC7C4H,GAAezF,KAAIjB,GAChBqC,EAAAC,cAAA,SAAA,CAAQ0C,IAAKhF,EAAKX,QACVP,MAAOkB,EAAKX,SAAUW,EAAKV,YAGxCoC,EAAMqF,MAAuB,SAAfrF,EAAMqF,OAChB1E,EAACC,cAAAmC,EAAiB,IAAA/C,EACJrC,QAASA,EACTmE,OAAQA,IACb,SAAf9B,EAAMqF,MACA1E,EAACC,cAAAS,EAAiB,IAAArB,EACJrC,QAASA,EACTmE,OAAQA,IACb,iBAAf9B,EAAMqF,MACA1E,EAACC,cAAAgD,EAAiC,IAAA5D,EACJrC,QAASA,EACTmE,OAAQA,IAC7B,WAAf9B,EAAMqF,MACA1E,EAAAC,cAAC+C,EAAM,IAAe3D,EACJrC,QAASA,EACTmE,OAAQA,KAIjD"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orangesix/react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Luiz Fernando Bernardes de Paula",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Conjunto de componentes e funções disponíveis para serem utilizados em projetos React.",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "https://github.com/Nandovga/orangesix-react.git"
|
|
@@ -20,15 +20,16 @@
|
|
|
20
20
|
"component library"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@tiptap/extension-color": "^2.
|
|
24
|
-
"@tiptap/extension-highlight": "^2.
|
|
25
|
-
"@tiptap/extension-image": "^2.
|
|
26
|
-
"@tiptap/extension-link": "^2.
|
|
27
|
-
"@tiptap/extension-text-style": "^2.
|
|
28
|
-
"@tiptap/extension-underline": "^2.
|
|
29
|
-
"@tiptap/pm": "^2.
|
|
30
|
-
"@tiptap/react": "^2.
|
|
31
|
-
"@tiptap/starter-kit": "^2.
|
|
23
|
+
"@tiptap/extension-color": "^2.9.1",
|
|
24
|
+
"@tiptap/extension-highlight": "^2.9.1",
|
|
25
|
+
"@tiptap/extension-image": "^2.9.1",
|
|
26
|
+
"@tiptap/extension-link": "^2.9.1",
|
|
27
|
+
"@tiptap/extension-text-style": "^2.9.1",
|
|
28
|
+
"@tiptap/extension-underline": "^2.9.1",
|
|
29
|
+
"@tiptap/pm": "^2.9.1",
|
|
30
|
+
"@tiptap/react": "^2.9.1",
|
|
31
|
+
"@tiptap/starter-kit": "^2.9.1",
|
|
32
|
+
"@webdatarocks/react-webdatarocks": "^1.4.15",
|
|
32
33
|
"axios": "^1.7.7",
|
|
33
34
|
"bootstrap": "^5.3.3",
|
|
34
35
|
"bootstrap-icons": "^1.11.3",
|
|
@@ -38,6 +39,6 @@
|
|
|
38
39
|
"primereact": "^10.8.4",
|
|
39
40
|
"react": "^18.3.1",
|
|
40
41
|
"react-dom": "^18.3.1",
|
|
41
|
-
"sweetalert2": "^11.14.
|
|
42
|
+
"sweetalert2": "^11.14.5"
|
|
42
43
|
}
|
|
43
44
|
}
|
package/table/index.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react"),t=require("primereact/utils"),a=require("primereact/column"),o=require("primereact/datatable");const r=({children:a,...o})=>{const r={size:`box-size-${o.size??"100"}`,direction:`box-direction-${o.direction??"row"}`,justify:void 0===o.justify?"":Array.isArray(o.justify)?o.justify?.join(" "):o.justify,align:void 0===o.align?"":Array.isArray(o.align)?o.align?.join(" "):o.align},n={className:t.classNames(["box",o.className??"",r.size,r.direction,r.justify,r.align]),style:o.css};return e.createElement("div",{...n},a)};function n(e){return{value:e.data,dataKey:"id",lazy:void 0!==e.lazy,resizableColumns:e.styleResizable??!1,columnResizeMode:"expand",emptyMessage:e.emptyMessage??"Não há informações disponíveis no momento.",header:e.templeteHeader,footer:e.templateFooter}}function
|
|
1
|
+
"use strict";var e=require("react"),t=require("primereact/utils"),a=require("primereact/column"),o=require("primereact/datatable");const r=({children:a,...o})=>{const r={size:`box-size-${o.size??"100"}`,direction:`box-direction-${o.direction??"row"}`,justify:void 0===o.justify?"":Array.isArray(o.justify)?o.justify?.join(" "):o.justify,align:void 0===o.align?"":Array.isArray(o.align)?o.align?.join(" "):o.align},n={className:t.classNames(["box",o.className??"",r.size,r.direction,r.justify,r.align]),style:o.css,id:o.id};return e.createElement("div",{...n},a)};function n(e){return{value:e.data,dataKey:"id",lazy:void 0!==e.lazy,resizableColumns:e.styleResizable??!1,columnResizeMode:"expand",emptyMessage:e.emptyMessage??"Não há informações disponíveis no momento.",header:e.templeteHeader,footer:e.templateFooter}}function i(e){return{sortField:e.lazy?.sortField,sortOrder:e.lazy?.sortOrder??null,onSort:void 0!==e.lazy?function(t){e.onSort&&e.onSort(t.sortField,t.sortOrder)}:void 0}}function l(e,t,a){return{groupRowsBy:e.rowGroup,rowGroupMode:e.rowGroupMode,rowGroupHeaderTemplate:e.rowGroupHeaderTemplate,rowGroupFooterTemplate:e.rowGroupFooterTemplate,expandableRowGroups:e.rowExpandable??!1,expandedRows:t,onRowToggle(e){a(e.data)}}}function s(e){return{metaKeySelection:void 0!==e.onSelection,selection:e.selection,selectionMode:void 0!==e.onSelection?e.selectionMode??"single":void 0,onSelectionChange:function(t){e.onSelection&&e.onSelection(t.value)}}}function d(t){return{paginator:t.paginator??!1,paginatorClassName:"pagination",totalRecords:t?.lazy?.paginationTotal??void 0,first:void 0===t?.lazy?.paginationPage?0:((t?.lazy?.paginationPage??0)-1)*(t.paginatorRow??10),rows:t.paginator?t.paginatorRow??10:void 0,rowsPerPageOptions:[5,10,15,20,50,100],paginatorTemplate:{layout:"RowsPerPageDropdown FirstPageLink PageLinks LastPageLink CurrentPageReport",CurrentPageReport:t=>e.createElement("p",{className:"text-secondary mx-2",style:{fontSize:".9em"}},"Total de registros: ",t.totalRecords),RowsPerPageDropdown:t=>e.createElement("select",{className:"form-select form-select-sm mx-2",style:{maxWidth:"60px"},value:t.value,onChange:e=>{const a={};a.value=Number(e.target.value),t.onChange(a)}},t.options.map((t=>e.createElement("option",{key:t.value,value:t.value},t.label))))},paginatorRight:t.templatePaginationRight,paginatorLeft:t.templatePaginationLeft,onPage:void 0!==t.lazy?function(e){let a=e.first/(t.paginatorRow??10);t.onPaginator&&t.onPaginator(a+1,e.rows)}:void 0}}function c(e){return{root:{className:"table-responsive"},table:{className:t.classNames(["table",e.styleHover?"table-hover":"",e.styleStriped?"table-striped":"","small"===e.styleSize?"table-sm":"","bordered"===e.styleType?"table-bordered":"borderless"===e.styleType?"table-borderless":""])},header:{className:"table-header"},footer:{className:"table-footer"},paginator:{root:{className:t.classNames(["p-0 d-flex mb-1 mt-2",`justify-content-${e.paginatorAlign??"center"}`]),style:{borderTop:"none"}},firstPageButton:{style:{borderTopLeftRadius:"3px",borderBottomLeftRadius:"3px"}},lastPageButton:{style:{borderTopRightRadius:"3px",borderBottomRightRadius:"3px"}}}}}function p(){return{sort:{className:"table-sort"},headerCell:e=>({className:t.classNames([e?.context.sorted?"table-sort-active":""])}),bodyCell:{className:"table-resizable"}}}exports.Table=function(t){const[u,m]=e.useState([]);return e.createElement(r,{className:"p-0",size:t.size??"100"},e.createElement(o.DataTable,{pt:{...c(t)},tableClassName:t.className,...n(t),...i(t),...s(t),...d(t),...l(t,u,m)},"checkbox"===t.selectionMode&&e.createElement(a.Column,{align:"center",headerStyle:{width:"2.5rem"},pt:{...p()},selectionMode:"multiple"}),t.column.map((t=>e.createElement(a.Column,{unstyled:!0,align:t.align,alignFrozen:t.frozen?"right":void 0,alignHeader:t.alignHeader,body:t.body,field:t.id,frozen:void 0!==t.frozen,header:t.header,key:t.id,pt:{...p()},sortable:t.sort??!1,style:t.style})))))};
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|