jornada-ui 0.4.13 → 0.4.14
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/lib/commonjs/components/list-devices/components/list-device-empty/index.js +68 -0
- package/lib/commonjs/components/list-devices/components/list-device-empty/index.js.map +1 -0
- package/lib/commonjs/components/list-devices/components/list-device-render-item/index.js +77 -0
- package/lib/commonjs/components/list-devices/components/list-device-render-item/index.js.map +1 -0
- package/lib/commonjs/components/list-devices/index.js +22 -54
- package/lib/commonjs/components/list-devices/index.js.map +1 -1
- package/lib/commonjs/components/list-devices/interface.js +2 -0
- package/lib/commonjs/components/list-devices/interface.js.map +1 -0
- package/lib/commonjs/components/list-devices/styles.js +14 -3
- package/lib/commonjs/components/list-devices/styles.js.map +1 -1
- package/lib/module/components/list-devices/components/list-device-empty/index.js +63 -0
- package/lib/module/components/list-devices/components/list-device-empty/index.js.map +1 -0
- package/lib/module/components/list-devices/components/list-device-render-item/index.js +74 -0
- package/lib/module/components/list-devices/components/list-device-render-item/index.js.map +1 -0
- package/lib/module/components/list-devices/index.js +25 -57
- package/lib/module/components/list-devices/index.js.map +1 -1
- package/lib/module/components/list-devices/interface.js +2 -0
- package/lib/module/components/list-devices/interface.js.map +1 -0
- package/lib/module/components/list-devices/styles.js +14 -3
- package/lib/module/components/list-devices/styles.js.map +1 -1
- package/lib/typescript/commonjs/src/components/list-devices/components/list-device-empty/index.d.ts +10 -0
- package/lib/typescript/commonjs/src/components/list-devices/components/list-device-empty/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/list-devices/components/list-device-render-item/index.d.ts +22 -0
- package/lib/typescript/commonjs/src/components/list-devices/components/list-device-render-item/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/list-devices/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/list-devices/interface.d.ts +29 -0
- package/lib/typescript/commonjs/src/components/list-devices/interface.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/list-devices/styles.d.ts +5 -5
- package/lib/typescript/commonjs/src/components/list-devices/styles.d.ts.map +1 -1
- package/lib/typescript/module/src/components/list-devices/components/list-device-empty/index.d.ts +10 -0
- package/lib/typescript/module/src/components/list-devices/components/list-device-empty/index.d.ts.map +1 -0
- package/lib/typescript/module/src/components/list-devices/components/list-device-render-item/index.d.ts +22 -0
- package/lib/typescript/module/src/components/list-devices/components/list-device-render-item/index.d.ts.map +1 -0
- package/lib/typescript/module/src/components/list-devices/index.d.ts.map +1 -1
- package/lib/typescript/module/src/components/list-devices/interface.d.ts +29 -0
- package/lib/typescript/module/src/components/list-devices/interface.d.ts.map +1 -0
- package/lib/typescript/module/src/components/list-devices/styles.d.ts +5 -5
- package/lib/typescript/module/src/components/list-devices/styles.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/list-devices/components/list-device-empty/index.tsx +60 -0
- package/src/components/list-devices/components/list-device-render-item/index.tsx +86 -0
- package/src/components/list-devices/index.tsx +26 -58
- package/src/components/list-devices/{interface.d.ts → interface.ts} +36 -36
- package/src/components/list-devices/styles.ts +73 -68
- package/lib/commonjs/components/list-devices/interface.d.js +0 -2
- package/lib/commonjs/components/list-devices/interface.d.js.map +0 -1
- package/lib/module/components/list-devices/interface.d.js +0 -2
- package/lib/module/components/list-devices/interface.d.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","forwardRef","
|
|
1
|
+
{"version":3,"names":["React","forwardRef","useCallback","FlatList","DeviceRow","ListDeviceEmpty","asBaseComponent","jsx","_jsx","ListDevices","data","textColorDescription","titleColor","selectedId","onSelect","defaultSelectedId","disabled","ref","isControlled","undefined","internalSelected","setInternalSelected","useState","currentSelected","handlePress","device","id","renderItem","item","index","isLast","length","isSelected","onPress","keyExtractor","String","ListEmptyComponent","displayName"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/list-devices/index.tsx"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,IAAIC,UAAU,EAAEC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AoB,EAAEA;IAAqB,CAC5C,CAAC;EAEN,CAAC,EACD,CAACY,eAAe,EAAEP,QAAQ,EAAEQ,WAAW,EAAEZ,UAAU,EAAED,oBAAoB,CAC3E,CAAC;EAED,oBACEH,IAAA,CAACL,QAAQ;IACPc,GAAG,EAAEA,GAAI;IACTP,IAAI,EAAEA,IAAK;IACXwB,YAAY,EAAEA,CAAC;MAAER;IAAG,CAAC,KAAKS,MAAM,CAACT,EAAE,CAAE;IACrCC,UAAU,EAAEA,UAAW;IACvBS,kBAAkB,EAAE/B;EAAgB,CACrC,CAAC;AAEN,CACF,CAAC;AAEDI,WAAW,CAAC4B,WAAW,GAAG,aAAa;;AAEvC;AACA;AACA;AACA,eAAe/B,eAAe,CAACG,WAAW,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/list-devices/interface.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* IMPORTS
|
|
5
|
+
*/
|
|
3
6
|
import { StyleSheet } from "react-native";
|
|
4
7
|
import { theme } from "../../styles/theme/theme.js";
|
|
8
|
+
|
|
9
|
+
// typings
|
|
10
|
+
|
|
5
11
|
const styles = (props = {}) => StyleSheet.create({
|
|
6
12
|
containerIndicator: {
|
|
7
13
|
width: "100%",
|
|
@@ -25,9 +31,10 @@ const styles = (props = {}) => StyleSheet.create({
|
|
|
25
31
|
color: props.titleColor ?? theme.colors.black[10],
|
|
26
32
|
textAlign: "center",
|
|
27
33
|
lineHeight: 20,
|
|
28
|
-
fontSize: theme.fontSizes.
|
|
34
|
+
fontSize: theme.fontSizes.lg,
|
|
29
35
|
fontWeight: "500",
|
|
30
|
-
marginLeft: theme.margins.xs
|
|
36
|
+
marginLeft: theme.margins.xs,
|
|
37
|
+
marginBottom: 8
|
|
31
38
|
},
|
|
32
39
|
titleSelected: {
|
|
33
40
|
color: theme.colors.neutral[25],
|
|
@@ -37,7 +44,7 @@ const styles = (props = {}) => StyleSheet.create({
|
|
|
37
44
|
color: props.textColorDescription ?? theme.colors.gray[600],
|
|
38
45
|
textAlign: "center",
|
|
39
46
|
lineHeight: 16,
|
|
40
|
-
fontSize:
|
|
47
|
+
fontSize: theme.fontSizes.md,
|
|
41
48
|
fontFamily: theme.fonts.inter_light_300,
|
|
42
49
|
marginLeft: theme.margins.xs
|
|
43
50
|
},
|
|
@@ -52,5 +59,9 @@ const styles = (props = {}) => StyleSheet.create({
|
|
|
52
59
|
justifyContent: "center"
|
|
53
60
|
}
|
|
54
61
|
});
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* EXPORTS
|
|
65
|
+
*/
|
|
55
66
|
export { styles };
|
|
56
67
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","theme","styles","props","create","containerIndicator","width","flexDirection","justifyContent","alignItems","marginTop","paddingVertical","paddingHorizontal","opacity","disabled","containerIndicatorSelected","backgroundColor","colors","green","borderRadius","separator","borderBottomWidth","borderBottomColor","isSelected","gray","title","color","titleColor","black","textAlign","lineHeight","fontSize","fontSizes","
|
|
1
|
+
{"version":3,"names":["StyleSheet","theme","styles","props","create","containerIndicator","width","flexDirection","justifyContent","alignItems","marginTop","paddingVertical","paddingHorizontal","opacity","disabled","containerIndicatorSelected","backgroundColor","colors","green","borderRadius","separator","borderBottomWidth","borderBottomColor","isSelected","gray","title","color","titleColor","black","textAlign","lineHeight","fontSize","fontSizes","lg","fontWeight","marginLeft","margins","xs","marginBottom","titleSelected","neutral","titleDescription","textColorDescription","md","fontFamily","fonts","inter_light_300","descSelected","containerMain"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/list-devices/styles.ts"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,cAAc;AACzC,SAASC,KAAK,QAAQ,6B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AAG,CAAC;IAC3DK,SAAS,EAAE,QAAQ;IACnBC,UAAU,EAAE,EAAE;IACdC,QAAQ,EAAE9B,KAAK,CAAC+B,SAAS,CAACW,EAAE;IAC5BC,UAAU,EAAE3C,KAAK,CAAC4C,KAAK,CAACC,eAAe;IACvCX,UAAU,EAAElC,KAAK,CAACmC,OAAO,CAACC;EAC5B,CAAC;EAEDU,YAAY,EAAE;IACZrB,KAAK,EAAEzB,KAAK,CAACgB,MAAM,CAACuB,OAAO,CAAC,EAAE;EAChC,CAAC;EAEDQ,aAAa,EAAE;IACb1C,KAAK,EAAE,MAAM;IACbC,aAAa,EAAE,QAAQ;IACvBE,UAAU,EAAE,YAAY;IACxB0B,UAAU,EAAE,CAAC;IACb3B,cAAc,EAAE;EAClB;AACF,CAAC,CAAC;;AAEJ;AACA;AACA;AACA,SAASN,MAAM","ignoreList":[]}
|
package/lib/typescript/commonjs/src/components/list-devices/components/list-device-empty/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import React from "react";
|
|
5
|
+
/**
|
|
6
|
+
* Componente ListDeviceEmpty para a interação da ui.
|
|
7
|
+
*/
|
|
8
|
+
declare const _default: React.ComponentType<Omit<any, "ref"> & React.RefAttributes<any>>;
|
|
9
|
+
export default _default;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/list-devices/components/list-device-empty/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAqB,MAAM,OAAO,CAAC;AAqD1C;;GAEG;;AACH,wBAAgD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import React from "react";
|
|
5
|
+
import type { IData } from "../../interface";
|
|
6
|
+
/**
|
|
7
|
+
* Componente DeviceRow para a exibição de um item da lista de dispositivos
|
|
8
|
+
*/
|
|
9
|
+
declare const DeviceRow: React.NamedExoticComponent<{
|
|
10
|
+
device: IData;
|
|
11
|
+
isSelected: boolean;
|
|
12
|
+
isLast: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
onPress: (d: IData) => void;
|
|
15
|
+
titleColor?: string;
|
|
16
|
+
textColorDescription?: string;
|
|
17
|
+
}>;
|
|
18
|
+
/**
|
|
19
|
+
* EXPORTS
|
|
20
|
+
*/
|
|
21
|
+
export { DeviceRow };
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/list-devices/components/list-device-render-item/index.tsx"],"names":[],"mappings":"AAEA;;GAEG;AACH,OAAO,KAAkB,MAAM,OAAO,CAAC;AAQvC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAM7C;;GAEG;AACH,QAAA,MAAM,SAAS;YASL,KAAK;gBACD,OAAO;YACX,OAAO;eACJ,OAAO;aACT,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI;iBACd,MAAM;2BACI,MAAM;EA2C7B,CAAC;AAEH;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/list-devices/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/list-devices/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAkC,MAAM,OAAO,CAAC;AAOvD,OAAO,KAAK,EAAE,YAAY,EAAS,MAAM,aAAa,CAAC;AAyDvD;;GAEG;;AACH,wBAA4C"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
interface IData {
|
|
2
|
+
id: number;
|
|
3
|
+
macDevice: string;
|
|
4
|
+
nameDevice: string;
|
|
5
|
+
}
|
|
6
|
+
type Extra = {
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
isSelected?: boolean;
|
|
9
|
+
};
|
|
10
|
+
interface IListDevices {
|
|
11
|
+
/** dados que vão ser renderizados */
|
|
12
|
+
data?: IData[];
|
|
13
|
+
/** cor do texto */
|
|
14
|
+
titleColor?: string;
|
|
15
|
+
/** cor do titulo (não está sendo usada no componente atual, mantida por compat) */
|
|
16
|
+
titleNumberColor?: string;
|
|
17
|
+
/** cor do texto da descrição */
|
|
18
|
+
textColorDescription?: string;
|
|
19
|
+
/** (opcional) id selecionado - modo controlado */
|
|
20
|
+
selectedId?: number | null;
|
|
21
|
+
/** (opcional) seleção inicial - modo não-controlado */
|
|
22
|
+
defaultSelectedId?: number | null;
|
|
23
|
+
/** callback ao selecionar um item */
|
|
24
|
+
onSelect?: (device: IData) => void;
|
|
25
|
+
/** desabilita interação */
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export type { IData, IListDevices, Extra };
|
|
29
|
+
//# sourceMappingURL=interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../../../src/components/list-devices/interface.ts"],"names":[],"mappings":"AACA,UAAU,KAAK;IACb,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,KAAK,KAAK,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE1D,UAAU,YAAY;IACpB,qCAAqC;IACrC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC;IAEf,mBAAmB;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,mFAAmF;IACnF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,gCAAgC;IAChC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAE9B,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B,uDAAuD;IACvD,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAElC,qCAAqC;IACrC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,KAAK,IAAI,CAAC;IAEnC,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import { type IListDevices } from "./interface";
|
|
2
|
-
type Extra = {
|
|
3
|
-
disabled?: boolean;
|
|
4
|
-
isSelected?: boolean;
|
|
5
|
-
};
|
|
1
|
+
import { type IListDevices, type Extra } from "./interface";
|
|
6
2
|
declare const styles: (props?: Partial<IListDevices & Extra>) => {
|
|
7
3
|
containerIndicator: {
|
|
8
4
|
width: "100%";
|
|
@@ -29,6 +25,7 @@ declare const styles: (props?: Partial<IListDevices & Extra>) => {
|
|
|
29
25
|
fontSize: number;
|
|
30
26
|
fontWeight: "500";
|
|
31
27
|
marginLeft: number;
|
|
28
|
+
marginBottom: number;
|
|
32
29
|
};
|
|
33
30
|
titleSelected: {
|
|
34
31
|
color: string;
|
|
@@ -53,5 +50,8 @@ declare const styles: (props?: Partial<IListDevices & Extra>) => {
|
|
|
53
50
|
justifyContent: "center";
|
|
54
51
|
};
|
|
55
52
|
};
|
|
53
|
+
/**
|
|
54
|
+
* EXPORTS
|
|
55
|
+
*/
|
|
56
56
|
export { styles };
|
|
57
57
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/list-devices/styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/list-devices/styles.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AAE5D,QAAA,MAAM,MAAM,WAAW,OAAO,CAAC,YAAY,GAAG,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DhD,CAAC;AAEL;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
package/lib/typescript/module/src/components/list-devices/components/list-device-empty/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import React from "react";
|
|
5
|
+
/**
|
|
6
|
+
* Componente ListDeviceEmpty para a interação da ui.
|
|
7
|
+
*/
|
|
8
|
+
declare const _default: React.ComponentType<Omit<any, "ref"> & React.RefAttributes<any>>;
|
|
9
|
+
export default _default;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/list-devices/components/list-device-empty/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAqB,MAAM,OAAO,CAAC;AAqD1C;;GAEG;;AACH,wBAAgD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import React from "react";
|
|
5
|
+
import type { IData } from "../../interface";
|
|
6
|
+
/**
|
|
7
|
+
* Componente DeviceRow para a exibição de um item da lista de dispositivos
|
|
8
|
+
*/
|
|
9
|
+
declare const DeviceRow: React.NamedExoticComponent<{
|
|
10
|
+
device: IData;
|
|
11
|
+
isSelected: boolean;
|
|
12
|
+
isLast: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
onPress: (d: IData) => void;
|
|
15
|
+
titleColor?: string;
|
|
16
|
+
textColorDescription?: string;
|
|
17
|
+
}>;
|
|
18
|
+
/**
|
|
19
|
+
* EXPORTS
|
|
20
|
+
*/
|
|
21
|
+
export { DeviceRow };
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/list-devices/components/list-device-render-item/index.tsx"],"names":[],"mappings":"AAEA;;GAEG;AACH,OAAO,KAAkB,MAAM,OAAO,CAAC;AAQvC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAM7C;;GAEG;AACH,QAAA,MAAM,SAAS;YASL,KAAK;gBACD,OAAO;YACX,OAAO;eACJ,OAAO;aACT,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI;iBACd,MAAM;2BACI,MAAM;EA2C7B,CAAC;AAEH;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/list-devices/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/list-devices/index.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAkC,MAAM,OAAO,CAAC;AAOvD,OAAO,KAAK,EAAE,YAAY,EAAS,MAAM,aAAa,CAAC;AAyDvD;;GAEG;;AACH,wBAA4C"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
interface IData {
|
|
2
|
+
id: number;
|
|
3
|
+
macDevice: string;
|
|
4
|
+
nameDevice: string;
|
|
5
|
+
}
|
|
6
|
+
type Extra = {
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
isSelected?: boolean;
|
|
9
|
+
};
|
|
10
|
+
interface IListDevices {
|
|
11
|
+
/** dados que vão ser renderizados */
|
|
12
|
+
data?: IData[];
|
|
13
|
+
/** cor do texto */
|
|
14
|
+
titleColor?: string;
|
|
15
|
+
/** cor do titulo (não está sendo usada no componente atual, mantida por compat) */
|
|
16
|
+
titleNumberColor?: string;
|
|
17
|
+
/** cor do texto da descrição */
|
|
18
|
+
textColorDescription?: string;
|
|
19
|
+
/** (opcional) id selecionado - modo controlado */
|
|
20
|
+
selectedId?: number | null;
|
|
21
|
+
/** (opcional) seleção inicial - modo não-controlado */
|
|
22
|
+
defaultSelectedId?: number | null;
|
|
23
|
+
/** callback ao selecionar um item */
|
|
24
|
+
onSelect?: (device: IData) => void;
|
|
25
|
+
/** desabilita interação */
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export type { IData, IListDevices, Extra };
|
|
29
|
+
//# sourceMappingURL=interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../../../src/components/list-devices/interface.ts"],"names":[],"mappings":"AACA,UAAU,KAAK;IACb,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,KAAK,KAAK,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE1D,UAAU,YAAY;IACpB,qCAAqC;IACrC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC;IAEf,mBAAmB;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,mFAAmF;IACnF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,gCAAgC;IAChC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAE9B,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B,uDAAuD;IACvD,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAElC,qCAAqC;IACrC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,KAAK,IAAI,CAAC;IAEnC,2BAA2B;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import { type IListDevices } from "./interface";
|
|
2
|
-
type Extra = {
|
|
3
|
-
disabled?: boolean;
|
|
4
|
-
isSelected?: boolean;
|
|
5
|
-
};
|
|
1
|
+
import { type IListDevices, type Extra } from "./interface";
|
|
6
2
|
declare const styles: (props?: Partial<IListDevices & Extra>) => {
|
|
7
3
|
containerIndicator: {
|
|
8
4
|
width: "100%";
|
|
@@ -29,6 +25,7 @@ declare const styles: (props?: Partial<IListDevices & Extra>) => {
|
|
|
29
25
|
fontSize: number;
|
|
30
26
|
fontWeight: "500";
|
|
31
27
|
marginLeft: number;
|
|
28
|
+
marginBottom: number;
|
|
32
29
|
};
|
|
33
30
|
titleSelected: {
|
|
34
31
|
color: string;
|
|
@@ -53,5 +50,8 @@ declare const styles: (props?: Partial<IListDevices & Extra>) => {
|
|
|
53
50
|
justifyContent: "center";
|
|
54
51
|
};
|
|
55
52
|
};
|
|
53
|
+
/**
|
|
54
|
+
* EXPORTS
|
|
55
|
+
*/
|
|
56
56
|
export { styles };
|
|
57
57
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/list-devices/styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/list-devices/styles.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AAE5D,QAAA,MAAM,MAAM,WAAW,OAAO,CAAC,YAAY,GAAG,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DhD,CAAC;AAEL;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IMPORTS
|
|
3
|
+
*/
|
|
4
|
+
import React, { forwardRef } from "react";
|
|
5
|
+
|
|
6
|
+
// components
|
|
7
|
+
import Box from "../../../box";
|
|
8
|
+
import Typography from "../../../typography";
|
|
9
|
+
|
|
10
|
+
// typings
|
|
11
|
+
import { asBaseComponent } from "../../../../@types/as-base-component";
|
|
12
|
+
|
|
13
|
+
// styles
|
|
14
|
+
import { Icons } from "../../../../common/icons-svg";
|
|
15
|
+
import { theme } from "../../../../styles/theme/theme";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Componente ListDeviceEmpty para a exibição de messagens
|
|
19
|
+
*/
|
|
20
|
+
const ListDeviceEmpty = forwardRef<any, any>((_prop, ref): React.ReactElement => {
|
|
21
|
+
return (
|
|
22
|
+
<Box
|
|
23
|
+
ref={ref}
|
|
24
|
+
width={"100%"}
|
|
25
|
+
flexStyle={{
|
|
26
|
+
flex: 1,
|
|
27
|
+
flexDirection: "column",
|
|
28
|
+
justifyContent: "center",
|
|
29
|
+
alignItems: "center",
|
|
30
|
+
}}
|
|
31
|
+
>
|
|
32
|
+
<Box
|
|
33
|
+
width={"100%"}
|
|
34
|
+
height={60}
|
|
35
|
+
flexStyle={{
|
|
36
|
+
flex: 1,
|
|
37
|
+
flexDirection: "column",
|
|
38
|
+
justifyContent: "center",
|
|
39
|
+
alignItems: "center",
|
|
40
|
+
}}
|
|
41
|
+
>
|
|
42
|
+
<Icons icon={"FILES"} size={28} color={theme.colors.gray[800]} />
|
|
43
|
+
<Typography
|
|
44
|
+
text={"Sem Relações de dispositivos."}
|
|
45
|
+
align={"center"}
|
|
46
|
+
size={theme.fontSizes.md}
|
|
47
|
+
fontFamily={theme.fonts.inter_regular_400}
|
|
48
|
+
color={theme.colors.gray[800]}
|
|
49
|
+
lineHeight={24}
|
|
50
|
+
letterSpacing={"regular"}
|
|
51
|
+
/>
|
|
52
|
+
</Box>
|
|
53
|
+
</Box>
|
|
54
|
+
);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Componente ListDeviceEmpty para a interação da ui.
|
|
59
|
+
*/
|
|
60
|
+
export default asBaseComponent(ListDeviceEmpty);
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* IMPORTS
|
|
5
|
+
*/
|
|
6
|
+
import React, { useMemo } from "react";
|
|
7
|
+
|
|
8
|
+
import { Text, TouchableOpacity, View } from "react-native";
|
|
9
|
+
|
|
10
|
+
// commons / svg
|
|
11
|
+
import { Icons } from "../../../../common/icons-svg";
|
|
12
|
+
|
|
13
|
+
// typings
|
|
14
|
+
import type { IData } from "../../interface";
|
|
15
|
+
|
|
16
|
+
// styles
|
|
17
|
+
import { theme } from "../../../../styles/theme/theme";
|
|
18
|
+
import { styles as makeStyles } from "../../styles";
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Componente DeviceRow para a exibição de um item da lista de dispositivos
|
|
22
|
+
*/
|
|
23
|
+
const DeviceRow = React.memo(function DeviceRow({
|
|
24
|
+
device,
|
|
25
|
+
isSelected,
|
|
26
|
+
isLast,
|
|
27
|
+
disabled,
|
|
28
|
+
onPress,
|
|
29
|
+
titleColor,
|
|
30
|
+
textColorDescription,
|
|
31
|
+
}: {
|
|
32
|
+
device: IData;
|
|
33
|
+
isSelected: boolean;
|
|
34
|
+
isLast: boolean;
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
onPress: (d: IData) => void;
|
|
37
|
+
titleColor?: string;
|
|
38
|
+
textColorDescription?: string;
|
|
39
|
+
}) {
|
|
40
|
+
// estilos base/memoizados (evite recriar objetos grandes)
|
|
41
|
+
const s = useMemo(
|
|
42
|
+
() =>
|
|
43
|
+
makeStyles({
|
|
44
|
+
titleColor,
|
|
45
|
+
textColorDescription,
|
|
46
|
+
disabled,
|
|
47
|
+
isSelected,
|
|
48
|
+
}),
|
|
49
|
+
[titleColor, textColorDescription, disabled, isSelected]
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<TouchableOpacity
|
|
54
|
+
activeOpacity={0.7}
|
|
55
|
+
testID="list-devices"
|
|
56
|
+
onPress={() => onPress(device)}
|
|
57
|
+
disabled={disabled}
|
|
58
|
+
accessibilityRole="button"
|
|
59
|
+
accessibilityState={{ selected: isSelected, disabled }}
|
|
60
|
+
accessibilityLabel={`Dispositivo ${device.nameDevice}`}
|
|
61
|
+
style={[
|
|
62
|
+
s.containerIndicator,
|
|
63
|
+
!isLast && s.separator,
|
|
64
|
+
isSelected && s.containerIndicatorSelected,
|
|
65
|
+
]}
|
|
66
|
+
>
|
|
67
|
+
<Icons
|
|
68
|
+
icon="BLUETOOTH"
|
|
69
|
+
size={26}
|
|
70
|
+
background={theme.colors.gray[600]}
|
|
71
|
+
color={theme.colors.gray[300]}
|
|
72
|
+
/>
|
|
73
|
+
<View style={s.containerMain}>
|
|
74
|
+
<Text style={[s.title, isSelected && s.titleSelected]}>{device.nameDevice}</Text>
|
|
75
|
+
{!!device.macDevice && (
|
|
76
|
+
<Text style={[s.titleDescription, isSelected && s.descSelected]}>{device.macDevice}</Text>
|
|
77
|
+
)}
|
|
78
|
+
</View>
|
|
79
|
+
</TouchableOpacity>
|
|
80
|
+
);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* EXPORTS
|
|
85
|
+
*/
|
|
86
|
+
export { DeviceRow };
|
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* IMPORTS
|
|
3
3
|
*/
|
|
4
|
-
import React, { forwardRef } from "react";
|
|
5
|
-
import {
|
|
4
|
+
import React, { forwardRef, useCallback } from "react";
|
|
5
|
+
import { FlatList, type ListRenderItem } from "react-native";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
// icons
|
|
11
|
-
import { Icons } from "../../common/icons-svg";
|
|
7
|
+
import { DeviceRow } from "./components/list-device-render-item";
|
|
8
|
+
import ListDeviceEmpty from "./components/list-device-empty";
|
|
12
9
|
|
|
13
10
|
// typings
|
|
14
11
|
import type { IListDevices, IData } from "./interface";
|
|
15
12
|
import { asBaseComponent } from "../../@types/as-base-component";
|
|
16
13
|
|
|
17
|
-
// styles
|
|
18
|
-
import { styles as makeStyles } from "./styles";
|
|
19
|
-
import { theme } from "../../styles/theme/theme";
|
|
20
|
-
|
|
21
14
|
/**
|
|
22
15
|
* Componente ListDevices para a interação da ui.
|
|
23
16
|
*/
|
|
@@ -28,7 +21,7 @@ const ListDevices = forwardRef<any, IListDevices>(
|
|
|
28
21
|
): React.ReactElement => {
|
|
29
22
|
const isControlled = selectedId !== undefined;
|
|
30
23
|
const [internalSelected, setInternalSelected] = React.useState<number | null>(
|
|
31
|
-
defaultSelectedId
|
|
24
|
+
defaultSelectedId ?? null
|
|
32
25
|
);
|
|
33
26
|
|
|
34
27
|
const currentSelected = isControlled ? (selectedId ?? null) : internalSelected;
|
|
@@ -39,57 +32,32 @@ const ListDevices = forwardRef<any, IListDevices>(
|
|
|
39
32
|
onSelect?.(device);
|
|
40
33
|
};
|
|
41
34
|
|
|
42
|
-
|
|
35
|
+
const renderItem: ListRenderItem<IData> = useCallback(
|
|
36
|
+
({ item: device, index }) => {
|
|
37
|
+
const isLast = index === data?.length! - 1;
|
|
38
|
+
const isSelected = currentSelected === device.id;
|
|
39
|
+
return (
|
|
40
|
+
<DeviceRow
|
|
41
|
+
device={device}
|
|
42
|
+
isSelected={isSelected}
|
|
43
|
+
isLast={isLast}
|
|
44
|
+
disabled={disabled}
|
|
45
|
+
onPress={handlePress}
|
|
46
|
+
titleColor={titleColor}
|
|
47
|
+
textColorDescription={textColorDescription}
|
|
48
|
+
/>
|
|
49
|
+
);
|
|
50
|
+
},
|
|
51
|
+
[currentSelected, disabled, handlePress, titleColor, textColorDescription]
|
|
52
|
+
);
|
|
43
53
|
|
|
44
54
|
return (
|
|
45
55
|
<FlatList
|
|
56
|
+
ref={ref}
|
|
46
57
|
data={data}
|
|
47
58
|
keyExtractor={({ id }) => String(id)}
|
|
48
|
-
renderItem={
|
|
49
|
-
|
|
50
|
-
const isSelected = currentSelected === device.id;
|
|
51
|
-
|
|
52
|
-
const s = makeStyles({
|
|
53
|
-
titleColor,
|
|
54
|
-
textColorDescription,
|
|
55
|
-
disabled,
|
|
56
|
-
isSelected,
|
|
57
|
-
});
|
|
58
|
-
return (
|
|
59
|
-
<TouchableOpacity
|
|
60
|
-
ref={ref}
|
|
61
|
-
activeOpacity={0.7}
|
|
62
|
-
testID="list-devices"
|
|
63
|
-
key={device.id}
|
|
64
|
-
onPress={() => handlePress(device)}
|
|
65
|
-
disabled={disabled}
|
|
66
|
-
accessibilityRole="button"
|
|
67
|
-
accessibilityState={{ selected: isSelected, disabled }}
|
|
68
|
-
accessibilityLabel={`Dispositivo ${device.nameDevice}`}
|
|
69
|
-
style={[
|
|
70
|
-
s.containerIndicator,
|
|
71
|
-
!isLast && s.separator,
|
|
72
|
-
isSelected && s.containerIndicatorSelected,
|
|
73
|
-
]}
|
|
74
|
-
>
|
|
75
|
-
<Icons
|
|
76
|
-
icon={"BLUETOOTH"}
|
|
77
|
-
size={26}
|
|
78
|
-
background={theme.colors.gray[600]}
|
|
79
|
-
color={theme.colors.gray[300]}
|
|
80
|
-
/>
|
|
81
|
-
|
|
82
|
-
<View style={s.containerMain}>
|
|
83
|
-
<Text style={[s.title, isSelected && s.titleSelected]}>{device.nameDevice}</Text>
|
|
84
|
-
{!!device.macDevice && (
|
|
85
|
-
<Text style={[s.titleDescription, isSelected && s.descSelected]}>
|
|
86
|
-
{device.macDevice}
|
|
87
|
-
</Text>
|
|
88
|
-
)}
|
|
89
|
-
</View>
|
|
90
|
-
</TouchableOpacity>
|
|
91
|
-
);
|
|
92
|
-
}}
|
|
59
|
+
renderItem={renderItem}
|
|
60
|
+
ListEmptyComponent={ListDeviceEmpty}
|
|
93
61
|
/>
|
|
94
62
|
);
|
|
95
63
|
}
|