jclib-ui 1.2.0 → 1.2.1

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.
@@ -0,0 +1,19 @@
1
+ import { ReactNode } from 'react';
2
+
3
+
4
+ type Props = {
5
+ isOpen: boolean
6
+ setOpen: (isOpen: boolean) => void
7
+ title?: string
8
+ placeHolder?: string
9
+ searchInit?: string
10
+ route: string
11
+ keyField: string
12
+ fields: string[]
13
+ renderLine?: (item) => ReactNode
14
+ onClick: (keyValue, item) => void
15
+ maxWidth?: number
16
+ helpLink?: string
17
+ }
18
+
19
+ export default function BoxSearch(props: Props)
@@ -0,0 +1,11 @@
1
+ type Props = {
2
+ title: string
3
+ items: any[]
4
+ size: string
5
+ children: React.ReactNode
6
+ direction?: string
7
+ color?: string
8
+ dados?: any[]
9
+ }
10
+
11
+ export default function DropDownButton(props: Props)
@@ -0,0 +1,3 @@
1
+ type Props = React.InputHTMLAttributes<HTMLInputElement> & { autoSelect?: boolean }
2
+
3
+ export default function InputPassword(props: Props): JSX.Element
@@ -0,0 +1,14 @@
1
+ import { ReactNode } from 'react';
2
+
3
+
4
+ type Props = {
5
+ type: number
6
+ onConfirm: () => void
7
+ onCancel: () => void
8
+ title?: string
9
+ text?: string
10
+ children?: ReactNode
11
+ defaultBtn?: number
12
+ }
13
+
14
+ export function JCAlert(props: Props): ReactNode
@@ -0,0 +1,11 @@
1
+ type BotaoSalvarProps = {
2
+ loading?: boolean
3
+ saveInfo?: boolean
4
+ link?: string
5
+ fixed?: boolean
6
+ modalFixed?: boolean
7
+ btnSaveDisabled?: boolean
8
+ onCancel?: () => void
9
+ onConfirm?: () => void
10
+ }
11
+ export default function BotaoSalvar(props: BotaoSalvarProps): JSX.Element
@@ -0,0 +1,7 @@
1
+ export type Props = {
2
+ title?: string
3
+ url: string
4
+ timerInMilliSeconds?: number
5
+ }
6
+
7
+ export default function ClipboardArea(props: Props)
@@ -0,0 +1,32 @@
1
+ import { default as axios, AxiosRequestConfig, AxiosResponse } from 'axios';
2
+ import { globalApiConfig } from './useApi';
3
+ import { ReactNode } from 'react';
4
+
5
+
6
+ export type ApiRequestConfig = AxiosRequestConfig & {
7
+ cache?: boolean
8
+ report?: boolean
9
+ onTerminated?: (res: AxiosResponse & { error: any; data: any }) => void
10
+ onBefore?: (config: ApiRequestConfig) => void
11
+ }
12
+
13
+ export type ApiResponseConfig = {
14
+ isError: boolean //deprecated
15
+ message: string | ReactNode | null //deprecated
16
+ loading: boolean
17
+ headers: any
18
+ data: any
19
+ error: string | ReactNode | null
20
+ code: number
21
+ status: number
22
+ report: boolean
23
+ onBefore: (config: ApiRequestConfig) => void
24
+ }
25
+
26
+ export type ApiReturn = [
27
+ callRequest: (config?: ApiRequestConfig) => Promise<ApiResponseConfig>,
28
+ requestInto: ApiResponseConfig,
29
+ callCancel: () => void,
30
+ ]
31
+
32
+ export default function useApi(initialConfig: ApiRequestConfig): ApiReturn
@@ -0,0 +1,10 @@
1
+ type Props = React.InputHTMLAttributes<HTMLInputElement> & {
2
+ search?: string
3
+ setSearch?: (value: string) => void
4
+ fnSearch?: () => void
5
+ fnFilter?: () => void
6
+ fnValidateFilter?: () => boolean
7
+ placeHolder?: string
8
+ }
9
+
10
+ export default function InputPesquisa(props: Props): JSX.Element
@@ -0,0 +1,19 @@
1
+ import { default as React } from 'react';
2
+
3
+
4
+ type Props = {
5
+ title: string
6
+ visible: boolean
7
+ setVisible: (value: boolean) => void
8
+ id?: string
9
+ codigo: number
10
+ maxWidth?: number
11
+ hideScrollBar?: boolean
12
+ id?: string
13
+ children: React.ReactNode
14
+ paddingBottom?: number
15
+ alignTop?: boolean
16
+ helpLink?: string
17
+ }
18
+
19
+ export default function ModalBox(props: Props)
@@ -0,0 +1,11 @@
1
+ type Props = {
2
+ title?: string
3
+ maxWidth: number
4
+ children: React.ReactNode
5
+ setVisible: (value: boolean) => void
6
+ fnApplyFilter: (filtered: boolean) => void
7
+ alignTop?: boolean
8
+ helpLink?: string
9
+ }
10
+
11
+ export default function ModalFilter(props: Props)
@@ -0,0 +1,9 @@
1
+ import { MenusConfig } from './OpcoesMenu';
2
+
3
+
4
+ export type NavbarProps = {
5
+ menusConfig: MenusConfig
6
+ helpLink?: string
7
+ }
8
+
9
+ export default function Navbar(props: NavbarProps): ReactNode
@@ -0,0 +1,39 @@
1
+ import * as React from 'react'
2
+
3
+ export interface InputMaskSelection {
4
+ start: number | null
5
+ end: number | null
6
+ }
7
+
8
+ export interface InputMaskState {
9
+ value: string
10
+ selection: InputMaskSelection | null
11
+ }
12
+
13
+ export interface BeforeMaskedStateChangeStates {
14
+ previousState?: InputMaskState
15
+ currentState?: InputMaskState
16
+ nextState: InputMaskState
17
+ }
18
+
19
+ export interface InputMaskProps
20
+ extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'children'> {
21
+ /** `9` dígito, `a` letra, `*` letra ou dígito; `\` escapa um caractere. Array aceita strings (fixas) e RegExp. */
22
+ mask?: string | Array<string | RegExp> | null
23
+ /** Um caractere (repetido nas posições editáveis) ou string do mesmo tamanho da máscara. `null` oculta o placeholder. */
24
+ maskPlaceholder?: string | null
25
+ /** Mantém a máscara visível mesmo sem foco e com valor vazio. */
26
+ alwaysShowMask?: boolean
27
+ /** Permite alterar o próximo estado (valor/seleção) antes de ser aplicado. */
28
+ beforeMaskedStateChange?: (
29
+ states: BeforeMaskedStateChangeStates
30
+ ) => InputMaskState
31
+ /** Elemento de input customizado; `value`, `onChange`, `onFocus`, `onBlur`, `onMouseDown`, `disabled` e `readOnly` devem ir no InputMask. */
32
+ children?: React.ReactElement
33
+ }
34
+
35
+ declare const InputMask: React.ForwardRefExoticComponent<
36
+ InputMaskProps & React.RefAttributes<HTMLInputElement>
37
+ >
38
+
39
+ export default InputMask
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jclib-ui",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "dependencies": {