crmbonus-component-wake 2.1.40-ngrok → 2.1.41-shoulder
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/LICENSE +21 -21
- package/dist/cjs/app-modal.cjs.entry.js +2 -2
- package/dist/cjs/app-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/bc-crmbonus.cjs.entry.js +28 -0
- package/dist/cjs/bc-crmbonus.cjs.entry.js.map +1 -0
- package/dist/cjs/bc-phone-form_2.cjs.entry.js +333 -0
- package/dist/cjs/bc-phone-form_2.cjs.entry.js.map +1 -0
- package/dist/cjs/bc-wake-crmbonus.cjs.entry.js +18 -0
- package/dist/cjs/bc-wake-crmbonus.cjs.entry.js.map +1 -0
- package/dist/cjs/cart.helper-d1f02660.js +201 -0
- package/dist/cjs/cart.helper-d1f02660.js.map +1 -0
- package/dist/cjs/container-empty.cjs.entry.js +2 -2
- package/dist/cjs/container-empty.cjs.entry.js.map +1 -1
- package/dist/cjs/countdown-timer-v2.cjs.entry.js +2 -2
- package/dist/cjs/countdown-timer-v2.cjs.entry.js.map +1 -1
- package/dist/cjs/countdown-timer_11.cjs.entry.js +66 -42
- package/dist/cjs/countdown-timer_11.cjs.entry.js.map +1 -1
- package/dist/cjs/crm-bonus-note.cjs.entry.js +14 -12
- package/dist/cjs/crm-bonus-note.cjs.entry.js.map +1 -1
- package/dist/cjs/crmbonus-component-wake.cjs.js +2 -2
- package/dist/{components/p-0d09c221.js → cjs/crmbonus.service-ef8fe456.js} +30 -117
- package/dist/cjs/crmbonus.service-ef8fe456.js.map +1 -0
- package/dist/{esm/info.config.helper-e4b8c478.js → cjs/i18n-defaa4f8.js} +3 -30
- package/dist/cjs/i18n-defaa4f8.js.map +1 -0
- package/dist/cjs/{index-a7537457.js → index-e45b352e.js} +17 -1
- package/dist/cjs/index-e45b352e.js.map +1 -0
- package/dist/cjs/info.config.helper-52984ab9.js +36 -0
- package/dist/cjs/info.config.helper-52984ab9.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/pedido-finalizado.cjs.entry.js +6 -5
- package/dist/cjs/pedido-finalizado.cjs.entry.js.map +1 -1
- package/dist/cjs/utils-5d59acb1.js.map +1 -1
- package/dist/collection/assets/svg/money-dollars-svgrepo-com.svg +5 -5
- package/dist/collection/collection-manifest.json +5 -1
- package/dist/collection/components/button/crm-button.css +21 -21
- package/dist/collection/components/button/index.js +1 -1
- package/dist/collection/components/button/index.js.map +1 -1
- package/dist/collection/components/countdown-timer/countdown-timer.js +1 -1
- package/dist/collection/components/countdown-timer/countdown-timer.js.map +1 -1
- package/dist/collection/components/countdown-timer/countdown-timer.v2.js +2 -2
- package/dist/collection/components/countdown-timer/countdown-timer.v2.js.map +1 -1
- package/dist/collection/components/crm-bonus/assets/logo.svg +17 -17
- package/dist/collection/components/crm-bonus/assets/svg/logo.svg +17 -17
- package/dist/collection/components/crm-bonus/crm-bonus.css +86 -82
- package/dist/collection/components/crm-bonus/crm-bonus.js +27 -6
- package/dist/collection/components/crm-bonus/crm-bonus.js.map +1 -1
- package/dist/collection/components/crmbonus/crmbonus.js +26 -0
- package/dist/collection/components/crmbonus/crmbonus.js.map +1 -0
- package/dist/collection/components/crmbonus/subcomponents/phone-form/index.js +95 -0
- package/dist/collection/components/crmbonus/subcomponents/phone-form/index.js.map +1 -0
- package/dist/collection/components/crmbonus/subcomponents/phone-form/styles.scss +5 -0
- package/dist/collection/components/crmbonus/subcomponents/phone-validate/index.js +129 -0
- package/dist/collection/components/crmbonus/subcomponents/phone-validate/index.js.map +1 -0
- package/dist/collection/components/crmbonus/subcomponents/phone-validate/styles.scss +84 -0
- package/dist/collection/components/giftback-form/giftback-form.css +74 -74
- package/dist/collection/components/giftback-form/giftback-form.js +5 -5
- package/dist/collection/components/giftback-form/giftback-form.js.map +1 -1
- package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.css +181 -181
- package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js +6 -6
- package/dist/collection/components/giftback-form/subcomponents/giftback-info/giftback-info.js.map +1 -1
- package/dist/collection/components/giftback-form/subcomponents/giftback-message/giftback-massage.js.map +1 -1
- package/dist/collection/components/giftback-form/subcomponents/phone-form/phone-form.js +1 -1
- package/dist/collection/components/giftback-form/subcomponents/phone-form/phone-form.js.map +1 -1
- package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.css +83 -83
- package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.js +1 -1
- package/dist/collection/components/giftback-form/subcomponents/pin-form/pin-form.js.map +1 -1
- package/dist/collection/components/loading-container/container-empty.js +1 -1
- package/dist/collection/components/loading-container/container-empty.js.map +1 -1
- package/dist/collection/components/loading-container/loading-container.css +53 -53
- package/dist/collection/components/loading-container/loading-container.js +1 -1
- package/dist/collection/components/loading-container/loading-container.js.map +1 -1
- package/dist/collection/components/loading-spinner/loading-spinner.css +16 -16
- package/dist/collection/components/loading-spinner/loading-spinner.js +1 -1
- package/dist/collection/components/loading-spinner/loading-spinner.js.map +1 -1
- package/dist/collection/components/modal/app-modal.css +44 -44
- package/dist/collection/components/modal/app-modal.js +1 -1
- package/dist/collection/components/modal/app-modal.js.map +1 -1
- package/dist/collection/components/note/crm-bonus-note.css +68 -68
- package/dist/collection/components/note/crm-bonus-note.js +2 -2
- package/dist/collection/components/note/crm-bonus-note.js.map +1 -1
- package/dist/collection/components/pedido/pedido.js +2 -2
- package/dist/collection/components/pedido/pedido.js.map +1 -1
- package/dist/collection/components/phone/phone-input-mask.css +40 -40
- package/dist/collection/components/phone/phone-input-mask.js +1 -1
- package/dist/collection/components/phone/phone-input-mask.js.map +1 -1
- package/dist/collection/components/tooltip/crm-tooltip.css +48 -48
- package/dist/collection/components/tooltip/tooltip.js +1 -1
- package/dist/collection/components/tooltip/tooltip.js.map +1 -1
- package/dist/collection/contants/index.js.map +1 -1
- package/dist/collection/contants/mocks.js.map +1 -1
- package/dist/collection/dto/checkout.dto.js +2 -0
- package/dist/collection/dto/checkout.dto.js.map +1 -0
- package/dist/collection/dto/pin.sent.js.map +1 -1
- package/dist/collection/dto/reserved-info.dto.js.map +1 -1
- package/dist/collection/dto/update.order.dto.js.map +1 -1
- package/dist/collection/dto/validate.pin.bonus.js.map +1 -1
- package/dist/collection/helpers/build.payload.helper.js +1 -0
- package/dist/collection/helpers/build.payload.helper.js.map +1 -1
- package/dist/collection/helpers/cart.helper.js +55 -1
- package/dist/collection/helpers/cart.helper.js.map +1 -1
- package/dist/collection/helpers/info.config.helper.js.map +1 -1
- package/dist/collection/helpers/payload.interface.js.map +1 -1
- package/dist/collection/helpers/time.helper.js.map +1 -1
- package/dist/collection/i18n/i18n.js.map +1 -1
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/objectvalues/cart.wake.js +33 -8
- package/dist/collection/objectvalues/cart.wake.js.map +1 -1
- package/dist/collection/platforms/wake/index.js +8 -0
- package/dist/collection/platforms/wake/index.js.map +1 -0
- package/dist/collection/services/crmbonus.service.js +21 -2
- package/dist/collection/services/crmbonus.service.js.map +1 -1
- package/dist/collection/utils/keys.storage.js.map +1 -1
- package/dist/collection/utils/retry.utils.js.map +1 -1
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/app-modal.js +2 -2
- package/dist/components/app-modal.js.map +1 -1
- package/dist/components/bc-crmbonus.d.ts +11 -0
- package/dist/components/bc-crmbonus.js +8 -0
- package/dist/components/bc-crmbonus.js.map +1 -0
- package/dist/components/bc-phone-form.d.ts +11 -0
- package/dist/components/bc-phone-form.js +8 -0
- package/dist/components/bc-phone-form.js.map +1 -0
- package/dist/components/bc-phone-validate-pin-form.d.ts +11 -0
- package/dist/components/bc-phone-validate-pin-form.js +8 -0
- package/dist/components/bc-phone-validate-pin-form.js.map +1 -0
- package/dist/components/bc-wake-crmbonus.d.ts +11 -0
- package/dist/components/bc-wake-crmbonus.js +74 -0
- package/dist/components/bc-wake-crmbonus.js.map +1 -0
- package/dist/components/container-empty.js +2 -2
- package/dist/components/container-empty.js.map +1 -1
- package/dist/components/countdown-timer-v2.js +2 -2
- package/dist/components/countdown-timer-v2.js.map +1 -1
- package/dist/components/countdown-timer.js +1 -1
- package/dist/components/crm-bonus-note.js +8 -7
- package/dist/components/crm-bonus-note.js.map +1 -1
- package/dist/components/crm-bonus.js +41 -18
- package/dist/components/crm-bonus.js.map +1 -1
- package/dist/components/crm-button.js +1 -1
- package/dist/components/crm-giftback-form.js +1 -1
- package/dist/components/crm-tooltip.js +1 -1
- package/dist/components/giftback-info.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/loading-container.js +1 -1
- package/dist/components/loading-spinner.js +1 -1
- package/dist/components/p-06d73541.js +80 -0
- package/dist/components/p-06d73541.js.map +1 -0
- package/dist/components/p-09f86f1d.js +106 -0
- package/dist/components/p-09f86f1d.js.map +1 -0
- package/dist/components/p-1b441909.js.map +1 -1
- package/dist/components/p-2362455d.js +195 -0
- package/dist/components/p-2362455d.js.map +1 -0
- package/dist/components/p-2fac7f5e.js +78 -0
- package/dist/components/p-2fac7f5e.js.map +1 -0
- package/dist/components/{p-786485b2.js → p-39bd2459.js} +3 -3
- package/dist/components/p-39bd2459.js.map +1 -0
- package/dist/components/{p-144c34f6.js → p-496bc4af.js} +17 -16
- package/dist/components/p-496bc4af.js.map +1 -0
- package/dist/{esm/cart.helper-8c8d4a0a.js → components/p-60787be2.js} +25 -117
- package/dist/components/p-60787be2.js.map +1 -0
- package/dist/components/{p-0a7ccd8c.js → p-6aa17c2b.js} +6 -6
- package/dist/components/p-6aa17c2b.js.map +1 -0
- package/dist/components/{p-c250687d.js → p-80a69118.js} +4 -4
- package/dist/components/p-80a69118.js.map +1 -0
- package/dist/components/p-81e4e697.js +1298 -0
- package/dist/components/p-81e4e697.js.map +1 -0
- package/dist/components/{p-2cece106.js → p-8f45d088.js} +3 -3
- package/dist/components/p-8f45d088.js.map +1 -0
- package/dist/components/{p-9b5c07d8.js → p-9231dc5e.js} +4 -4
- package/dist/components/p-9231dc5e.js.map +1 -0
- package/dist/components/{p-3c8ae82e.js → p-ade5e41e.js} +11 -10
- package/dist/components/p-ade5e41e.js.map +1 -0
- package/dist/components/p-af3ba015.js.map +1 -1
- package/dist/components/{p-e6863cf5.js → p-bf1d624e.js} +6 -6
- package/dist/components/p-bf1d624e.js.map +1 -0
- package/dist/components/{p-8274e2c4.js → p-c1522ad8.js} +3 -3
- package/dist/components/p-c1522ad8.js.map +1 -0
- package/dist/components/p-c53241bf.js.map +1 -1
- package/dist/components/{p-11520f0f.js → p-eabf185c.js} +3 -3
- package/dist/components/p-eabf185c.js.map +1 -0
- package/dist/components/p-ecc51430.js.map +1 -1
- package/dist/components/{p-9d950d25.js → p-f58c9cb2.js} +2 -2
- package/dist/components/p-f58c9cb2.js.map +1 -0
- package/dist/components/pedido-finalizado.js +5 -4
- package/dist/components/pedido-finalizado.js.map +1 -1
- package/dist/components/phone-form.js +1 -1
- package/dist/components/phone-input-mask.js +1 -1
- package/dist/components/pin-form.js +1 -1
- package/dist/crmbonus-component-wake/assets/logo.svg +17 -17
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -1
- package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js.map +1 -1
- package/dist/crmbonus-component-wake/{p-ac027576.entry.js → p-06d494c4.entry.js} +2 -2
- package/dist/crmbonus-component-wake/p-06d494c4.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/{p-8c362346.js → p-19848de4.js} +2 -2
- package/dist/crmbonus-component-wake/p-19848de4.js.map +1 -0
- package/dist/crmbonus-component-wake/p-20d0467e.js +2 -0
- package/dist/crmbonus-component-wake/p-20d0467e.js.map +1 -0
- package/dist/crmbonus-component-wake/p-2362455d.js +2 -0
- package/dist/crmbonus-component-wake/p-2362455d.js.map +1 -0
- package/dist/crmbonus-component-wake/p-2dd97532.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-2dd97532.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-3e02757c.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-3e02757c.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-4cbebe64.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-4cbebe64.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/{p-0d09c221.js → p-60787be2.js} +2 -2
- package/dist/crmbonus-component-wake/p-60787be2.js.map +1 -0
- package/dist/crmbonus-component-wake/p-6e7c09cd.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-6e7c09cd.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-9b556ee6.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-9b556ee6.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-af3ba015.js.map +1 -1
- package/dist/crmbonus-component-wake/p-b435da9a.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-b435da9a.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-c53241bf.js +2 -0
- package/dist/crmbonus-component-wake/p-c53241bf.js.map +1 -0
- package/dist/crmbonus-component-wake/p-c533ea8b.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-c533ea8b.entry.js.map +1 -0
- package/dist/crmbonus-component-wake/p-c7d03986.entry.js +2 -0
- package/dist/crmbonus-component-wake/p-c7d03986.entry.js.map +1 -0
- package/dist/env.js +2 -2
- package/dist/env.js.map +1 -1
- package/dist/esm/app-modal.entry.js +2 -2
- package/dist/esm/app-modal.entry.js.map +1 -1
- package/dist/esm/bc-crmbonus.entry.js +24 -0
- package/dist/esm/bc-crmbonus.entry.js.map +1 -0
- package/dist/esm/bc-phone-form_2.entry.js +328 -0
- package/dist/esm/bc-phone-form_2.entry.js.map +1 -0
- package/dist/esm/bc-wake-crmbonus.entry.js +14 -0
- package/dist/esm/bc-wake-crmbonus.entry.js.map +1 -0
- package/dist/esm/cart.helper-22ecdec9.js +195 -0
- package/dist/esm/cart.helper-22ecdec9.js.map +1 -0
- package/dist/esm/container-empty.entry.js +2 -2
- package/dist/esm/container-empty.entry.js.map +1 -1
- package/dist/esm/countdown-timer-v2.entry.js +2 -2
- package/dist/esm/countdown-timer-v2.entry.js.map +1 -1
- package/dist/esm/countdown-timer_11.entry.js +52 -28
- package/dist/esm/countdown-timer_11.entry.js.map +1 -1
- package/dist/esm/crm-bonus-note.entry.js +9 -7
- package/dist/esm/crm-bonus-note.entry.js.map +1 -1
- package/dist/esm/crmbonus-component-wake.js +3 -3
- package/dist/{cjs/cart.helper-31ba8997.js → esm/crmbonus.service-d83e6bb6.js} +25 -125
- package/dist/esm/crmbonus.service-d83e6bb6.js.map +1 -0
- package/dist/{cjs/info.config.helper-d4b1291b.js → esm/i18n-b9d8b0cc.js} +2 -36
- package/dist/esm/i18n-b9d8b0cc.js.map +1 -0
- package/dist/esm/{index-bdb70d5a.js → index-09314622.js} +16 -2
- package/dist/esm/index-09314622.js.map +1 -0
- package/dist/esm/info.config.helper-156cb9b2.js +32 -0
- package/dist/esm/info.config.helper-156cb9b2.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/pedido-finalizado.entry.js +5 -4
- package/dist/esm/pedido-finalizado.entry.js.map +1 -1
- package/dist/esm/utils-dec6df66.js.map +1 -1
- package/dist/store.js +25 -0
- package/dist/store.js.map +1 -0
- package/dist/types/components/crmbonus/crmbonus.d.ts +9 -0
- package/dist/types/components/crmbonus/subcomponents/phone-form/index.d.ts +13 -0
- package/dist/types/components/crmbonus/subcomponents/phone-validate/index.d.ts +17 -0
- package/dist/types/components.d.ts +76 -0
- package/dist/types/dto/checkout.dto.d.ts +8 -0
- package/dist/types/dto/pin.sent.d.ts +3 -0
- package/dist/types/dto/validate.pin.bonus.d.ts +9 -0
- package/dist/types/helpers/cart.helper.d.ts +1 -0
- package/dist/types/home/darlison/Projects/Bycoders/crmbonus/crmbonus-component/.stencil/env.d.ts +2 -0
- package/dist/types/home/darlison/Projects/Bycoders/crmbonus/crmbonus-component/.stencil/store.d.ts +11 -0
- package/dist/types/objectvalues/cart.wake.d.ts +2 -1
- package/dist/types/platforms/wake/index.d.ts +3 -0
- package/dist/types/services/crmbonus.service.d.ts +4 -2
- package/package.json +59 -58
- package/readme.md +114 -114
- package/dist/cjs/cart.helper-31ba8997.js.map +0 -1
- package/dist/cjs/index-a7537457.js.map +0 -1
- package/dist/cjs/info.config.helper-d4b1291b.js.map +0 -1
- package/dist/components/p-0a7ccd8c.js.map +0 -1
- package/dist/components/p-0d09c221.js.map +0 -1
- package/dist/components/p-11520f0f.js.map +0 -1
- package/dist/components/p-144c34f6.js.map +0 -1
- package/dist/components/p-2cece106.js.map +0 -1
- package/dist/components/p-3c8ae82e.js.map +0 -1
- package/dist/components/p-786485b2.js.map +0 -1
- package/dist/components/p-8274e2c4.js.map +0 -1
- package/dist/components/p-9b5c07d8.js.map +0 -1
- package/dist/components/p-9d950d25.js.map +0 -1
- package/dist/components/p-c250687d.js.map +0 -1
- package/dist/components/p-e6863cf5.js.map +0 -1
- package/dist/crmbonus-component-wake/p-0d09c221.js.map +0 -1
- package/dist/crmbonus-component-wake/p-1644deef.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-1644deef.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-3ceb1dad.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-3ceb1dad.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-7e52727e.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-7e52727e.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-8c362346.js.map +0 -1
- package/dist/crmbonus-component-wake/p-ac027576.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-ac1e7c32.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-ac1e7c32.entry.js.map +0 -1
- package/dist/crmbonus-component-wake/p-b4f52f79.js +0 -2
- package/dist/crmbonus-component-wake/p-b4f52f79.js.map +0 -1
- package/dist/crmbonus-component-wake/p-df80d1b0.entry.js +0 -2
- package/dist/crmbonus-component-wake/p-df80d1b0.entry.js.map +0 -1
- package/dist/esm/cart.helper-8c8d4a0a.js.map +0 -1
- package/dist/esm/index-bdb70d5a.js.map +0 -1
- package/dist/esm/info.config.helper-e4b8c478.js.map +0 -1
- package/dist/types/Users/Darlison/Projects/Bycoders/crmbonus/crmbonus-component/.stencil/env.d.ts +0 -2
package/dist/store.js
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
import { createStore } from "@stencil/store";
|
2
|
+
const { state, onChange } = createStore({
|
3
|
+
storeConfig: {
|
4
|
+
btnApplyBonusLabel: 'Avançar',
|
5
|
+
confirmationMessage: '',
|
6
|
+
giftbackTitle: 'giftback',
|
7
|
+
keepStoreFrontStyle: false
|
8
|
+
},
|
9
|
+
checkout: {
|
10
|
+
cellphone: null,
|
11
|
+
checkoutId: '',
|
12
|
+
checkoutProducts: [],
|
13
|
+
crmbonuStoreId: null,
|
14
|
+
crmbonusUserId: null,
|
15
|
+
storeName: ''
|
16
|
+
},
|
17
|
+
clicks: 0,
|
18
|
+
seconds: 0,
|
19
|
+
squaredClicks: 0
|
20
|
+
});
|
21
|
+
onChange('clicks', value => {
|
22
|
+
state.squaredClicks = value ** 2;
|
23
|
+
});
|
24
|
+
export default state;
|
25
|
+
//# sourceMappingURL=store.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAc7C,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,WAAW,CAAiB;IACtD,WAAW,EAAE;QACX,kBAAkB,EAAE,SAAS;QAC7B,mBAAmB,EAAE,EAAE;QACvB,aAAa,EAAE,UAAU;QACzB,mBAAmB,EAAE,KAAK;KAC3B;IACD,QAAQ,EAAE;QACR,SAAS,EAAE,IAAI;QACf,UAAU,EAAE,EAAE;QACd,gBAAgB,EAAE,EAAE;QACpB,cAAc,EAAE,IAAI;QACpB,cAAc,EAAE,IAAI;QACpB,SAAS,EAAE,EAAE;KACd;IACD,MAAM,EAAE,CAAC;IACT,OAAO,EAAE,CAAC;IACV,aAAa,EAAE,CAAC;CACjB,CAAC,CAAC;AAEH,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE;IACzB,KAAK,CAAC,aAAa,GAAG,KAAK,IAAI,CAAC,CAAC;AACnC,CAAC,CAAC,CAAC;AAEH,eAAe,KAAK,CAAC","sourcesContent":["import { createStore } from \"@stencil/store\";\n\nimport { IInfoStore } from \"./src/helpers/info.config.helper\";\nimport { ICheckoutDTO } from \"./src/dto/checkout.dto\";\n\n\ninterface IStoreCheckout {\n clicks: number;\n squaredClicks: number;\n seconds: number;\n storeConfig: IInfoStore;\n checkout: ICheckoutDTO;\n}\n\nconst { state, onChange } = createStore<IStoreCheckout>({\n storeConfig: {\n btnApplyBonusLabel: 'Avançar',\n confirmationMessage: '',\n giftbackTitle: 'giftback',\n keepStoreFrontStyle: false\n },\n checkout: {\n cellphone: null,\n checkoutId: '',\n checkoutProducts: [],\n crmbonuStoreId: null,\n crmbonusUserId: null,\n storeName: ''\n },\n clicks: 0,\n seconds: 0,\n squaredClicks: 0\n});\n\nonChange('clicks', value => {\n state.squaredClicks = value ** 2;\n});\n\nexport default state;"]}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { EventEmitter } from "../../../../stencil-public-runtime";
|
2
|
+
import { CrmBonusService } from "../../../../services/crmbonus.service";
|
3
|
+
export declare class PhoneForm {
|
4
|
+
private phoneInputMask;
|
5
|
+
crmbonusService: CrmBonusService;
|
6
|
+
loading: boolean;
|
7
|
+
storeName: string;
|
8
|
+
actionError: EventEmitter<Partial<{
|
9
|
+
message: string;
|
10
|
+
}>>;
|
11
|
+
handlerPhone(): Promise<void>;
|
12
|
+
render(): any;
|
13
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { CrmBonusService } from "../../../../services/crmbonus.service";
|
2
|
+
export declare class PhoneValidatePinForm {
|
3
|
+
crmbonusService: CrmBonusService;
|
4
|
+
storeName: string;
|
5
|
+
phone: number;
|
6
|
+
cancel: () => void;
|
7
|
+
pin: string[];
|
8
|
+
isVerified: boolean;
|
9
|
+
canResend: boolean;
|
10
|
+
loading: boolean;
|
11
|
+
handleInput(event: Event, index: number): void;
|
12
|
+
handleResend(): Promise<void>;
|
13
|
+
buildTime(): string;
|
14
|
+
handleTimeout(): void;
|
15
|
+
validatePin(): void;
|
16
|
+
render(): any;
|
17
|
+
}
|
@@ -20,6 +20,18 @@ export namespace Components {
|
|
20
20
|
"isOpen": boolean;
|
21
21
|
"modalTitle": string;
|
22
22
|
}
|
23
|
+
interface BcCrmbonus {
|
24
|
+
}
|
25
|
+
interface BcPhoneForm {
|
26
|
+
"storeName": string;
|
27
|
+
}
|
28
|
+
interface BcPhoneValidatePinForm {
|
29
|
+
"cancel": () => void;
|
30
|
+
"phone": number;
|
31
|
+
"storeName": string;
|
32
|
+
}
|
33
|
+
interface BcWakeCrmbonus {
|
34
|
+
}
|
23
35
|
interface ContainerEmpty {
|
24
36
|
}
|
25
37
|
interface CountdownTimer {
|
@@ -110,6 +122,10 @@ export interface AppModalCustomEvent<T> extends CustomEvent<T> {
|
|
110
122
|
detail: T;
|
111
123
|
target: HTMLAppModalElement;
|
112
124
|
}
|
125
|
+
export interface BcPhoneFormCustomEvent<T> extends CustomEvent<T> {
|
126
|
+
detail: T;
|
127
|
+
target: HTMLBcPhoneFormElement;
|
128
|
+
}
|
113
129
|
declare global {
|
114
130
|
interface HTMLAppModalElementEventMap {
|
115
131
|
"modalClosed": void;
|
@@ -128,6 +144,41 @@ declare global {
|
|
128
144
|
prototype: HTMLAppModalElement;
|
129
145
|
new (): HTMLAppModalElement;
|
130
146
|
};
|
147
|
+
interface HTMLBcCrmbonusElement extends Components.BcCrmbonus, HTMLStencilElement {
|
148
|
+
}
|
149
|
+
var HTMLBcCrmbonusElement: {
|
150
|
+
prototype: HTMLBcCrmbonusElement;
|
151
|
+
new (): HTMLBcCrmbonusElement;
|
152
|
+
};
|
153
|
+
interface HTMLBcPhoneFormElementEventMap {
|
154
|
+
"actionError": Partial<{ message: string }>;
|
155
|
+
}
|
156
|
+
interface HTMLBcPhoneFormElement extends Components.BcPhoneForm, HTMLStencilElement {
|
157
|
+
addEventListener<K extends keyof HTMLBcPhoneFormElementEventMap>(type: K, listener: (this: HTMLBcPhoneFormElement, ev: BcPhoneFormCustomEvent<HTMLBcPhoneFormElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
158
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
159
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
160
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
161
|
+
removeEventListener<K extends keyof HTMLBcPhoneFormElementEventMap>(type: K, listener: (this: HTMLBcPhoneFormElement, ev: BcPhoneFormCustomEvent<HTMLBcPhoneFormElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
162
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
163
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
164
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
165
|
+
}
|
166
|
+
var HTMLBcPhoneFormElement: {
|
167
|
+
prototype: HTMLBcPhoneFormElement;
|
168
|
+
new (): HTMLBcPhoneFormElement;
|
169
|
+
};
|
170
|
+
interface HTMLBcPhoneValidatePinFormElement extends Components.BcPhoneValidatePinForm, HTMLStencilElement {
|
171
|
+
}
|
172
|
+
var HTMLBcPhoneValidatePinFormElement: {
|
173
|
+
prototype: HTMLBcPhoneValidatePinFormElement;
|
174
|
+
new (): HTMLBcPhoneValidatePinFormElement;
|
175
|
+
};
|
176
|
+
interface HTMLBcWakeCrmbonusElement extends Components.BcWakeCrmbonus, HTMLStencilElement {
|
177
|
+
}
|
178
|
+
var HTMLBcWakeCrmbonusElement: {
|
179
|
+
prototype: HTMLBcWakeCrmbonusElement;
|
180
|
+
new (): HTMLBcWakeCrmbonusElement;
|
181
|
+
};
|
131
182
|
interface HTMLContainerEmptyElement extends Components.ContainerEmpty, HTMLStencilElement {
|
132
183
|
}
|
133
184
|
var HTMLContainerEmptyElement: {
|
@@ -220,6 +271,10 @@ declare global {
|
|
220
271
|
};
|
221
272
|
interface HTMLElementTagNameMap {
|
222
273
|
"app-modal": HTMLAppModalElement;
|
274
|
+
"bc-crmbonus": HTMLBcCrmbonusElement;
|
275
|
+
"bc-phone-form": HTMLBcPhoneFormElement;
|
276
|
+
"bc-phone-validate-pin-form": HTMLBcPhoneValidatePinFormElement;
|
277
|
+
"bc-wake-crmbonus": HTMLBcWakeCrmbonusElement;
|
223
278
|
"container-empty": HTMLContainerEmptyElement;
|
224
279
|
"countdown-timer": HTMLCountdownTimerElement;
|
225
280
|
"countdown-timer-v2": HTMLCountdownTimerV2Element;
|
@@ -243,6 +298,19 @@ declare namespace LocalJSX {
|
|
243
298
|
"modalTitle"?: string;
|
244
299
|
"onModalClosed"?: (event: AppModalCustomEvent<void>) => void;
|
245
300
|
}
|
301
|
+
interface BcCrmbonus {
|
302
|
+
}
|
303
|
+
interface BcPhoneForm {
|
304
|
+
"onActionError"?: (event: BcPhoneFormCustomEvent<Partial<{ message: string }>>) => void;
|
305
|
+
"storeName"?: string;
|
306
|
+
}
|
307
|
+
interface BcPhoneValidatePinForm {
|
308
|
+
"cancel"?: () => void;
|
309
|
+
"phone"?: number;
|
310
|
+
"storeName"?: string;
|
311
|
+
}
|
312
|
+
interface BcWakeCrmbonus {
|
313
|
+
}
|
246
314
|
interface ContainerEmpty {
|
247
315
|
}
|
248
316
|
interface CountdownTimer {
|
@@ -324,6 +392,10 @@ declare namespace LocalJSX {
|
|
324
392
|
}
|
325
393
|
interface IntrinsicElements {
|
326
394
|
"app-modal": AppModal;
|
395
|
+
"bc-crmbonus": BcCrmbonus;
|
396
|
+
"bc-phone-form": BcPhoneForm;
|
397
|
+
"bc-phone-validate-pin-form": BcPhoneValidatePinForm;
|
398
|
+
"bc-wake-crmbonus": BcWakeCrmbonus;
|
327
399
|
"container-empty": ContainerEmpty;
|
328
400
|
"countdown-timer": CountdownTimer;
|
329
401
|
"countdown-timer-v2": CountdownTimerV2;
|
@@ -346,6 +418,10 @@ declare module "@stencil/core" {
|
|
346
418
|
export namespace JSX {
|
347
419
|
interface IntrinsicElements {
|
348
420
|
"app-modal": LocalJSX.AppModal & JSXBase.HTMLAttributes<HTMLAppModalElement>;
|
421
|
+
"bc-crmbonus": LocalJSX.BcCrmbonus & JSXBase.HTMLAttributes<HTMLBcCrmbonusElement>;
|
422
|
+
"bc-phone-form": LocalJSX.BcPhoneForm & JSXBase.HTMLAttributes<HTMLBcPhoneFormElement>;
|
423
|
+
"bc-phone-validate-pin-form": LocalJSX.BcPhoneValidatePinForm & JSXBase.HTMLAttributes<HTMLBcPhoneValidatePinFormElement>;
|
424
|
+
"bc-wake-crmbonus": LocalJSX.BcWakeCrmbonus & JSXBase.HTMLAttributes<HTMLBcWakeCrmbonusElement>;
|
349
425
|
"container-empty": LocalJSX.ContainerEmpty & JSXBase.HTMLAttributes<HTMLContainerEmptyElement>;
|
350
426
|
"countdown-timer": LocalJSX.CountdownTimer & JSXBase.HTMLAttributes<HTMLCountdownTimerElement>;
|
351
427
|
"countdown-timer-v2": LocalJSX.CountdownTimerV2 & JSXBase.HTMLAttributes<HTMLCountdownTimerV2Element>;
|
@@ -47,6 +47,15 @@ export interface IProccesPinBonusDto {
|
|
47
47
|
cellphone: number;
|
48
48
|
pin: string;
|
49
49
|
}
|
50
|
+
export interface IProccesPinDto {
|
51
|
+
storeName: string;
|
52
|
+
name: string;
|
53
|
+
checkoutId: string;
|
54
|
+
storeId: string;
|
55
|
+
userId: string;
|
56
|
+
cellphone: number;
|
57
|
+
pin: string;
|
58
|
+
}
|
50
59
|
export interface IBonus {
|
51
60
|
hasBonus: boolean;
|
52
61
|
bonusBalance: number;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { CartWake } from "../objectvalues/cart.wake";
|
2
2
|
import { ReservedInfoDTO } from '../dto/reserved-info.dto';
|
3
|
+
export declare const getCartStoreFront: () => Promise<CartWake>;
|
3
4
|
export declare const getCart: () => Promise<CartWake>;
|
4
5
|
export declare const getInfoBonusByCartIdAndStoreName: (cartId: any, storeName: any) => Promise<ReservedInfoDTO>;
|
5
6
|
export declare const persisteMetadata: (storeName: string, cartId: string, metadata?: {}) => Promise<void>;
|
package/dist/types/home/darlison/Projects/Bycoders/crmbonus/crmbonus-component/.stencil/store.d.ts
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
import { IInfoStore } from "./src/helpers/info.config.helper";
|
2
|
+
import { ICheckoutDTO } from "./src/dto/checkout.dto";
|
3
|
+
interface IStoreCheckout {
|
4
|
+
clicks: number;
|
5
|
+
squaredClicks: number;
|
6
|
+
seconds: number;
|
7
|
+
storeConfig: IInfoStore;
|
8
|
+
checkout: ICheckoutDTO;
|
9
|
+
}
|
10
|
+
declare const state: IStoreCheckout;
|
11
|
+
export default state;
|
@@ -6,7 +6,8 @@ export declare class CartWake {
|
|
6
6
|
products: IProductWake[];
|
7
7
|
user: IUser;
|
8
8
|
store: IStore;
|
9
|
-
|
9
|
+
static fromCheckout(cart: any): CartWake;
|
10
|
+
static fromCheckoutStoreFront(checkoutInfo: any): CartWake;
|
10
11
|
private buildUserInfo;
|
11
12
|
private buildStoreInfo;
|
12
13
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { IPinSent } from '../dto/pin.sent';
|
2
|
-
import { IBonus, IProccesPinBonusDto, IReserveDTO } from '../dto/validate.pin.bonus';
|
2
|
+
import { IBonus, IProccesPinBonusDto, IProccesPinDto, IReserveDTO } from '../dto/validate.pin.bonus';
|
3
3
|
import { UpdateOrderDTO } from '../dto/update.order.dto';
|
4
4
|
import { IPersisteInfoPayload } from '../helpers/payload.interface';
|
5
5
|
export declare class CrmBonusService {
|
@@ -10,11 +10,13 @@ export declare class CrmBonusService {
|
|
10
10
|
static getInstance(): CrmBonusService;
|
11
11
|
getCustomer(userId: number, store: string): Promise<any>;
|
12
12
|
updateOrder(updateOrderDTO: UpdateOrderDTO): Promise<void>;
|
13
|
-
sendPin(phone: number, name: string,
|
13
|
+
sendPin(phone: number, name: string, storeName: string): Promise<IPinSent>;
|
14
14
|
validatePinBonus(payload: IProccesPinBonusDto): Promise<IBonus>;
|
15
|
+
validatePin(payload: IProccesPinDto): Promise<IBonus>;
|
15
16
|
reserve(payload: IReserveDTO): Promise<any>;
|
16
17
|
cancel(cartId: string): Promise<any>;
|
17
18
|
getToken(store: string): Promise<string>;
|
19
|
+
saveTracking(checkoutId: string, payload: any): Promise<void>;
|
18
20
|
getCustomization(storeName: string): Promise<any>;
|
19
21
|
cancelBonus(cartId: string, storeName: string): Promise<void>;
|
20
22
|
getInfoBonus(cartId: string, storeName: string): Promise<any>;
|
package/package.json
CHANGED
@@ -1,58 +1,59 @@
|
|
1
|
-
{
|
2
|
-
"name": "crmbonus-component-wake",
|
3
|
-
"version": "2.1.
|
4
|
-
"description": "Stencil Component Starter",
|
5
|
-
"main": "dist/index.cjs.js",
|
6
|
-
"module": "dist/index.js",
|
7
|
-
"types": "dist/types/index.d.ts",
|
8
|
-
"collection": "dist/collection/collection-manifest.json",
|
9
|
-
"collection:main": "dist/collection/index.js",
|
10
|
-
"unpkg": "dist/crmbonus-component-wake/crmbonus-component-wake.esm.js",
|
11
|
-
"exports": {
|
12
|
-
".": {
|
13
|
-
"import": "./dist/crmbonus-component-wake/crmbonus-component-wake.esm.js",
|
14
|
-
"require": "./dist/crmbonus-component-wake/crmbonus-component-wake.cjs.js"
|
15
|
-
},
|
16
|
-
"./my-component": {
|
17
|
-
"import": "./dist/components/my-component.js",
|
18
|
-
"types": "./dist/components/my-component.d.ts"
|
19
|
-
},
|
20
|
-
"./loader": {
|
21
|
-
"import": "./loader/index.js",
|
22
|
-
"require": "./loader/index.cjs",
|
23
|
-
"types": "./loader/index.d.ts"
|
24
|
-
}
|
25
|
-
},
|
26
|
-
"repository": {
|
27
|
-
"type": "git",
|
28
|
-
"url": "https://github.com/ionic-team/stencil-component-starter.git"
|
29
|
-
},
|
30
|
-
"files": [
|
31
|
-
"dist/",
|
32
|
-
"loader/"
|
33
|
-
],
|
34
|
-
"scripts": {
|
35
|
-
"build": "stencil build",
|
36
|
-
"start": "stencil build --dev --watch --serve",
|
37
|
-
"dev": "concurrently \"npm run mock\" \"stencil build --dev --watch --serve\"",
|
38
|
-
"test": "stencil test --spec --e2e",
|
39
|
-
"test.watch": "stencil test --spec --e2e --watchAll",
|
40
|
-
"generate": "stencil generate",
|
41
|
-
"mock": "json-server --watch local-server/db.json --routes local-server/routes.json --port 3001"
|
42
|
-
},
|
43
|
-
"devDependencies": {
|
44
|
-
"@stencil/core": "^4.7.0",
|
45
|
-
"@
|
46
|
-
"@types/
|
47
|
-
"
|
48
|
-
"
|
49
|
-
"jest
|
50
|
-
"
|
51
|
-
"
|
52
|
-
|
53
|
-
|
54
|
-
"
|
55
|
-
|
56
|
-
"
|
57
|
-
|
58
|
-
}
|
1
|
+
{
|
2
|
+
"name": "crmbonus-component-wake",
|
3
|
+
"version": "2.1.41-shoulder",
|
4
|
+
"description": "Stencil Component Starter",
|
5
|
+
"main": "dist/index.cjs.js",
|
6
|
+
"module": "dist/index.js",
|
7
|
+
"types": "dist/types/index.d.ts",
|
8
|
+
"collection": "dist/collection/collection-manifest.json",
|
9
|
+
"collection:main": "dist/collection/index.js",
|
10
|
+
"unpkg": "dist/crmbonus-component-wake/crmbonus-component-wake.esm.js",
|
11
|
+
"exports": {
|
12
|
+
".": {
|
13
|
+
"import": "./dist/crmbonus-component-wake/crmbonus-component-wake.esm.js",
|
14
|
+
"require": "./dist/crmbonus-component-wake/crmbonus-component-wake.cjs.js"
|
15
|
+
},
|
16
|
+
"./my-component": {
|
17
|
+
"import": "./dist/components/my-component.js",
|
18
|
+
"types": "./dist/components/my-component.d.ts"
|
19
|
+
},
|
20
|
+
"./loader": {
|
21
|
+
"import": "./loader/index.js",
|
22
|
+
"require": "./loader/index.cjs",
|
23
|
+
"types": "./loader/index.d.ts"
|
24
|
+
}
|
25
|
+
},
|
26
|
+
"repository": {
|
27
|
+
"type": "git",
|
28
|
+
"url": "https://github.com/ionic-team/stencil-component-starter.git"
|
29
|
+
},
|
30
|
+
"files": [
|
31
|
+
"dist/",
|
32
|
+
"loader/"
|
33
|
+
],
|
34
|
+
"scripts": {
|
35
|
+
"build": "stencil build",
|
36
|
+
"start": "stencil build --dev --watch --serve",
|
37
|
+
"dev": "concurrently \"npm run mock\" \"stencil build --dev --watch --serve\"",
|
38
|
+
"test": "stencil test --spec --e2e",
|
39
|
+
"test.watch": "stencil test --spec --e2e --watchAll",
|
40
|
+
"generate": "stencil generate",
|
41
|
+
"mock": "json-server --watch local-server/db.json --routes local-server/routes.json --port 3001"
|
42
|
+
},
|
43
|
+
"devDependencies": {
|
44
|
+
"@stencil/core": "^4.7.0",
|
45
|
+
"@stencil/store": "^2.2.0",
|
46
|
+
"@types/jest": "^29.5.6",
|
47
|
+
"@types/node": "^16.18.11",
|
48
|
+
"concurrently": "^9.1.2",
|
49
|
+
"jest": "^29.7.0",
|
50
|
+
"jest-cli": "^29.7.0",
|
51
|
+
"json-server": "0.17.0",
|
52
|
+
"puppeteer": "^21.9.0"
|
53
|
+
},
|
54
|
+
"license": "MIT",
|
55
|
+
"dependencies": {
|
56
|
+
"axios": "^1.7.7",
|
57
|
+
"i18next": "^24.0.5"
|
58
|
+
}
|
59
|
+
}
|
package/readme.md
CHANGED
@@ -1,115 +1,115 @@
|
|
1
|
-
[](https://stenciljs.com)
|
2
|
-
|
3
|
-
# Stencil Component Starter
|
4
|
-
|
5
|
-
This is a starter project for building a standalone Web Component using Stencil.
|
6
|
-
|
7
|
-
Stencil is also great for building entire apps. For that, use the [stencil-app-starter](https://github.com/ionic-team/stencil-app-starter) instead.
|
8
|
-
|
9
|
-
# Stencil
|
10
|
-
|
11
|
-
Stencil is a compiler for building fast web apps using Web Components.
|
12
|
-
|
13
|
-
Stencil combines the best concepts of the most popular frontend frameworks into a compile-time rather than runtime tool. Stencil takes TypeScript, JSX, a tiny virtual DOM layer, efficient one-way data binding, an asynchronous rendering pipeline (similar to React Fiber), and lazy-loading out of the box, and generates 100% standards-based Web Components that run in any browser supporting the Custom Elements v1 spec.
|
14
|
-
|
15
|
-
Stencil components are just Web Components, so they work in any major framework or with no framework at all.
|
16
|
-
|
17
|
-
## Getting Started
|
18
|
-
|
19
|
-
To start building a new web component using Stencil, clone this repo to a new directory:
|
20
|
-
|
21
|
-
```bash
|
22
|
-
git clone https://github.com/ionic-team/stencil-component-starter.git my-component
|
23
|
-
cd my-component
|
24
|
-
git remote rm origin
|
25
|
-
```
|
26
|
-
|
27
|
-
and run:
|
28
|
-
|
29
|
-
```bash
|
30
|
-
npm install
|
31
|
-
npm start
|
32
|
-
```
|
33
|
-
|
34
|
-
To build the component for production, run:
|
35
|
-
|
36
|
-
```bash
|
37
|
-
npm run build
|
38
|
-
```
|
39
|
-
|
40
|
-
To run the unit tests for the components, run:
|
41
|
-
|
42
|
-
```bash
|
43
|
-
npm test
|
44
|
-
```
|
45
|
-
|
46
|
-
Need help? Check out our docs [here](https://stenciljs.com/docs/my-first-component).
|
47
|
-
|
48
|
-
## Naming Components
|
49
|
-
|
50
|
-
When creating new component tags, we recommend _not_ using `stencil` in the component name (ex: `<stencil-datepicker>`). This is because the generated component has little to nothing to do with Stencil; it's just a web component!
|
51
|
-
|
52
|
-
Instead, use a prefix that fits your company or any name for a group of related components. For example, all of the Ionic-generated web components use the prefix `ion`.
|
53
|
-
|
54
|
-
## Using this component
|
55
|
-
|
56
|
-
There are two strategies we recommend for using web components built with Stencil.
|
57
|
-
|
58
|
-
The first step for all two of these strategies is to [publish to NPM](https://docs.npmjs.com/getting-started/publishing-npm-packages).
|
59
|
-
|
60
|
-
You can read more about these different approaches in the [Stencil docs](https://stenciljs.com/docs/publishing).
|
61
|
-
|
62
|
-
### Lazy Loading
|
63
|
-
|
64
|
-
If your Stencil project is built with the [`dist`](https://stenciljs.com/docs/distribution) output target, you can import a small bootstrap script that registers all components and allows you to load individual component scripts lazily.
|
65
|
-
|
66
|
-
For example, given your Stencil project namespace is called `my-design-system`, to use `my-component` on any website, inject this into your HTML:
|
67
|
-
|
68
|
-
```html
|
69
|
-
<script type="module" src="https://unpkg.com/my-design-system"></script>
|
70
|
-
<!--
|
71
|
-
To avoid unpkg.com redirects to the actual file, you can also directly import:
|
72
|
-
https://unpkg.com/foobar-design-system@0.0.1/dist/foobar-design-system/foobar-design-system.esm.js
|
73
|
-
-->
|
74
|
-
<my-component first="Stencil" middle="'Don't call me a framework'" last="JS"></my-component>
|
75
|
-
```
|
76
|
-
|
77
|
-
This will only load the necessary scripts needed to render `<my-component />`. Once more components of this package are used, they will automatically be loaded lazily.
|
78
|
-
|
79
|
-
You can also import the script as part of your `node_modules` in your applications entry file:
|
80
|
-
|
81
|
-
```tsx
|
82
|
-
import 'foobar-design-system/dist/foobar-design-system/foobar-design-system.esm.js';
|
83
|
-
```
|
84
|
-
|
85
|
-
Check out this [Live Demo](https://stackblitz.com/edit/vitejs-vite-y6v26a?file=src%2Fmain.tsx).
|
86
|
-
|
87
|
-
### Standalone
|
88
|
-
|
89
|
-
If you are using a Stencil component library with `dist-custom-elements`, we recommend importing Stencil components individually in those files where they are needed.
|
90
|
-
|
91
|
-
To export Stencil components as standalone components make sure you have the [`dist-custom-elements`](https://stenciljs.com/docs/custom-elements) output target defined in your `stencil.config.ts`.
|
92
|
-
|
93
|
-
For example, given you'd like to use `<my-component />` as part of a React component, you can import the component directly via:
|
94
|
-
|
95
|
-
```tsx
|
96
|
-
import 'foobar-design-system/my-component';
|
97
|
-
|
98
|
-
function App() {
|
99
|
-
return (
|
100
|
-
<>
|
101
|
-
<div>
|
102
|
-
<my-component
|
103
|
-
first="Stencil"
|
104
|
-
middle="'Don't call me a framework'"
|
105
|
-
last="JS"
|
106
|
-
></my-component>
|
107
|
-
</div>
|
108
|
-
</>
|
109
|
-
);
|
110
|
-
}
|
111
|
-
|
112
|
-
export default App;
|
113
|
-
```
|
114
|
-
|
1
|
+
[](https://stenciljs.com)
|
2
|
+
|
3
|
+
# Stencil Component Starter
|
4
|
+
|
5
|
+
This is a starter project for building a standalone Web Component using Stencil.
|
6
|
+
|
7
|
+
Stencil is also great for building entire apps. For that, use the [stencil-app-starter](https://github.com/ionic-team/stencil-app-starter) instead.
|
8
|
+
|
9
|
+
# Stencil
|
10
|
+
|
11
|
+
Stencil is a compiler for building fast web apps using Web Components.
|
12
|
+
|
13
|
+
Stencil combines the best concepts of the most popular frontend frameworks into a compile-time rather than runtime tool. Stencil takes TypeScript, JSX, a tiny virtual DOM layer, efficient one-way data binding, an asynchronous rendering pipeline (similar to React Fiber), and lazy-loading out of the box, and generates 100% standards-based Web Components that run in any browser supporting the Custom Elements v1 spec.
|
14
|
+
|
15
|
+
Stencil components are just Web Components, so they work in any major framework or with no framework at all.
|
16
|
+
|
17
|
+
## Getting Started
|
18
|
+
|
19
|
+
To start building a new web component using Stencil, clone this repo to a new directory:
|
20
|
+
|
21
|
+
```bash
|
22
|
+
git clone https://github.com/ionic-team/stencil-component-starter.git my-component
|
23
|
+
cd my-component
|
24
|
+
git remote rm origin
|
25
|
+
```
|
26
|
+
|
27
|
+
and run:
|
28
|
+
|
29
|
+
```bash
|
30
|
+
npm install
|
31
|
+
npm start
|
32
|
+
```
|
33
|
+
|
34
|
+
To build the component for production, run:
|
35
|
+
|
36
|
+
```bash
|
37
|
+
npm run build
|
38
|
+
```
|
39
|
+
|
40
|
+
To run the unit tests for the components, run:
|
41
|
+
|
42
|
+
```bash
|
43
|
+
npm test
|
44
|
+
```
|
45
|
+
|
46
|
+
Need help? Check out our docs [here](https://stenciljs.com/docs/my-first-component).
|
47
|
+
|
48
|
+
## Naming Components
|
49
|
+
|
50
|
+
When creating new component tags, we recommend _not_ using `stencil` in the component name (ex: `<stencil-datepicker>`). This is because the generated component has little to nothing to do with Stencil; it's just a web component!
|
51
|
+
|
52
|
+
Instead, use a prefix that fits your company or any name for a group of related components. For example, all of the Ionic-generated web components use the prefix `ion`.
|
53
|
+
|
54
|
+
## Using this component
|
55
|
+
|
56
|
+
There are two strategies we recommend for using web components built with Stencil.
|
57
|
+
|
58
|
+
The first step for all two of these strategies is to [publish to NPM](https://docs.npmjs.com/getting-started/publishing-npm-packages).
|
59
|
+
|
60
|
+
You can read more about these different approaches in the [Stencil docs](https://stenciljs.com/docs/publishing).
|
61
|
+
|
62
|
+
### Lazy Loading
|
63
|
+
|
64
|
+
If your Stencil project is built with the [`dist`](https://stenciljs.com/docs/distribution) output target, you can import a small bootstrap script that registers all components and allows you to load individual component scripts lazily.
|
65
|
+
|
66
|
+
For example, given your Stencil project namespace is called `my-design-system`, to use `my-component` on any website, inject this into your HTML:
|
67
|
+
|
68
|
+
```html
|
69
|
+
<script type="module" src="https://unpkg.com/my-design-system"></script>
|
70
|
+
<!--
|
71
|
+
To avoid unpkg.com redirects to the actual file, you can also directly import:
|
72
|
+
https://unpkg.com/foobar-design-system@0.0.1/dist/foobar-design-system/foobar-design-system.esm.js
|
73
|
+
-->
|
74
|
+
<my-component first="Stencil" middle="'Don't call me a framework'" last="JS"></my-component>
|
75
|
+
```
|
76
|
+
|
77
|
+
This will only load the necessary scripts needed to render `<my-component />`. Once more components of this package are used, they will automatically be loaded lazily.
|
78
|
+
|
79
|
+
You can also import the script as part of your `node_modules` in your applications entry file:
|
80
|
+
|
81
|
+
```tsx
|
82
|
+
import 'foobar-design-system/dist/foobar-design-system/foobar-design-system.esm.js';
|
83
|
+
```
|
84
|
+
|
85
|
+
Check out this [Live Demo](https://stackblitz.com/edit/vitejs-vite-y6v26a?file=src%2Fmain.tsx).
|
86
|
+
|
87
|
+
### Standalone
|
88
|
+
|
89
|
+
If you are using a Stencil component library with `dist-custom-elements`, we recommend importing Stencil components individually in those files where they are needed.
|
90
|
+
|
91
|
+
To export Stencil components as standalone components make sure you have the [`dist-custom-elements`](https://stenciljs.com/docs/custom-elements) output target defined in your `stencil.config.ts`.
|
92
|
+
|
93
|
+
For example, given you'd like to use `<my-component />` as part of a React component, you can import the component directly via:
|
94
|
+
|
95
|
+
```tsx
|
96
|
+
import 'foobar-design-system/my-component';
|
97
|
+
|
98
|
+
function App() {
|
99
|
+
return (
|
100
|
+
<>
|
101
|
+
<div>
|
102
|
+
<my-component
|
103
|
+
first="Stencil"
|
104
|
+
middle="'Don't call me a framework'"
|
105
|
+
last="JS"
|
106
|
+
></my-component>
|
107
|
+
</div>
|
108
|
+
</>
|
109
|
+
);
|
110
|
+
}
|
111
|
+
|
112
|
+
export default App;
|
113
|
+
```
|
114
|
+
|
115
115
|
Check out this [Live Demo](https://stackblitz.com/edit/vitejs-vite-b6zuds?file=src%2FApp.tsx).
|