@draftbit/core 46.2.4-44e731.5 → 46.2.4-45ebda.5

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 (69) hide show
  1. package/lib/commonjs/components/Config.js +1 -1
  2. package/lib/commonjs/components/SVG.js +4 -5
  3. package/lib/commonjs/index.js +0 -38
  4. package/lib/commonjs/mappings/FieldSearchBarFull.js +1 -3
  5. package/lib/commonjs/mappings/{SVG.js → Svg.js} +2 -0
  6. package/lib/commonjs/utilities.js +2 -2
  7. package/lib/module/components/Config.js +1 -1
  8. package/lib/module/components/SVG.js +4 -5
  9. package/lib/module/index.js +0 -1
  10. package/lib/module/mappings/Svg.js +16 -0
  11. package/lib/module/utilities.js +3 -3
  12. package/lib/typescript/src/components/SVG.d.ts +3 -3
  13. package/lib/typescript/src/index.d.ts +0 -1
  14. package/lib/typescript/src/mappings/{SVG.d.ts → Svg.d.ts} +2 -0
  15. package/lib/typescript/src/utilities.d.ts +3 -3
  16. package/package.json +3 -3
  17. package/src/components/Config.js +1 -1
  18. package/src/components/Config.ts +1 -1
  19. package/src/components/SVG.js +4 -5
  20. package/src/components/SVG.tsx +8 -8
  21. package/src/index.js +0 -1
  22. package/src/index.tsx +0 -9
  23. package/src/mappings/Svg.js +21 -0
  24. package/src/mappings/Svg.ts +26 -0
  25. package/src/utilities.js +2 -5
  26. package/src/utilities.ts +2 -13
  27. package/lib/commonjs/components/Table/index.js +0 -55
  28. package/lib/commonjs/components/Table/table.js +0 -35
  29. package/lib/commonjs/components/Table/tableCell.js +0 -50
  30. package/lib/commonjs/components/Table/tableHeader.js +0 -41
  31. package/lib/commonjs/components/Table/tablePaginator.js +0 -17
  32. package/lib/commonjs/components/Table/tableRow.js +0 -47
  33. package/lib/commonjs/components/Table/tableTitle.js +0 -60
  34. package/lib/commonjs/mappings/table.js +0 -103
  35. package/lib/module/components/Table/index.js +0 -6
  36. package/lib/module/components/Table/table.js +0 -23
  37. package/lib/module/components/Table/tableCell.js +0 -37
  38. package/lib/module/components/Table/tableHeader.js +0 -27
  39. package/lib/module/components/Table/tablePaginator.js +0 -6
  40. package/lib/module/components/Table/tableRow.js +0 -33
  41. package/lib/module/components/Table/tableTitle.js +0 -47
  42. package/lib/module/mappings/SVG.js +0 -14
  43. package/lib/module/mappings/table.js +0 -94
  44. package/lib/typescript/src/components/Table/index.d.ts +0 -6
  45. package/lib/typescript/src/components/Table/table.d.ts +0 -8
  46. package/lib/typescript/src/components/Table/tableCell.d.ts +0 -10
  47. package/lib/typescript/src/components/Table/tableHeader.d.ts +0 -12
  48. package/lib/typescript/src/components/Table/tablePaginator.d.ts +0 -3
  49. package/lib/typescript/src/components/Table/tableRow.d.ts +0 -12
  50. package/lib/typescript/src/components/Table/tableTitle.d.ts +0 -12
  51. package/lib/typescript/src/mappings/table.d.ts +0 -153
  52. package/src/components/Table/index.js +0 -6
  53. package/src/components/Table/index.tsx +0 -6
  54. package/src/components/Table/table.js +0 -10
  55. package/src/components/Table/table.tsx +0 -22
  56. package/src/components/Table/tableCell.js +0 -21
  57. package/src/components/Table/tableCell.tsx +0 -44
  58. package/src/components/Table/tableHeader.js +0 -11
  59. package/src/components/Table/tableHeader.tsx +0 -28
  60. package/src/components/Table/tablePaginator.js +0 -5
  61. package/src/components/Table/tablePaginator.tsx +0 -10
  62. package/src/components/Table/tableRow.js +0 -16
  63. package/src/components/Table/tableRow.tsx +0 -31
  64. package/src/components/Table/tableTitle.js +0 -28
  65. package/src/components/Table/tableTitle.tsx +0 -58
  66. package/src/mappings/SVG.js +0 -14
  67. package/src/mappings/SVG.ts +0 -15
  68. package/src/mappings/table.js +0 -137
  69. package/src/mappings/table.ts +0 -145
@@ -62,7 +62,7 @@ var _default = {
62
62
  width: size.width,
63
63
  height: size.height
64
64
  }, "image-placeholder_1"),
65
- placeholderSvgURL: "https://static.draftbit.com/images/placeholder-svg.svg",
65
+ placeholderSvgURL: "https://static.draftbit.com/images/placeholder-image.svg",
66
66
  squareImageUrl: buildImageUrl({
67
67
  width: 100,
68
68
  height: 100
@@ -21,26 +21,25 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
21
21
 
22
22
  const SVG = _ref => {
23
23
  let {
24
- source,
24
+ source = _Config.default.placeholderSvgURL,
25
25
  style
26
26
  } = _ref;
27
- let svgSource = source === null || source === undefined ? _Config.default.placeholderSvgURL : source;
28
27
  return /*#__PURE__*/React.createElement(React.Fragment, null, _reactNative.Platform.OS === "ios" && /*#__PURE__*/React.createElement(_reactNative.View, {
29
28
  style: style
30
29
  }, /*#__PURE__*/React.createElement(_reactNativeSvg.SvgUri, {
31
30
  width: "100%",
32
31
  height: "100%",
33
- uri: svgSource
32
+ uri: source
34
33
  })), _reactNative.Platform.OS === "android" && /*#__PURE__*/React.createElement(_reactNative.View, {
35
34
  style: style
36
35
  }, /*#__PURE__*/React.createElement(_reactNativeSvg.SvgUri, {
37
36
  width: "100%",
38
37
  height: "100%",
39
- uri: svgSource
38
+ uri: source
40
39
  })), _reactNative.Platform.OS === "web" && /*#__PURE__*/React.createElement(_reactNative.Image, {
41
40
  style: style,
42
41
  source: {
43
- uri: svgSource
42
+ uri: source
44
43
  }
45
44
  }));
46
45
  };
@@ -369,42 +369,6 @@ Object.defineProperty(exports, "SwitchRow", {
369
369
  return _Switch.SwitchRow;
370
370
  }
371
371
  });
372
- Object.defineProperty(exports, "Table", {
373
- enumerable: true,
374
- get: function () {
375
- return _Table.Table;
376
- }
377
- });
378
- Object.defineProperty(exports, "TableCell", {
379
- enumerable: true,
380
- get: function () {
381
- return _Table.TableCell;
382
- }
383
- });
384
- Object.defineProperty(exports, "TableHeader", {
385
- enumerable: true,
386
- get: function () {
387
- return _Table.TableHeader;
388
- }
389
- });
390
- Object.defineProperty(exports, "TablePaginator", {
391
- enumerable: true,
392
- get: function () {
393
- return _Table.TablePaginator;
394
- }
395
- });
396
- Object.defineProperty(exports, "TableRow", {
397
- enumerable: true,
398
- get: function () {
399
- return _Table.TableRow;
400
- }
401
- });
402
- Object.defineProperty(exports, "TableTitle", {
403
- enumerable: true,
404
- get: function () {
405
- return _Table.TableTitle;
406
- }
407
- });
408
372
  Object.defineProperty(exports, "TextField", {
409
373
  enumerable: true,
410
374
  get: function () {
@@ -512,8 +476,6 @@ var _Layout = require("./components/Layout");
512
476
 
513
477
  var _index = require("./components/RadioButton/index");
514
478
 
515
- var _Table = require("./components/Table");
516
-
517
479
  var _DeprecatedButton = _interopRequireDefault(require("./components/DeprecatedButton"));
518
480
 
519
481
  var _CardBlock = _interopRequireDefault(require("./components/CardBlock"));
@@ -16,6 +16,7 @@ const SEED_DATA = [{
16
16
  preview_image_url: "{CLOUDINARY_URL}/Field_SearchBar_Full.png",
17
17
  supports_list_render: false,
18
18
  triggers: [_types.Triggers.OnChange],
19
+ // TODO Triggers.OnSubmit for multiple triggers
19
20
  props: {
20
21
  icon: {
21
22
  group: _types.GROUPS.basic,
@@ -53,7 +54,4 @@ const SEED_DATA = [{
53
54
  },
54
55
  layout: {}
55
56
  }];
56
- exports.SEED_DATA = SEED_DATA;},
57
- layout: {}
58
- }];
59
57
  exports.SEED_DATA = SEED_DATA;
@@ -11,11 +11,13 @@ const SEED_DATA = {
11
11
  name: "SVG",
12
12
  tag: "SVG",
13
13
  description: "An SVG component",
14
+ packageName: "@draftbit/core",
14
15
  category: _types.COMPONENT_TYPES.media,
15
16
  layout: {
16
17
  width: 100,
17
18
  height: 100
18
19
  },
20
+ stylesPanelSections: [_types.StylesPanelSections.Size, _types.StylesPanelSections.Margins, _types.StylesPanelSections.Position, _types.StylesPanelSections.Effects],
19
21
  props: {
20
22
  source: (0, _types.createSvgProp)()
21
23
  }
@@ -44,8 +44,8 @@ function extractStyles(style) {
44
44
  textDecorationStyle
45
45
  };
46
46
  return {
47
- viewStyles: (0, _lodash.omitBy)(viewStyles, _lodash.isNil),
48
- textStyles: (0, _lodash.omitBy)(textStyles, _lodash.isNil)
47
+ viewStyles,
48
+ textStyles
49
49
  };
50
50
  }
51
51
 
@@ -54,7 +54,7 @@ export default {
54
54
  width: size.width,
55
55
  height: size.height
56
56
  }, "image-placeholder_1"),
57
- placeholderSvgURL: "https://static.draftbit.com/images/placeholder-svg.svg",
57
+ placeholderSvgURL: "https://static.draftbit.com/images/placeholder-image.svg",
58
58
  squareImageUrl: buildImageUrl({
59
59
  width: 100,
60
60
  height: 100
@@ -5,26 +5,25 @@ import Config from "./Config";
5
5
 
6
6
  const SVG = _ref => {
7
7
  let {
8
- source,
8
+ source = Config.placeholderSvgURL,
9
9
  style
10
10
  } = _ref;
11
- let svgSource = source === null || source === undefined ? Config.placeholderSvgURL : source;
12
11
  return /*#__PURE__*/React.createElement(React.Fragment, null, Platform.OS === "ios" && /*#__PURE__*/React.createElement(View, {
13
12
  style: style
14
13
  }, /*#__PURE__*/React.createElement(SvgUri, {
15
14
  width: "100%",
16
15
  height: "100%",
17
- uri: svgSource
16
+ uri: source
18
17
  })), Platform.OS === "android" && /*#__PURE__*/React.createElement(View, {
19
18
  style: style
20
19
  }, /*#__PURE__*/React.createElement(SvgUri, {
21
20
  width: "100%",
22
21
  height: "100%",
23
- uri: svgSource
22
+ uri: source
24
23
  })), Platform.OS === "web" && /*#__PURE__*/React.createElement(Image, {
25
24
  style: style,
26
25
  source: {
27
- uri: svgSource
26
+ uri: source
28
27
  }
29
28
  }));
30
29
  };
@@ -31,7 +31,6 @@ export { ActionSheet, ActionSheetItem, ActionSheetCancel } from "./components/Ac
31
31
  export { Swiper, SwiperItem } from "./components/Swiper";
32
32
  export { Center, Circle, Square, Row, Stack, Spacer } from "./components/Layout";
33
33
  export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup } from "./components/RadioButton/index";
34
- export { Table, TableRow, TablePaginator, TableHeader, TableCell, TableTitle } from "./components/Table";
35
34
  /* Deprecated: Fix or Delete! */
36
35
 
37
36
  export { default as Button } from "./components/DeprecatedButton";
@@ -0,0 +1,16 @@
1
+ import { COMPONENT_TYPES, createSvgProp, StylesPanelSections } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "SVG",
4
+ tag: "SVG",
5
+ description: "An SVG component",
6
+ packageName: "@draftbit/core",
7
+ category: COMPONENT_TYPES.media,
8
+ layout: {
9
+ width: 100,
10
+ height: 100
11
+ },
12
+ stylesPanelSections: [StylesPanelSections.Size, StylesPanelSections.Margins, StylesPanelSections.Position, StylesPanelSections.Effects],
13
+ props: {
14
+ source: createSvgProp()
15
+ }
16
+ };
@@ -1,5 +1,5 @@
1
1
  import { StyleSheet } from "react-native";
2
- import { isString, isNumber, pick, pickBy, identity, omitBy, isNil } from "lodash";
2
+ import { isString, isNumber, pick, pickBy, identity } from "lodash";
3
3
  export function extractStyles(style) {
4
4
  const {
5
5
  color,
@@ -29,8 +29,8 @@ export function extractStyles(style) {
29
29
  textDecorationStyle
30
30
  };
31
31
  return {
32
- viewStyles: omitBy(viewStyles, isNil),
33
- textStyles: omitBy(textStyles, isNil)
32
+ viewStyles,
33
+ textStyles
34
34
  };
35
35
  }
36
36
  export const borderStyleNames = ["borderRadius", "borderBottomColor", "borderBottomEndRadius", "borderBottomLeftRadius", "borderBottomRightRadius", "borderBottomStartRadius", "borderBottomWidth", "borderColor", "borderEndColor", "borderLeftColor", "borderLeftWidth", "borderRadius", "borderRightColor", "borderRightWidth", "borderStartColor", "borderStyle", "borderTopColor", "borderTopEndRadius", "borderTopLeftRadius", "borderTopRightRadius", "borderTopStartRadius", "borderTopWidth", "borderWidth"];
@@ -1,8 +1,8 @@
1
- /// <reference types="react" />
1
+ import * as React from "react";
2
2
  import { StyleProp, ImageStyle } from "react-native";
3
- declare type SVGComponentProps = {
3
+ declare type SvgComponentProps = {
4
4
  source: string;
5
5
  style?: StyleProp<ImageStyle>;
6
6
  };
7
- declare const SVG: ({ source, style }: SVGComponentProps) => JSX.Element;
7
+ declare const SVG: React.FC<React.PropsWithChildren<SvgComponentProps>>;
8
8
  export default SVG;
@@ -31,7 +31,6 @@ export { ActionSheet, ActionSheetItem, ActionSheetCancel, } from "./components/A
31
31
  export { Swiper, SwiperItem } from "./components/Swiper";
32
32
  export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
33
33
  export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
34
- export { Table, TableRow, TablePaginator, TableHeader, TableCell, TableTitle, } from "./components/Table";
35
34
  export { default as Button } from "./components/DeprecatedButton";
36
35
  export { default as CardBlock } from "./components/CardBlock";
37
36
  export { default as CardContainer } from "./components/CardContainer";
@@ -2,11 +2,13 @@ export declare const SEED_DATA: {
2
2
  name: string;
3
3
  tag: string;
4
4
  description: string;
5
+ packageName: string;
5
6
  category: string;
6
7
  layout: {
7
8
  width: number;
8
9
  height: number;
9
10
  };
11
+ stylesPanelSections: string[];
10
12
  props: {
11
13
  source: {
12
14
  label: string;
@@ -1,8 +1,8 @@
1
1
  /// <reference types="lodash" />
2
- import { StyleProp } from "react-native";
2
+ import { StyleProp, TextStyle } from "react-native";
3
3
  export declare function extractStyles(style: StyleProp<any>): {
4
- viewStyles: Partial<any>;
5
- textStyles: import("lodash").Dictionary<any>;
4
+ viewStyles: any;
5
+ textStyles: TextStyle;
6
6
  };
7
7
  export declare const borderStyleNames: string[];
8
8
  export declare const marginStyleNames: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "46.2.4-44e731.5+44e731b9",
3
+ "version": "46.2.4-45ebda.5+45ebda32",
4
4
  "description": "Core (non-native) Components",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -41,7 +41,7 @@
41
41
  "dependencies": {
42
42
  "@date-io/date-fns": "^1.3.13",
43
43
  "@draftbit/react-theme-provider": "^2.1.1",
44
- "@draftbit/types": "^46.2.4",
44
+ "@draftbit/types": "^46.2.4-45ebda.5+45ebda32",
45
45
  "@material-ui/core": "^4.11.0",
46
46
  "@material-ui/pickers": "^3.2.10",
47
47
  "@react-native-community/slider": "4.2.3",
@@ -80,5 +80,5 @@
80
80
  ]
81
81
  ]
82
82
  },
83
- "gitHead": "44e731b9ecbbb4ab62b7d7a3235faeb8f7f6c854"
83
+ "gitHead": "45ebda32c08ebc8c510cf342de81c8a68f3a22dd"
84
84
  }
@@ -42,7 +42,7 @@ export default {
42
42
  cardIconElevation: 1,
43
43
  placeholderImageURL: "https://static.draftbit.com/images/placeholder-image" + getExtension(),
44
44
  getPlaceholderImageUrl: (size) => buildImageUrl({ width: size.width, height: size.height }, "image-placeholder_1"),
45
- placeholderSvgURL: "https://static.draftbit.com/images/placeholder-svg.svg",
45
+ placeholderSvgURL: "https://static.draftbit.com/images/placeholder-image.svg",
46
46
  squareImageUrl: buildImageUrl({ width: 100, height: 100 }, "Avatar"),
47
47
  FABSize: 40,
48
48
  FABBorderRadius: 20,
@@ -60,7 +60,7 @@ export default {
60
60
  { width: size.width, height: size.height },
61
61
  "image-placeholder_1"
62
62
  ),
63
- placeholderSvgURL: "https://static.draftbit.com/images/placeholder-svg.svg",
63
+ placeholderSvgURL: "https://static.draftbit.com/images/placeholder-image.svg",
64
64
  squareImageUrl: buildImageUrl({ width: 100, height: 100 }, "Avatar"),
65
65
  FABSize: 40,
66
66
  FABBorderRadius: 20,
@@ -2,13 +2,12 @@ import * as React from "react";
2
2
  import { View, Platform, Image } from "react-native";
3
3
  import { SvgUri } from "react-native-svg";
4
4
  import Config from "./Config";
5
- const SVG = ({ source, style }) => {
6
- let svgSource = source === null || source === undefined ? Config.placeholderSvgURL : source;
5
+ const SVG = ({ source = Config.placeholderSvgURL, style, }) => {
7
6
  return (React.createElement(React.Fragment, null,
8
7
  Platform.OS === "ios" && (React.createElement(View, { style: style },
9
- React.createElement(SvgUri, { width: "100%", height: "100%", uri: svgSource }))),
8
+ React.createElement(SvgUri, { width: "100%", height: "100%", uri: source }))),
10
9
  Platform.OS === "android" && (React.createElement(View, { style: style },
11
- React.createElement(SvgUri, { width: "100%", height: "100%", uri: svgSource }))),
12
- Platform.OS === "web" && (React.createElement(Image, { style: style, source: { uri: svgSource } }))));
10
+ React.createElement(SvgUri, { width: "100%", height: "100%", uri: source }))),
11
+ Platform.OS === "web" && (React.createElement(Image, { style: style, source: { uri: source } }))));
13
12
  };
14
13
  export default SVG;
@@ -4,29 +4,29 @@ import { SvgUri } from "react-native-svg";
4
4
 
5
5
  import Config from "./Config";
6
6
 
7
- type SVGComponentProps = {
7
+ type SvgComponentProps = {
8
8
  source: string;
9
9
  style?: StyleProp<ImageStyle>;
10
10
  };
11
11
 
12
- const SVG = ({ source, style }: SVGComponentProps) => {
13
- let svgSource =
14
- source === null || source === undefined ? Config.placeholderSvgURL : source;
15
-
12
+ const SVG: React.FC<React.PropsWithChildren<SvgComponentProps>> = ({
13
+ source = Config.placeholderSvgURL,
14
+ style,
15
+ }) => {
16
16
  return (
17
17
  <>
18
18
  {Platform.OS === "ios" && (
19
19
  <View style={style}>
20
- <SvgUri width="100%" height="100%" uri={svgSource} />
20
+ <SvgUri width="100%" height="100%" uri={source} />
21
21
  </View>
22
22
  )}
23
23
  {Platform.OS === "android" && (
24
24
  <View style={style}>
25
- <SvgUri width="100%" height="100%" uri={svgSource} />
25
+ <SvgUri width="100%" height="100%" uri={source} />
26
26
  </View>
27
27
  )}
28
28
  {Platform.OS === "web" && (
29
- <Image style={style} source={{ uri: svgSource }} />
29
+ <Image style={style} source={{ uri: source }} />
30
30
  )}
31
31
  </>
32
32
  );
package/src/index.js CHANGED
@@ -31,7 +31,6 @@ export { ActionSheet, ActionSheetItem, ActionSheetCancel, } from "./components/A
31
31
  export { Swiper, SwiperItem } from "./components/Swiper";
32
32
  export { Center, Circle, Square, Row, Stack, Spacer, } from "./components/Layout";
33
33
  export { RadioButton, RadioButtonGroup, RadioButtonRow, RadioButtonFieldGroup, } from "./components/RadioButton/index";
34
- export { Table, TableRow, TablePaginator, TableHeader, TableCell, TableTitle, } from "./components/Table";
35
34
  /* Deprecated: Fix or Delete! */
36
35
  export { default as Button } from "./components/DeprecatedButton";
37
36
  export { default as CardBlock } from "./components/CardBlock";
package/src/index.tsx CHANGED
@@ -51,15 +51,6 @@ export {
51
51
  RadioButtonFieldGroup,
52
52
  } from "./components/RadioButton/index";
53
53
 
54
- export {
55
- Table,
56
- TableRow,
57
- TablePaginator,
58
- TableHeader,
59
- TableCell,
60
- TableTitle,
61
- } from "./components/Table";
62
-
63
54
  /* Deprecated: Fix or Delete! */
64
55
  export { default as Button } from "./components/DeprecatedButton";
65
56
  export { default as CardBlock } from "./components/CardBlock";
@@ -0,0 +1,21 @@
1
+ import { COMPONENT_TYPES, createSvgProp, StylesPanelSections, } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "SVG",
4
+ tag: "SVG",
5
+ description: "An SVG component",
6
+ packageName: "@draftbit/core",
7
+ category: COMPONENT_TYPES.media,
8
+ layout: {
9
+ width: 100,
10
+ height: 100,
11
+ },
12
+ stylesPanelSections: [
13
+ StylesPanelSections.Size,
14
+ StylesPanelSections.Margins,
15
+ StylesPanelSections.Position,
16
+ StylesPanelSections.Effects,
17
+ ],
18
+ props: {
19
+ source: createSvgProp(),
20
+ },
21
+ };
@@ -0,0 +1,26 @@
1
+ import {
2
+ COMPONENT_TYPES,
3
+ createSvgProp,
4
+ StylesPanelSections,
5
+ } from "@draftbit/types";
6
+
7
+ export const SEED_DATA = {
8
+ name: "SVG",
9
+ tag: "SVG",
10
+ description: "An SVG component",
11
+ packageName: "@draftbit/core",
12
+ category: COMPONENT_TYPES.media,
13
+ layout: {
14
+ width: 100,
15
+ height: 100,
16
+ },
17
+ stylesPanelSections: [
18
+ StylesPanelSections.Size,
19
+ StylesPanelSections.Margins,
20
+ StylesPanelSections.Position,
21
+ StylesPanelSections.Effects,
22
+ ],
23
+ props: {
24
+ source: createSvgProp(),
25
+ },
26
+ };
package/src/utilities.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { StyleSheet } from "react-native";
2
- import { isString, isNumber, pick, pickBy, identity, omitBy, isNil, } from "lodash";
2
+ import { isString, isNumber, pick, pickBy, identity } from "lodash";
3
3
  export function extractStyles(style) {
4
4
  const { color, fontFamily, fontWeight, fontSize, lineHeight, letterSpacing, textTransform, textAlign, textDecorationLine, textDecorationColor, textDecorationStyle, ...viewStyles } = StyleSheet.flatten(style || {});
5
5
  const textStyles = {
@@ -15,10 +15,7 @@ export function extractStyles(style) {
15
15
  textDecorationColor,
16
16
  textDecorationStyle,
17
17
  };
18
- return {
19
- viewStyles: omitBy(viewStyles, isNil),
20
- textStyles: omitBy(textStyles, isNil),
21
- };
18
+ return { viewStyles, textStyles };
22
19
  }
23
20
  export const borderStyleNames = [
24
21
  "borderRadius",
package/src/utilities.ts CHANGED
@@ -1,13 +1,5 @@
1
1
  import { StyleSheet, StyleProp, TextStyle } from "react-native";
2
- import {
3
- isString,
4
- isNumber,
5
- pick,
6
- pickBy,
7
- identity,
8
- omitBy,
9
- isNil,
10
- } from "lodash";
2
+ import { isString, isNumber, pick, pickBy, identity } from "lodash";
11
3
 
12
4
  export function extractStyles(style: StyleProp<any>) {
13
5
  const {
@@ -39,10 +31,7 @@ export function extractStyles(style: StyleProp<any>) {
39
31
  textDecorationStyle,
40
32
  };
41
33
 
42
- return {
43
- viewStyles: omitBy(viewStyles, isNil),
44
- textStyles: omitBy(textStyles, isNil),
45
- };
34
+ return { viewStyles, textStyles };
46
35
  }
47
36
 
48
37
  export const borderStyleNames = [
@@ -1,55 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "Table", {
7
- enumerable: true,
8
- get: function () {
9
- return _table.default;
10
- }
11
- });
12
- Object.defineProperty(exports, "TableCell", {
13
- enumerable: true,
14
- get: function () {
15
- return _tableCell.default;
16
- }
17
- });
18
- Object.defineProperty(exports, "TableHeader", {
19
- enumerable: true,
20
- get: function () {
21
- return _tableHeader.default;
22
- }
23
- });
24
- Object.defineProperty(exports, "TablePaginator", {
25
- enumerable: true,
26
- get: function () {
27
- return _tablePaginator.default;
28
- }
29
- });
30
- Object.defineProperty(exports, "TableRow", {
31
- enumerable: true,
32
- get: function () {
33
- return _tableRow.default;
34
- }
35
- });
36
- Object.defineProperty(exports, "TableTitle", {
37
- enumerable: true,
38
- get: function () {
39
- return _tableTitle.default;
40
- }
41
- });
42
-
43
- var _table = _interopRequireDefault(require("./table"));
44
-
45
- var _tableHeader = _interopRequireDefault(require("./tableHeader"));
46
-
47
- var _tablePaginator = _interopRequireDefault(require("./tablePaginator"));
48
-
49
- var _tableRow = _interopRequireDefault(require("./tableRow"));
50
-
51
- var _tableCell = _interopRequireDefault(require("./tableCell"));
52
-
53
- var _tableTitle = _interopRequireDefault(require("./tableTitle"));
54
-
55
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -1,35 +0,0 @@
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
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
- function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
15
-
16
- const Table = _ref => {
17
- let {
18
- children,
19
- style,
20
- ...rest
21
- } = _ref;
22
- return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({}, rest, {
23
- style: [styles.wrapper, style]
24
- }), children);
25
- };
26
-
27
- const styles = _reactNative.StyleSheet.create({
28
- wrapper: {
29
- display: "flex",
30
- flexDirection: "column"
31
- }
32
- });
33
-
34
- var _default = Table;
35
- exports.default = _default;
@@ -1,50 +0,0 @@
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 ? Object.assign.bind() : 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 TableCell = _ref => {
19
- let {
20
- children,
21
- style,
22
- numeric,
23
- value,
24
- ...rest
25
- } = _ref;
26
- const {
27
- textStyles,
28
- viewStyles
29
- } = (0, _utilities.extractStyles)(style);
30
- return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({}, rest, {
31
- style: [styles.wrapper, numeric && styles.right, viewStyles]
32
- }), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
33
- numberOfLines: 1,
34
- style: textStyles
35
- }, children, value));
36
- };
37
-
38
- const styles = _reactNative.StyleSheet.create({
39
- wrapper: {
40
- flex: 1,
41
- display: "flex",
42
- flexDirection: "row"
43
- },
44
- right: {
45
- justifyContent: "flex-end"
46
- }
47
- });
48
-
49
- var _default = TableCell;
50
- exports.default = _default;