@merchi/product-form 1.19.12

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 (188) hide show
  1. package/README.md +272 -0
  2. package/lib/actions/jobs.d.ts +3 -0
  3. package/lib/actions/jobs.js +80 -0
  4. package/lib/actions/leads.d.ts +7 -0
  5. package/lib/actions/leads.js +67 -0
  6. package/lib/components/AlertVariationSellerEditable.d.ts +6 -0
  7. package/lib/components/AlertVariationSellerEditable.js +46 -0
  8. package/lib/components/Collapse.d.ts +3 -0
  9. package/lib/components/Collapse.js +34 -0
  10. package/lib/components/DateCountdown.d.ts +44 -0
  11. package/lib/components/DateCountdown.js +188 -0
  12. package/lib/components/DropzoneInput.d.ts +10 -0
  13. package/lib/components/DropzoneInput.js +169 -0
  14. package/lib/components/DynamicVariationInput.d.ts +9 -0
  15. package/lib/components/DynamicVariationInput.js +71 -0
  16. package/lib/components/FormLead.d.ts +10 -0
  17. package/lib/components/FormLead.js +215 -0
  18. package/lib/components/GroupInventory.d.ts +6 -0
  19. package/lib/components/GroupInventory.js +16 -0
  20. package/lib/components/InputGroupQuantity.d.ts +8 -0
  21. package/lib/components/InputGroupQuantity.js +117 -0
  22. package/lib/components/InputHiddenStatic.d.ts +8 -0
  23. package/lib/components/InputHiddenStatic.js +24 -0
  24. package/lib/components/InputProductQuantity.d.ts +7 -0
  25. package/lib/components/InputProductQuantity.js +102 -0
  26. package/lib/components/InventoryStatus.d.ts +7 -0
  27. package/lib/components/InventoryStatus.js +67 -0
  28. package/lib/components/MerchiProductForm.d.ts +62 -0
  29. package/lib/components/MerchiProductForm.js +51 -0
  30. package/lib/components/PriceMatrix.d.ts +27 -0
  31. package/lib/components/PriceMatrix.js +106 -0
  32. package/lib/components/ProductButtonsSubmit.d.ts +3 -0
  33. package/lib/components/ProductButtonsSubmit.js +52 -0
  34. package/lib/components/ProductFeatureDeadline.d.ts +3 -0
  35. package/lib/components/ProductFeatureDeadline.js +25 -0
  36. package/lib/components/ProductGroupBuyStatus.d.ts +3 -0
  37. package/lib/components/ProductGroupBuyStatus.js +47 -0
  38. package/lib/components/ProductPriceMatrix.d.ts +3 -0
  39. package/lib/components/ProductPriceMatrix.js +51 -0
  40. package/lib/components/ProductTitle.d.ts +3 -0
  41. package/lib/components/ProductTitle.js +36 -0
  42. package/lib/components/ProductTotalCost.d.ts +3 -0
  43. package/lib/components/ProductTotalCost.js +74 -0
  44. package/lib/components/ProductUnitPrice.d.ts +7 -0
  45. package/lib/components/ProductUnitPrice.js +51 -0
  46. package/lib/components/TooltipElement.d.ts +9 -0
  47. package/lib/components/TooltipElement.js +35 -0
  48. package/lib/components/VariationAreaInput.d.ts +8 -0
  49. package/lib/components/VariationAreaInput.js +219 -0
  50. package/lib/components/VariationCheckBoxOrRadioOption.d.ts +10 -0
  51. package/lib/components/VariationCheckBoxOrRadioOption.js +82 -0
  52. package/lib/components/VariationCheckboxRadio.d.ts +17 -0
  53. package/lib/components/VariationCheckboxRadio.js +57 -0
  54. package/lib/components/VariationColourExtractInput.d.ts +8 -0
  55. package/lib/components/VariationColourExtractInput.js +395 -0
  56. package/lib/components/VariationError.d.ts +7 -0
  57. package/lib/components/VariationError.js +52 -0
  58. package/lib/components/VariationFieldInputInstructions.d.ts +10 -0
  59. package/lib/components/VariationFieldInputInstructions.js +50 -0
  60. package/lib/components/VariationFieldInstructions.d.ts +3 -0
  61. package/lib/components/VariationFieldInstructions.js +22 -0
  62. package/lib/components/VariationFieldNameAndCostInputs.d.ts +7 -0
  63. package/lib/components/VariationFieldNameAndCostInputs.js +34 -0
  64. package/lib/components/VariationFieldOptionDefaultInputs.d.ts +7 -0
  65. package/lib/components/VariationFieldOptionDefaultInputs.js +48 -0
  66. package/lib/components/VariationFieldStaticValues.d.ts +8 -0
  67. package/lib/components/VariationFieldStaticValues.js +57 -0
  68. package/lib/components/VariationFileInput.d.ts +8 -0
  69. package/lib/components/VariationFileInput.js +229 -0
  70. package/lib/components/VariationInput.d.ts +11 -0
  71. package/lib/components/VariationInput.js +97 -0
  72. package/lib/components/VariationLabel.d.ts +11 -0
  73. package/lib/components/VariationLabel.js +85 -0
  74. package/lib/components/VariationOptionColour.d.ts +8 -0
  75. package/lib/components/VariationOptionColour.js +50 -0
  76. package/lib/components/VariationOptionImage.d.ts +8 -0
  77. package/lib/components/VariationOptionImage.js +52 -0
  78. package/lib/components/VariationSelect.d.ts +8 -0
  79. package/lib/components/VariationSelect.js +66 -0
  80. package/lib/components/VariationSelectElements.d.ts +16 -0
  81. package/lib/components/VariationSelectElements.js +141 -0
  82. package/lib/components/VariationTurnaroundTime.d.ts +9 -0
  83. package/lib/components/VariationTurnaroundTime.js +156 -0
  84. package/lib/components/Variations.d.ts +9 -0
  85. package/lib/components/Variations.js +109 -0
  86. package/lib/components/VariationsGroups.d.ts +8 -0
  87. package/lib/components/VariationsGroups.js +79 -0
  88. package/lib/components/buttons/ButtonAddGroup.d.ts +7 -0
  89. package/lib/components/buttons/ButtonAddGroup.js +38 -0
  90. package/lib/components/buttons/ButtonProductSubmit.d.ts +7 -0
  91. package/lib/components/buttons/ButtonProductSubmit.js +33 -0
  92. package/lib/components/buttons/ButtonRemoveGroup.d.ts +8 -0
  93. package/lib/components/buttons/ButtonRemoveGroup.js +25 -0
  94. package/lib/components/buttons/index.d.ts +4 -0
  95. package/lib/components/buttons/index.js +5 -0
  96. package/lib/components/cost.d.ts +11 -0
  97. package/lib/components/cost.js +44 -0
  98. package/lib/components/currency.d.ts +16 -0
  99. package/lib/components/currency.js +184 -0
  100. package/lib/components/drafts/DraftApprovePanel.d.ts +6 -0
  101. package/lib/components/drafts/DraftApprovePanel.js +315 -0
  102. package/lib/components/drafts/DraftCanvas.d.ts +13 -0
  103. package/lib/components/drafts/DraftCanvas.js +496 -0
  104. package/lib/components/drafts/DraftDesignerSheet.d.ts +9 -0
  105. package/lib/components/drafts/DraftDesignerSheet.js +685 -0
  106. package/lib/components/drafts/ProductDraftsHost.d.ts +3 -0
  107. package/lib/components/drafts/ProductDraftsHost.js +207 -0
  108. package/lib/components/drafts/useHtmlImage.d.ts +1 -0
  109. package/lib/components/drafts/useHtmlImage.js +45 -0
  110. package/lib/components/icons/IconChecked.d.ts +3 -0
  111. package/lib/components/icons/IconChecked.js +10 -0
  112. package/lib/components/icons/IconCheckedOrNoStock.d.ts +7 -0
  113. package/lib/components/icons/IconCheckedOrNoStock.js +13 -0
  114. package/lib/components/icons/IconCountryFlag.d.ts +8 -0
  115. package/lib/components/icons/IconCountryFlag.js +27 -0
  116. package/lib/components/icons/IconFile.d.ts +7 -0
  117. package/lib/components/icons/IconFile.js +41 -0
  118. package/lib/components/icons/IconNoStock.d.ts +3 -0
  119. package/lib/components/icons/IconNoStock.js +12 -0
  120. package/lib/components/icons/index.d.ts +5 -0
  121. package/lib/components/icons/index.js +6 -0
  122. package/lib/components/quoteAfterFieldChange.d.ts +7 -0
  123. package/lib/components/quoteAfterFieldChange.js +11 -0
  124. package/lib/components/quoteAfterFieldChange.test.js +58 -0
  125. package/lib/components/utils.d.ts +26 -0
  126. package/lib/components/utils.js +500 -0
  127. package/lib/context/MerchiProductFormProvider.d.ts +177 -0
  128. package/lib/context/MerchiProductFormProvider.js +1020 -0
  129. package/lib/images/product-not-found.png +0 -0
  130. package/lib/index.d.ts +42 -0
  131. package/lib/index.js +41 -0
  132. package/lib/styles/globals.css +1590 -0
  133. package/lib/styles/globals.css.map +1 -0
  134. package/lib/styles/globals.scss +1698 -0
  135. package/lib/utils/area.d.ts +77 -0
  136. package/lib/utils/area.js +298 -0
  137. package/lib/utils/cleanFormVariationJson.d.ts +5 -0
  138. package/lib/utils/cleanFormVariationJson.js +39 -0
  139. package/lib/utils/cleanFormVariationJson.test.js +54 -0
  140. package/lib/utils/countries.d.ts +7 -0
  141. package/lib/utils/countries.js +290 -0
  142. package/lib/utils/currency.d.ts +2 -0
  143. package/lib/utils/currency.js +188 -0
  144. package/lib/utils/draftExport.d.ts +21 -0
  145. package/lib/utils/draftExport.js +481 -0
  146. package/lib/utils/draftExport.test.js +78 -0
  147. package/lib/utils/draftFonts.d.ts +55 -0
  148. package/lib/utils/draftFonts.js +68 -0
  149. package/lib/utils/draftStorage.d.ts +25 -0
  150. package/lib/utils/draftStorage.js +148 -0
  151. package/lib/utils/draftStorage.test.js +125 -0
  152. package/lib/utils/draftTemplates.d.ts +87 -0
  153. package/lib/utils/draftTemplates.js +579 -0
  154. package/lib/utils/draftTemplates.test.js +476 -0
  155. package/lib/utils/formErrors.d.ts +2 -0
  156. package/lib/utils/formErrors.js +29 -0
  157. package/lib/utils/index.d.ts +3 -0
  158. package/lib/utils/index.js +4 -0
  159. package/lib/utils/priceMatrix.d.ts +57 -0
  160. package/lib/utils/priceMatrix.js +82 -0
  161. package/lib/utils/priceMatrix.test.js +200 -0
  162. package/lib/utils/products.d.ts +40 -0
  163. package/lib/utils/products.js +68 -0
  164. package/lib/utils/quantity.d.ts +7 -0
  165. package/lib/utils/quantity.js +19 -0
  166. package/lib/utils/quantity.test.js +42 -0
  167. package/lib/utils/reconcileVariations.d.ts +25 -0
  168. package/lib/utils/reconcileVariations.js +246 -0
  169. package/lib/utils/reconcileVariations.test.js +239 -0
  170. package/lib/utils/selectedVariationCosts.d.ts +6 -0
  171. package/lib/utils/selectedVariationCosts.js +59 -0
  172. package/lib/utils/selectedVariationCosts.test.js +66 -0
  173. package/lib/utils/selections.d.ts +23 -0
  174. package/lib/utils/selections.js +76 -0
  175. package/lib/utils/selections.test.js +159 -0
  176. package/lib/utils/singleOptionVariation.d.ts +2 -0
  177. package/lib/utils/singleOptionVariation.js +22 -0
  178. package/lib/utils/singleOptionVariation.test.js +59 -0
  179. package/lib/utils/supportedNumbers.d.ts +1 -0
  180. package/lib/utils/supportedNumbers.js +27 -0
  181. package/lib/utils/types.d.ts +114 -0
  182. package/lib/utils/types.js +50 -0
  183. package/lib/utils/url.d.ts +3 -0
  184. package/lib/utils/url.js +65 -0
  185. package/lib/utils/variationFields.d.ts +5 -0
  186. package/lib/utils/variationFields.js +116 -0
  187. package/lib/utils/variationFields.test.js +108 -0
  188. package/package.json +93 -0
@@ -0,0 +1,177 @@
1
+ import * as React from 'react';
2
+ import { ReactNode } from 'react';
3
+ import { useForm } from 'react-hook-form';
4
+ type FormMethods = ReturnType<typeof useForm>;
5
+ interface IMerchiProductForm {
6
+ apiUrl?: string;
7
+ allowAddToCart?: boolean;
8
+ btnNameAddToCart?: string;
9
+ classNameAlertSellerEditable?: string;
10
+ classNameButtonSubmit?: string;
11
+ classNameButtonGroupAdd?: string;
12
+ classNameButtonGroupRemove?: string;
13
+ classNameButtonsSubmitContainer?: string;
14
+ classNameButtonApproveDrafts?: string;
15
+ classNameButtonCloseDrafts?: string;
16
+ classNameDraftButtonContainer?: string;
17
+ classNameDraftCta?: string;
18
+ classNameDraftGroupContainer?: string;
19
+ classNameDraftGroupTitle?: string;
20
+ classNameDraftSheet?: string;
21
+ classNameDraftToolbar?: string;
22
+ classNameFileUploadContainer?: string;
23
+ classNameFileUpload?: string;
24
+ classNameFilePreviewContainer?: string;
25
+ classNameFileUploadTextContainer?: string;
26
+ classNameFilePreviewIconWrapper?: string;
27
+ classNameFileUploadButton?: string;
28
+ classNameFileUploadIcon?: string;
29
+ classNameFileUploadIconSecond?: string;
30
+ classNameFileUploadIconContainer?: string;
31
+ classNameFileListItem?: string;
32
+ classNameFileButtonDownload?: string;
33
+ classNameFileButtonDelete?: string;
34
+ classNameFileListItemContainer?: string;
35
+ classNameGroupsContainer?: string;
36
+ classNameGroupPriceContainer?: string;
37
+ classNameInput?: string;
38
+ classNameInputContainer?: string;
39
+ classNameInventoryStatus?: string;
40
+ classNameOptionContainer?: string;
41
+ classNameOptionInput?: string;
42
+ classNameOptionLabel?: string;
43
+ classNameOptionSuper?: string;
44
+ classNameOptionsCheckboxRadioContainer?: string;
45
+ classNameOptionImage?: string;
46
+ classNameOptionImageContainer?: string;
47
+ classNameOptionColour?: string;
48
+ classNameOptionColourContainer?: string;
49
+ classNameProductTitle?: string;
50
+ classNameProductOriginTitle?: string;
51
+ classNameProductTotalContainer?: string;
52
+ classNameProductTotal?: string;
53
+ classNameQuantityLabelContainer?: string;
54
+ classNameUnitPrice?: string;
55
+ classNamePriceMatrix?: string;
56
+ control: any;
57
+ currentUser?: any;
58
+ draftApproveCallback: ((job: any) => Promise<void>) | null;
59
+ getQuote: any;
60
+ hcaptchaSiteKey?: string;
61
+ pricingRules?: any;
62
+ hideCost?: boolean;
63
+ hideCountry?: boolean;
64
+ hideCalculatedPrice?: boolean;
65
+ hideDomainName?: boolean;
66
+ hideQuantityField?: boolean;
67
+ hideRequestQuotationButton?: boolean;
68
+ hidePaymentUpfrontButton?: boolean;
69
+ hideTitle?: boolean;
70
+ hookForm: FormMethods;
71
+ isCartItem?: boolean;
72
+ initJob?: any;
73
+ isDraftDesignerOpen: boolean;
74
+ isDraftModalOpen: boolean;
75
+ consumePendingCheckout?: () => (() => void) | null;
76
+ job: any;
77
+ loading: boolean;
78
+ inventoryLoading?: boolean;
79
+ onAddToCart?: () => void;
80
+ onBuyNow?: () => void;
81
+ onGetQuote?: () => void;
82
+ onSubmit?: (jobData: any) => void;
83
+ product: any;
84
+ productFormId?: string;
85
+ setClient: (client: any) => void;
86
+ setIsDraftDesignerOpen: (isOpen: boolean) => void;
87
+ setIsDraftModalOpen: (isOpen: boolean) => void;
88
+ setJob: (job: any) => void;
89
+ setLoading: (loading: boolean) => void;
90
+ showAlert: (alert: any) => void;
91
+ showCurrency?: boolean;
92
+ showCurrencyCode?: boolean;
93
+ showFeatureDeadline?: boolean;
94
+ showGroupBuyStatus?: boolean;
95
+ showPriceMatrix?: boolean;
96
+ showUnitPrice?: boolean;
97
+ }
98
+ export declare const useMerchiFormContext: () => IMerchiProductForm;
99
+ export declare const MerchiProductFormProvider: ({ apiUrl, allowAddToCart, btnNameAddToCart, classNameAlertSellerEditable, classNameButtonSubmit, classNameButtonGroupAdd, classNameButtonGroupRemove, classNameButtonsSubmitContainer, classNameButtonApproveDrafts, classNameButtonCloseDrafts, classNameDraftButtonContainer, classNameDraftCta, classNameDraftGroupContainer, classNameDraftGroupTitle, classNameDraftSheet, classNameDraftToolbar, classNameFileUploadContainer, classNameFileUpload, classNameFilePreviewContainer, classNameFileUploadTextContainer, classNameFilePreviewIconWrapper, classNameFileUploadButton, classNameFileUploadIcon, classNameFileUploadIconSecond, classNameFileUploadIconContainer, classNameFileListItem, classNameFileButtonDownload, classNameFileButtonDelete, classNameFileListItemContainer, classNameGroupsContainer, classNameGroupPriceContainer, classNameInput, classNameInventoryStatus, classNameInputContainer, classNameOptionContainer, classNameOptionInput, classNameOptionLabel, classNameOptionSuper, classNameOptionsCheckboxRadioContainer, classNameOptionImage, classNameOptionImageContainer, classNameOptionColour, classNameOptionColourContainer, classNameProductTitle, classNameProductOriginTitle, classNameProductTotal, classNameProductTotalContainer, classNameQuantityLabelContainer, classNameUnitPrice, classNamePriceMatrix, children, currentUser, hcaptchaSiteKey, hideCost, hideCountry, hideCalculatedPrice, hideDomainName, hideQuantityField, hideRequestQuotationButton, hidePaymentUpfrontButton, hideTitle, isCartItem, initJob, initProduct, pricingRules: pricingRulesProp, onAddToCart, onBuyNow, onGetQuote, onSubmit, productFormId, showCurrency, showCurrencyCode, showFeatureDeadline, showGroupBuyStatus, showPriceMatrix, showUnitPrice, }: {
100
+ apiUrl?: string;
101
+ allowAddToCart?: boolean;
102
+ btnNameAddToCart?: string;
103
+ classNameAlertSellerEditable?: string;
104
+ classNameButtonSubmit?: string;
105
+ classNameButtonGroupAdd?: string;
106
+ classNameButtonGroupRemove?: string;
107
+ classNameButtonsSubmitContainer?: string;
108
+ classNameButtonApproveDrafts?: string;
109
+ classNameButtonCloseDrafts?: string;
110
+ classNameDraftButtonContainer?: string;
111
+ classNameDraftCta?: string;
112
+ classNameDraftGroupContainer?: string;
113
+ classNameDraftGroupTitle?: string;
114
+ classNameDraftSheet?: string;
115
+ classNameDraftToolbar?: string;
116
+ classNameFileUploadContainer?: string;
117
+ classNameFileUpload?: string;
118
+ classNameFilePreviewContainer?: string;
119
+ classNameFileUploadTextContainer?: string;
120
+ classNameFilePreviewIconWrapper?: string;
121
+ classNameFileUploadButton?: string;
122
+ classNameFileUploadIcon?: string;
123
+ classNameFileUploadIconSecond?: string;
124
+ classNameFileUploadIconContainer?: string;
125
+ classNameFileListItem?: string;
126
+ classNameFileButtonDownload?: string;
127
+ classNameFileButtonDelete?: string;
128
+ classNameFileListItemContainer?: string;
129
+ classNameGroupsContainer?: string;
130
+ classNameGroupPriceContainer?: string;
131
+ classNameInput?: string;
132
+ classNameInputContainer?: string;
133
+ classNameInventoryStatus?: string;
134
+ classNameOptionContainer?: string;
135
+ classNameOptionInput?: string;
136
+ classNameOptionLabel?: string;
137
+ classNameOptionSuper?: string;
138
+ classNameOptionsCheckboxRadioContainer?: string;
139
+ classNameOptionImage?: string;
140
+ classNameOptionImageContainer?: string;
141
+ classNameOptionColour?: string;
142
+ classNameProductTitle?: string;
143
+ classNameProductOriginTitle?: string;
144
+ classNameProductTotalContainer?: string;
145
+ classNameProductTotal?: string;
146
+ classNameOptionColourContainer?: string;
147
+ classNameQuantityLabelContainer?: string;
148
+ classNameUnitPrice?: string;
149
+ classNamePriceMatrix?: string;
150
+ children: ReactNode;
151
+ currentUser?: any;
152
+ hcaptchaSiteKey?: string;
153
+ hideCalculatedPrice?: boolean;
154
+ hideCost?: boolean;
155
+ hideCountry?: boolean;
156
+ hideDomainName?: boolean;
157
+ hideQuantityField?: boolean;
158
+ hideRequestQuotationButton?: boolean;
159
+ hidePaymentUpfrontButton?: boolean;
160
+ hideTitle?: boolean;
161
+ isCartItem?: boolean;
162
+ initJob?: any;
163
+ initProduct: any;
164
+ pricingRules?: any;
165
+ onAddToCart?: (job: any) => void;
166
+ onBuyNow?: (job: any) => void;
167
+ onGetQuote?: (job: any) => void;
168
+ onSubmit?: (job: any) => void;
169
+ productFormId?: string;
170
+ showCurrency?: boolean;
171
+ showCurrencyCode?: boolean;
172
+ showFeatureDeadline?: boolean;
173
+ showGroupBuyStatus?: boolean;
174
+ showPriceMatrix?: boolean;
175
+ showUnitPrice?: boolean;
176
+ }) => React.JSX.Element;
177
+ export {};