ordering-ui-react-native 0.21.48-test → 0.21.48-test-3
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/package.json +2 -3
- package/src/components/StripeMethodForm/index.tsx +3 -2
- package/themes/business/index.tsx +0 -5
- package/themes/business/src/components/AcceptOrRejectOrder/index.tsx +9 -2
- package/themes/business/src/components/FloatingButton/index.tsx +34 -31
- package/themes/business/src/components/MapView/index.tsx +6 -2
- package/themes/business/src/components/OrderDetails/Delivery.tsx +11 -6
- package/themes/business/src/components/OrderDetails/OrderHeaderComponent.tsx +12 -0
- package/themes/business/src/components/OrderDetailsLogistic/index.tsx +6 -1
- package/themes/business/src/components/OrderSummary/index.tsx +3 -10
- package/themes/business/src/components/OrdersOption/index.tsx +2 -0
- package/themes/business/src/components/PreviousOrders/OrderList.tsx +17 -12
- package/themes/business/src/components/PreviousOrders/index.tsx +77 -65
- package/themes/kiosk/src/components/LoginForm/index.tsx +7 -4
- package/themes/original/index.tsx +6 -2
- package/themes/original/src/components/BusinessInformation/index.tsx +0 -1
- package/themes/original/src/components/BusinessProductsList/index.tsx +2 -2
- package/themes/original/src/components/BusinessProductsListing/index.tsx +5 -1
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListFooter.tsx +69 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListHeader.tsx +406 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/FlatListBusinessListing.tsx +76 -0
- package/themes/original/src/components/BusinessesListing/Layout/Original/index.tsx +22 -402
- package/themes/original/src/components/Checkout/index.tsx +9 -1
- package/themes/original/src/components/DatePicker/index.tsx +17 -0
- package/themes/original/src/components/DatePicker/styles.tsx +20 -0
- package/themes/original/src/components/GiftCard/GiftCardUI/index.tsx +8 -3
- package/themes/original/src/components/GiftCard/PurchaseGiftCard/index.tsx +36 -3
- package/themes/original/src/components/GiftCard/RedeemGiftCard/index.tsx +67 -4
- package/themes/original/src/components/LastOrder/index.tsx +2 -1
- package/themes/original/src/components/LastOrders/index.tsx +2 -1
- package/themes/original/src/components/MultiCheckout/index.tsx +138 -16
- package/themes/original/src/components/NavBar/index.tsx +0 -1
- package/themes/original/src/components/OrderDetails/index.tsx +8 -4
- package/themes/original/src/components/OrderProgress/index.tsx +2 -1
- package/themes/original/src/components/PaymentOptions/index.tsx +4 -2
- package/themes/original/src/components/ProductForm/index.tsx +1 -2
- package/themes/original/src/components/UserFormDetails/index.tsx +35 -1
- package/themes/original/src/components/Wallets/index.tsx +1 -0
- package/themes/original/src/components/Wallets/styles.tsx +0 -1
- package/themes/business/src/components/StarPrinter/SearchPrinter.tsx +0 -106
- package/themes/business/src/components/StarPrinter/index.tsx +0 -235
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
View,
|
|
4
|
-
Text,
|
|
5
|
-
Button,
|
|
6
|
-
TextInput,
|
|
7
|
-
PermissionsAndroid,
|
|
8
|
-
Platform
|
|
9
|
-
} from 'react-native';
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
Picker
|
|
13
|
-
} from '@react-native-picker/picker';
|
|
14
|
-
|
|
15
|
-
import {
|
|
16
|
-
InterfaceType,
|
|
17
|
-
StarConnectionSettings,
|
|
18
|
-
StarXpandCommand,
|
|
19
|
-
StarPrinter
|
|
20
|
-
} from 'react-native-star-io10';
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const HandleStarPrinter = ({ navigation }) => {
|
|
24
|
-
|
|
25
|
-
const [state, setState] = React.useState({
|
|
26
|
-
interfaceType: InterfaceType.Bluetooth,
|
|
27
|
-
identifier: '00:11:62:00:00:00',
|
|
28
|
-
imageBase64: ''
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
const _onPressPrintButton = async () => {
|
|
32
|
-
const settings = new StarConnectionSettings();
|
|
33
|
-
settings.interfaceType = state.interfaceType;
|
|
34
|
-
settings.identifier = state.identifier;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const printer = new StarPrinter(settings);
|
|
38
|
-
|
|
39
|
-
try {
|
|
40
|
-
const builder = new StarXpandCommand.StarXpandCommandBuilder();
|
|
41
|
-
builder.addDocument(new StarXpandCommand.DocumentBuilder()
|
|
42
|
-
.addPrinter(new StarXpandCommand.PrinterBuilder()
|
|
43
|
-
.actionPrintImage(new StarXpandCommand.Printer.ImageParameter("logo_01.png", 406))
|
|
44
|
-
.styleInternationalCharacter(StarXpandCommand.Printer.InternationalCharacterType.Usa)
|
|
45
|
-
.styleCharacterSpace(0)
|
|
46
|
-
.styleAlignment(StarXpandCommand.Printer.Alignment.Center)
|
|
47
|
-
.actionPrintText("Star Clothing Boutique\n" +
|
|
48
|
-
"123 Star Road\n" +
|
|
49
|
-
"City, State 12345\n" +
|
|
50
|
-
"\n")
|
|
51
|
-
.styleAlignment(StarXpandCommand.Printer.Alignment.Left)
|
|
52
|
-
.actionPrintText("Date:MM/DD/YYYY Time:HH:MM PM\n" +
|
|
53
|
-
"--------------------------------\n" +
|
|
54
|
-
"\n")
|
|
55
|
-
.actionPrintText("SKU Description Total\n" +
|
|
56
|
-
"300678566 PLAIN T-SHIRT 10.99\n" +
|
|
57
|
-
"300692003 BLACK DENIM 29.99\n" +
|
|
58
|
-
"300651148 BLUE DENIM 29.99\n" +
|
|
59
|
-
"300642980 STRIPED DRESS 49.99\n" +
|
|
60
|
-
"300638471 BLACK BOOTS 35.99\n" +
|
|
61
|
-
"\n" +
|
|
62
|
-
"Subtotal 156.95\n" +
|
|
63
|
-
"Tax 0.00\n" +
|
|
64
|
-
"--------------------------------\n")
|
|
65
|
-
.actionPrintText("Total ")
|
|
66
|
-
.add(new StarXpandCommand.PrinterBuilder()
|
|
67
|
-
.styleMagnification(new StarXpandCommand.MagnificationParameter(2, 2))
|
|
68
|
-
.actionPrintText(" $156.95\n")
|
|
69
|
-
)
|
|
70
|
-
.actionPrintText("--------------------------------\n" +
|
|
71
|
-
"\n" +
|
|
72
|
-
"Charge\n" +
|
|
73
|
-
"156.95\n" +
|
|
74
|
-
"Visa XXXX-XXXX-XXXX-0123\n" +
|
|
75
|
-
"\n")
|
|
76
|
-
.add(new StarXpandCommand.PrinterBuilder()
|
|
77
|
-
.styleInvert(true)
|
|
78
|
-
.actionPrintText("Refunds and Exchanges\n")
|
|
79
|
-
)
|
|
80
|
-
.actionPrintText("Within ")
|
|
81
|
-
.add(new StarXpandCommand.PrinterBuilder()
|
|
82
|
-
.styleUnderLine(true)
|
|
83
|
-
.actionPrintText("30 days")
|
|
84
|
-
)
|
|
85
|
-
.actionPrintText(" with receipt\n")
|
|
86
|
-
.actionPrintText("And tags attached\n" +
|
|
87
|
-
"\n")
|
|
88
|
-
.styleAlignment(StarXpandCommand.Printer.Alignment.Center)
|
|
89
|
-
.actionPrintBarcode(new StarXpandCommand.Printer.BarcodeParameter('0123456',
|
|
90
|
-
StarXpandCommand.Printer.BarcodeSymbology.Jan8)
|
|
91
|
-
.setBarDots(3)
|
|
92
|
-
.setBarRatioLevel(StarXpandCommand.Printer.BarcodeBarRatioLevel.Level0)
|
|
93
|
-
.setHeight(5)
|
|
94
|
-
.setPrintHri(true))
|
|
95
|
-
.actionFeedLine(1)
|
|
96
|
-
.actionPrintQRCode(new StarXpandCommand.Printer.QRCodeParameter('Hello World.\n')
|
|
97
|
-
.setModel(StarXpandCommand.Printer.QRCodeModel.Model2)
|
|
98
|
-
.setLevel(StarXpandCommand.Printer.QRCodeLevel.L)
|
|
99
|
-
.setCellSize(8))
|
|
100
|
-
.actionCut(StarXpandCommand.Printer.CutType.Partial)
|
|
101
|
-
)
|
|
102
|
-
);
|
|
103
|
-
|
|
104
|
-
const commands = await builder.getCommands();
|
|
105
|
-
|
|
106
|
-
await printer.open();
|
|
107
|
-
await printer.print(commands);
|
|
108
|
-
|
|
109
|
-
console.log(`Success`);
|
|
110
|
-
}
|
|
111
|
-
catch (error) {
|
|
112
|
-
console.log(`Error: ${String(error)}`);
|
|
113
|
-
}
|
|
114
|
-
finally {
|
|
115
|
-
await printer.close();
|
|
116
|
-
await printer.dispose();
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
const onSearchPrint = () => {
|
|
122
|
-
navigation.navigate('SearchStarPrinter')
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
const onPrintStatus = async () => {
|
|
126
|
-
const settings = new StarConnectionSettings();
|
|
127
|
-
settings.interfaceType = InterfaceType.Lan;
|
|
128
|
-
settings.identifier = '00:11:62:00:00:00';
|
|
129
|
-
const printer = new StarPrinter(settings);
|
|
130
|
-
|
|
131
|
-
try {
|
|
132
|
-
// Connect to the printer.
|
|
133
|
-
await printer.open();
|
|
134
|
-
|
|
135
|
-
// Get printer status.
|
|
136
|
-
const status = await printer.getStatus();
|
|
137
|
-
console.log(status);
|
|
138
|
-
}
|
|
139
|
-
catch (error) {
|
|
140
|
-
// Error.
|
|
141
|
-
console.log(error);
|
|
142
|
-
}
|
|
143
|
-
finally {
|
|
144
|
-
// Disconnect from the printer and dispose object.
|
|
145
|
-
await printer.close();
|
|
146
|
-
await printer.dispose();
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
const onPrinterMonitor = async () => {
|
|
151
|
-
let printer: StarPrinter;
|
|
152
|
-
const settings = new StarConnectionSettings();
|
|
153
|
-
settings.interfaceType = InterfaceType.Lan;
|
|
154
|
-
settings.identifier = '00:11:62:00:00:00';
|
|
155
|
-
printer = new StarPrinter(settings);
|
|
156
|
-
|
|
157
|
-
// Callback for printer state changed.
|
|
158
|
-
printer.printerDelegate.onReady = () => {
|
|
159
|
-
console.log(`Printer: Ready`);
|
|
160
|
-
}
|
|
161
|
-
printer.drawerDelegate.onOpenCloseSignalSwitched = (openCloseSignal: any) => {
|
|
162
|
-
console.log(`Drawer: Open Close Signal Switched: ${String(openCloseSignal)}`);
|
|
163
|
-
}
|
|
164
|
-
printer.inputDeviceDelegate.onDataReceived = (data: any) => {
|
|
165
|
-
console.log(`Input Device: DataReceived ${String(data)}`);
|
|
166
|
-
}
|
|
167
|
-
printer.displayDelegate.onConnected = () => {
|
|
168
|
-
console.log(`Display: Connected`);
|
|
169
|
-
}
|
|
170
|
-
// ...
|
|
171
|
-
// Please refer to document for other callback.
|
|
172
|
-
|
|
173
|
-
try {
|
|
174
|
-
// Connect to the printer.
|
|
175
|
-
await printer.open();
|
|
176
|
-
}
|
|
177
|
-
catch (error) {
|
|
178
|
-
// Error.
|
|
179
|
-
console.log(error);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
return (
|
|
184
|
-
<View style={{ margin: 50 }}>
|
|
185
|
-
<View style={{ flexDirection: 'row' }}>
|
|
186
|
-
<Text style={{ width: 100 }}>Interface</Text>
|
|
187
|
-
<Picker
|
|
188
|
-
style={{ width: 200, marginLeft: 20, justifyContent: 'center' }}
|
|
189
|
-
selectedValue={state.interfaceType}
|
|
190
|
-
onValueChange={(value) => {
|
|
191
|
-
setState({ ...state, interfaceType: value });
|
|
192
|
-
}}>
|
|
193
|
-
<Picker.Item label='Bluetooth' value={InterfaceType.Bluetooth} />
|
|
194
|
-
<Picker.Item label='Bluetooth LE' value={InterfaceType.BluetoothLE} />
|
|
195
|
-
</Picker>
|
|
196
|
-
</View>
|
|
197
|
-
<View style={{ flexDirection: 'row', marginTop: 30 }}>
|
|
198
|
-
<Text style={{ width: 100 }}>Identifier</Text>
|
|
199
|
-
<TextInput
|
|
200
|
-
style={{ width: 200, marginLeft: 20 }}
|
|
201
|
-
value={state.identifier}
|
|
202
|
-
onChangeText={(value) => {
|
|
203
|
-
setState({ ...state, identifier: value });
|
|
204
|
-
}}
|
|
205
|
-
/>
|
|
206
|
-
</View>
|
|
207
|
-
<View style={{ width: 100, marginTop: 20 }}>
|
|
208
|
-
<Button
|
|
209
|
-
title="Search Printer"
|
|
210
|
-
onPress={onSearchPrint}
|
|
211
|
-
/>
|
|
212
|
-
</View>
|
|
213
|
-
<View style={{ width: 100, marginTop: 20 }}>
|
|
214
|
-
<Button
|
|
215
|
-
title="Printer status"
|
|
216
|
-
onPress={onPrintStatus}
|
|
217
|
-
/>
|
|
218
|
-
</View>
|
|
219
|
-
<View style={{ width: 100, marginTop: 20 }}>
|
|
220
|
-
<Button
|
|
221
|
-
title="Printer monitor"
|
|
222
|
-
onPress={onPrinterMonitor}
|
|
223
|
-
/>
|
|
224
|
-
</View>
|
|
225
|
-
<View style={{ width: 100, marginTop: 20 }}>
|
|
226
|
-
<Button
|
|
227
|
-
title="Print"
|
|
228
|
-
onPress={async () => await _onPressPrintButton()}
|
|
229
|
-
/>
|
|
230
|
-
</View>
|
|
231
|
-
</View>
|
|
232
|
-
);
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
export default HandleStarPrinter;
|