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.
Files changed (48) hide show
  1. package/lib/commonjs/components/list-devices/components/list-device-empty/index.js +68 -0
  2. package/lib/commonjs/components/list-devices/components/list-device-empty/index.js.map +1 -0
  3. package/lib/commonjs/components/list-devices/components/list-device-render-item/index.js +77 -0
  4. package/lib/commonjs/components/list-devices/components/list-device-render-item/index.js.map +1 -0
  5. package/lib/commonjs/components/list-devices/index.js +22 -54
  6. package/lib/commonjs/components/list-devices/index.js.map +1 -1
  7. package/lib/commonjs/components/list-devices/interface.js +2 -0
  8. package/lib/commonjs/components/list-devices/interface.js.map +1 -0
  9. package/lib/commonjs/components/list-devices/styles.js +14 -3
  10. package/lib/commonjs/components/list-devices/styles.js.map +1 -1
  11. package/lib/module/components/list-devices/components/list-device-empty/index.js +63 -0
  12. package/lib/module/components/list-devices/components/list-device-empty/index.js.map +1 -0
  13. package/lib/module/components/list-devices/components/list-device-render-item/index.js +74 -0
  14. package/lib/module/components/list-devices/components/list-device-render-item/index.js.map +1 -0
  15. package/lib/module/components/list-devices/index.js +25 -57
  16. package/lib/module/components/list-devices/index.js.map +1 -1
  17. package/lib/module/components/list-devices/interface.js +2 -0
  18. package/lib/module/components/list-devices/interface.js.map +1 -0
  19. package/lib/module/components/list-devices/styles.js +14 -3
  20. package/lib/module/components/list-devices/styles.js.map +1 -1
  21. package/lib/typescript/commonjs/src/components/list-devices/components/list-device-empty/index.d.ts +10 -0
  22. package/lib/typescript/commonjs/src/components/list-devices/components/list-device-empty/index.d.ts.map +1 -0
  23. package/lib/typescript/commonjs/src/components/list-devices/components/list-device-render-item/index.d.ts +22 -0
  24. package/lib/typescript/commonjs/src/components/list-devices/components/list-device-render-item/index.d.ts.map +1 -0
  25. package/lib/typescript/commonjs/src/components/list-devices/index.d.ts.map +1 -1
  26. package/lib/typescript/commonjs/src/components/list-devices/interface.d.ts +29 -0
  27. package/lib/typescript/commonjs/src/components/list-devices/interface.d.ts.map +1 -0
  28. package/lib/typescript/commonjs/src/components/list-devices/styles.d.ts +5 -5
  29. package/lib/typescript/commonjs/src/components/list-devices/styles.d.ts.map +1 -1
  30. package/lib/typescript/module/src/components/list-devices/components/list-device-empty/index.d.ts +10 -0
  31. package/lib/typescript/module/src/components/list-devices/components/list-device-empty/index.d.ts.map +1 -0
  32. package/lib/typescript/module/src/components/list-devices/components/list-device-render-item/index.d.ts +22 -0
  33. package/lib/typescript/module/src/components/list-devices/components/list-device-render-item/index.d.ts.map +1 -0
  34. package/lib/typescript/module/src/components/list-devices/index.d.ts.map +1 -1
  35. package/lib/typescript/module/src/components/list-devices/interface.d.ts +29 -0
  36. package/lib/typescript/module/src/components/list-devices/interface.d.ts.map +1 -0
  37. package/lib/typescript/module/src/components/list-devices/styles.d.ts +5 -5
  38. package/lib/typescript/module/src/components/list-devices/styles.d.ts.map +1 -1
  39. package/package.json +1 -1
  40. package/src/components/list-devices/components/list-device-empty/index.tsx +60 -0
  41. package/src/components/list-devices/components/list-device-render-item/index.tsx +86 -0
  42. package/src/components/list-devices/index.tsx +26 -58
  43. package/src/components/list-devices/{interface.d.ts → interface.ts} +36 -36
  44. package/src/components/list-devices/styles.ts +73 -68
  45. package/lib/commonjs/components/list-devices/interface.d.js +0 -2
  46. package/lib/commonjs/components/list-devices/interface.d.js.map +0 -1
  47. package/lib/module/components/list-devices/interface.d.js +0 -2
  48. package/lib/module/components/list-devices/interface.d.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"names":["React","forwardRef","View","Text","TouchableOpacity","FlatList","Box","Icons","asBaseComponent","styles","makeStyles","theme","jsx","_jsx","jsxs","_jsxs","ListDevices","data","textColorDescription","titleColor","selectedId","onSelect","defaultSelectedId","disabled","ref","isControlled","undefined","internalSelected","setInternalSelected","useState","currentSelected","handlePress","device","id","length","keyExtractor","String","renderItem","item","index","isLast","isSelected","s","activeOpacity","testID","onPress","accessibilityRole","accessibilityState","selected","accessibilityLabel","nameDevice","style","containerIndicator","separator","containerIndicatorSelected","children","icon","size","background","colors","gray","color","containerMain","title","titleSelected","macDevice","titleDescription","descSelected","displayName"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/list-devices/index.tsx"],"mappings":"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","ignoreList":[]}
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,WAAW,QAAQ,OAAO;AACtD,SAASC,QAAQ,QAA6B,cAAc;AAE5D,SAASC,SAAS,QAAQ,+CAAsC;AAChE,OAAOC,eAAe,MAAM,yCAAgC;;AAE5D;;AAEA,SAASC,eAAe,QAAQ,mCAAgC;;AAEhE;AACA;AACA;AAFA,SAAAC,GAAA,IAAAC,IAAA;AAGA,MAAMC,WAAW,gBAAGR,UAAU,CAC5B,CACE;EAAES,IAAI;EAAEC,oBAAoB;EAAEC,UAAU;EAAEC,UAAU;EAAEC,QAAQ;EAAEC,iBAAiB;EAAEC;AAAS,CAAC,EAC7FC,GAAG,KACoB;EACvB,MAAMC,YAAY,GAAGL,UAAU,KAAKM,SAAS;EAC7C,MAAM,CAACC,gBAAgB,EAAEC,mBAAmB,CAAC,GAAGrB,KAAK,CAACsB,QAAQ,CAC5DP,iBAAiB,IAAI,IACvB,CAAC;EAED,MAAMQ,eAAe,GAAGL,YAAY,GAAIL,UAAU,IAAI,IAAI,GAAIO,gBAAgB;EAE9E,MAAMI,WAAW,GAAIC,MAAa,IAAK;IACrC,IAAIT,QAAQ,EAAE;IACd,IAAI,CAACE,YAAY,EAAEG,mBAAmB,CAACI,MAAM,CAACC,EAAE,CAAC;IACjDZ,QAAQ,GAAGW,MAAM,CAAC;EACpB,CAAC;EAED,MAAME,UAAiC,GAAGzB,WAAW,CACnD,CAAC;IAAE0B,IAAI,EAAEH,MAAM;IAAEI;EAAM,CAAC,KAAK;IAC3B,MAAMC,MAAM,GAAGD,KAAK,KAAKnB,IAAI,EAAEqB,MAAM,GAAI,CAAC;IAC1C,MAAMC,UAAU,GAAGT,eAAe,KAAKE,MAAM,CAACC,EAAE;IAChD,oBACElB,IAAA,CAACJ,SAAS;MACRqB,MAAM,EAAEA,MAAO;MACfO,UAAU,EAAEA,UAAW;MACvBF,MAAM,EAAEA,MAAO;MACfd,QAAQ,EAAEA,QAAS;MACnBiB,OAAO,EAAET,WAAY;MACrBZ,UAAU,EAAEA,UAAW;MACvBD,oBAAoB,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,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=interface.js.map
@@ -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.sm,
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: 18,
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","sm","fontWeight","marginLeft","margins","xs","titleSelected","neutral","titleDescription","textColorDescription","fontFamily","fonts","inter_light_300","descSelected","containerMain"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/list-devices/styles.ts"],"mappings":";;AAAA,SAASA,UAAU,QAAQ,cAAc;AAEzC,SAASC,KAAK,QAAQ,6BAA0B;AAIhD,MAAMC,MAAM,GAAGA,CAACC,KAAoC,GAAG,CAAC,CAAC,KACvDH,UAAU,CAACI,MAAM,CAAC;EAChBC,kBAAkB,EAAE;IAClBC,KAAK,EAAE,MAAM;IACbC,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE,YAAY;IAC5BC,UAAU,EAAE,QAAQ;IACpBC,SAAS,EAAE,CAAC;IACZC,eAAe,EAAE,CAAC;IAClBC,iBAAiB,EAAE,CAAC;IACpBC,OAAO,EAAEV,KAAK,CAACW,QAAQ,GAAG,GAAG,GAAG;EAClC,CAAC;EAEDC,0BAA0B,EAAE;IAC1BC,eAAe,EAAEf,KAAK,CAACgB,MAAM,CAACC,KAAK,CAAC,GAAG,CAAC;IACxCC,YAAY,EAAE;EAChB,CAAC;EAEDC,SAAS,EAAE;IACTC,iBAAiB,EAAE,CAAC;IACpBC,iBAAiB,EAAEnB,KAAK,CAACoB,UAAU,GAC/B,aAAa,GACbtB,KAAK,CAACgB,MAAM,CAACO,IAAI,CAAC,GAAG;EAC3B,CAAC;EAEDC,KAAK,EAAE;IACLC,KAAK,EAAEvB,KAAK,CAACwB,UAAU,IAAI1B,KAAK,CAACgB,MAAM,CAACW,KAAK,CAAC,EAAE,CAAC;IACjDC,SAAS,EAAE,QAAQ;IACnBC,UAAU,EAAE,EAAE;IACdC,QAAQ,EAAE9B,KAAK,CAAC+B,SAAS,CAACC,EAAE;IAC5BC,UAAU,EAAE,KAAK;IACjBC,UAAU,EAAElC,KAAK,CAACmC,OAAO,CAACC;EAC5B,CAAC;EAEDC,aAAa,EAAE;IACbZ,KAAK,EAAEzB,KAAK,CAACgB,MAAM,CAACsB,OAAO,CAAC,EAAE,CAAC;IAC/BL,UAAU,EAAE;EACd,CAAC;EAEDM,gBAAgB,EAAE;IAChBd,KAAK,EAAEvB,KAAK,CAACsC,oBAAoB,IAAIxC,KAAK,CAACgB,MAAM,CAACO,IAAI,CAAC,GAAG,CAAC;IAC3DK,SAAS,EAAE,QAAQ;IACnBC,UAAU,EAAE,EAAE;IACdC,QAAQ,EAAE,EAAE;IACZW,UAAU,EAAEzC,KAAK,CAAC0C,KAAK,CAACC,eAAe;IACvCT,UAAU,EAAElC,KAAK,CAACmC,OAAO,CAACC;EAC5B,CAAC;EAEDQ,YAAY,EAAE;IACZnB,KAAK,EAAEzB,KAAK,CAACgB,MAAM,CAACsB,OAAO,CAAC,EAAE;EAChC,CAAC;EAEDO,aAAa,EAAE;IACbxC,KAAK,EAAE,MAAM;IACbC,aAAa,EAAE,QAAQ;IACvBE,UAAU,EAAE,YAAY;IACxB0B,UAAU,EAAE,CAAC;IACb3B,cAAc,EAAE;EAClB;AACF,CAAC,CAAC;AAEJ,SAASN,MAAM","ignoreList":[]}
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,6BAA0B;;AAEhD;;AAGA,MAAMC,MAAM,GAAGA,CAACC,KAAoC,GAAG,CAAC,CAAC,KACvDH,UAAU,CAACI,MAAM,CAAC;EAChBC,kBAAkB,EAAE;IAClBC,KAAK,EAAE,MAAM;IACbC,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE,YAAY;IAC5BC,UAAU,EAAE,QAAQ;IACpBC,SAAS,EAAE,CAAC;IACZC,eAAe,EAAE,CAAC;IAClBC,iBAAiB,EAAE,CAAC;IACpBC,OAAO,EAAEV,KAAK,CAACW,QAAQ,GAAG,GAAG,GAAG;EAClC,CAAC;EAEDC,0BAA0B,EAAE;IAC1BC,eAAe,EAAEf,KAAK,CAACgB,MAAM,CAACC,KAAK,CAAC,GAAG,CAAC;IACxCC,YAAY,EAAE;EAChB,CAAC;EAEDC,SAAS,EAAE;IACTC,iBAAiB,EAAE,CAAC;IACpBC,iBAAiB,EAAEnB,KAAK,CAACoB,UAAU,GAAG,aAAa,GAAGtB,KAAK,CAACgB,MAAM,CAACO,IAAI,CAAC,GAAG;EAC7E,CAAC;EAEDC,KAAK,EAAE;IACLC,KAAK,EAAEvB,KAAK,CAACwB,UAAU,IAAI1B,KAAK,CAACgB,MAAM,CAACW,KAAK,CAAC,EAAE,CAAC;IACjDC,SAAS,EAAE,QAAQ;IACnBC,UAAU,EAAE,EAAE;IACdC,QAAQ,EAAE9B,KAAK,CAAC+B,SAAS,CAACC,EAAE;IAC5BC,UAAU,EAAE,KAAK;IACjBC,UAAU,EAAElC,KAAK,CAACmC,OAAO,CAACC,EAAE;IAC5BC,YAAY,EAAE;EAChB,CAAC;EAEDC,aAAa,EAAE;IACbb,KAAK,EAAEzB,KAAK,CAACgB,MAAM,CAACuB,OAAO,CAAC,EAAE,CAAC;IAC/BN,UAAU,EAAE;EACd,CAAC;EAEDO,gBAAgB,EAAE;IAChBf,KAAK,EAAEvB,KAAK,CAACuC,oBAAoB,IAAIzC,KAAK,CAACgB,MAAM,CAACO,IAAI,CAAC,GAAG,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":[]}
@@ -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,KAAqB,MAAM,OAAO,CAAC;AAU1C,OAAO,KAAK,EAAE,YAAY,EAAS,MAAM,aAAa,CAAC;AAsFvD;;GAEG;;AACH,wBAA4C"}
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":"AACA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,KAAK,KAAK,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE1D,QAAA,MAAM,MAAM,WAAW,OAAO,CAAC,YAAY,GAAG,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2DhD,CAAC;AAEL,OAAO,EAAE,MAAM,EAAE,CAAC"}
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"}
@@ -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,KAAqB,MAAM,OAAO,CAAC;AAU1C,OAAO,KAAK,EAAE,YAAY,EAAS,MAAM,aAAa,CAAC;AAsFvD;;GAEG;;AACH,wBAA4C"}
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":"AACA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,KAAK,KAAK,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE1D,QAAA,MAAM,MAAM,WAAW,OAAO,CAAC,YAAY,GAAG,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2DhD,CAAC;AAEL,OAAO,EAAE,MAAM,EAAE,CAAC"}
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jornada-ui",
3
- "version": "0.4.13",
3
+ "version": "0.4.14",
4
4
  "description": "Biblioteca para desenvolvimento dos componentes para utilizar nos app",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",
@@ -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 { View, Text, TouchableOpacity, FlatList } from "react-native";
4
+ import React, { forwardRef, useCallback } from "react";
5
+ import { FlatList, type ListRenderItem } from "react-native";
6
6
 
7
- // components
8
- import Box from "../box";
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
- if (!data?.length) return <Box />;
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={({ item: device, index }) => {
49
- const isLast = index === data.length - 1;
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
  }