@draftbit/core 43.4.5-312b1d.1 → 43.4.5-4e19aa.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.
Files changed (97) hide show
  1. package/lib/commonjs/components/Elevation.js +14 -3
  2. package/lib/commonjs/components/Elevation.js.map +1 -1
  3. package/lib/commonjs/components/FieldSearchBarFull.js.map +1 -1
  4. package/lib/commonjs/components/RadioButton/RadioButton.js +6 -9
  5. package/lib/commonjs/components/RadioButton/RadioButton.js.map +1 -1
  6. package/lib/commonjs/components/RadioButton/RadioButtonGroup.js +8 -18
  7. package/lib/commonjs/components/RadioButton/RadioButtonGroup.js.map +1 -1
  8. package/lib/commonjs/components/RadioButton/RadioButtonRow.js +9 -14
  9. package/lib/commonjs/components/RadioButton/RadioButtonRow.js.map +1 -1
  10. package/lib/commonjs/components/Table/index.js +56 -0
  11. package/lib/commonjs/components/Table/index.js.map +1 -0
  12. package/lib/commonjs/components/Table/table.js +36 -0
  13. package/lib/commonjs/components/Table/table.js.map +1 -0
  14. package/lib/commonjs/components/Table/tableCell.js +44 -0
  15. package/lib/commonjs/components/Table/tableCell.js.map +1 -0
  16. package/lib/commonjs/components/Table/tableHeader.js +42 -0
  17. package/lib/commonjs/components/Table/tableHeader.js.map +1 -0
  18. package/lib/commonjs/components/Table/tablePaginator.js +18 -0
  19. package/lib/commonjs/components/Table/tablePaginator.js.map +1 -0
  20. package/lib/commonjs/components/Table/tableRow.js +48 -0
  21. package/lib/commonjs/components/Table/tableRow.js.map +1 -0
  22. package/lib/commonjs/components/Table/tableTitle.js +61 -0
  23. package/lib/commonjs/components/Table/tableTitle.js.map +1 -0
  24. package/lib/commonjs/index.js +38 -0
  25. package/lib/commonjs/index.js.map +1 -1
  26. package/lib/commonjs/mappings/Table.js +99 -0
  27. package/lib/commonjs/mappings/Table.js.map +1 -0
  28. package/lib/commonjs/utilities.js +7 -16
  29. package/lib/commonjs/utilities.js.map +1 -1
  30. package/lib/module/components/DatePicker/DatePickerComponentType.js.map +1 -1
  31. package/lib/module/components/RadioButton/RadioButton.js +6 -8
  32. package/lib/module/components/RadioButton/RadioButton.js.map +1 -1
  33. package/lib/module/components/RadioButton/RadioButtonGroup.js +8 -17
  34. package/lib/module/components/RadioButton/RadioButtonGroup.js.map +1 -1
  35. package/lib/module/components/RadioButton/RadioButtonRow.js +10 -15
  36. package/lib/module/components/RadioButton/RadioButtonRow.js.map +1 -1
  37. package/lib/module/components/ResizeMode.js +2 -2
  38. package/lib/module/components/ResizeMode.js.map +1 -1
  39. package/lib/module/components/Table/index.js +7 -0
  40. package/lib/module/components/Table/index.js.map +1 -0
  41. package/lib/module/components/Table/table.js +24 -0
  42. package/lib/module/components/Table/table.js.map +1 -0
  43. package/lib/module/components/Table/tableCell.js +32 -0
  44. package/lib/module/components/Table/tableCell.js.map +1 -0
  45. package/lib/module/components/Table/tableHeader.js +28 -0
  46. package/lib/module/components/Table/tableHeader.js.map +1 -0
  47. package/lib/module/components/Table/tablePaginator.js +7 -0
  48. package/lib/module/components/Table/tablePaginator.js.map +1 -0
  49. package/lib/module/components/Table/tableRow.js +34 -0
  50. package/lib/module/components/Table/tableRow.js.map +1 -0
  51. package/lib/module/components/Table/tableTitle.js +48 -0
  52. package/lib/module/components/Table/tableTitle.js.map +1 -0
  53. package/lib/module/index.js +1 -0
  54. package/lib/module/index.js.map +1 -1
  55. package/lib/module/mappings/BlurView.js.map +1 -1
  56. package/lib/module/mappings/Table.js +90 -0
  57. package/lib/module/mappings/Table.js.map +1 -0
  58. package/lib/module/utilities.js +4 -14
  59. package/lib/module/utilities.js.map +1 -1
  60. package/lib/typescript/src/components/RadioButton/RadioButton.d.ts +2 -2
  61. package/lib/typescript/src/components/RadioButton/RadioButtonGroup.d.ts +1 -1
  62. package/lib/typescript/src/components/RadioButton/RadioButtonRow.d.ts +1 -1
  63. package/lib/typescript/src/components/Table/index.d.ts +6 -0
  64. package/lib/typescript/src/components/Table/table.d.ts +8 -0
  65. package/lib/typescript/src/components/Table/tableCell.d.ts +10 -0
  66. package/lib/typescript/src/components/Table/tableHeader.d.ts +12 -0
  67. package/lib/typescript/src/components/Table/tablePaginator.d.ts +3 -0
  68. package/lib/typescript/src/components/Table/tableRow.d.ts +12 -0
  69. package/lib/typescript/src/components/Table/tableTitle.d.ts +12 -0
  70. package/lib/typescript/src/index.d.ts +1 -0
  71. package/lib/typescript/src/utilities.d.ts +4 -4
  72. package/package.json +2 -2
  73. package/src/components/RadioButton/RadioButton.js +5 -9
  74. package/src/components/RadioButton/RadioButton.tsx +10 -13
  75. package/src/components/RadioButton/RadioButtonGroup.js +8 -14
  76. package/src/components/RadioButton/RadioButtonGroup.tsx +12 -21
  77. package/src/components/RadioButton/RadioButtonRow.js +9 -15
  78. package/src/components/RadioButton/RadioButtonRow.tsx +13 -19
  79. package/src/components/Table/index.js +6 -0
  80. package/src/components/Table/index.tsx +6 -0
  81. package/src/components/Table/table.js +10 -0
  82. package/src/components/Table/table.tsx +22 -0
  83. package/src/components/Table/tableCell.js +17 -0
  84. package/src/components/Table/tableCell.tsx +37 -0
  85. package/src/components/Table/tableHeader.js +11 -0
  86. package/src/components/Table/tableHeader.tsx +28 -0
  87. package/src/components/Table/tablePaginator.js +5 -0
  88. package/src/components/Table/tablePaginator.tsx +10 -0
  89. package/src/components/Table/tableRow.js +16 -0
  90. package/src/components/Table/tableRow.tsx +31 -0
  91. package/src/components/Table/tableTitle.js +28 -0
  92. package/src/components/Table/tableTitle.tsx +59 -0
  93. package/src/index.js +1 -0
  94. package/src/index.tsx +9 -0
  95. package/src/mappings/Table.js +102 -0
  96. package/src/utilities.js +6 -16
  97. package/src/utilities.ts +6 -14
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _reactNative = require("react-native");
11
+
12
+ var _utilities = require("../../utilities");
13
+
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+
16
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
17
+
18
+ const TableTitle = _ref => {
19
+ let {
20
+ children,
21
+ style,
22
+ numeric = false,
23
+ isAscending = false,
24
+ numberOfLines = 1,
25
+ title,
26
+ ...rest
27
+ } = _ref;
28
+ const {
29
+ textStyles,
30
+ viewStyles
31
+ } = (0, _utilities.extractStyles)(style);
32
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({}, rest, {
33
+ style: [styles.wrapper, numeric && styles.right, viewStyles]
34
+ }), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
35
+ style: [isAscending ? styles.sorted : {
36
+ color: "gray"
37
+ }, textStyles],
38
+ numberOfLines: numberOfLines
39
+ }, children, title));
40
+ };
41
+
42
+ const styles = _reactNative.StyleSheet.create({
43
+ wrapper: {
44
+ flex: 1,
45
+ display: "flex",
46
+ flexDirection: "row"
47
+ },
48
+ right: {
49
+ justifyContent: "flex-end"
50
+ },
51
+ sorted: {// marginLeft: 8,
52
+ },
53
+ icon: {
54
+ height: 24,
55
+ justifyContent: "center"
56
+ }
57
+ });
58
+
59
+ var _default = TableTitle;
60
+ exports.default = _default;
61
+ //# sourceMappingURL=tableTitle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["tableTitle.tsx"],"names":["TableTitle","children","style","numeric","isAscending","numberOfLines","title","rest","textStyles","viewStyles","styles","wrapper","right","sorted","color","StyleSheet","create","flex","display","flexDirection","justifyContent","icon","height"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;AAWA,MAAMA,UAAU,GAAG,QAQG;AAAA,MARF;AAClBC,IAAAA,QADkB;AAElBC,IAAAA,KAFkB;AAGlBC,IAAAA,OAAO,GAAG,KAHQ;AAIlBC,IAAAA,WAAW,GAAG,KAJI;AAKlBC,IAAAA,aAAa,GAAG,CALE;AAMlBC,IAAAA,KANkB;AAOlB,OAAGC;AAPe,GAQE;AACpB,QAAM;AAAEC,IAAAA,UAAF;AAAcC,IAAAA;AAAd,MAA6B,8BAAcP,KAAd,CAAnC;AAEA,sBACE,6BAAC,iBAAD,eACMK,IADN;AAEE,IAAA,KAAK,EAAE,CAACG,MAAM,CAACC,OAAR,EAAiBR,OAAO,IAAIO,MAAM,CAACE,KAAnC,EAA0CH,UAA1C;AAFT,mBAIE,6BAAC,iBAAD;AACE,IAAA,KAAK,EAAE,CAACL,WAAW,GAAGM,MAAM,CAACG,MAAV,GAAmB;AAAEC,MAAAA,KAAK,EAAE;AAAT,KAA/B,EAAkDN,UAAlD,CADT;AAEE,IAAA,aAAa,EAAEH;AAFjB,KAIGJ,QAJH,EAKGK,KALH,CAJF,CADF;AAcD,CAzBD;;AA2BA,MAAMI,MAAM,GAAGK,wBAAWC,MAAX,CAAkB;AAC/BL,EAAAA,OAAO,EAAE;AACPM,IAAAA,IAAI,EAAE,CADC;AAEPC,IAAAA,OAAO,EAAE,MAFF;AAGPC,IAAAA,aAAa,EAAE;AAHR,GADsB;AAM/BP,EAAAA,KAAK,EAAE;AACLQ,IAAAA,cAAc,EAAE;AADX,GANwB;AAS/BP,EAAAA,MAAM,EAAE,CACN;AADM,GATuB;AAY/BQ,EAAAA,IAAI,EAAE;AACJC,IAAAA,MAAM,EAAE,EADJ;AAEJF,IAAAA,cAAc,EAAE;AAFZ;AAZyB,CAAlB,CAAf;;eAkBepB,U","sourcesContent":["import React from \"react\";\nimport { View, Text, StyleProp, ViewStyle, StyleSheet } from \"react-native\";\nimport { extractStyles } from \"../../utilities\";\n\nexport interface TableCellProps {\n children: React.ReactNode;\n numeric?: boolean;\n isAscending: boolean;\n numberOfLines?: number;\n title?: string;\n style?: StyleProp<ViewStyle>;\n}\n\nconst TableTitle = ({\n children,\n style,\n numeric = false,\n isAscending = false,\n numberOfLines = 1,\n title,\n ...rest\n}: TableCellProps) => {\n const { textStyles, viewStyles } = extractStyles(style);\n\n return (\n <View\n {...rest}\n style={[styles.wrapper, numeric && styles.right, viewStyles]}\n >\n <Text\n style={[isAscending ? styles.sorted : { color: \"gray\" }, textStyles]}\n numberOfLines={numberOfLines}\n >\n {children}\n {title}\n </Text>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n wrapper: {\n flex: 1,\n display: \"flex\",\n flexDirection: \"row\",\n },\n right: {\n justifyContent: \"flex-end\",\n },\n sorted: {\n // marginLeft: 8,\n },\n icon: {\n height: 24,\n justifyContent: \"center\",\n },\n});\n\nexport default TableTitle;\n"]}
@@ -357,6 +357,42 @@ Object.defineProperty(exports, "SwitchRow", {
357
357
  return _Switch.SwitchRow;
358
358
  }
359
359
  });
360
+ Object.defineProperty(exports, "Table", {
361
+ enumerable: true,
362
+ get: function () {
363
+ return _Table.Table;
364
+ }
365
+ });
366
+ Object.defineProperty(exports, "TableCell", {
367
+ enumerable: true,
368
+ get: function () {
369
+ return _Table.TableCell;
370
+ }
371
+ });
372
+ Object.defineProperty(exports, "TableHeader", {
373
+ enumerable: true,
374
+ get: function () {
375
+ return _Table.TableHeader;
376
+ }
377
+ });
378
+ Object.defineProperty(exports, "TablePaginator", {
379
+ enumerable: true,
380
+ get: function () {
381
+ return _Table.TablePaginator;
382
+ }
383
+ });
384
+ Object.defineProperty(exports, "TableRow", {
385
+ enumerable: true,
386
+ get: function () {
387
+ return _Table.TableRow;
388
+ }
389
+ });
390
+ Object.defineProperty(exports, "TableTitle", {
391
+ enumerable: true,
392
+ get: function () {
393
+ return _Table.TableTitle;
394
+ }
395
+ });
360
396
  Object.defineProperty(exports, "TextField", {
361
397
  enumerable: true,
362
398
  get: function () {
@@ -460,6 +496,8 @@ var _Layout = require("./components/Layout");
460
496
 
461
497
  var _index = require("./components/RadioButton/index");
462
498
 
499
+ var _Table = require("./components/Table");
500
+
463
501
  var _DeprecatedButton = _interopRequireDefault(require("./components/DeprecatedButton"));
464
502
 
465
503
  var _CardBlock = _interopRequireDefault(require("./components/CardBlock"));
@@ -1 +1 @@
1
- {"version":3,"sources":["index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAEA;;AASA;;AAQA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA","sourcesContent":["export { injectIcon } from \"./interfaces/Icon\";\nexport { withTheme, ThemeProvider } from \"./theming\";\nexport { default as Provider } from \"./Provider\";\nexport { default as DefaultTheme } from \"./styles/DefaultTheme\";\n\nexport { Link } from \"./components/Text\";\nexport { ButtonSolid, ButtonOutline } from \"./components/Button\";\nexport { default as Avatar } from \"./components/CircleImage\";\nexport { default as AvatarEdit } from \"./components/AvatarEdit\";\nexport { default as Card } from \"./components/Card\";\nexport { default as Carousel } from \"./components/Carousel\";\nexport { Checkbox, CheckboxGroup, CheckboxRow } from \"./components/Checkbox\";\nexport { default as CircleImage } from \"./components/CircleImage\";\nexport { default as Container } from \"./components/Container\";\nexport { default as Divider } from \"./components/Divider\";\nexport { default as FAB } from \"./components/FAB\";\nexport { default as FieldSearchBarFull } from \"./components/FieldSearchBarFull\";\nexport { default as IconButton } from \"./components/IconButton\";\nexport { default as Image } from \"./components/Image\";\nexport { default as NumberInput } from \"./components/NumberInput\";\nexport { default as ScreenContainer } from \"./components/ScreenContainer\";\nexport { default as StarRating } from \"./components/StarRating\";\nexport { default as Surface } from \"./components/Surface\";\nexport { default as Switch, SwitchRow } from \"./components/Switch\";\nexport { default as TextField } from \"./components/TextField\";\nexport { default as ToggleButton } from \"./components/ToggleButton\";\nexport { default as Touchable } from \"./components/Touchable\";\nexport { AccordionGroup, AccordionItem } from \"./components/Accordion\";\nexport {\n ActionSheet,\n ActionSheetItem,\n ActionSheetCancel,\n} from \"./components/ActionSheet\";\nexport { Swiper, SwiperItem } from \"./components/Swiper\";\n\nexport {\n Center,\n Circle,\n Square,\n Row,\n Stack,\n Spacer,\n} from \"./components/Layout\";\n\nexport {\n RadioButton,\n RadioButtonGroup,\n RadioButtonRow,\n RadioButtonFieldGroup,\n} from \"./components/RadioButton/index\";\n\n/* Deprecated: Fix or Delete! */\nexport { default as Button } from \"./components/DeprecatedButton\";\nexport { default as CardBlock } from \"./components/CardBlock\";\nexport { default as CardContainer } from \"./components/CardContainer\";\nexport { default as CardContainerRating } from \"./components/CardContainerRating\";\nexport { default as CardInline } from \"./components/CardInline\";\nexport { default as DatePicker } from \"./components/DatePicker/DatePicker\";\nexport { default as HeaderLarge } from \"./components/HeaderLarge\";\nexport { default as HeaderMedium } from \"./components/HeaderMedium\";\nexport { default as HeaderOverline } from \"./components/HeaderOverline\";\nexport { default as Picker } from \"./components/Picker/Picker\";\nexport { default as ProgressBar } from \"./components/ProgressBar\";\nexport { default as ProgressCircle } from \"./components/ProgressCircle\";\nexport { default as RowBodyIcon } from \"./components/RowBodyIcon\";\nexport { default as RowHeadlineImageCaption } from \"./components/RowHeadlineImageCaption\";\nexport { default as RowHeadlineImageIcon } from \"./components/RowHeadlineImageIcon\";\nexport { default as Slider } from \"./components/Slider\";\nexport { default as Stepper } from \"./components/Stepper\";\nexport { useAuthState } from \"./components/useAuthState\";\n"]}
1
+ {"version":3,"sources":["index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAEA;;AASA;;AAOA;;AAUA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA","sourcesContent":["export { injectIcon } from \"./interfaces/Icon\";\nexport { withTheme, ThemeProvider } from \"./theming\";\nexport { default as Provider } from \"./Provider\";\nexport { default as DefaultTheme } from \"./styles/DefaultTheme\";\n\nexport { Link } from \"./components/Text\";\nexport { ButtonSolid, ButtonOutline } from \"./components/Button\";\nexport { default as Avatar } from \"./components/CircleImage\";\nexport { default as AvatarEdit } from \"./components/AvatarEdit\";\nexport { default as Card } from \"./components/Card\";\nexport { default as Carousel } from \"./components/Carousel\";\nexport { Checkbox, CheckboxGroup, CheckboxRow } from \"./components/Checkbox\";\nexport { default as CircleImage } from \"./components/CircleImage\";\nexport { default as Container } from \"./components/Container\";\nexport { default as Divider } from \"./components/Divider\";\nexport { default as FAB } from \"./components/FAB\";\nexport { default as FieldSearchBarFull } from \"./components/FieldSearchBarFull\";\nexport { default as IconButton } from \"./components/IconButton\";\nexport { default as Image } from \"./components/Image\";\nexport { default as NumberInput } from \"./components/NumberInput\";\nexport { default as ScreenContainer } from \"./components/ScreenContainer\";\nexport { default as StarRating } from \"./components/StarRating\";\nexport { default as Surface } from \"./components/Surface\";\nexport { default as Switch, SwitchRow } from \"./components/Switch\";\nexport { default as TextField } from \"./components/TextField\";\nexport { default as ToggleButton } from \"./components/ToggleButton\";\nexport { default as Touchable } from \"./components/Touchable\";\nexport { AccordionGroup, AccordionItem } from \"./components/Accordion\";\nexport {\n ActionSheet,\n ActionSheetItem,\n ActionSheetCancel,\n} from \"./components/ActionSheet\";\nexport { Swiper, SwiperItem } from \"./components/Swiper\";\n\nexport {\n Center,\n Circle,\n Square,\n Row,\n Stack,\n Spacer,\n} from \"./components/Layout\";\n\nexport {\n RadioButton,\n RadioButtonGroup,\n RadioButtonRow,\n RadioButtonFieldGroup,\n} from \"./components/RadioButton/index\";\n\nexport {\n Table,\n TableRow,\n TablePaginator,\n TableHeader,\n TableCell,\n TableTitle,\n} from \"./components/Table\";\n\n/* Deprecated: Fix or Delete! */\nexport { default as Button } from \"./components/DeprecatedButton\";\nexport { default as CardBlock } from \"./components/CardBlock\";\nexport { default as CardContainer } from \"./components/CardContainer\";\nexport { default as CardContainerRating } from \"./components/CardContainerRating\";\nexport { default as CardInline } from \"./components/CardInline\";\nexport { default as DatePicker } from \"./components/DatePicker/DatePicker\";\nexport { default as HeaderLarge } from \"./components/HeaderLarge\";\nexport { default as HeaderMedium } from \"./components/HeaderMedium\";\nexport { default as HeaderOverline } from \"./components/HeaderOverline\";\nexport { default as Picker } from \"./components/Picker/Picker\";\nexport { default as ProgressBar } from \"./components/ProgressBar\";\nexport { default as ProgressCircle } from \"./components/ProgressCircle\";\nexport { default as RowBodyIcon } from \"./components/RowBodyIcon\";\nexport { default as RowHeadlineImageCaption } from \"./components/RowHeadlineImageCaption\";\nexport { default as RowHeadlineImageIcon } from \"./components/RowHeadlineImageIcon\";\nexport { default as Slider } from \"./components/Slider\";\nexport { default as Stepper } from \"./components/Stepper\";\nexport { useAuthState } from \"./components/useAuthState\";\n"]}
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SEED_DATA = void 0;
7
+
8
+ var _types = require("@draftbit/types");
9
+
10
+ const SEED_DATA = [{
11
+ name: "Table",
12
+ tag: "Table",
13
+ category: _types.COMPONENT_TYPES.container,
14
+ layout: {
15
+ width: "100%"
16
+ },
17
+ props: {}
18
+ }, {
19
+ name: "Table Row",
20
+ tag: "TableRow",
21
+ category: _types.COMPONENT_TYPES.container,
22
+ layout: {
23
+ paddingLeft: 16,
24
+ paddingRight: 16,
25
+ borderBottomWidth: 1,
26
+ borderStyle: "solid"
27
+ },
28
+ props: {}
29
+ }, {
30
+ name: "Table Cell",
31
+ tag: "TableCell",
32
+ category: _types.COMPONENT_TYPES.container,
33
+ layout: {
34
+ paddingTop: 16,
35
+ paddingBottom: 16,
36
+ paddingLeft: 8,
37
+ paddingRight: 8
38
+ },
39
+ props: {
40
+ numeric: (0, _types.createBoolProp)({
41
+ label: "Is Numeric Cell?",
42
+ description: "Does the cell contain a numeric value?",
43
+ group: _types.GROUPS.data
44
+ }),
45
+ value: (0, _types.createTextProp)({
46
+ label: "Cell Value",
47
+ description: "Table Cell Value",
48
+ group: _types.GROUPS.data
49
+ })
50
+ }
51
+ }, {
52
+ name: "Table Header",
53
+ tag: "TableHeader",
54
+ category: _types.COMPONENT_TYPES.container,
55
+ layout: {
56
+ paddingLeft: 16,
57
+ paddingRight: 16,
58
+ borderBottomWidth: 1,
59
+ borderStyle: "solid",
60
+ backgroundColor: "#EFEFEF"
61
+ },
62
+ props: {}
63
+ }, {
64
+ name: "Table Title",
65
+ tag: "TableTitle",
66
+ category: _types.COMPONENT_TYPES.container,
67
+ layout: {
68
+ fontSize: 14,
69
+ fontWeight: "500",
70
+ paddingTop: 16,
71
+ paddingBottom: 16,
72
+ paddingLeft: 8,
73
+ paddingRight: 8
74
+ },
75
+ props: {
76
+ numeric: (0, _types.createBoolProp)({
77
+ label: "Is Numeric Cell?",
78
+ description: "Does the cell contain a numeric value?",
79
+ group: _types.GROUPS.data
80
+ }),
81
+ value: (0, _types.createTextProp)({
82
+ label: "Cell Value",
83
+ description: "Table Cell Value",
84
+ group: _types.GROUPS.data
85
+ }),
86
+ isAscending: (0, _types.createBoolProp)({
87
+ label: "Is Ascending?",
88
+ description: "Does the cell contain a numeric value?",
89
+ group: _types.GROUPS.data
90
+ }),
91
+ numberOfLines: (0, _types.createNumberProp)({
92
+ label: "Number of Lines",
93
+ description: "Number of Lines",
94
+ group: _types.GROUPS.basic
95
+ })
96
+ }
97
+ }];
98
+ exports.SEED_DATA = SEED_DATA;
99
+ //# sourceMappingURL=Table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["Table.js"],"names":["SEED_DATA","name","tag","category","COMPONENT_TYPES","container","layout","width","props","paddingLeft","paddingRight","borderBottomWidth","borderStyle","paddingTop","paddingBottom","numeric","label","description","group","GROUPS","data","value","backgroundColor","fontSize","fontWeight","isAscending","numberOfLines","basic"],"mappings":";;;;;;;AAAA;;AAQO,MAAMA,SAAS,GAAG,CACvB;AACEC,EAAAA,IAAI,EAAE,OADR;AAEEC,EAAAA,GAAG,EAAE,OAFP;AAGEC,EAAAA,QAAQ,EAAEC,uBAAgBC,SA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\n createTextProp,\n createNumberProp,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = [\n {\n name: \"Table\",\n tag: \"Table\",\n category: COMPONENT_TYPES.container,\n layout: {\n width: \"100%\",\n },\n props: {},\n },\n {\n name: \"Table Row\",\n tag: \"TableRow\",\n category: COMPONENT_TYPES.container,\n layout: {\n paddingLeft: 16,\n paddingRight: 16,\n borderBottomWidth: 1,\n borderStyle: \"solid\",\n },\n props: {},\n },\n {\n name: \"Table Cell\",\n tag: \"TableCell\",\n category: COMPONENT_TYPES.container,\n layout: {\n paddingTop: 16,\n paddingBottom: 16,\n paddingLeft: 8,\n paddingRight: 8,\n },\n props: {\n numeric: createBoolProp({\n label: \"Is Numeric Cell?\",\n description: \"Does the cell contain a numeric value?\",\n group: GROUPS.data,\n }),\n value: createTextProp({\n label: \"Cell Value\",\n description: \"Table Cell Value\",\n group: GROUPS.data,\n }),\n },\n },\n {\n name: \"Table Header\",\n tag: \"TableHeader\",\n category: COMPONENT_TYPES.container,\n layout: {\n paddingLeft: 16,\n paddingRight: 16,\n borderBottomWidth: 1,\n borderStyle: \"solid\",\n backgroundColor: \"#EFEFEF\",\n },\n props: {},\n },\n {\n name: \"Table Title\",\n tag: \"TableTitle\",\n category: COMPONENT_TYPES.container,\n layout: {\n fontSize: 14,\n fontWeight: \"500\",\n paddingTop: 16,\n paddingBottom: 16,\n paddingLeft: 8,\n paddingRight: 8,\n },\n props: {\n numeric: createBoolProp({\n label: \"Is Numeric Cell?\",\n description: \"Does the cell contain a numeric value?\",\n group: GROUPS.data,\n }),\n value: createTextProp({\n label: \"Cell Value\",\n description: \"Table Cell Value\",\n group: GROUPS.data,\n }),\n isAscending: createBoolProp({\n label: \"Is Ascending?\",\n description: \"Does the cell contain a numeric value?\",\n group: GROUPS.data,\n }),\n numberOfLines: createNumberProp({\n label: \"Number of Lines\",\n description: \"Number of Lines\",\n group: GROUPS.basic,\n }),\n },\n },\n];\n"]}
@@ -5,11 +5,14 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.applyStyles = applyStyles;
7
7
  exports.extractStyles = extractStyles;
8
- exports.getValueForRadioButton = getValueForRadioButton;
9
8
 
10
9
  var _reactNative = require("react-native");
11
10
 
12
- var _lodash = require("lodash");
11
+ var _omitBy = _interopRequireDefault(require("lodash/omitBy"));
12
+
13
+ var _isNil = _interopRequireDefault(require("lodash/isNil"));
14
+
15
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
16
 
14
17
  function extractStyles(style) {
15
18
  const {
@@ -41,8 +44,8 @@ function extractStyles(style) {
41
44
  textDecorationStyle
42
45
  };
43
46
  return {
44
- viewStyles,
45
- textStyles
47
+ viewStyles: (0, _omitBy.default)(viewStyles, _isNil.default),
48
+ textStyles: (0, _omitBy.default)(textStyles, _isNil.default)
46
49
  };
47
50
  }
48
51
  /**
@@ -74,16 +77,4 @@ function applyStyles(baseStyles, stylesToApply) {
74
77
 
75
78
  return flattenedStyles;
76
79
  }
77
-
78
- function getValueForRadioButton(value) {
79
- if ((0, _lodash.isString)(value)) {
80
- return value;
81
- } else if ((0, _lodash.isNumber)(value)) {
82
- return String(value);
83
- } else if (value === undefined) {
84
- return undefined;
85
- } else {
86
- throw new Error(`Invalid value: ${value}`);
87
- }
88
- }
89
80
  //# sourceMappingURL=utilities.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["utilities.ts"],"names":["extractStyles","style","color","fontFamily","fontWeight","fontSize","lineHeight","letterSpacing","textTransform","textAlign","textDecorationLine","textDecorationColor","textDecorationStyle","viewStyles","StyleSheet","flatten","textStyles","applyStyles","baseStyles","stylesToApply","flattenedStyles","key","value","Object","entries","getValueForRadioButton","String","undefined","Error"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEO,SAASA,aAAT,CAAuBC,KAAvB,EAA8C;AACnD,QAAM;AACJC,IAAAA,KADI;AAEJC,IAAAA,UAFI;AAGJC,IAAAA,UAHI;AAIJC,IAAAA,QAJI;AAKJC,IAAA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K,SAAd,EAAyB;AAC9B,WAAOA,SAAP;AACD,GAFM,MAEA;AACL,UAAM,IAAIC,KAAJ,CAAW,kBAAiBN,KAAM,EAAlC,CAAN;AACD;AACF","sourcesContent":["import { StyleSheet, StyleProp, TextStyle } from \"react-native\";\nimport { isString, isNumber } from \"lodash\";\n\nexport function extractStyles(style: StyleProp<any>) {\n const {\n color,\n fontFamily,\n fontWeight,\n fontSize,\n lineHeight,\n letterSpacing,\n textTransform,\n textAlign,\n textDecorationLine,\n textDecorationColor,\n textDecorationStyle,\n ...viewStyles\n } = StyleSheet.flatten(style || {});\n\n const textStyles: TextStyle = {\n color,\n fontFamily,\n fontWeight,\n fontSize,\n lineHeight,\n letterSpacing,\n textTransform,\n textAlign,\n textDecorationLine,\n textDecorationColor,\n textDecorationStyle,\n };\n\n return { viewStyles, textStyles };\n}\n\n/**\n * Merges a style object on top of another style object. In React Native,\n * keys with undefined values in a style object will still override styles\n * that appear earlier in a sequence. This avoids that problem.\n *\n * This lets us avoid the `...(something ? { something } : {})` pattern.\n * There doesn't seem to be a better way to do this. These all seem to not\n * work (i.e. they all result in `{ color: undefined }`:\n * `const mergedStyles = [{ color: \"red\" }, { color: undefined }]`\n * `const mergedStyles = StyleSheet.compose({ color: \"red\" }, { color: undefined })`\n * `const mergedStyles = StyleSheet.flatten([{ color: \"red\" }, { color: undefined }])`\n */\nexport function applyStyles(\n baseStyles: Array<StyleProp<any>>,\n stylesToApply: StyleProp<any> | undefined\n) {\n if (!stylesToApply) {\n return;\n }\n\n const flattenedStyles = StyleSheet.flatten(baseStyles);\n\n for (const [key, value] of Object.entries(stylesToApply)) {\n if (value != null) {\n flattenedStyles[key] = value;\n }\n }\n\n return flattenedStyles;\n}\n\nexport function getValueForRadioButton(value?: string | number) {\n if (isString(value)) {\n return value;\n } else if (isNumber(value)) {\n return String(value);\n } else if (value === undefined) {\n return undefined;\n } else {\n throw new Error(`Invalid value: ${value}`);\n }\n}\n"]}
1
+ {"version":3,"sources":["utilities.ts"],"names":["extractStyles","style","color","fontFamily","fontWeight","fontSize","lineHeight","letterSpacing","textTransform","textAlign","textDecorationLine","textDecorationColor","textDecorationStyle","viewStyles","StyleSheet","flatten","textStyles","isNil","applyStyles","baseStyles","stylesToApply","flattenedStyles","key","value","Object","entries"],"mappings":";;;;;;;;AAAA;;AACA;;AACA;;;;AAEO,SAASA,aAAT,CAAuBC,KAAvB,EAA8C;AACnD,QAAM;AACJC,IAAAA,KADI;AAEJC,IAAAA,UAFI;AAGJC,IAAAA,UAHI;AAIJC,IAAAA,QAJI;AAKJC,IAAAA,UALI;AAMJC,IAAAA,aANI;AAOJC,IAAAA,aAPI;AAQJC,IAAAA,SARI;AASJC,IAAAA,kBATI;AAUJC,IAAAA,mBAVI;AAWJC,IAAAA,mBAXI;AAYJ,OAAGC;AAZC,MAaFC,wBAAWC,OAAX,CAAmBd,KAAK,IAAI,EAA5B,CAbJ;;AAeA,QAAMe,UAAqB,GAAG;AAC5Bd,IAAAA,KAD4B;AAE5BC,IAAAA,UAF4B;AAG5BC,IAAAA,UAH4B;AAI5BC,IAAAA,QAJ4B;AAK5BC,IAAAA,UAL4B;AAM5BC,IAAAA,aAN4B;AAO5BC,IAAAA,aAP4B;AAQ5BC,IAAAA,SAR4B;AAS5BC,IAAAA,kBAT4B;AAU5BC,IAAAA,mBAV4B;AAW5BC,IAAAA;AAX4B,GAA9B;AAcA,SAAO;AACLC,IAAAA,UAAU,EAAE,qBAAOA,UAAP,EAAmBI,cAAnB,CADP;AAELD,IAAAA,UAAU,EAAE,qBAAOA,UAAP,EAAmBC,cAAnB;AAFP,GAAP;AAID;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASC,WAAT,CACLC,UADK,EAELC,aAFK,EAGL;AACA,MAAI,CAACA,aAAL,EAAoB;AAClB;AACD;;AAED,QAAMC,eAAe,GAAGP,wBAAWC,OAAX,CAAmBI,UAAnB,CAAxB;;AAEA,OAAK,MAAM,CAACG,GAAD,EAAMC,KAAN,CAAX,IAA2BC,MAAM,CAACC,OAAP,CAAeL,aAAf,CAA3B,EAA0D;AACxD,QAAIG,KAAK,IAAI,IAAb,EAAmB;AACjBF,MAAAA,eAAe,CAACC,GAAD,CAAf,GAAuBC,KAAvB;AACD;AACF;;AAED,SAAOF,eAAP;AACD","sourcesContent":["import { StyleSheet, StyleProp, TextStyle } from \"react-native\";\nimport omitBy from \"lodash/omitBy\";\nimport isNil from \"lodash/isNil\";\n\nexport function extractStyles(style: StyleProp<any>) {\n const {\n color,\n fontFamily,\n fontWeight,\n fontSize,\n lineHeight,\n letterSpacing,\n textTransform,\n textAlign,\n textDecorationLine,\n textDecorationColor,\n textDecorationStyle,\n ...viewStyles\n } = StyleSheet.flatten(style || {});\n\n const textStyles: TextStyle = {\n color,\n fontFamily,\n fontWeight,\n fontSize,\n lineHeight,\n letterSpacing,\n textTransform,\n textAlign,\n textDecorationLine,\n textDecorationColor,\n textDecorationStyle,\n };\n\n return {\n viewStyles: omitBy(viewStyles, isNil),\n textStyles: omitBy(textStyles, isNil),\n };\n}\n\n/**\n * Merges a style object on top of another style object. In React Native,\n * keys with undefined values in a style object will still override styles\n * that appear earlier in a sequence. This avoids that problem.\n *\n * This lets us avoid the `...(something ? { something } : {})` pattern.\n * There doesn't seem to be a better way to do this. These all seem to not\n * work (i.e. they all result in `{ color: undefined }`:\n * `const mergedStyles = [{ color: \"red\" }, { color: undefined }]`\n * `const mergedStyles = StyleSheet.compose({ color: \"red\" }, { color: undefined })`\n * `const mergedStyles = StyleSheet.flatten([{ color: \"red\" }, { color: undefined }])`\n */\nexport function applyStyles(\n baseStyles: Array<StyleProp<any>>,\n stylesToApply: StyleProp<any> | undefined\n) {\n if (!stylesToApply) {\n return;\n }\n\n const flattenedStyles = StyleSheet.flatten(baseStyles);\n\n for (const [key, value] of Object.entries(stylesToApply)) {\n if (value != null) {\n flattenedStyles[key] = value;\n }\n }\n\n return flattenedStyles;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"sources":["DatePickerComponentType.js"],"names":[],"mappings":"AAAA","sourcesContent":["export {};\n"]}
@@ -3,7 +3,6 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
3
3
  import * as React from "react";
4
4
  import Config from "../Config";
5
5
  import IconButton from "../IconButton";
6
- import { getValueForRadioButton } from "../../utilities";
7
6
  import { useRadioButtonGroupContext } from "./context";
8
7
 
9
8
  const RadioButton = _ref => {
@@ -14,7 +13,7 @@ const RadioButton = _ref => {
14
13
  value,
15
14
  selected,
16
15
  unselectedColor,
17
- onPress,
16
+ onPress = () => {},
18
17
  size = Config.radioButtonSize,
19
18
  selectedIcon = "MaterialIcons/radio-button-checked",
20
19
  unselectedIcon = "MaterialIcons/radio-button-unchecked",
@@ -25,17 +24,16 @@ const RadioButton = _ref => {
25
24
  value: contextValue,
26
25
  onValueChange
27
26
  } = useRadioButtonGroupContext();
28
- const realValue = getValueForRadioButton(value);
29
- const realContextValue = getValueForRadioButton(contextValue);
30
- const isSelected = selected !== null && selected !== void 0 ? selected : realContextValue && realValue && realContextValue === realValue;
31
27
 
32
28
  const handlePress = () => {
33
- if (realValue) {
34
- onPress === null || onPress === void 0 ? void 0 : onPress(realValue);
35
- onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(realValue);
29
+ onPress && onPress();
30
+
31
+ if (onValueChange && value) {
32
+ onValueChange(value);
36
33
  }
37
34
  };
38
35
 
36
+ const isSelected = selected || contextValue != null && contextValue === value;
39
37
  return /*#__PURE__*/React.createElement(IconButton, _extends({
40
38
  Icon: Icon,
41
39
  icon: isSelected ? selectedIcon : unselectedIcon,
@@ -1 +1 @@
1
- {"version":3,"sources":["RadioButton.tsx"],"names":["React","Config","IconButton","getValueForRadioButton","useRadioButtonGroupContext","RadioButton","Icon","disabled","color","value","selected","unselectedColor","onPress","size","radioButtonSize","selectedIcon","unselectedIcon","style","rest","contextValue","onValueChange","realVal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GAAGR,YAAH,GAAkBC,cAFpC;AAGE,IAAA,KAAK,EAAEO,UAAU,GAAGf,KAAH,GAAWG,eAH9B;AAIE,IAAA,QAAQ,EAAEJ,QAJZ;AAKE,IAAA,OAAO,EAAEiB,WALX;AAME,IAAA,IAAI,EAAEX,IANR;AAOE,IAAA,KAAK,EAAEI;AAPT,KAQMC,IARN,EADF;AAYD,CAzCD;;AA2CA,eAAeb,WAAf","sourcesContent":["import * as React from \"react\";\nimport { StyleProp, ViewStyle } from \"react-native\";\n\nimport Config from \"../Config\";\nimport IconButton from \"../IconButton\";\nimport { getValueForRadioButton } from \"../../utilities\";\nimport { useRadioButtonGroupContext } from \"./context\";\n\nimport type { IconSlot } from \"../../interfaces/Icon\";\n\nexport type RadioButtonProps = {\n selected?: boolean;\n disabled?: boolean;\n color?: string;\n value?: string | number;\n unselectedColor?: string;\n onPress?: (value: string) => void;\n style?: StyleProp<ViewStyle>;\n size?: number;\n selectedIcon?: string;\n unselectedIcon?: string;\n} & IconSlot;\n\nconst RadioButton: React.FC<RadioButtonProps> = ({\n Icon,\n disabled = false,\n color,\n value,\n selected,\n unselectedColor,\n onPress,\n size = Config.radioButtonSize,\n selectedIcon = \"MaterialIcons/radio-button-checked\",\n unselectedIcon = \"MaterialIcons/radio-button-unchecked\",\n style,\n ...rest\n}) => {\n const { value: contextValue, onValueChange } = useRadioButtonGroupContext();\n\n const realValue = getValueForRadioButton(value);\n const realContextValue = getValueForRadioButton(contextValue);\n const isSelected =\n selected ??\n (realContextValue && realValue && realContextValue === realValue);\n\n const handlePress = () => {\n if (realValue) {\n onPress?.(realValue);\n onValueChange?.(realValue);\n }\n };\n\n return (\n <IconButton\n Icon={Icon}\n icon={isSelected ? selectedIcon : unselectedIcon}\n color={isSelected ? color : unselectedColor}\n disabled={disabled}\n onPress={handlePress}\n size={size}\n style={style}\n {...rest}\n />\n );\n};\n\nexport default RadioButton;\n"]}
1
+ {"version":3,"sources":["RadioButton.tsx"],"names":["React","Config","IconButton","useRadioButtonGroupContext","RadioButton","Icon","disabled","color","value","selected","unselectedColor","onPress","size","radioButtonSize","selectedIcon","unselectedIcon","style","rest","contextValue","onValueChange","handlePress","isSelected"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAGA,OAAOC,MAAP,MAAmB,WAAnB;AACA,OAAOC,UAAP,MAAuB,eAAvB;AACA,SAASC,0BAAT,QAA2C,WAA3C;;AAiBA,MAAMC,WAAuC,GAAG,QAa1C;AAAA,MAb2C;AAC/CC,IAAAA,IAD+C;AAE/CC,IAAAA,QAAQ,GAAG,KAFoC;AAG/CC,IAAAA,KAH+C;AAI/CC,IAAAA,KAJ+C;AAK/CC,IAAAA,QAL+C;AAM/CC,IAAAA,eAN+C;AAO/CC,IAAAA,OAAO,GAAG,MAAM,CAAE,CAP6B;AAQ/CC,IAAAA,IAAI,GAAGX,MAAM,CAACY,eARiC;AAS/CC,IAAAA,YAAY,GAAG,oCATgC;AAU/CC,IAAAA,cAAc,GAAG,sCAV8B;AAW/CC,IAAAA,KAX+C;AAY/C,OAAGC;AAZ4C,GAa3C;AACJ,QAAM;AAAET,IAAAA,KAAK,EAAEU,YAAT;AAAuBC,IAAAA;AAAvB,MAAyChB,0BAA0B,EAAzE;;AAEA,QAAMiB,WAAW,GAAG,MAAM;AACxBT,IAAAA,OAAO,IAAIA,OAAO,EAAlB;;AAEA,QAAIQ,aAAa,IAAIX,KAArB,EAA4B;AAC1BW,MAAAA,aAAa,CAACX,KAAD,CAAb;AACD;AACF,GAND;;AAQA,QAAMa,UAAU,GACdZ,QAAQ,IAAKS,YAAY,IAAI,IAAhB,IAAwBA,YAAY,KAAKV,KADxD;AAGA,sBACE,oBAAC,UAAD;AACE,IAAA,IAAI,EAAEH,IADR;AAEE,IAAA,IAAI,EAAEgB,UAAU,GAAGP,YAAH,GAAkBC,cAFpC;AAGE,IAAA,KAAK,EAAEM,UAAU,GAAGd,KAAH,GAAWG,eAH9B;AAIE,IAAA,QAAQ,EAAEJ,QAJZ;AAKE,IAAA,OAAO,EAAEc,WALX;AAME,IAAA,IAAI,EAAER,IANR;AAOE,IAAA,KAAK,EAAEI;AAPT,KAQMC,IARN,EADF;AAYD,CAvCD;;AAyCA,eAAeb,WAAf","sourcesContent":["import * as React from \"react\";\nimport { StyleProp, ViewStyle } from \"react-native\";\n\nimport Config from \"../Config\";\nimport IconButton from \"../IconButton\";\nimport { useRadioButtonGroupContext } from \"./context\";\n\nimport type { IconSlot } from \"../../interfaces/Icon\";\n\nexport type RadioButtonProps = {\n selected?: boolean;\n disabled?: boolean;\n color?: string;\n value?: string;\n unselectedColor?: string;\n onPress?: () => void;\n style?: StyleProp<ViewStyle>;\n size?: number;\n selectedIcon?: string;\n unselectedIcon?: string;\n} & IconSlot;\n\nconst RadioButton: React.FC<RadioButtonProps> = ({\n Icon,\n disabled = false,\n color,\n value,\n selected,\n unselectedColor,\n onPress = () => {},\n size = Config.radioButtonSize,\n selectedIcon = \"MaterialIcons/radio-button-checked\",\n unselectedIcon = \"MaterialIcons/radio-button-unchecked\",\n style,\n ...rest\n}) => {\n const { value: contextValue, onValueChange } = useRadioButtonGroupContext();\n\n const handlePress = () => {\n onPress && onPress();\n\n if (onValueChange && value) {\n onValueChange(value);\n }\n };\n\n const isSelected =\n selected || (contextValue != null && contextValue === value);\n\n return (\n <IconButton\n Icon={Icon}\n icon={isSelected ? selectedIcon : unselectedIcon}\n color={isSelected ? color : unselectedColor}\n disabled={disabled}\n onPress={handlePress}\n size={size}\n style={style}\n {...rest}\n />\n );\n};\n\nexport default RadioButton;\n"]}
@@ -2,7 +2,6 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
2
2
 
3
3
  import * as React from "react";
4
4
  import { View } from "react-native";
5
- import { getValueForRadioButton } from "../../utilities";
6
5
  import { radioButtonGroupContext, Direction } from "./context";
7
6
  const {
8
7
  Provider
@@ -12,35 +11,27 @@ const RadioButtonGroup = _ref => {
12
11
  let {
13
12
  direction = Direction.Vertical,
14
13
  value,
15
- onValueChange,
14
+ onValueChange = () => {},
16
15
  defaultValue,
17
16
  style,
18
17
  children,
19
18
  ...rest
20
19
  } = _ref;
21
- const [internalValue, setInternalValue] = React.useState();
20
+ const [internalValue, setInternalValue] = React.useState(value || defaultValue);
22
21
  React.useEffect(() => {
23
- const realValue = getValueForRadioButton(value);
24
-
25
- if (realValue) {
26
- setInternalValue(realValue);
22
+ if (value != null) {
23
+ setInternalValue(value);
27
24
  }
28
25
  }, [value]);
29
26
  React.useEffect(() => {
30
- const realDefaultValue = getValueForRadioButton(defaultValue);
31
-
32
- if (realDefaultValue) {
33
- setInternalValue(realDefaultValue);
27
+ if (defaultValue != null) {
28
+ setInternalValue(defaultValue);
34
29
  }
35
30
  }, [defaultValue]);
36
31
 
37
32
  const handleValueChange = newValue => {
38
- const realNewValue = getValueForRadioButton(newValue);
39
-
40
- if (realNewValue) {
41
- setInternalValue(realNewValue);
42
- onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(realNewValue);
43
- }
33
+ setInternalValue(newValue);
34
+ onValueChange(newValue);
44
35
  };
45
36
 
46
37
  const _containerStyle = [{
@@ -1 +1 @@
1
- {"version":3,"sources":["RadioButtonGroup.tsx"],"names":["React","View","getValueForRadioButton","radioButtonGroupContext","Direction","Provider","RadioButtonGroup","direction","Vertical","value","onValueChange","defaultValue","style","children","rest","internalValue","setInternalValue","useState","useEffect","realValue","realDefaultValue","handleValueChange","newValue","realNewValue","_containerStyle","flexDirection","Horizontal","push","alignItems","minHeight"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,IAAT,QAA2C,cAA3C;AAEA,SAASC,sBAAT,QAAuC,iBAAvC;AACA,SAASC,uBAAT,EAAkCC,SAAlC,QAAmD,WAAnD;AAWA,MAAM;AAAEC,EAAAA;AAAF,IAAeF,uBAArB;;AAEA,MAAMG,gBAAiD,GAAG,QAQpD;AAAA,MARqD;AACzDC,IAAAA,SAAS,GAAGH,SAAS,CAACI,QAD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,CAAC;AAAEC,MAAAA,SAAS,EAAE;AAAb,KAAD,EAAoBjB,KAApB;AAAb,KAA6CE,IAA7C,gBACE,oBAAC,QAAD;AACE,IAAA,KAAK,EAAE;AACLL,MAAAA,KAAK,EAAEM,aAAa,IAAI,EADnB;AAELL,MAAAA,aAAa,EAAEW,iBAFV;AAGLd,MAAAA;AAHK;AADT,kBAOE,oBAAC,IAAD;AAAM,IAAA,KAAK,EAAEiB;AAAb,KAA+BX,QAA/B,CAPF,CADF,CADF;AAaD,CA/DD;;AAiEA,eAAeP,gBAAf","sourcesContent":["import * as React from \"react\";\nimport { View, StyleProp, ViewStyle } from \"react-native\";\nimport type { Theme } from \"../../styles/DefaultTheme\";\nimport { getValueForRadioButton } from \"../../utilities\";\nimport { radioButtonGroupContext, Direction } from \"./context\";\nexport interface RadioButtonGroupProps {\n direction?: Direction;\n style?: StyleProp<ViewStyle>;\n value?: string;\n onValueChange?: (value: string) => void;\n defaultValue?: string | number;\n theme: Theme;\n children: React.ReactNode;\n}\n\nconst { Provider } = radioButtonGroupContext;\n\nconst RadioButtonGroup: React.FC<RadioButtonGroupProps> = ({\n direction = Direction.Vertical,\n value,\n onValueChange,\n defaultValue,\n style,\n children,\n ...rest\n}) => {\n const [internalValue, setInternalValue] = React.useState<\n string | undefined\n >();\n\n React.useEffect(() => {\n const realValue = getValueForRadioButton(value);\n\n if (realValue) {\n setInternalValue(realValue);\n }\n }, [value]);\n\n React.useEffect(() => {\n const realDefaultValue = getValueForRadioButton(defaultValue);\n\n if (realDefaultValue) {\n setInternalValue(realDefaultValue);\n }\n }, [defaultValue]);\n\n const handleValueChange = (newValue?: string | number) => {\n const realNewValue = getValueForRadioButton(newValue);\n\n if (realNewValue) {\n setInternalValue(realNewValue);\n onValueChange?.(realNewValue);\n }\n };\n\n const _containerStyle: StyleProp<ViewStyle> = [\n {\n flexDirection: direction === Direction.Horizontal ? \"row\" : \"column\",\n },\n ];\n\n if (direction !== Direction.Vertical) {\n _containerStyle.push({\n alignItems: \"center\",\n });\n }\n\n return (\n <View style={[{ minHeight: 40 }, style]} {...rest}>\n <Provider\n value={{\n value: internalValue || \"\",\n onValueChange: handleValueChange,\n direction,\n }}\n >\n <View style={_containerStyle}>{children}</View>\n </Provider>\n </View>\n );\n};\n\nexport default RadioButtonGroup;\n"]}
1
+ {"version":3,"sources":["RadioButtonGroup.tsx"],"names":["React","View","radioButtonGroupContext","Direction","Provider","RadioButtonGroup","direction","Vertical","value","onValueChange","defaultValue","style","children","rest","internalValue","setInternalValue","useState","useEffect","handleValueChange","newValue","_containerStyle","flexDirection","Horizontal","push","alignItems","minHeight"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,IAAT,QAA2C,cAA3C;AAEA,SAASC,uBAAT,EAAkCC,SAAlC,QAAmD,WAAnD;AAWA,MAAM;AAAEC,EAAAA;AAAF,IAAeF,uBAArB;;AAEA,MAAMG,gBAAiD,GAAG,QAQpD;AAAA,MARqD;AACzDC,IAAAA,SAAS,GAAGH,SAAS,CAACI,QADmC;AAEzDC,IAAAA,KAFyD;AAGzDC,IAAAA,aAAa,GAAG,MAAM,CAAE,CAHiC;AAIzDC,IAAAA,YAJyD;AAKzDC,IAAAA,KALyD;AAMzDC,IAAAA,QANyD;AAOzD,OAAGC;AAPsD,GAQrD;AACJ,QAAM,CAACC,aAAD,EAAgBC,gBAAhB,IAAoCf,KAAK,CAACgB,QAAN,CACxCR,KAAK,IAAIE,YAD+B,CAA1C;AAIAV,EAAAA,KAAK,CAACiB,SAAN,CAAgB,MAAM;AACpB,QAAIT,KAAK,IAAI,IAAb,EAAmB;AACjBO,MAAAA,gBAAgB,CAACP,KAAD,CAAhB;AACD;AACF,GAJD,EAIG,CAACA,KAAD,CAJH;AAMAR,EAAAA,KAAK,CAACiB,SAAN,CAAgB,MAAM;AACpB,QAAIP,YAAY,IAAI,IAApB,EAA0B;AACxBK,MAAAA,gBAAgB,CAACL,YAAD,CAAhB;AACD;AACF,GAJD,EAIG,CAACA,YAAD,CAJH;;AAMA,QAAMQ,iBAAiB,GAAIC,QAAD,IAAsB;AAC9CJ,IAAAA,gBAAgB,CAACI,QAAD,CAAhB;AACAV,IAAAA,aAAa,CAACU,QAAD,CAAb;AACD,GAHD;;AAKA,QAAMC,eAAqC,GAAG,CAC5C;AACEC,IAAAA,aAAa,EAAEf,SAAS,KAAKH,SAAS,CAACmB,UAAxB,GAAqC,KAArC,GAA6C;AAD9D,GAD4C,CAA9C;;AAMA,MAAIhB,SAAS,KAAKH,SAAS,CAACI,QAA5B,EAAsC;AACpCa,IAAAA,eAAe,CAACG,IAAhB,CAAqB;AACnBC,MAAAA,UAAU,EAAE;AADO,KAArB;AAGD;;AAED,sBACE,oBAAC,IAAD;AAAM,IAAA,KAAK,EAAE,CAAC;AAAEC,MAAAA,SAAS,EAAE;AAAb,KAAD,EAAoBd,KAApB;AAAb,KAA6CE,IAA7C,gBACE,oBAAC,QAAD;AACE,IAAA,KAAK,EAAE;AACLL,MAAAA,KAAK,EAAEM,aAAa,IAAI,EADnB;AAELL,MAAAA,aAAa,EAAES,iBAFV;AAGLZ,MAAAA;AAHK;AADT,kBAOE,oBAAC,IAAD;AAAM,IAAA,KAAK,EAAEc;AAAb,KAA+BR,QAA/B,CAPF,CADF,CADF;AAaD,CAvDD;;AAyDA,eAAeP,gBAAf","sourcesContent":["import * as React from \"react\";\nimport { View, StyleProp, ViewStyle } from \"react-native\";\nimport type { Theme } from \"../../styles/DefaultTheme\";\nimport { radioButtonGroupContext, Direction } from \"./context\";\nexport interface RadioButtonGroupProps {\n direction?: Direction;\n style?: StyleProp<ViewStyle>;\n value?: string;\n onValueChange?: (value: string) => void;\n defaultValue?: string;\n theme: Theme;\n children: React.ReactNode;\n}\n\nconst { Provider } = radioButtonGroupContext;\n\nconst RadioButtonGroup: React.FC<RadioButtonGroupProps> = ({\n direction = Direction.Vertical,\n value,\n onValueChange = () => {},\n defaultValue,\n style,\n children,\n ...rest\n}) => {\n const [internalValue, setInternalValue] = React.useState<string | undefined>(\n value || defaultValue\n );\n\n React.useEffect(() => {\n if (value != null) {\n setInternalValue(value);\n }\n }, [value]);\n\n React.useEffect(() => {\n if (defaultValue != null) {\n setInternalValue(defaultValue);\n }\n }, [defaultValue]);\n\n const handleValueChange = (newValue: string) => {\n setInternalValue(newValue);\n onValueChange(newValue);\n };\n\n const _containerStyle: StyleProp<ViewStyle> = [\n {\n flexDirection: direction === Direction.Horizontal ? \"row\" : \"column\",\n },\n ];\n\n if (direction !== Direction.Vertical) {\n _containerStyle.push({\n alignItems: \"center\",\n });\n }\n\n return (\n <View style={[{ minHeight: 40 }, style]} {...rest}>\n <Provider\n value={{\n value: internalValue || \"\",\n onValueChange: handleValueChange,\n direction,\n }}\n >\n <View style={_containerStyle}>{children}</View>\n </Provider>\n </View>\n );\n};\n\nexport default RadioButtonGroup;\n"]}
@@ -7,7 +7,7 @@ import Text from "../Text";
7
7
  import { useRadioButtonGroupContext } from "./context";
8
8
  import { Direction as GroupDirection } from "./context";
9
9
  import Touchable from "../Touchable";
10
- import { extractStyles, getValueForRadioButton } from "../../utilities";
10
+ import { extractStyles } from "../../utilities";
11
11
  export let Direction;
12
12
 
13
13
  (function (Direction) {
@@ -25,13 +25,13 @@ const getRadioButtonAlignment = (parentDirection, direction) => {
25
25
  }
26
26
  };
27
27
 
28
- const renderLabel = (label, labelStyle, textStyle) => {
29
- if (typeof label === "string") {
28
+ const renderLabel = (value, labelStyle, textStyle) => {
29
+ if (typeof value === "string") {
30
30
  return /*#__PURE__*/React.createElement(Text, {
31
31
  style: [labelStyle, textStyle]
32
- }, label);
32
+ }, value);
33
33
  } else {
34
- return /*#__PURE__*/React.createElement(React.Fragment, null, label);
34
+ return /*#__PURE__*/React.createElement(React.Fragment, null, value);
35
35
  }
36
36
  };
37
37
 
@@ -42,7 +42,7 @@ const RadioButtonRow = _ref => {
42
42
  value,
43
43
  color,
44
44
  unselectedColor,
45
- onPress,
45
+ onPress = () => {},
46
46
  labelContainerStyle,
47
47
  labelStyle,
48
48
  radioButtonStyle,
@@ -57,15 +57,10 @@ const RadioButtonRow = _ref => {
57
57
  onValueChange,
58
58
  direction: parentDirection
59
59
  } = useRadioButtonGroupContext();
60
- const realValue = getValueForRadioButton(value);
61
- const realContextValue = getValueForRadioButton(contextValue);
62
- const isSelected = selected !== null && selected !== void 0 ? selected : realContextValue && realValue && realContextValue === realValue;
63
60
 
64
61
  const handlePress = () => {
65
- if (realValue) {
66
- onPress === null || onPress === void 0 ? void 0 : onPress(realValue);
67
- onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(realValue);
68
- }
62
+ onPress(value);
63
+ onValueChange && onValueChange(value);
69
64
  };
70
65
 
71
66
  const {
@@ -89,10 +84,10 @@ const RadioButtonRow = _ref => {
89
84
  }
90
85
  }, /*#__PURE__*/React.createElement(RadioButton, {
91
86
  Icon: Icon,
92
- selected: isSelected ? true : false,
93
- value: realValue,
87
+ selected: selected || contextValue != null && contextValue === value,
94
88
  color: color,
95
89
  unselectedColor: unselectedColor,
90
+ onPress: handlePress,
96
91
  style: radioButtonStyle
97
92
  })));
98
93
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["RadioButtonRow.tsx"],"names":["React","StyleSheet","View","Platform","RadioButton","Text","useRadioButtonGroupContext","Direction","GroupDirection","Touchable","extractStyles","getValueForRadioButton","getRadioButtonAlignment","parentDirection","direction","Horizontal","Row","RowReverse","renderLabel","label","labelStyle","textStyle","RadioButtonRow","Icon","value","color","unselectedColor","onPress","labelContainerStyle","radioButtonStyle","selected","disabled","style","rest","contextValue","onValueChange","realValue","realContextValue","isSelected","handlePress","textStyles","viewStyles","styles","mainParent","flexDirection","alignItems","flex","create","justifyContent","paddingStart","minHeight","paddingEnd","select","web","cursor","userSelect"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAGEC,UAHF,EAKEC,IALF,EAMEC,QANF,QAOO,cAPP;AAQA,OAAOC,WAAP,MAA8C,eAA9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ACLM,MAAAA,IAAI,EAAE,CADD;AAELD,MAAAA,UAAU,EAAEjC,uBAAuB,CAACC,eAAD,EAAkBC,SAAlB;AAF9B;AADT,kBAME,oBAAC,WAAD;AACE,IAAA,IAAI,EAAES,IADR;AAEE,IAAA,QAAQ,EAAEe,UAAU,GAAG,IAAH,GAAU,KAFhC;AAGE,IAAA,KAAK,EAAEF,SAHT;AAIE,IAAA,KAAK,EAAEX,KAJT;AAKE,IAAA,eAAe,EAAEC,eALnB;AAME,IAAA,KAAK,EAAEG;AANT,IANF,CAjBF,CADF;AAmCD,CAxED;;AA0EA,MAAMa,MAAM,GAAGzC,UAAU,CAAC8C,MAAX,CAAkB;AAC/BJ,EAAAA,UAAU,EAAE;AACVE,IAAAA,UAAU,EAAE,QADF;AAEVG,IAAAA,cAAc,EAAE,cAFN;AAGVC,IAAAA,YAAY,EAAE,EAHJ;AAIVC,IAAAA,SAAS,EAAE,EAJD;AAKVC,IAAAA,UAAU,EAAE,EALF;AAMVL,IAAAA,IAAI,EAAE,CANI;AAOV,OAAG3C,QAAQ,CAACiD,MAAT,CAAgB;AACjBC,MAAAA,GAAG,EAAE;AACHC,QAAAA,MAAM,EAAE,SADL;AAEHC,QAAAA,UAAU,EAAE;AAFT;AADY,KAAhB;AAPO,GADmB;AAe/BpC,EAAAA,KAAK,EAAE;AACL2B,IAAAA,IAAI,EAAE;AADD;AAfwB,CAAlB,CAAf;AAoBA,eAAexB,cAAf","sourcesContent":["import * as React from \"react\";\nimport {\n StyleProp,\n ViewStyle,\n StyleSheet,\n TextStyle,\n View,\n Platform,\n} from \"react-native\";\nimport RadioButton, { RadioButtonProps } from \"./RadioButton\";\nimport Text from \"../Text\";\nimport { useRadioButtonGroupContext } from \"./context\";\nimport type { IconSlot } from \"../../interfaces/Icon\";\nimport { Direction as GroupDirection } from \"./context\";\nimport Touchable from \"../Touchable\";\nimport { extractStyles, getValueForRadioButton } from \"../../utilities\";\n\nexport enum Direction {\n Row = \"row\",\n RowReverse = \"row-reverse\",\n}\n\nexport interface RadioButtonRowProps extends Omit<RadioButtonProps, \"onPress\"> {\n label: string | React.ReactNode;\n value: string | number; // A string (or number that will be parsed String(number)) that this radio button row represents when selected\n color?: string;\n unselectedColor?: string;\n labelContainerStyle: StyleProp<ViewStyle>;\n radioButtonStyle?: StyleProp<ViewStyle>;\n labelStyle?: StyleProp<TextStyle>;\n onPress?: (value: string) => void;\n direction?: Direction;\n}\n\nconst getRadioButtonAlignment = (\n parentDirection: GroupDirection | undefined,\n direction: Direction\n) => {\n if (parentDirection === GroupDirection.Horizontal) {\n return direction === Direction.Row ? \"flex-start\" : \"flex-end\";\n } else if (direction === Direction.RowReverse) {\n return \"flex-start\";\n } else {\n return \"flex-end\";\n }\n};\n\nconst renderLabel = (\n label: string | React.ReactNode,\n labelStyle: StyleProp<TextStyle>,\n textStyle: StyleProp<TextStyle>\n) => {\n if (typeof label === \"string\") {\n return <Text style={[labelStyle, textStyle]}>{label}</Text>;\n } else {\n return <>{label}</>;\n }\n};\n\nconst RadioButtonRow: React.FC<RadioButtonRowProps & IconSlot> = ({\n Icon,\n label,\n value,\n color,\n unselectedColor,\n onPress,\n labelContainerStyle,\n labelStyle,\n radioButtonStyle,\n direction = Direction.Row,\n selected,\n disabled,\n style,\n ...rest\n}) => {\n const {\n value: contextValue,\n onValueChange,\n direction: parentDirection,\n } = useRadioButtonGroupContext();\n\n const realValue = getValueForRadioButton(value);\n const realContextValue = getValueForRadioButton(contextValue);\n const isSelected =\n selected ??\n (realContextValue && realValue && realContextValue === realValue);\n\n const handlePress = () => {\n if (realValue) {\n onPress?.(realValue);\n onValueChange?.(realValue);\n }\n };\n\n const { textStyles, viewStyles } = extractStyles(style);\n\n return (\n <Touchable\n onPress={handlePress}\n style={[styles.mainParent, { flexDirection: direction }, viewStyles]}\n disabled={disabled}\n {...rest}\n >\n <View\n style={[\n styles.label,\n {\n alignItems: direction === Direction.Row ? \"flex-start\" : \"flex-end\",\n },\n labelContainerStyle,\n ]}\n >\n {renderLabel(label, labelStyle, textStyles)}\n </View>\n <View\n style={{\n flex: 1,\n alignItems: getRadioButtonAlignment(parentDirection, direction),\n }}\n >\n <RadioButton\n Icon={Icon}\n selected={isSelected ? true : false}\n value={realValue}\n color={color}\n unselectedColor={unselectedColor}\n style={radioButtonStyle}\n />\n </View>\n </Touchable>\n );\n};\n\nconst styles = StyleSheet.create({\n mainParent: {\n alignItems: \"center\",\n justifyContent: \"space-around\",\n paddingStart: 20,\n minHeight: 50,\n paddingEnd: 20,\n flex: 1,\n ...Platform.select({\n web: {\n cursor: \"pointer\",\n userSelect: \"none\",\n },\n }),\n },\n label: {\n flex: 3,\n },\n});\n\nexport default RadioButtonRow;\n"]}
1
+ {"version":3,"sources":["RadioButtonRow.tsx"],"names":["React","StyleSheet","View","Platform","RadioButton","Text","useRadioButtonGroupContext","Direction","GroupDirection","Touchable","extractStyles","getRadioButtonAlignment","parentDirection","direction","Horizontal","Row","RowReverse","renderLabel","value","labelStyle","textStyle","RadioButtonRow","Icon","label","color","unselectedColor","onPress","labelContainerStyle","radioButtonStyle","selected","disabled","style","rest","contextValue","onValueChange","handlePress","textStyles","viewStyles","styles","mainParent","flexDirection","alignItems","flex","create","justifyContent","paddingStart","minHeight","paddingEnd","select","web","cursor","userSelect"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAGEC,UAHF,EAKEC,IALF,EAMEC,QANF,QAOO,cAPP;AAQA,OAAOC,WAAP,MAA8C,eAA9C;AACA,OAAOC,IAAP,MAAiB,SAAjB;AACA,SAASC,0BAAT,QAA2C,WAA3C;AAEA,SAASC,SAAS,IAAIC,cAAtB,QAA4C,WAA5C;AACA,OAAOC,SAAP,MAAsB,cAAtB;AACA,SAASC,aAAT,QAA8B,iBAA9B;AAEA,WAAYH,SAAZ;;WAAYA,S;AAAAA,EAAAA,S;AAAAA,EAAAA,S;GAAAA,S,KAAAA,S;;AAiBZ,MAAMI,uBAAuB,GAAG,CAC9BC,eAD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VC,IAAAA,UAAU,EAAE,EALF;AAMVL,IAAAA,IAAI,EAAE,CANI;AAOV,OAAGvC,QAAQ,CAAC6C,MAAT,CAAgB;AACjBC,MAAAA,GAAG,EAAE;AACHC,QAAAA,MAAM,EAAE,SADL;AAEHC,QAAAA,UAAU,EAAE;AAFT;AADY,KAAhB;AAPO,GADmB;AAe/B5B,EAAAA,KAAK,EAAE;AACLmB,IAAAA,IAAI,EAAE;AADD;AAfwB,CAAlB,CAAf;AAoBA,eAAerB,cAAf","sourcesContent":["import * as React from \"react\";\nimport {\n StyleProp,\n ViewStyle,\n StyleSheet,\n TextStyle,\n View,\n Platform,\n} from \"react-native\";\nimport RadioButton, { RadioButtonProps } from \"./RadioButton\";\nimport Text from \"../Text\";\nimport { useRadioButtonGroupContext } from \"./context\";\nimport type { IconSlot } from \"../../interfaces/Icon\";\nimport { Direction as GroupDirection } from \"./context\";\nimport Touchable from \"../Touchable\";\nimport { extractStyles } from \"../../utilities\";\n\nexport enum Direction {\n Row = \"row\",\n RowReverse = \"row-reverse\",\n}\n\nexport interface RadioButtonRowProps extends Omit<RadioButtonProps, \"onPress\"> {\n label: string | React.ReactNode;\n value: string; // A string that this radio button row represents when selected\n color?: string;\n unselectedColor?: string;\n labelContainerStyle: StyleProp<ViewStyle>;\n radioButtonStyle?: StyleProp<ViewStyle>;\n labelStyle?: StyleProp<TextStyle>;\n onPress?: (value: string) => void;\n direction?: Direction;\n}\n\nconst getRadioButtonAlignment = (\n parentDirection: GroupDirection | undefined,\n direction: Direction\n) => {\n if (parentDirection === GroupDirection.Horizontal) {\n return direction === Direction.Row ? \"flex-start\" : \"flex-end\";\n } else if (direction === Direction.RowReverse) {\n return \"flex-start\";\n } else {\n return \"flex-end\";\n }\n};\n\nconst renderLabel = (\n value: string | React.ReactNode,\n labelStyle: StyleProp<TextStyle>,\n textStyle: StyleProp<TextStyle>\n) => {\n if (typeof value === \"string\") {\n return <Text style={[labelStyle, textStyle]}>{value}</Text>;\n } else {\n return <>{value}</>;\n }\n};\n\nconst RadioButtonRow: React.FC<RadioButtonRowProps & IconSlot> = ({\n Icon,\n label,\n value,\n color,\n unselectedColor,\n onPress = () => {},\n labelContainerStyle,\n labelStyle,\n radioButtonStyle,\n direction = Direction.Row,\n selected,\n disabled,\n style,\n ...rest\n}) => {\n const {\n value: contextValue,\n onValueChange,\n direction: parentDirection,\n } = useRadioButtonGroupContext();\n\n const handlePress = () => {\n onPress(value);\n onValueChange && onValueChange(value);\n };\n\n const { textStyles, viewStyles } = extractStyles(style);\n\n return (\n <Touchable\n onPress={handlePress}\n style={[styles.mainParent, { flexDirection: direction }, viewStyles]}\n disabled={disabled}\n {...rest}\n >\n <View\n style={[\n styles.label,\n {\n alignItems: direction === Direction.Row ? \"flex-start\" : \"flex-end\",\n },\n labelContainerStyle,\n ]}\n >\n {renderLabel(label, labelStyle, textStyles)}\n </View>\n <View\n style={{\n flex: 1,\n alignItems: getRadioButtonAlignment(parentDirection, direction),\n }}\n >\n <RadioButton\n Icon={Icon}\n selected={\n selected || (contextValue != null && contextValue === value)\n }\n color={color}\n unselectedColor={unselectedColor}\n onPress={handlePress}\n style={radioButtonStyle}\n />\n </View>\n </Touchable>\n );\n};\n\nconst styles = StyleSheet.create({\n mainParent: {\n alignItems: \"center\",\n justifyContent: \"space-around\",\n paddingStart: 20,\n minHeight: 50,\n paddingEnd: 20,\n flex: 1,\n ...Platform.select({\n web: {\n cursor: \"pointer\",\n userSelect: \"none\",\n },\n }),\n },\n label: {\n flex: 3,\n },\n});\n\nexport default RadioButtonRow;\n"]}
@@ -1,2 +1,2 @@
1
- export {};
2
- //# sourceMappingURL=ResizeMode.js.map
1
+
2
+ //# sourceMappingURL=ResizeMode.js.mapode.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["ResizeMode.js"],"names":[],"mappings":"AAAA","sourcesContent":["export {};\n"]}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -0,0 +1,7 @@
1
+ export { default as Table } from "./table";
2
+ export { default as TableHeader } from "./tableHeader";
3
+ export { default as TablePaginator } from "./tablePaginator";
4
+ export { default as TableRow } from "./tableRow";
5
+ export { default as TableCell } from "./tableCell";
6
+ export { default as TableTitle } from "./tableTitle";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.tsx"],"names":["default","Table","TableHeader","TablePaginator","TableRow","TableCell","TableTitle"],"mappings":"AAAA,SAASA,OAAO,IAAIC,KAApB,QAAiC,SAAjC;AACA,SAASD,OAAO,IAAIE,WAApB,QAAuC,eAAvC;AACA,SAASF,OAAO,IAAIG,cAApB,QAA0C,kBAA1C;AACA,SAASH,OAAO,IAAII,QAApB,QAAoC,YAApC;AACA,SAASJ,OAAO,IAAIK,SAApB,QAAqC,aAArC;AACA,SAASL,OAAO,IAAIM,UAApB,QAAsC,cAAtC","sourcesContent":["export { default as Table } from \"./table\";\nexport { default as TableHeader } from \"./tableHeader\";\nexport { default as TablePaginator } from \"./tablePaginator\";\nexport { default as TableRow } from \"./tableRow\";\nexport { default as TableCell } from \"./tableCell\";\nexport { default as TableTitle } from \"./tableTitle\";\n"]}
@@ -0,0 +1,24 @@
1
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ import React from "react";
4
+ import { View, StyleSheet } from "react-native";
5
+
6
+ const Table = _ref => {
7
+ let {
8
+ children,
9
+ style,
10
+ ...rest
11
+ } = _ref;
12
+ return /*#__PURE__*/React.createElement(View, _extends({}, rest, {
13
+ style: [styles.wrapper, style]
14
+ }), children);
15
+ };
16
+
17
+ const styles = StyleSheet.create({
18
+ wrapper: {
19
+ display: "flex",
20
+ flexDirection: "column"
21
+ }
22
+ });
23
+ export default Table;
24
+ //# sourceMappingURL=table.js.map