@orderingstack/front-components-product-configurator 1.8.1 → 1.8.2

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 (85) hide show
  1. package/dist/DefaultDeviceCode-CnKwsh6j.mjs +201 -0
  2. package/dist/DefaultDeviceCode-eT4w9geC.js +5 -0
  3. package/dist/Logo-ByIuMLVG.js +61 -0
  4. package/dist/Logo-C535H7gA.mjs +90 -0
  5. package/dist/index.cjs.js +27 -16
  6. package/dist/index.es.js +14442 -9648
  7. package/dist/src/App.d.ts +2 -0
  8. package/dist/src/clients/ProductConfiguratorClient.d.ts +11 -0
  9. package/dist/{components → src/components}/Counter/Counter.d.ts +1 -2
  10. package/dist/src/components/DisplayState/DisplayState.d.ts +2 -0
  11. package/dist/src/components/Extra/Extra.d.ts +2 -0
  12. package/dist/src/components/Extra/index.d.ts +2 -0
  13. package/dist/src/components/Footer/Footer.d.ts +5 -0
  14. package/dist/src/components/Footer/index.d.ts +2 -0
  15. package/dist/{components → src/components}/GroupStateInfo/GroupStateInfo.d.ts +2 -2
  16. package/dist/src/components/InfoLine/InfoLine.d.ts +7 -0
  17. package/dist/{components → src/components}/MenuItemsDispatcher/MenuItemsDispatcher.d.ts +2 -3
  18. package/dist/{components → src/components}/MenuOptions/MenuOptions.d.ts +1 -2
  19. package/dist/{components → src/components}/MenuOptions/MenuOptionsDefaultUI.d.ts +1 -2
  20. package/dist/{components → src/components}/MenuProduct/MenuProduct.d.ts +3 -3
  21. package/dist/{components → src/components}/MenuProduct/useMenuProduct.d.ts +1 -1
  22. package/dist/{components → src/components}/MenuProductRoot/MenuProductRoot.d.ts +2 -3
  23. package/dist/{components → src/components}/MenuProductRoot/MenuProductRootDefaultUI.d.ts +1 -2
  24. package/dist/{components → src/components}/MenuProductRoot/MenuProductRootDefaultUIModal.d.ts +1 -2
  25. package/dist/{components → src/components}/Price/Price.d.ts +1 -2
  26. package/dist/{components → src/components}/ProductConfigurator/ProductConfigurator.d.ts +1 -2
  27. package/dist/{components → src/components}/ProductConfigurator/useProductConfigurator.d.ts +1 -1
  28. package/dist/{components → src/components}/SimpleCheckbox/SimpleCheckbox.d.ts +1 -2
  29. package/dist/{components → src/components}/SimpleRadio/SimpleRadio.d.ts +1 -2
  30. package/dist/src/components/SimpleRadioWithImage/SimpleRadioWithImage.d.ts +2 -0
  31. package/dist/src/components/SimpleRadioWithImage/index.d.ts +2 -0
  32. package/dist/{components → src/components}/SubmitRow/SubmitRow.d.ts +1 -2
  33. package/dist/{context → src/context}/Components.d.ts +1 -1
  34. package/dist/{context → src/context}/GroupsValidation.d.ts +2 -2
  35. package/dist/{context → src/context}/ProductData.d.ts +2 -2
  36. package/dist/src/index.d.ts +0 -0
  37. package/dist/src/state/index.d.ts +6 -0
  38. package/dist/src/translations/i18n.d.ts +1 -0
  39. package/dist/src/types/index.d.ts +129 -0
  40. package/dist/{utils → src/utils}/formatPrice.d.ts +1 -1
  41. package/dist/src/utils/getAttrs.d.ts +1 -0
  42. package/dist/src/utils/translations.d.ts +1 -0
  43. package/dist/style.css +1 -1
  44. package/dist/types/index.d.ts +1 -130
  45. package/package.json +2 -1
  46. package/dist/components/DisplayState/DisplayState.d.ts +0 -2
  47. package/dist/components/InfoLine/InfoLine.d.ts +0 -8
  48. package/dist/state/index.d.ts +0 -6
  49. package/dist/vite-env.d.ts +0 -1
  50. /package/dist/{components → src/components}/Counter/index.d.ts +0 -0
  51. /package/dist/{components → src/components}/DisplayState/index.d.ts +0 -0
  52. /package/dist/{components → src/components}/GroupStateInfo/index.d.ts +0 -0
  53. /package/dist/{components → src/components}/InfoLine/index.d.ts +0 -0
  54. /package/dist/{components → src/components}/MenuItemsDispatcher/index.d.ts +0 -0
  55. /package/dist/{components → src/components}/MenuItemsDispatcher/useMenuItemsDispatcher.d.ts +0 -0
  56. /package/dist/{components → src/components}/MenuOptions/index.d.ts +0 -0
  57. /package/dist/{components → src/components}/MenuOptions/useMenuOptions.d.ts +0 -0
  58. /package/dist/{components → src/components}/MenuProduct/index.d.ts +0 -0
  59. /package/dist/{components → src/components}/MenuProductRoot/index.d.ts +0 -0
  60. /package/dist/{components → src/components}/Price/index.d.ts +0 -0
  61. /package/dist/{components → src/components}/ProductConfigurator/index.d.ts +0 -0
  62. /package/dist/{components → src/components}/SimpleCheckbox/index.d.ts +0 -0
  63. /package/dist/{components → src/components}/SimpleRadio/index.d.ts +0 -0
  64. /package/dist/{components → src/components}/SubmitRow/index.d.ts +0 -0
  65. /package/dist/{hooks → src/hooks}/useEmitFilter.d.ts +0 -0
  66. /package/dist/{hooks → src/hooks}/useExpand.d.ts +0 -0
  67. /package/dist/{hooks → src/hooks}/useValidate.d.ts +0 -0
  68. /package/dist/{hooks → src/hooks}/useWindow.d.ts +0 -0
  69. /package/dist/{state → src/state}/expandedItems.d.ts +0 -0
  70. /package/dist/{state → src/state}/filter.d.ts +0 -0
  71. /package/dist/{state → src/state}/validate.d.ts +0 -0
  72. /package/dist/{translations → src/translations}/dictionary.d.ts +0 -0
  73. /package/dist/{utils → src/utils}/cleanSelected.d.ts +0 -0
  74. /package/dist/{utils → src/utils}/countPrice.d.ts +0 -0
  75. /package/dist/{utils → src/utils}/filter.d.ts +0 -0
  76. /package/dist/{utils → src/utils}/formatValues.d.ts +0 -0
  77. /package/dist/{utils → src/utils}/getContext.d.ts +0 -0
  78. /package/dist/{utils → src/utils}/getProduct.d.ts +0 -0
  79. /package/dist/{utils → src/utils}/getSelCtxCntFromSelectedState.d.ts +0 -0
  80. /package/dist/{utils → src/utils}/getValidSelectedState.d.ts +0 -0
  81. /package/dist/{utils → src/utils}/groupsValidation.d.ts +0 -0
  82. /package/dist/{utils → src/utils}/index.d.ts +0 -0
  83. /package/dist/{utils → src/utils}/setSelected.d.ts +0 -0
  84. /package/dist/{utils → src/utils}/validate.d.ts +0 -0
  85. /package/dist/{utils → src/utils}/validationMessagesToRefactor.d.ts +0 -0
@@ -1,130 +1 @@
1
- /// <reference types="react" />
2
- import hamburgerProduct from '../../__mocks__/hamburger-w-zestawie.json';
3
- import comboBurger from '../../__mocks__/burger-combo-complex.json';
4
- import { IProduct } from '@orderingstack/ordering-types';
5
- import { UseFormRegisterReturn } from 'react-hook-form';
6
- export interface IMenuProductRootUIProps {
7
- product: IProduct;
8
- countedProductPrice: number;
9
- countedProductTotalPrice: number;
10
- currency: string;
11
- productQuantity: number;
12
- showDebugState?: boolean;
13
- children: JSX.Element;
14
- isOpen?: boolean;
15
- increaseProductQuantity: () => void;
16
- decreaseProductQuantity: () => void;
17
- handleOnSubmit: () => void;
18
- handleGoBack: () => void;
19
- handleClose?: () => void;
20
- }
21
- export interface IMenuOptionsUIProps {
22
- nestedLvl: number;
23
- optionsItem: IProduct;
24
- parentSelCtx: string;
25
- selected: any;
26
- isOnSubmitted: boolean;
27
- actualQtyCnt: number;
28
- actualSelCnt: number;
29
- children: JSX.Element;
30
- }
31
- export interface IMenuProductUIProps {
32
- product: IProduct;
33
- nestedLvl: number;
34
- registerProps: UseFormRegisterReturn;
35
- inputId: string;
36
- radioInputValue: string;
37
- isRadio: boolean;
38
- isCheckbox: boolean;
39
- isCounter: boolean;
40
- isDecrementEnabled: boolean;
41
- isIncrementEnabled: boolean;
42
- isChecked: boolean;
43
- isCheckboxEnabled: boolean;
44
- counterValue: number;
45
- handleCounterIncrementQty: () => void;
46
- handleCounterDecrementQty: () => void;
47
- children: JSX.Element;
48
- parentProduct?: IProduct;
49
- }
50
- export declare enum MainView {
51
- FULL_PAGE = "FULL_PAGE",
52
- MODAL = "MODAL"
53
- }
54
- export interface Attrs {
55
- selMin?: string;
56
- selMax?: string;
57
- qtyMin?: string;
58
- qtyMax?: string;
59
- vital?: boolean;
60
- allowMultiple?: boolean;
61
- }
62
- export declare enum ProductTypes {
63
- SIMPLE = "SIMPLE",
64
- COMPLEX = "COMPLEX",
65
- QUANTITY = "QUANTITY"
66
- }
67
- export declare enum ContextType {
68
- SELECT = "selCtx",
69
- FILTER = "fltCtx"
70
- }
71
- export declare enum ProductKinds {
72
- OPTIONS = "3e/group/options",
73
- CONFIG = "3e/group/config",
74
- PRODUCT = "3e/product"
75
- }
76
- export declare type TProductConfigurator = {
77
- product: Product;
78
- mainView: MainView;
79
- subProductsView?: string;
80
- mainColor?: string;
81
- mainFont?: string;
82
- lang?: string;
83
- tenantConfig?: any;
84
- venueConfig?: any;
85
- };
86
- export declare type TView = {
87
- product: Product;
88
- subProductsView?: string;
89
- mainColor?: string;
90
- mainFont?: string;
91
- lang?: string;
92
- tenantConfig?: any;
93
- venueConfig?: any;
94
- isModal?: boolean;
95
- showDebugState?: boolean;
96
- handleAddToCart: (obj: any) => void;
97
- handleGoBack: () => void;
98
- };
99
- export declare type TExtra = {
100
- productName: string;
101
- price: string;
102
- };
103
- export declare type Product = typeof hamburgerProduct | typeof comboBurger;
104
- export declare type TProductItem = any;
105
- export declare type TSimpleRadioWithImage = {
106
- productName: string;
107
- price: string;
108
- size?: string;
109
- };
110
- export declare enum SelMinSelMaxStatus {
111
- OK = "OK",
112
- TOO_MUCH = "TOO_MUCH",
113
- NOT_ENOUGHT = "NOT_ENOUGHT",
114
- IGNORE = "IGNORE"
115
- }
116
- export interface IValidationSelCtx {
117
- parentSelCtx: string;
118
- disableAddCounter: Attrs;
119
- disableInput: boolean;
120
- isSelCntAllowedToIncrement: boolean;
121
- isQtyCntAllowedToIncrement: boolean;
122
- parentKind: string;
123
- nestedLvl: number;
124
- isPassedFiltering: boolean;
125
- isValid: boolean;
126
- debug: any;
127
- }
128
- export interface IValidationSelCtxMap {
129
- [selCtx: string]: IValidationSelCtx;
130
- }
1
+ export {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orderingstack/front-components-product-configurator",
3
- "version": "1.8.1",
3
+ "version": "1.8.2",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",
@@ -23,6 +23,7 @@
23
23
  "typecheck": "tsc --project tsconfig.json --noEmit"
24
24
  },
25
25
  "dependencies": {
26
+ "@orderingstack/front-hooks": "^6.11.0",
26
27
  "@headlessui/react": "^1.4.2",
27
28
  "clsx": "^1.1.1",
28
29
  "dinero.js": "^1.9.1",
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const DisplayState: () => JSX.Element;
@@ -1,8 +0,0 @@
1
- /// <reference types="react" />
2
- interface Props {
3
- isOk: boolean;
4
- isErr: boolean;
5
- info: string;
6
- }
7
- export declare function InfoLine(props: Props): JSX.Element;
8
- export {};
@@ -1,6 +0,0 @@
1
- import { IFilterSlice } from './filter';
2
- import { IValidationSlice } from './validate';
3
- import { IExpandedSlice } from './expandedItems';
4
- export declare type StoreState = IFilterSlice & IValidationSlice & IExpandedSlice;
5
- declare const useStore: import("zustand").UseBoundStore<StoreState, import("zustand").StoreApi<StoreState>>;
6
- export default useStore;
@@ -1 +0,0 @@
1
- /// <reference types="vite/client" />
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes