-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvtex.product-quantity.d.ts
106 lines (105 loc) · 4.45 KB
/
vtex.product-quantity.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import { Block } from '.'
declare global {
namespace JSX {
interface IntrinsicElements {
/**
* Displays a quantity selector on the product details page.
* This block must be declared in the theme's `store.product` page template.
*
* @see {@link https://developers.vtex.com/docs/apps/vtex.product-quantity}
*/
'product-quantity': Block<{
/**
* Displays the quantity of remaining items in stock if the available quantity is less than or equal to the value given to this property.
*
* @default 0
*/
warningQuantityThreshold?: number
/**
* Whether the unit of measurement should be displayed (`true`) or not (`false`).
*
* @default true
*/
showUnit?: boolean
/**
* Preset size values for font-size and padding.
* You can check these value measures by accessing the [VTEX Styleguide](https://styleguide.vtex.com/#/Components/Forms/NumericStepper).
* Possible values are: `small`, `regular`, and `large`.
*
* @default "small"
*/
size?: 'small' | 'regular' | 'large'
/**
* Whether a label should be displayed (`true`) or not (`false`).
*
* @default true
*/
showLabel?: boolean
/**
* Defines how the quantity selector should initially behave.
* Possible values are: `stepper` (displays an input field where the quantity can be directly defined, in addition to side buttons to increase or decrease the value) and `dropdown` (shows a list of predefined-quantity options.
* In case the last quantity option is selected by users, the component is replaced with an input).
*
* @default "stepper"
*/
selectorType?: 'stepper' | 'dropdown'
/**
* Defines how the number of products that have unitMultiplier will works.
* Possible values are: `singleUnit` (the quantity will be not affected with the unitMultiplier) and `unitMultiplier` (the quantity will be affected with the unitMultiplier).
*
* @default "unitMultiplier"
*/
quantitySelectorStep?: 'singleUnit' | 'unitMultiplier'
}>
/**
* Displays a quantity selector on [Product Summary](https://vtex.io/docs/components/all/vtex.product-summary/)'s blocks.
* This block must be declared as a children of the `product-summary.shelf` block.
*
* @see {@link https://developers.vtex.com/docs/apps/vtex.product-quantity}
*/
'product-summary-quantity': Block<{
/**
* Displays the quantity of remaining items in stock if the available quantity is less than or equal to the value given to this property.
*
* @default 0
*/
warningQuantityThreshold?: number
/**
* Whether the unit of measurement should be displayed (`true`) or not (`false`).
*
* @default true
*/
showUnit?: boolean
/**
* Preset size values for font-size and padding.
* You can check these value measures by accessing the [VTEX Styleguide](https://styleguide.vtex.com/#/Components/Forms/NumericStepper).
* Possible values are: `small`, `regular`, and `large`.
*
* @default "small"
*/
size?: 'small' | 'regular' | 'large'
/**
* Whether a label should be displayed (`true`) or not (`false`).
*
* @default true
*/
showLabel?: boolean
/**
* Defines how the quantity selector should initially behave.
* Possible values are: `stepper` (displays an input field where the quantity can be directly defined, in addition to side buttons to increase or decrease the value) and `dropdown` (shows a list of predefined-quantity options.
* In case the last quantity option is selected by users, the component is replaced with an input).
*
* @default "stepper"
*/
selectorType?: 'stepper' | 'dropdown'
/**
* Defines how the number of products that have unitMultiplier will works.
* Possible values are: `singleUnit` (the quantity will be not affected with the unitMultiplier) and `unitMultiplier` (the quantity will be affected with the unitMultiplier).
*
* @default "unitMultiplier"
*/
quantitySelectorStep?: 'singleUnit' | 'unitMultiplier'
}>
}
}
}