@scrumble-nl/gatherer-frontend 0.2.2 → 0.2.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.
@@ -29,8 +29,10 @@ const PickGroupItem = props => {
29
29
  is_picked
30
30
  } = props.renderProps.item;
31
31
  const handlePress = () => {
32
- var _props$onPress;
33
- (_props$onPress = props.onPress) === null || _props$onPress === void 0 ? void 0 : _props$onPress.call(props, props.renderProps.item);
32
+ if (props.onPress) {
33
+ props.onPress(props.renderProps.item);
34
+ return;
35
+ }
34
36
  startPicking(props.renderProps.item.id);
35
37
  };
36
38
  return /*#__PURE__*/_react.default.createElement(_pressButton.PressButton, {
@@ -1 +1 @@
1
- {"version":3,"names":["listItem","label","text","styles","PickGroupItem","props","t","useTranslation","startPicking","useGatherer","id","is_picked","renderProps","item","handlePress","onPress"],"sources":["pick-group-item.tsx"],"sourcesContent":["import React from 'react';\nimport {ListRenderItemInfo, View, Text} from 'react-native';\n\nimport {useTranslation} from 'react-i18next';\n\nimport {Badge} from '../../shared/badge/badge';\nimport {useGatherer} from '../../hooks/use-gatherer';\nimport {styles} from '../styles/pick-group-item-styles';\nimport {PressButton} from '../../shared/press-button/press-button';\n\nexport interface props<T> {\n renderProps: ListRenderItemInfo<T>;\n onPress?: (pickGroup: T) => void;\n}\n\nconst {listItem, label, text} = styles;\n\nexport const PickGroupItem = <T extends PickGroup>(props: props<T>): JSX.Element => {\n const {t} = useTranslation();\n const {startPicking} = useGatherer();\n const {id, is_picked} = props.renderProps.item;\n\n const handlePress = (): void => {\n props.onPress?.(props.renderProps.item);\n startPicking(props.renderProps.item.id);\n };\n\n return (\n <PressButton style={listItem} onPress={handlePress}>\n <View>\n <Text style={label}>ID</Text>\n <Text style={text}>{id}</Text>\n </View>\n <View>\n <Badge variant={is_picked ? 'success' : 'danger'}>\n {t(`pick-list.item.is-picked.${is_picked ? 'true' : 'false'}`)}\n </Badge>\n </View>\n </PressButton>\n );\n};\n"],"mappings":";;;;;;AAAA;AACA;AAEA;AAEA;AACA;AACA;AACA;AAAmE;AAOnE,MAAM;EAACA,QAAQ;EAAEC,KAAK;EAAEC;AAAI,CAAC,GAAGC,2BAAM;AAE/B,MAAMC,aAAa,GAAyBC,KAAe,IAAkB;EAChF,MAAM;IAACC;EAAC,CAAC,GAAG,IAAAC,4BAAc,GAAE;EAC5B,MAAM;IAACC;EAAY,CAAC,GAAG,IAAAC,wBAAW,GAAE;EACpC,MAAM;IAACC,EAAE;IAAEC;EAAS,CAAC,GAAGN,KAAK,CAACO,WAAW,CAACC,IAAI;EAE9C,MAAMC,WAAW,GAAG,MAAY;IAAA;IAC5B,kBAAAT,KAAK,CAACU,OAAO,mDAAb,oBAAAV,KAAK,EAAWA,KAAK,CAACO,WAAW,CAACC,IAAI,CAAC;IACvCL,YAAY,CAACH,KAAK,CAACO,WAAW,CAACC,IAAI,CAACH,EAAE,CAAC;EAC3C,CAAC;EAED,oBACI,6BAAC,wBAAW;IAAC,KAAK,EAAEV,QAAS;IAAC,OAAO,EAAEc;EAAY,gBAC/C,6BAAC,iBAAI,qBACD,6BAAC,iBAAI;IAAC,KAAK,EAAEb;EAAM,QAAU,eAC7B,6BAAC,iBAAI;IAAC,KAAK,EAAEC;EAAK,GAAEQ,EAAE,CAAQ,CAC3B,eACP,6BAAC,iBAAI,qBACD,6BAAC,YAAK;IAAC,OAAO,EAAEC,SAAS,GAAG,SAAS,GAAG;EAAS,GAC5CL,CAAC,CAAE,4BAA2BK,SAAS,GAAG,MAAM,GAAG,OAAQ,EAAC,CAAC,CAC1D,CACL,CACG;AAEtB,CAAC;AAAC"}
1
+ {"version":3,"names":["listItem","label","text","styles","PickGroupItem","props","t","useTranslation","startPicking","useGatherer","id","is_picked","renderProps","item","handlePress","onPress"],"sources":["pick-group-item.tsx"],"sourcesContent":["import React from 'react';\nimport {ListRenderItemInfo, View, Text} from 'react-native';\n\nimport {useTranslation} from 'react-i18next';\n\nimport {Badge} from '../../shared/badge/badge';\nimport {useGatherer} from '../../hooks/use-gatherer';\nimport {styles} from '../styles/pick-group-item-styles';\nimport {PressButton} from '../../shared/press-button/press-button';\n\nexport interface props<T> {\n renderProps: ListRenderItemInfo<T>;\n onPress?: (pickGroup: T) => void;\n}\n\nconst {listItem, label, text} = styles;\n\nexport const PickGroupItem = <T extends PickGroup>(props: props<T>): JSX.Element => {\n const {t} = useTranslation();\n const {startPicking} = useGatherer();\n const {id, is_picked} = props.renderProps.item;\n\n const handlePress = (): void => {\n if (props.onPress) {\n props.onPress(props.renderProps.item);\n return;\n }\n\n startPicking(props.renderProps.item.id);\n };\n\n return (\n <PressButton style={listItem} onPress={handlePress}>\n <View>\n <Text style={label}>ID</Text>\n <Text style={text}>{id}</Text>\n </View>\n <View>\n <Badge variant={is_picked ? 'success' : 'danger'}>\n {t(`pick-list.item.is-picked.${is_picked ? 'true' : 'false'}`)}\n </Badge>\n </View>\n </PressButton>\n );\n};\n"],"mappings":";;;;;;AAAA;AACA;AAEA;AAEA;AACA;AACA;AACA;AAAmE;AAOnE,MAAM;EAACA,QAAQ;EAAEC,KAAK;EAAEC;AAAI,CAAC,GAAGC,2BAAM;AAE/B,MAAMC,aAAa,GAAyBC,KAAe,IAAkB;EAChF,MAAM;IAACC;EAAC,CAAC,GAAG,IAAAC,4BAAc,GAAE;EAC5B,MAAM;IAACC;EAAY,CAAC,GAAG,IAAAC,wBAAW,GAAE;EACpC,MAAM;IAACC,EAAE;IAAEC;EAAS,CAAC,GAAGN,KAAK,CAACO,WAAW,CAACC,IAAI;EAE9C,MAAMC,WAAW,GAAG,MAAY;IAC5B,IAAIT,KAAK,CAACU,OAAO,EAAE;MACfV,KAAK,CAACU,OAAO,CAACV,KAAK,CAACO,WAAW,CAACC,IAAI,CAAC;MACrC;IACJ;IAEAL,YAAY,CAACH,KAAK,CAACO,WAAW,CAACC,IAAI,CAACH,EAAE,CAAC;EAC3C,CAAC;EAED,oBACI,6BAAC,wBAAW;IAAC,KAAK,EAAEV,QAAS;IAAC,OAAO,EAAEc;EAAY,gBAC/C,6BAAC,iBAAI,qBACD,6BAAC,iBAAI;IAAC,KAAK,EAAEb;EAAM,QAAU,eAC7B,6BAAC,iBAAI;IAAC,KAAK,EAAEC;EAAK,GAAEQ,EAAE,CAAQ,CAC3B,eACP,6BAAC,iBAAI,qBACD,6BAAC,YAAK;IAAC,OAAO,EAAEC,SAAS,GAAG,SAAS,GAAG;EAAS,GAC5CL,CAAC,CAAE,4BAA2BK,SAAS,GAAG,MAAM,GAAG,OAAQ,EAAC,CAAC,CAC1D,CACL,CACG;AAEtB,CAAC;AAAC"}
@@ -22,8 +22,10 @@ export const PickGroupItem = props => {
22
22
  is_picked
23
23
  } = props.renderProps.item;
24
24
  const handlePress = () => {
25
- var _props$onPress;
26
- (_props$onPress = props.onPress) === null || _props$onPress === void 0 ? void 0 : _props$onPress.call(props, props.renderProps.item);
25
+ if (props.onPress) {
26
+ props.onPress(props.renderProps.item);
27
+ return;
28
+ }
27
29
  startPicking(props.renderProps.item.id);
28
30
  };
29
31
  return /*#__PURE__*/React.createElement(PressButton, {
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","Text","useTranslation","Badge","useGatherer","styles","PressButton","listItem","label","text","PickGroupItem","props","t","startPicking","id","is_picked","renderProps","item","handlePress","onPress"],"sources":["pick-group-item.tsx"],"sourcesContent":["import React from 'react';\nimport {ListRenderItemInfo, View, Text} from 'react-native';\n\nimport {useTranslation} from 'react-i18next';\n\nimport {Badge} from '../../shared/badge/badge';\nimport {useGatherer} from '../../hooks/use-gatherer';\nimport {styles} from '../styles/pick-group-item-styles';\nimport {PressButton} from '../../shared/press-button/press-button';\n\nexport interface props<T> {\n renderProps: ListRenderItemInfo<T>;\n onPress?: (pickGroup: T) => void;\n}\n\nconst {listItem, label, text} = styles;\n\nexport const PickGroupItem = <T extends PickGroup>(props: props<T>): JSX.Element => {\n const {t} = useTranslation();\n const {startPicking} = useGatherer();\n const {id, is_picked} = props.renderProps.item;\n\n const handlePress = (): void => {\n props.onPress?.(props.renderProps.item);\n startPicking(props.renderProps.item.id);\n };\n\n return (\n <PressButton style={listItem} onPress={handlePress}>\n <View>\n <Text style={label}>ID</Text>\n <Text style={text}>{id}</Text>\n </View>\n <View>\n <Badge variant={is_picked ? 'success' : 'danger'}>\n {t(`pick-list.item.is-picked.${is_picked ? 'true' : 'false'}`)}\n </Badge>\n </View>\n </PressButton>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAA4BC,IAAI,EAAEC,IAAI,QAAO,cAAc;AAE3D,SAAQC,cAAc,QAAO,eAAe;AAE5C,SAAQC,KAAK,QAAO,0BAA0B;AAC9C,SAAQC,WAAW,QAAO,0BAA0B;AACpD,SAAQC,MAAM,QAAO,kCAAkC;AACvD,SAAQC,WAAW,QAAO,wCAAwC;AAOlE,MAAM;EAACC,QAAQ;EAAEC,KAAK;EAAEC;AAAI,CAAC,GAAGJ,MAAM;AAEtC,OAAO,MAAMK,aAAa,GAAyBC,KAAe,IAAkB;EAChF,MAAM;IAACC;EAAC,CAAC,GAAGV,cAAc,EAAE;EAC5B,MAAM;IAACW;EAAY,CAAC,GAAGT,WAAW,EAAE;EACpC,MAAM;IAACU,EAAE;IAAEC;EAAS,CAAC,GAAGJ,KAAK,CAACK,WAAW,CAACC,IAAI;EAE9C,MAAMC,WAAW,GAAG,MAAY;IAAA;IAC5B,kBAAAP,KAAK,CAACQ,OAAO,mDAAb,oBAAAR,KAAK,EAAWA,KAAK,CAACK,WAAW,CAACC,IAAI,CAAC;IACvCJ,YAAY,CAACF,KAAK,CAACK,WAAW,CAACC,IAAI,CAACH,EAAE,CAAC;EAC3C,CAAC;EAED,oBACI,oBAAC,WAAW;IAAC,KAAK,EAAEP,QAAS;IAAC,OAAO,EAAEW;EAAY,gBAC/C,oBAAC,IAAI,qBACD,oBAAC,IAAI;IAAC,KAAK,EAAEV;EAAM,QAAU,eAC7B,oBAAC,IAAI;IAAC,KAAK,EAAEC;EAAK,GAAEK,EAAE,CAAQ,CAC3B,eACP,oBAAC,IAAI,qBACD,oBAAC,KAAK;IAAC,OAAO,EAAEC,SAAS,GAAG,SAAS,GAAG;EAAS,GAC5CH,CAAC,CAAE,4BAA2BG,SAAS,GAAG,MAAM,GAAG,OAAQ,EAAC,CAAC,CAC1D,CACL,CACG;AAEtB,CAAC"}
1
+ {"version":3,"names":["React","View","Text","useTranslation","Badge","useGatherer","styles","PressButton","listItem","label","text","PickGroupItem","props","t","startPicking","id","is_picked","renderProps","item","handlePress","onPress"],"sources":["pick-group-item.tsx"],"sourcesContent":["import React from 'react';\nimport {ListRenderItemInfo, View, Text} from 'react-native';\n\nimport {useTranslation} from 'react-i18next';\n\nimport {Badge} from '../../shared/badge/badge';\nimport {useGatherer} from '../../hooks/use-gatherer';\nimport {styles} from '../styles/pick-group-item-styles';\nimport {PressButton} from '../../shared/press-button/press-button';\n\nexport interface props<T> {\n renderProps: ListRenderItemInfo<T>;\n onPress?: (pickGroup: T) => void;\n}\n\nconst {listItem, label, text} = styles;\n\nexport const PickGroupItem = <T extends PickGroup>(props: props<T>): JSX.Element => {\n const {t} = useTranslation();\n const {startPicking} = useGatherer();\n const {id, is_picked} = props.renderProps.item;\n\n const handlePress = (): void => {\n if (props.onPress) {\n props.onPress(props.renderProps.item);\n return;\n }\n\n startPicking(props.renderProps.item.id);\n };\n\n return (\n <PressButton style={listItem} onPress={handlePress}>\n <View>\n <Text style={label}>ID</Text>\n <Text style={text}>{id}</Text>\n </View>\n <View>\n <Badge variant={is_picked ? 'success' : 'danger'}>\n {t(`pick-list.item.is-picked.${is_picked ? 'true' : 'false'}`)}\n </Badge>\n </View>\n </PressButton>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAA4BC,IAAI,EAAEC,IAAI,QAAO,cAAc;AAE3D,SAAQC,cAAc,QAAO,eAAe;AAE5C,SAAQC,KAAK,QAAO,0BAA0B;AAC9C,SAAQC,WAAW,QAAO,0BAA0B;AACpD,SAAQC,MAAM,QAAO,kCAAkC;AACvD,SAAQC,WAAW,QAAO,wCAAwC;AAOlE,MAAM;EAACC,QAAQ;EAAEC,KAAK;EAAEC;AAAI,CAAC,GAAGJ,MAAM;AAEtC,OAAO,MAAMK,aAAa,GAAyBC,KAAe,IAAkB;EAChF,MAAM;IAACC;EAAC,CAAC,GAAGV,cAAc,EAAE;EAC5B,MAAM;IAACW;EAAY,CAAC,GAAGT,WAAW,EAAE;EACpC,MAAM;IAACU,EAAE;IAAEC;EAAS,CAAC,GAAGJ,KAAK,CAACK,WAAW,CAACC,IAAI;EAE9C,MAAMC,WAAW,GAAG,MAAY;IAC5B,IAAIP,KAAK,CAACQ,OAAO,EAAE;MACfR,KAAK,CAACQ,OAAO,CAACR,KAAK,CAACK,WAAW,CAACC,IAAI,CAAC;MACrC;IACJ;IAEAJ,YAAY,CAACF,KAAK,CAACK,WAAW,CAACC,IAAI,CAACH,EAAE,CAAC;EAC3C,CAAC;EAED,oBACI,oBAAC,WAAW;IAAC,KAAK,EAAEP,QAAS;IAAC,OAAO,EAAEW;EAAY,gBAC/C,oBAAC,IAAI,qBACD,oBAAC,IAAI;IAAC,KAAK,EAAEV;EAAM,QAAU,eAC7B,oBAAC,IAAI;IAAC,KAAK,EAAEC;EAAK,GAAEK,EAAE,CAAQ,CAC3B,eACP,oBAAC,IAAI,qBACD,oBAAC,KAAK;IAAC,OAAO,EAAEC,SAAS,GAAG,SAAS,GAAG;EAAS,GAC5CH,CAAC,CAAE,4BAA2BG,SAAS,GAAG,MAAM,GAAG,OAAQ,EAAC,CAAC,CAC1D,CACL,CACG;AAEtB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrumble-nl/gatherer-frontend",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "main": "lib/commonjs/index",
5
5
  "module": "lib/module/index",
6
6
  "types": "lib/typescript/index.d.ts",
@@ -21,7 +21,11 @@ export const PickGroupItem = <T extends PickGroup>(props: props<T>): JSX.Element
21
21
  const {id, is_picked} = props.renderProps.item;
22
22
 
23
23
  const handlePress = (): void => {
24
- props.onPress?.(props.renderProps.item);
24
+ if (props.onPress) {
25
+ props.onPress(props.renderProps.item);
26
+ return;
27
+ }
28
+
25
29
  startPicking(props.renderProps.item.id);
26
30
  };
27
31