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K,CAAC,IAAI,CAAC,SAAS,CAAC,0CAAE,aAAa,0CAAE,MAAM,EACtD,SAAS,EAAE,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,MAC7D,CAAC,CAAC,gBAAgB,GAAG,EAAE,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAE,CAAC,GACrC,CACN,CACb,EACP;KACH;;;;;;","names":[],"sources":["src/components/controllers/product/sc-product-quantity/sc-product-quantity.css?tag=sc-product-quantity&encapsulation=shadow","src/components/controllers/product/sc-product-quantity/sc-product-quantity.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Host, h, Prop } from '@stencil/core';\nimport { state } from '@store/product';\nimport { setProduct } from '@store/product/setters';\nimport { getMaxStockQuantity } from '../../../../functions/quantity';\nlet id = 0;\n\n@Component({\n tag: 'sc-product-quantity',\n styleUrl: 'sc-product-quantity.css',\n shadow: true,\n})\nexport class ScProductQuantity {\n private inputId: string = `sc-quantity-${++id}`;\n private helpId = `sc-quantity-help-text-${id}`;\n private labelId = `sc-quantity-label-${id}`;\n\n /** Size of the control */\n @Prop({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n /** Name for the input. Used for validation errors. */\n @Prop() name: string;\n\n /** Display server-side validation errors. */\n @Prop() errors: any;\n\n /** Show the label. */\n @Prop() showLabel: boolean = true;\n\n /** Input label. */\n @Prop() label: string;\n\n /** Whether the input is required. */\n @Prop() required: boolean = false;\n\n /** Help text */\n @Prop() help: string;\n\n /** The product id */\n @Prop() productId: string;\n\n render() {\n const maxStockQuantity = getMaxStockQuantity(state[this.productId]?.product, state[this.productId]?.selectedVariant);\n\n return (\n <Host>\n <sc-form-control\n exportparts=\"label, help-text, form-control\"\n size={this.size}\n required={this.required}\n label={this.label}\n showLabel={this.showLabel}\n help={this.help}\n inputId={this.inputId}\n helpId={this.helpId}\n labelId={this.labelId}\n name={this.name}\n >\n <sc-quantity-select\n size={this.size}\n quantity={Math.max(state[this.productId]?.selectedPrice?.ad_hoc ? 1 : state[this.productId]?.quantity, 1)}\n disabled={state[this.productId]?.selectedPrice?.ad_hoc}\n onScInput={e => setProduct(this.productId, { quantity: e.detail })}\n {...(!!maxStockQuantity ? { max: maxStockQuantity } : {})}\n ></sc-quantity-select>\n </sc-form-control>\n </Host>\n );\n }\n}\n"],"version":3}