@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.
- package/README.md +272 -0
- package/lib/actions/jobs.d.ts +3 -0
- package/lib/actions/jobs.js +80 -0
- package/lib/actions/leads.d.ts +7 -0
- package/lib/actions/leads.js +67 -0
- package/lib/components/AlertVariationSellerEditable.d.ts +6 -0
- package/lib/components/AlertVariationSellerEditable.js +46 -0
- package/lib/components/Collapse.d.ts +3 -0
- package/lib/components/Collapse.js +34 -0
- package/lib/components/DateCountdown.d.ts +44 -0
- package/lib/components/DateCountdown.js +188 -0
- package/lib/components/DropzoneInput.d.ts +10 -0
- package/lib/components/DropzoneInput.js +169 -0
- package/lib/components/DynamicVariationInput.d.ts +9 -0
- package/lib/components/DynamicVariationInput.js +71 -0
- package/lib/components/FormLead.d.ts +10 -0
- package/lib/components/FormLead.js +215 -0
- package/lib/components/GroupInventory.d.ts +6 -0
- package/lib/components/GroupInventory.js +16 -0
- package/lib/components/InputGroupQuantity.d.ts +8 -0
- package/lib/components/InputGroupQuantity.js +117 -0
- package/lib/components/InputHiddenStatic.d.ts +8 -0
- package/lib/components/InputHiddenStatic.js +24 -0
- package/lib/components/InputProductQuantity.d.ts +7 -0
- package/lib/components/InputProductQuantity.js +102 -0
- package/lib/components/InventoryStatus.d.ts +7 -0
- package/lib/components/InventoryStatus.js +67 -0
- package/lib/components/MerchiProductForm.d.ts +62 -0
- package/lib/components/MerchiProductForm.js +51 -0
- package/lib/components/PriceMatrix.d.ts +27 -0
- package/lib/components/PriceMatrix.js +106 -0
- package/lib/components/ProductButtonsSubmit.d.ts +3 -0
- package/lib/components/ProductButtonsSubmit.js +52 -0
- package/lib/components/ProductFeatureDeadline.d.ts +3 -0
- package/lib/components/ProductFeatureDeadline.js +25 -0
- package/lib/components/ProductGroupBuyStatus.d.ts +3 -0
- package/lib/components/ProductGroupBuyStatus.js +47 -0
- package/lib/components/ProductPriceMatrix.d.ts +3 -0
- package/lib/components/ProductPriceMatrix.js +51 -0
- package/lib/components/ProductTitle.d.ts +3 -0
- package/lib/components/ProductTitle.js +36 -0
- package/lib/components/ProductTotalCost.d.ts +3 -0
- package/lib/components/ProductTotalCost.js +74 -0
- package/lib/components/ProductUnitPrice.d.ts +7 -0
- package/lib/components/ProductUnitPrice.js +51 -0
- package/lib/components/TooltipElement.d.ts +9 -0
- package/lib/components/TooltipElement.js +35 -0
- package/lib/components/VariationAreaInput.d.ts +8 -0
- package/lib/components/VariationAreaInput.js +219 -0
- package/lib/components/VariationCheckBoxOrRadioOption.d.ts +10 -0
- package/lib/components/VariationCheckBoxOrRadioOption.js +82 -0
- package/lib/components/VariationCheckboxRadio.d.ts +17 -0
- package/lib/components/VariationCheckboxRadio.js +57 -0
- package/lib/components/VariationColourExtractInput.d.ts +8 -0
- package/lib/components/VariationColourExtractInput.js +395 -0
- package/lib/components/VariationError.d.ts +7 -0
- package/lib/components/VariationError.js +52 -0
- package/lib/components/VariationFieldInputInstructions.d.ts +10 -0
- package/lib/components/VariationFieldInputInstructions.js +50 -0
- package/lib/components/VariationFieldInstructions.d.ts +3 -0
- package/lib/components/VariationFieldInstructions.js +22 -0
- package/lib/components/VariationFieldNameAndCostInputs.d.ts +7 -0
- package/lib/components/VariationFieldNameAndCostInputs.js +34 -0
- package/lib/components/VariationFieldOptionDefaultInputs.d.ts +7 -0
- package/lib/components/VariationFieldOptionDefaultInputs.js +48 -0
- package/lib/components/VariationFieldStaticValues.d.ts +8 -0
- package/lib/components/VariationFieldStaticValues.js +57 -0
- package/lib/components/VariationFileInput.d.ts +8 -0
- package/lib/components/VariationFileInput.js +229 -0
- package/lib/components/VariationInput.d.ts +11 -0
- package/lib/components/VariationInput.js +97 -0
- package/lib/components/VariationLabel.d.ts +11 -0
- package/lib/components/VariationLabel.js +85 -0
- package/lib/components/VariationOptionColour.d.ts +8 -0
- package/lib/components/VariationOptionColour.js +50 -0
- package/lib/components/VariationOptionImage.d.ts +8 -0
- package/lib/components/VariationOptionImage.js +52 -0
- package/lib/components/VariationSelect.d.ts +8 -0
- package/lib/components/VariationSelect.js +66 -0
- package/lib/components/VariationSelectElements.d.ts +16 -0
- package/lib/components/VariationSelectElements.js +141 -0
- package/lib/components/VariationTurnaroundTime.d.ts +9 -0
- package/lib/components/VariationTurnaroundTime.js +156 -0
- package/lib/components/Variations.d.ts +9 -0
- package/lib/components/Variations.js +109 -0
- package/lib/components/VariationsGroups.d.ts +8 -0
- package/lib/components/VariationsGroups.js +79 -0
- package/lib/components/buttons/ButtonAddGroup.d.ts +7 -0
- package/lib/components/buttons/ButtonAddGroup.js +38 -0
- package/lib/components/buttons/ButtonProductSubmit.d.ts +7 -0
- package/lib/components/buttons/ButtonProductSubmit.js +33 -0
- package/lib/components/buttons/ButtonRemoveGroup.d.ts +8 -0
- package/lib/components/buttons/ButtonRemoveGroup.js +25 -0
- package/lib/components/buttons/index.d.ts +4 -0
- package/lib/components/buttons/index.js +5 -0
- package/lib/components/cost.d.ts +11 -0
- package/lib/components/cost.js +44 -0
- package/lib/components/currency.d.ts +16 -0
- package/lib/components/currency.js +184 -0
- package/lib/components/drafts/DraftApprovePanel.d.ts +6 -0
- package/lib/components/drafts/DraftApprovePanel.js +315 -0
- package/lib/components/drafts/DraftCanvas.d.ts +13 -0
- package/lib/components/drafts/DraftCanvas.js +496 -0
- package/lib/components/drafts/DraftDesignerSheet.d.ts +9 -0
- package/lib/components/drafts/DraftDesignerSheet.js +685 -0
- package/lib/components/drafts/ProductDraftsHost.d.ts +3 -0
- package/lib/components/drafts/ProductDraftsHost.js +207 -0
- package/lib/components/drafts/useHtmlImage.d.ts +1 -0
- package/lib/components/drafts/useHtmlImage.js +45 -0
- package/lib/components/icons/IconChecked.d.ts +3 -0
- package/lib/components/icons/IconChecked.js +10 -0
- package/lib/components/icons/IconCheckedOrNoStock.d.ts +7 -0
- package/lib/components/icons/IconCheckedOrNoStock.js +13 -0
- package/lib/components/icons/IconCountryFlag.d.ts +8 -0
- package/lib/components/icons/IconCountryFlag.js +27 -0
- package/lib/components/icons/IconFile.d.ts +7 -0
- package/lib/components/icons/IconFile.js +41 -0
- package/lib/components/icons/IconNoStock.d.ts +3 -0
- package/lib/components/icons/IconNoStock.js +12 -0
- package/lib/components/icons/index.d.ts +5 -0
- package/lib/components/icons/index.js +6 -0
- package/lib/components/quoteAfterFieldChange.d.ts +7 -0
- package/lib/components/quoteAfterFieldChange.js +11 -0
- package/lib/components/quoteAfterFieldChange.test.js +58 -0
- package/lib/components/utils.d.ts +26 -0
- package/lib/components/utils.js +500 -0
- package/lib/context/MerchiProductFormProvider.d.ts +177 -0
- package/lib/context/MerchiProductFormProvider.js +1020 -0
- package/lib/images/product-not-found.png +0 -0
- package/lib/index.d.ts +42 -0
- package/lib/index.js +41 -0
- package/lib/styles/globals.css +1590 -0
- package/lib/styles/globals.css.map +1 -0
- package/lib/styles/globals.scss +1698 -0
- package/lib/utils/area.d.ts +77 -0
- package/lib/utils/area.js +298 -0
- package/lib/utils/cleanFormVariationJson.d.ts +5 -0
- package/lib/utils/cleanFormVariationJson.js +39 -0
- package/lib/utils/cleanFormVariationJson.test.js +54 -0
- package/lib/utils/countries.d.ts +7 -0
- package/lib/utils/countries.js +290 -0
- package/lib/utils/currency.d.ts +2 -0
- package/lib/utils/currency.js +188 -0
- package/lib/utils/draftExport.d.ts +21 -0
- package/lib/utils/draftExport.js +481 -0
- package/lib/utils/draftExport.test.js +78 -0
- package/lib/utils/draftFonts.d.ts +55 -0
- package/lib/utils/draftFonts.js +68 -0
- package/lib/utils/draftStorage.d.ts +25 -0
- package/lib/utils/draftStorage.js +148 -0
- package/lib/utils/draftStorage.test.js +125 -0
- package/lib/utils/draftTemplates.d.ts +87 -0
- package/lib/utils/draftTemplates.js +579 -0
- package/lib/utils/draftTemplates.test.js +476 -0
- package/lib/utils/formErrors.d.ts +2 -0
- package/lib/utils/formErrors.js +29 -0
- package/lib/utils/index.d.ts +3 -0
- package/lib/utils/index.js +4 -0
- package/lib/utils/priceMatrix.d.ts +57 -0
- package/lib/utils/priceMatrix.js +82 -0
- package/lib/utils/priceMatrix.test.js +200 -0
- package/lib/utils/products.d.ts +40 -0
- package/lib/utils/products.js +68 -0
- package/lib/utils/quantity.d.ts +7 -0
- package/lib/utils/quantity.js +19 -0
- package/lib/utils/quantity.test.js +42 -0
- package/lib/utils/reconcileVariations.d.ts +25 -0
- package/lib/utils/reconcileVariations.js +246 -0
- package/lib/utils/reconcileVariations.test.js +239 -0
- package/lib/utils/selectedVariationCosts.d.ts +6 -0
- package/lib/utils/selectedVariationCosts.js +59 -0
- package/lib/utils/selectedVariationCosts.test.js +66 -0
- package/lib/utils/selections.d.ts +23 -0
- package/lib/utils/selections.js +76 -0
- package/lib/utils/selections.test.js +159 -0
- package/lib/utils/singleOptionVariation.d.ts +2 -0
- package/lib/utils/singleOptionVariation.js +22 -0
- package/lib/utils/singleOptionVariation.test.js +59 -0
- package/lib/utils/supportedNumbers.d.ts +1 -0
- package/lib/utils/supportedNumbers.js +27 -0
- package/lib/utils/types.d.ts +114 -0
- package/lib/utils/types.js +50 -0
- package/lib/utils/url.d.ts +3 -0
- package/lib/utils/url.js +65 -0
- package/lib/utils/variationFields.d.ts +5 -0
- package/lib/utils/variationFields.js +116 -0
- package/lib/utils/variationFields.test.js +108 -0
- 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 {};
|