@scrumble-nl/gatherer-frontend 0.0.1
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/README.md +159 -0
- package/lib/commonjs/context/picker-context.js +85 -0
- package/lib/commonjs/context/picker-context.js.map +1 -0
- package/lib/commonjs/context/scan-context.js +20 -0
- package/lib/commonjs/context/scan-context.js.map +1 -0
- package/lib/commonjs/hooks/use-instance.js +28 -0
- package/lib/commonjs/hooks/use-instance.js.map +1 -0
- package/lib/commonjs/hooks/use-pick-item-switch.js +53 -0
- package/lib/commonjs/hooks/use-pick-item-switch.js.map +1 -0
- package/lib/commonjs/hooks/use-picker.js +13 -0
- package/lib/commonjs/hooks/use-picker.js.map +1 -0
- package/lib/commonjs/hooks/use-scanner.js +35 -0
- package/lib/commonjs/hooks/use-scanner.js.map +1 -0
- package/lib/commonjs/index.js +41 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/lang/en/components/pick-list.js +14 -0
- package/lib/commonjs/lang/en/components/pick-list.js.map +1 -0
- package/lib/commonjs/lang/en/components/picker.js +16 -0
- package/lib/commonjs/lang/en/components/picker.js.map +1 -0
- package/lib/commonjs/lang/en/english.js +16 -0
- package/lib/commonjs/lang/en/english.js.map +1 -0
- package/lib/commonjs/lang/nl/components/pick-list.js +14 -0
- package/lib/commonjs/lang/nl/components/pick-list.js.map +1 -0
- package/lib/commonjs/lang/nl/components/picker.js +16 -0
- package/lib/commonjs/lang/nl/components/picker.js.map +1 -0
- package/lib/commonjs/lang/nl/dutch.js +16 -0
- package/lib/commonjs/lang/nl/dutch.js.map +1 -0
- package/lib/commonjs/lang/translations.js +15 -0
- package/lib/commonjs/lang/translations.js.map +1 -0
- package/lib/commonjs/pick-list/partials/empty-list.js +23 -0
- package/lib/commonjs/pick-list/partials/empty-list.js.map +1 -0
- package/lib/commonjs/pick-list/partials/pick-group-item.js +45 -0
- package/lib/commonjs/pick-list/partials/pick-group-item.js.map +1 -0
- package/lib/commonjs/pick-list/partials/search.js +64 -0
- package/lib/commonjs/pick-list/partials/search.js.map +1 -0
- package/lib/commonjs/pick-list/pick-list.js +80 -0
- package/lib/commonjs/pick-list/pick-list.js.map +1 -0
- package/lib/commonjs/pick-list/styles/empty-list-styles.js +19 -0
- package/lib/commonjs/pick-list/styles/empty-list-styles.js.map +1 -0
- package/lib/commonjs/pick-list/styles/pick-group-item-styles.js +24 -0
- package/lib/commonjs/pick-list/styles/pick-group-item-styles.js.map +1 -0
- package/lib/commonjs/pick-list/styles/search-styles.js +34 -0
- package/lib/commonjs/pick-list/styles/search-styles.js.map +1 -0
- package/lib/commonjs/picker/partials/modal/pick-modal.js +44 -0
- package/lib/commonjs/picker/partials/modal/pick-modal.js.map +1 -0
- package/lib/commonjs/picker/partials/modal/pick-quantity-select.js +132 -0
- package/lib/commonjs/picker/partials/modal/pick-quantity-select.js.map +1 -0
- package/lib/commonjs/picker/partials/pick-amount.js +33 -0
- package/lib/commonjs/picker/partials/pick-amount.js.map +1 -0
- package/lib/commonjs/picker/partials/product-info.js +38 -0
- package/lib/commonjs/picker/partials/product-info.js.map +1 -0
- package/lib/commonjs/picker/partials/progress-bar.js +37 -0
- package/lib/commonjs/picker/partials/progress-bar.js.map +1 -0
- package/lib/commonjs/picker/picker.js +67 -0
- package/lib/commonjs/picker/picker.js.map +1 -0
- package/lib/commonjs/picker/styles/pick-amount-styles.js +31 -0
- package/lib/commonjs/picker/styles/pick-amount-styles.js.map +1 -0
- package/lib/commonjs/picker/styles/pick-modal-styles.js +81 -0
- package/lib/commonjs/picker/styles/pick-modal-styles.js.map +1 -0
- package/lib/commonjs/picker/styles/picker-styles.js +14 -0
- package/lib/commonjs/picker/styles/picker-styles.js.map +1 -0
- package/lib/commonjs/picker/styles/product-info-styles.js +27 -0
- package/lib/commonjs/picker/styles/product-info-styles.js.map +1 -0
- package/lib/commonjs/picker/styles/progress-bar-styles.js +19 -0
- package/lib/commonjs/picker/styles/progress-bar-styles.js.map +1 -0
- package/lib/commonjs/shared/api/api-urls.js +22 -0
- package/lib/commonjs/shared/api/api-urls.js.map +1 -0
- package/lib/commonjs/shared/badge/badge.js +44 -0
- package/lib/commonjs/shared/badge/badge.js.map +1 -0
- package/lib/commonjs/shared/badge/styles/badge-styles.js +24 -0
- package/lib/commonjs/shared/badge/styles/badge-styles.js.map +1 -0
- package/lib/commonjs/shared/constants.js +37 -0
- package/lib/commonjs/shared/constants.js.map +1 -0
- package/lib/commonjs/shared/default-pick-group-item.js +22 -0
- package/lib/commonjs/shared/default-pick-group-item.js.map +1 -0
- package/lib/commonjs/shared/layout/data-column.js +26 -0
- package/lib/commonjs/shared/layout/data-column.js.map +1 -0
- package/lib/commonjs/shared/layout/data-format.js +22 -0
- package/lib/commonjs/shared/layout/data-format.js.map +1 -0
- package/lib/commonjs/shared/layout/data-row.js +36 -0
- package/lib/commonjs/shared/layout/data-row.js.map +1 -0
- package/lib/commonjs/shared/layout/styles/layout-styles.js +26 -0
- package/lib/commonjs/shared/layout/styles/layout-styles.js.map +1 -0
- package/lib/commonjs/shared/press-button/press-button.js +34 -0
- package/lib/commonjs/shared/press-button/press-button.js.map +1 -0
- package/lib/commonjs/types/badge/badge.d.js +2 -0
- package/lib/commonjs/types/badge/badge.d.js.map +1 -0
- package/lib/commonjs/types/config/config.d.js +2 -0
- package/lib/commonjs/types/config/config.d.js.map +1 -0
- package/lib/commonjs/types/control/control.d.js +2 -0
- package/lib/commonjs/types/control/control.d.js.map +1 -0
- package/lib/commonjs/types/pick-group/pick-group.d.js +2 -0
- package/lib/commonjs/types/pick-group/pick-group.d.js.map +1 -0
- package/lib/commonjs/types/pick-group/search-params.d.js +2 -0
- package/lib/commonjs/types/pick-group/search-params.d.js.map +1 -0
- package/lib/commonjs/types/pick-item/pick-item.d.js +2 -0
- package/lib/commonjs/types/pick-item/pick-item.d.js.map +1 -0
- package/lib/commonjs/types/scanner/scanner.d.js +2 -0
- package/lib/commonjs/types/scanner/scanner.d.js.map +1 -0
- package/lib/module/context/picker-context.js +74 -0
- package/lib/module/context/picker-context.js.map +1 -0
- package/lib/module/context/scan-context.js +10 -0
- package/lib/module/context/scan-context.js.map +1 -0
- package/lib/module/hooks/use-instance.js +20 -0
- package/lib/module/hooks/use-instance.js.map +1 -0
- package/lib/module/hooks/use-pick-item-switch.js +46 -0
- package/lib/module/hooks/use-pick-item-switch.js.map +1 -0
- package/lib/module/hooks/use-picker.js +6 -0
- package/lib/module/hooks/use-picker.js.map +1 -0
- package/lib/module/hooks/use-scanner.js +28 -0
- package/lib/module/hooks/use-scanner.js.map +1 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/lang/en/components/pick-list.js +7 -0
- package/lib/module/lang/en/components/pick-list.js.map +1 -0
- package/lib/module/lang/en/components/picker.js +9 -0
- package/lib/module/lang/en/components/picker.js.map +1 -0
- package/lib/module/lang/en/english.js +9 -0
- package/lib/module/lang/en/english.js.map +1 -0
- package/lib/module/lang/nl/components/pick-list.js +7 -0
- package/lib/module/lang/nl/components/pick-list.js.map +1 -0
- package/lib/module/lang/nl/components/picker.js +9 -0
- package/lib/module/lang/nl/components/picker.js.map +1 -0
- package/lib/module/lang/nl/dutch.js +9 -0
- package/lib/module/lang/nl/dutch.js.map +1 -0
- package/lib/module/lang/translations.js +8 -0
- package/lib/module/lang/translations.js.map +1 -0
- package/lib/module/pick-list/partials/empty-list.js +15 -0
- package/lib/module/pick-list/partials/empty-list.js.map +1 -0
- package/lib/module/pick-list/partials/pick-group-item.js +37 -0
- package/lib/module/pick-list/partials/pick-group-item.js.map +1 -0
- package/lib/module/pick-list/partials/search.js +54 -0
- package/lib/module/pick-list/partials/search.js.map +1 -0
- package/lib/module/pick-list/pick-list.js +71 -0
- package/lib/module/pick-list/pick-list.js.map +1 -0
- package/lib/module/pick-list/styles/empty-list-styles.js +12 -0
- package/lib/module/pick-list/styles/empty-list-styles.js.map +1 -0
- package/lib/module/pick-list/styles/pick-group-item-styles.js +17 -0
- package/lib/module/pick-list/styles/pick-group-item-styles.js.map +1 -0
- package/lib/module/pick-list/styles/search-styles.js +27 -0
- package/lib/module/pick-list/styles/search-styles.js.map +1 -0
- package/lib/module/picker/partials/modal/pick-modal.js +36 -0
- package/lib/module/picker/partials/modal/pick-modal.js.map +1 -0
- package/lib/module/picker/partials/modal/pick-quantity-select.js +122 -0
- package/lib/module/picker/partials/modal/pick-quantity-select.js.map +1 -0
- package/lib/module/picker/partials/pick-amount.js +25 -0
- package/lib/module/picker/partials/pick-amount.js.map +1 -0
- package/lib/module/picker/partials/product-info.js +30 -0
- package/lib/module/picker/partials/product-info.js.map +1 -0
- package/lib/module/picker/partials/progress-bar.js +29 -0
- package/lib/module/picker/partials/progress-bar.js.map +1 -0
- package/lib/module/picker/picker.js +59 -0
- package/lib/module/picker/picker.js.map +1 -0
- package/lib/module/picker/styles/pick-amount-styles.js +24 -0
- package/lib/module/picker/styles/pick-amount-styles.js.map +1 -0
- package/lib/module/picker/styles/pick-modal-styles.js +74 -0
- package/lib/module/picker/styles/pick-modal-styles.js.map +1 -0
- package/lib/module/picker/styles/picker-styles.js +7 -0
- package/lib/module/picker/styles/picker-styles.js.map +1 -0
- package/lib/module/picker/styles/product-info-styles.js +20 -0
- package/lib/module/picker/styles/product-info-styles.js.map +1 -0
- package/lib/module/picker/styles/progress-bar-styles.js +12 -0
- package/lib/module/picker/styles/progress-bar-styles.js.map +1 -0
- package/lib/module/shared/api/api-urls.js +9 -0
- package/lib/module/shared/api/api-urls.js.map +1 -0
- package/lib/module/shared/badge/badge.js +36 -0
- package/lib/module/shared/badge/badge.js.map +1 -0
- package/lib/module/shared/badge/styles/badge-styles.js +17 -0
- package/lib/module/shared/badge/styles/badge-styles.js.map +1 -0
- package/lib/module/shared/constants.js +16 -0
- package/lib/module/shared/constants.js.map +1 -0
- package/lib/module/shared/default-pick-group-item.js +15 -0
- package/lib/module/shared/default-pick-group-item.js.map +1 -0
- package/lib/module/shared/layout/data-column.js +18 -0
- package/lib/module/shared/layout/data-column.js.map +1 -0
- package/lib/module/shared/layout/data-format.js +14 -0
- package/lib/module/shared/layout/data-format.js.map +1 -0
- package/lib/module/shared/layout/data-row.js +28 -0
- package/lib/module/shared/layout/data-row.js.map +1 -0
- package/lib/module/shared/layout/styles/layout-styles.js +19 -0
- package/lib/module/shared/layout/styles/layout-styles.js.map +1 -0
- package/lib/module/shared/press-button/press-button.js +25 -0
- package/lib/module/shared/press-button/press-button.js.map +1 -0
- package/lib/module/types/badge/badge.d.js +2 -0
- package/lib/module/types/badge/badge.d.js.map +1 -0
- package/lib/module/types/config/config.d.js +2 -0
- package/lib/module/types/config/config.d.js.map +1 -0
- package/lib/module/types/control/control.d.js +2 -0
- package/lib/module/types/control/control.d.js.map +1 -0
- package/lib/module/types/pick-group/pick-group.d.js +2 -0
- package/lib/module/types/pick-group/pick-group.d.js.map +1 -0
- package/lib/module/types/pick-group/search-params.d.js +2 -0
- package/lib/module/types/pick-group/search-params.d.js.map +1 -0
- package/lib/module/types/pick-item/pick-item.d.js +2 -0
- package/lib/module/types/pick-item/pick-item.d.js.map +1 -0
- package/lib/module/types/scanner/scanner.d.js +2 -0
- package/lib/module/types/scanner/scanner.d.js.map +1 -0
- package/lib/typescript/context/picker-context.d.ts +18 -0
- package/lib/typescript/context/scan-context.d.ts +11 -0
- package/lib/typescript/hooks/use-instance.d.ts +2 -0
- package/lib/typescript/hooks/use-pick-item-switch.d.ts +1 -0
- package/lib/typescript/hooks/use-picker.d.ts +2 -0
- package/lib/typescript/hooks/use-scanner.d.ts +3 -0
- package/lib/typescript/index.d.ts +5 -0
- package/lib/typescript/lang/en/components/pick-list.d.ts +6 -0
- package/lib/typescript/lang/en/components/picker.d.ts +8 -0
- package/lib/typescript/lang/en/english.d.ts +14 -0
- package/lib/typescript/lang/nl/components/pick-list.d.ts +6 -0
- package/lib/typescript/lang/nl/components/picker.d.ts +8 -0
- package/lib/typescript/lang/nl/dutch.d.ts +14 -0
- package/lib/typescript/lang/translations.d.ts +2 -0
- package/lib/typescript/pick-list/partials/empty-list.d.ts +5 -0
- package/lib/typescript/pick-list/partials/pick-group-item.d.ts +6 -0
- package/lib/typescript/pick-list/partials/search.d.ts +5 -0
- package/lib/typescript/pick-list/pick-list.d.ts +9 -0
- package/lib/typescript/pick-list/styles/empty-list-styles.d.ts +9 -0
- package/lib/typescript/pick-list/styles/pick-group-item-styles.d.ts +14 -0
- package/lib/typescript/pick-list/styles/search-styles.d.ts +24 -0
- package/lib/typescript/picker/partials/modal/pick-modal.d.ts +6 -0
- package/lib/typescript/picker/partials/modal/pick-quantity-select.d.ts +6 -0
- package/lib/typescript/picker/partials/pick-amount.d.ts +1 -0
- package/lib/typescript/picker/partials/product-info.d.ts +1 -0
- package/lib/typescript/picker/partials/progress-bar.d.ts +5 -0
- package/lib/typescript/picker/picker.d.ts +16 -0
- package/lib/typescript/picker/styles/pick-amount-styles.d.ts +21 -0
- package/lib/typescript/picker/styles/pick-modal-styles.d.ts +71 -0
- package/lib/typescript/picker/styles/picker-styles.d.ts +5 -0
- package/lib/typescript/picker/styles/product-info-styles.d.ts +17 -0
- package/lib/typescript/picker/styles/progress-bar-styles.d.ts +9 -0
- package/lib/typescript/shared/api/api-urls.d.ts +7 -0
- package/lib/typescript/shared/badge/badge.d.ts +6 -0
- package/lib/typescript/shared/badge/styles/badge-styles.d.ts +14 -0
- package/lib/typescript/shared/constants.d.ts +15 -0
- package/lib/typescript/shared/default-pick-group-item.d.ts +1 -0
- package/lib/typescript/shared/layout/data-column.d.ts +7 -0
- package/lib/typescript/shared/layout/data-format.d.ts +5 -0
- package/lib/typescript/shared/layout/data-row.d.ts +10 -0
- package/lib/typescript/shared/layout/styles/layout-styles.d.ts +16 -0
- package/lib/typescript/shared/press-button/press-button.d.ts +8 -0
- package/package.json +133 -0
- package/src/context/picker-context.tsx +117 -0
- package/src/context/scan-context.tsx +16 -0
- package/src/hooks/use-instance.tsx +23 -0
- package/src/hooks/use-pick-item-switch.tsx +55 -0
- package/src/hooks/use-picker.tsx +8 -0
- package/src/hooks/use-scanner.tsx +33 -0
- package/src/index.tsx +5 -0
- package/src/lang/en/components/pick-list.ts +6 -0
- package/src/lang/en/components/picker.ts +8 -0
- package/src/lang/en/english.ts +9 -0
- package/src/lang/nl/components/pick-list.ts +6 -0
- package/src/lang/nl/components/picker.ts +8 -0
- package/src/lang/nl/dutch.ts +9 -0
- package/src/lang/translations.ts +9 -0
- package/src/pick-list/partials/empty-list.tsx +18 -0
- package/src/pick-list/partials/pick-group-item.tsx +45 -0
- package/src/pick-list/partials/search.tsx +52 -0
- package/src/pick-list/pick-list.tsx +92 -0
- package/src/pick-list/styles/empty-list-styles.ts +13 -0
- package/src/pick-list/styles/pick-group-item-styles.ts +18 -0
- package/src/pick-list/styles/search-styles.ts +28 -0
- package/src/picker/partials/modal/pick-modal.tsx +31 -0
- package/src/picker/partials/modal/pick-quantity-select.tsx +129 -0
- package/src/picker/partials/pick-amount.tsx +23 -0
- package/src/picker/partials/product-info.tsx +29 -0
- package/src/picker/partials/progress-bar.tsx +39 -0
- package/src/picker/picker.tsx +67 -0
- package/src/picker/styles/pick-amount-styles.ts +25 -0
- package/src/picker/styles/pick-modal-styles.ts +75 -0
- package/src/picker/styles/picker-styles.ts +7 -0
- package/src/picker/styles/product-info-styles.ts +21 -0
- package/src/picker/styles/progress-bar-styles.ts +13 -0
- package/src/shared/api/api-urls.ts +9 -0
- package/src/shared/badge/badge.tsx +45 -0
- package/src/shared/badge/styles/badge-styles.ts +18 -0
- package/src/shared/constants.ts +16 -0
- package/src/shared/default-pick-group-item.ts +14 -0
- package/src/shared/layout/data-column.tsx +22 -0
- package/src/shared/layout/data-format.tsx +16 -0
- package/src/shared/layout/data-row.tsx +27 -0
- package/src/shared/layout/styles/layout-styles.ts +20 -0
- package/src/shared/press-button/press-button.tsx +30 -0
- package/src/types/badge/badge.d.ts +1 -0
- package/src/types/config/config.d.ts +17 -0
- package/src/types/control/control.d.ts +6 -0
- package/src/types/pick-group/pick-group.d.ts +9 -0
- package/src/types/pick-group/search-params.d.ts +4 -0
- package/src/types/pick-item/pick-item.d.ts +14 -0
- package/src/types/scanner/scanner.d.ts +4 -0
package/README.md
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# Gatherer frontend
|
|
2
|
+
|
|
3
|
+
Gatherer is the frontend for our React Native pickers. It works seamless with our React Native backend package: [insert package here].
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install @scrumble-nl/gatherer-frontend
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
### Config
|
|
14
|
+
|
|
15
|
+
1. Put the PickerContextProvider as toplevel in the application as possible. This gives access to the `usePicker` hook within the project aswell as sets up the picklist and picker data automatically.
|
|
16
|
+
2. Add the config to its prop. See the Gatherer config table below.
|
|
17
|
+
3. Add provided components where necessary.
|
|
18
|
+
4. ???
|
|
19
|
+
5. PROFIT
|
|
20
|
+
```typescript jsx
|
|
21
|
+
import {PickerContextProvider} from '@scrumble-nl/gatherer-frontend';
|
|
22
|
+
|
|
23
|
+
//
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<PickerContextProvider config={gathererConfig}>
|
|
27
|
+
// Rest of the app
|
|
28
|
+
</PickerContextProvider>
|
|
29
|
+
);
|
|
30
|
+
```
|
|
31
|
+
#### Gatherer config
|
|
32
|
+
| Key | Description | Type | Required? |
|
|
33
|
+
|----------------------|----------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------|:---------:|
|
|
34
|
+
| `baseURL` | Base url of the back-end for the application to communicate with | `string` | `true` |
|
|
35
|
+
| `scanImplementation` | Start and stop functions for the hardware scanner | `{startScanner: () => void; stopScanner: () => void}` | `true` |
|
|
36
|
+
| `onLastPick` | What needs to happen after the last item in a group has been picked. For when you want to navigate to another screen for example | `() => void` | `true` |
|
|
37
|
+
| `language` | What language the picker should be in. Defaults to `'nl'` | <code>'nl' | 'en'</code> | `false` |
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
Gatherer frontend comes with a couple of ready-to-use components that are easy to set up and use.
|
|
41
|
+
|
|
42
|
+
### PickList
|
|
43
|
+
|
|
44
|
+
| Prop | Description | Type | Default value |
|
|
45
|
+
|--------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------|---------------|
|
|
46
|
+
| `renderItem` | A component that renders the item in the picklist. When none given a default item will be used based on default back-end parameters | `ListRenderItem<PickGroup>` | `JSX.Element` |
|
|
47
|
+
| `searchParams` | Searchable params to use for searching in the picklist. When this prop is `undefined` the picklist renders its own search text input | `{searchField: string; searchValue: string}` | |
|
|
48
|
+
| `onItemPress` | This is the callback when a user presses on the renderItem in the picklist. This callback only triggers when no `renderItem` is being passed as prop | `(pickGroup: PickGroup) => void` | |
|
|
49
|
+
| `isAfterPickList` | Determines which picklist to retrieve from the server (normal or after picklist) | `boolean` | `false` |
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
### Picker
|
|
53
|
+
|
|
54
|
+
| Prop | Description | Type | Default value |
|
|
55
|
+
|-------------------|-----------------------------------------------------------------------------------|---------------|-----------------|
|
|
56
|
+
| `children` | Children to render in the Picker | `ReactNode` | |
|
|
57
|
+
| `style` | Styling to apply to the global Picker container | `ViewStyle` | `flex: 1` |
|
|
58
|
+
| `pickModal` | Custom modal to use when multiple of the same item need to be picked | `JSX.Element` | `<PickModal />` |
|
|
59
|
+
|
|
60
|
+
The picker comes with several build-in ready-to-use child components.
|
|
61
|
+
|
|
62
|
+
#### Row
|
|
63
|
+
A row to place content in. Consists of two columns.
|
|
64
|
+
|
|
65
|
+
```typescript jsx
|
|
66
|
+
import {Picker} from '@scrumble-nl/gatherer-frontend';
|
|
67
|
+
|
|
68
|
+
//
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<Picker>
|
|
72
|
+
<Picker.Row leftTitle="Title" leftContent="Content" />
|
|
73
|
+
</Picker>
|
|
74
|
+
);
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
| Prop | Description | Type | Required? |
|
|
78
|
+
|----------------|---------------------------------------|------------------------------------------------------|-----------|
|
|
79
|
+
| `leftTitle` | Title of the left column | `string` | `true` |
|
|
80
|
+
| `leftContent` | Content of the left column | <code>JSX.Element | string | number</code> | `true` |
|
|
81
|
+
| `rightTitle` | Title of the right column | `string` | `false` |
|
|
82
|
+
| `rightContent` | Content of the right column | <code>JSX.Element | string | number</code> | `false` |
|
|
83
|
+
| `rowStyles` | Extra styling applied to the row | `ViewStyle` | `false` |
|
|
84
|
+
| `columnStyles` | Extra styling applied to both columns | `ViewStyle` | `false` |
|
|
85
|
+
|
|
86
|
+
#### Column
|
|
87
|
+
A column to place content in. This is build into `Row` by default.
|
|
88
|
+
|
|
89
|
+
```typescript jsx
|
|
90
|
+
import {Picker} from '@scrumble-nl/gatherer-frontend';
|
|
91
|
+
|
|
92
|
+
//
|
|
93
|
+
|
|
94
|
+
return <Picker.Column title="Title" data="Content" />;
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
| Prop | Description | Type | Required? |
|
|
98
|
+
|----------------|-------------------------------------|------------------------------------------------------|-----------|
|
|
99
|
+
| `title` | Title of the column | `string` | `true` |
|
|
100
|
+
| `data` | Content of the column | <code>JSX.Element | string | number</code> | `true` |
|
|
101
|
+
| `columnStyles` | Extra styling applied to the column | `ViewStyle` | `false` |
|
|
102
|
+
|
|
103
|
+
#### ProgressBar
|
|
104
|
+
A progress bar, usually shown in the bottom of the screen, to track progress when picking items.
|
|
105
|
+
Tracking of progress is done internally. You can override it, but this is not recommended behavior.
|
|
106
|
+
|
|
107
|
+
```typescript jsx
|
|
108
|
+
import {Picker} from '@scrumble-nl/gatherer-frontend';
|
|
109
|
+
|
|
110
|
+
//
|
|
111
|
+
|
|
112
|
+
return <Picker.ProgressBar />;
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
| Prop | Description | Type | Required? |
|
|
116
|
+
|----------------|-------------------------------------------------------------|-------------|-----------|
|
|
117
|
+
| `total` | Total number of items to be picked in the entire group | `number` | `false` |
|
|
118
|
+
| `current` | Current index of the item that is being picked. Starts at 0 | `number` | `false` |
|
|
119
|
+
|
|
120
|
+
#### PickAmount
|
|
121
|
+
Shows the amount to pick for the current item in a fancy UI. Uses data retrieved internally and you're unable to override anything.
|
|
122
|
+
|
|
123
|
+
```typescript jsx
|
|
124
|
+
import {Picker} from '@scrumble-nl/gatherer-frontend';
|
|
125
|
+
|
|
126
|
+
//
|
|
127
|
+
|
|
128
|
+
return <Picker.PickAmount />;
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
#### ProductInfo
|
|
132
|
+
Shows information of the current to pick item. By default it will show the barcode and the amount to pick. Uses data retrieved internally and you're unable to override anything.
|
|
133
|
+
|
|
134
|
+
```typescript jsx
|
|
135
|
+
import {Picker} from '@scrumble-nl/gatherer-frontend';
|
|
136
|
+
|
|
137
|
+
//
|
|
138
|
+
|
|
139
|
+
return <Picker.ProductInfo />;
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
A complete example of an out-of-the-box picker front-end would look like this:
|
|
143
|
+
```typescript jsx
|
|
144
|
+
import {Picker} from '@scrumble-nl/gatherer-frontend';
|
|
145
|
+
|
|
146
|
+
export const App = (): JSX.Element => {
|
|
147
|
+
return (
|
|
148
|
+
<Picker>
|
|
149
|
+
<Picker.ProductInfo />
|
|
150
|
+
<Picker.PickAmount />
|
|
151
|
+
<Picker.ProgressBar />
|
|
152
|
+
</Picker>
|
|
153
|
+
);
|
|
154
|
+
};
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## License
|
|
158
|
+
|
|
159
|
+
MIT
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.PickerContextProvider = exports.PickerContext = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _axios = _interopRequireDefault(require("axios"));
|
|
9
|
+
var _reactPolyglot = require("react-polyglot");
|
|
10
|
+
var _translations = _interopRequireDefault(require("../lang/translations"));
|
|
11
|
+
var _scanContext = require("./scan-context");
|
|
12
|
+
var _defaultPickGroupItem = require("../shared/default-pick-group-item");
|
|
13
|
+
var _apiUrls = require("../shared/api/api-urls");
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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
|
+
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
|
+
const PickerContext = /*#__PURE__*/(0, _react.createContext)({
|
|
18
|
+
baseURL: '',
|
|
19
|
+
scanImplementation: undefined,
|
|
20
|
+
currentPickGroupId: 0,
|
|
21
|
+
onLastPick: () => undefined,
|
|
22
|
+
pickItem: _defaultPickGroupItem.defaultPickGroupItem,
|
|
23
|
+
savePickGroupData: () => undefined,
|
|
24
|
+
startPicking: () => new Promise(() => undefined),
|
|
25
|
+
switchPickItem: () => new Promise(() => undefined)
|
|
26
|
+
});
|
|
27
|
+
exports.PickerContext = PickerContext;
|
|
28
|
+
const PickerContextProvider = props => {
|
|
29
|
+
const [pickItem, setPickItem] = (0, _react.useState)(_defaultPickGroupItem.defaultPickGroupItem);
|
|
30
|
+
const prevPickItem = (0, _react.useRef)(null);
|
|
31
|
+
const nextPickItem = (0, _react.useRef)(null);
|
|
32
|
+
const currentPickGroupId = (0, _react.useRef)(0);
|
|
33
|
+
const instance = _axios.default.create({
|
|
34
|
+
baseURL: props.config.baseURL
|
|
35
|
+
});
|
|
36
|
+
const language = (0, _react.useMemo)(() => props.config.language ?? 'nl', [props.config.language]);
|
|
37
|
+
const savePickGroupData = (0, _react.useCallback)(data => {
|
|
38
|
+
setPickItem(data);
|
|
39
|
+
prevPickItem.current = data.previous;
|
|
40
|
+
nextPickItem.current = data.next;
|
|
41
|
+
}, []);
|
|
42
|
+
const startPicking = (0, _react.useCallback)(async pickGroupId => {
|
|
43
|
+
return new Promise((resolve, reject) => {
|
|
44
|
+
instance.post(_apiUrls.START_PICKING_URL, {
|
|
45
|
+
pick_group_id: pickGroupId
|
|
46
|
+
}).then(response => {
|
|
47
|
+
currentPickGroupId.current = pickGroupId;
|
|
48
|
+
savePickGroupData(response.data);
|
|
49
|
+
resolve(response.data);
|
|
50
|
+
}).catch(reject);
|
|
51
|
+
});
|
|
52
|
+
}, [instance, savePickGroupData]);
|
|
53
|
+
const switchPickItem = (0, _react.useCallback)(async dir => {
|
|
54
|
+
const url = dir === 'prev' ? _apiUrls.PREV_PICK_ITEM_URL : _apiUrls.NEXT_PICK_ITEM_URL;
|
|
55
|
+
return new Promise((resolve, reject) => {
|
|
56
|
+
instance.post(url, {
|
|
57
|
+
pick_group_id: currentPickGroupId.current,
|
|
58
|
+
pick_item_id: pickItem.pickItem.id
|
|
59
|
+
}).then(response => {
|
|
60
|
+
setPickItem(response.data);
|
|
61
|
+
resolve(response.data);
|
|
62
|
+
}).catch(reject);
|
|
63
|
+
});
|
|
64
|
+
}, [instance, pickItem.pickItem.id]);
|
|
65
|
+
const context = (0, _react.useMemo)(() => ({
|
|
66
|
+
pickItem,
|
|
67
|
+
startPicking,
|
|
68
|
+
switchPickItem,
|
|
69
|
+
savePickGroupData,
|
|
70
|
+
baseURL: props.config.baseURL,
|
|
71
|
+
onLastPick: props.config.onLastPick,
|
|
72
|
+
currentPickGroupId: currentPickGroupId.current,
|
|
73
|
+
scanImplementation: props.config.scanImplementation
|
|
74
|
+
}), [pickItem, startPicking, switchPickItem, savePickGroupData, props.config.baseURL, props.config.onLastPick, props.config.scanImplementation]);
|
|
75
|
+
return /*#__PURE__*/_react.default.createElement(_reactPolyglot.I18n, {
|
|
76
|
+
locale: language,
|
|
77
|
+
messages: _translations.default[language]
|
|
78
|
+
}, /*#__PURE__*/_react.default.createElement(PickerContext.Provider, {
|
|
79
|
+
value: context
|
|
80
|
+
}, /*#__PURE__*/_react.default.createElement(_scanContext.ScanContextProvider, {
|
|
81
|
+
scanner: props.config.scanImplementation
|
|
82
|
+
}, props.children)));
|
|
83
|
+
};
|
|
84
|
+
exports.PickerContextProvider = PickerContextProvider;
|
|
85
|
+
//# sourceMappingURL=picker-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["PickerContext","createContext","baseURL","scanImplementation","undefined","currentPickGroupId","onLastPick","pickItem","defaultPickGroupItem","savePickGroupData","startPicking","Promise","switchPickItem","PickerContextProvider","props","setPickItem","useState","prevPickItem","useRef","nextPickItem","instance","axios","create","config","language","useMemo","useCallback","data","current","previous","next","pickGroupId","resolve","reject","post","START_PICKING_URL","pick_group_id","then","response","catch","dir","url","PREV_PICK_ITEM_URL","NEXT_PICK_ITEM_URL","pick_item_id","id","context","messages","children"],"sources":["picker-context.tsx"],"sourcesContent":["import React, {createContext, ReactNode, useCallback, useMemo, useRef, useState} from 'react';\n\nimport axios from 'axios';\nimport {I18n} from 'react-polyglot';\n\nimport messages from '../lang/translations';\nimport {ScanContextProvider} from './scan-context';\nimport {defaultPickGroupItem} from '../shared/default-pick-group-item';\nimport {NEXT_PICK_ITEM_URL, PREV_PICK_ITEM_URL, START_PICKING_URL} from '../shared/api/api-urls';\n\nexport interface IPickerContext {\n baseURL: string;\n scanImplementation: any;\n pickItem: PickGroupItem<any>;\n currentPickGroupId: number;\n onLastPick: () => void;\n savePickGroupData: (data: PickGroupItem<any>) => void;\n startPicking: (pickGroupId: number) => Promise<PickGroupItem<DefaultPickItem>>;\n switchPickItem: (dir: ControlDir) => Promise<PickGroupItem<DefaultPickItem>>;\n}\n\ninterface props {\n children: ReactNode;\n config: GathererConfig;\n}\n\nexport const PickerContext = createContext<IPickerContext>({\n baseURL: '',\n scanImplementation: undefined,\n currentPickGroupId: 0,\n onLastPick: () => undefined,\n pickItem: defaultPickGroupItem,\n savePickGroupData: () => undefined,\n startPicking: () => new Promise(() => undefined),\n switchPickItem: () => new Promise(() => undefined),\n});\n\nexport const PickerContextProvider = <T extends DefaultPickItem>(props: props): JSX.Element => {\n const [pickItem, setPickItem] = useState<PickGroupItem<T>>(defaultPickGroupItem);\n const prevPickItem = useRef<PickItem<T> | null>(null);\n const nextPickItem = useRef<PickItem<T> | null>(null);\n const currentPickGroupId = useRef<number>(0);\n const instance = axios.create({baseURL: props.config.baseURL});\n const language = useMemo(() => props.config.language ?? 'nl', [props.config.language]);\n\n const savePickGroupData = useCallback((data: PickGroupItem<T>): void => {\n setPickItem(data);\n prevPickItem.current = data.previous;\n nextPickItem.current = data.next;\n }, []);\n\n const startPicking = useCallback(\n async (pickGroupId: number): Promise<PickGroupItem<T>> => {\n return new Promise((resolve, reject) => {\n instance\n .post(START_PICKING_URL, {pick_group_id: pickGroupId})\n .then(response => {\n currentPickGroupId.current = pickGroupId;\n savePickGroupData(response.data);\n resolve(response.data);\n })\n .catch(reject);\n });\n },\n [instance, savePickGroupData],\n );\n\n const switchPickItem = useCallback(\n async (dir: ControlDir): Promise<PickGroupItem<T>> => {\n const url = dir === 'prev' ? PREV_PICK_ITEM_URL : NEXT_PICK_ITEM_URL;\n\n return new Promise((resolve, reject) => {\n instance\n .post(url, {\n pick_group_id: currentPickGroupId.current,\n pick_item_id: pickItem.pickItem.id,\n })\n .then(response => {\n setPickItem(response.data);\n resolve(response.data);\n })\n .catch(reject);\n });\n },\n [instance, pickItem.pickItem.id],\n );\n\n const context = useMemo(\n () => ({\n pickItem,\n startPicking,\n switchPickItem,\n savePickGroupData,\n baseURL: props.config.baseURL,\n onLastPick: props.config.onLastPick,\n currentPickGroupId: currentPickGroupId.current,\n scanImplementation: props.config.scanImplementation,\n }),\n [\n pickItem,\n startPicking,\n switchPickItem,\n savePickGroupData,\n props.config.baseURL,\n props.config.onLastPick,\n props.config.scanImplementation,\n ],\n );\n\n return (\n <I18n locale={language} messages={messages[language]}>\n <PickerContext.Provider value={context}>\n <ScanContextProvider scanner={props.config.scanImplementation}>{props.children}</ScanContextProvider>\n </PickerContext.Provider>\n </I18n>\n );\n};\n"],"mappings":"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"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ScanContextProvider = exports.ScanContext = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
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
|
+
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
|
+
const ScanContext = /*#__PURE__*/(0, _react.createContext)({
|
|
11
|
+
scanner: undefined
|
|
12
|
+
});
|
|
13
|
+
exports.ScanContext = ScanContext;
|
|
14
|
+
const ScanContextProvider = props => {
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement(ScanContext.Provider, {
|
|
16
|
+
value: props.scanner
|
|
17
|
+
}, props.children);
|
|
18
|
+
};
|
|
19
|
+
exports.ScanContextProvider = ScanContextProvider;
|
|
20
|
+
//# sourceMappingURL=scan-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ScanContext","createContext","scanner","undefined","ScanContextProvider","props","children"],"sources":["scan-context.tsx"],"sourcesContent":["import React, {createContext, ReactNode} from 'react';\n\nexport type IScanContext = {\n scanner: any;\n};\n\ninterface props {\n scanner: any;\n children: ReactNode;\n}\n\nexport const ScanContext = createContext<IScanContext>({scanner: undefined});\n\nexport const ScanContextProvider = (props: props): JSX.Element => {\n return <ScanContext.Provider value={props.scanner}>{props.children}</ScanContext.Provider>;\n};\n"],"mappings":";;;;;;AAAA;AAAsD;AAAA;AAW/C,MAAMA,WAAW,gBAAG,IAAAC,oBAAa,EAAe;EAACC,OAAO,EAAEC;AAAS,CAAC,CAAC;AAAC;AAEtE,MAAMC,mBAAmB,GAAIC,KAAY,IAAkB;EAC9D,oBAAO,6BAAC,WAAW,CAAC,QAAQ;IAAC,KAAK,EAAEA,KAAK,CAACH;EAAQ,GAAEG,KAAK,CAACC,QAAQ,CAAwB;AAC9F,CAAC;AAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useInstance = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _axios = _interopRequireDefault(require("axios"));
|
|
9
|
+
var _usePicker = require("./use-picker");
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
const useInstance = () => {
|
|
12
|
+
const {
|
|
13
|
+
baseURL
|
|
14
|
+
} = (0, _usePicker.usePicker)();
|
|
15
|
+
const instance = _axios.default.create({
|
|
16
|
+
baseURL
|
|
17
|
+
});
|
|
18
|
+
instance.interceptors.response.use(response => response, error => {
|
|
19
|
+
var _error$response$data;
|
|
20
|
+
if ((_error$response$data = error.response.data) !== null && _error$response$data !== void 0 && _error$response$data.error) {
|
|
21
|
+
_reactNative.ToastAndroid.show(error.response.data.error, _reactNative.ToastAndroid.LONG);
|
|
22
|
+
}
|
|
23
|
+
return Promise.reject(error);
|
|
24
|
+
});
|
|
25
|
+
return instance;
|
|
26
|
+
};
|
|
27
|
+
exports.useInstance = useInstance;
|
|
28
|
+
//# sourceMappingURL=use-instance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useInstance","baseURL","usePicker","instance","axios","create","interceptors","response","use","error","data","ToastAndroid","show","LONG","Promise","reject"],"sources":["use-instance.tsx"],"sourcesContent":["import {ToastAndroid} from 'react-native';\n\nimport axios, {AxiosInstance} from 'axios';\n\nimport {usePicker} from './use-picker';\n\nexport const useInstance = (): AxiosInstance => {\n const {baseURL} = usePicker();\n const instance = axios.create({baseURL});\n\n instance.interceptors.response.use(\n response => response,\n error => {\n if (error.response.data?.error) {\n ToastAndroid.show(error.response.data.error, ToastAndroid.LONG);\n }\n\n return Promise.reject(error);\n },\n );\n\n return instance;\n};\n"],"mappings":";;;;;;AAAA;AAEA;AAEA;AAAuC;AAEhC,MAAMA,WAAW,GAAG,MAAqB;EAC5C,MAAM;IAACC;EAAO,CAAC,GAAG,IAAAC,oBAAS,GAAE;EAC7B,MAAMC,QAAQ,GAAGC,cAAK,CAACC,MAAM,CAAC;IAACJ;EAAO,CAAC,CAAC;EAExCE,QAAQ,CAACG,YAAY,CAACC,QAAQ,CAACC,GAAG,CAC9BD,QAAQ,IAAIA,QAAQ,EACpBE,KAAK,IAAI;IAAA;IACL,4BAAIA,KAAK,CAACF,QAAQ,CAACG,IAAI,iDAAnB,qBAAqBD,KAAK,EAAE;MAC5BE,yBAAY,CAACC,IAAI,CAACH,KAAK,CAACF,QAAQ,CAACG,IAAI,CAACD,KAAK,EAAEE,yBAAY,CAACE,IAAI,CAAC;IACnE;IAEA,OAAOC,OAAO,CAACC,MAAM,CAACN,KAAK,CAAC;EAChC,CAAC,CACJ;EAED,OAAON,QAAQ;AACnB,CAAC;AAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.usePickItemSwitch = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _usePicker = require("./use-picker");
|
|
9
|
+
var _useInstance = require("./use-instance");
|
|
10
|
+
var _apiUrls = require("../shared/api/api-urls");
|
|
11
|
+
const usePickItemSwitch = () => {
|
|
12
|
+
const instance = (0, _useInstance.useInstance)();
|
|
13
|
+
const {
|
|
14
|
+
pickItem,
|
|
15
|
+
currentPickGroupId,
|
|
16
|
+
savePickGroupData,
|
|
17
|
+
switchPickItem,
|
|
18
|
+
onLastPick
|
|
19
|
+
} = (0, _usePicker.usePicker)();
|
|
20
|
+
const retrieveNextPickItem = (0, _react.useCallback)(() => {
|
|
21
|
+
switchPickItem('next');
|
|
22
|
+
}, [switchPickItem]);
|
|
23
|
+
const setItemToPicked = (0, _react.useCallback)((quantityPicked, metaData) => {
|
|
24
|
+
instance.patch(_apiUrls.SET_ITEM_PICKED_URL, {
|
|
25
|
+
quantity_picked: quantityPicked,
|
|
26
|
+
pick_group_id: currentPickGroupId,
|
|
27
|
+
pick_item_id: pickItem.pickItem.id,
|
|
28
|
+
metadata: metaData
|
|
29
|
+
}).then(response => {
|
|
30
|
+
if (response.data.content === 'Pick group finished') {
|
|
31
|
+
onLastPick();
|
|
32
|
+
} else {
|
|
33
|
+
savePickGroupData(response.data);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}, [currentPickGroupId, instance, onLastPick, pickItem.pickItem.id, savePickGroupData]);
|
|
37
|
+
const nextPickItem = (0, _react.useCallback)((isSkip, quantityPicked, metaData) => {
|
|
38
|
+
if (isSkip) {
|
|
39
|
+
retrieveNextPickItem();
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
setItemToPicked(quantityPicked, metaData);
|
|
43
|
+
}, [retrieveNextPickItem, setItemToPicked]);
|
|
44
|
+
const previousPickItem = (0, _react.useCallback)(() => {
|
|
45
|
+
switchPickItem('prev');
|
|
46
|
+
}, [switchPickItem]);
|
|
47
|
+
return {
|
|
48
|
+
nextPickItem,
|
|
49
|
+
previousPickItem
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
exports.usePickItemSwitch = usePickItemSwitch;
|
|
53
|
+
//# sourceMappingURL=use-pick-item-switch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["usePickItemSwitch","instance","useInstance","pickItem","currentPickGroupId","savePickGroupData","switchPickItem","onLastPick","usePicker","retrieveNextPickItem","useCallback","setItemToPicked","quantityPicked","metaData","patch","SET_ITEM_PICKED_URL","quantity_picked","pick_group_id","pick_item_id","id","metadata","then","response","data","content","nextPickItem","isSkip","previousPickItem"],"sources":["use-pick-item-switch.tsx"],"sourcesContent":["import {useCallback} from 'react';\n\nimport {usePicker} from './use-picker';\nimport {useInstance} from './use-instance';\nimport {SET_ITEM_PICKED_URL} from '../shared/api/api-urls';\n\nexport const usePickItemSwitch = (): ProductSwitch => {\n const instance = useInstance();\n const {pickItem, currentPickGroupId, savePickGroupData, switchPickItem, onLastPick} = usePicker();\n\n const retrieveNextPickItem = useCallback((): void => {\n switchPickItem('next');\n }, [switchPickItem]);\n\n const setItemToPicked = useCallback(\n (quantityPicked?: number, metaData?: any): void => {\n instance\n .patch(SET_ITEM_PICKED_URL, {\n quantity_picked: quantityPicked,\n pick_group_id: currentPickGroupId,\n pick_item_id: pickItem.pickItem.id,\n metadata: metaData,\n })\n .then(response => {\n if (response.data.content === 'Pick group finished') {\n onLastPick();\n } else {\n savePickGroupData(response.data);\n }\n });\n },\n [currentPickGroupId, instance, onLastPick, pickItem.pickItem.id, savePickGroupData],\n );\n\n const nextPickItem = useCallback(\n (isSkip: boolean, quantityPicked?: number, metaData?: any): void => {\n if (isSkip) {\n retrieveNextPickItem();\n return;\n }\n\n setItemToPicked(quantityPicked, metaData);\n },\n [retrieveNextPickItem, setItemToPicked],\n );\n\n const previousPickItem = useCallback((): void => {\n switchPickItem('prev');\n }, [switchPickItem]);\n\n return {\n nextPickItem,\n previousPickItem,\n };\n};\n"],"mappings":";;;;;;AAAA;AAEA;AACA;AACA;AAEO,MAAMA,iBAAiB,GAAG,MAAqB;EAClD,MAAMC,QAAQ,GAAG,IAAAC,wBAAW,GAAE;EAC9B,MAAM;IAACC,QAAQ;IAAEC,kBAAkB;IAAEC,iBAAiB;IAAEC,cAAc;IAAEC;EAAU,CAAC,GAAG,IAAAC,oBAAS,GAAE;EAEjG,MAAMC,oBAAoB,GAAG,IAAAC,kBAAW,EAAC,MAAY;IACjDJ,cAAc,CAAC,MAAM,CAAC;EAC1B,CAAC,EAAE,CAACA,cAAc,CAAC,CAAC;EAEpB,MAAMK,eAAe,GAAG,IAAAD,kBAAW,EAC/B,CAACE,cAAuB,EAAEC,QAAc,KAAW;IAC/CZ,QAAQ,CACHa,KAAK,CAACC,4BAAmB,EAAE;MACxBC,eAAe,EAAEJ,cAAc;MAC/BK,aAAa,EAAEb,kBAAkB;MACjCc,YAAY,EAAEf,QAAQ,CAACA,QAAQ,CAACgB,EAAE;MAClCC,QAAQ,EAAEP;IACd,CAAC,CAAC,CACDQ,IAAI,CAACC,QAAQ,IAAI;MACd,IAAIA,QAAQ,CAACC,IAAI,CAACC,OAAO,KAAK,qBAAqB,EAAE;QACjDjB,UAAU,EAAE;MAChB,CAAC,MAAM;QACHF,iBAAiB,CAACiB,QAAQ,CAACC,IAAI,CAAC;MACpC;IACJ,CAAC,CAAC;EACV,CAAC,EACD,CAACnB,kBAAkB,EAAEH,QAAQ,EAAEM,UAAU,EAAEJ,QAAQ,CAACA,QAAQ,CAACgB,EAAE,EAAEd,iBAAiB,CAAC,CACtF;EAED,MAAMoB,YAAY,GAAG,IAAAf,kBAAW,EAC5B,CAACgB,MAAe,EAAEd,cAAuB,EAAEC,QAAc,KAAW;IAChE,IAAIa,MAAM,EAAE;MACRjB,oBAAoB,EAAE;MACtB;IACJ;IAEAE,eAAe,CAACC,cAAc,EAAEC,QAAQ,CAAC;EAC7C,CAAC,EACD,CAACJ,oBAAoB,EAAEE,eAAe,CAAC,CAC1C;EAED,MAAMgB,gBAAgB,GAAG,IAAAjB,kBAAW,EAAC,MAAY;IAC7CJ,cAAc,CAAC,MAAM,CAAC;EAC1B,CAAC,EAAE,CAACA,cAAc,CAAC,CAAC;EAEpB,OAAO;IACHmB,YAAY;IACZE;EACJ,CAAC;AACL,CAAC;AAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.usePicker = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _pickerContext = require("../context/picker-context");
|
|
9
|
+
const usePicker = () => {
|
|
10
|
+
return (0, _react.useContext)(_pickerContext.PickerContext);
|
|
11
|
+
};
|
|
12
|
+
exports.usePicker = usePicker;
|
|
13
|
+
//# sourceMappingURL=use-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["usePicker","useContext","PickerContext"],"sources":["use-picker.tsx"],"sourcesContent":["import {useContext} from 'react';\n\nimport {PickerContext} from '../context/picker-context';\nimport type {IPickerContext} from '../context/picker-context';\n\nexport const usePicker = (): IPickerContext => {\n return useContext<IPickerContext>(PickerContext);\n};\n"],"mappings":";;;;;;AAAA;AAEA;AAGO,MAAMA,SAAS,GAAG,MAAsB;EAC3C,OAAO,IAAAC,iBAAU,EAAiBC,4BAAa,CAAC;AACpD,CAAC;AAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useScanner = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _scanContext = require("../context/scan-context");
|
|
9
|
+
const useScanner = onScan => {
|
|
10
|
+
const {
|
|
11
|
+
scanner
|
|
12
|
+
} = (0, _react.useContext)(_scanContext.ScanContext);
|
|
13
|
+
const callbackRef = (0, _react.useRef)(onScan);
|
|
14
|
+
(0, _react.useEffect)(() => {
|
|
15
|
+
callbackRef.current = onScan;
|
|
16
|
+
}, [onScan]);
|
|
17
|
+
const startScanner = (0, _react.useCallback)(() => {
|
|
18
|
+
setTimeout(() => {
|
|
19
|
+
scanner.startReader().then(() => {
|
|
20
|
+
scanner.onBarcodeReadSucccess(event => {
|
|
21
|
+
callbackRef.current(event.data.trim());
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
}, 100);
|
|
25
|
+
}, [scanner]);
|
|
26
|
+
const stopScanner = (0, _react.useCallback)(() => {
|
|
27
|
+
scanner.stopReader().then(scanner.offBarcodeReadSuccess);
|
|
28
|
+
}, [scanner]);
|
|
29
|
+
return {
|
|
30
|
+
startScanner,
|
|
31
|
+
stopScanner
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
exports.useScanner = useScanner;
|
|
35
|
+
//# sourceMappingURL=use-scanner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useScanner","onScan","scanner","useContext","ScanContext","callbackRef","useRef","useEffect","current","startScanner","useCallback","setTimeout","startReader","then","onBarcodeReadSucccess","event","data","trim","stopScanner","stopReader","offBarcodeReadSuccess"],"sources":["use-scanner.tsx"],"sourcesContent":["import {useCallback, useContext, useEffect, useRef} from 'react';\n\nimport {IScanContext, ScanContext} from '../context/scan-context';\n\ntype ScanCallback = (scan: string) => void;\n\nexport const useScanner = (onScan: ScanCallback): Scanner => {\n const {scanner} = useContext<IScanContext>(ScanContext);\n const callbackRef = useRef<ScanCallback>(onScan);\n\n useEffect(() => {\n callbackRef.current = onScan;\n }, [onScan]);\n\n const startScanner = useCallback((): void => {\n setTimeout(() => {\n scanner.startReader().then(() => {\n scanner.onBarcodeReadSucccess((event: {data: string}) => {\n callbackRef.current(event.data.trim());\n });\n });\n }, 100);\n }, [scanner]);\n\n const stopScanner = useCallback((): void => {\n scanner.stopReader().then(scanner.offBarcodeReadSuccess);\n }, [scanner]);\n\n return {\n startScanner,\n stopScanner,\n };\n};\n"],"mappings":";;;;;;AAAA;AAEA;AAIO,MAAMA,UAAU,GAAIC,MAAoB,IAAc;EACzD,MAAM;IAACC;EAAO,CAAC,GAAG,IAAAC,iBAAU,EAAeC,wBAAW,CAAC;EACvD,MAAMC,WAAW,GAAG,IAAAC,aAAM,EAAeL,MAAM,CAAC;EAEhD,IAAAM,gBAAS,EAAC,MAAM;IACZF,WAAW,CAACG,OAAO,GAAGP,MAAM;EAChC,CAAC,EAAE,CAACA,MAAM,CAAC,CAAC;EAEZ,MAAMQ,YAAY,GAAG,IAAAC,kBAAW,EAAC,MAAY;IACzCC,UAAU,CAAC,MAAM;MACbT,OAAO,CAACU,WAAW,EAAE,CAACC,IAAI,CAAC,MAAM;QAC7BX,OAAO,CAACY,qBAAqB,CAAEC,KAAqB,IAAK;UACrDV,WAAW,CAACG,OAAO,CAACO,KAAK,CAACC,IAAI,CAACC,IAAI,EAAE,CAAC;QAC1C,CAAC,CAAC;MACN,CAAC,CAAC;IACN,CAAC,EAAE,GAAG,CAAC;EACX,CAAC,EAAE,CAACf,OAAO,CAAC,CAAC;EAEb,MAAMgB,WAAW,GAAG,IAAAR,kBAAW,EAAC,MAAY;IACxCR,OAAO,CAACiB,UAAU,EAAE,CAACN,IAAI,CAACX,OAAO,CAACkB,qBAAqB,CAAC;EAC5D,CAAC,EAAE,CAAClB,OAAO,CAAC,CAAC;EAEb,OAAO;IACHO,YAAY;IACZS;EACJ,CAAC;AACL,CAAC;AAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "PickList", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _pickList.PickList;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "Picker", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _picker.Picker;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "PickerContextProvider", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _pickerContext.PickerContextProvider;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "usePickItemSwitch", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _usePickItemSwitch.usePickItemSwitch;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "usePicker", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _usePicker.usePicker;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
var _picker = require("./picker/picker");
|
|
37
|
+
var _usePicker = require("./hooks/use-picker");
|
|
38
|
+
var _pickList = require("./pick-list/pick-list");
|
|
39
|
+
var _usePickItemSwitch = require("./hooks/use-pick-item-switch");
|
|
40
|
+
var _pickerContext = require("./context/picker-context");
|
|
41
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["index.tsx"],"sourcesContent":["export {Picker} from './picker/picker';\nexport {usePicker} from './hooks/use-picker';\nexport {PickList} from './pick-list/pick-list';\nexport {usePickItemSwitch} from './hooks/use-pick-item-switch';\nexport {PickerContextProvider} from './context/picker-context';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.pickList = void 0;
|
|
7
|
+
const pickList = {
|
|
8
|
+
'pick-list.empty-list.loading': 'Retrieving items',
|
|
9
|
+
'pick-list.empty-list.not-found': 'Nothing found',
|
|
10
|
+
'pick-list.item.is-picked.true': 'Picked',
|
|
11
|
+
'pick-list.item.is-picked.false': 'Not Picked'
|
|
12
|
+
};
|
|
13
|
+
exports.pickList = pickList;
|
|
14
|
+
//# sourceMappingURL=pick-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["pickList"],"sources":["pick-list.ts"],"sourcesContent":["export const pickList = {\n 'pick-list.empty-list.loading': 'Retrieving items',\n 'pick-list.empty-list.not-found': 'Nothing found',\n 'pick-list.item.is-picked.true': 'Picked',\n 'pick-list.item.is-picked.false': 'Not Picked',\n};\n"],"mappings":";;;;;;AAAO,MAAMA,QAAQ,GAAG;EACpB,8BAA8B,EAAE,kBAAkB;EAClD,gCAAgC,EAAE,eAAe;EACjD,+BAA+B,EAAE,QAAQ;EACzC,gCAAgC,EAAE;AACtC,CAAC;AAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.picker = void 0;
|
|
7
|
+
const picker = {
|
|
8
|
+
'picker.modal.picked': 'Gepickt',
|
|
9
|
+
'picker.modal.pick-items': 'Pick items',
|
|
10
|
+
'picker.modal.not-enough-pick': 'Not everything has been picked',
|
|
11
|
+
'picker.modal.confirm-error': 'Confirm with the Pick items button',
|
|
12
|
+
'picker.product-info.barcode': 'Barcode',
|
|
13
|
+
'picker.product-info.pick-quantity': 'Pick quantity'
|
|
14
|
+
};
|
|
15
|
+
exports.picker = picker;
|
|
16
|
+
//# sourceMappingURL=picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["picker"],"sources":["picker.ts"],"sourcesContent":["export const picker = {\n 'picker.modal.picked': 'Gepickt',\n 'picker.modal.pick-items': 'Pick items',\n 'picker.modal.not-enough-pick': 'Not everything has been picked',\n 'picker.modal.confirm-error': 'Confirm with the Pick items button',\n 'picker.product-info.barcode': 'Barcode',\n 'picker.product-info.pick-quantity': 'Pick quantity',\n};\n"],"mappings":";;;;;;AAAO,MAAMA,MAAM,GAAG;EAClB,qBAAqB,EAAE,SAAS;EAChC,yBAAyB,EAAE,YAAY;EACvC,8BAA8B,EAAE,gCAAgC;EAChE,4BAA4B,EAAE,oCAAoC;EAClE,6BAA6B,EAAE,SAAS;EACxC,mCAAmC,EAAE;AACzC,CAAC;AAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.englishTranslations = void 0;
|
|
7
|
+
var _picker = require("./components/picker");
|
|
8
|
+
var _pickList = require("./components/pick-list");
|
|
9
|
+
const englishTranslations = {
|
|
10
|
+
en: {
|
|
11
|
+
..._pickList.pickList,
|
|
12
|
+
..._picker.picker
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
exports.englishTranslations = englishTranslations;
|
|
16
|
+
//# sourceMappingURL=english.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["englishTranslations","en","pickList","picker"],"sources":["english.ts"],"sourcesContent":["import {picker} from './components/picker';\nimport {pickList} from './components/pick-list';\n\nexport const englishTranslations = {\n en: {\n ...pickList,\n ...picker,\n },\n};\n"],"mappings":";;;;;;AAAA;AACA;AAEO,MAAMA,mBAAmB,GAAG;EAC/BC,EAAE,EAAE;IACA,GAAGC,kBAAQ;IACX,GAAGC;EACP;AACJ,CAAC;AAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.pickList = void 0;
|
|
7
|
+
const pickList = {
|
|
8
|
+
'pick-list.empty-list.loading': 'Items ophalen',
|
|
9
|
+
'pick-list.empty-list.not-found': 'Niks gevonden',
|
|
10
|
+
'pick-list.item.is-picked.true': 'Picked',
|
|
11
|
+
'pick-list.item.is-picked.false': 'Niet Picked'
|
|
12
|
+
};
|
|
13
|
+
exports.pickList = pickList;
|
|
14
|
+
//# sourceMappingURL=pick-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["pickList"],"sources":["pick-list.ts"],"sourcesContent":["export const pickList = {\n 'pick-list.empty-list.loading': 'Items ophalen',\n 'pick-list.empty-list.not-found': 'Niks gevonden',\n 'pick-list.item.is-picked.true': 'Picked',\n 'pick-list.item.is-picked.false': 'Niet Picked',\n};\n"],"mappings":";;;;;;AAAO,MAAMA,QAAQ,GAAG;EACpB,8BAA8B,EAAE,eAAe;EAC/C,gCAAgC,EAAE,eAAe;EACjD,+BAA+B,EAAE,QAAQ;EACzC,gCAAgC,EAAE;AACtC,CAAC;AAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.picker = void 0;
|
|
7
|
+
const picker = {
|
|
8
|
+
'picker.modal.picked': 'Gepickt',
|
|
9
|
+
'picker.modal.pick-items': 'Pick items',
|
|
10
|
+
'picker.modal.not-enough-pick': 'Niet alles is gepickt',
|
|
11
|
+
'picker.modal.confirm-error': 'Bevestig met de Pick items knop',
|
|
12
|
+
'picker.product-info.barcode': 'Barcode',
|
|
13
|
+
'picker.product-info.pick-quantity': 'Pick aantal'
|
|
14
|
+
};
|
|
15
|
+
exports.picker = picker;
|
|
16
|
+
//# sourceMappingURL=picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["picker"],"sources":["picker.ts"],"sourcesContent":["export const picker = {\n 'picker.modal.picked': 'Gepickt',\n 'picker.modal.pick-items': 'Pick items',\n 'picker.modal.not-enough-pick': 'Niet alles is gepickt',\n 'picker.modal.confirm-error': 'Bevestig met de Pick items knop',\n 'picker.product-info.barcode': 'Barcode',\n 'picker.product-info.pick-quantity': 'Pick aantal',\n};\n"],"mappings":";;;;;;AAAO,MAAMA,MAAM,GAAG;EAClB,qBAAqB,EAAE,SAAS;EAChC,yBAAyB,EAAE,YAAY;EACvC,8BAA8B,EAAE,uBAAuB;EACvD,4BAA4B,EAAE,iCAAiC;EAC/D,6BAA6B,EAAE,SAAS;EACxC,mCAAmC,EAAE;AACzC,CAAC;AAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.dutchTranslations = void 0;
|
|
7
|
+
var _picker = require("./components/picker");
|
|
8
|
+
var _pickList = require("./components/pick-list");
|
|
9
|
+
const dutchTranslations = {
|
|
10
|
+
nl: {
|
|
11
|
+
..._pickList.pickList,
|
|
12
|
+
..._picker.picker
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
exports.dutchTranslations = dutchTranslations;
|
|
16
|
+
//# sourceMappingURL=dutch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["dutchTranslations","nl","pickList","picker"],"sources":["dutch.ts"],"sourcesContent":["import {picker} from './components/picker';\nimport {pickList} from './components/pick-list';\n\nexport const dutchTranslations = {\n nl: {\n ...pickList,\n ...picker,\n },\n};\n"],"mappings":";;;;;;AAAA;AACA;AAEO,MAAMA,iBAAiB,GAAG;EAC7BC,EAAE,EAAE;IACA,GAAGC,kBAAQ;IACX,GAAGC;EACP;AACJ,CAAC;AAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _dutch = require("./nl/dutch");
|
|
8
|
+
var _english = require("./en/english");
|
|
9
|
+
const translations = {
|
|
10
|
+
..._english.englishTranslations,
|
|
11
|
+
..._dutch.dutchTranslations
|
|
12
|
+
};
|
|
13
|
+
var _default = translations;
|
|
14
|
+
exports.default = _default;
|
|
15
|
+
//# sourceMappingURL=translations.js.map
|