@draftbit/core 46.7.9-437259.2 → 46.7.9-57e94b.2

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/DeprecatedFAB.js +21 -3
  2. package/lib/commonjs/components/Divider.js +14 -1
  3. package/lib/commonjs/components/Picker/PickerComponent.android.js +20 -3
  4. package/lib/commonjs/components/Portal/PortalConsumer.js +22 -7
  5. package/lib/commonjs/index.js +0 -13
  6. package/lib/commonjs/mappings/DatePickerModal.js +151 -0
  7. package/lib/module/components/IconButton.js +4 -21
  8. package/lib/module/index.js +0 -1
  9. package/lib/module/mappings/DatePickerModal.js +145 -0
  10. package/lib/typescript/src/index.d.ts +0 -1
  11. package/lib/typescript/src/index.d.ts.map +1 -1
  12. package/lib/typescript/src/mappings/DatePickerModal.d.ts +241 -0
  13. package/lib/typescript/src/mappings/DatePickerModal.d.ts.map +1 -0
  14. package/package.json +4 -4
  15. package/src/index.js +0 -1
  16. package/src/index.tsx +0 -2
  17. package/src/mappings/DatePickerModal.js +152 -0
  18. package/src/mappings/DatePickerModal.ts +175 -0
  19. package/lib/commonjs/components/DeckSwiper/DeckSwiper.js +0 -73
  20. package/lib/commonjs/components/DeckSwiper/DeckSwiperCard.js +0 -35
  21. package/lib/commonjs/components/DeckSwiper/index.js +0 -20
  22. package/lib/commonjs/mappings/DeckSwiper.js +0 -52
  23. package/lib/commonjs/mappings/DeckSwiperCard.js +0 -16
  24. package/lib/module/components/DeckSwiper/DeckSwiper.js +0 -65
  25. package/lib/module/components/DeckSwiper/DeckSwiperCard.js +0 -27
  26. package/lib/module/components/DeckSwiper/index.js +0 -2
  27. package/lib/module/mappings/DeckSwiper.js +0 -45
  28. package/lib/module/mappings/DeckSwiperCard.js +0 -9
  29. package/lib/typescript/src/components/DeckSwiper/DeckSwiper.d.ts +0 -15
  30. package/lib/typescript/src/components/DeckSwiper/DeckSwiper.d.ts.map +0 -1
  31. package/lib/typescript/src/components/DeckSwiper/DeckSwiperCard.d.ts +0 -13
  32. package/lib/typescript/src/components/DeckSwiper/DeckSwiperCard.d.ts.map +0 -1
  33. package/lib/typescript/src/components/DeckSwiper/index.d.ts +0 -3
  34. package/lib/typescript/src/components/DeckSwiper/index.d.ts.map +0 -1
  35. package/lib/typescript/src/mappings/DeckSwiper.d.ts +0 -83
  36. package/lib/typescript/src/mappings/DeckSwiper.d.ts.map +0 -1
  37. package/lib/typescript/src/mappings/DeckSwiperCard.d.ts +0 -9
  38. package/lib/typescript/src/mappings/DeckSwiperCard.d.ts.map +0 -1
  39. package/src/components/DeckSwiper/DeckSwiper.js +0 -34
  40. package/src/components/DeckSwiper/DeckSwiper.tsx +0 -93
  41. package/src/components/DeckSwiper/DeckSwiperCard.js +0 -22
  42. package/src/components/DeckSwiper/DeckSwiperCard.tsx +0 -42
  43. package/src/components/DeckSwiper/index.js +0 -2
  44. package/src/components/DeckSwiper/index.tsx +0 -2
  45. package/src/mappings/DeckSwiper.js +0 -45
  46. package/src/mappings/DeckSwiper.ts +0 -54
  47. package/src/mappings/DeckSwiperCard.js +0 -9
  48. package/src/mappings/DeckSwiperCard.ts +0 -13
@@ -14,7 +14,6 @@ var _theming = require("../theming");
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
16
16
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
- 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); }
18
17
  const FAB = _ref => {
19
18
  let {
20
19
  Icon,
@@ -106,7 +105,8 @@ const FAB = _ref => {
106
105
  style: [{
107
106
  elevation
108
107
  }, style]
109
- }, /*#__PURE__*/React.createElement(_reactNative.Pressable, _extends({}, rest, {
108
+ }, /*#__PURE__*/React.createElement(_reactNative.Pressable, {
109
+ ...rest,
110
110
  onPress: onPress,
111
111
  accessibilityState: {
112
112
  disabled
@@ -114,7 +114,7 @@ const FAB = _ref => {
114
114
  accessibilityRole: "button",
115
115
  disabled: disabled || loading,
116
116
  style: buttonStyles
117
- }), /*#__PURE__*/React.createElement(_reactNative.View, {
117
+ }, /*#__PURE__*/React.createElement(_reactNative.View, {
118
118
  style: styles.content
119
119
  }, icon && loading !== true ? /*#__PURE__*/React.createElement(_reactNative.View, {
120
120
  style: iconStyle
@@ -154,4 +154,22 @@ const styles = _reactNative.StyleSheet.create({
154
154
  }
155
155
  });
156
156
  var _default = (0, _theming.withTheme)(FAB);
157
+ exports.default = _default;ow",
158
+ alignItems: "center",
159
+ justifyContent: "center"
160
+ },
161
+ icon: {
162
+ alignItems: "center",
163
+ justifyContent: "center",
164
+ width: _Config.default.buttonIconSize
165
+ },
166
+ fixed: {
167
+ left: 0,
168
+ right: 0,
169
+ bottom: 0,
170
+ height: 64,
171
+ borderRadius: 0
172
+ }
173
+ });
174
+ var _default = (0, _theming.withTheme)(FAB);
157
175
  exports.default = _default;
@@ -9,7 +9,6 @@ var _reactNative = require("react-native");
9
9
  var _theming = require("../theming");
10
10
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
11
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
12
- 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); }
13
12
  const Divider = _ref => {
14
13
  let {
15
14
  style,
@@ -19,6 +18,20 @@ const Divider = _ref => {
19
18
  },
20
19
  ...rest
21
20
  } = _ref;
21
+ return /*#__PURE__*/React.createElement(_reactNative.View, {
22
+ style: [{
23
+ backgroundColor: color || colors.divider,
24
+ height: _reactNative.StyleSheet.hairlineWidth
25
+ }, style],
26
+ ...rest
27
+ });
28
+ };
29
+ var _default = (0, _theming.withTheme)(Divider);
30
+ exports.default = _default;eme: {
31
+ colors
32
+ },
33
+ ...rest
34
+ } = _ref;
22
35
  return /*#__PURE__*/React.createElement(_reactNative.View, _extends({
23
36
  style: [{
24
37
  backgroundColor: color || colors.divider,
@@ -15,9 +15,7 @@ var _Touchable = _interopRequireDefault(require("../Touchable"));
15
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
16
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
17
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
18
- 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); }
19
18
  const Picker = _ref => {
20
- var _options$find$label, _options$find;
21
19
  let {
22
20
  style,
23
21
  options,
@@ -27,6 +25,7 @@ const Picker = _ref => {
27
25
  onValueChange: onValueChangeOverride = () => {},
28
26
  ...props
29
27
  } = _ref;
28
+ var _a, _b;
30
29
  const {
31
30
  viewStyles: {
32
31
  borderRadius,
@@ -71,7 +70,7 @@ const Picker = _ref => {
71
70
  };
72
71
 
73
72
  const stylesWithoutMargin = style && (0, _lodash.default)(_reactNative.StyleSheet.flatten(style), ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"]);
74
- const selectedLabel = selectedValue && ((_options$find$label = (_options$find = options.find(o => o.value === selectedValue)) === null || _options$find === void 0 ? void 0 : _options$find.label) !== null && _options$find$label !== void 0 ? _options$find$label : selectedValue);
73
+ const selectedLabel = selectedValue && ((_b = (_a = options.find(o => o.value === selectedValue)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : selectedValue);
75
74
  return /*#__PURE__*/React.createElement(_Touchable.default, {
76
75
  disabled: disabled,
77
76
  onPress: toggleFocus,
@@ -95,6 +94,24 @@ const Picker = _ref => {
95
94
  key: o.value
96
95
  }))), /*#__PURE__*/React.createElement(_reactNative.View, {
97
96
  pointerEvents: "none"
97
+ }, /*#__PURE__*/React.createElement(_TextField.default, {
98
+ ...props,
99
+ value: selectedLabel,
100
+ placeholder: placeholder,
101
+ // @ts-ignore
102
+ ref: textField,
103
+ disabled: disabled,
104
+ // @ts-expect-error
105
+ style: stylesWithoutMargin
106
+ }))));
107
+ };
108
+ const styles = _reactNative.StyleSheet.create({
109
+ container: {
110
+ alignSelf: "stretch"
111
+ }
112
+ });
113
+ var _default = (0, _theming.withTheme)(Picker);
114
+ exports.default = _default;pointerEvents: "none"
98
115
  }, /*#__PURE__*/React.createElement(_TextField.default, _extends({}, props, {
99
116
  value: selectedLabel,
100
117
  placeholder: placeholder
@@ -7,16 +7,31 @@ exports.default = void 0;
7
7
  var React = _interopRequireWildcard(require("react"));
8
8
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
9
9
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
10
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
12
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
13
10
  class PortalConsumer extends React.Component {
14
- constructor() {
15
- super(...arguments);
16
- _defineProperty(this, "key", void 0);
17
- }
18
11
  async componentDidMount() {
19
12
  this.checkManager();
13
+ // Delay updating to prevent React from going to infinite loop
14
+ await Promise.resolve();
15
+ this.key = this.props.manager.mount(this.props.children);
16
+ }
17
+ componentDidUpdate() {
18
+ this.checkManager();
19
+ this.props.manager.update(this.key, this.props.children);
20
+ }
21
+ componentWillUnmount() {
22
+ this.checkManager();
23
+ this.props.manager.unmount(this.key);
24
+ }
25
+ checkManager() {
26
+ if (!this.props.manager) {
27
+ throw new Error("Looks like you forgot to wrap your root component with `Provider` component from `react-native-paper`.\n\n" + "Please read our getting-started guide and make sure you've followed all the required steps.\n\n" + "https://callstack.github.io/react-native-paper/getting-started.html");
28
+ }
29
+ }
30
+ render() {
31
+ return null;
32
+ }
33
+ }
34
+ exports.default = PortalConsumer;s.checkManager();
20
35
 
21
36
  // Delay updating to prevent React from going to infinite loop
22
37
  await Promise.resolve();
@@ -123,18 +123,6 @@ Object.defineProperty(exports, "DatePicker", {
123
123
  return _DatePicker.default;
124
124
  }
125
125
  });
126
- Object.defineProperty(exports, "DeckSwiper", {
127
- enumerable: true,
128
- get: function () {
129
- return _DeckSwiper.DeckSwiper;
130
- }
131
- });
132
- Object.defineProperty(exports, "DeckSwiperCard", {
133
- enumerable: true,
134
- get: function () {
135
- return _DeckSwiper.DeckSwiperCard;
136
- }
137
- });
138
126
  Object.defineProperty(exports, "DefaultTheme", {
139
127
  enumerable: true,
140
128
  get: function () {
@@ -413,7 +401,6 @@ var _ActionSheet = require("./components/ActionSheet");
413
401
  var _Swiper = require("./components/Swiper");
414
402
  var _Layout = require("./components/Layout");
415
403
  var _index = require("./components/RadioButton/index");
416
- var _DeckSwiper = require("./components/DeckSwiper");
417
404
  var _DatePicker = _interopRequireDefault(require("./components/DatePicker/DatePicker"));
418
405
  var _Picker = _interopRequireDefault(require("./components/Picker/Picker"));
419
406
  var _ProgressBar = _interopRequireDefault(require("./components/ProgressBar"));
@@ -0,0 +1,151 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SEED_DATA = void 0;
7
+ var _types = require("@draftbit/types");
8
+ /**
9
+ * Maps react-native-paper-dates DatePickerModal in modes: "single" and "multiple"
10
+ * Cannot map mode "range" because it relies on 2 fieldNames (startDate and endDate)
11
+ */
12
+
13
+ const SHARED_SEED_DATA = {
14
+ tag: "DatePickerModal",
15
+ packageName: "react-native-paper-dates",
16
+ triggers: [_types.Triggers.OnDismiss, _types.Triggers.OnConfirm, _types.Triggers.OnChange],
17
+ category: _types.COMPONENT_TYPES.input,
18
+ StylesPanelSections: [_types.StylesPanelSections.Typography, _types.StylesPanelSections.Background, _types.StylesPanelSections.Size, _types.StylesPanelSections.MarginsAndPaddings, _types.StylesPanelSections.Position]
19
+ };
20
+ const SHARED_SEED_DATA_PROPS = {
21
+ onDismiss: (0, _types.createActionProp)({
22
+ label: "On Dismiss",
23
+ description: "Called when date picker dimissed",
24
+ required: true
25
+ }),
26
+ locale: (0, _types.createTextProp)({
27
+ label: "Locale",
28
+ description: "A locale can be composed of both a base language, the country (territory) of use, and possibly codeset (which is usually assumed). For example, German is de",
29
+ defaultValue: "en",
30
+ required: true,
31
+ group: _types.GROUPS.basic
32
+ }),
33
+ visible: (0, _types.createBoolProp)({
34
+ label: "Visible",
35
+ description: "Flag indicating if the component should be displayed",
36
+ required: true
37
+ }),
38
+ label: (0, _types.createTextProp)({
39
+ label: "Label",
40
+ description: "The label used as the header in the component",
41
+ defaultValue: "Select date",
42
+ group: _types.GROUPS.basic
43
+ }),
44
+ saveLabel: (0, _types.createTextProp)({
45
+ label: "Save Label",
46
+ description: "Label used to confirm a date selection",
47
+ defaultValue: "Save",
48
+ group: _types.GROUPS.basic
49
+ }),
50
+ saveLabelDisabled: (0, _types.createStaticBoolProp)({
51
+ label: "Disable Save Label",
52
+ description: "Flag indicating if the save label should be disabled and unable to receive events"
53
+ }),
54
+ uppercase: (0, _types.createStaticBoolProp)({
55
+ label: "Uppercase",
56
+ description: "Flag indicating if the text in the component should be uppercase",
57
+ defaultValue: true
58
+ }),
59
+ startYear: (0, _types.createStaticNumberProp)({
60
+ label: "Start Year",
61
+ description: "The start year when the component is rendered",
62
+ required: false,
63
+ defaultValue: 1800
64
+ }),
65
+ endYear: (0, _types.createStaticNumberProp)({
66
+ label: "End Year",
67
+ description: "The end year when the component is rendered",
68
+ required: false,
69
+ defaultValue: 2200
70
+ })
71
+ };
72
+ const SEED_DATA = [{
73
+ ...SHARED_SEED_DATA,
74
+ name: "Date Picker Modal",
75
+ description: "Date Picker modal for date selection",
76
+ props: {
77
+ ...SHARED_SEED_DATA_PROPS,
78
+ onConfirm: (0, _types.createActionProp)({
79
+ label: "On Confirm",
80
+ description: "Called when date selected and confirmed",
81
+ required: true
82
+ }),
83
+ onChange: (0, _types.createActionProp)({
84
+ label: "On Change",
85
+ description: "Called when date selection changes"
86
+ }),
87
+ mode: (0, _types.createTextEnumProp)({
88
+ label: "Mode",
89
+ description: "The selection mode of the date picker",
90
+ required: true,
91
+ options: ["single"],
92
+ editable: false,
93
+ defaultValue: "single",
94
+ formType: _types.FORM_TYPES.flatArray
95
+ }),
96
+ fieldName: (0, _types.createFieldNameProp)({
97
+ defaultValue: "date",
98
+ handlerPropName: "onConfirm",
99
+ valuePropName: "date"
100
+ })
101
+ }
102
+ }, {
103
+ ...SHARED_SEED_DATA,
104
+ name: "Multiple Date Picker Modal",
105
+ description: "Date Picker modal for multiple date selection",
106
+ props: {
107
+ ...SHARED_SEED_DATA_PROPS,
108
+ onConfirm: (0, _types.createActionProp)({
109
+ label: "On Confirm",
110
+ description: "Called when dates selected and confirmed",
111
+ required: true
112
+ }),
113
+ onChange: (0, _types.createActionProp)({
114
+ label: "On Change",
115
+ description: "Called when dates selection changes"
116
+ }),
117
+ mode: (0, _types.createTextEnumProp)({
118
+ label: "Mode",
119
+ description: "The selection mode of the date picker",
120
+ required: true,
121
+ options: ["multiple"],
122
+ editable: false,
123
+ defaultValue: "multiple",
124
+ formType: _types.FORM_TYPES.flatArray
125
+ }),
126
+ moreLabel: (0, _types.createTextProp)({
127
+ label: "More Label",
128
+ description: "The label used display when multiple dates have been selected in the component",
129
+ defaultValue: "More",
130
+ group: _types.GROUPS.basic
131
+ }),
132
+ startLabel: (0, _types.createTextProp)({
133
+ label: "Start Label",
134
+ description: "The label used as the prefix to the starting date in the component",
135
+ defaultValue: "Start",
136
+ group: _types.GROUPS.basic
137
+ }),
138
+ endLabel: (0, _types.createTextProp)({
139
+ label: "End Label",
140
+ description: "The label used as the suffix to the ending date in the component",
141
+ defaultValue: "End",
142
+ group: _types.GROUPS.basic
143
+ }),
144
+ fieldName: (0, _types.createFieldNameProp)({
145
+ defaultValue: "dates",
146
+ handlerPropName: "onConfirm",
147
+ valuePropName: "dates"
148
+ })
149
+ }
150
+ }];
151
+ exports.SEED_DATA = SEED_DATA;
@@ -1,3 +1,4 @@
1
+ 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); }
1
2
  import * as React from "react";
2
3
  import { View, StyleSheet, ActivityIndicator, Pressable, Platform } from "react-native";
3
4
  import { withTheme } from "../theming";
@@ -17,7 +18,7 @@ const IconButton = _ref => {
17
18
  ...props
18
19
  } = _ref;
19
20
  const iconColor = customColor || theme.colors.primary;
20
- return /*#__PURE__*/React.createElement(Pressable, {
21
+ return /*#__PURE__*/React.createElement(Pressable, _extends({
21
22
  onPress: onPress,
22
23
  disabled: disabled || loading,
23
24
  style: _ref2 => {
@@ -31,9 +32,8 @@ const IconButton = _ref => {
31
32
  alignItems: "center",
32
33
  justifyContent: "center"
33
34
  }, style];
34
- },
35
- ...props
36
- }, /*#__PURE__*/React.createElement(View, null, icon && !loading ? /*#__PURE__*/React.createElement(Icon, {
35
+ }
36
+ }, props), /*#__PURE__*/React.createElement(View, null, icon && !loading ? /*#__PURE__*/React.createElement(Icon, {
37
37
  name: icon,
38
38
  size: size - 2,
39
39
  color: iconColor
@@ -54,21 +54,4 @@ const styles = StyleSheet.create({
54
54
  })
55
55
  }
56
56
  });
57
- export default withTheme(IconButton);ement(ActivityIndicator, {
58
- size: "small",
59
- color: iconColor
60
- }) : null));
61
- };
62
- const styles = StyleSheet.create({
63
- container: {
64
- alignItems: "center",
65
- justifyContent: "center",
66
- ...Platform.select({
67
- web: {
68
- cursor: "pointer",
69
- userSelect: "none"
70
- }
71
- })
72
- }
73
- });
74
57
  export default withTheme(IconButton);
@@ -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 { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
35
34
 
36
35
  /* Deprecated: Fix or Delete! */
37
36
  export { default as DatePicker } from "./components/DatePicker/DatePicker";
@@ -0,0 +1,145 @@
1
+ import { COMPONENT_TYPES, FORM_TYPES, Triggers, StylesPanelSections, createBoolProp, createTextProp, createTextEnumProp, createStaticBoolProp, createStaticNumberProp, createFieldNameProp, createActionProp, GROUPS } from "@draftbit/types";
2
+
3
+ /**
4
+ * Maps react-native-paper-dates DatePickerModal in modes: "single" and "multiple"
5
+ * Cannot map mode "range" because it relies on 2 fieldNames (startDate and endDate)
6
+ */
7
+
8
+ const SHARED_SEED_DATA = {
9
+ tag: "DatePickerModal",
10
+ packageName: "react-native-paper-dates",
11
+ triggers: [Triggers.OnDismiss, Triggers.OnConfirm, Triggers.OnChange],
12
+ category: COMPONENT_TYPES.input,
13
+ StylesPanelSections: [StylesPanelSections.Typography, StylesPanelSections.Background, StylesPanelSections.Size, StylesPanelSections.MarginsAndPaddings, StylesPanelSections.Position]
14
+ };
15
+ const SHARED_SEED_DATA_PROPS = {
16
+ onDismiss: createActionProp({
17
+ label: "On Dismiss",
18
+ description: "Called when date picker dimissed",
19
+ required: true
20
+ }),
21
+ locale: createTextProp({
22
+ label: "Locale",
23
+ description: "A locale can be composed of both a base language, the country (territory) of use, and possibly codeset (which is usually assumed). For example, German is de",
24
+ defaultValue: "en",
25
+ required: true,
26
+ group: GROUPS.basic
27
+ }),
28
+ visible: createBoolProp({
29
+ label: "Visible",
30
+ description: "Flag indicating if the component should be displayed",
31
+ required: true
32
+ }),
33
+ label: createTextProp({
34
+ label: "Label",
35
+ description: "The label used as the header in the component",
36
+ defaultValue: "Select date",
37
+ group: GROUPS.basic
38
+ }),
39
+ saveLabel: createTextProp({
40
+ label: "Save Label",
41
+ description: "Label used to confirm a date selection",
42
+ defaultValue: "Save",
43
+ group: GROUPS.basic
44
+ }),
45
+ saveLabelDisabled: createStaticBoolProp({
46
+ label: "Disable Save Label",
47
+ description: "Flag indicating if the save label should be disabled and unable to receive events"
48
+ }),
49
+ uppercase: createStaticBoolProp({
50
+ label: "Uppercase",
51
+ description: "Flag indicating if the text in the component should be uppercase",
52
+ defaultValue: true
53
+ }),
54
+ startYear: createStaticNumberProp({
55
+ label: "Start Year",
56
+ description: "The start year when the component is rendered",
57
+ required: false,
58
+ defaultValue: 1800
59
+ }),
60
+ endYear: createStaticNumberProp({
61
+ label: "End Year",
62
+ description: "The end year when the component is rendered",
63
+ required: false,
64
+ defaultValue: 2200
65
+ })
66
+ };
67
+ export const SEED_DATA = [{
68
+ ...SHARED_SEED_DATA,
69
+ name: "Date Picker Modal",
70
+ description: "Date Picker modal for date selection",
71
+ props: {
72
+ ...SHARED_SEED_DATA_PROPS,
73
+ onConfirm: createActionProp({
74
+ label: "On Confirm",
75
+ description: "Called when date selected and confirmed",
76
+ required: true
77
+ }),
78
+ onChange: createActionProp({
79
+ label: "On Change",
80
+ description: "Called when date selection changes"
81
+ }),
82
+ mode: createTextEnumProp({
83
+ label: "Mode",
84
+ description: "The selection mode of the date picker",
85
+ required: true,
86
+ options: ["single"],
87
+ editable: false,
88
+ defaultValue: "single",
89
+ formType: FORM_TYPES.flatArray
90
+ }),
91
+ fieldName: createFieldNameProp({
92
+ defaultValue: "date",
93
+ handlerPropName: "onConfirm",
94
+ valuePropName: "date"
95
+ })
96
+ }
97
+ }, {
98
+ ...SHARED_SEED_DATA,
99
+ name: "Multiple Date Picker Modal",
100
+ description: "Date Picker modal for multiple date selection",
101
+ props: {
102
+ ...SHARED_SEED_DATA_PROPS,
103
+ onConfirm: createActionProp({
104
+ label: "On Confirm",
105
+ description: "Called when dates selected and confirmed",
106
+ required: true
107
+ }),
108
+ onChange: createActionProp({
109
+ label: "On Change",
110
+ description: "Called when dates selection changes"
111
+ }),
112
+ mode: createTextEnumProp({
113
+ label: "Mode",
114
+ description: "The selection mode of the date picker",
115
+ required: true,
116
+ options: ["multiple"],
117
+ editable: false,
118
+ defaultValue: "multiple",
119
+ formType: FORM_TYPES.flatArray
120
+ }),
121
+ moreLabel: createTextProp({
122
+ label: "More Label",
123
+ description: "The label used display when multiple dates have been selected in the component",
124
+ defaultValue: "More",
125
+ group: GROUPS.basic
126
+ }),
127
+ startLabel: createTextProp({
128
+ label: "Start Label",
129
+ description: "The label used as the prefix to the starting date in the component",
130
+ defaultValue: "Start",
131
+ group: GROUPS.basic
132
+ }),
133
+ endLabel: createTextProp({
134
+ label: "End Label",
135
+ description: "The label used as the suffix to the ending date in the component",
136
+ defaultValue: "End",
137
+ group: GROUPS.basic
138
+ }),
139
+ fieldName: createFieldNameProp({
140
+ defaultValue: "dates",
141
+ handlerPropName: "onConfirm",
142
+ valuePropName: "dates"
143
+ })
144
+ }
145
+ }];
@@ -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 { DeckSwiper, DeckSwiperCard } from "./components/DeckSwiper";
35
34
  export { default as DatePicker } from "./components/DatePicker/DatePicker";
36
35
  export { default as Picker } from "./components/Picker/Picker";
37
36
  export { default as ProgressBar } from "./components/ProgressBar";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,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