@draftbit/core 46.7.9-9ade8f.2 → 46.7.9-b47217.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 (36) hide show
  1. package/lib/commonjs/components/DatePicker/DatePicker.js +0 -6
  2. package/lib/commonjs/components/DeprecatedFAB.js +21 -3
  3. package/lib/commonjs/components/Elevation.js +2 -14
  4. package/lib/commonjs/components/Picker/Picker.js +1 -7
  5. package/lib/commonjs/mappings/DatePicker.js +1 -6
  6. package/lib/commonjs/mappings/DatePickerModal.js +145 -0
  7. package/lib/commonjs/mappings/Picker.js +0 -5
  8. package/lib/commonjs/styles/overlay.js +1 -3
  9. package/lib/module/components/AnimatedCircularProgress.js +1 -13
  10. package/lib/module/components/DatePicker/DatePicker.js +1 -7
  11. package/lib/module/components/Picker/Picker.js +2 -8
  12. package/lib/module/constants.js +0 -1
  13. package/lib/module/mappings/DatePicker.js +2 -7
  14. package/lib/module/mappings/DatePickerModal.js +139 -0
  15. package/lib/module/mappings/Picker.js +1 -6
  16. package/lib/typescript/src/components/DatePicker/DatePicker.d.ts +0 -1
  17. package/lib/typescript/src/components/DatePicker/DatePicker.d.ts.map +1 -1
  18. package/lib/typescript/src/components/Picker/Picker.d.ts +0 -1
  19. package/lib/typescript/src/components/Picker/Picker.d.ts.map +1 -1
  20. package/lib/typescript/src/mappings/DatePicker.d.ts +0 -10
  21. package/lib/typescript/src/mappings/DatePicker.d.ts.map +1 -1
  22. package/lib/typescript/src/mappings/DatePickerModal.d.ts +241 -0
  23. package/lib/typescript/src/mappings/DatePickerModal.d.ts.map +1 -0
  24. package/lib/typescript/src/mappings/Picker.d.ts +0 -10
  25. package/lib/typescript/src/mappings/Picker.d.ts.map +1 -1
  26. package/package.json +3 -3
  27. package/src/components/DatePicker/DatePicker.js +2 -7
  28. package/src/components/DatePicker/DatePicker.tsx +0 -9
  29. package/src/components/Picker/Picker.js +2 -7
  30. package/src/components/Picker/Picker.tsx +1 -9
  31. package/src/mappings/DatePicker.js +1 -6
  32. package/src/mappings/DatePicker.ts +0 -6
  33. package/src/mappings/DatePickerModal.js +146 -0
  34. package/src/mappings/DatePickerModal.ts +168 -0
  35. package/src/mappings/Picker.js +1 -6
  36. package/src/mappings/Picker.ts +0 -6
@@ -0,0 +1,168 @@
1
+ import {
2
+ COMPONENT_TYPES,
3
+ FORM_TYPES,
4
+ Triggers,
5
+ StylesPanelSections,
6
+ createBoolProp,
7
+ createTextProp,
8
+ createTextEnumProp,
9
+ createStaticBoolProp,
10
+ createStaticNumberProp,
11
+ createFieldNameProp,
12
+ createActionProp,
13
+ } from "@draftbit/types";
14
+
15
+ /**
16
+ * Maps react-native-paper-dates DatePickerModal in modes: "single" and "multiple"
17
+ * Cannot map mode "range" because it relies on 2 fieldNames (startDate and endDate)
18
+ */
19
+
20
+ const SHARED_SEED_DATA = {
21
+ tag: "DatePickerModal",
22
+ packageName: "react-native-paper-dates",
23
+ triggers: [Triggers.OnDismiss, Triggers.OnConfirm, Triggers.OnChange],
24
+ category: COMPONENT_TYPES.input,
25
+ StylesPanelSections: [
26
+ StylesPanelSections.Typography,
27
+ StylesPanelSections.Background,
28
+ StylesPanelSections.Size,
29
+ StylesPanelSections.MarginsAndPaddings,
30
+ StylesPanelSections.Position,
31
+ ],
32
+ };
33
+
34
+ const SHARED_SEED_DATA_PROPS = {
35
+ onDismiss: createActionProp({
36
+ label: "On Dismiss",
37
+ description: "Called when date picker dimissed",
38
+ required: true,
39
+ }),
40
+ locale: createTextProp({
41
+ label: "Locale",
42
+ description:
43
+ "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",
44
+ defaultValue: "en",
45
+ required: true,
46
+ }),
47
+ visible: createBoolProp({
48
+ label: "Visible",
49
+ description: "Flag indicating if the component should be displayed",
50
+ required: true,
51
+ }),
52
+ label: createTextProp({
53
+ label: "Label",
54
+ description: "The label used as the header in the component",
55
+ defaultValue: "Select date",
56
+ }),
57
+ saveLabel: createTextProp({
58
+ label: "Save Label",
59
+ description: "Label used to confirm a date selection",
60
+ defaultValue: "Save",
61
+ }),
62
+ saveLabelDisabled: createStaticBoolProp({
63
+ label: "Disable Save Label",
64
+ description:
65
+ "Flag indicating if the save label should be disabled and unable to receive events",
66
+ }),
67
+ uppercase: createStaticBoolProp({
68
+ label: "Uppercase",
69
+ description:
70
+ "Flag indicating if the text in the component should be uppercase",
71
+ defaultValue: true,
72
+ }),
73
+ startYear: createStaticNumberProp({
74
+ label: "Start Year",
75
+ description: "The start year when the component is rendered",
76
+ required: false,
77
+ defaultValue: 1800,
78
+ }),
79
+ endYear: createStaticNumberProp({
80
+ label: "End Year",
81
+ description: "The end year when the component is rendered",
82
+ required: false,
83
+ defaultValue: 2200,
84
+ }),
85
+ };
86
+
87
+ export const SEED_DATA = [
88
+ {
89
+ ...SHARED_SEED_DATA,
90
+ name: "Date Picker Modal",
91
+ description: "Date Picker modal for date selection",
92
+ props: {
93
+ ...SHARED_SEED_DATA_PROPS,
94
+ onConfirm: createActionProp({
95
+ label: "On Confirm",
96
+ description: "Called when date selected and confirmed",
97
+ required: true,
98
+ }),
99
+ onChange: createActionProp({
100
+ label: "On Change",
101
+ description: "Called when date selection changes",
102
+ }),
103
+ mode: createTextEnumProp({
104
+ label: "Mode",
105
+ description: "The selection mode of the date picker",
106
+ required: true,
107
+ options: ["single"],
108
+ editable: false,
109
+ defaultValue: "single",
110
+ formType: FORM_TYPES.flatArray,
111
+ }),
112
+ fieldName: createFieldNameProp({
113
+ defaultValue: "date",
114
+ handlerPropName: "onConfirm",
115
+ valuePropName: "date",
116
+ }),
117
+ },
118
+ },
119
+ {
120
+ ...SHARED_SEED_DATA,
121
+ name: "Multiple Date Picker Modal",
122
+ description: "Date Picker modal for multiple date selection",
123
+ props: {
124
+ ...SHARED_SEED_DATA_PROPS,
125
+ onConfirm: createActionProp({
126
+ label: "On Confirm",
127
+ description: "Called when dates selected and confirmed",
128
+ required: true,
129
+ }),
130
+ onChange: createActionProp({
131
+ label: "On Change",
132
+ description: "Called when dates selection changes",
133
+ }),
134
+ mode: createTextEnumProp({
135
+ label: "Mode",
136
+ description: "The selection mode of the date picker",
137
+ required: true,
138
+ options: ["multiple"],
139
+ editable: false,
140
+ defaultValue: "multiple",
141
+ formType: FORM_TYPES.flatArray,
142
+ }),
143
+ moreLabel: createTextProp({
144
+ label: "More Label",
145
+ description:
146
+ "The label used display when multiple dates have been selected in the component",
147
+ defaultValue: "More",
148
+ }),
149
+ startLabel: createTextProp({
150
+ label: "Start Label",
151
+ description:
152
+ "The label used as the prefix to the starting date in the component",
153
+ defaultValue: "Start",
154
+ }),
155
+ endLabel: createTextProp({
156
+ label: "End Label",
157
+ description:
158
+ "The label used as the suffix to the ending date in the component",
159
+ defaultValue: "End",
160
+ }),
161
+ fieldName: createFieldNameProp({
162
+ defaultValue: "dates",
163
+ handlerPropName: "onConfirm",
164
+ valuePropName: "dates",
165
+ }),
166
+ },
167
+ },
168
+ ];
@@ -1,4 +1,4 @@
1
- import { COMPONENT_TYPES, Triggers, GROUPS, FORM_TYPES, PROP_TYPES, FIELD_NAME, createIconSizeProp, createColorProp, StylesPanelSections, createStaticBoolProp, } from "@draftbit/types";
1
+ import { COMPONENT_TYPES, Triggers, GROUPS, FORM_TYPES, PROP_TYPES, FIELD_NAME, createIconSizeProp, createColorProp, StylesPanelSections, } from "@draftbit/types";
2
2
  const SEED_DATA_PROPS = {
3
3
  label: {
4
4
  group: GROUPS.data,
@@ -142,11 +142,6 @@ export const SEED_DATA = [
142
142
  },
143
143
  iconSize: createIconSizeProp({ defaultValue: 24 }),
144
144
  iconColor: createColorProp({ label: "Icon Color" }),
145
- autoDismissKeyboard: createStaticBoolProp({
146
- label: "Auto dismiss keyboard",
147
- description: "Automatically dismiss keyboard when Picker is opened",
148
- defaultValue: true,
149
- }),
150
145
  },
151
146
  layout: {},
152
147
  },
@@ -8,7 +8,6 @@ import {
8
8
  createIconSizeProp,
9
9
  createColorProp,
10
10
  StylesPanelSections,
11
- createStaticBoolProp,
12
11
  } from "@draftbit/types";
13
12
 
14
13
  const SEED_DATA_PROPS = {
@@ -158,11 +157,6 @@ export const SEED_DATA = [
158
157
  },
159
158
  iconSize: createIconSizeProp({ defaultValue: 24 }),
160
159
  iconColor: createColorProp({ label: "Icon Color" }),
161
- autoDismissKeyboard: createStaticBoolProp({
162
- label: "Auto dismiss keyboard",
163
- description: "Automatically dismiss keyboard when Picker is opened",
164
- defaultValue: true,
165
- }),
166
160
  },
167
161
  layout: {},
168
162
  },