@draftbit/core 46.7.9-b47217.2 → 46.7.9-cd34f6.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.
- package/lib/commonjs/components/DeprecatedFAB.js +3 -21
- package/lib/commonjs/components/Elevation.js +14 -2
- package/lib/commonjs/mappings/Accordion.js +1 -0
- package/lib/commonjs/mappings/AccordionItem.js +1 -0
- package/lib/commonjs/mappings/ActionSheet.js +1 -0
- package/lib/commonjs/mappings/ActionSheetCancel.js +1 -0
- package/lib/commonjs/mappings/ActionSheetItem.js +1 -0
- package/lib/commonjs/mappings/LinearGradient.js +1 -0
- package/lib/commonjs/mappings/MapCallout.js +1 -0
- package/lib/commonjs/mappings/MapMarker.js +1 -0
- package/lib/commonjs/mappings/MapView.js +1 -0
- package/lib/commonjs/mappings/Swiper.js +1 -0
- package/lib/commonjs/mappings/SwiperItem.js +2 -1
- package/lib/commonjs/mappings/TextArea.js +1 -0
- package/lib/commonjs/mappings/TextField.js +1 -0
- package/lib/commonjs/styles/overlay.js +3 -1
- package/lib/module/mappings/Accordion.js +2 -1
- package/lib/module/mappings/AccordionItem.js +2 -1
- package/lib/module/mappings/ActionSheet.js +2 -1
- package/lib/module/mappings/ActionSheetCancel.js +2 -1
- package/lib/module/mappings/ActionSheetItem.js +2 -1
- package/lib/module/mappings/LinearGradient.js +2 -1
- package/lib/module/mappings/MapCallout.js +2 -1
- package/lib/module/mappings/MapMarker.js +2 -1
- package/lib/module/mappings/MapView.js +2 -1
- package/lib/module/mappings/Swiper.js +2 -1
- package/lib/module/mappings/SwiperItem.js +3 -2
- package/lib/module/mappings/TextArea.js +2 -1
- package/lib/module/mappings/TextField.js +1 -0
- package/lib/typescript/src/mappings/Accordion.d.ts +1 -0
- package/lib/typescript/src/mappings/Accordion.d.ts.map +1 -1
- package/lib/typescript/src/mappings/AccordionItem.d.ts +1 -0
- package/lib/typescript/src/mappings/AccordionItem.d.ts.map +1 -1
- package/lib/typescript/src/mappings/ActionSheet.d.ts +1 -0
- package/lib/typescript/src/mappings/ActionSheet.d.ts.map +1 -1
- package/lib/typescript/src/mappings/ActionSheetCancel.d.ts +1 -0
- package/lib/typescript/src/mappings/ActionSheetCancel.d.ts.map +1 -1
- package/lib/typescript/src/mappings/ActionSheetItem.d.ts +1 -0
- package/lib/typescript/src/mappings/ActionSheetItem.d.ts.map +1 -1
- package/lib/typescript/src/mappings/LinearGradient.d.ts +1 -0
- package/lib/typescript/src/mappings/LinearGradient.d.ts.map +1 -1
- package/lib/typescript/src/mappings/MapCallout.d.ts +1 -0
- package/lib/typescript/src/mappings/MapCallout.d.ts.map +1 -1
- package/lib/typescript/src/mappings/MapMarker.d.ts +1 -0
- package/lib/typescript/src/mappings/MapMarker.d.ts.map +1 -1
- package/lib/typescript/src/mappings/MapView.d.ts +1 -0
- package/lib/typescript/src/mappings/MapView.d.ts.map +1 -1
- package/lib/typescript/src/mappings/Swiper.d.ts +1 -0
- package/lib/typescript/src/mappings/Swiper.d.ts.map +1 -1
- package/lib/typescript/src/mappings/SwiperItem.d.ts +1 -0
- package/lib/typescript/src/mappings/SwiperItem.d.ts.map +1 -1
- package/lib/typescript/src/mappings/TextArea.d.ts +1 -0
- package/lib/typescript/src/mappings/TextArea.d.ts.map +1 -1
- package/lib/typescript/src/mappings/TextField.d.ts +1 -1
- package/lib/typescript/src/mappings/TextField.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/mappings/Accordion.js +10 -1
- package/src/mappings/Accordion.ts +10 -0
- package/src/mappings/AccordionItem.js +2 -1
- package/src/mappings/AccordionItem.ts +2 -0
- package/src/mappings/ActionSheet.js +2 -1
- package/src/mappings/ActionSheet.ts +7 -1
- package/src/mappings/ActionSheetCancel.js +2 -1
- package/src/mappings/ActionSheetCancel.ts +2 -0
- package/src/mappings/ActionSheetItem.js +2 -1
- package/src/mappings/ActionSheetItem.ts +2 -0
- package/src/mappings/LinearGradient.js +6 -1
- package/src/mappings/LinearGradient.ts +6 -0
- package/src/mappings/MapCallout.js +2 -1
- package/src/mappings/MapCallout.ts +2 -0
- package/src/mappings/MapMarker.js +2 -1
- package/src/mappings/MapMarker.ts +2 -0
- package/src/mappings/MapView.js +2 -1
- package/src/mappings/MapView.ts +2 -0
- package/src/mappings/Swiper.js +10 -1
- package/src/mappings/Swiper.ts +10 -0
- package/src/mappings/SwiperItem.js +2 -1
- package/src/mappings/SwiperItem.ts +5 -1
- package/src/mappings/TextArea.js +10 -1
- package/src/mappings/TextArea.ts +10 -0
- package/src/mappings/TextField.js +9 -0
- package/src/mappings/TextField.ts +9 -0
- package/lib/commonjs/mappings/DatePickerModal.js +0 -145
- package/lib/module/mappings/DatePickerModal.js +0 -139
- package/lib/typescript/src/mappings/DatePickerModal.d.ts +0 -241
- package/lib/typescript/src/mappings/DatePickerModal.d.ts.map +0 -1
- package/src/mappings/DatePickerModal.js +0 -146
- package/src/mappings/DatePickerModal.ts +0 -168
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, FORM_TYPES, Triggers, StylesPanelSections, createBoolProp, createTextProp, createTextEnumProp, createStaticBoolProp, createStaticNumberProp, createFieldNameProp, createActionProp } 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
|
-
}),
|
|
27
|
-
visible: createBoolProp({
|
|
28
|
-
label: "Visible",
|
|
29
|
-
description: "Flag indicating if the component should be displayed",
|
|
30
|
-
required: true
|
|
31
|
-
}),
|
|
32
|
-
label: createTextProp({
|
|
33
|
-
label: "Label",
|
|
34
|
-
description: "The label used as the header in the component",
|
|
35
|
-
defaultValue: "Select date"
|
|
36
|
-
}),
|
|
37
|
-
saveLabel: createTextProp({
|
|
38
|
-
label: "Save Label",
|
|
39
|
-
description: "Label used to confirm a date selection",
|
|
40
|
-
defaultValue: "Save"
|
|
41
|
-
}),
|
|
42
|
-
saveLabelDisabled: createStaticBoolProp({
|
|
43
|
-
label: "Disable Save Label",
|
|
44
|
-
description: "Flag indicating if the save label should be disabled and unable to receive events"
|
|
45
|
-
}),
|
|
46
|
-
uppercase: createStaticBoolProp({
|
|
47
|
-
label: "Uppercase",
|
|
48
|
-
description: "Flag indicating if the text in the component should be uppercase",
|
|
49
|
-
defaultValue: true
|
|
50
|
-
}),
|
|
51
|
-
startYear: createStaticNumberProp({
|
|
52
|
-
label: "Start Year",
|
|
53
|
-
description: "The start year when the component is rendered",
|
|
54
|
-
required: false,
|
|
55
|
-
defaultValue: 1800
|
|
56
|
-
}),
|
|
57
|
-
endYear: createStaticNumberProp({
|
|
58
|
-
label: "End Year",
|
|
59
|
-
description: "The end year when the component is rendered",
|
|
60
|
-
required: false,
|
|
61
|
-
defaultValue: 2200
|
|
62
|
-
})
|
|
63
|
-
};
|
|
64
|
-
export const SEED_DATA = [{
|
|
65
|
-
...SHARED_SEED_DATA,
|
|
66
|
-
name: "Date Picker Modal",
|
|
67
|
-
description: "Date Picker modal for date selection",
|
|
68
|
-
props: {
|
|
69
|
-
...SHARED_SEED_DATA_PROPS,
|
|
70
|
-
onConfirm: createActionProp({
|
|
71
|
-
label: "On Confirm",
|
|
72
|
-
description: "Called when date selected and confirmed",
|
|
73
|
-
required: true
|
|
74
|
-
}),
|
|
75
|
-
onChange: createActionProp({
|
|
76
|
-
label: "On Change",
|
|
77
|
-
description: "Called when date selection changes"
|
|
78
|
-
}),
|
|
79
|
-
mode: createTextEnumProp({
|
|
80
|
-
label: "Mode",
|
|
81
|
-
description: "The selection mode of the date picker",
|
|
82
|
-
required: true,
|
|
83
|
-
options: ["single"],
|
|
84
|
-
editable: false,
|
|
85
|
-
defaultValue: "single",
|
|
86
|
-
formType: FORM_TYPES.flatArray
|
|
87
|
-
}),
|
|
88
|
-
fieldName: createFieldNameProp({
|
|
89
|
-
defaultValue: "date",
|
|
90
|
-
handlerPropName: "onConfirm",
|
|
91
|
-
valuePropName: "date"
|
|
92
|
-
})
|
|
93
|
-
}
|
|
94
|
-
}, {
|
|
95
|
-
...SHARED_SEED_DATA,
|
|
96
|
-
name: "Multiple Date Picker Modal",
|
|
97
|
-
description: "Date Picker modal for multiple date selection",
|
|
98
|
-
props: {
|
|
99
|
-
...SHARED_SEED_DATA_PROPS,
|
|
100
|
-
onConfirm: createActionProp({
|
|
101
|
-
label: "On Confirm",
|
|
102
|
-
description: "Called when dates selected and confirmed",
|
|
103
|
-
required: true
|
|
104
|
-
}),
|
|
105
|
-
onChange: createActionProp({
|
|
106
|
-
label: "On Change",
|
|
107
|
-
description: "Called when dates selection changes"
|
|
108
|
-
}),
|
|
109
|
-
mode: createTextEnumProp({
|
|
110
|
-
label: "Mode",
|
|
111
|
-
description: "The selection mode of the date picker",
|
|
112
|
-
required: true,
|
|
113
|
-
options: ["multiple"],
|
|
114
|
-
editable: false,
|
|
115
|
-
defaultValue: "multiple",
|
|
116
|
-
formType: FORM_TYPES.flatArray
|
|
117
|
-
}),
|
|
118
|
-
moreLabel: createTextProp({
|
|
119
|
-
label: "More Label",
|
|
120
|
-
description: "The label used display when multiple dates have been selected in the component",
|
|
121
|
-
defaultValue: "More"
|
|
122
|
-
}),
|
|
123
|
-
startLabel: createTextProp({
|
|
124
|
-
label: "Start Label",
|
|
125
|
-
description: "The label used as the prefix to the starting date in the component",
|
|
126
|
-
defaultValue: "Start"
|
|
127
|
-
}),
|
|
128
|
-
endLabel: createTextProp({
|
|
129
|
-
label: "End Label",
|
|
130
|
-
description: "The label used as the suffix to the ending date in the component",
|
|
131
|
-
defaultValue: "End"
|
|
132
|
-
}),
|
|
133
|
-
fieldName: createFieldNameProp({
|
|
134
|
-
defaultValue: "dates",
|
|
135
|
-
handlerPropName: "onConfirm",
|
|
136
|
-
valuePropName: "dates"
|
|
137
|
-
})
|
|
138
|
-
}
|
|
139
|
-
}];
|
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
export declare const SEED_DATA: ({
|
|
2
|
-
name: string;
|
|
3
|
-
description: string;
|
|
4
|
-
props: {
|
|
5
|
-
onConfirm: {
|
|
6
|
-
label: string;
|
|
7
|
-
description: string;
|
|
8
|
-
editable: boolean;
|
|
9
|
-
required: boolean;
|
|
10
|
-
formType: string;
|
|
11
|
-
propType: string;
|
|
12
|
-
defaultValue: null;
|
|
13
|
-
group: string;
|
|
14
|
-
};
|
|
15
|
-
onChange: {
|
|
16
|
-
label: string;
|
|
17
|
-
description: string;
|
|
18
|
-
editable: boolean;
|
|
19
|
-
required: boolean;
|
|
20
|
-
formType: string;
|
|
21
|
-
propType: string;
|
|
22
|
-
defaultValue: null;
|
|
23
|
-
group: string;
|
|
24
|
-
};
|
|
25
|
-
mode: {
|
|
26
|
-
group: string;
|
|
27
|
-
label: string;
|
|
28
|
-
description: string;
|
|
29
|
-
editable: boolean;
|
|
30
|
-
required: boolean;
|
|
31
|
-
formType: string;
|
|
32
|
-
propType: string;
|
|
33
|
-
defaultValue: null;
|
|
34
|
-
options: never[];
|
|
35
|
-
};
|
|
36
|
-
fieldName: {
|
|
37
|
-
handlerPropName: string;
|
|
38
|
-
group: string;
|
|
39
|
-
label: string;
|
|
40
|
-
description: string;
|
|
41
|
-
formType: string;
|
|
42
|
-
propType: string;
|
|
43
|
-
defaultValue: string;
|
|
44
|
-
valuePropName: string;
|
|
45
|
-
editable: boolean;
|
|
46
|
-
required: boolean;
|
|
47
|
-
};
|
|
48
|
-
onDismiss: {
|
|
49
|
-
label: string;
|
|
50
|
-
description: string;
|
|
51
|
-
editable: boolean;
|
|
52
|
-
required: boolean;
|
|
53
|
-
formType: string;
|
|
54
|
-
propType: string;
|
|
55
|
-
defaultValue: null;
|
|
56
|
-
group: string;
|
|
57
|
-
};
|
|
58
|
-
locale: any;
|
|
59
|
-
visible: {
|
|
60
|
-
label: string;
|
|
61
|
-
description: string;
|
|
62
|
-
formType: string;
|
|
63
|
-
propType: string;
|
|
64
|
-
defaultValue: boolean;
|
|
65
|
-
editable: boolean;
|
|
66
|
-
required: boolean;
|
|
67
|
-
group: string;
|
|
68
|
-
};
|
|
69
|
-
label: any;
|
|
70
|
-
saveLabel: any;
|
|
71
|
-
saveLabelDisabled: {
|
|
72
|
-
label: string;
|
|
73
|
-
description: string;
|
|
74
|
-
formType: string;
|
|
75
|
-
propType: string;
|
|
76
|
-
defaultValue: boolean;
|
|
77
|
-
editable: boolean;
|
|
78
|
-
required: boolean;
|
|
79
|
-
group: string;
|
|
80
|
-
};
|
|
81
|
-
uppercase: {
|
|
82
|
-
label: string;
|
|
83
|
-
description: string;
|
|
84
|
-
formType: string;
|
|
85
|
-
propType: string;
|
|
86
|
-
defaultValue: boolean;
|
|
87
|
-
editable: boolean;
|
|
88
|
-
required: boolean;
|
|
89
|
-
group: string;
|
|
90
|
-
};
|
|
91
|
-
startYear: {
|
|
92
|
-
label: string;
|
|
93
|
-
description: string;
|
|
94
|
-
formType: string;
|
|
95
|
-
propType: string;
|
|
96
|
-
group: string;
|
|
97
|
-
defaultValue: null;
|
|
98
|
-
editable: boolean;
|
|
99
|
-
required: boolean;
|
|
100
|
-
step: number;
|
|
101
|
-
};
|
|
102
|
-
endYear: {
|
|
103
|
-
label: string;
|
|
104
|
-
description: string;
|
|
105
|
-
formType: string;
|
|
106
|
-
propType: string;
|
|
107
|
-
group: string;
|
|
108
|
-
defaultValue: null;
|
|
109
|
-
editable: boolean;
|
|
110
|
-
required: boolean;
|
|
111
|
-
step: number;
|
|
112
|
-
};
|
|
113
|
-
};
|
|
114
|
-
tag: string;
|
|
115
|
-
packageName: string;
|
|
116
|
-
triggers: string[];
|
|
117
|
-
category: string;
|
|
118
|
-
StylesPanelSections: string[];
|
|
119
|
-
} | {
|
|
120
|
-
name: string;
|
|
121
|
-
description: string;
|
|
122
|
-
props: {
|
|
123
|
-
onConfirm: {
|
|
124
|
-
label: string;
|
|
125
|
-
description: string;
|
|
126
|
-
editable: boolean;
|
|
127
|
-
required: boolean;
|
|
128
|
-
formType: string;
|
|
129
|
-
propType: string;
|
|
130
|
-
defaultValue: null;
|
|
131
|
-
group: string;
|
|
132
|
-
};
|
|
133
|
-
onChange: {
|
|
134
|
-
label: string;
|
|
135
|
-
description: string;
|
|
136
|
-
editable: boolean;
|
|
137
|
-
required: boolean;
|
|
138
|
-
formType: string;
|
|
139
|
-
propType: string;
|
|
140
|
-
defaultValue: null;
|
|
141
|
-
group: string;
|
|
142
|
-
};
|
|
143
|
-
mode: {
|
|
144
|
-
group: string;
|
|
145
|
-
label: string;
|
|
146
|
-
description: string;
|
|
147
|
-
editable: boolean;
|
|
148
|
-
required: boolean;
|
|
149
|
-
formType: string;
|
|
150
|
-
propType: string;
|
|
151
|
-
defaultValue: null;
|
|
152
|
-
options: never[];
|
|
153
|
-
};
|
|
154
|
-
moreLabel: any;
|
|
155
|
-
startLabel: any;
|
|
156
|
-
endLabel: any;
|
|
157
|
-
fieldName: {
|
|
158
|
-
handlerPropName: string;
|
|
159
|
-
group: string;
|
|
160
|
-
label: string;
|
|
161
|
-
description: string;
|
|
162
|
-
formType: string;
|
|
163
|
-
propType: string;
|
|
164
|
-
defaultValue: string;
|
|
165
|
-
valuePropName: string;
|
|
166
|
-
editable: boolean;
|
|
167
|
-
required: boolean;
|
|
168
|
-
};
|
|
169
|
-
onDismiss: {
|
|
170
|
-
label: string;
|
|
171
|
-
description: string;
|
|
172
|
-
editable: boolean;
|
|
173
|
-
required: boolean;
|
|
174
|
-
formType: string;
|
|
175
|
-
propType: string;
|
|
176
|
-
defaultValue: null;
|
|
177
|
-
group: string;
|
|
178
|
-
};
|
|
179
|
-
locale: any;
|
|
180
|
-
visible: {
|
|
181
|
-
label: string;
|
|
182
|
-
description: string;
|
|
183
|
-
formType: string;
|
|
184
|
-
propType: string;
|
|
185
|
-
defaultValue: boolean;
|
|
186
|
-
editable: boolean;
|
|
187
|
-
required: boolean;
|
|
188
|
-
group: string;
|
|
189
|
-
};
|
|
190
|
-
label: any;
|
|
191
|
-
saveLabel: any;
|
|
192
|
-
saveLabelDisabled: {
|
|
193
|
-
label: string;
|
|
194
|
-
description: string;
|
|
195
|
-
formType: string;
|
|
196
|
-
propType: string;
|
|
197
|
-
defaultValue: boolean;
|
|
198
|
-
editable: boolean;
|
|
199
|
-
required: boolean;
|
|
200
|
-
group: string;
|
|
201
|
-
};
|
|
202
|
-
uppercase: {
|
|
203
|
-
label: string;
|
|
204
|
-
description: string;
|
|
205
|
-
formType: string;
|
|
206
|
-
propType: string;
|
|
207
|
-
defaultValue: boolean;
|
|
208
|
-
editable: boolean;
|
|
209
|
-
required: boolean;
|
|
210
|
-
group: string;
|
|
211
|
-
};
|
|
212
|
-
startYear: {
|
|
213
|
-
label: string;
|
|
214
|
-
description: string;
|
|
215
|
-
formType: string;
|
|
216
|
-
propType: string;
|
|
217
|
-
group: string;
|
|
218
|
-
defaultValue: null;
|
|
219
|
-
editable: boolean;
|
|
220
|
-
required: boolean;
|
|
221
|
-
step: number;
|
|
222
|
-
};
|
|
223
|
-
endYear: {
|
|
224
|
-
label: string;
|
|
225
|
-
description: string;
|
|
226
|
-
formType: string;
|
|
227
|
-
propType: string;
|
|
228
|
-
group: string;
|
|
229
|
-
defaultValue: null;
|
|
230
|
-
editable: boolean;
|
|
231
|
-
required: boolean;
|
|
232
|
-
step: number;
|
|
233
|
-
};
|
|
234
|
-
};
|
|
235
|
-
tag: string;
|
|
236
|
-
packageName: string;
|
|
237
|
-
triggers: string[];
|
|
238
|
-
category: string;
|
|
239
|
-
StylesPanelSections: string[];
|
|
240
|
-
})[];
|
|
241
|
-
//# sourceMappingURL=DatePickerModal.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DatePickerModal.d.ts","sourceRoot":"","sources":["../../../../src/mappings/DatePickerModal.ts"],"names":[],"mappings":"AAsFA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAiFrB,CAAC"}
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { COMPONENT_TYPES, FORM_TYPES, Triggers, StylesPanelSections, createBoolProp, createTextProp, createTextEnumProp, createStaticBoolProp, createStaticNumberProp, createFieldNameProp, createActionProp, } from "@draftbit/types";
|
|
2
|
-
/**
|
|
3
|
-
* Maps react-native-paper-dates DatePickerModal in modes: "single" and "multiple"
|
|
4
|
-
* Cannot map mode "range" because it relies on 2 fieldNames (startDate and endDate)
|
|
5
|
-
*/
|
|
6
|
-
const SHARED_SEED_DATA = {
|
|
7
|
-
tag: "DatePickerModal",
|
|
8
|
-
packageName: "react-native-paper-dates",
|
|
9
|
-
triggers: [Triggers.OnDismiss, Triggers.OnConfirm, Triggers.OnChange],
|
|
10
|
-
category: COMPONENT_TYPES.input,
|
|
11
|
-
StylesPanelSections: [
|
|
12
|
-
StylesPanelSections.Typography,
|
|
13
|
-
StylesPanelSections.Background,
|
|
14
|
-
StylesPanelSections.Size,
|
|
15
|
-
StylesPanelSections.MarginsAndPaddings,
|
|
16
|
-
StylesPanelSections.Position,
|
|
17
|
-
],
|
|
18
|
-
};
|
|
19
|
-
const SHARED_SEED_DATA_PROPS = {
|
|
20
|
-
onDismiss: createActionProp({
|
|
21
|
-
label: "On Dismiss",
|
|
22
|
-
description: "Called when date picker dimissed",
|
|
23
|
-
required: true,
|
|
24
|
-
}),
|
|
25
|
-
locale: createTextProp({
|
|
26
|
-
label: "Locale",
|
|
27
|
-
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",
|
|
28
|
-
defaultValue: "en",
|
|
29
|
-
required: true,
|
|
30
|
-
}),
|
|
31
|
-
visible: createBoolProp({
|
|
32
|
-
label: "Visible",
|
|
33
|
-
description: "Flag indicating if the component should be displayed",
|
|
34
|
-
required: true,
|
|
35
|
-
}),
|
|
36
|
-
label: createTextProp({
|
|
37
|
-
label: "Label",
|
|
38
|
-
description: "The label used as the header in the component",
|
|
39
|
-
defaultValue: "Select date",
|
|
40
|
-
}),
|
|
41
|
-
saveLabel: createTextProp({
|
|
42
|
-
label: "Save Label",
|
|
43
|
-
description: "Label used to confirm a date selection",
|
|
44
|
-
defaultValue: "Save",
|
|
45
|
-
}),
|
|
46
|
-
saveLabelDisabled: createStaticBoolProp({
|
|
47
|
-
label: "Disable Save Label",
|
|
48
|
-
description: "Flag indicating if the save label should be disabled and unable to receive events",
|
|
49
|
-
}),
|
|
50
|
-
uppercase: createStaticBoolProp({
|
|
51
|
-
label: "Uppercase",
|
|
52
|
-
description: "Flag indicating if the text in the component should be uppercase",
|
|
53
|
-
defaultValue: true,
|
|
54
|
-
}),
|
|
55
|
-
startYear: createStaticNumberProp({
|
|
56
|
-
label: "Start Year",
|
|
57
|
-
description: "The start year when the component is rendered",
|
|
58
|
-
required: false,
|
|
59
|
-
defaultValue: 1800,
|
|
60
|
-
}),
|
|
61
|
-
endYear: createStaticNumberProp({
|
|
62
|
-
label: "End Year",
|
|
63
|
-
description: "The end year when the component is rendered",
|
|
64
|
-
required: false,
|
|
65
|
-
defaultValue: 2200,
|
|
66
|
-
}),
|
|
67
|
-
};
|
|
68
|
-
export const SEED_DATA = [
|
|
69
|
-
{
|
|
70
|
-
...SHARED_SEED_DATA,
|
|
71
|
-
name: "Date Picker Modal",
|
|
72
|
-
description: "Date Picker modal for date selection",
|
|
73
|
-
props: {
|
|
74
|
-
...SHARED_SEED_DATA_PROPS,
|
|
75
|
-
onConfirm: createActionProp({
|
|
76
|
-
label: "On Confirm",
|
|
77
|
-
description: "Called when date selected and confirmed",
|
|
78
|
-
required: true,
|
|
79
|
-
}),
|
|
80
|
-
onChange: createActionProp({
|
|
81
|
-
label: "On Change",
|
|
82
|
-
description: "Called when date selection changes",
|
|
83
|
-
}),
|
|
84
|
-
mode: createTextEnumProp({
|
|
85
|
-
label: "Mode",
|
|
86
|
-
description: "The selection mode of the date picker",
|
|
87
|
-
required: true,
|
|
88
|
-
options: ["single"],
|
|
89
|
-
editable: false,
|
|
90
|
-
defaultValue: "single",
|
|
91
|
-
formType: FORM_TYPES.flatArray,
|
|
92
|
-
}),
|
|
93
|
-
fieldName: createFieldNameProp({
|
|
94
|
-
defaultValue: "date",
|
|
95
|
-
handlerPropName: "onConfirm",
|
|
96
|
-
valuePropName: "date",
|
|
97
|
-
}),
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
...SHARED_SEED_DATA,
|
|
102
|
-
name: "Multiple Date Picker Modal",
|
|
103
|
-
description: "Date Picker modal for multiple date selection",
|
|
104
|
-
props: {
|
|
105
|
-
...SHARED_SEED_DATA_PROPS,
|
|
106
|
-
onConfirm: createActionProp({
|
|
107
|
-
label: "On Confirm",
|
|
108
|
-
description: "Called when dates selected and confirmed",
|
|
109
|
-
required: true,
|
|
110
|
-
}),
|
|
111
|
-
onChange: createActionProp({
|
|
112
|
-
label: "On Change",
|
|
113
|
-
description: "Called when dates selection changes",
|
|
114
|
-
}),
|
|
115
|
-
mode: createTextEnumProp({
|
|
116
|
-
label: "Mode",
|
|
117
|
-
description: "The selection mode of the date picker",
|
|
118
|
-
required: true,
|
|
119
|
-
options: ["multiple"],
|
|
120
|
-
editable: false,
|
|
121
|
-
defaultValue: "multiple",
|
|
122
|
-
formType: FORM_TYPES.flatArray,
|
|
123
|
-
}),
|
|
124
|
-
moreLabel: createTextProp({
|
|
125
|
-
label: "More Label",
|
|
126
|
-
description: "The label used display when multiple dates have been selected in the component",
|
|
127
|
-
defaultValue: "More",
|
|
128
|
-
}),
|
|
129
|
-
startLabel: createTextProp({
|
|
130
|
-
label: "Start Label",
|
|
131
|
-
description: "The label used as the prefix to the starting date in the component",
|
|
132
|
-
defaultValue: "Start",
|
|
133
|
-
}),
|
|
134
|
-
endLabel: createTextProp({
|
|
135
|
-
label: "End Label",
|
|
136
|
-
description: "The label used as the suffix to the ending date in the component",
|
|
137
|
-
defaultValue: "End",
|
|
138
|
-
}),
|
|
139
|
-
fieldName: createFieldNameProp({
|
|
140
|
-
defaultValue: "dates",
|
|
141
|
-
handlerPropName: "onConfirm",
|
|
142
|
-
valuePropName: "dates",
|
|
143
|
-
}),
|
|
144
|
-
},
|
|
145
|
-
},
|
|
146
|
-
];
|
|
@@ -1,168 +0,0 @@
|
|
|
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
|
-
];
|