@draftbit/core 43.4.9 → 43.4.11-2f015a.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/lib/commonjs/components/Accordion/AccordionGroup.js +2 -2
  2. package/lib/commonjs/components/Accordion/AccordionGroup.js.map +1 -1
  3. package/lib/commonjs/components/DatePicker/DatePicker.js +2 -9
  4. package/lib/commonjs/components/DatePicker/DatePicker.js.map +1 -1
  5. package/lib/commonjs/components/Elevation.js +14 -3
  6. package/lib/commonjs/components/Elevation.js.map +1 -1
  7. package/lib/commonjs/components/FieldSearchBarFull.js.map +1 -1
  8. package/lib/commonjs/components/NumberInput.js +15 -17
  9. package/lib/commonjs/components/NumberInput.js.map +1 -1
  10. package/lib/commonjs/components/TextField.js +8 -5
  11. package/lib/commonjs/components/TextField.js.map +1 -1
  12. package/lib/commonjs/index.js.map +1 -1
  13. package/lib/commonjs/mappings/HeaderLarge.js.map +1 -1
  14. package/lib/commonjs/mappings/Icon.js +3 -1
  15. package/lib/commonjs/mappings/Icon.js.map +1 -1
  16. package/lib/commonjs/mappings/Image.js.map +1 -1
  17. package/lib/commonjs/mappings/KeyboardAwareScrollView.js +48 -0
  18. package/lib/commonjs/mappings/KeyboardAwareScrollView.js.map +1 -0
  19. package/lib/commonjs/mappings/MapCallout.js.map +1 -1
  20. package/lib/commonjs/mappings/RowBodyIcon.js.map +1 -1
  21. package/lib/commonjs/mappings/RowHeadlineImageCaption.js.map +1 -1
  22. package/lib/commonjs/mappings/RowHeadlineImageIcon.js.map +1 -1
  23. package/lib/module/components/Accordion/AccordionGroup.js +2 -2
  24. package/lib/module/components/Accordion/AccordionGroup.js.map +1 -1
  25. package/lib/module/components/DatePicker/DatePicker.js +3 -9
  26. package/lib/module/components/DatePicker/DatePicker.js.map +1 -1
  27. package/lib/module/components/NumberInput.js +15 -17
  28. package/lib/module/components/NumberInput.js.map +1 -1
  29. package/lib/module/components/RadioButton/index.js.map +1 -1
  30. package/lib/module/components/Switch.js +10 -21
  31. package/lib/module/components/Switch.js.map +1 -1
  32. package/lib/module/components/TextField.js +8 -5
  33. package/lib/module/components/TextField.js.map +1 -1
  34. package/lib/module/mappings/HeaderMedium.js.map +1 -1
  35. package/lib/module/mappings/Icon.js +3 -1
  36. package/lib/module/mappings/Icon.js.map +1 -1
  37. package/lib/module/mappings/KeyboardAwareScrollView.js +39 -0
  38. package/lib/module/mappings/KeyboardAwareScrollView.js.map +1 -0
  39. package/lib/typescript/src/mappings/Icon.d.ts +1 -1
  40. package/lib/typescript/src/mappings/KeyboardAwareScrollView.d.ts +82 -0
  41. package/package.json +3 -3
  42. package/src/components/Accordion/AccordionGroup.js +1 -1
  43. package/src/components/Accordion/AccordionGroup.tsx +1 -1
  44. package/src/components/DatePicker/DatePicker.js +2 -4
  45. package/src/components/DatePicker/DatePicker.tsx +1 -14
  46. package/src/components/NumberInput.js +13 -14
  47. package/src/components/NumberInput.tsx +16 -31
  48. package/src/components/TextField.js +5 -4
  49. package/src/components/TextField.tsx +6 -5
  50. package/src/mappings/Icon.js +4 -1
  51. package/src/mappings/Icon.ts +4 -1
  52. package/src/mappings/KeyboardAwareScrollView.js +38 -0
  53. package/src/mappings/KeyboardAwareScrollView.ts +48 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["HeaderMedium.js"],"names":["GROUPS","COMPONENT_TYPES","FORM_TYPES","PROP_TYPES","SEED_DATA","name","tag","description","category","header","preview_image_url","supports_list_render","props","title","group","data","label","formType","string","propType","STRING","defaultValue","editable","required","buttonText","icon","basic","ASSET","onPress","action","layout"],"mappings":"AAAA,SAASA,MAAT,EAAiBC,eAAjB,EAAkCC,UAAlC,EAA8CC,UAA9C,QAAiE,iBAAjE;AACA,OAAO,MAAMC,SAAS,GAAG,CACrB;AACIC,EAAAA,IAAI,EAAE,eADV;AAEIC,EAAAA,GAAG,EAAE,cAFT;AAGIC,EAAAA,WAAW,EAAE,yEAHjB;AAIIC,EAAAA,QAAQ,EAAEP,eAAe,CAACQ,MAJ9B;AAKIC,EAAAA,iBAAiB,EAAE,oDALvB;AAMIC,EAAAA,oBAAoB,EAAE,KAN1B;AAOIC,EAAAA,KAAK,EAAE;AACHC,IAAAA,KAAK,EAAE;AACHC,MAAAA,KAAK,EAAEd,MAAM,CAACe,IADX;AAEHC,MAAAA,KAAK,EAAE,OAFJ;AAGHT,MAAAA,WAAW,EAAE,iBAHV;AAIHU,MAAAA,QAAQ,EAAEf,UAAU,CAACgB,MAJlB;AAKHC,MAAAA,QAAQ,EAAEhB,UAAU,CAACiB,MALlB;AAMHC,MAAAA,YAAY,EAAE,OANX;AAOHC,MAAAA,QAAQ,EAAE,IAPP;AAQHC,MAAAA,QAAQ,EAAE;AARP,KADJ;AAWHC,IAAAA,UAAU,EAAE;AACRV,MAAAA,KAAK,EAAEd,MAAM,CAACe,IADN;AAERC,MAAAA,KAAK,EAAE,aAFC;AAGRT,MAAAA,WAAW,EAAE,sCAHL;AAIRU,MAAAA,QAAQ,EAAEf,UAAU,CAACgB,MAJb;AAKRC,MAAAA,QAAQ,EAAEhB,UAAU,CAACiB,MALb;AAMRC,MAAAA,YAAY,EAAE,SANN;AAORC,MAAAA,QAAQ,EAAE,IAPF;AAQRC,MAAAA,QAAQ,EAAE;AARF,KAXT;AAqBHE,IAAAA,IAAI,EAAE;AACFX,MAAAA,KAAK,EAAEd,MAAM,CAAC0B,KADZ;AAEFV,MAAAA,KAAK,EAAE,MAFL;AAGFT,MAAAA,WAAW,EAAE,yBAHX;AAIFU,MAAAA,QAAQ,EAAEf,UAAU,CAACuB,IAJnB;AAKFN,MAAAA,QAAQ,EAAEhB,UAAU,CAACwB,KALnB;AAMFN,MAAAA,YAAY,EAAE,IANZ;AAOFC,MAAAA,QAAQ,EAAE,IAPR;AAQFC,MAAAA,QAAQ,EAAE;AARR,KArBH;AA+BHK,IAAAA,OAAO,EAAE;AACLd,MAAAA,KAAK,EAAEd,MAAM,CAAC0B,KADT;AAELV,MAAAA,KAAK,EAAE,QAFF;AAGLT,MAAAA,WAAW,EAAE,uCAHR;AAILe,MAAAA,QAAQ,EAAE,IAJL;AAKLC,MAAAA,QAAQ,EAAE,KALL;AAMLN,MAAAA,QAAQ,EAAEf,UAAU,CAAC2B,MANhB;AAOLV,MAAAA,QAAQ,EAAEhB,UAAU,CAACiB,MAPhB;AAQLC,MAAAA,YAAY,EAAE;AART;AA/BN,GAPX;AAiDIS,EAAAA,MAAM,EAAE;AAjDZ,CADqB,CAAlB","sourcesContent":["import { GROUPS, COMPONENT_TYPES, FORM_TYPES, PROP_TYPES, } from \"@draftbit/types\";\nexport const SEED_DATA = [\n {\n name: \"Header Medium\",\n tag: \"HeaderMedium\",\n description: \"A medium header with an optional touchable right aligned text and icon.\",\n category: COMPONENT_TYPES.header,\n preview_image_url: \"{CLOUDINARY_URL}/Header_HeadlineMediumIconText.png\",\n supports_list_render: false,\n props: {\n title: {\n group: GROUPS.data,\n label: \"Title\",\n description: \"Text to display\",\n formType: FORM_TYPES.string,\n propType: PROP_TYPES.STRING,\n defaultValue: \"Title\",\n editable: true,\n required: false,\n },\n buttonText: {\n group: GROUPS.data,\n label: \"Button text\",\n description: \"Right aligned button text to display\",\n formType: FORM_TYPES.string,\n propType: PROP_TYPES.STRING,\n defaultValue: \"See All\",\n editable: true,\n required: false,\n },\n icon: {\n group: GROUPS.basic,\n label: \"Icon\",\n description: \"Name of icon to display\",\n formType: FORM_TYPES.icon,\n propType: PROP_TYPES.ASSET,\n defaultValue: null,\n editable: true,\n required: false,\n },\n onPress: {\n group: GROUPS.basic,\n label: \"Action\",\n description: \"Action to execute when button pressed\",\n editable: true,\n required: false,\n formType: FORM_TYPES.action,\n propType: PROP_TYPES.STRING,\n defaultValue: null,\n },\n },\n layout: {},\n },\n];\n"]}
1
+ {"version":3,"sources":["HeaderMedium.ts"],"names":["GROUPS","COMPONENT_TYPES","FORM_TYPES","PROP_TYPES","SEED_DATA","name","tag","description","category","header","preview_image_url","supports_list_render","props","title","group","data","label","formType","string","propType","STRING","defaultValue","editable","required","buttonText","icon","basic","ASSET","onPress","action","layout"],"mappings":"AAAA,SACEA,MADF,EAEEC,eAFF,EAGEC,UAHF,EAIEC,UAJF,QAKO,iBALP;AAOA,OAAO,MAAMC,SAAS,GAAG,CACvB;AACEC,EAAAA,IAAI,EAAE,eADR;AAEEC,EAAAA,GAAG,EAAE,cAFP;AAGEC,EAAAA,WAAW,EACT,yEAJJ;AAKEC,EAAAA,QAAQ,EAAEP,eAAe,CAACQ,MAL5B;AAMEC,EAAAA,iBAAiB,EAAE,oDANrB;AAOEC,EAAAA,oBAAoB,EAAE,KAPxB;AAQEC,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAE;AACLC,MAAAA,KAAK,EAAEd,MAAM,CAACe,IADT;AAELC,MAAAA,KAAK,EAAE,OAFF;AAGLT,MAAAA,WAAW,EAAE,iBAHR;AAILU,MAAAA,QAAQ,EAAEf,UAAU,CAACgB,MAJhB;AAKLC,MAAAA,QAAQ,EAAEhB,UAAU,CAACiB,MALhB;AAMLC,MAAAA,YAAY,EAAE,OANT;AAOLC,MAAAA,QAAQ,EAAE,IAPL;AAQLC,MAAAA,QAAQ,EAAE;AARL,KADF;AAWLC,IAAAA,UAAU,EAAE;AACVV,MAAAA,KAAK,EAAEd,MAAM,CAACe,IADJ;AAEVC,MAAAA,KAAK,EAAE,aAFG;AAGVT,MAAAA,WAAW,EAAE,sCAHH;AAIVU,MAAAA,QAAQ,EAAEf,UAAU,CAACgB,MAJX;AAKVC,MAAAA,QAAQ,EAAEhB,UAAU,CAACiB,MALX;AAMVC,MAAAA,YAAY,EAAE,SANJ;AAOVC,MAAAA,QAAQ,EAAE,IAPA;AAQVC,MAAAA,QAAQ,EAAE;AARA,KAXP;AAqBLE,IAAAA,IAAI,EAAE;AACJX,MAAAA,KAAK,EAAEd,MAAM,CAAC0B,KADV;AAEJV,MAAAA,KAAK,EAAE,MAFH;AAGJT,MAAAA,WAAW,EAAE,yBAHT;AAIJU,MAAAA,QAAQ,EAAEf,UAAU,CAACuB,IAJjB;AAKJN,MAAAA,QAAQ,EAAEhB,UAAU,CAACwB,KALjB;AAMJN,MAAAA,YAAY,EAAE,IANV;AAOJC,MAAAA,QAAQ,EAAE,IAPN;AAQJC,MAAAA,QAAQ,EAAE;AARN,KArBD;AA+BLK,IAAAA,OAAO,EAAE;AACPd,MAAAA,KAAK,EAAEd,MAAM,CAAC0B,KADP;AAEPV,MAAAA,KAAK,EAAE,QAFA;AAGPT,MAAAA,WAAW,EAAE,uCAHN;AAIPe,MAAAA,QAAQ,EAAE,IAJH;AAKPC,MAAAA,QAAQ,EAAE,KALH;AAMPN,MAAAA,QAAQ,EAAEf,UAAU,CAAC2B,MANd;AAOPV,MAAAA,QAAQ,EAAEhB,UAAU,CAACiB,MAPd;AAQPC,MAAAA,YAAY,EAAE;AARP;AA/BJ,GART;AAkDES,EAAAA,MAAM,EAAE;AAlDV,CADuB,CAAlB","sourcesContent":["import {\n GROUPS,\n COMPONENT_TYPES,\n FORM_TYPES,\n PROP_TYPES,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = [\n {\n name: \"Header Medium\",\n tag: \"HeaderMedium\",\n description:\n \"A medium header with an optional touchable right aligned text and icon.\",\n category: COMPONENT_TYPES.header,\n preview_image_url: \"{CLOUDINARY_URL}/Header_HeadlineMediumIconText.png\",\n supports_list_render: false,\n props: {\n title: {\n group: GROUPS.data,\n label: \"Title\",\n description: \"Text to display\",\n formType: FORM_TYPES.string,\n propType: PROP_TYPES.STRING,\n defaultValue: \"Title\",\n editable: true,\n required: false,\n },\n buttonText: {\n group: GROUPS.data,\n label: \"Button text\",\n description: \"Right aligned button text to display\",\n formType: FORM_TYPES.string,\n propType: PROP_TYPES.STRING,\n defaultValue: \"See All\",\n editable: true,\n required: false,\n },\n icon: {\n group: GROUPS.basic,\n label: \"Icon\",\n description: \"Name of icon to display\",\n formType: FORM_TYPES.icon,\n propType: PROP_TYPES.ASSET,\n defaultValue: null,\n editable: true,\n required: false,\n },\n onPress: {\n group: GROUPS.basic,\n label: \"Action\",\n description: \"Action to execute when button pressed\",\n editable: true,\n required: false,\n formType: FORM_TYPES.action,\n propType: PROP_TYPES.STRING,\n defaultValue: null,\n },\n },\n layout: {},\n },\n];\n"]}
@@ -6,7 +6,9 @@ export const SEED_DATA = {
6
6
  category: COMPONENT_TYPES.basic,
7
7
  layout: {},
8
8
  props: {
9
- name: createIconProp(),
9
+ name: { ...createIconProp(),
10
+ group: GROUPS.data
11
+ },
10
12
  color: createColorProp(),
11
13
  size: createNumberProp({
12
14
  group: GROUPS.basic,
@@ -1 +1 @@
1
- {"version":3,"sources":["Icon.ts"],"names":["COMPONENT_TYPES","GROUPS","createNumberProp","createColorProp","createIconProp","SEED_DATA","name","tag","description","category","basic","layout","props","color","size","group","label","defaultValue","min","max","step","precision"],"mappings":"AAAA,SACEA,eADF,EAEEC,MAFF,EAGEC,gBAHF,EAIEC,eAJF,EAKEC,cALF,QAMO,iBANP;AAQA,OAAO,MAAMC,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,MADiB;AAEvBC,EAAAA,GAAG,EAAE,MAFkB;AAGvBC,EAAAA,WAAW,EAAE,SAHU;AAIvBC,EAAAA,QAAQ,EAAET,eAAe,CAACU,KAJH;AAKvBC,EAAAA,MAAM,EAAE,EALe;AAMvBC,EAAAA,KAAK,EAAE;AACLN,IAAAA,IAAI,EAAEF,cAAc,EADf;AAELS,IAAAA,KAAK,EAAEV,eAAe,EAFjB;AAGLW,IAAAA,IAAI,EAAEZ,gBAAgB,CAAC;AACrBa,MAAAA,KAAK,EAAEd,MAAM,CAACS,KADO;AAErBM,MAAAA,KAAK,EAAE,MAFc;AAGrBR,MAAAA,WAAW,EAAE,+BAHQ;AAIrBS,MAAAA,YAAY,EAAE,EAJO;AAKrBC,MAAAA,GAAG,EAAE,EALgB;AAMrBC,MAAAA,GAAG,EAAE,GANgB;AAOrBC,MAAAA,IAAI,EAAE,CAPe;AAQrBC,MAAAA,SAAS,EAAE;AARU,KAAD;AAHjB;AANgB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n GROUPS,\n createNumberProp,\n createColorProp,\n createIconProp,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"Icon\",\n tag: \"Icon\",\n description: \"An icon\",\n category: COMPONENT_TYPES.basic,\n layout: {},\n props: {\n name: createIconProp(),\n color: createColorProp(),\n size: createNumberProp({\n group: GROUPS.basic,\n label: \"Size\",\n description: \"Width and height of your icon\",\n defaultValue: 24,\n min: 16,\n max: 128,\n step: 1,\n precision: 0,\n }),\n },\n};\n"]}
1
+ {"version":3,"sources":["Icon.ts"],"names":["COMPONENT_TYPES","GROUPS","createNumberProp","createColorProp","createIconProp","SEED_DATA","name","tag","description","category","basic","layout","props","group","data","color","size","label","defaultValue","min","max","step","precision"],"mappings":"AAAA,SACEA,eADF,EAEEC,MAFF,EAGEC,gBAHF,EAIEC,eAJF,EAKEC,cALF,QAMO,iBANP;AAQA,OAAO,MAAMC,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,MADiB;AAEvBC,EAAAA,GAAG,EAAE,MAFkB;AAGvBC,EAAAA,WAAW,EAAE,SAHU;AAIvBC,EAAAA,QAAQ,EAAET,eAAe,CAACU,KAJH;AAKvBC,EAAAA,MAAM,EAAE,EALe;AAMvBC,EAAAA,KAAK,EAAE;AACLN,IAAAA,IAAI,EAAE,EACJ,GAAGF,cAAc,EADb;AAEJS,MAAAA,KAAK,EAAEZ,MAAM,CAACa;AAFV,KADD;AAKLC,IAAAA,KAAK,EAAEZ,eAAe,EALjB;AAMLa,IAAAA,IAAI,EAAEd,gBAAgB,CAAC;AACrBW,MAAAA,KAAK,EAAEZ,MAAM,CAACS,KADO;AAErBO,MAAAA,KAAK,EAAE,MAFc;AAGrBT,MAAAA,WAAW,EAAE,+BAHQ;AAIrBU,MAAAA,YAAY,EAAE,EAJO;AAKrBC,MAAAA,GAAG,EAAE,EALgB;AAMrBC,MAAAA,GAAG,EAAE,GANgB;AAOrBC,MAAAA,IAAI,EAAE,CAPe;AAQrBC,MAAAA,SAAS,EAAE;AARU,KAAD;AANjB;AANgB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n GROUPS,\n createNumberProp,\n createColorProp,\n createIconProp,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"Icon\",\n tag: \"Icon\",\n description: \"An icon\",\n category: COMPONENT_TYPES.basic,\n layout: {},\n props: {\n name: {\n ...createIconProp(),\n group: GROUPS.data,\n },\n color: createColorProp(),\n size: createNumberProp({\n group: GROUPS.basic,\n label: \"Size\",\n description: \"Width and height of your icon\",\n defaultValue: 24,\n min: 16,\n max: 128,\n step: 1,\n precision: 0,\n }),\n },\n};\n"]}
@@ -0,0 +1,39 @@
1
+ import { COMPONENT_TYPES, createStaticBoolProp, createStaticNumberProp } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "Keyboard Aware Scroll View",
4
+ tag: "KeyboardAwareScrollView",
5
+ description: "View that moves pushes the content when virtual keyboard is open.",
6
+ category: COMPONENT_TYPES.layout,
7
+ layout: {},
8
+ props: {
9
+ viewIsInsideTabBar: createStaticBoolProp({
10
+ label: "View Is Inside TabBar",
11
+ description: "Adds an extra offset that represents the TabBarIOS height."
12
+ }),
13
+ enableAutomaticScroll: createStaticBoolProp({
14
+ label: "Enable Automatic Scroll",
15
+ description: "When focus in TextInput will scroll the position, default is enabled"
16
+ }),
17
+ extraHeight: createStaticNumberProp({
18
+ label: "Extra Height",
19
+ description: "Adds an extra offset when focusing the TextInputs"
20
+ }),
21
+ extraScrollHeight: createStaticNumberProp({
22
+ label: "Extra Scroll Height",
23
+ description: "Adds an extra offset to the keyboard. Useful if you want to stick elements above the keyboard"
24
+ }),
25
+ enableResetScrollToCoords: createStaticBoolProp({
26
+ label: "Enable Reset Scroll To Coordinates",
27
+ description: "Lets the user enable or disable automatic resetScrollToCoords"
28
+ }),
29
+ keyboardOpeningTime: createStaticNumberProp({
30
+ label: "Keyboard Opening Time",
31
+ description: "Sets the delay time before scrolling to new position, default is 250"
32
+ }),
33
+ enableOnAndroid: createStaticBoolProp({
34
+ label: "Enable On Android",
35
+ description: "Enable Android Support"
36
+ })
37
+ }
38
+ };
39
+ //# sourceMappingURL=KeyboardAwareScrollView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["KeyboardAwareScrollView.ts"],"names":["COMPONENT_TYPES","createStaticBoolProp","createStaticNumberProp","SEED_DATA","name","tag","description","category","layout","props","viewIsInsideTabBar","label","enableAutomaticScroll","extraHeight","extraScrollHeight","enableResetScrollToCoords","keyboardOpeningTime","enableOnAndroid"],"mappings":"AAAA,SACEA,eADF,EAEEC,oBAFF,EAGEC,sBAHF,QAIO,iBAJP;AAMA,OAAO,MAAMC,SAAS,GAAG;AACvBC,EAAAA,IAAI,EAAE,4BADiB;AAEvBC,EAAAA,GAAG,EAAE,yBAFkB;AAGvBC,EAAAA,WAAW,EACT,mEAJqB;AAKvBC,EAAAA,QAAQ,EAAEP,eAAe,CAACQ,MALH;AAMvBA,EAAAA,MAAM,EAAE,EANe;AAOvBC,EAAAA,KAAK,EAAE;AACLC,IAAAA,kBAAkB,EAAET,oBAAoB,CAAC;AACvCU,MAAAA,KAAK,EAAE,uBADgC;AAEvCL,MAAAA,WAAW,EAAE;AAF0B,KAAD,CADnC;AAKLM,IAAAA,qBAAqB,EAAEX,oBAAoB,CAAC;AAC1CU,MAAAA,KAAK,EAAE,yBADmC;AAE1CL,MAAAA,WAAW,EACT;AAHwC,KAAD,CALtC;AAULO,IAAAA,WAAW,EAAEX,sBAAsB,CAAC;AAClCS,MAAAA,KAAK,EAAE,cAD2B;AAElCL,MAAAA,WAAW,EAAE;AAFqB,KAAD,CAV9B;AAcLQ,IAAAA,iBAAiB,EAAEZ,sBAAsB,CAAC;AACxCS,MAAAA,KAAK,EAAE,qBADiC;AAExCL,MAAAA,WAAW,EACT;AAHsC,KAAD,CAdpC;AAmBLS,IAAAA,yBAAyB,EAAEd,oBAAoB,CAAC;AAC9CU,MAAAA,KAAK,EAAE,oCADuC;AAE9CL,MAAAA,WAAW,EACT;AAH4C,KAAD,CAnB1C;AAwBLU,IAAAA,mBAAmB,EAAEd,sBAAsB,CAAC;AAC1CS,MAAAA,KAAK,EAAE,uBADmC;AAE1CL,MAAAA,WAAW,EACT;AAHwC,KAAD,CAxBtC;AA6BLW,IAAAA,eAAe,EAAEhB,oBAAoB,CAAC;AACpCU,MAAAA,KAAK,EAAE,mBAD6B;AAEpCL,MAAAA,WAAW,EAAE;AAFuB,KAAD;AA7BhC;AAPgB,CAAlB","sourcesContent":["import {\n COMPONENT_TYPES,\n createStaticBoolProp,\n createStaticNumberProp,\n} from \"@draftbit/types\";\n\nexport const SEED_DATA = {\n name: \"Keyboard Aware Scroll View\",\n tag: \"KeyboardAwareScrollView\",\n description:\n \"View that moves pushes the content when virtual keyboard is open.\",\n category: COMPONENT_TYPES.layout,\n layout: {},\n props: {\n viewIsInsideTabBar: createStaticBoolProp({\n label: \"View Is Inside TabBar\",\n description: \"Adds an extra offset that represents the TabBarIOS height.\",\n }),\n enableAutomaticScroll: createStaticBoolProp({\n label: \"Enable Automatic Scroll\",\n description:\n \"When focus in TextInput will scroll the position, default is enabled\",\n }),\n extraHeight: createStaticNumberProp({\n label: \"Extra Height\",\n description: \"Adds an extra offset when focusing the TextInputs\",\n }),\n extraScrollHeight: createStaticNumberProp({\n label: \"Extra Scroll Height\",\n description:\n \"Adds an extra offset to the keyboard. Useful if you want to stick elements above the keyboard\",\n }),\n enableResetScrollToCoords: createStaticBoolProp({\n label: \"Enable Reset Scroll To Coordinates\",\n description:\n \"Lets the user enable or disable automatic resetScrollToCoords\",\n }),\n keyboardOpeningTime: createStaticNumberProp({\n label: \"Keyboard Opening Time\",\n description:\n \"Sets the delay time before scrolling to new position, default is 250\",\n }),\n enableOnAndroid: createStaticBoolProp({\n label: \"Enable On Android\",\n description: \"Enable Android Support\",\n }),\n },\n};\n"]}
@@ -6,6 +6,7 @@ export declare const SEED_DATA: {
6
6
  layout: {};
7
7
  props: {
8
8
  name: {
9
+ group: string;
9
10
  label: string;
10
11
  description: string;
11
12
  formType: string;
@@ -13,7 +14,6 @@ export declare const SEED_DATA: {
13
14
  defaultValue: string;
14
15
  required: boolean;
15
16
  editable: boolean;
16
- group: string;
17
17
  };
18
18
  color: {
19
19
  group: string;
@@ -0,0 +1,82 @@
1
+ export declare const SEED_DATA: {
2
+ name: string;
3
+ tag: string;
4
+ description: string;
5
+ category: string;
6
+ layout: {};
7
+ props: {
8
+ viewIsInsideTabBar: {
9
+ label: string;
10
+ description: string;
11
+ formType: string;
12
+ propType: string;
13
+ defaultValue: boolean;
14
+ editable: boolean;
15
+ required: boolean;
16
+ group: string;
17
+ };
18
+ enableAutomaticScroll: {
19
+ label: string;
20
+ description: string;
21
+ formType: string;
22
+ propType: string;
23
+ defaultValue: boolean;
24
+ editable: boolean;
25
+ required: boolean;
26
+ group: string;
27
+ };
28
+ extraHeight: {
29
+ label: string;
30
+ description: string;
31
+ formType: string;
32
+ propType: string;
33
+ group: string;
34
+ defaultValue: null;
35
+ editable: boolean;
36
+ required: boolean;
37
+ step: number;
38
+ };
39
+ extraScrollHeight: {
40
+ label: string;
41
+ description: string;
42
+ formType: string;
43
+ propType: string;
44
+ group: string;
45
+ defaultValue: null;
46
+ editable: boolean;
47
+ required: boolean;
48
+ step: number;
49
+ };
50
+ enableResetScrollToCoords: {
51
+ label: string;
52
+ description: string;
53
+ formType: string;
54
+ propType: string;
55
+ defaultValue: boolean;
56
+ editable: boolean;
57
+ required: boolean;
58
+ group: string;
59
+ };
60
+ keyboardOpeningTime: {
61
+ label: string;
62
+ description: string;
63
+ formType: string;
64
+ propType: string;
65
+ group: string;
66
+ defaultValue: null;
67
+ editable: boolean;
68
+ required: boolean;
69
+ step: number;
70
+ };
71
+ enableOnAndroid: {
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
+ };
82
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@draftbit/core",
3
- "version": "43.4.9",
3
+ "version": "43.4.11-2f015a.5+2f015a40",
4
4
  "description": "Core (non-native) Components",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -41,7 +41,7 @@
41
41
  "dependencies": {
42
42
  "@date-io/date-fns": "^1.3.13",
43
43
  "@draftbit/react-theme-provider": "^2.1.1",
44
- "@draftbit/types": "^43.4.0",
44
+ "@draftbit/types": "^43.4.10",
45
45
  "@material-ui/core": "^4.11.0",
46
46
  "@material-ui/pickers": "^3.2.10",
47
47
  "@react-native-community/slider": "4.1.7",
@@ -80,5 +80,5 @@
80
80
  ]
81
81
  ]
82
82
  },
83
- "gitHead": "847053d768f405aa0d10b18ac73f566f3f7de695"
83
+ "gitHead": "2f015a4046112486445bc88889194caa483910f9"
84
84
  }
@@ -18,10 +18,10 @@ const AccordionGroup = ({ Icon, openColor, closedColor, caretColor, icon, iconSi
18
18
  icon ? (React.createElement(Icon, { name: icon, size: iconSize, color: labelColor, style: styles.icon })) : null,
19
19
  React.createElement(View, { style: styles.content },
20
20
  React.createElement(Text, { selectable: false, style: [
21
+ textStyles,
21
22
  {
22
23
  color: labelColor,
23
24
  },
24
- textStyles,
25
25
  ] }, label)),
26
26
  React.createElement(Icon, { name: expanded
27
27
  ? "MaterialIcons/keyboard-arrow-up"
@@ -74,10 +74,10 @@ const AccordionGroup = ({
74
74
  <Text
75
75
  selectable={false}
76
76
  style={[
77
+ textStyles,
77
78
  {
78
79
  color: labelColor,
79
80
  },
80
- textStyles,
81
81
  ]}
82
82
  >
83
83
  {label}
@@ -1,10 +1,9 @@
1
1
  import * as React from "react";
2
- import { View, Animated, Text, StyleSheet, Platform, I18nManager, TextInput as NativeTextInput, } from "react-native";
2
+ import { View, Animated, Text, StyleSheet, I18nManager, TextInput as NativeTextInput, } from "react-native";
3
3
  import { useSafeAreaInsets } from "react-native-safe-area-context";
4
4
  import dateFormat from "dateformat";
5
5
  import { withTheme } from "../../theming";
6
6
  import Portal from "../Portal/Portal";
7
- import Button from "../DeprecatedButton";
8
7
  import Touchable from "../Touchable";
9
8
  import DateTimePicker from "./DatePickerComponent";
10
9
  const AnimatedText = Animated.createAnimatedComponent(Text);
@@ -325,9 +324,8 @@ const DatePicker = ({ Icon, style, theme: { colors, typography, roundness, disab
325
324
  paddingRight: insets.right,
326
325
  },
327
326
  ] },
328
- Platform.OS === "ios" && (React.createElement(Button, { Icon: Icon, type: "text", onPress: toggleVisibility, style: styles.closeButton }, "Close")),
329
327
  React.createElement(DateTimePicker, { value: getValidDate(), mode: mode, isVisible: pickerVisible, toggleVisibility: toggleVisibility, onChange: (_event, data) => {
330
- Platform.OS === "ios" ? null : toggleVisibility();
328
+ toggleVisibility();
331
329
  setValue(data);
332
330
  onDateChange(data);
333
331
  } })))))));
@@ -7,7 +7,6 @@ import {
7
7
  StyleProp,
8
8
  ViewStyle,
9
9
  TextStyle,
10
- Platform,
11
10
  TextInputProps,
12
11
  ImageStyle,
13
12
  I18nManager,
@@ -19,7 +18,6 @@ import { useSafeAreaInsets } from "react-native-safe-area-context";
19
18
  import dateFormat from "dateformat";
20
19
  import { withTheme } from "../../theming";
21
20
  import Portal from "../Portal/Portal";
22
- import Button from "../DeprecatedButton";
23
21
  import Touchable from "../Touchable";
24
22
  import DateTimePicker from "./DatePickerComponent";
25
23
 
@@ -496,24 +494,13 @@ const DatePicker: React.FC<Props> = ({
496
494
  },
497
495
  ]}
498
496
  >
499
- {Platform.OS === "ios" && (
500
- <Button
501
- Icon={Icon}
502
- type="text"
503
- onPress={toggleVisibility}
504
- style={styles.closeButton}
505
- >
506
- Close
507
- </Button>
508
- )}
509
-
510
497
  <DateTimePicker
511
498
  value={getValidDate()}
512
499
  mode={mode}
513
500
  isVisible={pickerVisible}
514
501
  toggleVisibility={toggleVisibility}
515
502
  onChange={(_event: any, data: any) => {
516
- Platform.OS === "ios" ? null : toggleVisibility();
503
+ toggleVisibility();
517
504
  setValue(data);
518
505
  onDateChange(data);
519
506
  }}
@@ -2,7 +2,8 @@ import React, { useEffect, useState } from "react";
2
2
  import { TextInput } from "react-native";
3
3
  import { isString, isNumber, isNaN } from "lodash";
4
4
  const NumberInput = ({ onChangeText, value, defaultValue, ...props }) => {
5
- const formatValueToStringNumber = (valueToFormat, currentStringNumberValue) => {
5
+ const [currentStringNumberValue, setCurrentStringNumberValue] = useState("0");
6
+ const formatValueToStringNumber = (valueToFormat) => {
6
7
  if (valueToFormat != null) {
7
8
  if (isString(valueToFormat) && valueToFormat !== "") {
8
9
  if (/^0[1-9]$/.test(valueToFormat)) {
@@ -11,7 +12,7 @@ const NumberInput = ({ onChangeText, value, defaultValue, ...props }) => {
11
12
  else if (/^[+-]?([0-9]+\.?[0-9]*|\.[0-9]+)$/.test(valueToFormat)) {
12
13
  return valueToFormat;
13
14
  }
14
- else if (currentStringNumberValue) {
15
+ else {
15
16
  return currentStringNumberValue;
16
17
  }
17
18
  }
@@ -21,25 +22,23 @@ const NumberInput = ({ onChangeText, value, defaultValue, ...props }) => {
21
22
  }
22
23
  return "0";
23
24
  };
24
- const [currentStringNumberValue, setCurrentStringNumberValue] = useState(formatValueToStringNumber("0"));
25
- const handleChangeText = (newValue) => {
26
- const newStringNumberValue = formatValueToStringNumber(newValue, currentStringNumberValue);
27
- const number = parseFloat(newStringNumberValue);
28
- setCurrentStringNumberValue(newStringNumberValue);
29
- onChangeText?.(number);
30
- };
31
- /* set currentStringNumberValue directly to defaultValue if it exists on load
32
- ( no need to use TextInput's defaultValue because its value is always controlled & set ) */
25
+ // set currentStringNumberValue as defaultValue prop if there is a differnce on first render only
33
26
  useEffect(() => {
34
- const defaultStringNumberValue = formatValueToStringNumber(defaultValue, currentStringNumberValue);
27
+ const defaultStringNumberValue = formatValueToStringNumber(defaultValue);
35
28
  if (currentStringNumberValue !== defaultStringNumberValue) {
36
29
  setCurrentStringNumberValue(defaultStringNumberValue);
37
30
  }
38
31
  // eslint-disable-next-line react-hooks/exhaustive-deps
39
32
  }, []);
40
- // set new (or original) value if different from current (or initialized "0") value
33
+ const handleChangeText = (newValue) => {
34
+ const newStringNumberValue = formatValueToStringNumber(newValue);
35
+ const number = parseFloat(newStringNumberValue);
36
+ setCurrentStringNumberValue(newStringNumberValue);
37
+ onChangeText?.(number);
38
+ };
39
+ // run handleChangeText with value prop only when value prop changes (and first render to reset currentStringNumberValue)
41
40
  useEffect(() => {
42
- const nextStringNumberValue = formatValueToStringNumber(value, currentStringNumberValue);
41
+ const nextStringNumberValue = formatValueToStringNumber(value);
43
42
  if (currentStringNumberValue !== nextStringNumberValue) {
44
43
  handleChangeText(nextStringNumberValue);
45
44
  }
@@ -14,17 +14,16 @@ const NumberInput: FC<Props> = ({
14
14
  defaultValue,
15
15
  ...props
16
16
  }) => {
17
- const formatValueToStringNumber = (
18
- valueToFormat?: number | string,
19
- currentStringNumberValue?: string
20
- ) => {
17
+ const [currentStringNumberValue, setCurrentStringNumberValue] = useState("0");
18
+
19
+ const formatValueToStringNumber = (valueToFormat?: number | string) => {
21
20
  if (valueToFormat != null) {
22
21
  if (isString(valueToFormat) && valueToFormat !== "") {
23
22
  if (/^0[1-9]$/.test(valueToFormat)) {
24
23
  return valueToFormat.slice(1);
25
24
  } else if (/^[+-]?([0-9]+\.?[0-9]*|\.[0-9]+)$/.test(valueToFormat)) {
26
25
  return valueToFormat;
27
- } else if (currentStringNumberValue) {
26
+ } else {
28
27
  return currentStringNumberValue;
29
28
  }
30
29
  } else if (isNumber(valueToFormat) && !isNaN(valueToFormat)) {
@@ -35,28 +34,9 @@ const NumberInput: FC<Props> = ({
35
34
  return "0";
36
35
  };
37
36
 
38
- const [currentStringNumberValue, setCurrentStringNumberValue] = useState(
39
- formatValueToStringNumber("0")
40
- );
41
-
42
- const handleChangeText = (newValue: string) => {
43
- const newStringNumberValue = formatValueToStringNumber(
44
- newValue,
45
- currentStringNumberValue
46
- );
47
- const number = parseFloat(newStringNumberValue);
48
-
49
- setCurrentStringNumberValue(newStringNumberValue);
50
- onChangeText?.(number);
51
- };
52
-
53
- /* set currentStringNumberValue directly to defaultValue if it exists on load
54
- ( no need to use TextInput's defaultValue because its value is always controlled & set ) */
37
+ // set currentStringNumberValue as defaultValue prop if there is a differnce on first render only
55
38
  useEffect(() => {
56
- const defaultStringNumberValue = formatValueToStringNumber(
57
- defaultValue,
58
- currentStringNumberValue
59
- );
39
+ const defaultStringNumberValue = formatValueToStringNumber(defaultValue);
60
40
 
61
41
  if (currentStringNumberValue !== defaultStringNumberValue) {
62
42
  setCurrentStringNumberValue(defaultStringNumberValue);
@@ -64,12 +44,17 @@ const NumberInput: FC<Props> = ({
64
44
  // eslint-disable-next-line react-hooks/exhaustive-deps
65
45
  }, []);
66
46
 
67
- // set new (or original) value if different from current (or initialized "0") value
47
+ const handleChangeText = (newValue: string) => {
48
+ const newStringNumberValue = formatValueToStringNumber(newValue);
49
+ const number = parseFloat(newStringNumberValue);
50
+
51
+ setCurrentStringNumberValue(newStringNumberValue);
52
+ onChangeText?.(number);
53
+ };
54
+
55
+ // run handleChangeText with value prop only when value prop changes (and first render to reset currentStringNumberValue)
68
56
  useEffect(() => {
69
- const nextStringNumberValue = formatValueToStringNumber(
70
- value,
71
- currentStringNumberValue
72
- );
57
+ const nextStringNumberValue = formatValueToStringNumber(value);
73
58
 
74
59
  if (currentStringNumberValue !== nextStringNumberValue) {
75
60
  handleChangeText(nextStringNumberValue);
@@ -231,6 +231,7 @@ class TextField extends React.Component {
231
231
  : leftIconMode === "outset"
232
232
  ? 16
233
233
  : 0,
234
+ marginLeft: leftIconMode === "inset" && type === "solid" ? 16 : 0,
234
235
  };
235
236
  const labelStyle = {
236
237
  ...typography.subtitle1,
@@ -355,10 +356,10 @@ class TextField extends React.Component {
355
356
  opacity: hasActiveOutline ? this.state.labeled : 1,
356
357
  },
357
358
  ], numberOfLines: 1 }, label))) : null,
358
- leftIconName && leftIconMode === "inset" ? (React.createElement(Icon, { ...leftIconProps, style: {
359
- ...leftIconStyle,
360
- marginLeft: type === "solid" ? 16 : 0,
361
- } })) : null,
359
+ leftIconName && leftIconMode === "inset" ? (React.createElement(View, { style: {
360
+ justifyContent: type === "solid" ? "center" : undefined,
361
+ } },
362
+ React.createElement(Icon, { ...leftIconProps, style: leftIconStyle }))) : null,
362
363
  render({
363
364
  ref: (c) => {
364
365
  this._root = c;
@@ -359,6 +359,7 @@ class TextField extends React.Component<Props, State> {
359
359
  : leftIconMode === "outset"
360
360
  ? 16
361
361
  : 0,
362
+ marginLeft: leftIconMode === "inset" && type === "solid" ? 16 : 0,
362
363
  };
363
364
 
364
365
  const labelStyle = {
@@ -536,13 +537,13 @@ class TextField extends React.Component<Props, State> {
536
537
  ) : null}
537
538
 
538
539
  {leftIconName && leftIconMode === "inset" ? (
539
- <Icon
540
- {...leftIconProps}
540
+ <View
541
541
  style={{
542
- ...leftIconStyle,
543
- marginLeft: type === "solid" ? 16 : 0,
542
+ justifyContent: type === "solid" ? "center" : undefined,
544
543
  }}
545
- />
544
+ >
545
+ <Icon {...leftIconProps} style={leftIconStyle} />
546
+ </View>
546
547
  ) : null}
547
548
 
548
549
  {render({
@@ -6,7 +6,10 @@ export const SEED_DATA = {
6
6
  category: COMPONENT_TYPES.basic,
7
7
  layout: {},
8
8
  props: {
9
- name: createIconProp(),
9
+ name: {
10
+ ...createIconProp(),
11
+ group: GROUPS.data,
12
+ },
10
13
  color: createColorProp(),
11
14
  size: createNumberProp({
12
15
  group: GROUPS.basic,
@@ -13,7 +13,10 @@ export const SEED_DATA = {
13
13
  category: COMPONENT_TYPES.basic,
14
14
  layout: {},
15
15
  props: {
16
- name: createIconProp(),
16
+ name: {
17
+ ...createIconProp(),
18
+ group: GROUPS.data,
19
+ },
17
20
  color: createColorProp(),
18
21
  size: createNumberProp({
19
22
  group: GROUPS.basic,
@@ -0,0 +1,38 @@
1
+ import { COMPONENT_TYPES, createStaticBoolProp, createStaticNumberProp, } from "@draftbit/types";
2
+ export const SEED_DATA = {
3
+ name: "Keyboard Aware Scroll View",
4
+ tag: "KeyboardAwareScrollView",
5
+ description: "View that moves pushes the content when virtual keyboard is open.",
6
+ category: COMPONENT_TYPES.layout,
7
+ layout: {},
8
+ props: {
9
+ viewIsInsideTabBar: createStaticBoolProp({
10
+ label: "View Is Inside TabBar",
11
+ description: "Adds an extra offset that represents the TabBarIOS height.",
12
+ }),
13
+ enableAutomaticScroll: createStaticBoolProp({
14
+ label: "Enable Automatic Scroll",
15
+ description: "When focus in TextInput will scroll the position, default is enabled",
16
+ }),
17
+ extraHeight: createStaticNumberProp({
18
+ label: "Extra Height",
19
+ description: "Adds an extra offset when focusing the TextInputs",
20
+ }),
21
+ extraScrollHeight: createStaticNumberProp({
22
+ label: "Extra Scroll Height",
23
+ description: "Adds an extra offset to the keyboard. Useful if you want to stick elements above the keyboard",
24
+ }),
25
+ enableResetScrollToCoords: createStaticBoolProp({
26
+ label: "Enable Reset Scroll To Coordinates",
27
+ description: "Lets the user enable or disable automatic resetScrollToCoords",
28
+ }),
29
+ keyboardOpeningTime: createStaticNumberProp({
30
+ label: "Keyboard Opening Time",
31
+ description: "Sets the delay time before scrolling to new position, default is 250",
32
+ }),
33
+ enableOnAndroid: createStaticBoolProp({
34
+ label: "Enable On Android",
35
+ description: "Enable Android Support",
36
+ }),
37
+ },
38
+ };
@@ -0,0 +1,48 @@
1
+ import {
2
+ COMPONENT_TYPES,
3
+ createStaticBoolProp,
4
+ createStaticNumberProp,
5
+ } from "@draftbit/types";
6
+
7
+ export const SEED_DATA = {
8
+ name: "Keyboard Aware Scroll View",
9
+ tag: "KeyboardAwareScrollView",
10
+ description:
11
+ "View that moves pushes the content when virtual keyboard is open.",
12
+ category: COMPONENT_TYPES.layout,
13
+ layout: {},
14
+ props: {
15
+ viewIsInsideTabBar: createStaticBoolProp({
16
+ label: "View Is Inside TabBar",
17
+ description: "Adds an extra offset that represents the TabBarIOS height.",
18
+ }),
19
+ enableAutomaticScroll: createStaticBoolProp({
20
+ label: "Enable Automatic Scroll",
21
+ description:
22
+ "When focus in TextInput will scroll the position, default is enabled",
23
+ }),
24
+ extraHeight: createStaticNumberProp({
25
+ label: "Extra Height",
26
+ description: "Adds an extra offset when focusing the TextInputs",
27
+ }),
28
+ extraScrollHeight: createStaticNumberProp({
29
+ label: "Extra Scroll Height",
30
+ description:
31
+ "Adds an extra offset to the keyboard. Useful if you want to stick elements above the keyboard",
32
+ }),
33
+ enableResetScrollToCoords: createStaticBoolProp({
34
+ label: "Enable Reset Scroll To Coordinates",
35
+ description:
36
+ "Lets the user enable or disable automatic resetScrollToCoords",
37
+ }),
38
+ keyboardOpeningTime: createStaticNumberProp({
39
+ label: "Keyboard Opening Time",
40
+ description:
41
+ "Sets the delay time before scrolling to new position, default is 250",
42
+ }),
43
+ enableOnAndroid: createStaticBoolProp({
44
+ label: "Enable On Android",
45
+ description: "Enable Android Support",
46
+ }),
47
+ },
48
+ };